diff --git a/.gitignore b/.gitignore index a9e18e31d..e24fe0bbb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,78 @@ target/ classes/ tools/eclipse/plugins/org.scribble.*/bin/ -*.jar .classpath .project .checkstyle .settings/ .DS_Store *~ +*.swp +*.bak +*.versionsBackup + +.idea +**/*.iml + +javadoc + + +## +#scribble-demos/scrib + +scribble-demos/scrib/Makefile +scribble-demos/scrib/tutorial/src/tutorial/adder/Adder/ +scribble-demos/scrib/betty16/src/betty16/lec1/httplong/HttpLong/ +scribble-demos/scrib/betty16/src/betty16/lec1/httpshort/HttpShort/ +scribble-demos/scrib/betty16/src/betty16/lec2/adder/Adder/ +scribble-demos/scrib/betty16/src/betty16/lec2/smtp/Smtp/ +scribble-demos/scrib/bettybook/src/bettybook/http/longv/HttpLong/ +scribble-demos/scrib/bettybook/src/bettybook/http/shortv/HttpShort/ +scribble-demos/scrib/bettybook/src/bettybook/math/scrib/Math/ +scribble-demos/scrib/coco/src/coco/fibo/Fibo/ +scribble-demos/scrib/coco/src/coco/smtp/Smtp/ +scribble-demos/scrib/fase16/src/fase16/adder/Adder/ +scribble-demos/scrib/fase16/src/fase16/smtp/Smtp/ +scribble-demos/scrib/fib/src/fib/Fib/ +scribble-demos/scrib/http/src/http/longvers/HttpLong/ +scribble-demos/scrib/http/src/http/shortvers/HttpShort/ +scribble-demos/scrib/loan/src/loan/LoanApplication/ +scribble-demos/scrib/smtp/src/smtp/Smtp/ +scribble-demos/scrib/travel/src/travel/Travel/ +scribble-demos/scrib/tutorial/src/tutorial/adder/Adder/ + + +## +#scribble-test/src/test/scrib + +scribble-test/src/test/scrib/exercise/calculator/EProtocol/ +scribble-test/src/test/scrib/exercise/voting/EProtocol/ + +scribble-test/src/test/scrib/demo/fase17/travel/TravelAgent/ +scribble-test/src/test/scrib/demo/fase17/travel2/TravelAgent2/ +scribble-test/src/test/scrib/demo/highlow/HighLow/ + +scribble-test/src/test/scrib/scratch/scratch1/ +scribble-test/src/test/scrib/scratch/scratch2/ +scribble-test/src/test/scrib/test/foo/Foo/ +scribble-test/src/test/scrib/test/test1/ +scribble-test/src/test/scrib/test/test2/ +scribble-test/src/test/scrib/test/test3/ +scribble-test/src/test/scrib/test/test4/ +scribble-test/src/test/scrib/test/test5/ +scribble-test/src/test/scrib/test/test6/ +scribble-test/src/test/scrib/test/test7/ +scribble-test/src/test/scrib/test/test8/ +scribble-test/src/test/scrib/test/test9/ + +scribble-test/src/test/scrib/test/test2/Test2/ +scribble-test/src/test/scrib/test/test3/Test3/ +scribble-test/src/test/scrib/test/test4/Test4/ +scribble-test/src/test/scrib/test/test5/Test5/ +scribble-test/src/test/scrib/test/test6/Test6/ +scribble-test/src/test/scrib/test/test7/Test7/ + + +bin/scribblec.sh +permissions-fix.sh + diff --git a/.mvn/wrapper/maven-wrapper.jar b/.mvn/wrapper/maven-wrapper.jar new file mode 100644 index 000000000..c6feb8bb6 Binary files /dev/null and b/.mvn/wrapper/maven-wrapper.jar differ diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 000000000..56bb0164e --- /dev/null +++ b/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1 @@ +distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.0/apache-maven-3.5.0-bin.zip \ No newline at end of file diff --git a/.settings.xml b/.settings.xml new file mode 100644 index 000000000..8fbe094c3 --- /dev/null +++ b/.settings.xml @@ -0,0 +1,28 @@ + + + + + sonatype + ${env.SONATYPE_USER} + ${env.SONATYPE_PASSWORD} + + + bintray + ${env.BINTRAY_USER} + ${env.BINTRAY_KEY} + + + jfrog-snapshots + ${env.BINTRAY_USER} + ${env.BINTRAY_KEY} + + + github.com + ${env.GH_USER} + ${env.GH_TOKEN} + + + diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..0f95eaf29 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,43 @@ +sudo: required +dist: trusty + +language: java +jdk: +- oraclejdk8 + +cache: + directories: + - $HOME/.m2/repository + +before_install: + # allocate commits to CI, not the owner of the deploy key + - git config user.name "scribbleci" + - git config user.email "ci@scribble.org" + + # setup https authentication credentials, used by ./mvnw release:prepare + - git config credential.helper "store --file=.git/credentials" + - echo "https://$GH_TOKEN:@github.com" > .git/credentials + +install: + # Override default travis to use the maven wrapper + - ./mvnw install -DskipTests=true -Dmaven.javadoc.skip=true -B -V + +script: + - ./travis/publish.sh + +branches: + except: + - /^[0-9]/ + +env: + global: + # Ex. travis encrypt -r org/repo GH_TOKEN=XXX-https://github.com/settings/tokens-XXX + - secure: "EZHcIA6vC1eUqj1vMRlsMh+wBkdEejPNIy7ZDpKkf6Ntsv8COTyKbzr/mDWyl8W8BgieiYKvLiCJQpUj8ZNagGTUw8znngW6XQhDZJTuuimuyq9RikK1+owd+BNNybMTIbe21CuKpEwWranbINBJvu/Wi7IHXuqqcClQJ/fDApE=" + # Ex. travis encrypt -r org/repo SONATYPE_USER=your_sonatype_account + - secure: "zD27+IC5mFIMz5lvL+cwjAeXHEdJuAFwl0M6lBr5g5/4IqInPq5bXyVeQI5vSMmKa9xk9tdx4tvRSnIqIvSqrXj0t3yl9b3lXmFFbOTtSem7Mu8MhIdSTcXkPCdt0I/1MUmtJpExQ29BwNZWwiSXeOBngxrgZTpUUhi806JGpME=" + # Ex. travis encrypt -r org/repo SONATYPE_PASSWORD=your_sonatype_password + - secure: "ewf2f+EBpizqXJ9i90ekHbvODH59KKFulMdSko6qhle6E6IsTK5tuWzwSir3lRqTRAiVoJ/F3IR32fkzkMv+KaZCookN8jmFb/OI58x8jzTRz8+pJkSCMWZ+pUgZUZt51D/85pTkw3ftacVQt3oYP4wPIkJdF0c3UArTjOsapso=" + # Ex. travis encrypt -r org/repo BINTRAY_USER=your_github_account + - secure: "Mofhc9/R1c3r1Ve4ZTmIX/gMb737FqvaOrAIjVSaaSW/T/pSqgh8AZu0bndVrQZ4YSpkmZcmhdO8NX0MtrxHBQMddY/DpE2o0G4oAkRUVtYUz7o5rL8Q5xVtQUngzaMrpFPBF2JlAoK+/iJDF839wGuQdiV9koaViOMt61yVRHw=" + # Ex. travis encrypt -r org/repo BINTRAY_KEY=xxx-https://bintray.com/profile/edit-xxx + - secure: "yxiVTp3pD6UPex4G69tbYkXB5QWqQsu4vlUrS/RRaxOW7TWeZRl4hXtqOUwL3AxoZcJFivE4OcqdUlw2IOYVBtrVTngQ/ZAVefdD/ohNPO3+6SdP2uzqdnqAxEi7kJBqaCvUG1uEPdp+S+w5f6VcK0rfxgK+IRUxREhDmCFuCg8=" diff --git a/CHANGES.md b/CHANGES.md new file mode 100644 index 000000000..1feda4399 --- /dev/null +++ b/CHANGES.md @@ -0,0 +1,27 @@ +Scribble 0.4 +--- + +- Updated scribblec script interface: check + + ./scribblec --help + + for new usages. + +- The core tooling has been refactored to support an alternative validation + method. To obtain more details on safety/progress errors, use the -V + command line flag. + + N.B. the -oldwf command line flag allows to use only the well-formedness + from the previous version of the tool. Warning: no guarantees are offered + when validating newer Scribble features using -oldwf. + +- Most Scribble demos that were previously in + + modules/core/src/test/scrib/demo + + have been relocated to + + modules/demos/scrib/ + + Some demo files have also been renamed or repackaged. + \ No newline at end of file diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 000000000..c0132670b --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,14 @@ +Copyright 2012 Scribble authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + diff --git a/README b/README deleted file mode 100644 index 139597f9c..000000000 --- a/README +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/README.md b/README.md new file mode 100644 index 000000000..408b44a3a --- /dev/null +++ b/README.md @@ -0,0 +1,108 @@ +[![Build Status][ci-img]][ci] [![Released Version][maven-img]][maven] + +# Java Tooling for Scribble + +This project provides Java tooling/libraries for the Scribble multi-party +protocol definition language. + + +## Building from source + +First step is to clone this git repository locally. Once available, run the +following maven command to build the project: + + mvn [clean] install + +The distribution will be available from the folder _scribble-dist/target_. The +contents of the zip is: + +- lib jars needed to run the scribble-java tool +- scribblec.sh script for running the command line tool + + +## Command line usage: + +Assuming scribblec.sh has been extracted from the above zip: + +> List command line options. + + ./scribblec.sh --help + +Assuming a Scribble module file Test.scr in the same directory: + +> Check well-formedness of global protocols in module Test.scr. + + ./scribblec.sh Test.scr + +Note: try the -V command line flag to obtain full traces for errors (and other + details). + +> Project local protocol for role "C" of protocol "Proto" in Test.scr + + ./scribblec.sh Test.scr -project Proto C + + +> Print (a dot representation of) the Endpoint FSM for role "C" of protocol + "Proto" in Test.scr + + ./scribblec.sh Test.scr -fsm Proto C + + +> Generate Java Endpoint API for role "C" of protocol "Proto" + in Test.scr + + ./scribblec.sh -d . Test.scr -api Proto C + +Note: omitting the -d argument will print the output to stdout. + + +## Examples: + +> To write a HelloWorld protocol in Test.scr (e.g., for the commands listed above): + + echo 'module Test; global protocol Proto(role C, role S) { Hello() from C to S; }' > Test.scr + + +Further examples can be found in: + + https://github.com/scribble/scribble-java/tree/master/scribble-demos/scrib + +The distribution zip does not include these examples. They can be obtained as +part of the source repository, or separately via the above link. + +> E.g. To generate the Java Endpoint API for role "C" in the "Adder" protocol from the + Scribble-Java tutorial (http://www.scribble.org/docs/scribble-java.html#QUICK) + + ./scribblec.sh scribble-demos/scrib/tutorial/src/tutorial/adder/Adder.scr + -d scribble-demos/scrib/tutorial/src/ -api Adder C + + +## Alternative command line usage: + +To run the Scribble tool directly via java, try + + ./scribblec.sh --verbose [args] + +to see the underlying java command with main class, classpath and other args. + +Or try (from Nick Ng): + + mvn dependency:build-classpath -Dmdep.outputFile=classpath + + java -cp $(cat dist/classpath) org.scribble.cli.CommandLine [args] MyModule.scr + + +## Issue reporting + +Bugs and issues can be reported via the github Issues facility. + +Or email r.z.h.hu1234 [at] herts.ac.uk excluding the 1234. + + + [ci-img]: https://travis-ci.org/scribble/scribble-java.svg?branch=master + [ci]: https://travis-ci.org/scribble/scribble-java + [cov-img]: https://coveralls.io/repos/github/scribble/scribble-java/badge.svg?branch=master + [cov]: https://coveralls.io/github/scribble/scribble-java?branch=master + [maven-img]: https://img.shields.io/maven-central/v/org.scribble/scribble-core.svg?maxAge=2592000 + [maven]: http://search.maven.org/#search%7Cga%7C1%7Cscribble-core + diff --git a/RELEASE.md b/RELEASE.md new file mode 100644 index 000000000..b8775e2e2 --- /dev/null +++ b/RELEASE.md @@ -0,0 +1,18 @@ +# Scribble Release Process + +This repo uses semantic versions. Please keep this in mind when choosing version numbers. + +1. **Alert others you are releasing** + + There should be no commits made to master while the release is in progress (about 10 minutes). Before you start + a release, alert others so that they don't accidentally merge + anything. If they do, and the build fails because of that, you'll have to recreate the release tag described below. + +1. **Push a git tag** + + The tag should be of the format `release-N.M.L`, ex `git tag release-3.7.1; git push origin release-3.7.1`. + +1. **Wait for Travis CI** + + This part is controlled by [`travis/publish.sh`](travis/publish.sh). It creates a bunch of new commits, bumps + the version, publishes artifacts, and syncs to Maven Central. \ No newline at end of file diff --git a/build/pom.xml b/build/pom.xml deleted file mode 100644 index 85acd5df3..000000000 --- a/build/pom.xml +++ /dev/null @@ -1,30 +0,0 @@ - - 4.0.0 - build - 0.3.2-SNAPSHOT - jar - Scribble::Build - - - org.scribble - parent - 0.3.2-SNAPSHOT - - - - - - - - - org.apache.maven.plugins - maven-deploy-plugin - - true - - - - - - diff --git a/build/src/main/resources/checkstyle/checkstyle.xml b/build/src/main/resources/checkstyle/checkstyle.xml deleted file mode 100644 index 44e0015b6..000000000 --- a/build/src/main/resources/checkstyle/checkstyle.xml +++ /dev/null @@ -1,218 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/src/main/resources/checkstyle/suppressions.xml b/build/src/main/resources/checkstyle/suppressions.xml deleted file mode 100644 index dc2694e1a..000000000 --- a/build/src/main/resources/checkstyle/suppressions.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/src/main/resources/findbugs/findbugs-exclude.xml b/build/src/main/resources/findbugs/findbugs-exclude.xml deleted file mode 100644 index 4a85c0fa9..000000000 --- a/build/src/main/resources/findbugs/findbugs-exclude.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/docs/developerguide/en-US/SJDGMonitor.asciidoc b/docs/developerguide/en-US/SJDGMonitor.asciidoc deleted file mode 100644 index 5ffc2a4ca..000000000 --- a/docs/developerguide/en-US/SJDGMonitor.asciidoc +++ /dev/null @@ -1,120 +0,0 @@ -== Monitor - -The monitoring capability is used to ensure that a system conforms to a protocol description at runtime. This is a form of dynamic validation, or conformance checking. - - -=== Converting a Protocol into a Monitor State Machine - -To efficiently monitor a running system, to ensure that it is conformed to one or more roles within a protocol description, it is necessary to transform the text based description (and even the object model representation) into a form that can more effectively be used to drive a runtime monitoring solution. - ----- -org.scribble.context.ModuleLoader loader=...; -org.scribble.resources.Resource res=...; - -org.scribble.model.local.LProtocolDefinition lp=...; // Obtain the required local protocol definition - -org.scribble.monitor.export.MonitorExporter exporter=new org.scribble.monitor.export.MonitorExporter(); - -org.scribble.context.ModuleContext context=new org.scribble.context.DefaultModuleContext(res, lp.getModule(), loader); - -org.scribble.monitor.model.SessionType type=exporter.export(context, lp); ----- - -The first step is to obtain the module that contains the local protocol definition to be monitored. This can ether be achieved by parsing a textual representation of a local protocol definition, or by projecting the local modules from a global module. - -Once the module is obtained, then the specific local protocol definition can be retrieved. As a module may contain multiple local protocol definitions, it is important to select the one that represents the initial (or top level) protocol definition from the perspective of what needs to be monitored. - -Once the exporter has been instantiated, invoke the _export_ method with the selected local protocol definition. This will export the protocol definition into a state machine representation associated with the returned _org.scribble.monitor.model.SessionType_ object. This object will be used in subsequent runtime monitoring session instances to define the behavioural type being verified. - - -=== Dynamically Monitoring Message Exchanges - -==== Managing session instances - -It is currently out of the scope of the Scribble monitor to manage session instances. It is up to the application invoking the monitor to determine: - -* When a new session instance must be created and initialized - -In this situation, the application should instantiated an instance of the _org.scribble.monitor.SessionInstance_ class and supply it, along with the relevant _org.scribble.monitor.model.SessionType_ object (defining the behavioural type to be monitored), to the _initializeInstance_ method of the monitor, e.g. - ----- -org.scribble.monitor.Monitor monitor=new org.scribble.monitor.DefaultMonitor(); -org.scribble.monitor.model.SessionType sessionType=....; - -org.scribble.monitor.SessionInstance instance=new org.scribble.monitor.SessionInstance(); - -monitor.initializeInstance(sessionType, instance); ----- - -The new session instance should then be stored by the application, associated with some relevant key that can be used to retrieve it later. - -* When an existing session instance should be retrieved - -If a key is obtained from the interaction being monitored, possibly by extracting relevant information from the message content or header, then it can be used to locate an existing session instance. - -* When a session instance is no longer required - -The _org.scribble.monitor.SessionInstance_ class has a method called _hasCompleted_ which will return a boolean result, indicating whether the session instance has completed. - -This should be checked after any processing of the session instance by the Scribble monitor. If this method returns _true_, then the session instance object should be removed from the set of application managed session instances. - -==== Verifying behaviour - -When behaviour is detected, and an appropriate session instance object created or retrieved, then the behaviour can be verified using the Scribble monitor. Currently the following types of verification can be performed: - -* Message Sent - -The following is an example of how to verify a sent message: - ----- -org.scribble.monitor.Monitor monitor=....; -org.scribble.monitor.model.SessionType sessionType=....; -org.scribble.monitor.SessionInstance instance=....; - -String toRole=....; -org.scribble.monitor.Message mesg=new org.scribble.monitor.Message(); - -mesg.setOperator("placeOrder"); -mesg.getTypes().add("{http://acme.org/ordermgmt}Order"); -mesg.getValues().add(""); - -boolean result=monitor.sent(sessionType, instance, mesg, toRole); ----- - -The first lines are simply present to identify the types associated with the parameters to the _sent_ method. - -The next block would identify the _toRole_, i.e. the role that the message is being sent to, and the message details. The message includes an operator name, and a list of parameter types/values. - -NOTE: Currently the values are not used, so it is not necessary to supply them, but in the future they will be used in the evaluation of assertions. - -The monitor is then invoked using the _sent_ method, supplying the session type and instance, as well as the message and 'to' role. The result of this method is a boolean value indicating whether the monitor considered it to be valid or not. - - -* Message Received - -The following is an example of how to verify a received message: - ----- -org.scribble.monitor.Monitor monitor=....; -org.scribble.monitor.model.SessionType sessionType=....; -org.scribble.monitor.SessionInstance instance=....; - -String fromRole=....; -org.scribble.monitor.Message mesg=new org.scribble.monitor.Message(); - -mesg.setOperator("placeOrder"); -mesg.getTypes().add("{http://acme.org/ordermgmt}Order"); -mesg.getValues().add(""); - -boolean result=monitor.received(sessionType, instance, mesg, fromRole); ----- - -The first lines are simply present to identify the types associated with the parameters to the _received_ method. - -The next block would identify the _fromRole_, i.e. the role that the message is been received from, and the message details. The message includes an operator name, and a list of parameter types/values. - -NOTE: Currently the values are not used, so it is not necessary to supply them, but in the future they will be used in the evaluation of assertions. - -The monitor is then invoked using the _received_ method, supplying the session type and instance, as well as the message and 'from' role. The result of this method is a boolean value indicating whether the monitor considered it to be valid or not. - - diff --git a/docs/developerguide/en-US/SJDGProtocol.asciidoc b/docs/developerguide/en-US/SJDGProtocol.asciidoc deleted file mode 100644 index 9cdb76850..000000000 --- a/docs/developerguide/en-US/SJDGProtocol.asciidoc +++ /dev/null @@ -1,112 +0,0 @@ -== Protocol - -This section explains how to make use of the Scribble Java tools to parse, validate and project a Scribble protocol. The following sections of this document explain how applications can then make use of these validated (and potentially projected) protocols to perform further tasks, such as monitoring message exchanges to ensure they conform to a defined protocol, or simulating message traces against endpoint simulators. - -The Java tools make use of maven to store its artifacts (i.e. jars). These are associated with the group id _org.scribble_ and the artifact id _scribble-_, where the is the individual area represented by the artifact. As well as there being an artifact per component of the tooling, there is an additional _scribble-core_ artifact that contains items shared by all of the components. - -=== Common Components (maven artifact id _scribble-core_) - -This artifact contains general interfaces/classes for issue logging, context, resources and the protocol model (local and global variants). - -==== Issue Logging - -Whenever a component needs to perform processing on the protocol, to identify parsing, validation or projection issues, then the component will use the _org.scribble.logging.IssueLogger_ to report any errors, warnings or other general information. - -As part of the core artifact there is a _org.scribble.logging.ConsoleIssueLogger_ implementation that reports any issues to the console, however an application is free to provide its own implementation. For example, the Eclipse tooling contains an implementation that converts the issues into Eclipse markers for reporting in the _Marker_ or _Problems_ views. - -==== Context - -The _org.scribble.context_ package contains the following components that may be used with various protocol processing capabilities: - -* Module Loader - -The _org.scribble.context.ModuleLoader_ interface is used during a variety of processing stages, e.g. parsing, validation, monitoring, etc. It is responsible for retrieving a _org.scribble.model.Module_ object model associated with a fully qualified module name. - -There is a default implementation of the module loader _org.scribble.context.DefaultModuleLoader_ that simply provides a caching capability for loaded modules. It is expected that a derived loader implementation will be provided, that will leverage the caching capability of the default implementation, but will provide the environment specific knowledge of how to obtain the modules. One such concrete implementation is _org.scribble.parser.ProtocolModuleLoader_ which can be found in the _scribble-parser_ component. - -* Module Context - -The module context is responsible for providing support services to any processing that is occuring on a particular module. The focus of a particular module context instance will be an individual _org.scribble.model.Module_ instance. Based on the definitions contained within that module instance, an application can request access to members, either within that module, or in an associated module (identified by a fully qualified name). - -==== Resources - -Within the _org.scribble.resources_ package is contained classes/interfaces to provide support for locating and loading resources. These capabilities can be used to load modules, as well as any other appropriate resources used during parsing, validation or further stages. - - -==== Protocol Model - -The model contains the general module components, as well as the specfic components to represent the local and global variations of the Scribble protocol. - -The top level model component is _org.scribble.model.Module_. - - -=== Parsing (artifact id _scribble-parser_) - -The parser is the component responsible for taking a text based description of a Scribble protocol and transforming it into an object model. As part of this process, it will verify that the syntax of the protocol description is valid, and report any errors using the supplied _org.scribble.logging.IssueLogger_. - ----- -String path=....; // Colon separate directory paths where scribble modules are located -java.io.InputStream is=....; // Input stream containing text description of scribble protocol - -org.scribble.parser.ProtocolParser pp=new org.scribble.parser.ProtocolParser(); -org.scribble.logging.IssueLogger logger=new org.scribble.logging.ConsoleIssueLogger(); -org.scribble.resources.DirectoryResourceLocator locator=new org.scribble.resources.DirectoryResourceLocator(path); - -org.scribble.context.ModuleLoader loader=new org.scribble.parser.ProtocolModuleLoader(pp, locator, logger); - -org.scribble.resources.Resource res=new org.scribble.resources.InputStreamResource(path, is); - -org.scribble.model.Module module=pp.parse(res, loader, logger); ----- - -The last line of this example shows the parser being involved. It takes three parameters: - -* the resource, containing the text based scribble protocol description -* the loader, to load any additional modules (or potentially other resources) that may be required to support the parsing of the module -* the logger, to report any issues that arise from parsing the protocol description - -If the parser returns a module, then it means that it was successfully parsed. Otherwise the syntax errors will be reported to the issue logger and no module will be returned. - - -=== Validating (artifact id _scribble-validation_) - -The validator is the component responsible for evaluating a protocol module (_org.scribble.model.Module_) to determine if it conforms to a set of predefined rules (e.g. wellformedness conditions). As with the parser, any issues will be reported to the supplied _org.scribble.logging.IssueLogger_. - ----- -org.scribble.logging.IssueLogger logger=...; -org.scribble.resources.Resource res=...; -org.scribble.context.ModuleLoader loader=...; -org.scribble.model.Module module=...; - -org.scribble.context.ModuleContext context=new org.scribble.context.DefaultModuleContext(res, module, loader); - -org.scribble.validation.ProtocolValidator pv=new org.scribble.validation.ProtocolValidator(); - -pv.validate(context, module, logger); ----- - -Most of the components used in this example validation were introduced in the parser section above. The new components in this example are the _ProtocolValidator_, which will perform the validation, and the _ModuleContext_. As discussed in a previous section, the module context provides access to members (e.g. type or protocol definitions) in a particular module, or associated module. - - -=== Projection (artifact id _scribble-projection_) - -In the context of Scribble, projection is the term used to describe extracting the local endpoint behaviour of a role defined within a global protocol. The global protocol describes the interactions between multiple parties, whereas the local protocol described the interactions from a particular role's perspective. - -Being able to filter out just the responsibilies of an individual role, from the potentially complex set of interactions that may be defined in a global protocol between many participants, is important - primarily for being able to determine whether an implementation of that role (endpoint) is statically or dynamically conforming to the expected behaviour. - ----- -org.scribble.logging.IssueLogger logger=...; -org.scribble.resources.Resource res=...; -org.scribble.context.ModuleLoader loader=...; -org.scribble.model.Module module=...; - -org.scribble.context.ModuleContext context=new org.scribble.context.DefaultModuleContext(res, module, loader); - -org.scribble.projection.ProtocolProjector projector=new org.scribble.projection.ProtocolProjector(); - -java.util.Set projected=projector.project(context, module, logger); ----- - -The code is very similar to the validation example, with the exception that we are creating a _ProtocolProjector_ and the projection results in a set of modules representing the local protocol definitions. - - diff --git a/docs/developerguide/en-US/SJDGSimulation.asciidoc b/docs/developerguide/en-US/SJDGSimulation.asciidoc deleted file mode 100644 index d7a35c4a0..000000000 --- a/docs/developerguide/en-US/SJDGSimulation.asciidoc +++ /dev/null @@ -1,94 +0,0 @@ -== Simulation - -Simulation is performed by defining a _trace_ file, containing a sequence of actions (e.g. message transfers), and one or more simulation definitions identifying how each role should be simulated. - -=== Defining a Trace - -The _trace_ model can be serialized as a JSON representation, e.g. - ----- -{ - "name":"RequestResponse-1", - "steps":[{ - "type":"MessageTransfer", - "message":{ - "operator":"buy", - "types":["{http://scribble.org/example}OrderRequest"], - "values":[""] - }, - "fromRole":"Buyer", - "toRoles":["Seller"] - },{ - "type":"MessageTransfer", - "message":{ - "operator":"buy", - "types":["{http://scribble.org/example}OrderResponse"], - "values":[""] - }, - "fromRole":"Seller", - "toRoles":["Buyer"] - }], - "simulations":[{ - "roleSimulators":{ - "Buyer":{ - "type":"MonitorRoleSimulator", - "module":"scribble.examples.RequestResponse", - "role":"Buyer", - "protocol":"First" - }, - "Seller":{ - "type":"MonitorRoleSimulator", - "module":"scribble.examples.RequestResponse", - "role":"Seller", - "protocol":"First" - } - } - }] -} ----- - -In this example trace file, two steps (or actions) are defined. The first is representing the order request being sent from the _Buyer_ role to the _Seller_ role. The second is representing an order response being returned from the _Seller_ role to the _Buyer_ role. The _message_ component defined the operator, list of parameter types, and list of parameter values. The values are currently optional - however once assertions are supported, the value will need to be provided. - -The _simulations_ section defines a list of simulations. Each simulation defined an optional name, and a map of role names to role simulators. - -In this example, the only role simulator type used is *MonitorRoleSimulator* which uses the Scribble monitor to verify that the message transfers defined in the trace conform to the Scribble protocol identified by the module, role and protocol. - -NOTE: If a trace contains steps associated with roles that are not defined within the role simulator map, then those roles will be ignored when performing the simulation. - - -=== Performing a Simulation - -To perform a simulation from within your own application, you need to perform the following steps: - ----- -// Create a locator that can be used to load the scribble modules and any associated resources -org.scribble.resources.ResourceLocator locator=new org.scribble.resources.DirectoryResourceLocator(...); - -// Build or load the trace (e.g. deserialize the JSON representation) -org.scribble.trace.model.Trace trace=...; - -// Create a context using the locator -org.scribble.trace.simulation.SimulatorContext context=new org.scribble.trace.simulation.DefaultSimulatorContext(locator); - -// Create the simulator -org.scribble.trace.simulation.Simulator simulator=new org.scribble.trace.simulation.Simulator(); - -// Instantiate an implementation of the listener interface, to be informed when steps are simulated -// successfully or unsuccessfully -org.scribble.trace.simulation.SimulationListener l=...; - -// Add the listener to the simulator -simulator.addSimulationListener(l); - -try { - // Simulate the trace - simulator.simulate(context, trace); -} catch (Exception e) { - ... -} - -// Unregister the listener -simulator.removeSimulationListener(l); ----- - - diff --git a/docs/developerguide/en-US/ScribbleJavaDeveloperGuide-docinfo.xml b/docs/developerguide/en-US/ScribbleJavaDeveloperGuide-docinfo.xml deleted file mode 100644 index 4944b7aed..000000000 --- a/docs/developerguide/en-US/ScribbleJavaDeveloperGuide-docinfo.xml +++ /dev/null @@ -1,14 +0,0 @@ - -    Gary -     Brown - - Red Hat -     -   - - - - 2012-2014 - - diff --git a/docs/developerguide/en-US/ScribbleJavaDeveloperGuide.asciidoc b/docs/developerguide/en-US/ScribbleJavaDeveloperGuide.asciidoc deleted file mode 100644 index 0334d296c..000000000 --- a/docs/developerguide/en-US/ScribbleJavaDeveloperGuide.asciidoc +++ /dev/null @@ -1,10 +0,0 @@ -Scribble Java Developer Guide -============================= -:doctype: book - -include::SJDGProtocol.asciidoc[] - -include::SJDGMonitor.asciidoc[] - -include::SJDGSimulation.asciidoc[] - diff --git a/docs/developerguide/en-US/_Sidebar.asciidoc b/docs/developerguide/en-US/_Sidebar.asciidoc deleted file mode 100644 index 8357b97c1..000000000 --- a/docs/developerguide/en-US/_Sidebar.asciidoc +++ /dev/null @@ -1,8 +0,0 @@ -.Contents -**** -link:SJDGProtocol[Protocol] + -link:SJDGMonitor[Monitor] + -link:SJDGSimulation[Simulation] + -**** - - diff --git a/docs/developerguide/pom.xml b/docs/developerguide/pom.xml deleted file mode 100644 index e826ea462..000000000 --- a/docs/developerguide/pom.xml +++ /dev/null @@ -1,118 +0,0 @@ - - - 4.0.0 - - org.scribble.docs - scribble-developerguide - jdocbook - Scribble::Docs::DeveloperGuide - The Developer Guide for Scribble Java. - https://github.com/scribble/scribble-java/wiki - 2013 - - - org.scribble.docs - parent - 0.3.2-SNAPSHOT - - - - - - org.asciidoctor - asciidoctor-maven-plugin - 0.1.1 - - - output-docbook - generate-resources - - process-asciidoc - - - - - en-US - target/docbook/en-US - docbook - book - - - - org.jboss.maven.plugins - maven-jdocbook-plugin - 2.3.8 - true - - - org.jboss.pressgang - pressgang-xslt-ns - 2.0.2 - - - org.jboss.pressgang - pressgang-jdocbook-style - jdocbook-style - 2.0.2 - - - - - ScribbleJavaDeveloperGuide.xml - target/docbook/ - - ${basedir} - - images/* - - - - - - - - html - classpath:/xslt/org/jboss/xhtml.xsl - index.html - - - html_single - classpath:/xslt/org/jboss/xhtml-single.xsl - index.html - - - pdf - classpath:/xslt/org/jboss/pdf.xsl - Scribble_Java_Developer_Guide.pdf - - - - true - saxon - - - - 1.72.0 - - - javax.xml.parsers.DocumentBuilderFactory - org.apache.xerces.jaxp.DocumentBuilderFactoryImpl - - - javax.xml.parsers.SAXParserFactory - org.apache.xerces.jaxp.SAXParserFactoryImpl - - - - - - - - - - diff --git a/docs/javadoc/pom.xml b/docs/javadoc/pom.xml deleted file mode 100644 index 608e867fb..000000000 --- a/docs/javadoc/pom.xml +++ /dev/null @@ -1,118 +0,0 @@ - - 4.0.0 - javadoc - jar - Scribble::Docs::Javadoc - - - org.scribble.docs - parent - 0.3.2-SNAPSHOT - - - - - org.scribble - scribble-parser - - - - org.codehaus.jackson - jackson-core-asl - provided - - - org.codehaus.jackson - jackson-mapper-asl - provided - - - org.antlr - antlr-runtime - - - - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - - *.internal.* - - - - - - - - org.apache.maven.plugins - maven-antrun-plugin - - - copy-sources - generate-sources - - - - - - - - - - - - - run - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - - - package - package - - jar - - - ${project.build.directory}/sources - true - - - - rtgov-javadoc - package - - jar - - - ${project.build.directory}/sources - ${project.build.directory}/api - scribble-javadoc - false - - - - - 128m - 768m -
Scribble
-
Scribble
- Scribble Java ${project.version} API - true -
-
-
-
- -
diff --git a/docs/pom.xml b/docs/pom.xml deleted file mode 100644 index 954a8ca1f..000000000 --- a/docs/pom.xml +++ /dev/null @@ -1,23 +0,0 @@ - - 4.0.0 - org.scribble.docs - parent - pom - Scribble::Docs - - - org.scribble - parent - 0.3.2-SNAPSHOT - - - - developerguide - userguide - javadoc - - - - diff --git a/docs/userguide/en-US/SJUGCommandLine.asciidoc b/docs/userguide/en-US/SJUGCommandLine.asciidoc deleted file mode 100644 index 233cd2a5b..000000000 --- a/docs/userguide/en-US/SJUGCommandLine.asciidoc +++ /dev/null @@ -1,82 +0,0 @@ -== Command Line - - -=== Installation - -Download the latest binary distribution of the command lines tools from the scribble website and unpack the zip file in an appropriate location. - -The directory structure within the distribution is: - -* bin - -The folder containing the scripts for running the scribble tools. - -* docs - -The folder containing the user guide, developer guide and Java API documentation. - -* lib - -The jar files used by the scribble command line tools. - - - -=== How To ... - -Before running any of the commands, you will need to setup the MODULE_PATH environment variable, to identify which folder (or folders) contain the module definitions. The MODULE_PATH will define a list of directories, separated by the ':' character. - -If you don't wish to define the environment variable, then the list of folders can be supplied on the command line, by specfying: -path - - -==== Parse and Validate a Scribble Protocol - -To parse and validate that a Scribble module is correct, run the following command from the bin folder: - -On windows ----- -scribble -validate ----- - -On linux ----- -./scribble.sh -validate ----- - -If any parse or validation errors are detected, then they will be displayed on the console. - - -==== Project a Global Protocol - -To project a Scribble global module to a local module per role, run the following command from the bin folder: - -On windows ----- -scribble -project ----- - -On linux ----- -./scribble.sh -project ----- - -If any parse or validation errors are detected, then they will be displayed on the console. Otherwise a local module will be created, at the same location as the global module, for each role defined in the global module. - - -==== Simulate a Message Trace - -To simulate a Scribble protocol, run the following command from the bin folder: - -On windows ----- -scribble -simulate ----- - -On linux ----- -./scribble.sh -simulate ----- - -If a trace file is specified, then only that file will be simulated. If a folder is specified, then all trace files within that folder (or sub-folders) will be simulated. If a simulation fails, then it will immediately terminate the command. - - - diff --git a/docs/userguide/en-US/SJUGEclipse.asciidoc b/docs/userguide/en-US/SJUGEclipse.asciidoc deleted file mode 100644 index d318cf253..000000000 --- a/docs/userguide/en-US/SJUGEclipse.asciidoc +++ /dev/null @@ -1,141 +0,0 @@ -== Eclipse - -=== Installation - -* Download Eclipse - -The Scribble Java tools are installed as plugins within the Eclipse Integrated Development Environment (IDE). - -Therefore the first step is to download a copy of Eclipse from http://www.eclipse.org/downloads. This download page includes various configurations of the IDE customised for specific needs. However if you are simply wanting to experiment with the Scribble tooling then it is best to initially just use the standard version. - -* Start Eclipse - -Once you have downloaded Eclipse, and unpacked it into an appropriate location, start it up by running the 'eclipse' command in the top level folder. - -* Install Scribble Java Tooling - -Go to the _Help_ -> _Install New Software..._ menu item. This will show a dialog window. - -Enter the URL http://download.jboss.org/scribble/tools/latest into the _Work With_ field and press the +return+ key. This will show the available Eclipse features and plugins (from this update site) in the main window. Select the checkbox against the top level _Scribble_ node and then press the +Next+ button and following the remaining instructions. - -When the plugins have been installed you will need to restart the Eclipse IDE when requested. - - -=== How To ... - -This chapter will describe how the Scribble tooling can be used within the Eclipse IDE. - -==== Create a Scribble Protocol - -Before being able to create a protocol, we need to first create an Eclipse project, if one does not already exist. This is achieved by selecting the _New_ -> _Project ..._ menu item from the context menu associated with the _Project Explorer_, which appears on the left hand side of the Eclipse tool. - -This will result in a dialog box being displayed showing the different types of project that can be created. If the project is not required for any other purpose, then expand the _General_ top level node and choose the _Project_ child node. Press the +Next+ button and then enter the project name before pressing the +Finish+ button. - -Once a project has been created (or selected if already exists), then we need to create a hierarchy of folders representing the module path within which the protocol will be defined. - -A folder is created by selecting _New_ -> _Folder_ menu item from the context menu associated with either the project, or a parent folder. This will show a dialog window in which the new folder's name can be specified. - -Once the appropriate folder hierarchy has been created, then the next step is to create the protocol file. This can be achieved by selecting the _New_ -> _Other ..._ menu item from the context menu associated with the containing folder. This will present a dialog window with the list of items that can be created. Expand the top level _Scribble_ node and select the _Protocol_ child node. When the +Next+ button is pressed it will offer the ability to enter the name of the protocol. Finally press the +Finish+ button to create the file. - -When the protocol file is created, it will also launch the editor for the file. For further information, on how to edit the protocol, see the next section. - - -==== Edit a Scibble Protocol - -To edit a Scribble protocol file (with extension _.scr_) simply locate the file within the _Project Explorer_, by expanding the relevant project and folders, and then double click on the file to launch the Scribble editor. - -The editor will appear in the main area. It is essentially a standard text editor, although will provide some guidance (e.g. keyword highlighting). - -When a change has been made to the file, an astrisk will appear against the filename to indicate that it is in a 'dirty' state. To save the file, use Ctrl-S, Alt-F followed by S, or the disc icon in the top left part of the toolbar. - - -==== Validate a Scribble Protocol - -When a protocol is edited, and saved, it will automatically trigger the validation of the protocol. - -An issues that are found with the protocol will be displayed in the _Markers_ view (window) in the bottom region of the Eclipse window. Double clicking on any of the errors in this area will navigate to the protocol file (and specific text in that file). - - -==== Project a Global Protocol - -Projecting a Global Protocol will create a set of Local Protocols, one per role within the Global Protocol. To perform this task, select the _Scribble_ -> _Project_ menu item from the context menu associated with the Scribble protocol file in the _Project Explorer_. - -This will cause the local protocol files to be created in the same folder as the global protocol. This is because they are associated with the same module. However the filename will be appended with the role, indicating that it is a local protocol associated with that role. - - -==== Simulate a Message Trace - -A message trace represents a sequence of messages that are exchanged between communicating parties. These can be defined using a JSON format, in a file with extension .trace. - -NOTE: There is now an early preview version of the Eclipse trace editor. We would welcome feedback on its usability. Alternatively the trace files can be edited using a standard text editor. - -An example of a trace file is: - ----- -{ - "name":"RequestResponse@Buyer-1", - "steps":[{ - "type":"MessageTransfer", - "message":{ - "operator":"buy", - "types":["{http://scribble.org/example}OrderRequest"], - "values":[""] - }, - "fromRole":"Buyer", - "toRoles":["Seller"] - },{ - "type":"MessageTransfer", - "message":{ - "operator":"buy", - "types":["{http://scribble.org/example}OrderResponse"], - "values":[""] - }, - "fromRole":"Seller", - "toRoles":["Buyer"] - }], - "roles":[{ - "name":"Buyer", - "simulator":{ - "type":"MonitorRoleSimulator", - "module":"scribble.examples.RequestResponse", - "role":"Buyer", - "protocol":"First" - } - },{ - "name":"Seller", - "simulator":{ - "type":"MonitorRoleSimulator", - "module":"scribble.examples.RequestResponse", - "role":"Seller", - "protocol":"First" - } - }] -} ----- - -The trace file has the following top level elements: - -* name - -The name of the trace. - -* steps - -A list of steps documenting the message trace. - -* roles - -The definition of the roles used within the trace. The roles can optionally have a _simulator_ that defines how the role, based on the steps in the trace, can be simulated against a scribble protocol definition. - - - -Currently only one type of _step_ is supported, the _MessageTransfer_. This defines the message definition, and the _from_ to _to_ roles. - -A role definition contains a name property, and an optional simulator definition. Role simulator definitions only need to be provided for the roles that you are interested in being simulated. - -The only type of role simulator currently supported is the _MonitorRoleSimulator_ which uses the Scribble protocol monitor to evaluate the message trace against the specified local protocol. The _module_ property is used to locate the scribble module, and the _protocol_ property identifies the protocol within the module. The _role_ property identifies the role name within the protocol, which may be different to the one used in the trace. - -When the trace has been defined, select the _Run As_ -> _Simulation_ context menu item associated with either the file, or a folder in which it is contains (if you wish to simulate multiple trace files at the same time). The results from the simulation will be displayed in the JUnit result view. If any simulation steps failed, they will be shown against a red cross. - - - diff --git a/docs/userguide/en-US/ScribbleJavaUserGuide-docinfo.xml b/docs/userguide/en-US/ScribbleJavaUserGuide-docinfo.xml deleted file mode 100644 index 4944b7aed..000000000 --- a/docs/userguide/en-US/ScribbleJavaUserGuide-docinfo.xml +++ /dev/null @@ -1,14 +0,0 @@ - -    Gary -     Brown - - Red Hat -     -   - - - - 2012-2014 - - diff --git a/docs/userguide/en-US/ScribbleJavaUserGuide.asciidoc b/docs/userguide/en-US/ScribbleJavaUserGuide.asciidoc deleted file mode 100644 index 9071765cf..000000000 --- a/docs/userguide/en-US/ScribbleJavaUserGuide.asciidoc +++ /dev/null @@ -1,8 +0,0 @@ -Scribble Java User Guide -======================== -:doctype: book - -include::SJUGEclipse.asciidoc[] - -include::SJUGCommandLine.asciidoc[] - diff --git a/docs/userguide/en-US/_Sidebar.asciidoc b/docs/userguide/en-US/_Sidebar.asciidoc deleted file mode 100644 index 71dd9150d..000000000 --- a/docs/userguide/en-US/_Sidebar.asciidoc +++ /dev/null @@ -1,9 +0,0 @@ -.Contents -**** -link:PLGOverview[Overview] + -link:PLGDefiningAProtocol[Defining A Protocol] + -link:PLGAdvancedConstructs[Advanced Constructs] + -link:PLGProjection[Projection] + -**** - - diff --git a/docs/userguide/pom.xml b/docs/userguide/pom.xml deleted file mode 100644 index 1c756acd3..000000000 --- a/docs/userguide/pom.xml +++ /dev/null @@ -1,118 +0,0 @@ - - - 4.0.0 - - org.scribble.docs - scribble-userguide - jdocbook - Scribble::Docs::UserGuide - The tooling user guide for Scribble Java. - https://github.com/scribble/scribble-java/wiki - 2013 - - - org.scribble.docs - parent - 0.3.2-SNAPSHOT - - - - - - org.asciidoctor - asciidoctor-maven-plugin - 0.1.1 - - - output-docbook - generate-resources - - process-asciidoc - - - - - en-US - target/docbook/en-US - docbook - book - - - - org.jboss.maven.plugins - maven-jdocbook-plugin - 2.3.8 - true - - - org.jboss.pressgang - pressgang-xslt-ns - 2.0.2 - - - org.jboss.pressgang - pressgang-jdocbook-style - jdocbook-style - 2.0.2 - - - - - ScribbleJavaUserGuide.xml - target/docbook/ - - ${basedir} - - images/* - - - - - - - - html - classpath:/xslt/org/jboss/xhtml.xsl - index.html - - - html_single - classpath:/xslt/org/jboss/xhtml-single.xsl - index.html - - - pdf - classpath:/xslt/org/jboss/pdf.xsl - Scribble_Java_User_Guide.pdf - - - - true - saxon - - - - 1.72.0 - - - javax.xml.parsers.DocumentBuilderFactory - org.apache.xerces.jaxp.DocumentBuilderFactoryImpl - - - javax.xml.parsers.SAXParserFactory - org.apache.xerces.jaxp.SAXParserFactoryImpl - - - - - - - - - - diff --git a/extensions/monitor-rest/pom.xml b/extensions/monitor-rest/pom.xml deleted file mode 100644 index bef5ab28b..000000000 --- a/extensions/monitor-rest/pom.xml +++ /dev/null @@ -1,50 +0,0 @@ - - 4.0.0 - scribble-monitor-rest - jar - 0.3.2-SNAPSHOT - Scribble::Extensions::Monitor REST - - - org.scribble - extensions - 0.3.2-SNAPSHOT - - - - - org.scribble - scribble-core - ${project.version} - - - org.scribble - scribble-monitor - ${project.version} - - - org.codehaus.jackson - jackson-core-asl - provided - - - org.codehaus.jackson - jackson-mapper-asl - provided - - - - org.scribble - scribble-parser - ${project.version} - test - - - junit - junit - test - - - - diff --git a/extensions/monitor-rest/src/main/java/org/scribble/monitor/rest/RESTMessage.java b/extensions/monitor-rest/src/main/java/org/scribble/monitor/rest/RESTMessage.java deleted file mode 100644 index 67f56caf9..000000000 --- a/extensions/monitor-rest/src/main/java/org/scribble/monitor/rest/RESTMessage.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.rest; - -/** - * This class represents a message being sent or received by the - * role being monitored. - * - */ -public class RESTMessage { - - public static final String METHOD_GET="GET"; - public static final String METHOD_PUT="PUT"; - public static final String METHOD_POST="POST"; - public static final String METHOD_DELETE="DELETE"; - - private String _method; - private java.util.List _path=new java.util.ArrayList(); - private java.util.Map _queryParameters=new java.util.HashMap(); - private String _content; - - /** - * This method returns the method. - * - * @return The method - */ - public String getMethod() { - return (_method); - } - - /** - * This method sets the method. - * - * @param method The method - */ - public void setMethod(String method) { - _method = method; - } - - /** - * This method returns the path. - * - * @return The path - */ - public java.util.List getPath() { - return (_path); - } - - /** - * This method sets the path. - * - * @param path The path - */ - public void setPath(java.util.List path) { - _path = path; - } - - /** - * This method returns the path. - * - * @return The path - */ - public java.util.Map getQueryParameters() { - return (_queryParameters); - } - - /** - * This method sets the path. - * - * @param path The path - */ - public void setQueryParameters(java.util.Map params) { - _queryParameters = params; - } - - /** - * This method returns the content. - * - * @return The content - */ - public String getContent() { - return (_content); - } - - /** - * This method sets the content. - * - * @param content The content - */ - public void setContent(String content) { - _content = content; - } -} diff --git a/extensions/monitor-rest/src/main/java/org/scribble/monitor/rest/RESTMessageComparator.java b/extensions/monitor-rest/src/main/java/org/scribble/monitor/rest/RESTMessageComparator.java deleted file mode 100644 index 13ba5d287..000000000 --- a/extensions/monitor-rest/src/main/java/org/scribble/monitor/rest/RESTMessageComparator.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.rest; - -import org.scribble.monitor.model.Annotation; -import org.scribble.monitor.model.MessageNode; -import org.scribble.monitor.model.Parameter; -import org.scribble.monitor.runtime.MessageComparator; - -/** - * This class provides the default message comparator implementation. - * - */ -public class RESTMessageComparator implements MessageComparator { - - private String _method; - private String[] _parts; - private java.util.List _parameters; - - private boolean _evaluated=false; - - /** - * This is the constructor to initialize the message comparator. - * - * @param node The message node - */ - public RESTMessageComparator(MessageNode node) { - Annotation ann=node.getAnnotation("REST"); - - if (ann != null) { - _method = ann.getValue("method"); - - String path=ann.getValue("path"); - - java.util.List parts=new java.util.ArrayList(); - - java.util.StringTokenizer iter=new java.util.StringTokenizer(path, "/"); - - while (iter.hasMoreTokens()) { - parts.add(iter.nextToken()); - } - - _parts = new String[parts.size()]; - - parts.toArray(_parts); - } - - _parameters = node.getParameters(); - } - - /** - * {@inheritDoc} - */ - public boolean isMatch(Object message) { - boolean ret=false; - - if (message instanceof RESTMessage) { - RESTMessage rm=(RESTMessage)message; - - if (_method.equals(rm.getMethod()) - && rm.getPath().size() == _parts.length) { - - java.util.Map pathParams=null; - - for (int i=0; i < _parts.length; i++) { - if (_parts[i].charAt(0) == '{' - && _parts[i].charAt(_parts[i].length()-1) == '}') { - - if (_evaluated) { - if (pathParams == null) { - pathParams = new java.util.HashMap(); - } - pathParams.put(_parts[i].substring(1, _parts[i].length()-1), rm.getPath().get(i)); - } - - } else if (!rm.getPath().get(i).equals(_parts[i])) { - // Mismatched path part - return (false); - } - } - - if (_parameters != null && _evaluated) { - String[] values=new String[_parameters.size()]; - boolean f_usedContent=false; - - // TODO: Maybe if single parameter without annotation, then - // could be mapped to POST content? But then need to ensure only - // single non-annotation parameter. - - // Check parameter mappings - for (int i=0; i < _parameters.size(); i++) { - Annotation pann=_parameters.get(i).getAnnotation("REST"); - - if (pann != null) { - String query=pann.getValue("query"); - - if (query != null && rm.getQueryParameters().containsKey(query)) { - values[i] = rm.getQueryParameters().get(query); - - } else { - String path=pann.getValue("path"); - - if (path != null && pathParams.containsKey(path)) { - values[i] = pathParams.get(path); - } - } - } else if (_method.equals("POST") && !f_usedContent) { - values[i] = rm.getContent(); - f_usedContent = true; - } - } - - // TODO: Check that values for all parameters are available ???? Or - // should assertions just fail? - - // TODO: Maybe could include a component for evaluating the message content format, which - // would be used to extract info required for assertions. The extracted path parameters - // and query parameters would also be relevant for assertions, with the mapping to the - // operation parameters in the scribble message transfer. - } - - return (true); - } - } - - return (ret); - } - -} diff --git a/extensions/monitor-rest/src/main/java/org/scribble/monitor/rest/RESTMessageComparatorFactory.java b/extensions/monitor-rest/src/main/java/org/scribble/monitor/rest/RESTMessageComparatorFactory.java deleted file mode 100644 index f5645d7f0..000000000 --- a/extensions/monitor-rest/src/main/java/org/scribble/monitor/rest/RESTMessageComparatorFactory.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.rest; - -import org.scribble.monitor.model.MessageNode; -import org.scribble.monitor.runtime.MessageComparator; -import org.scribble.monitor.runtime.MessageComparatorFactory; - -/** - * This class provides the REST implementation of the message comparator factory. - * - */ -public class RESTMessageComparatorFactory implements MessageComparatorFactory { - - private static final String REST = "REST"; - - /** - * {@inheritDoc} - */ - public MessageComparator create(MessageNode node) { - if (node.getAnnotation(REST) != null) { - return (new RESTMessageComparator(node)); - } - return (null); - } - -} diff --git a/extensions/monitor-rest/src/main/resources/org/scribble/monitor/Messages.properties b/extensions/monitor-rest/src/main/resources/org/scribble/monitor/Messages.properties deleted file mode 100644 index 81a38783f..000000000 --- a/extensions/monitor-rest/src/main/resources/org/scribble/monitor/Messages.properties +++ /dev/null @@ -1,17 +0,0 @@ -#/* -# * Copyright 2009-10 Scribble.org -# * -# * Licensed under the Apache License, Version 2.0 (the "License"); -# * you may not use this file except in compliance with the License. -# * You may obtain a copy of the License at -# * -# * http://www.apache.org/licenses/LICENSE-2.0 -# * -# * Unless required by applicable law or agreed to in writing, software -# * distributed under the License is distributed on an "AS IS" BASIS, -# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# * See the License for the specific language governing permissions and -# * limitations under the License. -# * -# */ - diff --git a/extensions/monitor-rest/src/test/java/org/scribble/monitor/rest/RESTMonitorTest.java b/extensions/monitor-rest/src/test/java/org/scribble/monitor/rest/RESTMonitorTest.java deleted file mode 100644 index 09075a7ba..000000000 --- a/extensions/monitor-rest/src/test/java/org/scribble/monitor/rest/RESTMonitorTest.java +++ /dev/null @@ -1,243 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.rest; - -import static org.junit.Assert.*; - -import org.junit.Test; -import org.scribble.monitor.model.Annotation; -import org.scribble.monitor.model.Receive; -import org.scribble.monitor.model.Send; -import org.scribble.monitor.model.SessionType; -import org.scribble.monitor.model.Parameter; -import org.scribble.monitor.runtime.DefaultMonitor; -import org.scribble.monitor.rest.RESTMessage; -import org.scribble.monitor.runtime.DefaultMonitorContext; -import org.scribble.monitor.runtime.Monitor; -import org.scribble.monitor.runtime.SessionInstance; - -public class RESTMonitorTest { - - private static final String ROLE1 = "Role1"; - - private static final String OP1 = "op1"; - private static final String OP2 = "op2"; - - private static final String TYPE1 = "type1"; - private static final String TYPE2 = "type2"; - private static final String TYPE3 = "type3"; - - @Test - public void testGetRequestResponse() { - Monitor monitor=new DefaultMonitor(); - - DefaultMonitorContext context=new DefaultMonitorContext(); - ((DefaultMonitor)monitor).setMonitorContext(context); - - context.register(new RESTMessageComparatorFactory()); - - SessionType type=new SessionType(); - - Send s1=new Send(); - s1.setOperator(OP1); - - Parameter t1=new Parameter("f", TYPE1); - Annotation t1ann=new Annotation(); - t1ann.setName("REST"); - t1ann.addProperty("query", "field"); - t1.getAnnotations().add(t1ann); - - Parameter t2=new Parameter("c", TYPE2); - Annotation t2ann=new Annotation(); - t2ann.setName("REST"); - t2ann.addProperty("path", "customer"); - t2.getAnnotations().add(t2ann); - - s1.getParameters().add(t1); - s1.getParameters().add(t2); - s1.setToRole(ROLE1); - s1.setNext(1); - - Annotation s1ann=new Annotation(); - s1ann.setName("REST"); - s1ann.addProperty("method", RESTMessage.METHOD_GET); - s1ann.addProperty("path", "/customer/{customer}/address"); - - s1.getAnnotations().add(s1ann); - - type.getNodes().add(s1); - - Receive r1=new Receive(); - r1.setOperator(OP2); - - Parameter t3=new Parameter("v", TYPE3); - - r1.getParameters().add(t3); - r1.setFromRole(ROLE1); - - Annotation r1ann=new Annotation(); - r1ann.setName("REST"); - r1ann.addProperty("method", RESTMessage.METHOD_GET); - r1ann.addProperty("path", "/customer/{customer}/address"); - - r1.getAnnotations().add(r1ann); - - type.getNodes().add(r1); - - SessionInstance instance=new SessionInstance(); - - monitor.initializeInstance(type, instance); - - RESTMessage m1=new RESTMessage(); - m1.setMethod(RESTMessage.METHOD_GET); - m1.getPath().add("customer"); - m1.getPath().add("fred"); - m1.getPath().add("address"); - m1.getQueryParameters().put("field","postcode"); - - RESTMessage badm2=new RESTMessage(); - badm2.setMethod(RESTMessage.METHOD_GET); - badm2.getPath().add("customer"); - badm2.getPath().add("fred"); - badm2.getPath().add("notaddress"); - badm2.setContent("{ \"id\":\"12345\" }"); - - RESTMessage m2=new RESTMessage(); - m2.setMethod(RESTMessage.METHOD_GET); - m2.getPath().add("customer"); - m2.getPath().add("fred"); - m2.getPath().add("address"); - m2.setContent("{ \"id\":\"12345\" }"); - - if (!monitor.sent(type, instance, m1, null)) { - fail("Sent message not expected"); - } - - if (monitor.received(type, instance, badm2, null)) { - fail("Received message should NOT be expected"); - } - - if (instance.hasCompleted()) { - fail("Session should NOT be completed"); - } - - if (!monitor.received(type, instance, m2, null)) { - fail("Received message not expected"); - } - - if (!instance.hasCompleted()) { - fail("Session hasn't completed"); - } - } - - @Test - public void testPostRequestResponse() { - Monitor monitor=new DefaultMonitor(); - - DefaultMonitorContext context=new DefaultMonitorContext(); - ((DefaultMonitor)monitor).setMonitorContext(context); - - context.register(new RESTMessageComparatorFactory()); - - SessionType type=new SessionType(); - - Send s1=new Send(); - s1.setOperator(OP1); - - // First parameter will represent the POST content - Parameter t1=new Parameter("v", TYPE1); - - Parameter t2=new Parameter("c", TYPE2); - Annotation t2ann=new Annotation(); - t2ann.setName("REST"); - t2ann.addProperty("path", "customer"); - t2.getAnnotations().add(t2ann); - - s1.getParameters().add(t1); - s1.getParameters().add(t2); - s1.setToRole(ROLE1); - s1.setNext(1); - - Annotation s1ann=new Annotation(); - s1ann.setName("REST"); - s1ann.addProperty("method", RESTMessage.METHOD_POST); - s1ann.addProperty("path", "/customer/{customer}/invoice"); - - s1.getAnnotations().add(s1ann); - - type.getNodes().add(s1); - - Receive r1=new Receive(); - r1.setOperator(OP2); - - Parameter t3=new Parameter("r", TYPE3); - - r1.getParameters().add(t3); - r1.setFromRole(ROLE1); - - Annotation r1ann=new Annotation(); - r1ann.setName("REST"); - r1ann.addProperty("method", RESTMessage.METHOD_POST); - r1ann.addProperty("path", "/customer/{customer}/invoice"); - - r1.getAnnotations().add(r1ann); - - type.getNodes().add(r1); - - SessionInstance instance=new SessionInstance(); - - monitor.initializeInstance(type, instance); - - RESTMessage m1=new RESTMessage(); - m1.setMethod(RESTMessage.METHOD_POST); - m1.getPath().add("customer"); - m1.getPath().add("fred"); - m1.getPath().add("invoice"); - m1.setContent("{ \"id\":\"12345\" }"); - - RESTMessage badm2=new RESTMessage(); - badm2.setMethod(RESTMessage.METHOD_POST); - badm2.getPath().add("customer"); - badm2.getPath().add("fred"); - badm2.getPath().add("notinvoice"); - badm2.setContent("{ \"id\":\"54321\" }"); - - RESTMessage m2=new RESTMessage(); - m2.setMethod(RESTMessage.METHOD_POST); - m2.getPath().add("customer"); - m2.getPath().add("fred"); - m2.getPath().add("invoice"); - m2.setContent("{ \"id\":\"54321\" }"); - - if (!monitor.sent(type, instance, m1, null)) { - fail("Sent message not expected"); - } - - if (monitor.received(type, instance, badm2, null)) { - fail("Received message should NOT be expected"); - } - - if (!monitor.received(type, instance, m2, null)) { - fail("Received message not expected"); - } - - if (!instance.hasCompleted()) { - fail("Session hasn't completed"); - } - } - -} diff --git a/extensions/monitor-rest/src/test/resources/scribble/examples/Choice_Buyer.monitor b/extensions/monitor-rest/src/test/resources/scribble/examples/Choice_Buyer.monitor deleted file mode 100644 index 2f41b7556..000000000 --- a/extensions/monitor-rest/src/test/resources/scribble/examples/Choice_Buyer.monitor +++ /dev/null @@ -1 +0,0 @@ -{"nodes":[{"type":"Send","next":1,"operator":"op1","toRole":"Seller","types":["{http://scribble.org/example}M1"]},{"type":"Choice","next":4,"pathIndexes":[2,3]},{"type":"Receive","fromRole":"Seller","next":-1,"operator":"op2","types":["{http://scribble.org/example}M2"]},{"type":"Receive","fromRole":"Seller","next":-1,"operator":"op3","types":["{http://scribble.org/example}M3"]},{"type":"Send","next":-1,"operator":"op4","toRole":"Seller","types":["{http://scribble.org/example}M4"]}]} diff --git a/extensions/monitor-rest/src/test/resources/scribble/examples/Choice_Buyer.scr b/extensions/monitor-rest/src/test/resources/scribble/examples/Choice_Buyer.scr deleted file mode 100644 index 81b736dec..000000000 --- a/extensions/monitor-rest/src/test/resources/scribble/examples/Choice_Buyer.scr +++ /dev/null @@ -1,18 +0,0 @@ -module scribble.examples.Choice; - -type "{http://scribble.org/example}M1" from "http://scribble.org/schema/Example.xsd" as M1; -type "{http://scribble.org/example}M2" from "http://scribble.org/schema/Example.xsd" as M2; -type "{http://scribble.org/example}M3" from "http://scribble.org/schema/Example.xsd" as M3; -type "{http://scribble.org/example}M4" from "http://scribble.org/schema/Example.xsd" as M4; - -local protocol First at Buyer (role Buyer, role Seller) { - op1(M1) to Seller; - - choice at Seller { - op2(M2) from Seller; - } or { - op3(M3) from Seller; - } - - op4(M4) to Seller; -} \ No newline at end of file diff --git a/extensions/monitor-rest/src/test/resources/scribble/examples/Do_Buyer.monitor b/extensions/monitor-rest/src/test/resources/scribble/examples/Do_Buyer.monitor deleted file mode 100644 index 2df4c7511..000000000 --- a/extensions/monitor-rest/src/test/resources/scribble/examples/Do_Buyer.monitor +++ /dev/null @@ -1 +0,0 @@ -{"nodes":[{"type":"Send","next":1,"operator":"op1","toRole":"Seller","types":["{http://scribble.org/example}M1"]},{"type":"Do","next":3,"protocolIndex":2},{"type":"Receive","fromRole":"Seller","next":-1,"operator":"op2","types":["{http://scribble.org/example}M2"]},{"type":"Send","next":-1,"operator":"op3","toRole":"Seller","types":["{http://scribble.org/example}M3"]}]} diff --git a/extensions/monitor-rest/src/test/resources/scribble/examples/Do_Buyer.scr b/extensions/monitor-rest/src/test/resources/scribble/examples/Do_Buyer.scr deleted file mode 100644 index 0378746cc..000000000 --- a/extensions/monitor-rest/src/test/resources/scribble/examples/Do_Buyer.scr +++ /dev/null @@ -1,17 +0,0 @@ -module scribble.examples.Do; - -type "{http://scribble.org/example}M1" from "http://scribble.org/schema/Example.xsd" as M1; -type "{http://scribble.org/example}M2" from "http://scribble.org/schema/Example.xsd" as M2; -type "{http://scribble.org/example}M3" from "http://scribble.org/schema/Example.xsd" as M3; - -local protocol First at Buyer (role Buyer, role Seller) { - op1(M1) to Seller; - - do Second(Buyer, Seller); - - op3(M3) to Seller; -} - -local protocol Second at Buyer (role Buyer, role Seller) { - op2(M2) from Seller; -} \ No newline at end of file diff --git a/extensions/monitor-rest/src/test/resources/scribble/examples/Interruptible2_Buyer.monitor b/extensions/monitor-rest/src/test/resources/scribble/examples/Interruptible2_Buyer.monitor deleted file mode 100644 index 0edbc87a7..000000000 --- a/extensions/monitor-rest/src/test/resources/scribble/examples/Interruptible2_Buyer.monitor +++ /dev/null @@ -1 +0,0 @@ -{"nodes":[{"type":"Send","next":1,"operator":"op1","toRole":"Seller","types":["{http://scribble.org/example}M1"]},{"type":"Interruptible","blockIndex":2,"catches":6,"next":10,"throws":3},{"type":"Receive","fromRole":"Seller","next":-1,"operator":"op2","types":["{http://scribble.org/example}M2"]},{"type":"Choice","next":-1,"pathIndexes":[4,5]},{"type":"Send","next":-1,"operator":"op3","toRole":"Seller2","types":["{http://scribble.org/example}M3"]},{"type":"Send","next":-1,"operator":"op4","toRole":"Seller2","types":["{http://scribble.org/example}M4"]},{"type":"Choice","next":-1,"pathIndexes":[7,8,9]},{"type":"Receive","fromRole":"Seller2","next":-1,"operator":"op5","types":["{http://scribble.org/example}M5"]},{"type":"Receive","fromRole":"Seller2","next":-1,"operator":"op6","types":["{http://scribble.org/example}M6"]},{"type":"Receive","fromRole":"Seller","next":-1,"operator":"op7","types":["{http://scribble.org/example}M7"]},{"type":"Send","next":-1,"operator":"op8","toRole":"Seller","types":["{http://scribble.org/example}M8"]}]} diff --git a/extensions/monitor-rest/src/test/resources/scribble/examples/Interruptible2_Buyer.scr b/extensions/monitor-rest/src/test/resources/scribble/examples/Interruptible2_Buyer.scr deleted file mode 100644 index d7f340b40..000000000 --- a/extensions/monitor-rest/src/test/resources/scribble/examples/Interruptible2_Buyer.scr +++ /dev/null @@ -1,25 +0,0 @@ -module scribble.examples.Interruptible2; - -type "{http://scribble.org/example}M1" from "http://scribble.org/schema/Example.xsd" as M1; -type "{http://scribble.org/example}M2" from "http://scribble.org/schema/Example.xsd" as M2; -type "{http://scribble.org/example}M3" from "http://scribble.org/schema/Example.xsd" as M3; -type "{http://scribble.org/example}M4" from "http://scribble.org/schema/Example.xsd" as M4; -type "{http://scribble.org/example}M5" from "http://scribble.org/schema/Example.xsd" as M5; -type "{http://scribble.org/example}M6" from "http://scribble.org/schema/Example.xsd" as M6; -type "{http://scribble.org/example}M7" from "http://scribble.org/schema/Example.xsd" as M7; -type "{http://scribble.org/example}M8" from "http://scribble.org/schema/Example.xsd" as M8; - -local protocol First at Buyer (role Buyer, role Seller, role Seller2) { - op1(M1) to Seller; - - interruptible TestScope: { - op2(M2) from Seller; - - } with { - throws op3(M3),op4(M4) to Seller, Seller2; - catches op5(M5),op6(M6) from Seller2; - catches op7(M7) from Seller; - } - - op8(M8) to Seller; -} diff --git a/extensions/monitor-rest/src/test/resources/scribble/examples/Interruptible_Buyer.monitor b/extensions/monitor-rest/src/test/resources/scribble/examples/Interruptible_Buyer.monitor deleted file mode 100644 index e944cc336..000000000 --- a/extensions/monitor-rest/src/test/resources/scribble/examples/Interruptible_Buyer.monitor +++ /dev/null @@ -1 +0,0 @@ -{"nodes":[{"type":"Send","next":1,"operator":"op1","toRole":"Seller","types":["{http://scribble.org/example}M1"]},{"type":"Interruptible","blockIndex":2,"catches":4,"next":5,"throws":3},{"type":"Receive","fromRole":"Seller","next":-1,"operator":"op2","types":["{http://scribble.org/example}M2"]},{"type":"Send","next":-1,"operator":"op3","toRole":"Seller","types":["{http://scribble.org/example}M3"]},{"type":"Receive","fromRole":"Seller","next":-1,"operator":"op4","types":["{http://scribble.org/example}M4"]},{"type":"Send","next":-1,"operator":"op5","toRole":"Seller","types":["{http://scribble.org/example}M5"]}]} diff --git a/extensions/monitor-rest/src/test/resources/scribble/examples/Interruptible_Buyer.scr b/extensions/monitor-rest/src/test/resources/scribble/examples/Interruptible_Buyer.scr deleted file mode 100644 index cd854b763..000000000 --- a/extensions/monitor-rest/src/test/resources/scribble/examples/Interruptible_Buyer.scr +++ /dev/null @@ -1,21 +0,0 @@ -module scribble.examples.Interruptible; - -type "{http://scribble.org/example}M1" from "http://scribble.org/schema/Example.xsd" as M1; -type "{http://scribble.org/example}M2" from "http://scribble.org/schema/Example.xsd" as M2; -type "{http://scribble.org/example}M3" from "http://scribble.org/schema/Example.xsd" as M3; -type "{http://scribble.org/example}M4" from "http://scribble.org/schema/Example.xsd" as M4; -type "{http://scribble.org/example}M5" from "http://scribble.org/schema/Example.xsd" as M5; - -local protocol First at Buyer (role Buyer, role Seller) { - op1(M1) to Seller; - - interruptible TestScope: { - op2(M2) from Seller; - - } with { - throws op3(M3) to Seller; - catches op4(M4) from Seller; - } - - op5(M5) to Seller; -} diff --git a/extensions/monitor-rest/src/test/resources/scribble/examples/Parallel2_Buyer.monitor b/extensions/monitor-rest/src/test/resources/scribble/examples/Parallel2_Buyer.monitor deleted file mode 100644 index 282488e42..000000000 --- a/extensions/monitor-rest/src/test/resources/scribble/examples/Parallel2_Buyer.monitor +++ /dev/null @@ -1 +0,0 @@ -{"nodes":[{"type":"Parallel","next":-1,"pathIndexes":[1,2]},{"type":"Receive","fromRole":"Seller","next":-1,"operator":"op2","types":["{http://scribble.org/example}M2"]},{"type":"Receive","fromRole":"Seller","next":-1,"operator":"op3","types":["{http://scribble.org/example}M3"]}]} diff --git a/extensions/monitor-rest/src/test/resources/scribble/examples/Parallel2_Buyer.scr b/extensions/monitor-rest/src/test/resources/scribble/examples/Parallel2_Buyer.scr deleted file mode 100644 index bdb68b950..000000000 --- a/extensions/monitor-rest/src/test/resources/scribble/examples/Parallel2_Buyer.scr +++ /dev/null @@ -1,14 +0,0 @@ -module scribble.examples.Parallel; - -type "{http://scribble.org/example}M1" from "http://scribble.org/schema/Example.xsd" as M1; -type "{http://scribble.org/example}M2" from "http://scribble.org/schema/Example.xsd" as M2; -type "{http://scribble.org/example}M3" from "http://scribble.org/schema/Example.xsd" as M3; -type "{http://scribble.org/example}M4" from "http://scribble.org/schema/Example.xsd" as M4; - -local protocol First at Buyer (role Buyer, role Seller) { - par { - op2(M2) from Seller; - } and { - op3(M3) from Seller; - } -} \ No newline at end of file diff --git a/extensions/monitor-rest/src/test/resources/scribble/examples/Parallel3_Buyer.monitor b/extensions/monitor-rest/src/test/resources/scribble/examples/Parallel3_Buyer.monitor deleted file mode 100644 index bf209271a..000000000 --- a/extensions/monitor-rest/src/test/resources/scribble/examples/Parallel3_Buyer.monitor +++ /dev/null @@ -1 +0,0 @@ -{"nodes":[{"type":"Parallel","next":-1,"pathIndexes":[1]},{"type":"Receive","fromRole":"Seller","next":-1,"operator":"op2","types":["{http://scribble.org/example}M2"]}]} diff --git a/extensions/monitor-rest/src/test/resources/scribble/examples/Parallel3_Buyer.scr b/extensions/monitor-rest/src/test/resources/scribble/examples/Parallel3_Buyer.scr deleted file mode 100644 index 17216a2cd..000000000 --- a/extensions/monitor-rest/src/test/resources/scribble/examples/Parallel3_Buyer.scr +++ /dev/null @@ -1,13 +0,0 @@ -module scribble.examples.Parallel; - -type "{http://scribble.org/example}M1" from "http://scribble.org/schema/Example.xsd" as M1; -type "{http://scribble.org/example}M2" from "http://scribble.org/schema/Example.xsd" as M2; -type "{http://scribble.org/example}M3" from "http://scribble.org/schema/Example.xsd" as M3; -type "{http://scribble.org/example}M4" from "http://scribble.org/schema/Example.xsd" as M4; - -local protocol First at Buyer (role Buyer, role Seller) { - par { - op2(M2) from Seller; - } and { - } -} \ No newline at end of file diff --git a/extensions/monitor-rest/src/test/resources/scribble/examples/Parallel4_Buyer.monitor b/extensions/monitor-rest/src/test/resources/scribble/examples/Parallel4_Buyer.monitor deleted file mode 100644 index bf209271a..000000000 --- a/extensions/monitor-rest/src/test/resources/scribble/examples/Parallel4_Buyer.monitor +++ /dev/null @@ -1 +0,0 @@ -{"nodes":[{"type":"Parallel","next":-1,"pathIndexes":[1]},{"type":"Receive","fromRole":"Seller","next":-1,"operator":"op2","types":["{http://scribble.org/example}M2"]}]} diff --git a/extensions/monitor-rest/src/test/resources/scribble/examples/Parallel4_Buyer.scr b/extensions/monitor-rest/src/test/resources/scribble/examples/Parallel4_Buyer.scr deleted file mode 100644 index 246514957..000000000 --- a/extensions/monitor-rest/src/test/resources/scribble/examples/Parallel4_Buyer.scr +++ /dev/null @@ -1,13 +0,0 @@ -module scribble.examples.Parallel; - -type "{http://scribble.org/example}M1" from "http://scribble.org/schema/Example.xsd" as M1; -type "{http://scribble.org/example}M2" from "http://scribble.org/schema/Example.xsd" as M2; -type "{http://scribble.org/example}M3" from "http://scribble.org/schema/Example.xsd" as M3; -type "{http://scribble.org/example}M4" from "http://scribble.org/schema/Example.xsd" as M4; - -local protocol First at Buyer (role Buyer, role Seller) { - par { - } and { - op2(M2) from Seller; - } -} \ No newline at end of file diff --git a/extensions/monitor-rest/src/test/resources/scribble/examples/Parallel_Buyer.monitor b/extensions/monitor-rest/src/test/resources/scribble/examples/Parallel_Buyer.monitor deleted file mode 100644 index 0b02ccf8b..000000000 --- a/extensions/monitor-rest/src/test/resources/scribble/examples/Parallel_Buyer.monitor +++ /dev/null @@ -1 +0,0 @@ -{"nodes":[{"type":"Send","next":1,"operator":"op1","toRole":"Seller","types":["{http://scribble.org/example}M1"]},{"type":"Parallel","next":4,"pathIndexes":[2,3]},{"type":"Receive","fromRole":"Seller","next":-1,"operator":"op2","types":["{http://scribble.org/example}M2"]},{"type":"Receive","fromRole":"Seller","next":-1,"operator":"op3","types":["{http://scribble.org/example}M3"]},{"type":"Send","next":-1,"operator":"op4","toRole":"Seller","types":["{http://scribble.org/example}M4"]}]} diff --git a/extensions/monitor-rest/src/test/resources/scribble/examples/Parallel_Buyer.scr b/extensions/monitor-rest/src/test/resources/scribble/examples/Parallel_Buyer.scr deleted file mode 100644 index da4bbf1b8..000000000 --- a/extensions/monitor-rest/src/test/resources/scribble/examples/Parallel_Buyer.scr +++ /dev/null @@ -1,18 +0,0 @@ -module scribble.examples.Parallel; - -type "{http://scribble.org/example}M1" from "http://scribble.org/schema/Example.xsd" as M1; -type "{http://scribble.org/example}M2" from "http://scribble.org/schema/Example.xsd" as M2; -type "{http://scribble.org/example}M3" from "http://scribble.org/schema/Example.xsd" as M3; -type "{http://scribble.org/example}M4" from "http://scribble.org/schema/Example.xsd" as M4; - -local protocol First at Buyer (role Buyer, role Seller) { - op1(M1) to Seller; - - par { - op2(M2) from Seller; - } and { - op3(M3) from Seller; - } - - op4(M4) to Seller; -} \ No newline at end of file diff --git a/extensions/monitor-rest/src/test/resources/scribble/examples/Recursion_Buyer.monitor b/extensions/monitor-rest/src/test/resources/scribble/examples/Recursion_Buyer.monitor deleted file mode 100644 index 821f63ffe..000000000 --- a/extensions/monitor-rest/src/test/resources/scribble/examples/Recursion_Buyer.monitor +++ /dev/null @@ -1 +0,0 @@ -{"nodes":[{"type":"Send","next":1,"operator":"op1","toRole":"Seller","types":["{http://scribble.org/example}M1"]},{"type":"Recursion","blockIndex":2,"next":7},{"type":"Receive","fromRole":"Seller","next":3,"operator":"op2","types":["{http://scribble.org/example}M2"]},{"type":"Choice","next":-1,"pathIndexes":[4,6]},{"type":"Receive","fromRole":"Seller","next":5,"operator":"op3","types":["{http://scribble.org/example}M3"]},{"type":"Continue","next":2},{"type":"Receive","fromRole":"Seller","next":-1,"operator":"op4","types":["{http://scribble.org/example}M4"]},{"type":"Send","next":-1,"operator":"op5","toRole":"Seller","types":["{http://scribble.org/example}M5"]}]} diff --git a/extensions/monitor-rest/src/test/resources/scribble/examples/Recursion_Buyer.scr b/extensions/monitor-rest/src/test/resources/scribble/examples/Recursion_Buyer.scr deleted file mode 100644 index 4e62a9b66..000000000 --- a/extensions/monitor-rest/src/test/resources/scribble/examples/Recursion_Buyer.scr +++ /dev/null @@ -1,24 +0,0 @@ -module scribble.examples.Recursion; - -type "{http://scribble.org/example}M1" from "http://scribble.org/schema/Example.xsd" as M1; -type "{http://scribble.org/example}M2" from "http://scribble.org/schema/Example.xsd" as M2; -type "{http://scribble.org/example}M3" from "http://scribble.org/schema/Example.xsd" as M3; -type "{http://scribble.org/example}M4" from "http://scribble.org/schema/Example.xsd" as M4; -type "{http://scribble.org/example}M5" from "http://scribble.org/schema/Example.xsd" as M5; - -local protocol First at Buyer (role Buyer, role Seller) { - op1(M1) to Seller; - - rec MyLabel { - op2(M2) from Seller; - - choice at Seller { - op3(M3) from Seller; - continue MyLabel; - } or { - op4(M4) from Seller; - } - } - - op5(M5) to Seller; -} diff --git a/extensions/monitor-rest/src/test/resources/scribble/examples/RequestResponse_Buyer.monitor b/extensions/monitor-rest/src/test/resources/scribble/examples/RequestResponse_Buyer.monitor deleted file mode 100644 index a0bef8aa0..000000000 --- a/extensions/monitor-rest/src/test/resources/scribble/examples/RequestResponse_Buyer.monitor +++ /dev/null @@ -1 +0,0 @@ -{"nodes":[{"type":"Send","next":1,"operator":"buy","toRole":"Seller","types":["{http://scribble.org/example}OrderRequest"]},{"type":"Receive","fromRole":"Seller","next":-1,"operator":"buy","types":["{http://scribble.org/example}OrderResponse"]}]} diff --git a/extensions/monitor-rest/src/test/resources/scribble/examples/RequestResponse_Buyer.scr b/extensions/monitor-rest/src/test/resources/scribble/examples/RequestResponse_Buyer.scr deleted file mode 100644 index fcde30739..000000000 --- a/extensions/monitor-rest/src/test/resources/scribble/examples/RequestResponse_Buyer.scr +++ /dev/null @@ -1,9 +0,0 @@ -module scribble.examples.RequestResponse; - -type "{http://scribble.org/example}OrderRequest" from "http://scribble.org/schema/Example.xsd" as OrderRequest; -type "{http://scribble.org/example}OrderResponse" from "http://scribble.org/schema/Example.xsd" as OrderResponse; - -local protocol First at Buyer (role Buyer, role Seller) { - buy(OrderRequest) to Seller; - buy(OrderResponse) from Seller; -} \ No newline at end of file diff --git a/extensions/pom.xml b/extensions/pom.xml deleted file mode 100644 index 10ece52b2..000000000 --- a/extensions/pom.xml +++ /dev/null @@ -1,21 +0,0 @@ - - 4.0.0 - extensions - pom - 0.3.2-SNAPSHOT - Scribble::Extensions - - - org.scribble - parent - 0.3.2-SNAPSHOT - - - - monitor-rest - - - - diff --git a/header.txt b/header.txt new file mode 100644 index 000000000..794754c8a --- /dev/null +++ b/header.txt @@ -0,0 +1,11 @@ +Copyright ${project.inceptionYear} The Scribble Authors + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except +in compliance with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License +is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +or implied. See the License for the specific language governing permissions and limitations under +the License. diff --git a/modules/cli/build.properties b/modules/cli/build.properties deleted file mode 100644 index b844f8dbe..000000000 --- a/modules/cli/build.properties +++ /dev/null @@ -1,19 +0,0 @@ -source.. = src/main/java/,\ - target/generated-sources/antlr3/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - src/main/resources/lib/antlr-3.2.jar,\ - OSGI-INF/,\ - LICENSE.txt -src.includes = target/generated-sources/,\ - src/,\ - pom.xml,\ - build.properties,\ - META-INF/,\ - .project,\ - .classpath,\ - OSGI-INF/,\ - LICENSE.txt -jars.compile.order = .,\ - lib/antlr-3.2.jar diff --git a/modules/cli/pom.xml b/modules/cli/pom.xml deleted file mode 100644 index 31b5e0e84..000000000 --- a/modules/cli/pom.xml +++ /dev/null @@ -1,64 +0,0 @@ - - 4.0.0 - scribble-cli - jar - Scribble::Modules::CLI - - - org.scribble - modules - 0.3.2-SNAPSHOT - - - - - org.scribble - scribble-core - ${project.version} - - - org.scribble - scribble-parser - ${project.version} - - - org.scribble - scribble-validation - ${project.version} - - - org.scribble - scribble-projection - ${project.version} - - - org.scribble - scribble-monitor - ${project.version} - - - org.scribble - scribble-trace - ${project.version} - - - - org.codehaus.jackson - jackson-core-asl - provided - - - org.codehaus.jackson - jackson-mapper-asl - provided - - - - junit - junit - test - - - - diff --git a/modules/cli/src/main/java/org/scribble/cli/CommandLine.java b/modules/cli/src/main/java/org/scribble/cli/CommandLine.java deleted file mode 100644 index fd08770a3..000000000 --- a/modules/cli/src/main/java/org/scribble/cli/CommandLine.java +++ /dev/null @@ -1,453 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.cli; - -import java.io.IOException; - -import org.codehaus.jackson.map.ObjectMapper; -import org.scribble.context.DefaultModuleContext; -import org.scribble.context.ModuleContext; -import org.scribble.logging.ConsoleIssueLogger; -import org.scribble.logging.IssueLogger; -import org.scribble.model.Module; -import org.scribble.parser.ProtocolModuleLoader; -import org.scribble.parser.ProtocolParser; -import org.scribble.projection.ProtocolProjector; -import org.scribble.resources.DirectoryResourceLocator; -import org.scribble.resources.Resource; -import org.scribble.trace.model.Step; -import org.scribble.trace.model.Trace; -import org.scribble.trace.simulation.DefaultSimulatorContext; -import org.scribble.trace.simulation.SimulationListener; -import org.scribble.trace.simulation.Simulator; -import org.scribble.trace.simulation.SimulatorContext; -import org.scribble.validation.ProtocolValidator; - -/** - * This class provides the command line interface for the - * scribble parser. - * - */ -public class CommandLine { - - private static final String MODULE_PATH = "MODULE_PATH"; - - private static final ProtocolParser PARSER=new ProtocolParser(); - private static final ProtocolValidator VALIDATOR=new ProtocolValidator(); - private static final ProtocolProjector PROJECTOR=new ProtocolProjector(); - private static final IssueLogger LOGGER=new ConsoleIssueLogger(); - - private static final ObjectMapper MAPPER=new ObjectMapper(); - - private DirectoryResourceLocator _locator; - private ProtocolModuleLoader _loader; - - /** - * This is the main method for the Scribble CLI. - * - * @param args The arguments - */ - public static void main(String[] args) { - CommandLine cli=new CommandLine(); - - if (!cli.execute(args)) { - System.exit(1); - } - } - - /** - * This method executes the supplied arguments. - * - * @param args The arguments - * @param Whether execution was successful - */ - public boolean execute(String[] args) { - boolean f_usageError=false; - boolean f_error=false; - - if (args.length > 0) { - // Find the path - for (int i=0; !f_usageError && i < args.length-1; i++) { - if (args[i].equals("-path")) { - - if (i >= args.length-2) { - System.err.println("ERROR: No path value has been defined\r\n"); - f_usageError = true; - } else { - i++; - - f_usageError = !validatePaths(args[i]); - - if (!f_usageError) { - initLoader(args[i]); - } else { - System.err.println("ERROR: Module path '"+args[i]+"' is not valid\r\n"); - f_usageError = true; - } - } - break; - } - } - - // Check whether a locator has been defined - if (!f_usageError && _locator == null) { - if (!System.getenv().containsKey(MODULE_PATH)) { - System.err.println("ERROR: MODULE_PATH has not been defined\r\n"); - f_usageError = true; - } else if (!validatePaths(System.getenv().get(MODULE_PATH))) { - System.err.println("ERROR: Module path '"+System.getenv().get(MODULE_PATH)+"' is not valid\r\n"); - f_usageError = true; - } else { - initLoader(System.getenv().get(MODULE_PATH)); - } - } - - // Parse all non-path parameters - for (int i=0; !f_usageError && i < args.length-1; i++) { - if (args[i].equals("-path")) { - i++; - } else if (args[i].equals("-project")) { - - if (i+1 >= args.length) { - System.err.println("ERROR: No global module has been defined\r\n"); - f_usageError = true; - } else { - i++; - - if (!validateModuleName(args[i])) { - System.err.println("ERROR: Module name '"+args[i]+"' is not valid\r\n"); - f_usageError = true; - } else { - - Resource resource=getResource(args[i]); - - if (resource != null) { - Module module=loadModule(resource); - - if (module != null) { - project(module, resource); - } - } else { - System.err.println("ERROR: Module name '"+args[i] - +"' could not be located\r\n"); - } - } - } - - } else if (args[i].equals("-validate")) { - - if (i+1 >= args.length) { - System.err.println("ERROR: No module has been defined\r\n"); - f_usageError = true; - } else { - i++; - - if (!validateModuleName(args[i])) { - System.err.println("ERROR: Module name '"+args[i]+"' is not valid\r\n"); - f_usageError = true; - } else { - - Resource resource=getResource(args[i]); - - if (resource != null) { - loadModule(resource); - } else { - System.err.println("ERROR: Module name '"+args[i] - +"' could not be located\r\n"); - } - } - } - - } else if (args[i].equals("-simulate")) { - - if (i+1 >= args.length) { - System.err.println("ERROR: No trace file has been defined\r\n"); - f_usageError = true; - } else { - i++; - - java.io.File location=new java.io.File(args[i]); - - if (!validateTraceLocation(location)) { - System.err.println("ERROR: No trace files could be found at location '"+args[i]+"'\r\n"); - f_usageError = true; - } else { - if (!simulate(location)) { - System.err.println("\r\nERROR: Simulation failed\r\n"); - f_error = true; - } - } - } - - } else { - System.err.println("ERROR: Unknown option '"+args[i]+"'\r\n"); - f_usageError = true; - } - } - - } else { - f_usageError = true; - } - - if (f_usageError) { - System.err.println("Usage: scribble [-path ] [ -project ] [ -simulate ]"); - System.err.println("Options:"); - System.err.println("\t-path\t\tList of root directories separated by ':'"); - System.err.println("\t-project\tProject global protocols to local"); - System.err.println("\t-simulate\tSimulate the supplied trace file or files within a directory"); - } - - return (!f_usageError && !f_error); - } - - /** - * This method initializes the loader. - * - * @param paths The paths - */ - protected void initLoader(String paths) { - _locator = new DirectoryResourceLocator(paths); - _loader = new ProtocolModuleLoader(PARSER, _locator, LOGGER); - } - - /** - * This method returns the resource associated with the supplied - * module name. - * - * @param moduleName The module name - * @return The resource, or null if not found - */ - protected Resource getResource(String moduleName) { - String relativePath=moduleName.replace('.', java.io.File.separatorChar)+".scr"; - - return (_locator.getResource(relativePath)); - } - - /** - * This method determines whether the module associated with the - * supplied resource is valid. - * - * @param resource The resource - * @return The module name, if valid, otherwise null - */ - protected Module loadModule(Resource resource) { - Module module=null; - - try { - module = PARSER.parse(resource, _loader, LOGGER); - - if (module != null) { - - ModuleContext context=new DefaultModuleContext(resource, module, _loader); - - VALIDATOR.validate(context, module, LOGGER); - } - - } catch (IOException e) { - System.err.println("ERROR: Failed to parse '"+resource+"': "+e+"\r\n"); - } - - return (module); - } - - /** - * This method validates the module name. - * - * @param module The module name - * @return Whether the module name is valid - */ - protected static boolean validateModuleName(String module) { - - for (String part : module.split(".")) { - - for (int i=0; i < part.length();i++) { - if (!Character.isLetterOrDigit(part.charAt(i))) { - if (part.charAt(i) != '_') { - return (false); - } - } - } - } - - return (true); - } - - /** - * This method validates the scribble path. - * - * @param paths The scribble path - * @return Whether the path is valid - */ - protected static boolean validatePaths(String paths) { - for (String path : paths.split(":")) { - - java.io.File f=new java.io.File(path); - - if (!f.isDirectory()) { - return (false); - } - } - - return (true); - } - - /** - * This method projects the supplied module. - * - * @param module The module - * @param resource The resource - */ - protected void project(Module module, Resource resource) { - String resourceRoot=_locator.getResourceRoot(resource); - - if (resourceRoot == null) { - System.err.println("Unable to find root location for resource"); - return; - } - - ModuleContext context=new DefaultModuleContext(resource, module, _loader); - - java.util.Set modules=PROJECTOR.project(context, module, LOGGER); - - for (Module m : modules) { - String name=m.getName().replace('.', java.io.File.separatorChar); - - String path=resourceRoot+java.io.File.separatorChar - +name+".scr"; - - try { - java.io.FileOutputStream fos=new java.io.FileOutputStream(path); - - fos.write(m.toString().getBytes()); - - fos.flush(); - fos.close(); - } catch (Exception e) { - e.printStackTrace(); - } - } - } - - /** - * This method validates the trace location. The location - * can either be a single trace file, or a folder containing - * one or more trace files. - * - * @param location The location - * @return Whether the location is valid - */ - protected static boolean validateTraceLocation(java.io.File location) { - boolean ret=false; - - if (location.exists()) { - if (location.isFile()) { - ret = location.getName().endsWith(".trace"); - - } else if (location.isDirectory()) { - for (java.io.File child : location.listFiles()) { - if (validateTraceLocation(child)) { - ret = true; - break; - } - } - } - } - - return (ret); - } - - /** - * This method recursively scans the supplied location to determine - * if a trace file is present, and if found, simulates it. - * - * @param location The location - * @return Whether simulation was successful - */ - protected boolean simulate(java.io.File location) { - boolean ret=true; - - if (location.exists()) { - if (location.isFile()) { - - if (location.getName().endsWith(".trace")) { - System.out.println("\r\nSimulate: "+location.getPath()); - - try { - java.io.InputStream is=new java.io.FileInputStream(location); - - Trace trace=MAPPER.readValue(is, Trace.class); - - is.close(); - - SimulatorContext context=new DefaultSimulatorContext(_locator); - - Simulator simulator=new Simulator(); - - final java.util.List failed=new java.util.ArrayList(); - - SimulationListener l=new SimulationListener() { - - public void start(Trace trace) { - } - - public void start(Trace trace, Step step) { - } - - public void successful(Trace trace, Step step) { - System.out.println("\tSUCCESSFUL: "+step); - } - - public void failed(Trace trace, Step step) { - System.out.println("\tFAILED: "+step); - failed.add(step); - } - - public void stop(Trace trace) { - } - - }; - - simulator.addSimulationListener(l); - - simulator.simulate(context, trace); - - simulator.removeSimulationListener(l); - - if (failed.size() > 0) { - ret = false; - } - } catch (Exception e) { - e.printStackTrace(); - ret = false; - - } - } - - } else if (location.isDirectory()) { - for (java.io.File child : location.listFiles()) { - ret = simulate(child); - - if (!ret) { - break; - } - } - } - } - - return (ret); - } -} diff --git a/modules/cli/src/test/java/org/scribble/cli/CommandLineTest.java b/modules/cli/src/test/java/org/scribble/cli/CommandLineTest.java deleted file mode 100644 index bb200e679..000000000 --- a/modules/cli/src/test/java/org/scribble/cli/CommandLineTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.cli; - -import static org.junit.Assert.*; - -import org.junit.Test; -import org.scribble.cli.CommandLine; - -public class CommandLineTest { - - @Test - @org.junit.Ignore - public void test() { - - java.net.URL url=ClassLoader.getSystemResource("scribble/examples/GMessage.scr"); - - if (url == null) { - fail("Failed to find reference protocol"); - } - - java.io.File f=new java.io.File(url.getFile()); - - String path=f.getParentFile().getParentFile().getParentFile().getPath(); - - String[] args={ "-path", path, "scribble.examples.Imports" }; - - CommandLine cli=new CommandLine(); - - if (!cli.execute(args)) { - fail("Failed to execute"); - } - } - -} diff --git a/modules/cli/src/test/resources/scribble/examples/GMessage.scr b/modules/cli/src/test/resources/scribble/examples/GMessage.scr deleted file mode 100644 index 9296dc6cd..000000000 --- a/modules/cli/src/test/resources/scribble/examples/GMessage.scr +++ /dev/null @@ -1,9 +0,0 @@ -module scribble.examples.GMessage; - -global protocol GMessageProtocol(role Buyer,role Seller) { - buy(Order,Customer) from Buyer to Seller; - buy(Order,Customer) from Buyer to Seller; - buy(o:Order,c:Customer) from Buyer to Seller; - buy(Order) from Buyer to Seller; - buy(ord:Order) from Buyer to Seller; -} diff --git a/modules/cli/src/test/resources/scribble/examples/Imports.scr b/modules/cli/src/test/resources/scribble/examples/Imports.scr deleted file mode 100644 index 5e23ce411..000000000 --- a/modules/cli/src/test/resources/scribble/examples/Imports.scr +++ /dev/null @@ -1,6 +0,0 @@ -module scribble.examples.Imports; - -import scribble.examples.GMessage; - -global protocol ImportsProtocol(role Buyer,role Seller) { -} diff --git a/modules/core/pom.xml b/modules/core/pom.xml deleted file mode 100644 index a0c041b65..000000000 --- a/modules/core/pom.xml +++ /dev/null @@ -1,67 +0,0 @@ - - 4.0.0 - scribble-core - jar - 0.3.2-SNAPSHOT - Scribble::Modules::Core - - - org.scribble - modules - 0.3.2-SNAPSHOT - - - - - junit - junit - test - - - - - - - maven-javadoc-plugin - - - generate-javadoc - package - - jar - - - - - org.jboss.apiviz.APIviz - - org.jboss.apiviz - apiviz - 1.2.4.GA - - true - false - - -d ${project.build.directory}/javadoc - -charset UTF-8 - -docencoding UTF-8 - -version - -author - -breakiterator - -windowtitle "${project.name} ${project.version} API Reference" - -doctitle "${project.name} ${project.version} API Reference" - -bottom "Copyright © ${project.inceptionYear}-Present ${project.organization.name}. All Rights Reserved." - -link http://java.sun.com/javase/6/docs/api/ - -sourceclasspath ${project.build.outputDirectory} - - UTF-8 - en_US - - org.scribble.model - - - - - - diff --git a/modules/core/src/main/java/org/scribble/context/DefaultModuleContext.java b/modules/core/src/main/java/org/scribble/context/DefaultModuleContext.java deleted file mode 100644 index f1947e29c..000000000 --- a/modules/core/src/main/java/org/scribble/context/DefaultModuleContext.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.context; - -import org.scribble.model.ModelObject; -import org.scribble.model.Module; -import org.scribble.resources.Resource; - -/** - * This class implements the validation context. - * - */ -public class DefaultModuleContext implements ModuleContext { - - private Resource _resource=null; - private Module _thisModule=null; - private ModuleLoader _loader=null; - - /** - * This is the constructor. - * - * @param resource The resource - * @param module The module - * @param loader The loader - */ - public DefaultModuleContext(Resource resource, Module thisModule, - ModuleLoader loader) { - _resource = resource; - _thisModule = thisModule; - _loader = loader; - } - - /** - * {@inheritDoc} - */ - public Resource getResource() { - return (_resource); - } - - /** - * {@inheritDoc} - */ - public Module importModule(String moduleName) { - return (_loader == null ? null : _loader.loadModule(moduleName)); - } - - /** - * {@inheritDoc} - */ - public ModelObject getMember(String fqn) { - int index=fqn.lastIndexOf('.'); - - String moduleName=null; - String memberName=null; - - if (index != -1) { - moduleName=fqn.substring(0, index); - memberName = fqn.substring(index+1); - } else { - // Local definition - memberName = fqn; - } - - return (getMember(moduleName, memberName)); - } - - /** - * {@inheritDoc} - */ - public ModelObject getMember(String moduleName, String memberName) { - ModelObject ret=null; - Module module=(moduleName == null ? _thisModule : _loader.loadModule(moduleName)); - - if (module != null) { - ret = module.getProtocol(memberName); - - if (ret == null) { - ret = module.getTypeDeclaration(memberName); - } - } - - return (ret); - } - -} diff --git a/modules/core/src/main/java/org/scribble/context/DefaultModuleLoader.java b/modules/core/src/main/java/org/scribble/context/DefaultModuleLoader.java deleted file mode 100644 index 7bf794b1c..000000000 --- a/modules/core/src/main/java/org/scribble/context/DefaultModuleLoader.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.context; - -import org.scribble.model.Module; - -/** - * This class provides a default implementation of the module loader interface. - * - */ -public class DefaultModuleLoader implements ModuleLoader { - - private java.util.Map _modules=new java.util.HashMap(); - - /** - * This method registers the supplied module. - * - * @param module The module - */ - public void registerModule(Module module) { - _modules.put(module.getName(), module); - } - - /** - * {@inheritDoc} - */ - public Module loadModule(String module) { - return (_modules.get(module)); - } - -} diff --git a/modules/core/src/main/java/org/scribble/context/ModuleContext.java b/modules/core/src/main/java/org/scribble/context/ModuleContext.java deleted file mode 100644 index 4c0a13ef7..000000000 --- a/modules/core/src/main/java/org/scribble/context/ModuleContext.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.context; - -import org.scribble.model.ModelObject; -import org.scribble.model.Module; -import org.scribble.resources.Resource; - -/** - * This interface represents the validation context. - * - */ -public interface ModuleContext { - - /** - * This method returns the resource associated with the module. - * - * @return The resource - */ - public Resource getResource(); - - /** - * This method imports and returns the named module. - * - * @param module The module name - * @return The module, or null if not found - */ - public Module importModule(String module); - - /** - * This method returns member associated with a name. If the supplied - * name is fully qualified, then all but the last component of the name - * will identify the module associated with the member. If only a simple - * name is provided, then the member will be obtained from the module - * associated with the context. - * - * @param name The (optionally fully qualified) member name, e.g. [.] - * @return The member, or null if not found - */ - public ModelObject getMember(String name); - - /** - * This method returns a member associated with a specified - * named module. If the module name is not supplied, then the member - * will be obtained from the module associated with the context. - * - * @param module The optional module name - * @param member The member name - * @return The member, or null if not found - */ - public ModelObject getMember(String module, String member); - -} diff --git a/modules/core/src/main/java/org/scribble/context/ModuleLoader.java b/modules/core/src/main/java/org/scribble/context/ModuleLoader.java deleted file mode 100644 index 46c9211cb..000000000 --- a/modules/core/src/main/java/org/scribble/context/ModuleLoader.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.context; - -import org.scribble.model.Module; - -/** - * This interface is responsible for loading modules. - * - */ -public interface ModuleLoader { - - /** - * This method loads the module associated with the specified name. - * - * @param module The module name - * @return The module, or null if not found - */ - public Module loadModule(String module); - -} diff --git a/modules/core/src/main/java/org/scribble/logging/ConsoleIssueLogger.java b/modules/core/src/main/java/org/scribble/logging/ConsoleIssueLogger.java deleted file mode 100644 index 5c0120ae4..000000000 --- a/modules/core/src/main/java/org/scribble/logging/ConsoleIssueLogger.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.logging; - -import org.scribble.model.ModelObject; - -/** - * This class provides an implementation of the journal that - * reports issues to the console. - * - */ -public class ConsoleIssueLogger implements IssueLogger { - - private static final String NO_DETAILS=""; - - /** - * This method records an error issue. - * - * @param issue The issue text - * @param props The optional properties associated with the issue - */ - public void error(String issue, java.util.Map props) { - System.out.println("ERROR: "+errorDetails(props)+issue); - } - - /** - * {@inheritDoc} - */ - public void error(String issue, ModelObject mobj) { - System.out.println("ERROR: "+errorDetails(mobj.getProperties())+issue); - } - - /** - * This method records a warning issue. - * - * @param issue The issue text - * @param props The optional properties associated with the issue - */ - public void warning(String issue, java.util.Map props) { - System.out.println("WARN: "+errorDetails(props)+issue); - } - - /** - * {@inheritDoc} - */ - public void warning(String issue, ModelObject mobj) { - System.out.println("WARN: "+errorDetails(mobj.getProperties())+issue); - } - - /** - * This method records an information issue. - * - * @param issue The issue text - * @param props The optional properties associated with the issue - */ - public void info(String issue, java.util.Map props) { - System.out.println("INFO: "+errorDetails(props)+issue); - } - - /** - * {@inheritDoc} - */ - public void info(String issue, ModelObject mobj) { - System.out.println("INFO: "+errorDetails(mobj.getProperties())+issue); - } - - private String errorDetails(java.util.Map props) { - String ret=NO_DETAILS; - - if (props != null && props.containsKey(ModelObject.START_LINE)) { - ret = "[line "+props.get(ModelObject.START_LINE)+"] "; - } - - return (ret); - } -} diff --git a/modules/core/src/main/java/org/scribble/logging/IssueLogger.java b/modules/core/src/main/java/org/scribble/logging/IssueLogger.java deleted file mode 100644 index de165d286..000000000 --- a/modules/core/src/main/java/org/scribble/logging/IssueLogger.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.logging; - -import org.scribble.model.ModelObject; - -/** - * This interface can be used to log validation - * feedback. - * - */ -public interface IssueLogger { - - /** - * This method records an error issue. - * - * @param issue The issue text - * @param props The optional properties associated with the issue - */ - public void error(String issue, java.util.Map props); - - /** - * This method records an error issue. - * - * @param issue The issue text - * @param mobj The model object - */ - public void error(String issue, ModelObject mobj); - - /** - * This method records a warning issue. - * - * @param issue The issue text - * @param props The optional properties associated with the issue - */ - public void warning(String issue, java.util.Map props); - - /** - * This method records a warning issue. - * - * @param issue The issue text - * @param mobj The model object - */ - public void warning(String issue, ModelObject mobj); - - /** - * This method records an information issue. - * - * @param issue The issue text - * @param props The optional properties associated with the issue - */ - public void info(String issue, java.util.Map props); - - /** - * This method records an information issue. - * - * @param issue The issue text - * @param mobj The model object - */ - public void info(String issue, ModelObject mobj); - -} diff --git a/modules/core/src/main/java/org/scribble/model/Argument.java b/modules/core/src/main/java/org/scribble/model/Argument.java deleted file mode 100644 index 1ef59fd6e..000000000 --- a/modules/core/src/main/java/org/scribble/model/Argument.java +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model; - -/** - * This class represents a message. - * Message signatures can be either a simple signature with - * a unique TypeReference, or an operation name with several - * TypeReferences as arguments. - */ -public class Argument extends ModelObject { - - private String _name=null; - private MessageSignature _messageSignature=null; - private String _alias=null; - - /** - * The default constructor. - */ - public Argument() { - } - - public Argument(Argument copy) { - _name = copy._name; - - if (copy._messageSignature != null) { - _messageSignature = new MessageSignature(copy._messageSignature); - } - } - - /** - * This method returns the optional parameter or payload type name. - * - * @return The optional name - */ - public String getName() { - return (_name); - } - - /** - * This method sets the payload type or parameter name. This property - * is mutually exclusive with the message signature. - * - * @param name The name - */ - public void setName(String name) { - _name = name; - } - - /** - * This method returns the message signature. - * - * @return The message signature - */ - public MessageSignature getMessageSignature() { - return (_messageSignature); - } - - /** - * This method sets the message signature. - * - * @param sig The message signature - */ - public void setMessageSignature(MessageSignature sig) { - if (_messageSignature != null) { - _messageSignature.setParent(null); - } - - _messageSignature = sig; - - if (_messageSignature != null) { - _messageSignature.setParent(this); - } - } - - /** - * This method returns the alias. - * - * @return The alias - */ - public String getAlias() { - return (_alias); - } - - /** - * This method sets the alias. - * - * @param alias The alias - */ - public void setAlias(String alias) { - _alias = alias; - } - - @Override - public String toString() { - String ret=""; - - if (getMessageSignature() != null) { - ret += getMessageSignature(); - } else if (getName() != null && - getName().trim().length() > 0) { - ret += getName(); - } - - if (ret.equals("")) { - ret = ""; - } - - return (ret); - } - - /** - * This method visits the model object using the supplied - * visitor. - * - * @param visitor The visitor - */ - public void visit(Visitor visitor) { - } - - /** - * {@inheritDoc} - */ - public void toText(StringBuffer buf, int level) { - - if (_messageSignature != null) { - _messageSignature.toText(buf, level); - } else if (_name != null) { - buf.append(_name); - } - - if (_alias != null) { - buf.append(" as "); - buf.append(_alias); - } - } -} diff --git a/modules/core/src/main/java/org/scribble/model/ContainmentList.java b/modules/core/src/main/java/org/scribble/model/ContainmentList.java deleted file mode 100644 index feb1f0877..000000000 --- a/modules/core/src/main/java/org/scribble/model/ContainmentList.java +++ /dev/null @@ -1,273 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model; - -import java.util.Collection; -import java.util.List; -import java.util.Vector; - -/** - * This class represents a list that understands how to manage - * containment and parent relationships. - * - * @param The element type - */ -public class ContainmentList extends Vector implements List { - - private static final long serialVersionUID = -1265091580286297521L; - - private ModelObject _parent=null; - private Class _type=null; - - /** - * This is the constructor for the containment list. - * - * @param parent The parent model object - * @param type The type of the elements in the list - */ - public ContainmentList(ModelObject parent, Class type) { - _parent = parent; - _type = type; - } - - /** - * This method returns the base type associated with the list - * elements. - * - * @return The base type for the list elements - */ - public Class getType() { - return (_type); - } - - /** - * Appends the specified element to the end of this list (optional - * operation).

- * - * Lists that support this operation may place limitations on what - * elements may be added to this list. In particular, some - * lists will refuse to add null elements, and others will impose - * restrictions on the type of elements that may be added. List - * classes should clearly specify in their documentation any restrictions - * on what elements may be added. - * - * @param o element to be appended to this list. - * @return true (as per the general contract of the - * Collection.add method). - */ - public boolean add(E o) { - boolean ret=super.add(o); - - if (ret) { - o.setParent(_parent); - } - - return (ret); - } - - /** - * Removes the first occurrence in this list of the specified element - * (optional operation). If this list does not contain the element, it is - * unchanged. More formally, removes the element with the lowest index i - * such that (o==null ? get(i)==null : o.equals(get(i))) (if - * such an element exists). - * - * @param o element to be removed from this list, if present. - * @return true if this list contained the specified element. - */ - public boolean remove(Object o) { - boolean ret=super.remove(o); - - if (ret && o instanceof ModelObject) { - ((ModelObject) o).setParent(null); - } - - return (ret); - } - - /** - * Appends all of the elements in the specified collection to the end of - * this list, in the order that they are returned by the specified - * collection's iterator (optional operation). The behavior of this - * operation is unspecified if the specified collection is modified while - * the operation is in progress. (Note that this will occur if the - * specified collection is this list, and it's nonempty.) - * - * @param c collection whose elements are to be added to this list. - * @return true if this list changed as a result of the call. - * @see #add(Object) - */ - public boolean addAll(Collection c) { - boolean ret=super.addAll(c); - - if (ret) { - java.util.Iterator iter=c.iterator(); - - while (iter.hasNext()) { - iter.next().setParent(_parent); - } - } - - return (ret); - } - - /** - * Inserts all of the elements in the specified collection into this - * list at the specified position (optional operation). Shifts the - * element currently at that position (if any) and any subsequent - * elements to the right (increases their indices). The new elements - * will appear in this list in the order that they are returned by the - * specified collection's iterator. The behavior of this operation is - * unspecified if the specified collection is modified while the - * operation is in progress. (Note that this will occur if the specified - * collection is this list, and it's nonempty.) - * - * @param index index at which to insert first element from the specified - * collection. - * @param c elements to be inserted into this list. - * @return true if this list changed as a result of the call. - */ - public boolean addAll(int index, Collection c) { - boolean ret=super.addAll(index, c); - - if (ret) { - java.util.Iterator iter=c.iterator(); - - while (iter.hasNext()) { - iter.next().setParent(_parent); - } - } - - return (ret); - } - - /** - * Removes from this list all the elements that are contained in the - * specified collection (optional operation). - * - * @param c collection that defines which elements will be removed from - * this list. - * @return true if this list changed as a result of the call. - * @see #remove(Object) - * @see #contains(Object) - */ - public boolean removeAll(Collection c) { - boolean ret=super.removeAll(c); - - if (ret) { - java.util.Iterator iter=c.iterator(); - - while (iter.hasNext()) { - Object val=iter.next(); - if (val instanceof ModelObject) { - ((ModelObject) val).setParent(null); - } - } - } - - return (ret); - } - - /** - * Retains only the elements in this list that are contained in the - * specified collection (optional operation). In other words, removes - * from this list all the elements that are not contained in the specified - * collection. - * - * @param c collection that defines which elements this set will retain. - * - * @return true if this list changed as a result of the call. - * @see #remove(Object) - * @see #contains(Object) - */ - public boolean retainAll(Collection c) { - return (super.retainAll(c)); - } - - /** - * Removes all of the elements from this list (optional operation). This - * list will be empty after this call returns (unless it throws an - * exception). - */ - public void clear() { - java.util.Iterator iter=iterator(); - - while (iter.hasNext()) { - iter.next().setParent(null); - } - - super.clear(); - } - - /** - * Replaces the element at the specified position in this list with the - * specified element (optional operation). - * - * @param index index of element to replace. - * @param element element to be stored at the specified position. - * @return the element previously at the specified position. - */ - public E set(int index, E element) { - E ret=super.set(index, element); - - if (element != null) { - element.setParent(_parent); - } - - if (ret != null) { - ret.setParent(null); - } - - return (ret); - } - - /** - * Inserts the specified element at the specified position in this list - * (optional operation). Shifts the element currently at that position - * (if any) and any subsequent elements to the right (adds one to their - * indices). - * - * @param index index at which the specified element is to be inserted. - * @param element element to be inserted. - * - */ - public void add(int index, E element) { - super.add(index, element); - - if (element != null) { - element.setParent(_parent); - } - } - - /** - * Removes the element at the specified position in this list (optional - * operation). Shifts any subsequent elements to the left (subtracts one - * from their indices). Returns the element that was removed from the - * list. - * - * @param index the index of the element to removed. - * @return the element previously at the specified position. - */ - public E remove(int index) { - E ret=super.remove(index); - - if (ret != null) { - ret.setParent(null); - } - - return (ret); - } -} diff --git a/modules/core/src/main/java/org/scribble/model/ImportDecl.java b/modules/core/src/main/java/org/scribble/model/ImportDecl.java deleted file mode 100644 index 365e08744..000000000 --- a/modules/core/src/main/java/org/scribble/model/ImportDecl.java +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model; - -/** - * This class represents an imported protocol. - * - */ -public class ImportDecl extends ModelObject { - - private String _moduleName=null; - private String _memberName=null; - private String _alias=null; - - /** - * The default constructor. - */ - public ImportDecl() { - } - - /** - * The copy constructor. - * - * @param copy The copy - */ - public ImportDecl(ImportDecl copy) { - super(copy); - _moduleName = copy.getModuleName(); - _memberName = copy.getMemberName(); - _alias = copy.getAlias(); - } - - /** - * This method returns the optional module name. - * - * @return The optional module name - */ - public String getModuleName() { - return (_moduleName); - } - - /** - * This method sets the optional module name. - * - * @param module The optional module name - */ - public void setModuleName(String module) { - _moduleName = module; - } - - /** - * This method returns the name of the - * member being imported. - * - * @return The member name - */ - public String getMemberName() { - return (_memberName); - } - - /** - * This method sets the name of the - * member being imported. - * - * @param name The member name - */ - public void setMemberName(String name) { - _memberName = name; - } - - /** - * This method returns the optional alias. - * - * @return The optional alias - */ - public String getAlias() { - return (_alias); - } - - /** - * This method sets the optional alias. - * - * @param alias The optionalalias - */ - public void setAlias(String alias) { - _alias = alias; - } - - /** - * This method returns the declaration name. - * - * @return The declaration name - */ - public String getDeclarationName() { - String ret=null; - - if (getAlias() != null) { - ret = getAlias(); - } else if (getMemberName() != null) { - ret = getModuleName().toString()+"."+getMemberName(); - } else { - ret = getModuleName().toString(); - } - - return (ret); - } - - /** - * This method visits the model object using the supplied - * visitor. - * - * @param visitor The visitor - */ - public void visit(Visitor visitor) { - visitor.accept(this); - } - - @Override - public String toString() { - String ret=getMemberName(); - - if (ret == null) { - ret = ""; - } - - return (ret); - } - - /** - * {@inheritDoc} - */ - public void toText(StringBuffer buf, int level) { - indent(buf, level); - - /* - buf.append("import "); - - if (_memberName != null) { - buf.append(_memberName); - - buf.append(" from "); - } - - buf.append(_moduleName); - - if (_memberName != null && _alias != null) { - buf.append(" as "); - - buf.append(_alias); - } - */ - - if (_memberName != null) { - buf.append("from "); - } else { - buf.append("import "); - } - - buf.append(_moduleName); - - if (_memberName != null) { - buf.append(" import "); - buf.append(_memberName); - } - - if (_alias != null) { - buf.append(" as "); - - buf.append(_alias); - } - - buf.append(";\n"); - } -} diff --git a/modules/core/src/main/java/org/scribble/model/Message.java b/modules/core/src/main/java/org/scribble/model/Message.java deleted file mode 100644 index d73ef3614..000000000 --- a/modules/core/src/main/java/org/scribble/model/Message.java +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model; - -/** - * This class represents a message. - * Message signatures can be either a simple signature with - * a unique TypeReference, or an operation name with several - * TypeReferences as arguments. - */ -public class Message extends ModelObject { - - private String _parameter=null; - private MessageSignature _messageSignature=null; - - /** - * The default constructor. - */ - public Message() { - } - - public Message(Message copy) { - _parameter = copy._parameter; - - if (copy._messageSignature != null) { - _messageSignature = new MessageSignature(copy._messageSignature); - } - } - - /** - * This method returns the optional parameter. - * - * @return The optional parameter - */ - public String getParameter() { - return (_parameter); - } - - /** - * This method sets the parameter. This property - * is mutually exclusive with the operator and - * types list, which represent the message - * signature. - * - * @param parameter The parameter - */ - public void setParameter(String parameter) { - _parameter = parameter; - } - - /** - * This method returns the message signature. - * - * @return The message signature - */ - public MessageSignature getMessageSignature() { - return (_messageSignature); - } - - /** - * This method sets the message signature. - * - * @param sig The message signature - */ - public void setMessageSignature(MessageSignature sig) { - if (_messageSignature != null) { - _messageSignature.setParent(null); - } - - _messageSignature = sig; - - if (_messageSignature != null) { - _messageSignature.setParent(this); - } - } - - @Override - public int hashCode() { - int result = 13; - result = 31 * result + (_parameter == null ? 0 : _parameter.hashCode()); - result = 31 * result + (_messageSignature == null ? 0 : _messageSignature.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - boolean ret=false; - - if (obj instanceof Message) { - Message other=(Message)obj; - - if (other._parameter != null && _parameter != null) { - ret = other._parameter.equals(_parameter); - } else if (other._parameter == null && _parameter == null) { - ret = true; - } - - if (ret) { - if (other._messageSignature != null && _messageSignature != null) { - ret = other._messageSignature.equals(_messageSignature); - } else if (other._messageSignature == null && _messageSignature == null) { - ret = true; - } - } - } - - return (ret); - } - - @Override - public String toString() { - String ret=""; - - if (getMessageSignature() != null) { - ret += getMessageSignature(); - } else if (getParameter() != null && - getParameter().trim().length() > 0) { - ret += getParameter(); - } - - if (ret.equals("")) { - ret = ""; - } - - return (ret); - } - - /** - * This method visits the model object using the supplied - * visitor. - * - * @param visitor The visitor - */ - public void visit(Visitor visitor) { - } - - /** - * {@inheritDoc} - */ - public void toText(StringBuffer buf, int level) { - - if (_messageSignature != null) { - _messageSignature.toText(buf, level); - } else if (_parameter != null) { - buf.append(_parameter); - } - } -} diff --git a/modules/core/src/main/java/org/scribble/model/MessageSignature.java b/modules/core/src/main/java/org/scribble/model/MessageSignature.java deleted file mode 100644 index fa46fdb8b..000000000 --- a/modules/core/src/main/java/org/scribble/model/MessageSignature.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model; - -/** - * This class represents a message signature. - * Message signatures can be either a simple signature with - * a unique TypeReference, or an operation name with several - * TypeReferences as arguments. - */ -public class MessageSignature extends ModelObject { - - private String _operator=null; - private java.util.List _types=new ContainmentList(this, PayloadElement.class); - - /** - * The default constructor. - */ - public MessageSignature() { - } - - /** - * Constructor for MessageSignatures that comprise an operation. - * @param operator The operation name. - * @param types The arguments for the operation. - */ - public MessageSignature(String operator, java.util.List types) { - _operator = operator; - _types.addAll(types); - } - - /** - * The copy constructor. - * - * @param msig The message signature - */ - public MessageSignature(MessageSignature msig) { - super(msig); - - _operator = msig.getOperator(); - - for (PayloadElement tref : msig.getPayloadElements()) { - _types.add(new PayloadElement(tref)); - } - } - - /** - * This method returns the optional operator. - * - * @return The optional operator - */ - public String getOperator() { - return (_operator); - } - - /** - * This method sets the operator. - * - * @param operator The operator - */ - public void setOperator(String operator) { - _operator = operator; - } - - /** - * This method returns the list of types. If - * no operation is defined, then only one type reference - * should be defined. - * - * @return The list of types - */ - public java.util.List getPayloadElements() { - return (_types); - } - - @Override - public int hashCode() { - int result = 13; - result = 31 * result + _types.hashCode(); - result = 31 * result + (_operator == null ? 0 : _operator.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - boolean ret=false; - - if (obj instanceof MessageSignature) { - MessageSignature other=(MessageSignature) obj; - - if (other.getPayloadElements().size() == getPayloadElements().size()) { - if (other._operator != null && _operator != null) { - ret = other._operator.equals(_operator); - } else if (other._operator == null && _operator == null) { - ret = true; - } - - for (int i=0; ret && i < getPayloadElements().size(); i++) { - ret = getPayloadElements().get(i).equals(other.getPayloadElements().get(i)); - } - } - } - - return (ret); - } - - @Override - public String toString() { - String ret=""; - - ret += getOperator() + "("; - - for (int i=0; i < _types.size(); i++) { - if (i > 0) { - ret += ","; - } - ret += _types.get(i).getName(); - } - - ret += ")"; - - if (ret.equals("")) { - ret = ""; - } - - return (ret); - } - - /** - * This method visits the model object using the supplied - * visitor. - * - * @param visitor The visitor - */ - public void visit(Visitor visitor) { - } - - /** - * {@inheritDoc} - */ - public void toText(StringBuffer buf, int level) { - - buf.append(_operator); - buf.append('('); - - for (int i=0; i < getPayloadElements().size(); i++) { - if (i > 0) { - buf.append(','); - } - getPayloadElements().get(i).toText(buf, level); - } - - buf.append(')'); - } -} diff --git a/modules/core/src/main/java/org/scribble/model/ModelObject.java b/modules/core/src/main/java/org/scribble/model/ModelObject.java deleted file mode 100644 index a148f4928..000000000 --- a/modules/core/src/main/java/org/scribble/model/ModelObject.java +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model; - -/** - * This is the generic object from which all Scribble model objects - * are derived. - */ -public abstract class ModelObject { - - /** - * The start line in the document at which the issue has been detected. - */ - public static final String START_LINE = "start.line"; - - /** - * The start column in the document at which the issue has been detected. - */ - public static final String START_COLUMN = "start.column"; - - /** - * The end line in the document at which the issue has been detected. - */ - public static final String END_LINE = "end.line"; - - /** - * The end column in the document at which the issue has been detected. - */ - public static final String END_COLUMN = "end.column"; - - /** - * The start position in the document at which the issue has been detected. - */ - public static final String START_POSITION = "position.start"; - - /** - * The end position in the document at which the issue has been detected. - */ - public static final String END_POSITION = "position.end"; - - /** - * The optional resource URL associated with the issue. - */ - public static final String RESOURCE_URL = "resource.url"; - - private ModelObject _parent=null; - private java.util.Map _properties= - new java.util.HashMap(); - - /** - * This is the default constructor for the model object. - */ - public ModelObject() { - } - - /** - * This is the copy constructor. - * - * @param obj The object to copy - */ - public ModelObject(ModelObject obj) { - _properties.putAll(obj.getProperties()); - } - - /** - * This method returns the parent of this - * model object. - * - * @return The parent, or null if top model - * object - */ - public ModelObject getParent() { - return (_parent); - } - - /** - * This method returns the parent with the specified type. - * - * @param type The class of the required parent - * @return The appropriate parent, or null if not found - */ - public T getParent(Class type) { - if (type.isAssignableFrom(getClass())) { - return (type.cast(this)); - } else if (_parent != null) { - return (_parent.getParent(type)); - } - return (null); - } - - /** - * This method sets the parent model object. - * - * @param parent The parent - */ - public void setParent(ModelObject parent) { - _parent = parent; - } - - /** - * This method establishes the necessary information to - * indicate that the current model object is derived - * from the supplied source model object. - * - * @param modelObj The source model object - */ - public void derivedFrom(ModelObject modelObj) { - if (modelObj != null) { - _properties = new java.util.HashMap(modelObj.getProperties()); - } - } - - /** - * This method returns the properties associated - * with this model object. - * - * @return The properties - */ - public java.util.Map getProperties() { - return (_properties); - } - - /** - * This method returns the protocol model in which this - * object is contained. - * - * @return The protocol model, or null if not found - */ - public Module getModule() { - Module ret=null; - ModelObject cur=this; - - while (ret == null && cur != null) { - - if (cur instanceof Module) { - ret = (Module) cur; - } else { - cur = cur.getParent(); - } - } - - return (ret); - } - - /** - * This method visits the model object using the supplied - * visitor. - * - * @param visitor The visitor - */ - public abstract void visit(Visitor visitor); - - /** - * This method generates a text representation of the protocol component. - * - * @param buf The text buffer - * @param level The indentation level, if relevant - */ - public abstract void toText(StringBuffer buf, int level); - - /** - * This method indents the text. - * - * @param buf The buffer - * @param level The indentation level - */ - protected static void indent(StringBuffer buf, int level) { - for (int i=0; i < level; i++) { - buf.append('\t'); - } - } -} diff --git a/modules/core/src/main/java/org/scribble/model/ModelProperties.java b/modules/core/src/main/java/org/scribble/model/ModelProperties.java deleted file mode 100644 index 266c0c6b2..000000000 --- a/modules/core/src/main/java/org/scribble/model/ModelProperties.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model; - -/** - * This interface provides the definitions for the properties - * associated with objects in the model. - */ -public interface ModelProperties { - - /** - * This construct defines the start location in a textual description of - * a scribble construct. - */ - public static final String START_LOCATION="scribble.start.location"; - - /** - * This construct defines the end location in a textual description of - * a scribble construct. - */ - public static final String END_LOCATION="scribble.end.location"; - - /** - * This construct defines the URI for locating the source component. - */ - public static final String URI="scribble.uri"; - -} diff --git a/modules/core/src/main/java/org/scribble/model/Module.java b/modules/core/src/main/java/org/scribble/model/Module.java deleted file mode 100644 index 26c4652a1..000000000 --- a/modules/core/src/main/java/org/scribble/model/Module.java +++ /dev/null @@ -1,225 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model; - -/** - * This class represents the base class for models associated with - * specific notations. The details associated with the notation are - * contained within derived classes. - * - */ -public class Module extends ModelObject { - - private String _name=null; - private java.util.List _imports= - new ContainmentList(this, ImportDecl.class); - private java.util.List _payloadTypes= - new ContainmentList(this, PayloadTypeDecl.class); - private java.util.List _protocols= - new ContainmentList(this, ProtocolDecl.class); - - /** - * The default constructor for the model. - */ - public Module() { - } - - /** - * This method returns the fully qualified name. - * - * @return The fully qualified name - */ - public String getName() { - return (_name); - } - - /** - * This method sets the fully qualified name. - * - * @param fqn The fully qualified name - */ - public void setName(String fqn) { - _name = fqn; - } - - /** - * This method returns the last component of the fully - * qualified name. - * - * @return The local name - */ - public String getLocalName() { - String ret=_name; - - if (_name != null) { - int ind=_name.lastIndexOf('.'); - if (ind != -1) { - ret = _name.substring(ind+1); - } - } - - return (ret); - } - - /** - * This method returns the role associated with a local module. - * If the module is a global module, then null is returned. - * - * @return The located role, if the module is local - */ - public Role getLocatedRole() { - Role ret=null; - - if (_protocols.size() > 0 - && _protocols.get(0) instanceof org.scribble.model.local.LProtocolDecl) { - ret = ((org.scribble.model.local.LProtocolDecl)_protocols.get(0)).getLocalRole(); - } - - return (ret); - } - - /** - * This method returns the list of import definitions. - * - * @return The import definitions - */ - public java.util.List getImports() { - return (_imports); - } - - /** - * This method returns the list of payload types. - * - * @return The payload types - */ - public java.util.List getPayloadTypeDeclarations() { - return (_payloadTypes); - } - - /** - * This method returns the payload type associated - * with the supplied name. - * - * @param name The name - * @return The payload type, or null if not found - */ - public PayloadTypeDecl getTypeDeclaration(String name) { - for (PayloadTypeDecl ptd : _payloadTypes) { - if (ptd.getAlias() != null && ptd.getAlias().equals(name)) { - return (ptd); - } - } - - return (null); - } - - /** - * This method returns the list of protocols. - * - * @return The protocols - */ - public java.util.List getProtocols() { - return (_protocols); - } - - /** - * This method returns the protocol associated - * with the supplied name. - * - * @param name The name - * @return The protocol, or null if not found - */ - public ProtocolDecl getProtocol(String name) { - for (ProtocolDecl p : _protocols) { - if (p.getName().equals(name)) { - return (p); - } - } - - return (null); - } - - /** - * This method visits the model object using the supplied - * visitor. - * - * @param visitor The visitor - */ - public void visit(Visitor visitor) { - - for (ImportDecl imp : getImports()) { - imp.visit(visitor); - } - - for (PayloadTypeDecl ptd : getPayloadTypeDeclarations()) { - ptd.visit(visitor); - } - - for (ProtocolDecl protocol : getProtocols()) { - protocol.visit(visitor); - } - } - - /** - * {@inheritDoc} - */ - public String toString() { - StringBuffer buf=new StringBuffer(); - toText(buf, 0); - - return (buf.toString()); - } - - /** - * {@inheritDoc} - */ - public void toText(StringBuffer buf, int level) { - if (_name != null) { - indent(buf, level); - - buf.append("module "); - - buf.append(_name); - - buf.append(";\n\n"); - } - - for (ImportDecl imp : getImports()) { - imp.toText(buf, level); - } - - if (getImports().size() > 0) { - buf.append("\n"); - } - - for (PayloadTypeDecl ptd : getPayloadTypeDeclarations()) { - ptd.toText(buf, level); - } - - if (getPayloadTypeDeclarations().size() > 0) { - buf.append("\n"); - } - - for (int i=0; i < getProtocols().size(); i++) { - ProtocolDecl protocol=getProtocols().get(i); - if (i > 0) { - buf.append("\n"); - } - protocol.toText(buf, level); - } - } - -} diff --git a/modules/core/src/main/java/org/scribble/model/Parameter.java b/modules/core/src/main/java/org/scribble/model/Parameter.java deleted file mode 100644 index 44ddf2afd..000000000 --- a/modules/core/src/main/java/org/scribble/model/Parameter.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model; - -/** - * This class represents a parameter. - * - */ -public class Parameter extends ModelObject { - - private String _name=null; - - /** - * This is the default constructor. - */ - public Parameter() { - } - - /** - * This is the copy constructor. - * - * @param p The parameter - */ - public Parameter(Parameter p) { - super(p); - _name = p.getName(); - } - - /** - * This method sets the name of the role. - * - * @param name The name - */ - public void setName(String name) { - _name = name; - } - - /** - * This method returns the name of the role. - * - * @return The name - */ - public String getName() { - return (_name); - } - - @Override - public boolean equals(Object obj) { - boolean ret=false; - - if (obj instanceof Parameter) { - Parameter other=(Parameter)obj; - - if (other.getName() != null && other.getName().equals(_name)) { - ret = true; - } - } - - return (ret); - } - - @Override - public int hashCode() { - int ret=super.hashCode(); - - if (_name != null) { - ret = _name.hashCode(); - } - - return (ret); - } - - @Override - public String toString() { - String ret=getName(); - - if (ret == null) { - ret = ""; - } - - return (ret); - } - - /** - * This method visits the model object using the supplied - * visitor. - * - * @param visitor The visitor - */ - public void visit(Visitor visitor) { - } - - /** - * {@inheritDoc} - */ - public void toText(StringBuffer buf, int level) { - - if (_name != null) { - buf.append("sig "); - buf.append(_name); - } - } -} diff --git a/modules/core/src/main/java/org/scribble/model/ParameterDecl.java b/modules/core/src/main/java/org/scribble/model/ParameterDecl.java deleted file mode 100644 index 919605363..000000000 --- a/modules/core/src/main/java/org/scribble/model/ParameterDecl.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model; - -/** - * This class represents a parameter declaration. - * - */ -public class ParameterDecl extends ModelObject { - - private String _name=null; - private String _alias=null; - private ParameterType _parameterType=null; - - /** - * This is the default constructor. - */ - public ParameterDecl() { - } - - /** - * This is the copy constructor. - * - * @param pd The role - */ - public ParameterDecl(ParameterDecl pd) { - super(pd); - _name = pd.getName(); - _alias = pd.getAlias(); - _parameterType = pd.getType(); - } - - /** - * This method returns the name of the parameter declaration. - * - * @return The name - */ - public String getName() { - return (_name); - } - - /** - * This method sets the name of the parameter declaration. - * - * @param name The name - */ - public void setName(String name) { - _name = name; - } - - /** - * This method returns the alias of the parameter declaration. - * - * @return The alias - */ - public String getAlias() { - return (_alias); - } - - /** - * This method sets the alias of the parameter declaration. - * - * @param alias The alias - */ - public void setAlias(String alias) { - _alias = alias; - } - - /** - * This method returns the type of the parameter declaration. - * - * @return The type - */ - public ParameterType getType() { - return (_parameterType); - } - - /** - * This method sets the type of the parameter declaration. - * - * @param type The type - */ - public void setType(ParameterType type) { - _parameterType = type; - } - - /** - * This method returns the declaration name for the parameter - * declaration. - * - * @return The declaration name - */ - public String getDeclarationName() { - String ret=_alias; - - if (ret == null) { - ret = _name; - } - - return (ret); - } - - @Override - public boolean equals(Object obj) { - boolean ret=false; - - if (obj instanceof ParameterDecl) { - ParameterDecl other=(ParameterDecl)obj; - - if (other.getName() != null && other.getName().equals(_name)) { - ret = true; - } - } - - return (ret); - } - - @Override - public int hashCode() { - int ret=super.hashCode(); - - if (_name != null) { - ret = _name.hashCode(); - } - - return (ret); - } - - @Override - public String toString() { - String ret=getName(); - - if (ret == null) { - ret = ""; - } - - return (ret); - } - - /** - * This method visits the model object using the supplied - * visitor. - * - * @param visitor The visitor - */ - public void visit(Visitor visitor) { - } - - /** - * {@inheritDoc} - */ - public void toText(StringBuffer buf, int level) { - buf.append(getType().name().toLowerCase()); - buf.append(" "); - - if (_name != null) { - buf.append(_name); - } - - if (_alias != null) { - buf.append(" as "+_alias); - } - } - - /** - * Parameter declaration type. - * - */ - public enum ParameterType { - // Type - Type, - - //Signature - Sig - } -} diff --git a/modules/core/src/main/java/org/scribble/model/PayloadElement.java b/modules/core/src/main/java/org/scribble/model/PayloadElement.java deleted file mode 100644 index dbc06d4f1..000000000 --- a/modules/core/src/main/java/org/scribble/model/PayloadElement.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model; - -/** - * This class represents a payload element associated with a model. - * - */ -public class PayloadElement extends ModelObject { - - private String _annotation=null; - private String _name=null; - - /** - * The default constructor. - */ - public PayloadElement() { - } - - /** - * The copy constructor. - * - * @param copy The copy - */ - public PayloadElement(PayloadElement copy) { - _annotation = copy.getAnnotation(); - _name = copy.getName(); - } - - /** - * This method returns the optional annotation. - * - * @return The optional annotation - */ - public String getAnnotation() { - return (_annotation); - } - - /** - * This method sets the optional annotation. - * - * @param annotation The annotation - */ - public void setAnnotation(String annotation) { - _annotation = annotation; - } - - /** - * This method returns the payload type or - * parameter name. - * - * @return The name - */ - public String getName() { - return (_name); - } - - /** - * This method sets the payload type or - * parameter name. - * - * @param name The name - */ - public void setName(String name) { - _name = name; - } - - @Override - public String toString() { - String ret=getName(); - - if (ret == null) { - ret = ""; - } - - if (_annotation != null) { - ret = _annotation+":"+ret; - } - - return (ret); - } - - /** - * {@inheritDoc} - */ - @Override - public void visit(Visitor visitor) { - - } - - /** - * {@inheritDoc} - */ - public void toText(StringBuffer buf, int level) { - if (_annotation != null) { - buf.append(_annotation); - buf.append(':'); - } - buf.append(_name); - } -} diff --git a/modules/core/src/main/java/org/scribble/model/PayloadTypeDecl.java b/modules/core/src/main/java/org/scribble/model/PayloadTypeDecl.java deleted file mode 100644 index 3c40a8394..000000000 --- a/modules/core/src/main/java/org/scribble/model/PayloadTypeDecl.java +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model; - -/** - * This class represents an imported type associated with a model. - * - */ -public class PayloadTypeDecl extends ModelObject { - - private String _format=null; - private String _type=null; - private String _schema=null; - private String _alias=null; - - /** - * The default constructor. - */ - public PayloadTypeDecl() { - } - - /** - * The copy constructor. - * - * @param copy The copy - */ - public PayloadTypeDecl(PayloadTypeDecl copy) { - super(copy); - _format = copy.getFormat(); - _type = copy.getType(); - _schema = copy.getSchema(); - _alias = copy.getAlias(); - } - - /** - * This method returns the schema format. - * - * @return The name - */ - public String getFormat() { - return (_format); - } - - /** - * This method sets the schema format. - * - * @param format The format - */ - public void setFormat(String format) { - _format = format; - } - - /** - * This method returns the schema format. - * - * @return The name - */ - public String getType() { - return (_type); - } - - /** - * This method sets the type. - * - * @param type The type - */ - public void setType(String type) { - _type = type; - } - - /** - * This method returns the schema. - * - * @return The schema - */ - public String getSchema() { - return (_schema); - } - - /** - * This method sets the schema. - * - * @param schema The schema - */ - public void setSchema(String schema) { - _schema = schema; - } - - /** - * This method returns the alias. - * - * @return The optional alias - */ - public String getAlias() { - return (_alias); - } - - /** - * This method sets the alias. - * - * @param alias The alias - */ - public void setAlias(String alias) { - _alias = alias; - } - - /** - * This method visits the model object using the supplied - * visitor. - * - * @param visitor The visitor - */ - public void visit(Visitor visitor) { - visitor.accept(this); - } - - @Override - public String toString() { - String ret=getType(); - - if (ret == null) { - ret = ""; - } - - return (ret); - } - - /** - * {@inheritDoc} - */ - public void toText(StringBuffer buf, int level) { - indent(buf, level); - - buf.append("type "); - - if (_format != null) { - buf.append('<'); - buf.append(_format); - buf.append("> "); - } - - if (_type != null) { - buf.append("\""); - buf.append(_type); - buf.append("\""); - } - - if (_schema != null) { - buf.append(" from "); - buf.append("\""); - buf.append(_schema); - buf.append("\""); - } - - if (_alias != null) { - buf.append(" as "); - buf.append(_alias); - } - - buf.append(";\n"); - } -} diff --git a/modules/core/src/main/java/org/scribble/model/ProtocolDecl.java b/modules/core/src/main/java/org/scribble/model/ProtocolDecl.java deleted file mode 100644 index 35381f233..000000000 --- a/modules/core/src/main/java/org/scribble/model/ProtocolDecl.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model; - -/** - * This class represents the protocol notation. - */ -public abstract class ProtocolDecl extends ModelObject { - - private String _name=null; - private java.util.List _roleDecls=new java.util.ArrayList(); - private java.util.List _parameterDecls=new java.util.ArrayList(); - - /** - * The default constructor. - */ - public ProtocolDecl() { - } - - /** - * This method returns the name. - * - * @return The name - */ - public String getName() { - return (_name); - } - - /** - * This method sets the name. - * - * @param name The name - */ - public void setName(String name) { - _name = name; - } - - /** - * This method returns the role declarations associated with - * the protocol. - * - * @return The role declarations - */ - public java.util.List getRoleDeclarations() { - return (_roleDecls); - } - - /** - * This method returns the role declaration associated - * with the supplied name. - * - * @param name The name - * @return The role declaration, or null if not found - */ - public RoleDecl getRoleDeclaration(String name) { - RoleDecl ret=null; - - for (RoleDecl rd : _roleDecls) { - if (rd.getDeclarationName().equals(name)) { - ret = rd; - break; - } - } - - return (ret); - } - - /** - * This method returns the parameter declarations associated with - * the protocol. - * - * @return The parameter declarations - */ - public java.util.List getParameterDeclarations() { - return (_parameterDecls); - } - - /** - * This method returns the parameter declaration associated - * with the supplied name. - * - * @param name The name - * @return The parameter declaration, or null if not found - */ - public ParameterDecl getParameterDeclaration(String name) { - ParameterDecl ret=null; - - for (ParameterDecl pd : _parameterDecls) { - if (pd.getName().equals(name) || (pd.getAlias() != null && pd.getAlias().equals(name))) { - ret = pd; - break; - } - } - - return (ret); - } - - /** - * This method returns the model in which this definition - * is contained. - * - * @return The model, or null if not contained within - * a model - */ - public Module getModule() { - Module ret=null; - ModelObject cur=this; - - while (ret == null && cur != null) { - if (cur instanceof Module) { - ret = (Module) cur; - } else { - cur = cur.getParent(); - } - } - - return (ret); - } - -} diff --git a/modules/core/src/main/java/org/scribble/model/Role.java b/modules/core/src/main/java/org/scribble/model/Role.java deleted file mode 100644 index dd593f343..000000000 --- a/modules/core/src/main/java/org/scribble/model/Role.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model; - -/** - * This class represents a role. - * - */ -public class Role extends ModelObject { - - private String _name=null; - - /** - * This is the default constructor. - */ - public Role() { - } - - /** - * This is the copy constructor. - * - * @param role The role - */ - public Role(Role role) { - super(role); - _name = role.getName(); - } - - /** - * This is the copy constructor. - * - * @param rd The role declaration - */ - public Role(RoleDecl rd) { - super(rd); - _name = rd.getAlias(); - - if (_name == null || _name.trim().length() == 0) { - _name = rd.getName(); - } - } - - /** - * This constructor initializes the role with a name. - * - * @param roleName The role name - */ - public Role(String roleName) { - _name = roleName; - } - - /** - * This method returns the name of the role. - * - * @return The name - */ - public String getName() { - return (_name); - } - - /** - * This method sets the name of the role. - * - * @param name The name - */ - public void setName(String name) { - _name = name; - } - - @Override - public boolean equals(Object obj) { - boolean ret=false; - - if (obj instanceof Role) { - Role other=(Role)obj; - - if (other.getName() != null && other.getName().equals(_name)) { - ret = true; - } - } - - return (ret); - } - - @Override - public int hashCode() { - int ret=super.hashCode(); - - if (_name != null) { - ret = _name.hashCode(); - } - - return (ret); - } - - @Override - public String toString() { - String ret=getName(); - - if (ret == null) { - ret = ""; - } - - return (ret); - } - - /** - * This method visits the model object using the supplied - * visitor. - * - * @param visitor The visitor - */ - public void visit(Visitor visitor) { - } - - /** - * {@inheritDoc} - */ - public void toText(StringBuffer buf, int level) { - if (_name != null) { - buf.append(_name); - } - } - -} diff --git a/modules/core/src/main/java/org/scribble/model/RoleDecl.java b/modules/core/src/main/java/org/scribble/model/RoleDecl.java deleted file mode 100644 index 451889627..000000000 --- a/modules/core/src/main/java/org/scribble/model/RoleDecl.java +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model; - -/** - * This class represents a role. - * - */ -public class RoleDecl extends ModelObject { - - private String _name=null; - private String _alias=null; - - /** - * This is the default constructor. - */ - public RoleDecl() { - } - - /** - * This is the copy constructor. - * - * @param role The role - */ - public RoleDecl(RoleDecl role) { - super(role); - _name = role.getName(); - _alias = role.getAlias(); - } - - /** - * This constructor initializes the role with a name. - * - * @param roleName The role name - */ - public RoleDecl(String roleName) { - _name = roleName; - } - - /** - * This method returns the name of the role. - * - * @return The name - */ - public String getName() { - return (_name); - } - - /** - * This method sets the name of the role. - * - * @param name The name - */ - public void setName(String name) { - _name = name; - } - - /** - * This method returns the alias of the role. - * - * @return The alias - */ - public String getAlias() { - return (_alias); - } - - /** - * This method sets the alias of the role. - * - * @param alias The alias - */ - public void setAlias(String alias) { - _alias = alias; - } - - /** - * Determines whether the role declaration is associated with the - * supplied role. - * - * @param role The role - * @return Whether the role is equivalent to the declaration - */ - public boolean isRole(Role role) { - return ((_name != null && _name.equals(role.getName())) || - (_alias != null && _alias.equals(role.getName()))); - } - - /** - * This method returns the declaration name for the role - * declaration. - * - * @return The declaration name - */ - public String getDeclarationName() { - String ret=_alias; - - if (ret == null) { - ret = _name; - } - - return (ret); - } - - @Override - public boolean equals(Object obj) { - boolean ret=false; - - if (obj instanceof RoleDecl) { - RoleDecl other=(RoleDecl)obj; - - if (other.getName() != null && other.getName().equals(_name)) { - ret = true; - } - } - - return (ret); - } - - @Override - public int hashCode() { - int ret=super.hashCode(); - - if (_name != null) { - ret = _name.hashCode(); - } - - return (ret); - } - - @Override - public String toString() { - String ret=getName(); - - if (ret == null) { - ret = ""; - } - - return (ret); - } - - /** - * This method visits the model object using the supplied - * visitor. - * - * @param visitor The visitor - */ - public void visit(Visitor visitor) { - } - - /** - * {@inheritDoc} - */ - public void toText(StringBuffer buf, int level) { - if (_name != null) { - buf.append(_name); - } - - if (_alias != null) { - buf.append(" as "+_alias); - } - } - -} diff --git a/modules/core/src/main/java/org/scribble/model/RoleInstantiation.java b/modules/core/src/main/java/org/scribble/model/RoleInstantiation.java deleted file mode 100644 index 34e7021ad..000000000 --- a/modules/core/src/main/java/org/scribble/model/RoleInstantiation.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model; - -/** - * This class represents a role instantiation. - * - */ -public class RoleInstantiation extends ModelObject { - - private String _name=null; - private String _alias=null; - - /** - * This is the default constructor. - */ - public RoleInstantiation() { - } - - /** - * This is the copy constructor. - * - * @param role The role - */ - public RoleInstantiation(RoleInstantiation role) { - super(role); - _name = role.getName(); - _alias = role.getAlias(); - } - - /** - * This method returns the name of the role. - * - * @return The name - */ - public String getName() { - return (_name); - } - - /** - * This method sets the name of the role. - * - * @param name The name - */ - public void setName(String name) { - _name = name; - } - - /** - * This method returns the alias of the role. - * - * @return The alias - */ - public String getAlias() { - return (_alias); - } - - /** - * This method sets the alias of the role. - * - * @param alias The alias - */ - public void setAlias(String alias) { - _alias = alias; - } - - @Override - public boolean equals(Object obj) { - boolean ret=false; - - if (obj instanceof RoleInstantiation) { - RoleInstantiation other=(RoleInstantiation)obj; - - if (other.getName() != null && other.getName().equals(_name)) { - ret = true; - } - } - - return (ret); - } - - @Override - public int hashCode() { - int ret=super.hashCode(); - - if (_name != null) { - ret = _name.hashCode(); - } - - return (ret); - } - - @Override - public String toString() { - String ret=getName(); - - if (ret == null) { - ret = ""; - } - - return (ret); - } - - /** - * This method visits the model object using the supplied - * visitor. - * - * @param visitor The visitor - */ - public void visit(Visitor visitor) { - } - - /** - * {@inheritDoc} - */ - public void toText(StringBuffer buf, int level) { - if (_name != null) { - buf.append(_name); - } - - if (_alias != null) { - buf.append(" as "+_alias); - } - } -} diff --git a/modules/core/src/main/java/org/scribble/model/Visitor.java b/modules/core/src/main/java/org/scribble/model/Visitor.java deleted file mode 100644 index 072d0b78f..000000000 --- a/modules/core/src/main/java/org/scribble/model/Visitor.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model; - -/** - * This interface represents a visitor which can be used - * to traverse a model. - */ -public interface Visitor { - - /** - * This method visits a type import component. - * - * @param elem The type import - */ - public void accept(PayloadTypeDecl elem); - - /** - * This method visits a protocol import component. - * - * @param elem The protocol import - */ - public void accept(ImportDecl elem); - -} diff --git a/modules/core/src/main/java/org/scribble/model/global/DefaultGVisitor.java b/modules/core/src/main/java/org/scribble/model/global/DefaultGVisitor.java deleted file mode 100644 index 7e985514f..000000000 --- a/modules/core/src/main/java/org/scribble/model/global/DefaultGVisitor.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model.global; - -import org.scribble.model.ImportDecl; -import org.scribble.model.PayloadTypeDecl; -import org.scribble.model.global.GChoice; - -/** - * This class represents the default visitor which can be used - * to traverse a model. - */ -public class DefaultGVisitor implements GVisitor { - - /** - * {@inheritDoc} - */ - public boolean start(GBlock elem) { - return (true); - } - - /** - * {@inheritDoc} - */ - public void end(GBlock elem) { - } - - /** - * {@inheritDoc} - */ - public boolean start(GChoice elem) { - return (true); - } - - /** - * {@inheritDoc} - */ - public void end(GChoice elem) { - } - - /** - * {@inheritDoc} - */ - public boolean start(GParallel elem) { - return (true); - } - - /** - * {@inheritDoc} - */ - public void end(GParallel elem) { - } - - /** - * {@inheritDoc} - */ - public boolean start(GProtocolDefinition elem) { - return (true); - } - - /** - * {@inheritDoc} - */ - public void end(GProtocolDefinition elem) { - } - - /** - * {@inheritDoc} - */ - public boolean start(GRecursion elem) { - return (true); - } - - /** - * {@inheritDoc} - */ - public void end(GRecursion elem) { - } - - /** - * {@inheritDoc} - */ - public boolean start(GInterruptible elem) { - return (true); - } - - /** - * {@inheritDoc} - */ - public void end(GInterruptible elem) { - } - - /** - * {@inheritDoc} - */ - public void accept(GProtocolInstance elem) { - } - - /** - * {@inheritDoc} - */ - public void accept(GMessageTransfer elem) { - } - - /** - * {@inheritDoc} - */ - public void accept(GContinue elem) { - } - - /** - * {@inheritDoc} - */ - public void accept(GDo elem) { - } - - /** - * {@inheritDoc} - */ - public void accept(GCustomActivity elem) { - } - - /** - * {@inheritDoc} - */ - public void accept(PayloadTypeDecl elem) { - } - - /** - * {@inheritDoc} - */ - public void accept(ImportDecl elem) { - } - -} diff --git a/modules/core/src/main/java/org/scribble/model/global/GActivity.java b/modules/core/src/main/java/org/scribble/model/global/GActivity.java deleted file mode 100644 index 6fa0ae7e2..000000000 --- a/modules/core/src/main/java/org/scribble/model/global/GActivity.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model.global; - -import org.scribble.model.ModelObject; -import org.scribble.model.Role; -import org.scribble.model.RoleDecl; -import org.scribble.model.Visitor; - -/** - * This class represents the base class for all Scribble definition - * context. - */ -public abstract class GActivity extends ModelObject { - - /** - * The default constructor. - */ - public GActivity() { - } - - /** - * The copy constructor. - * - * @param act The activity - */ - public GActivity(GActivity act) { - super(act); - } - - /** - * This method determines whether the supplied role is 'involved' - * in this global activity. - * - * @param r The role - * @return Whether the role is involved - */ - public abstract boolean isRoleInvolved(RoleDecl role); - - /** - * This method builds up the set of roles involved in the global - * activity. - * - * @param roles The set of involved roles - */ - public abstract void identifyInvolvedRoles(java.util.Set roles); - - /** - * {@inheritDoc} - */ - public void visit(Visitor visitor) { - if (visitor instanceof GVisitor) { - visit((GVisitor)visitor); - } - } - - /** - * This method visits the model object using the supplied - * visitor. - * - * @param visitor The visitor - */ - public abstract void visit(GVisitor visitor); - -} diff --git a/modules/core/src/main/java/org/scribble/model/global/GBlock.java b/modules/core/src/main/java/org/scribble/model/global/GBlock.java deleted file mode 100644 index 4cf60a2ad..000000000 --- a/modules/core/src/main/java/org/scribble/model/global/GBlock.java +++ /dev/null @@ -1,175 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model.global; - -import org.scribble.model.ContainmentList; -import org.scribble.model.Role; -import org.scribble.model.RoleDecl; - -/** - * This class represents a group of activities. - * - */ -public class GBlock extends GActivity { - - private java.util.List _contents= - new ContainmentList(this, GActivity.class); - - /** - * {@inheritDoc} - */ - public boolean isRoleInvolved(RoleDecl role) { - boolean ret=false; - - for (int i=0; !ret && i < _contents.size(); i++) { - ret = _contents.get(i).isRoleInvolved(role); - } - - return (ret); - } - - /** - * {@inheritDoc} - */ - public void identifyInvolvedRoles(java.util.Set roles) { - for (GActivity act : _contents) { - act.identifyInvolvedRoles(roles); - } - } - - /** - * This method returns the contents associated with - * the block. - * - * @return The contents - */ - public java.util.List getContents() { - return (_contents); - } - - /** - * This method adds an activity to the block. - * - * @param act The activity - * @return Whether the activity has been added - */ - public boolean add(GActivity act) { - return (_contents.add(act)); - } - - /** - * This method removes an activity from the block. - * - * @param act The activity - * @return Whether the activity has been removed - */ - public boolean remove(GActivity act) { - return (_contents.remove(act)); - } - - /** - * This method returns the number of activities - * in the block. - * - * @return The number of activities - */ - public int size() { - return (_contents.size()); - } - - /** - * This method returns the activity at the specified - * index. - * - * @param index The index The index - * @return The activity The activity - * @throws IndexOutOfBoundsException Out of bounds - */ - public GActivity get(int index) throws IndexOutOfBoundsException { - return (_contents.get(index)); - } - - /** - * This method returns the index of the supplied activity. - * - * @param act The activity - * @return The index, or -1 if the activity is not found - */ - public int indexOf(GActivity act) { - return (_contents.indexOf(act)); - } - - /** - * This method visits the model object using the supplied - * visitor. - * - * @param visitor The visitor - */ - public void visit(GVisitor visitor) { - - if (((GVisitor)visitor).start(this)) { - - for (int i=0; i < getContents().size(); i++) { - getContents().get(i).visit(visitor); - } - } - - visitor.end(this); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - - GBlock that = (GBlock) o; - - return _contents.equals(that._contents); - } - - @Override - public int hashCode() { - return _contents.hashCode(); - } - - @Override - public String toString() { - String result = "{\n"; - for (GActivity act : _contents) { - result += act + "\n"; - } - return result + "}"; - } - - /** - * {@inheritDoc} - */ - public void toText(StringBuffer buf, int level) { - - buf.append("{\n"); - - for (GActivity act : _contents) { - act.toText(buf, level+1); - } - - indent(buf, level); - buf.append("}"); - } -} diff --git a/modules/core/src/main/java/org/scribble/model/global/GChoice.java b/modules/core/src/main/java/org/scribble/model/global/GChoice.java deleted file mode 100644 index 5f106fab5..000000000 --- a/modules/core/src/main/java/org/scribble/model/global/GChoice.java +++ /dev/null @@ -1,177 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model.global; - -import org.scribble.model.ContainmentList; -import org.scribble.model.Role; -import org.scribble.model.RoleDecl; - -/** - * This class represents the Choice construct between - * two or more paths. - * - */ -public class GChoice extends GMultiPathActivity { - - private Role _role=null; - private java.util.List _blocks=new ContainmentList(this, GBlock.class); - - /** - * This is the default constructor. - * - */ - public GChoice() { - } - - /** - * {@inheritDoc} - */ - public boolean isRoleInvolved(RoleDecl role) { - boolean ret=false; - - if (_role != null) { - ret = role.isRole(_role); - } - - for (int i=0; !ret && i < _blocks.size(); i++) { - ret = _blocks.get(i).isRoleInvolved(role); - } - - return (ret); - } - - /** - * {@inheritDoc} - */ - public void identifyInvolvedRoles(java.util.Set roles) { - - if (_role != null) { - roles.add(_role); - } - - for (GBlock b : _blocks) { - b.identifyInvolvedRoles(roles); - } - } - - /** - * This method returns the role. - * - * @return The role - */ - public Role getRole() { - return (_role); - } - - /** - * This method sets the role. - * - * @param role The role - */ - public void setRole(Role role) { - _role = role; - } - - /** - * This method returns the list of mutually exclusive - * activity blocks that comprise the multi-path construct. - * - * @return The list of choice paths - */ - public java.util.List getPaths() { - return (_blocks); - } - - /** - * This method visits the model object using the supplied - * visitor. - * - * @param visitor The visitor - */ - public void visit(GVisitor visitor) { - if (visitor.start(this)) { - - for (GBlock b : getPaths()) { - b.visit(visitor); - } - } - - visitor.end(this); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - - GChoice that = (GChoice) o; - - return !(_role != null - ? !_role.equals(that._role) - : that._role != null) - && _blocks.equals(that._blocks); - } - - @Override - public int hashCode() { - int result = _blocks.hashCode(); - result = 31 * result + (_role != null ? _role.hashCode() : 0); - return result; - } - - @Override - public String toString() { - String result = "choice "; - if (_role != null) { - result += "at " + _role+" "; - } - for (GBlock b : _blocks) { - if (_blocks.indexOf(b) > 0) { - result += "or "; - } - result += b + "\n"; - } - return result; - } - - /** - * {@inheritDoc} - */ - public void toText(StringBuffer buf, int level) { - - indent(buf, level); - - buf.append("choice at "); - - if (_role != null) { - buf.append(_role); - buf.append(" "); - } - - for (int i=0; i < getPaths().size(); i++) { - if (i > 0) { - buf.append(" or "); - } - getPaths().get(i).toText(buf, level); - } - - buf.append("\n"); - } -} diff --git a/modules/core/src/main/java/org/scribble/model/global/GContinue.java b/modules/core/src/main/java/org/scribble/model/global/GContinue.java deleted file mode 100644 index bda2ac6cf..000000000 --- a/modules/core/src/main/java/org/scribble/model/global/GContinue.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model.global; - -import org.scribble.model.Role; -import org.scribble.model.RoleDecl; - -/** - * This class represents the Raise construct. - * - */ -public class GContinue extends GActivity { - - private String _label=null; - - /** - * This is the default constructor. - * - */ - public GContinue() { - } - - /** - * This is the copy constructor. - * - * @param copy The recursion to copy - */ - public GContinue(GContinue copy) { - super(copy); - _label = copy.getLabel(); - } - - /** - * {@inheritDoc} - */ - public boolean isRoleInvolved(RoleDecl role) { - return (false); - } - - /** - * {@inheritDoc} - */ - public void identifyInvolvedRoles(java.util.Set roles) { - } - - /** - * This method returns the label associated with the recursion construct. - * - * @return The label - */ - public String getLabel() { - return (_label); - } - - /** - * This method sets the label associated with the recursion construct. - * - * @param label The label - */ - public void setLabel(String label) { - _label = label; - } - - /** - * This method visits the model object using the supplied - * visitor. - * - * @param visitor The visitor - */ - public void visit(GVisitor visitor) { - visitor.accept(this); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - - GContinue that = (GContinue) o; - - return !(_label != null - ? !_label.equals(that._label) - : that._label != null); - } - - @Override - public int hashCode() { - return _label != null ? _label.hashCode() : 0; - } - - @Override - public String toString() { - return "continue " + _label; - } - - /** - * {@inheritDoc} - */ - public void toText(StringBuffer buf, int level) { - - indent(buf, level); - - buf.append("continue "); - - if (_label != null) { - buf.append(_label); - } - - buf.append(";\n"); - } -} diff --git a/modules/core/src/main/java/org/scribble/model/global/GCustomActivity.java b/modules/core/src/main/java/org/scribble/model/global/GCustomActivity.java deleted file mode 100644 index 2649618b0..000000000 --- a/modules/core/src/main/java/org/scribble/model/global/GCustomActivity.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2009-10 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model.global; - -import org.scribble.model.Role; -import org.scribble.model.RoleDecl; - -/** - * This class represents a custom activity. - * - */ -public class GCustomActivity extends GActivity { - - private java.util.List _roles=new java.util.Vector(); - - /** - * This is the default constructor. - * - */ - public GCustomActivity() { - } - - /** - * This is the copy constructor. - * - * @param act The custom activity to copy - */ - public GCustomActivity(GCustomActivity act) { - super(act); - } - - /** - * {@inheritDoc} - */ - public boolean isRoleInvolved(RoleDecl role) { - boolean ret=false; - - for (int i=0; !ret && i < _roles.size(); i++) { - Role r=new Role(_roles.get(i)); - ret = role.isRole(r); - } - - return (ret); - } - - /** - * {@inheritDoc} - */ - public void identifyInvolvedRoles(java.util.Set roles) { - for (int i=0; i < _roles.size(); i++) { - roles.add(new Role(_roles.get(i))); - } - } - - /** - * This method returns the roles associated with the custom activity. - * - * @return The roles - */ - public java.util.List getRoles() { - return(_roles); - } - - /** - * This method visits the model object using the supplied - * visitor. - * - * @param visitor The visitor - */ - public void visit(GVisitor visitor) { - visitor.accept(this); - } - - /** - * {@inheritDoc} - */ - public void toText(StringBuffer buf, int level) { - - indent(buf, level); - - buf.append("custom at "); - - for (int i=0; i < _roles.size(); i++) { - if (i > 0) { - buf.append(","); - } - buf.append(_roles.get(i)); - } - - buf.append(";\n"); - } -} diff --git a/modules/core/src/main/java/org/scribble/model/global/GDo.java b/modules/core/src/main/java/org/scribble/model/global/GDo.java deleted file mode 100644 index 2d0e7f688..000000000 --- a/modules/core/src/main/java/org/scribble/model/global/GDo.java +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model.global; - -import org.scribble.model.Argument; -import org.scribble.model.ContainmentList; -import org.scribble.model.Role; -import org.scribble.model.RoleDecl; -import org.scribble.model.RoleInstantiation; - -/** - * This class represents the Run construct. - * - */ -public class GDo extends GActivity { - - private String _protocol=null; - private String _scopeName=null; - private java.util.List _arguments=new ContainmentList(this, Argument.class); - private java.util.List _roleInstantiations=new ContainmentList(this, - RoleInstantiation.class); - - /** - * This is the default constructor. - * - */ - public GDo() { - } - - /** - * This is the copy constructor. - * - * @param copy The copy - */ - public GDo(GDo copy) { - super(copy); - _protocol = copy.getProtocol(); - - for (Argument arg : copy.getArguments()) { - _arguments.add(new Argument(arg)); - } - - for (RoleInstantiation ri : copy.getRoleInstantiations()) { - _roleInstantiations.add(new RoleInstantiation(ri)); - } - } - - /** - * {@inheritDoc} - */ - public boolean isRoleInvolved(RoleDecl role) { - boolean ret=false; - - for (int i=0; !ret && i < _roleInstantiations.size(); i++) { - RoleInstantiation ri=_roleInstantiations.get(i); - - ret = role.isRole(new Role(ri.getName())); - } - - return (ret); - } - - /** - * {@inheritDoc} - */ - public void identifyInvolvedRoles(java.util.Set roles) { - - for (int i=0; i < _roleInstantiations.size(); i++) { - RoleInstantiation ri=_roleInstantiations.get(i); - - roles.add(new Role(ri.getName())); - } - } - - /** - * This method returns the protocol. - * - * @return The protocol - */ - public String getProtocol() { - return (_protocol); - } - - /** - * This method sets the protocol. - * - * @param protocol The protocol - */ - public void setProtocol(String protocol) { - _protocol = protocol; - } - - /** - * This method returns the optional scope name. - * - * @return The scope name - */ - public String getScope() { - return (_scopeName); - } - - /** - * This method sets the optional scope name. - * - * @param scope The scope name - */ - public void setScope(String scope) { - _scopeName = scope; - } - - /** - * This method returns the argument list. - * - * @return The list of arguments - */ - public java.util.List getArguments() { - return (_arguments); - } - - /** - * This method returns the argument list. - * - * @return The list of arguments - */ - public java.util.List getRoleInstantiations() { - return (_roleInstantiations); - } - - /** - * This method returns the role instantiation associated with the supplied - * role name, or null if not found. - * - * @param role The role - * @return The role instantiation, or null if not found - */ - public RoleInstantiation getRoleInstantiation(RoleDecl role) { - for (RoleInstantiation ri : _roleInstantiations) { - if (role.isRole(new Role(ri.getName()))) { - return (ri); - } - } - - return (null); - } - - /** - * This method visits the model object using the supplied - * visitor. - * - * @param visitor The visitor - */ - public void visit(GVisitor visitor) { - visitor.accept(this); - } - - /** - * {@inheritDoc} - */ - public void toText(StringBuffer buf, int level) { - - indent(buf, level); - - buf.append("do "); - - if (_scopeName != null) { - buf.append(_scopeName); - buf.append(": "); - } - - if (_protocol != null) { - buf.append(_protocol); - } - - if (_arguments.size() > 0) { - buf.append('<'); - for (int i=0; i < _arguments.size(); i++) { - if (i > 0) { - buf.append(","); - } - buf.append(_arguments.get(i)); - } - buf.append(">"); - } - - buf.append("("); - for (int i=0; i < _roleInstantiations.size(); i++) { - if (i > 0) { - buf.append(","); - } - _roleInstantiations.get(i).toText(buf, level); - } - - buf.append(");\n"); - } -} diff --git a/modules/core/src/main/java/org/scribble/model/global/GInterruptible.java b/modules/core/src/main/java/org/scribble/model/global/GInterruptible.java deleted file mode 100644 index 4decc4d59..000000000 --- a/modules/core/src/main/java/org/scribble/model/global/GInterruptible.java +++ /dev/null @@ -1,279 +0,0 @@ -/* - * Copyright 2009-10 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model.global; - -import org.scribble.model.ContainmentList; -import org.scribble.model.Message; -import org.scribble.model.ModelObject; -import org.scribble.model.Role; -import org.scribble.model.RoleDecl; -import org.scribble.model.Visitor; - -/** - * This class represents the interruptible construct. - * - */ -public class GInterruptible extends GSinglePathActivity { - - private String _scope=null; - private GBlock _block=new GBlock(); - private java.util.List _interrupts=new ContainmentList(this, Interrupt.class); - - /** - * This is the default constructor. - * - */ - public GInterruptible() { - _block.setParent(this); - } - - /** - * {@inheritDoc} - */ - public boolean isRoleInvolved(RoleDecl role) { - boolean ret=_block.isRoleInvolved(role); - - for (int i=0; !ret && i < _interrupts.size(); i++) { - if (_interrupts.get(i).getRole() != null) { - ret = role.isRole(_interrupts.get(i).getRole()); - } - } - - return (ret); - } - - /** - * {@inheritDoc} - */ - public void identifyInvolvedRoles(java.util.Set roles) { - _block.identifyInvolvedRoles(roles); - - for (int i=0; i < _interrupts.size(); i++) { - if (_interrupts.get(i).getRole() != null) { - roles.add(_interrupts.get(i).getRole()); - } - } - } - - /** - * This method returns the scope name. - * - * @return The scope name - */ - public String getScope() { - return (_scope); - } - - /** - * This method sets the scope name. - * - * @param scope The scope name - */ - public void setScope(String scope) { - _scope = scope; - } - - /** - * This method returns the activities. - * - * @return The block of activities - */ - public GBlock getBlock() { - return (_block); - } - - /** - * This method sets the block. - * - * @param block The block - */ - public void setBlock(GBlock block) { - if (_block != null) { - _block.setParent(null); - } - - _block = block; - - if (_block != null) { - _block.setParent(this); - } - } - - /** - * This method sets the interrupts. - * - * @param interrupts The interrupts - */ - public void setInterrupts(java.util.List interrupts) { - _interrupts = interrupts; - } - - /** - * This method gets the interrupts. - * - * @return The interrupts - */ - public java.util.List getInterrupts() { - return (_interrupts); - } - - /** - * This method visits the model object using the supplied - * visitor. - * - * @param visitor The visitor - */ - public void visit(GVisitor visitor) { - if (visitor.start(this)) { - - if (getBlock() != null) { - getBlock().visit(visitor); - } - } - - visitor.end(this); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - - GInterruptible that = (GInterruptible) o; - - return !(_scope != null - ? !_scope.equals(that._scope) - : that._scope != null) - && !(_block != null - ? !_block.equals(that._block) - : that._block != null); - } - - @Override - public int hashCode() { - int result = _scope != null ? _scope.hashCode() : 0; - return 31 * result + (_block != null ? _block.hashCode() : 0); - } - - @Override - public String toString() { - return "interruptible "+_scope+" "+_block; - } - - /** - * {@inheritDoc} - */ - public void toText(StringBuffer buf, int level) { - - indent(buf, level); - - buf.append("interruptible "); - - if (_scope != null) { - buf.append(_scope); - buf.append(": "); - } - - if (_block != null) { - _block.toText(buf, level); - } - - buf.append(" with {\n"); - - for (Interrupt i : getInterrupts()) { - i.toText(buf, level+1); - } - - indent(buf, level); - - buf.append("}\n"); - } - - /** - * This class represents the interrupt definition. - * - */ - public static class Interrupt extends ModelObject { - - private Role _role=null; - private java.util.List _messages=new ContainmentList(this, Message.class); - - public Interrupt() { - } - - /** - * This method sets the 'by' role. - * - * @param role The 'by' role - */ - public void setRole(Role role) { - _role = role; - } - - /** - * This method gets the 'by' role. - * - * @return The 'by' role - */ - public Role getRole() { - return (_role); - } - - /** - * This method sets the interrupt messages. - * - * @param mesgs The messages - */ - public void setMessages(java.util.List mesgs) { - _messages = mesgs; - } - - /** - * This method gets the interrupt messages. - * - * @return The messages - */ - public java.util.List getMessages() { - return (_messages); - } - - @Override - public void visit(Visitor visitor) { - } - - public void toText(StringBuffer buf, int level) { - - GInterruptible.indent(buf, level); - - for (int i=0; i < _messages.size(); i++) { - if (i > 0) { - buf.append(","); - } - _messages.get(i).toText(buf, level); - } - - buf.append(" by "); - - _role.toText(buf, level); - - buf.append(";\n"); - } - } -} diff --git a/modules/core/src/main/java/org/scribble/model/global/GMessageTransfer.java b/modules/core/src/main/java/org/scribble/model/global/GMessageTransfer.java deleted file mode 100644 index 8d95f5da5..000000000 --- a/modules/core/src/main/java/org/scribble/model/global/GMessageTransfer.java +++ /dev/null @@ -1,270 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model.global; - -import org.scribble.model.Message; -import org.scribble.model.Role; -import org.scribble.model.RoleDecl; -import org.scribble.model.global.GActivity; - -/** - * This class represents an interaction: the communication - * of a message from one role to another, or several others. - * - */ -public class GMessageTransfer extends GActivity { - - private Message _message=null; - private Role _fromRole=null; - private java.util.List _toRoles=new java.util.ArrayList(); - - /** - * The default constructor. - */ - public GMessageTransfer() { - } - - /** - * The copy constructor. - * - * @param i The interaction to copy - */ - public GMessageTransfer(GMessageTransfer i) { - super(i); - - if (i._message != null) { - _message = new Message(i._message); - } - - _fromRole = i._fromRole; - - for (Role r : i._toRoles) { - _toRoles.add(new Role(r)); - } - } - - /** - * This method initializes the 'from' and 'to' roles, and - * message signature. - * - * @param sig The message signature - * @param fromRole The 'from' role - * @param toRoles The 'to' roles - */ - public GMessageTransfer(Message sig, Role fromRole, java.util.List toRoles) { - _message = sig; - _fromRole = fromRole; - _toRoles = toRoles; - } - - /** - * {@inheritDoc} - */ - public boolean isRoleInvolved(RoleDecl role) { - boolean ret=false; - - if (_fromRole != null) { - ret = role.isRole(_fromRole); - } - - for (int i=0; !ret && i < _toRoles.size(); i++) { - ret = role.isRole(_toRoles.get(i)); - } - - return (ret); - } - - /** - * {@inheritDoc} - */ - public void identifyInvolvedRoles(java.util.Set roles) { - - if (_fromRole != null) { - roles.add(_fromRole); - } - - roles.addAll(_toRoles); - } - - /** - * This method returns the message. - * - * @return The message - */ - public Message getMessage() { - return (_message); - } - - /** - * This method sets the message. - * - * @param message The message - */ - public void setMessage(Message message) { - - if (_message != null) { - _message.setParent(null); - } - - _message = message; - - if (_message != null) { - _message.setParent(this); - } - } - - /** - * This method returns the 'from' role. - * - * @return The 'from' role - */ - public Role getFromRole() { - return (_fromRole); - } - - /** - * This method sets the 'from' role. - * - * @param part The 'from' role - */ - public void setFromRole(Role part) { - _fromRole = part; - } - - /** - * This method returns the 'to' roles. - * - * @return The 'to' roles - */ - public java.util.List getToRoles() { - return (_toRoles); - } - - /** - * This method sets the 'to' roles. - * - * @param part The 'to' roles - */ - public void setToRoles(java.util.List part) { - _toRoles = part; - } - - - @Override - public String toString() { - StringBuffer ret=new StringBuffer(); - - if (getMessage() != null) { - ret.append(getMessage()); - ret.append(" "); - } - - ret.append(getFromRole()); - ret.append("->"); - - for (int i=0; i < getToRoles().size(); i++) { - if (i > 0) { - ret.append(","); - } - ret.append(getToRoles().get(i)); - } - - return (ret.toString()); - } - - /** - * This method visits the model object using the supplied - * visitor. - * - * @param visitor The visitor - */ - public void visit(GVisitor visitor) { - visitor.accept(this); - - if (getMessage() != null) { - getMessage().visit(visitor); - } - - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - - GMessageTransfer that = (GMessageTransfer) o; - - boolean ret=!(_fromRole != null - ? !_fromRole.equals(that._fromRole) - : that._fromRole != null) - && !(_message != null - ? !_message.equals(that._message) - : that._message != null); - - if (ret) { - if (_toRoles.size() != that.getToRoles().size()) { - return false; - } - for (int i=0; i < _toRoles.size(); i++) { - Role r=_toRoles.get(i); - if (!r.equals(that.getToRoles().get(i))) { - return false; - } - } - } - - return ret; - } - - @Override - public int hashCode() { - int result = _message != null ? _message.hashCode() : 0; - result = 31 * result + (_fromRole != null ? _fromRole.hashCode() : 0); - return result; - } - - /** - * {@inheritDoc} - */ - public void toText(StringBuffer buf, int level) { - - indent(buf, level); - - _message.toText(buf, level); - - if (_fromRole != null) { - buf.append(" from "); - _fromRole.toText(buf, level); - } - - if (_toRoles != null) { - buf.append(" to "); - for (int i=0; i < getToRoles().size(); i++) { - if (i > 0) { - buf.append(","); - } - _toRoles.get(i).toText(buf, level); - } - - } - - buf.append(";\n"); - } -} diff --git a/modules/core/src/main/java/org/scribble/model/global/GMultiPathActivity.java b/modules/core/src/main/java/org/scribble/model/global/GMultiPathActivity.java deleted file mode 100644 index 040526067..000000000 --- a/modules/core/src/main/java/org/scribble/model/global/GMultiPathActivity.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model.global; - -/** - * This class represents the base class for all multi-path activities. - */ -public abstract class GMultiPathActivity extends GActivity { - - /** - * The default constructor. - */ - public GMultiPathActivity() { - } - - /** - * The copy constructor. - * - * @param act The activity - */ - public GMultiPathActivity(GMultiPathActivity act) { - super(act); - } - - /** - * This method returns the list of paths. - * - * @return The paths - */ - public abstract java.util.List getPaths(); - -} diff --git a/modules/core/src/main/java/org/scribble/model/global/GParallel.java b/modules/core/src/main/java/org/scribble/model/global/GParallel.java deleted file mode 100644 index 222c3655b..000000000 --- a/modules/core/src/main/java/org/scribble/model/global/GParallel.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model.global; - -import org.scribble.model.ContainmentList; -import org.scribble.model.Role; -import org.scribble.model.RoleDecl; - -/** - * This class represents the Parallel construct with - * two or more concurrent paths. - * - */ -public class GParallel extends GMultiPathActivity { - - private java.util.List _blocks=new ContainmentList(this, GBlock.class); - - /** - * This is the default constructor. - * - */ - public GParallel() { - } - - /** - * {@inheritDoc} - */ - public boolean isRoleInvolved(RoleDecl role) { - boolean ret=false; - - for (int i=0; !ret && i < _blocks.size(); i++) { - ret = _blocks.get(i).isRoleInvolved(role); - } - - return (ret); - } - - /** - * {@inheritDoc} - */ - public void identifyInvolvedRoles(java.util.Set roles) { - - for (GBlock b : _blocks) { - b.identifyInvolvedRoles(roles); - } - } - - /** - * This method returns the list of concurrent - * activity blocks that comprise the multi-path construct. - * - * @return The list of concurrent paths - */ - public java.util.List getPaths() { - return (_blocks); - } - - /** - * This method visits the model object using the supplied - * visitor. - * - * @param visitor The visitor - */ - public void visit(GVisitor visitor) { - if (visitor.start(this)) { - - for (GBlock b : getPaths()) { - b.visit(visitor); - } - } - - visitor.end(this); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - - GParallel that = (GParallel) o; - - return _blocks.equals(that._blocks); - } - - @Override - public int hashCode() { - int result = _blocks.hashCode(); - return result; - } - - @Override - public String toString() { - String result = "parallel "; - for (GBlock b : _blocks) { - if (_blocks.indexOf(b) > 0) { - result += "and "; - } - result += b + "\n"; - } - return result; - } - - /** - * {@inheritDoc} - */ - public void toText(StringBuffer buf, int level) { - - indent(buf, level); - - buf.append("par "); - - for (int i=0; i < getPaths().size(); i++) { - if (i > 0) { - buf.append(" and "); - } - getPaths().get(i).toText(buf, level); - } - - buf.append("\n"); - } -} diff --git a/modules/core/src/main/java/org/scribble/model/global/GProtocolDefinition.java b/modules/core/src/main/java/org/scribble/model/global/GProtocolDefinition.java deleted file mode 100644 index bdf7166da..000000000 --- a/modules/core/src/main/java/org/scribble/model/global/GProtocolDefinition.java +++ /dev/null @@ -1,175 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model.global; - -import org.scribble.model.ParameterDecl; -import org.scribble.model.ProtocolDecl; -import org.scribble.model.RoleDecl; -import org.scribble.model.Visitor; - -/** - * This class represents the protocol notation. - */ -public class GProtocolDefinition extends ProtocolDecl { - - private GBlock _block=null; - - /** - * The default constructor. - */ - public GProtocolDefinition() { - } - - /** - * This method returns the block of activities associated - * with the definition. - * - * @return The block of activities - */ - public GBlock getBlock() { - - if (_block == null) { - _block = new GBlock(); - _block.setParent(this); - } - - return (_block); - } - - /** - * This method sets the block of activities associated - * with the definition. - * - * @param block The block of activities - */ - public void setBlock(GBlock block) { - if (_block != null) { - _block.setParent(null); - } - - _block = block; - - if (_block != null) { - _block.setParent(this); - } - } - - /** - * This method visits the model object using the supplied - * visitor. - * - * @param visitor The visitor - */ - public void visit(Visitor visitor) { - - if (visitor instanceof GVisitor) { - if (((GVisitor)visitor).start(this)) { - - if (getBlock() != null) { - getBlock().visit(visitor); - } - } - - ((GVisitor)visitor).end(this); - } - } - - public String toString() { - String ret="global protocol "+getName(); - - if (getParameterDeclarations().size() > 0) { - ret += " <"; - - for (int i=0; i < getParameterDeclarations().size(); i++) { - ParameterDecl pd=getParameterDeclarations().get(i); - - if (i > 0) { - ret += ","; - } - - ret += (pd.getType().name().toLowerCase()+" "+pd.getName()); - if (pd.getAlias() != null) { - ret += " as "+pd.getAlias(); - } - } - - ret += ">"; - } - - ret += " ( "; - - for (int i=0; i < getRoleDeclarations().size(); i++) { - RoleDecl role=getRoleDeclarations().get(i); - - if (i > 0) { - ret += ","; - } - - ret += ("role "+role.getName()+" "); - if (role.getAlias() != null) { - ret += " as "+role.getAlias(); - } - } - - ret += ")\n"; - - ret += getBlock(); - - return(ret); - } - - /** - * {@inheritDoc} - */ - public void toText(StringBuffer buf, int level) { - - indent(buf, level); - - buf.append("global protocol "); - - buf.append(getName()); - - if (getParameterDeclarations().size() > 0) { - buf.append("<"); - - for (int i=0; i < getParameterDeclarations().size(); i++) { - if (i > 0) { - buf.append(","); - } - getParameterDeclarations().get(i).toText(buf, level); - } - buf.append(">"); - } - - buf.append("("); - - for (int i=0; i < getRoleDeclarations().size(); i++) { - if (i > 0) { - buf.append(","); - } - buf.append("role "); - getRoleDeclarations().get(i).toText(buf, level); - } - buf.append(") "); - - - if (_block != null) { - _block.toText(buf, level); - } - - buf.append("\n"); - } -} diff --git a/modules/core/src/main/java/org/scribble/model/global/GProtocolInstance.java b/modules/core/src/main/java/org/scribble/model/global/GProtocolInstance.java deleted file mode 100644 index 732999efa..000000000 --- a/modules/core/src/main/java/org/scribble/model/global/GProtocolInstance.java +++ /dev/null @@ -1,213 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model.global; - -import org.scribble.model.Argument; -import org.scribble.model.ContainmentList; -import org.scribble.model.ParameterDecl; -import org.scribble.model.ProtocolDecl; -import org.scribble.model.Role; -import org.scribble.model.RoleDecl; -import org.scribble.model.RoleInstantiation; -import org.scribble.model.Visitor; - -/** - * This class represents the protocol notation. - */ -public class GProtocolInstance extends ProtocolDecl { - - private String _memberName=null; - private java.util.List _arguments=new ContainmentList(this, Argument.class); - private java.util.List _roleInstantiations=new ContainmentList(this, - RoleInstantiation.class); - - /** - * The default constructor. - */ - public GProtocolInstance() { - } - - /** - * This method returns the member name. - * - * @return The name - */ - public String getMemberName() { - return (_memberName); - } - - /** - * This method sets the member name. - * - * @param name The name - */ - public void setMemberName(String name) { - _memberName = name; - } - - /** - * This method returns the role declarations associated with - * the protocol. - * - * @return The role declarations - */ - public java.util.List getRoleInstantiations() { - return (_roleInstantiations); - } - - /** - * This method returns the role instantiation associated with the supplied - * role name, or null if not found. - * - * @param role The role - * @return The role instantiation, or null if not found - */ - public RoleInstantiation getRoleInstantiation(RoleDecl role) { - for (RoleInstantiation ri : _roleInstantiations) { - if (role.isRole(new Role(ri.getName()))) { - return (ri); - } - } - - return (null); - } - - /** - * This method returns the parameter declarations associated with - * the protocol. - * - * @return The parameter declarations - */ - public java.util.List getArguments() { - return (_arguments); - } - - /** - * This method visits the model object using the supplied - * visitor. - * - * @param visitor The visitor - */ - public void visit(Visitor visitor) { - if (visitor instanceof GVisitor) { - ((GVisitor)visitor).accept(this); - } - } - - public String toString() { - String ret="global protocol "+getName(); - - if (getParameterDeclarations().size() > 0) { - ret += " <"; - - for (int i=0; i < getParameterDeclarations().size(); i++) { - ParameterDecl pd=getParameterDeclarations().get(i); - - if (i > 0) { - ret += ","; - } - - ret += (pd.getType().name().toLowerCase()+" "+pd.getName()); - if (pd.getAlias() != null) { - ret += " as "+pd.getAlias(); - } - } - - ret += ">"; - } - - ret += " ( "; - - for (int i=0; i < getRoleDeclarations().size(); i++) { - RoleDecl role=getRoleDeclarations().get(i); - - if (i > 0) { - ret += ","; - } - - ret += ("role "+role.getName()+" "); - if (role.getAlias() != null) { - ret += " as "+role.getAlias(); - } - } - - ret += ") instantiates "; - - ret += _memberName; - - return(ret); - } - - /** - * {@inheritDoc} - */ - public void toText(StringBuffer buf, int level) { - - indent(buf, level); - - buf.append("global protocol "); - - buf.append(getName()); - - if (getParameterDeclarations().size() > 0) { - buf.append("<"); - - for (int i=0; i < getParameterDeclarations().size(); i++) { - if (i > 0) { - buf.append(","); - } - getParameterDeclarations().get(i).toText(buf, level); - } - buf.append(">"); - } - - buf.append("("); - - for (int i=0; i < getRoleDeclarations().size(); i++) { - if (i > 0) { - buf.append(","); - } - buf.append("role "); - getRoleDeclarations().get(i).toText(buf, level); - } - buf.append(") instantiates "); - - buf.append(getMemberName()); - - if (getArguments().size() > 0) { - buf.append("<"); - - for (int i=0; i < getArguments().size(); i++) { - if (i > 0) { - buf.append(","); - } - getArguments().get(i).toText(buf, level); - } - buf.append(">"); - } - - buf.append("("); - - for (int i=0; i < getRoleInstantiations().size(); i++) { - if (i > 0) { - buf.append(","); - } - getRoleInstantiations().get(i).toText(buf, level); - } - - buf.append(");\n"); - } -} diff --git a/modules/core/src/main/java/org/scribble/model/global/GRecursion.java b/modules/core/src/main/java/org/scribble/model/global/GRecursion.java deleted file mode 100644 index 8530f7417..000000000 --- a/modules/core/src/main/java/org/scribble/model/global/GRecursion.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright 2009-10 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model.global; - -import org.scribble.model.Role; -import org.scribble.model.RoleDecl; - -/** - * This class represents the Recur construct. - * - */ -public class GRecursion extends GSinglePathActivity { - - private String _label=null; - private GBlock _block=new GBlock(); - - /** - * This is the default constructor. - * - */ - public GRecursion() { - _block.setParent(this); - } - - /** - * {@inheritDoc} - */ - public boolean isRoleInvolved(RoleDecl role) { - return (_block.isRoleInvolved(role)); - } - - /** - * {@inheritDoc} - */ - public void identifyInvolvedRoles(java.util.Set roles) { - _block.identifyInvolvedRoles(roles); - } - - /** - * This method returns the label associated with the labelled block construct. - * - * @return The label - */ - public String getLabel() { - return (_label); - } - - /** - * This method sets the label associated with the labelled block construct. - * - * @param label The label - */ - public void setLabel(String label) { - _label = label; - } - - /** - * This method returns the activities. - * - * @return The block of activities - */ - public GBlock getBlock() { - return (_block); - } - - /** - * This method sets the block. - * - * @param block The block - */ - public void setBlock(GBlock block) { - if (_block != null) { - _block.setParent(null); - } - - _block = block; - - if (_block != null) { - _block.setParent(this); - } - } - - /** - * This method visits the model object using the supplied - * visitor. - * - * @param visitor The visitor - */ - public void visit(GVisitor visitor) { - if (visitor.start(this)) { - - if (getBlock() != null) { - getBlock().visit(visitor); - } - } - - visitor.end(this); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - - GRecursion that = (GRecursion) o; - - return !(_label != null - ? !_label.equals(that._label) - : that._label != null) - && !(_block != null - ? !_block.equals(that._block) - : that._block != null); - } - - @Override - public int hashCode() { - int result = _label != null ? _label.hashCode() : 0; - return 31 * result + (_block != null ? _block.hashCode() : 0); - } - - @Override - public String toString() { - return "rec "+_label+" "+_block; - } - - /** - * {@inheritDoc} - */ - public void toText(StringBuffer buf, int level) { - - indent(buf, level); - - buf.append("rec "); - - buf.append(_label); - - buf.append(" "); - - if (_block != null) { - _block.toText(buf, level); - } - - buf.append("\n"); - } -} diff --git a/modules/core/src/main/java/org/scribble/model/global/GSinglePathActivity.java b/modules/core/src/main/java/org/scribble/model/global/GSinglePathActivity.java deleted file mode 100644 index f47a54e6e..000000000 --- a/modules/core/src/main/java/org/scribble/model/global/GSinglePathActivity.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model.global; - -/** - * This class represents the base class for all single-path activities. - */ -public abstract class GSinglePathActivity extends GActivity { - - /** - * The default constructor. - */ - public GSinglePathActivity() { - } - - /** - * The copy constructor. - * - * @param act The activity - */ - public GSinglePathActivity(GSinglePathActivity act) { - super(act); - } - - /** - * This method returns the single path. - * - * @return The single path - */ - public abstract GBlock getBlock(); - -} diff --git a/modules/core/src/main/java/org/scribble/model/global/GVisitor.java b/modules/core/src/main/java/org/scribble/model/global/GVisitor.java deleted file mode 100644 index 1184b9181..000000000 --- a/modules/core/src/main/java/org/scribble/model/global/GVisitor.java +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model.global; - -import org.scribble.model.Visitor; -import org.scribble.model.global.GChoice; - -/** - * This interface represents a visitor which can be used - * to traverse a model. - */ -public interface GVisitor extends Visitor { - - /** - * This method indicates the start of a - * block. - * - * @param elem The block - * @return Whether to process the contents - */ - public boolean start(GBlock elem); - - /** - * This method indicates the end of a - * block. - * - * @param elem The block - */ - public void end(GBlock elem); - - /** - * This method indicates the start of a - * choice. - * - * @param elem The choice - * @return Whether to process the contents - */ - public boolean start(GChoice elem); - - /** - * This method indicates the end of a - * choice. - * - * @param elem The choice - */ - public void end(GChoice elem); - - /** - * This method indicates the start of a - * parallel. - * - * @param elem The parallel - * @return Whether to process the contents - */ - public boolean start(GParallel elem); - - /** - * This method indicates the end of a - * parallel. - * - * @param elem The parallel - */ - public void end(GParallel elem); - - /** - * This method indicates the start of a - * protocol. - * - * @param elem The protocol - * @return Whether to process the contents - */ - public boolean start(GProtocolDefinition elem); - - /** - * This method indicates the end of a - * protocol. - * - * @param elem The protocol - */ - public void end(GProtocolDefinition elem); - - /** - * This method indicates the start of a - * labelled block. - * - * @param elem The labelled block - * @return Whether to process the contents - */ - public boolean start(GRecursion elem); - - /** - * This method indicates the end of a - * labelled block. - * - * @param elem The labelled block - */ - public void end(GRecursion elem); - - /** - * This method indicates the start of an - * interruptible block. - * - * @param elem The interruptible - * @return Whether to process the contents - */ - public boolean start(GInterruptible elem); - - /** - * This method indicates the end of an - * interruptible block. - * - * @param elem The interruptible - */ - public void end(GInterruptible elem); - - /** - * This method visits a protocol instance. - * - * @param elem The protocol instances - */ - public void accept(GProtocolInstance elem); - - /** - * This method visits an interaction component. - * - * @param elem The interaction - */ - public void accept(GMessageTransfer elem); - - /** - * This method visits a recursion component. - * - * @param elem The recursion - */ - public void accept(GContinue elem); - - /** - * This method visits a do component. - * - * @param elem The do - */ - public void accept(GDo elem); - - /** - * This method visits a custom activity. - * - * @param elem The custom activity - */ - public void accept(GCustomActivity elem); - -} diff --git a/modules/core/src/main/java/org/scribble/model/local/LActivity.java b/modules/core/src/main/java/org/scribble/model/local/LActivity.java deleted file mode 100644 index 0cb1a2ac3..000000000 --- a/modules/core/src/main/java/org/scribble/model/local/LActivity.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model.local; - -import org.scribble.model.ModelObject; -import org.scribble.model.Visitor; - -/** - * This class represents the base class for all Scribble definition - * context. - */ -public abstract class LActivity extends ModelObject { - - /** - * The default constructor. - */ - public LActivity() { - } - - /** - * The copy constructor. - * - * @param act The activity - */ - public LActivity(LActivity act) { - super(act); - } - - /** - * {@inheritDoc} - */ - public void visit(Visitor visitor) { - if (visitor instanceof LVisitor) { - visit((LVisitor)visitor); - } - } - - /** - * This method visits the model object using the supplied - * visitor. - * - * @param visitor The visitor - */ - public abstract void visit(LVisitor visitor); - -} diff --git a/modules/core/src/main/java/org/scribble/model/local/LBlock.java b/modules/core/src/main/java/org/scribble/model/local/LBlock.java deleted file mode 100644 index 13dcc9ebf..000000000 --- a/modules/core/src/main/java/org/scribble/model/local/LBlock.java +++ /dev/null @@ -1,151 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model.local; - -import org.scribble.model.ContainmentList; - -/** - * This class represents a group of activities. - * - */ -public class LBlock extends LActivity { - - private java.util.List _contents= - new ContainmentList(this, LActivity.class); - - /** - * This method returns the contents associated with - * the block. - * - * @return The contents - */ - public java.util.List getContents() { - return (_contents); - } - - /** - * This method adds an activity to the block. - * - * @param act The activity - * @return Whether the activity has been added - */ - public boolean add(LActivity act) { - return (_contents.add(act)); - } - - /** - * This method removes an activity from the block. - * - * @param act The activity - * @return Whether the activity has been removed - */ - public boolean remove(LActivity act) { - return (_contents.remove(act)); - } - - /** - * This method returns the number of activities - * in the block. - * - * @return The number of activities - */ - public int size() { - return (_contents.size()); - } - - /** - * This method returns the activity at the specified - * index. - * - * @param index The index The index - * @return The activity The activity - * @throws IndexOutOfBoundsException Out of bounds - */ - public LActivity get(int index) throws IndexOutOfBoundsException { - return (_contents.get(index)); - } - - /** - * This method returns the index of the supplied activity. - * - * @param act The activity - * @return The index, or -1 if the activity is not found - */ - public int indexOf(LActivity act) { - return (_contents.indexOf(act)); - } - - /** - * This method visits the model object using the supplied - * visitor. - * - * @param visitor The visitor - */ - public void visit(LVisitor visitor) { - - if (visitor.start(this)) { - - for (int i=0; i < getContents().size(); i++) { - getContents().get(i).visit(visitor); - } - } - - visitor.end(this); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - - LBlock that = (LBlock) o; - - return _contents.equals(that._contents); - } - - @Override - public int hashCode() { - return _contents.hashCode(); - } - - @Override - public String toString() { - String result = "{\n"; - for (LActivity act : _contents) { - result += act + "\n"; - } - return result + "}"; - } - - /** - * {@inheritDoc} - */ - public void toText(StringBuffer buf, int level) { - - buf.append("{\n"); - - for (LActivity act : _contents) { - act.toText(buf, level+1); - } - - indent(buf, level); - buf.append("}"); - } -} diff --git a/modules/core/src/main/java/org/scribble/model/local/LChoice.java b/modules/core/src/main/java/org/scribble/model/local/LChoice.java deleted file mode 100644 index f210bc963..000000000 --- a/modules/core/src/main/java/org/scribble/model/local/LChoice.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model.local; - -import org.scribble.model.ContainmentList; -import org.scribble.model.Role; - -/** - * This class represents the Choice construct between - * two or more paths. - * - */ -public class LChoice extends LActivity { - - private Role _role=null; - private java.util.List _blocks=new ContainmentList(this, LBlock.class); - - /** - * This is the default constructor. - * - */ - public LChoice() { - } - - /** - * This method returns the role. - * - * @return The role - */ - public Role getRole() { - return (_role); - } - - /** - * This method sets the role. - * - * @param role The role - */ - public void setRole(Role role) { - _role = role; - } - - /** - * This method returns the list of mutually exclusive - * activity blocks that comprise the multi-path construct. - * - * @return The list of choice paths - */ - public java.util.List getPaths() { - return (_blocks); - } - - /** - * This method visits the model object using the supplied - * visitor. - * - * @param visitor The visitor - */ - public void visit(LVisitor visitor) { - - if (visitor.start(this)) { - - for (LBlock b : getPaths()) { - b.visit(visitor); - } - } - - visitor.end(this); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - - LChoice that = (LChoice) o; - - return !(_role != null - ? !_role.equals(that._role) - : that._role != null) - && _blocks.equals(that._blocks); - } - - @Override - public int hashCode() { - int result = _blocks.hashCode(); - result = 31 * result + (_role != null ? _role.hashCode() : 0); - return result; - } - - @Override - public String toString() { - String result = "choice "; - if (_role != null) { - result += "at " + _role+" "; - } - for (LBlock b : _blocks) { - if (_blocks.indexOf(b) > 0) { - result += "or "; - } - result += b + "\n"; - } - return result; - } - - /** - * {@inheritDoc} - */ - public void toText(StringBuffer buf, int level) { - - indent(buf, level); - - buf.append("choice at "); - - if (_role != null) { - buf.append(_role); - buf.append(" "); - } - - for (int i=0; i < getPaths().size(); i++) { - if (i > 0) { - buf.append(" or "); - } - getPaths().get(i).toText(buf, level); - } - - buf.append("\n"); - } -} diff --git a/modules/core/src/main/java/org/scribble/model/local/LContinue.java b/modules/core/src/main/java/org/scribble/model/local/LContinue.java deleted file mode 100644 index 02205de06..000000000 --- a/modules/core/src/main/java/org/scribble/model/local/LContinue.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model.local; - -/** - * This class represents the Raise construct. - * - */ -public class LContinue extends LActivity { - - private String _label=null; - - /** - * This is the default constructor. - * - */ - public LContinue() { - } - - /** - * This is the copy constructor. - * - * @param copy The recursion to copy - */ - public LContinue(LContinue copy) { - super(copy); - _label = copy.getLabel(); - } - - /** - * This method returns the label associated with the recursion construct. - * - * @return The label - */ - public String getLabel() { - return (_label); - } - - /** - * This method sets the label associated with the recursion construct. - * - * @param label The label - */ - public void setLabel(String label) { - _label = label; - } - - /** - * This method visits the model object using the supplied - * visitor. - * - * @param visitor The visitor - */ - public void visit(LVisitor visitor) { - visitor.accept(this); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - - LContinue that = (LContinue) o; - - return !(_label != null - ? !_label.equals(that._label) - : that._label != null); - } - - @Override - public int hashCode() { - return _label != null ? _label.hashCode() : 0; - } - - @Override - public String toString() { - return "continue " + _label; - } - - /** - * {@inheritDoc} - */ - public void toText(StringBuffer buf, int level) { - - indent(buf, level); - - buf.append("continue "); - - if (_label != null) { - buf.append(_label); - } - - buf.append(";\n"); - } -} diff --git a/modules/core/src/main/java/org/scribble/model/local/LCustomActivity.java b/modules/core/src/main/java/org/scribble/model/local/LCustomActivity.java deleted file mode 100644 index 638ced645..000000000 --- a/modules/core/src/main/java/org/scribble/model/local/LCustomActivity.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright 2009-10 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model.local; - -/** - * This class represents a custom activity. - * - */ -public class LCustomActivity extends LActivity { - - private java.util.List _roles=new java.util.Vector(); - - /** - * This is the default constructor. - * - */ - public LCustomActivity() { - } - - /** - * This is the copy constructor. - * - * @param act The custom activity to copy - */ - public LCustomActivity(LCustomActivity act) { - super(act); - } - - /** - * This method returns the roles associated with the custom activity. - * - * @return The roles - */ - public java.util.List getRoles() { - return(_roles); - } - - /** - * This method visits the model object using the supplied - * visitor. - * - * @param visitor The visitor - */ - public void visit(LVisitor visitor) { - visitor.accept(this); - } - - /** - * {@inheritDoc} - */ - public void toText(StringBuffer buf, int level) { - - indent(buf, level); - - buf.append("custom at "); - - for (int i=0; i < _roles.size(); i++) { - if (i > 0) { - buf.append(","); - } - buf.append(_roles.get(i)); - } - - buf.append(";\n"); - } -} diff --git a/modules/core/src/main/java/org/scribble/model/local/LDo.java b/modules/core/src/main/java/org/scribble/model/local/LDo.java deleted file mode 100644 index 9069cf677..000000000 --- a/modules/core/src/main/java/org/scribble/model/local/LDo.java +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model.local; - -import org.scribble.model.Argument; -import org.scribble.model.ContainmentList; -import org.scribble.model.RoleInstantiation; - -/** - * This class represents the Run construct. - * - */ -public class LDo extends LActivity { - private String _protocol=null; - private String _scope=null; - private java.util.List _arguments=new ContainmentList(this, Argument.class); - private java.util.List _roleInstantiations=new ContainmentList(this, - RoleInstantiation.class); - - /** - * This is the default constructor. - * - */ - public LDo() { - } - - /** - * This is the copy constructor. - * - * @param copy The copy - */ - public LDo(LDo copy) { - super(copy); - _protocol = copy.getProtocol(); - - for (Argument arg : copy.getArguments()) { - _arguments.add(new Argument(arg)); - } - - for (RoleInstantiation ri : copy.getRoleInstantiations()) { - _roleInstantiations.add(new RoleInstantiation(ri)); - } - } - - /** - * This method returns the protocol. - * - * @return The protocol - */ - public String getProtocol() { - return (_protocol); - } - - /** - * This method sets the protocol. - * - * @param protocol The protocol - */ - public void setProtocol(String protocol) { - _protocol = protocol; - } - - /** - * This method returns the optional scope name. - * - * @return The scope name - */ - public String getScope() { - return (_scope); - } - - /** - * This method sets the optional scope name. - * - * @param scope The scope name - */ - public void setScope(String scope) { - _scope = scope; - } - - /** - * This method returns the argument list. - * - * @return The list of arguments - */ - public java.util.List getArguments() { - return (_arguments); - } - - /** - * This method returns the argument list. - * - * @return The list of arguments - */ - public java.util.List getRoleInstantiations() { - return (_roleInstantiations); - } - - /** - * This method visits the model object using the supplied - * visitor. - * - * @param visitor The visitor - */ - public void visit(LVisitor visitor) { - visitor.accept(this); - } - - /** - * {@inheritDoc} - */ - public void toText(StringBuffer buf, int level) { - - indent(buf, level); - - buf.append("do "); - - if (_scope != null) { - buf.append(_scope); - buf.append(": "); - } - - if (_protocol != null) { - buf.append(_protocol); - } - - if (_arguments.size() > 0) { - buf.append('<'); - for (int i=0; i < _arguments.size(); i++) { - if (i > 0) { - buf.append(","); - } - buf.append(_arguments.get(i)); - } - buf.append(">"); - } - - buf.append("("); - for (int i=0; i < _roleInstantiations.size(); i++) { - if (i > 0) { - buf.append(","); - } - _roleInstantiations.get(i).toText(buf, level); - } - - buf.append(");\n"); - } -} diff --git a/modules/core/src/main/java/org/scribble/model/local/LInterruptible.java b/modules/core/src/main/java/org/scribble/model/local/LInterruptible.java deleted file mode 100644 index 886ab4f4b..000000000 --- a/modules/core/src/main/java/org/scribble/model/local/LInterruptible.java +++ /dev/null @@ -1,374 +0,0 @@ -/* - * Copyright 2009-10 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model.local; - -import org.scribble.model.ContainmentList; -import org.scribble.model.Message; -import org.scribble.model.ModelObject; -import org.scribble.model.Role; -import org.scribble.model.Visitor; - -/** - * This class represents the interruptible construct. - * - */ -public class LInterruptible extends LActivity { - - private String _scope=null; - private LBlock _block=new LBlock(); - private Throw _throws=null; - private java.util.List _catches=new ContainmentList(this, Catch.class); - - /** - * This is the default constructor. - * - */ - public LInterruptible() { - _block.setParent(this); - } - - /** - * This method returns the scope name. - * - * @return The scope name - */ - public String getScope() { - return (_scope); - } - - /** - * This method sets the scope name. - * - * @param scope The scope name - */ - public void setScope(String scope) { - _scope = scope; - } - - /** - * This method returns the activities. - * - * @return The block of activities - */ - public LBlock getBlock() { - return (_block); - } - - /** - * This method sets the block. - * - * @param block The block - */ - public void setBlock(LBlock block) { - if (_block != null) { - _block.setParent(null); - } - - _block = block; - - if (_block != null) { - _block.setParent(this); - } - } - - /** - * This method sets the catches. - * - * @param catches The catches - */ - public void setCatches(java.util.List catches) { - _catches = catches; - } - - /** - * This method gets the catches. - * - * @return The catches - */ - public java.util.List getCatches() { - return (_catches); - } - - /** - * This method sets the throws clause. - * - * @param t The throw - */ - public void setThrows(Throw t) { - if (_throws != null) { - _throws.setParent(null); - } - - _throws = t; - - if (_throws != null) { - _throws.setParent(this); - } - } - - /** - * This method gets the throws clause. - * - * @return The throw - */ - public Throw getThrows() { - return (_throws); - } - - /** - * This method visits the model object using the supplied - * visitor. - * - * @param visitor The visitor - */ - public void visit(LVisitor visitor) { - if (visitor.start(this)) { - - if (getBlock() != null) { - getBlock().visit(visitor); - } - } - - visitor.end(this); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - - LInterruptible that = (LInterruptible) o; - - return !(_scope != null - ? !_scope.equals(that._scope) - : that._scope != null) - && !(_block != null - ? !_block.equals(that._block) - : that._block != null); - } - - @Override - public int hashCode() { - int result = _scope != null ? _scope.hashCode() : 0; - return 31 * result + (_block != null ? _block.hashCode() : 0); - } - - @Override - public String toString() { - return "interruptible "+_scope+" "+_block; - } - - /** - * {@inheritDoc} - */ - public void toText(StringBuffer buf, int level) { - - indent(buf, level); - - buf.append("interruptible "); - - if (_scope != null) { - buf.append(_scope); - buf.append(": "); - } - - if (_block != null) { - _block.toText(buf, level); - } - - buf.append(" with {\n"); - - if (getThrows() != null) { - getThrows().toText(buf, level+1); - } - - for (Catch i : getCatches()) { - i.toText(buf, level+1); - } - - indent(buf, level); - - buf.append("}\n"); - } - - /** - * This class represents the throw definition. - * - */ - public static class Throw extends ModelObject { - - private java.util.List _toRoles=new ContainmentList(this, Role.class); - private java.util.List _messages=new ContainmentList(this, Message.class); - - public Throw() { - } - - /** - * This method returns the 'to' roles. - * - * @return The 'to' roles - */ - public java.util.List getToRoles() { - return (_toRoles); - } - - /** - * This method sets the 'to' roles. - * - * @param part The 'to' roles - */ - public void setToRoles(java.util.List part) { - _toRoles = part; - } - - /** - * This method sets the interrupt messages. - * - * @param mesgs The messages - */ - public void setMessages(java.util.List mesgs) { - _messages = mesgs; - } - - /** - * This method gets the interrupt messages. - * - * @return The messages - */ - public java.util.List getMessages() { - return (_messages); - } - - public void toText(StringBuffer buf, int level) { - - LInterruptible.indent(buf, level); - - buf.append("throws "); - - for (int i=0; i < _messages.size(); i++) { - if (i > 0) { - buf.append(","); - } - _messages.get(i).toText(buf, level); - } - - buf.append(" to "); - - for (int i=0; i < _toRoles.size(); i++) { - if (i > 0) { - buf.append(","); - } - Role r=_toRoles.get(i); - r.toText(buf, level); - } - - buf.append(";\n"); - } - - @Override - public void visit(Visitor visitor) { - // TODO Auto-generated method stub - - } - } - - /** - * This class represents the catch definition. - * - */ - public static class Catch extends ModelObject { - - private Role _role=null; - private java.util.List _messages=new ContainmentList(this, Message.class); - - public Catch() { - } - - /** - * This method sets the 'from' role. - * - * @param role The 'from' role - */ - public void setRole(Role role) { - if (_role != null) { - _role.setParent(null); - } - - _role = role; - - if (_role != null) { - _role.setParent(this); - } - } - - /** - * This method gets the 'from' role. - * - * @return The 'from' role - */ - public Role getRole() { - return (_role); - } - - /** - * This method sets the interrupt messages. - * - * @param mesgs The messages - */ - public void setMessages(java.util.List mesgs) { - _messages = mesgs; - } - - /** - * This method gets the interrupt messages. - * - * @return The messages - */ - public java.util.List getMessages() { - return (_messages); - } - - public void toText(StringBuffer buf, int level) { - - LInterruptible.indent(buf, level); - - buf.append("catches "); - - for (int i=0; i < _messages.size(); i++) { - if (i > 0) { - buf.append(","); - } - _messages.get(i).toText(buf, level); - } - - buf.append(" from "); - - _role.toText(buf, level); - - buf.append(";\n"); - } - - @Override - public void visit(Visitor visitor) { - // TODO Auto-generated method stub - - } - } -} diff --git a/modules/core/src/main/java/org/scribble/model/local/LParallel.java b/modules/core/src/main/java/org/scribble/model/local/LParallel.java deleted file mode 100644 index 57d8402a7..000000000 --- a/modules/core/src/main/java/org/scribble/model/local/LParallel.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model.local; - -import org.scribble.model.ContainmentList; - -/** - * This class represents the Parallel construct with - * two or more concurrent paths. - * - */ -public class LParallel extends LActivity { - - private java.util.List _blocks=new ContainmentList(this, LBlock.class); - - /** - * This is the default constructor. - * - */ - public LParallel() { - } - - /** - * This method returns the list of concurrent - * activity blocks that comprise the multi-path construct. - * - * @return The list of concurrent paths - */ - public java.util.List getPaths() { - return (_blocks); - } - - /** - * This method visits the model object using the supplied - * visitor. - * - * @param visitor The visitor - */ - public void visit(LVisitor visitor) { - if (visitor.start(this)) { - - for (LBlock b : getPaths()) { - b.visit(visitor); - } - } - - visitor.end(this); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - - LParallel that = (LParallel) o; - - return _blocks.equals(that._blocks); - } - - @Override - public int hashCode() { - int result = _blocks.hashCode(); - return result; - } - - @Override - public String toString() { - String result = "parallel "; - for (LBlock b : _blocks) { - if (_blocks.indexOf(b) > 0) { - result += "and "; - } - result += b + "\n"; - } - return result; - } - - /** - * {@inheritDoc} - */ - public void toText(StringBuffer buf, int level) { - - indent(buf, level); - - buf.append("par "); - - for (int i=0; i < getPaths().size(); i++) { - if (i > 0) { - buf.append(" and "); - } - getPaths().get(i).toText(buf, level); - } - - buf.append("\n"); - } -} diff --git a/modules/core/src/main/java/org/scribble/model/local/LProtocolDecl.java b/modules/core/src/main/java/org/scribble/model/local/LProtocolDecl.java deleted file mode 100644 index 602310b9f..000000000 --- a/modules/core/src/main/java/org/scribble/model/local/LProtocolDecl.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model.local; - -import org.scribble.model.ProtocolDecl; -import org.scribble.model.Role; - -/** - * This class represents the local protocol declaration. - */ -public abstract class LProtocolDecl extends ProtocolDecl { - - private Role _localRole=null; - - /** - * The default constructor. - */ - public LProtocolDecl() { - } - - /** - * This method returns the local role. This - * field is set when the protocol represents a local - * model. - * - * @return The local role - */ - public Role getLocalRole() { - return (_localRole); - } - - /** - * This method sets the local role. This - * field is set when the protocol represents a local - * model. - * - * @param role The local role - */ - public void setLocalRole(Role role) { - _localRole = role; - } - -} diff --git a/modules/core/src/main/java/org/scribble/model/local/LProtocolDefinition.java b/modules/core/src/main/java/org/scribble/model/local/LProtocolDefinition.java deleted file mode 100644 index 5dc6e2123..000000000 --- a/modules/core/src/main/java/org/scribble/model/local/LProtocolDefinition.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model.local; - -import org.scribble.model.RoleDecl; -import org.scribble.model.Visitor; - -/** - * This class represents the protocol notation. - */ -public class LProtocolDefinition extends LProtocolDecl { - - private LBlock _block=null; - - /** - * The default constructor. - */ - public LProtocolDefinition() { - } - - /** - * This method returns the block of activities associated - * with the definition. - * - * @return The block of activities - */ - public LBlock getBlock() { - - if (_block == null) { - _block = new LBlock(); - _block.setParent(this); - } - - return (_block); - } - - /** - * This method sets the block of activities associated - * with the definition. - * - * @param block The block of activities - */ - public void setBlock(LBlock block) { - if (_block != null) { - _block.setParent(null); - } - - _block = block; - - if (_block != null) { - _block.setParent(this); - } - } - - /** - * This method visits the model object using the supplied - * visitor. - * - * @param visitor The visitor - */ - public void visit(Visitor visitor) { - - if (visitor instanceof LVisitor) { - if (((LVisitor)visitor).start(this)) { - - if (getBlock() != null) { - getBlock().visit(visitor); - } - } - - ((LVisitor)visitor).end(this); - } - } - - public String toString() { - String ret="local protocol "+getName()+" ( "; - - for (RoleDecl role : getRoleDeclarations()) { - ret += "role " + role.getName() + " "; - } - - ret += ")\n"; - - ret += getBlock(); - - return(ret); - } - - /** - * {@inheritDoc} - */ - public void toText(StringBuffer buf, int level) { - - indent(buf, level); - - buf.append("local protocol "); - - buf.append(getName()); - - buf.append(" at "); - - if (getLocalRole() != null) { - getLocalRole().toText(buf, level); - } - - if (getParameterDeclarations().size() > 0) { - buf.append("<"); - - for (int i=0; i < getParameterDeclarations().size(); i++) { - if (i > 0) { - buf.append(","); - } - getParameterDeclarations().get(i).toText(buf, level); - } - buf.append(">"); - } - - buf.append("("); - - for (int i=0; i < getRoleDeclarations().size(); i++) { - if (i > 0) { - buf.append(","); - } - buf.append("role "); - getRoleDeclarations().get(i).toText(buf, level); - } - buf.append(") "); - - - if (_block != null) { - _block.toText(buf, level); - } - - buf.append("\n"); - } -} diff --git a/modules/core/src/main/java/org/scribble/model/local/LProtocolInstance.java b/modules/core/src/main/java/org/scribble/model/local/LProtocolInstance.java deleted file mode 100644 index 7c863a946..000000000 --- a/modules/core/src/main/java/org/scribble/model/local/LProtocolInstance.java +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model.local; - -import org.scribble.model.Argument; -import org.scribble.model.ContainmentList; -import org.scribble.model.ParameterDecl; -import org.scribble.model.RoleDecl; -import org.scribble.model.RoleInstantiation; -import org.scribble.model.Visitor; - -/** - * This class represents the protocol notation. - */ -public class LProtocolInstance extends LProtocolDecl { - - private String _memberName=null; - private java.util.List _arguments=new ContainmentList(this, Argument.class); - private java.util.List _roleInstantiations=new ContainmentList(this, - RoleInstantiation.class); - - /** - * The default constructor. - */ - public LProtocolInstance() { - } - - /** - * This method returns the member name. - * - * @return The name - */ - public String getMemberName() { - return (_memberName); - } - - /** - * This method sets the member name. - * - * @param name The name - */ - public void setMemberName(String name) { - _memberName = name; - } - - /** - * This method returns the role declarations associated with - * the protocol. - * - * @return The role declarations - */ - public java.util.List getRoleInstantiations() { - return (_roleInstantiations); - } - - /** - * This method returns the parameter declarations associated with - * the protocol. - * - * @return The parameter declarations - */ - public java.util.List getArguments() { - return (_arguments); - } - - /** - * This method visits the model object using the supplied - * visitor. - * - * @param visitor The visitor - */ - public void visit(Visitor visitor) { - if (visitor instanceof LVisitor) { - ((LVisitor)visitor).accept(this); - } - } - - public String toString() { - String ret="local protocol "+getName(); - - if (getParameterDeclarations().size() > 0) { - ret += " <"; - - for (int i=0; i < getParameterDeclarations().size(); i++) { - ParameterDecl pd=getParameterDeclarations().get(i); - - if (i > 0) { - ret += ","; - } - - ret += (pd.getType().name().toLowerCase()+" "+pd.getName()); - if (pd.getAlias() != null) { - ret += " as "+pd.getAlias(); - } - } - - ret += ">"; - } - - ret += " ( "; - - for (int i=0; i < getRoleDeclarations().size(); i++) { - RoleDecl role=getRoleDeclarations().get(i); - - if (i > 0) { - ret += ","; - } - - ret += ("role "+role.getName()+" "); - if (role.getAlias() != null) { - ret += " as "+role.getAlias(); - } - } - - ret += ") instantiates "; - - ret += _memberName; - - return(ret); - } - - /** - * {@inheritDoc} - */ - public void toText(StringBuffer buf, int level) { - - indent(buf, level); - - buf.append("local protocol "); - - buf.append(getName()); - - buf.append(" at "); - - if (getLocalRole() != null) { - getLocalRole().toText(buf, level); - } - - if (getParameterDeclarations().size() > 0) { - buf.append("<"); - - for (int i=0; i < getParameterDeclarations().size(); i++) { - if (i > 0) { - buf.append(","); - } - getParameterDeclarations().get(i).toText(buf, level); - } - buf.append(">"); - } - - buf.append("("); - - for (int i=0; i < getRoleDeclarations().size(); i++) { - if (i > 0) { - buf.append(","); - } - buf.append("role "); - getRoleDeclarations().get(i).toText(buf, level); - } - buf.append(") instantiates "); - - buf.append(getMemberName()); - - if (getArguments().size() > 0) { - buf.append("<"); - - for (int i=0; i < getArguments().size(); i++) { - if (i > 0) { - buf.append(","); - } - getArguments().get(i).toText(buf, level); - } - buf.append(">"); - } - - buf.append("("); - - for (int i=0; i < getRoleInstantiations().size(); i++) { - if (i > 0) { - buf.append(","); - } - getRoleInstantiations().get(i).toText(buf, level); - } - - buf.append(");\n"); - } -} diff --git a/modules/core/src/main/java/org/scribble/model/local/LReceive.java b/modules/core/src/main/java/org/scribble/model/local/LReceive.java deleted file mode 100644 index 41789f425..000000000 --- a/modules/core/src/main/java/org/scribble/model/local/LReceive.java +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model.local; - -import org.scribble.model.Message; -import org.scribble.model.Role; - -/** - * This class represents an interaction: the communication - * of a message from one role to another, or several others. - * - */ -public class LReceive extends LActivity { - - private Message _message=null; - private Role _fromRole=null; - - /** - * The default constructor. - */ - public LReceive() { - } - - /** - * The copy constructor. - * - * @param i The interaction to copy - */ - public LReceive(LReceive i) { - super(i); - - if (i._message != null) { - _message = new Message(i._message); - } - _fromRole = i._fromRole; - } - - /** - * This constructor initializes the 'from' role and message - * signature. - * - * @param sig The message signature - * @param fromRole The 'from' role - */ - public LReceive(Message sig, Role fromRole) { - _message = sig; - _fromRole = fromRole; - } - - /** - * This method returns the message. - * - * @return The message - */ - public Message getMessage() { - return (_message); - } - - /** - * This method sets the message. - * - * @param message The message - */ - public void setMessage(Message message) { - - if (_message != null) { - _message.setParent(null); - } - - _message = message; - - if (_message != null) { - _message.setParent(this); - } - } - - /** - * This method returns the optional 'from' role. - * - * @return The optional 'from' role - */ - public Role getFromRole() { - return (_fromRole); - } - - /** - * This method sets the optional 'from' role. - * - * @param part The optional 'from' role - */ - public void setFromRole(Role part) { - _fromRole = part; - } - - @Override - public String toString() { - StringBuffer ret=new StringBuffer(); - - if (getMessage() != null) { - ret.append(getMessage()); - } - - ret.append(" from "); - ret.append(getFromRole()); - - return (ret.toString()); - } - - /** - * This method visits the model object using the supplied - * visitor. - * - * @param visitor The visitor - */ - public void visit(LVisitor visitor) { - visitor.accept(this); - - if (getMessage() != null) { - getMessage().visit(visitor); - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - - LReceive that = (LReceive) o; - - return !(_fromRole != null - ? !_fromRole.equals(that._fromRole) - : that._fromRole != null) - && !(_message != null - ? !_message.equals(that._message) - : that._message != null); - } - - @Override - public int hashCode() { - int result = _message != null ? _message.hashCode() : 0; - result = 31 * result + (_fromRole != null ? _fromRole.hashCode() : 0); - return result; - } - - /** - * {@inheritDoc} - */ - public void toText(StringBuffer buf, int level) { - - indent(buf, level); - - _message.toText(buf, level); - - if (_fromRole != null) { - buf.append(" from "); - _fromRole.toText(buf, level); - } - - buf.append(";\n"); - } -} diff --git a/modules/core/src/main/java/org/scribble/model/local/LRecursion.java b/modules/core/src/main/java/org/scribble/model/local/LRecursion.java deleted file mode 100644 index e66c324a5..000000000 --- a/modules/core/src/main/java/org/scribble/model/local/LRecursion.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright 2009-10 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model.local; - -/** - * This class represents the Recur construct. - * - */ -public class LRecursion extends LActivity { - - private String _label=null; - private LBlock _block=new LBlock(); - - /** - * This is the default constructor. - * - */ - public LRecursion() { - _block.setParent(this); - } - - /** - * This method returns the label associated with the labelled block construct. - * - * @return The label - */ - public String getLabel() { - return (_label); - } - - /** - * This method sets the label associated with the labelled block construct. - * - * @param label The label - */ - public void setLabel(String label) { - _label = label; - } - - /** - * This method returns the activities. - * - * @return The block of activities - */ - public LBlock getBlock() { - return (_block); - } - - /** - * This method sets the block. - * - * @param block The block - */ - public void setBlock(LBlock block) { - if (_block != null) { - _block.setParent(null); - } - - _block = block; - - if (_block != null) { - _block.setParent(this); - } - } - - /** - * This method visits the model object using the supplied - * visitor. - * - * @param visitor The visitor - */ - public void visit(LVisitor visitor) { - if (visitor.start(this)) { - - if (getBlock() != null) { - getBlock().visit(visitor); - } - } - - visitor.end(this); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - - LRecursion that = (LRecursion) o; - - return !(_label != null - ? !_label.equals(that._label) - : that._label != null) - && !(_block != null - ? !_block.equals(that._block) - : that._block != null); - } - - @Override - public int hashCode() { - int result = _label != null ? _label.hashCode() : 0; - return 31 * result + (_block != null ? _block.hashCode() : 0); - } - - @Override - public String toString() { - return "rec "+_label+" "+_block; - } - - /** - * {@inheritDoc} - */ - public void toText(StringBuffer buf, int level) { - - indent(buf, level); - - buf.append("rec "); - - buf.append(_label); - - buf.append(" "); - - if (_block != null) { - _block.toText(buf, level); - } - - buf.append("\n"); - } -} diff --git a/modules/core/src/main/java/org/scribble/model/local/LSend.java b/modules/core/src/main/java/org/scribble/model/local/LSend.java deleted file mode 100644 index 3efcca9ad..000000000 --- a/modules/core/src/main/java/org/scribble/model/local/LSend.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model.local; - -import org.scribble.model.Message; -import org.scribble.model.Role; - -/** - * This class represents an interaction: the communication - * of a message from one role to another, or several others. - * - */ -public class LSend extends LActivity { - - private Message _message=null; - private java.util.List _toRoles=new java.util.ArrayList(); - - /** - * The default constructor. - */ - public LSend() { - } - - /** - * The copy constructor. - * - * @param i The interaction to copy - */ - public LSend(LSend i) { - super(i); - - if (i._message != null) { - _message = new Message(i._message); - } - for (Role r : i._toRoles) { - _toRoles.add(new Role(r)); - } - } - - /** - * This constructor initializes the 'to' role and message - * signature. - * - * @param sig The message signature - * @param toRole The 'to' role - */ - public LSend(Message sig, Role toRole) { - _message = sig; - _toRoles.add(toRole); - } - - /** - * This method returns the message. - * - * @return The message - */ - public Message getMessage() { - return (_message); - } - - /** - * This method sets the message. - * - * @param message The message - */ - public void setMessage(Message message) { - - if (_message != null) { - _message.setParent(null); - } - - _message = message; - - if (_message != null) { - _message.setParent(this); - } - } - - /** - * This method returns the 'to' roles. - * - * @return The 'to' roles - */ - public java.util.List getToRoles() { - return (_toRoles); - } - - /** - * This method sets the 'to' roles. - * - * @param part The 'to' roles - */ - public void setToRoles(java.util.List part) { - _toRoles = part; - } - - @Override - public String toString() { - StringBuffer ret=new StringBuffer(); - - if (getMessage() != null) { - ret.append(getMessage()); - } - - ret.append(" to "); - - for (int i=0; i < getToRoles().size(); i++) { - if (i > 0) { - ret.append(","); - } - ret.append(getToRoles().get(i)); - } - - return (ret.toString()); - } - - /** - * This method visits the model object using the supplied - * visitor. - * - * @param visitor The visitor - */ - public void visit(LVisitor visitor) { - visitor.accept(this); - - if (getMessage() != null) { - getMessage().visit(visitor); - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - - LSend that = (LSend) o; - - boolean ret = !(_message != null - ? !_message.equals(that._message) - : that._message != null); - - if (ret) { - if (_toRoles.size() != that.getToRoles().size()) { - return false; - } - for (int i=0; i < _toRoles.size(); i++) { - Role r=_toRoles.get(i); - if (!r.equals(that.getToRoles().get(i))) { - return false; - } - } - } - - return ret; - } - - @Override - public int hashCode() { - int result = _message != null ? _message.hashCode() : 0; - result = 31 * result + (_toRoles.size()>0 ? _toRoles.get(0).hashCode() : 0); - return result; - } - - - /** - * {@inheritDoc} - */ - public void toText(StringBuffer buf, int level) { - - indent(buf, level); - - _message.toText(buf, level); - - if (_toRoles != null) { - buf.append(" to "); - for (int i=0; i < getToRoles().size(); i++) { - if (i > 0) { - buf.append(","); - } - _toRoles.get(i).toText(buf, level); - } - - } - - buf.append(";\n"); - } -} diff --git a/modules/core/src/main/java/org/scribble/model/local/LVisitor.java b/modules/core/src/main/java/org/scribble/model/local/LVisitor.java deleted file mode 100644 index 87a75ed7a..000000000 --- a/modules/core/src/main/java/org/scribble/model/local/LVisitor.java +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model.local; - -import org.scribble.model.Visitor; - -/** - * This interface represents a visitor which can be used - * to traverse a model. - */ -public interface LVisitor extends Visitor { - - /** - * This method indicates the start of a - * block. - * - * @param elem The block - * @return Whether to process the contents - */ - public boolean start(LBlock elem); - - /** - * This method indicates the end of a - * block. - * - * @param elem The block - */ - public void end(LBlock elem); - - /** - * This method indicates the start of a - * choice. - * - * @param elem The choice - * @return Whether to process the contents - */ - public boolean start(LChoice elem); - - /** - * This method indicates the end of a - * choice. - * - * @param elem The choice - */ - public void end(LChoice elem); - - /** - * This method indicates the start of a - * parallel. - * - * @param elem The parallel - * @return Whether to process the contents - */ - public boolean start(LParallel elem); - - /** - * This method indicates the end of a - * parallel. - * - * @param elem The parallel - */ - public void end(LParallel elem); - - /** - * This method indicates the start of a - * protocol. - * - * @param elem The protocol - * @return Whether to process the contents - */ - public boolean start(LProtocolDefinition elem); - - /** - * This method indicates the end of a - * protocol. - * - * @param elem The protocol - */ - public void end(LProtocolDefinition elem); - - /** - * This method indicates the start of a - * labelled block. - * - * @param elem The labelled block - * @return Whether to process the contents - */ - public boolean start(LRecursion elem); - - /** - * This method indicates the end of a - * labelled block. - * - * @param elem The labelled block - */ - public void end(LRecursion elem); - - /** - * This method indicates the start of an - * interruptible block. - * - * @param elem The interruptible - * @return Whether to process the contents - */ - public boolean start(LInterruptible elem); - - /** - * This method indicates the end of an - * interruptible block. - * - * @param elem The interruptible - */ - public void end(LInterruptible elem); - - /** - * This method visits a protocol instance. - * - * @param elem The protocol instances - */ - public void accept(LProtocolInstance elem); - - /** - * This method visits a send component. - * - * @param elem The send - */ - public void accept(LSend elem); - - /** - * This method visits a receive component. - * - * @param elem The receive - */ - public void accept(LReceive elem); - - /** - * This method visits a recursion component. - * - * @param elem The recursion - */ - public void accept(LContinue elem); - - /** - * This method visits a do component. - * - * @param elem The do - */ - public void accept(LDo elem); - - /** - * This method visits a - * custom activity construct. - * - * @param elem The custom activity - */ - public void accept(LCustomActivity elem); - -} diff --git a/modules/core/src/main/java/org/scribble/resources/AbstractResource.java b/modules/core/src/main/java/org/scribble/resources/AbstractResource.java deleted file mode 100644 index 2bd5bd307..000000000 --- a/modules/core/src/main/java/org/scribble/resources/AbstractResource.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.resources; - -/** - * This class represents the resource. - * - */ -public abstract class AbstractResource implements Resource { - - private String _path=null; - - /** - * The constructor. - * - * @param path The path to the resource - */ - public AbstractResource(String path) { - _path = path; - } - - /** - * {@inheritDoc} - */ - public String getPath() { - return (_path); - } - -} diff --git a/modules/core/src/main/java/org/scribble/resources/DirectoryResourceLocator.java b/modules/core/src/main/java/org/scribble/resources/DirectoryResourceLocator.java deleted file mode 100644 index 7f18ad07a..000000000 --- a/modules/core/src/main/java/org/scribble/resources/DirectoryResourceLocator.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.resources; - -import java.util.logging.Level; -import java.util.logging.Logger; - -/** - * This class provides a directory based resource locator. - * - */ -public class DirectoryResourceLocator implements ResourceLocator { - - private static final Logger LOG=Logger.getLogger(DirectoryResourceLocator.class.getName()); - - private String[] _paths=null; - - /** - * This is the constructor for the directory resource - * locator, initialised with a ':' separated list - * of root directories. - * - * @param paths The ':' separated list of directory paths - */ - public DirectoryResourceLocator(String paths) { - _paths = paths.split(":"); - } - - /** - * This method returns the root location containing the supplied - * resource. - * - * @return The resource's root location - */ - public String getResourceRoot(Resource resource) { - String ret=null; - - for (String path : _paths) { - String fullPath=path+java.io.File.separator+resource.getPath(); - - java.io.File f=new java.io.File(fullPath); - - if (f.exists()) { - ret = path; - break; - } - } - - return (ret); - } - - /** - * {@inheritDoc} - */ - public Resource getResource(String relativePath) { - Resource ret=null; - - // Find module - for (String path : _paths) { - String fullPath=path; - - if (!fullPath.endsWith(java.io.File.separator)) { - fullPath += java.io.File.separator; - } - - fullPath += relativePath; - - java.io.File f=new java.io.File(fullPath); - - if (f.isFile()) { - try { - ret = new InputStreamResource(relativePath, new java.io.FileInputStream(f)); - - break; - } catch (Exception e) { - LOG.log(Level.SEVERE, "Failed to create file input stream for '"+f+"'", e); - } - } - } - - return (ret); - } - -} diff --git a/modules/core/src/main/java/org/scribble/resources/InputStreamResource.java b/modules/core/src/main/java/org/scribble/resources/InputStreamResource.java deleted file mode 100644 index 1a6946a41..000000000 --- a/modules/core/src/main/java/org/scribble/resources/InputStreamResource.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.resources; - -/** - * This class represents the resource. - * - */ -public class InputStreamResource extends AbstractResource { - - private java.io.InputStream _inputStream=null; - - /** - * The constructor. - * - * @param path The optional resource path - * @param is The input stream - */ - public InputStreamResource(String path, java.io.InputStream is) { - super(path); - - _inputStream = is; - } - - /** - * {@inheritDoc} - */ - public java.io.InputStream getInputStream() { - return (_inputStream); - } - -} diff --git a/modules/core/src/main/java/org/scribble/resources/Resource.java b/modules/core/src/main/java/org/scribble/resources/Resource.java deleted file mode 100644 index e95084869..000000000 --- a/modules/core/src/main/java/org/scribble/resources/Resource.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.resources; - -/** - * This class represents the resource. - * - */ -public interface Resource { - - /** - * This method returns the resource path. - * - * @return The resource path - */ - public String getPath(); - - /** - * This method returns an input stream containing the - * resource content. - * - * @return The input stream - */ - public java.io.InputStream getInputStream(); - -} diff --git a/modules/core/src/main/java/org/scribble/resources/ResourceLocator.java b/modules/core/src/main/java/org/scribble/resources/ResourceLocator.java deleted file mode 100644 index 693555bb3..000000000 --- a/modules/core/src/main/java/org/scribble/resources/ResourceLocator.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.resources; - - -/** - * This interface provides the resource location capability. - * - */ -public interface ResourceLocator { - - /** - * This method obtains the resource associated with the - * supplied path. - * - * @param path The resource path - * @return The resource, or null if not found - */ - public Resource getResource(String path); - -} diff --git a/modules/core/src/main/resources/org/scribble/protocol/Messages.properties b/modules/core/src/main/resources/org/scribble/protocol/Messages.properties deleted file mode 100644 index 28c2fcffc..000000000 --- a/modules/core/src/main/resources/org/scribble/protocol/Messages.properties +++ /dev/null @@ -1,35 +0,0 @@ -#/* -# * Copyright 2009-10 Scribble.org -# * -# * Licensed under the Apache License, Version 2.0 (the "License"); -# * you may not use this file except in compliance with the License. -# * You may obtain a copy of the License at -# * -# * http://www.apache.org/licenses/LICENSE-2.0 -# * -# * Unless required by applicable law or agreed to in writing, software -# * distributed under the License is distributed on an "AS IS" BASIS, -# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# * See the License for the specific language governing permissions and -# * limitations under the License. -# * -# */ - -# Export messages -_EXPORT_FAILED=Export failed due to: {0} - -# Validation rule messages -_AMBIGUOUS_CHOICE=Choice is ambiguous, multiple paths have a common interaction(s) ''{0}'' -_CANNOT_USE_RESERVED_WORD= Name ''{0}'' is a reserved word -_EXISTING_DECLARATION=Declaration already exists for name ''{0}'' -_NO_ENCLOSING_RECUR=No enclosing block found with label ''{0}'' -_NO_TYPE_IMPORT=Import statement does not exist for type ''{0}'' -_NOT_FOUND_BOUND_DECLARATION=Bound declaration ''{0}'' not found in definition ''{1}'' -_NOT_FOUND_REFERENCE=Definition ''{0}'' of type ''{1}'' could not be found -_INTERACTION_ROLE=Interaction needs to define a ''{0}'' role -_NAME_ALREADY_DEFINED=Name ''{0}'' has already been declared -_RAISED_TYPE_NOT_CAUGHT=Raised type ''{0}'' is not caught within the enclosing definition -_UNKNOWN_ROLE=Unknown role ''{0}'' -_UNCONNECTED_ROLE=Activity at role ''{0}'' is not connected to preceding activities -_UNPROJECTABLE_ROLES=Role(s) ''{0}'' cannot be projected -_UNRELATED_TO_LOCATED_ROLE=Unrelated to located role ''{0}'' diff --git a/modules/core/src/test/java/org/scribble/model/ModuleTest.java b/modules/core/src/test/java/org/scribble/model/ModuleTest.java deleted file mode 100644 index 343da5c1e..000000000 --- a/modules/core/src/test/java/org/scribble/model/ModuleTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.model; - -import static org.junit.Assert.*; - -import org.junit.Test; - -public class ModuleTest { - - private static final String SINGLE_PART = "Single"; - private static final String MULTIPLE_PART = "Multiple.Parts"; - private static final String MULTIPLE_LAST_PART = "Parts"; - - @Test - public void testLastPartSinglePart() { - Module module=new Module(); - - module.setName(SINGLE_PART); - - if (!module.getLocalName().equals(SINGLE_PART)) { - fail("Didn't return single part"); - } - } - - @Test - public void testLastPartMultipleParts() { - Module module=new Module(); - - module.setName(MULTIPLE_PART); - - if (!module.getLocalName().equals(MULTIPLE_LAST_PART)) { - fail("Didn't return multiple last part"); - } - } - -} diff --git a/modules/monitor/pom.xml b/modules/monitor/pom.xml deleted file mode 100644 index c8dc471f6..000000000 --- a/modules/monitor/pom.xml +++ /dev/null @@ -1,89 +0,0 @@ - - 4.0.0 - scribble-monitor - jar - 0.3.2-SNAPSHOT - Scribble::Modules::Monitor - - - org.scribble - modules - 0.3.2-SNAPSHOT - - - - - org.scribble - scribble-core - ${project.version} - - - org.codehaus.jackson - jackson-core-asl - provided - - - org.codehaus.jackson - jackson-mapper-asl - provided - - - - org.scribble - scribble-parser - ${project.version} - test - - - junit - junit - test - - - - - - - maven-javadoc-plugin - - - generate-javadoc - package - - jar - - - - - org.jboss.apiviz.APIviz - - org.jboss.apiviz - apiviz - 1.2.4.GA - - true - false - - -d ${project.build.directory}/javadoc - -charset UTF-8 - -docencoding UTF-8 - -version - -author - -breakiterator - -windowtitle "${project.name} ${project.version} API Reference" - -doctitle "${project.name} ${project.version} API Reference" - -bottom "Copyright © ${project.inceptionYear}-Present ${project.organization.name}. All Rights Reserved." - -link http://java.sun.com/javase/6/docs/api/ - -sourceclasspath ${project.build.outputDirectory} - - UTF-8 - en_US - - org.scribble.monitor - - - - - - diff --git a/modules/monitor/src/main/java/org/scribble/monitor/export/MonitorExporter.java b/modules/monitor/src/main/java/org/scribble/monitor/export/MonitorExporter.java deleted file mode 100644 index d821f77a9..000000000 --- a/modules/monitor/src/main/java/org/scribble/monitor/export/MonitorExporter.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.export; - -import org.scribble.context.ModuleContext; -import org.scribble.model.local.LProtocolDefinition; -import org.scribble.monitor.export.rules.ExportState; -import org.scribble.monitor.export.rules.NodeExporter; -import org.scribble.monitor.export.rules.NodeExporterFactory; -import org.scribble.monitor.model.SessionType; - -/** - * This class exports a local protocol definition to a monitor model. - * - */ -public class MonitorExporter { - - /** - * This method returns the session type associated with the supplied protocol. - * - * @param context The module context - * @param protocol The local protocol - * @return The session type - */ - public SessionType export(ModuleContext context, LProtocolDefinition protocol) { - SessionType ret=new SessionType(); - - NodeExporter ne=NodeExporterFactory.getNodeExporter(protocol.getBlock()); - - if (ne != null) { - ne.export(context, new ExportState(), protocol.getBlock(), ret); - } - - return (ret); - } - -} diff --git a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/ExportState.java b/modules/monitor/src/main/java/org/scribble/monitor/export/rules/ExportState.java deleted file mode 100644 index 832a4793c..000000000 --- a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/ExportState.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.export.rules; - -/** - * This class represents state information associated with the exported - * protocols. - * - */ -public class ExportState { - - private java.util.Stack _state=new java.util.Stack(); - - /** - * This method pushes state information to the stack. - */ - public void push() { - _state.push(new StateInformation()); - } - - /** - * This method pops state information from the stack. - */ - public void pop() { - _state.pop(); - } - - /** - * This method registers the label against the index. - * - * @param label The label - * @param index The index - */ - public void registerLabelIndex(String label, int index) { - _state.peek().registerLabelIndex(label, index); - } - - /** - * This method unregisters the label. - * - * @param label The label - */ - public void unregisterLabel(String label) { - _state.peek().unregisterLabel(label); - } - - /** - * This method returns the index associated with the - * supplied label. - * - * @param label The label - * @return The index, or -1 if not found - */ - public int getLabelIndex(String label) { - int ret=-1; - - for (int i=_state.size()-1; ret == -1 && i >= 0; i--) { - ret = _state.get(i).getLabelIndex(label); - } - - return (ret); - } - - /** - * This class represents the state information on the stack. - * - */ - public static class StateInformation { - - private java.util.Map _labelIndexes=new java.util.HashMap(); - - /** - * This method registers the label against the index. - * - * @param label The label - * @param index The index - */ - public void registerLabelIndex(String label, int index) { - _labelIndexes.put(label, index); - } - - /** - * This method unregisters the label. - * - * @param label The label - */ - public void unregisterLabel(String label) { - _labelIndexes.remove(label); - } - - /** - * This method returns the index associated with the - * supplied label. - * - * @param label The label - * @return The index, or -1 if not found - */ - public int getLabelIndex(String label) { - if (_labelIndexes.containsKey(label)) { - return (_labelIndexes.get(label)); - } - return (-1); - } - } -} diff --git a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LBlockNodeExporter.java b/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LBlockNodeExporter.java deleted file mode 100644 index 6d58b65a6..000000000 --- a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LBlockNodeExporter.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.export.rules; - -import org.scribble.context.ModuleContext; -import org.scribble.model.ModelObject; -import org.scribble.model.local.LActivity; -import org.scribble.model.local.LBlock; -import org.scribble.monitor.model.Node; -import org.scribble.monitor.model.SessionType; - -/** - * This class exports a block into a session type - * to be monitored. - * - */ -public class LBlockNodeExporter implements NodeExporter { - - /** - * {@inheritDoc} - */ - public void export(ModuleContext context, ExportState state, ModelObject mobj, SessionType type) { - LBlock block=(LBlock)mobj; - Node lastNode=null; - - state.push(); - - for (LActivity act : block.getContents()) { - NodeExporter ne=NodeExporterFactory.getNodeExporter(act); - int size=type.getNodes().size(); - - if (ne != null) { - ne.export(context, state, act, type); - - if (lastNode != null) { - lastNode.setNext(size); - } - - lastNode = type.getNode(size); - } - } - - state.pop(); - } - -} diff --git a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LChoiceNodeExporter.java b/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LChoiceNodeExporter.java deleted file mode 100644 index db174c49b..000000000 --- a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LChoiceNodeExporter.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.export.rules; - -import org.scribble.context.ModuleContext; -import org.scribble.model.ModelObject; -import org.scribble.model.local.LBlock; -import org.scribble.model.local.LChoice; -import org.scribble.monitor.model.Choice; -import org.scribble.monitor.model.SessionType; - -/** - * This class exports a choice into a session type - * to be monitored. - * - */ -public class LChoiceNodeExporter implements NodeExporter { - - /** - * {@inheritDoc} - */ - public void export(ModuleContext context, ExportState state, ModelObject mobj, SessionType type) { - LChoice choice=(LChoice)mobj; - - Choice choiceNode=new Choice(); - - type.getNodes().add(choiceNode); - - for (LBlock block : choice.getPaths()) { - choiceNode.getPathIndexes().add(type.getNodes().size()); - - NodeExporter ne=NodeExporterFactory.getNodeExporter(block); - - ne.export(context, state, block, type); - } - } - -} diff --git a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LContinueNodeExporter.java b/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LContinueNodeExporter.java deleted file mode 100644 index 13ea59bbe..000000000 --- a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LContinueNodeExporter.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.export.rules; - -import org.scribble.context.ModuleContext; -import org.scribble.model.ModelObject; -import org.scribble.model.local.LContinue; -import org.scribble.monitor.model.Continue; -import org.scribble.monitor.model.SessionType; - -/** - * This class exports a receive into a session type - * to be monitored. - * - */ -public class LContinueNodeExporter implements NodeExporter { - - /** - * {@inheritDoc} - */ - public void export(ModuleContext context, ExportState state, ModelObject mobj, SessionType type) { - LContinue elem=(LContinue)mobj; - - Continue continueNode=new Continue(); - continueNode.setNext(state.getLabelIndex(elem.getLabel())); - - type.getNodes().add(continueNode); - } - -} diff --git a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LDoNodeExporter.java b/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LDoNodeExporter.java deleted file mode 100644 index ff66d3b50..000000000 --- a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LDoNodeExporter.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.export.rules; - -import org.scribble.context.ModuleContext; -import org.scribble.model.ModelObject; -import org.scribble.model.local.LBlock; -import org.scribble.model.local.LDo; -import org.scribble.model.local.LProtocolDefinition; -import org.scribble.monitor.model.Do; -import org.scribble.monitor.model.SessionType; - -/** - * This class exports a Do into a session type - * to be monitored. - * - */ -public class LDoNodeExporter implements NodeExporter { - - /** - * {@inheritDoc} - */ - public void export(ModuleContext context, ExportState state, ModelObject mobj, SessionType type) { - LDo elem=(LDo)mobj; - - Do doNode=new Do(); - - type.getNodes().add(doNode); - - ModelObject mo=context.getMember(elem.getProtocol()); - - // TODO: Need to handle cyclic dependencies - store protocol definition when - // first used, against the index - - // TODO: Handle different instantiations of a protocol if parameterised or - // using protocol instance - - if (mo instanceof LProtocolDefinition) { - doNode.setProtocolIndex(type.getNodes().size()); - - LBlock block=((LProtocolDefinition)mo).getBlock(); - - NodeExporter ne=NodeExporterFactory.getNodeExporter(block); - - ne.export(context, state, block, type); - } - } - -} diff --git a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LInterruptibleNodeExporter.java b/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LInterruptibleNodeExporter.java deleted file mode 100644 index f5defe093..000000000 --- a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LInterruptibleNodeExporter.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.export.rules; - -import org.scribble.context.ModuleContext; -import org.scribble.model.Message; -import org.scribble.model.ModelObject; -import org.scribble.model.PayloadElement; -import org.scribble.model.PayloadTypeDecl; -import org.scribble.model.local.LBlock; -import org.scribble.model.local.LInterruptible; -import org.scribble.monitor.model.Choice; -import org.scribble.monitor.model.Interruptible; -import org.scribble.monitor.model.Receive; -import org.scribble.monitor.model.Send; -import org.scribble.monitor.model.SessionType; -import org.scribble.monitor.model.Parameter; - -/** - * This class exports an Interruptible into a session type - * to be monitored. - * - */ -public class LInterruptibleNodeExporter implements NodeExporter { - - /** - * {@inheritDoc} - */ - public void export(ModuleContext context, ExportState state, ModelObject mobj, SessionType type) { - LInterruptible elem=(LInterruptible)mobj; - - Interruptible interruptibleNode=new Interruptible(); - - type.getNodes().add(interruptibleNode); - - interruptibleNode.setBlockIndex(type.getNodes().size()); - - LBlock block=elem.getBlock(); - - NodeExporter ne=NodeExporterFactory.getNodeExporter(block); - - ne.export(context, state, block, type); - - // Export throws - if (elem.getThrows() != null && elem.getThrows().getMessages().size() > 0) { - - interruptibleNode.setThrows(type.getNodes().size()); - - if (elem.getThrows().getMessages().size() > 1) { - Choice choiceNode=new Choice(); - type.getNodes().add(choiceNode); - - for (Message mesg : elem.getThrows().getMessages()) { - choiceNode.getPathIndexes().add(type.getNodes().size()); - - exportThrow(context, state, elem, type, mesg); - } - } else { - exportThrow(context, state, elem, type, elem.getThrows().getMessages().get(0)); - } - } - - // Export catches - if (elem.getCatches().size() > 0) { - - interruptibleNode.setCatches(type.getNodes().size()); - - if (elem.getCatches().size() > 1 || elem.getCatches().get(0).getMessages().size() > 1) { - Choice choiceNode=new Choice(); - type.getNodes().add(choiceNode); - - for (LInterruptible.Catch c : elem.getCatches()) { - - for (Message mesg : c.getMessages()) { - choiceNode.getPathIndexes().add(type.getNodes().size()); - - exportCatch(context, state, c, type, mesg); - } - } - } else { - exportCatch(context, state, elem.getCatches().get(0), - type, elem.getCatches().get(0).getMessages().get(0)); - } - } - } - - protected void exportThrow(ModuleContext context, ExportState state, LInterruptible elem, - SessionType type, Message mesg) { - Send sendNode=new Send(); - sendNode.setOperator(mesg.getMessageSignature().getOperator()); - - for (PayloadElement pe : mesg.getMessageSignature().getPayloadElements()) { - - // TODO: Need to provide utility functions for extracting the payload type - // and make sure the context methods are as clear as possible - - PayloadTypeDecl ptype=elem.getModule().getTypeDeclaration(pe.getName()); - - if (ptype == null) { - ModelObject alias=context.getMember(pe.getName()); - - if (alias instanceof PayloadTypeDecl) { - ptype = (PayloadTypeDecl)alias; - } - } - - if (ptype != null) { - sendNode.getParameters().add(new Parameter(ptype.getType())); - } - } - - // TODO: Ned to cater for list of 'to' roles - sendNode.setToRole(elem.getThrows().getToRoles().get(0).getName()); - - type.getNodes().add(sendNode); - } - - protected void exportCatch(ModuleContext context, ExportState state, LInterruptible.Catch elem, - SessionType type, Message mesg) { - // TODO: Handle parameter - - Receive recvNode=new Receive(); - recvNode.setOperator(mesg.getMessageSignature().getOperator()); - - for (PayloadElement pe : mesg.getMessageSignature().getPayloadElements()) { - PayloadTypeDecl ptype=elem.getModule().getTypeDeclaration(pe.getName()); - - if (ptype == null) { - ModelObject alias=context.getMember(pe.getName()); - - if (alias instanceof PayloadTypeDecl) { - ptype = (PayloadTypeDecl)alias; - } - } - - if (ptype != null) { - recvNode.getParameters().add(new Parameter(ptype.getType())); - } - } - - // TODO: Ned to cater for list of 'to' roles - recvNode.setFromRole(elem.getRole().getName()); - - type.getNodes().add(recvNode); - } -} diff --git a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LParallelNodeExporter.java b/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LParallelNodeExporter.java deleted file mode 100644 index 64426fb98..000000000 --- a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LParallelNodeExporter.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.export.rules; - -import org.scribble.context.ModuleContext; -import org.scribble.model.ModelObject; -import org.scribble.model.local.LBlock; -import org.scribble.model.local.LParallel; -import org.scribble.monitor.model.Parallel; -import org.scribble.monitor.model.SessionType; - -/** - * This class exports a parallel into a session type - * to be monitored. - * - */ -public class LParallelNodeExporter implements NodeExporter { - - /** - * {@inheritDoc} - */ - public void export(ModuleContext context, ExportState state, ModelObject mobj, SessionType type) { - LParallel parallel=(LParallel)mobj; - - Parallel parallelNode=new Parallel(); - - type.getNodes().add(parallelNode); - - for (LBlock block : parallel.getPaths()) { - int newIndex=type.getNodes().size(); - - NodeExporter ne=NodeExporterFactory.getNodeExporter(block); - - ne.export(context, state, block, type); - - // Check if items have been exported, then add path index - if (type.getNodes().size() != newIndex) { - parallelNode.getPathIndexes().add(newIndex); - } - } - - // If no paths have been exported, then remove parallel node - if (parallelNode.getPathIndexes().size() == 0) { - type.getNodes().remove(parallelNode); - } - } - -} diff --git a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LReceiveNodeExporter.java b/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LReceiveNodeExporter.java deleted file mode 100644 index e1ae51eca..000000000 --- a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LReceiveNodeExporter.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.export.rules; - -import org.scribble.context.ModuleContext; -import org.scribble.model.ModelObject; -import org.scribble.model.PayloadElement; -import org.scribble.model.PayloadTypeDecl; -import org.scribble.model.local.LReceive; -import org.scribble.monitor.model.Receive; -import org.scribble.monitor.model.SessionType; -import org.scribble.monitor.model.Parameter; - -/** - * This class exports a receive into a session type - * to be monitored. - * - */ -public class LReceiveNodeExporter implements NodeExporter { - - /** - * {@inheritDoc} - */ - public void export(ModuleContext context, ExportState state, ModelObject mobj, SessionType type) { - LReceive recv=(LReceive)mobj; - - // TODO: Handle parameter - - Receive recvNode=new Receive(); - recvNode.setOperator(recv.getMessage().getMessageSignature().getOperator()); - - for (PayloadElement pe : recv.getMessage().getMessageSignature().getPayloadElements()) { - PayloadTypeDecl ptype=recv.getModule().getTypeDeclaration(pe.getName()); - - if (ptype == null) { - ModelObject alias=context.getMember(pe.getName()); - - if (alias instanceof PayloadTypeDecl) { - ptype = (PayloadTypeDecl)alias; - } - } - - if (ptype != null) { - recvNode.getParameters().add(new Parameter(ptype.getType())); - } - } - - // TODO: Ned to cater for list of 'to' roles - recvNode.setFromRole(recv.getFromRole().getName()); - - type.getNodes().add(recvNode); - } - -} diff --git a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LRecursionNodeExporter.java b/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LRecursionNodeExporter.java deleted file mode 100644 index f9038558c..000000000 --- a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LRecursionNodeExporter.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.export.rules; - -import org.scribble.context.ModuleContext; -import org.scribble.model.ModelObject; -import org.scribble.model.local.LBlock; -import org.scribble.model.local.LRecursion; -import org.scribble.monitor.model.Recursion; -import org.scribble.monitor.model.SessionType; - -/** - * This class exports a Recursion into a session type - * to be monitored. - * - */ -public class LRecursionNodeExporter implements NodeExporter { - - /** - * {@inheritDoc} - */ - public void export(ModuleContext context, ExportState state, ModelObject mobj, SessionType type) { - LRecursion elem=(LRecursion)mobj; - - Recursion recursionNode=new Recursion(); - - type.getNodes().add(recursionNode); - - recursionNode.setBlockIndex(type.getNodes().size()); - - state.registerLabelIndex(elem.getLabel(), type.getNodes().size()); - - LBlock block=elem.getBlock(); - - NodeExporter ne=NodeExporterFactory.getNodeExporter(block); - - ne.export(context, state, block, type); - - state.unregisterLabel(elem.getLabel()); - } - -} diff --git a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LSendNodeExporter.java b/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LSendNodeExporter.java deleted file mode 100644 index 5d38e0a51..000000000 --- a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/LSendNodeExporter.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.export.rules; - -import org.scribble.context.ModuleContext; -import org.scribble.model.ModelObject; -import org.scribble.model.PayloadElement; -import org.scribble.model.PayloadTypeDecl; -import org.scribble.model.local.LSend; -import org.scribble.monitor.model.Send; -import org.scribble.monitor.model.SessionType; -import org.scribble.monitor.model.Parameter; - -/** - * This class exports a send into a session type - * to be monitored. - * - */ -public class LSendNodeExporter implements NodeExporter { - - /** - * {@inheritDoc} - */ - public void export(ModuleContext context, ExportState state, ModelObject mobj, SessionType type) { - LSend send=(LSend)mobj; - - // TODO: Handle parameter - - Send sendNode=new Send(); - sendNode.setOperator(send.getMessage().getMessageSignature().getOperator()); - - for (PayloadElement pe : send.getMessage().getMessageSignature().getPayloadElements()) { - - // TODO: Need to provide utility functions for extracting the payload type - // and make sure the context methods are as clear as possible - - PayloadTypeDecl ptype=send.getModule().getTypeDeclaration(pe.getName()); - - if (ptype == null) { - ModelObject alias=context.getMember(pe.getName()); - - if (alias instanceof PayloadTypeDecl) { - ptype = (PayloadTypeDecl)alias; - } - } - - if (ptype != null) { - sendNode.getParameters().add(new Parameter(ptype.getType())); - } - } - - // TODO: Need to cater for list of 'to' roles - sendNode.setToRole(send.getToRoles().get(0).getName()); - - type.getNodes().add(sendNode); - } - -} diff --git a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/NodeExporter.java b/modules/monitor/src/main/java/org/scribble/monitor/export/rules/NodeExporter.java deleted file mode 100644 index d1a90af89..000000000 --- a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/NodeExporter.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.export.rules; - -import org.scribble.context.ModuleContext; -import org.scribble.model.ModelObject; -import org.scribble.monitor.model.SessionType; - -/** - * This class exports local protocol objects into a session type - * to be monitored. - * - */ -public interface NodeExporter { - - /** - * This method exports the model object to the session type. - * - * @param context The module context - * @param state The export state - * @param mobj The local protocol object - * @param type The session type - */ - public void export(ModuleContext context, ExportState state, ModelObject mobj, SessionType type); - -} diff --git a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/NodeExporterFactory.java b/modules/monitor/src/main/java/org/scribble/monitor/export/rules/NodeExporterFactory.java deleted file mode 100644 index e3da9a8d2..000000000 --- a/modules/monitor/src/main/java/org/scribble/monitor/export/rules/NodeExporterFactory.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.export.rules; - -import org.scribble.model.ModelObject; -import org.scribble.model.local.LBlock; -import org.scribble.model.local.LChoice; -import org.scribble.model.local.LContinue; -import org.scribble.model.local.LDo; -import org.scribble.model.local.LInterruptible; -import org.scribble.model.local.LParallel; -import org.scribble.model.local.LReceive; -import org.scribble.model.local.LRecursion; -import org.scribble.model.local.LSend; - -/** - * This class provides a factory for node exporters related to - * local protocol objects. - * - */ -public class NodeExporterFactory { - - private static java.util.Map, NodeExporter> _nodeExporters= - new java.util.HashMap, NodeExporter>(); - - static { - _nodeExporters.put(LBlock.class, new LBlockNodeExporter()); - _nodeExporters.put(LChoice.class, new LChoiceNodeExporter()); - _nodeExporters.put(LContinue.class, new LContinueNodeExporter()); - _nodeExporters.put(LDo.class, new LDoNodeExporter()); - _nodeExporters.put(LInterruptible.class, new LInterruptibleNodeExporter()); - _nodeExporters.put(LParallel.class, new LParallelNodeExporter()); - _nodeExporters.put(LReceive.class, new LReceiveNodeExporter()); - _nodeExporters.put(LRecursion.class, new LRecursionNodeExporter()); - _nodeExporters.put(LSend.class, new LSendNodeExporter()); - } - - /** - * This method returns a node exporter associated with the - * supplied model object. - * - * @param mobj The model object - * @return The node exporter, or null if not found - */ - public static NodeExporter getNodeExporter(ModelObject mobj) { - return (_nodeExporters.get(mobj.getClass())); - } - -} diff --git a/modules/monitor/src/main/java/org/scribble/monitor/model/Annotation.java b/modules/monitor/src/main/java/org/scribble/monitor/model/Annotation.java deleted file mode 100644 index c8baaa070..000000000 --- a/modules/monitor/src/main/java/org/scribble/monitor/model/Annotation.java +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.model; - -/** - * This class represents an annotation. - * - */ -public class Annotation { - - private String _name; - private java.util.List _properties=new java.util.ArrayList(); - - /** - * This method returns the name. - * - * @return The name - */ - public String getName() { - return (_name); - } - - /** - * This method sets the name. - * - * @param name The name - */ - public void setName(String name) { - _name = name; - } - - /** - * This method returns the properties. - * - * @return The properties - */ - public java.util.List getProperties() { - return (_properties); - } - - /** - * This method sets the properties. - * - * @param properties The properties - */ - public void setProperties(java.util.List properties) { - _properties = properties; - } - - /** - * This method adds a property to the annotation. - * - * @param name The name - * @param value The value - */ - public void addProperty(String name, String value) { - _properties.add(new NameValuePair(name, value)); - } - - /** - * This method returns the value associated with the specified - * name. - * - * @param name The name - * @return The value, or null if not found - */ - public String getValue(String name) { - for (NameValuePair nvp : _properties) { - if (nvp.getName().equals(name)) { - return (nvp.getValue()); - } - } - - return (null); - } - - /** - * This class represents a name/value pair. - * - */ - public static class NameValuePair { - - private String _name; - private String _value; - - /** - * This is the default constructor. - */ - public NameValuePair() { - } - - /** - * This constructor initializes the name and value. - * - * @param name The name - * @param value The value - */ - public NameValuePair(String name, String value) { - _name = name; - _value = value; - } - - /** - * This method returns the name. - * - * @return The name - */ - public String getName() { - return (_name); - } - - /** - * This method sets the name. - * - * @param name The name - */ - public void setName(String name) { - _name = name; - } - - /** - * This method returns the value. - * - * @return The value - */ - public String getValue() { - return (_value); - } - - /** - * This method sets the value. - * - * @param value The value - */ - public void setValue(String value) { - _value = value; - } - } -} diff --git a/modules/monitor/src/main/java/org/scribble/monitor/model/Choice.java b/modules/monitor/src/main/java/org/scribble/monitor/model/Choice.java deleted file mode 100644 index fe1e1a1e4..000000000 --- a/modules/monitor/src/main/java/org/scribble/monitor/model/Choice.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.model; - -import org.scribble.monitor.runtime.MonitorContext; -import org.scribble.monitor.runtime.SessionScope; - -/** - * This class represents a Choice action. - * - */ -public class Choice extends Node { - - private java.util.List _pathIndexes=new java.util.ArrayList(); - - /** - * {@inheritDoc} - */ - protected void init(MonitorContext context) { - } - - /** - * This method returns the choice path indexes. - * - * @return The choice path indexes - */ - public java.util.List getPathIndexes() { - return (_pathIndexes); - } - - /** - * This method sets the choice path indexes. - * - * @param indexes The choice path indexes - */ - public void getPathIndexes(java.util.List indexes) { - _pathIndexes = indexes; - } - - /** - * {@inheritDoc} - */ - @Override - public boolean evaluate(SessionType type, int index, SessionScope scope) { - - java.util.List subs=new java.util.ArrayList(); - - // Create a sub-scope per path - for (int i=0; i < _pathIndexes.size(); i++) { - SessionScope sub=new SessionScope(); - - if (Node._nameSessions) { - sub.setName("Choice/"+index+"/"+i); - } - - int subIndex=_pathIndexes.get(i); - - Node node=type.getNode(subIndex); - - if (node.evaluate(type, subIndex, sub)) { - sub.setCompletionIndex(getNext()); - scope.addSubScope(sub); - return (false); - } else { - subs.add(sub); - } - } - - // Need to add sub scopes to mutually exclusive scope - SessionScope choiceScope=new SessionScope(); - - if (Node._nameSessions) { - choiceScope.setName("Choice/"+index); - } - - choiceScope.setCompletionIndex(getNext()); - choiceScope.setMutuallyExclusive(true); - choiceScope.setSubScopes(subs); - - scope.addSubScope(choiceScope); - - return (false); - } - -} diff --git a/modules/monitor/src/main/java/org/scribble/monitor/model/Continue.java b/modules/monitor/src/main/java/org/scribble/monitor/model/Continue.java deleted file mode 100644 index e589438b3..000000000 --- a/modules/monitor/src/main/java/org/scribble/monitor/model/Continue.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.model; - -import org.scribble.monitor.runtime.MonitorContext; -import org.scribble.monitor.runtime.SessionScope; - -/** - * This class represents a Continue action. - * - */ -public class Continue extends Node { - - /** - * {@inheritDoc} - */ - protected void init(MonitorContext context) { - } - - /** - * {@inheritDoc} - */ - @Override - public boolean evaluate(SessionType type, int index, SessionScope scope) { - - handled(type, scope, -1); - - return (false); - } - -} diff --git a/modules/monitor/src/main/java/org/scribble/monitor/model/Do.java b/modules/monitor/src/main/java/org/scribble/monitor/model/Do.java deleted file mode 100644 index 19de0e73a..000000000 --- a/modules/monitor/src/main/java/org/scribble/monitor/model/Do.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.model; - -import org.scribble.monitor.runtime.MonitorContext; -import org.scribble.monitor.runtime.SessionScope; - -/** - * This class represents a Choice action. - * - */ -public class Do extends Node { - - private int _protocolIndex; - - /** - * {@inheritDoc} - */ - protected void init(MonitorContext context) { - } - - /** - * This method returns the protocol index. - * - * @return The protocol index - */ - public int getProtocolIndex() { - return (_protocolIndex); - } - - /** - * This method sets the protocol index. - * - * @param protocolIndex The protocol index - */ - public void setProtocolIndex(int protocolIndex) { - _protocolIndex = protocolIndex; - } - - /** - * {@inheritDoc} - */ - @Override - public boolean evaluate(SessionType type, int index, SessionScope scope) { - SessionScope subScope=new SessionScope(); - - if (Node._nameSessions) { - subScope.setName("Do/"+index); - } - - subScope.setCompletionIndex(getNext()); - - Node protocolNode=type.getNode(getProtocolIndex()); - protocolNode.evaluate(type, getProtocolIndex(), subScope); - - scope.addSubScope(subScope); - - return (false); - } - -} diff --git a/modules/monitor/src/main/java/org/scribble/monitor/model/Interruptible.java b/modules/monitor/src/main/java/org/scribble/monitor/model/Interruptible.java deleted file mode 100644 index 0ab37de7e..000000000 --- a/modules/monitor/src/main/java/org/scribble/monitor/model/Interruptible.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.model; - -import org.scribble.monitor.runtime.MonitorContext; -import org.scribble.monitor.runtime.SessionScope; - -/** - * This class represents an Interruptible action. - * - */ -public class Interruptible extends Node { - - /** - * {@inheritDoc} - */ - protected void init(MonitorContext context) { - } - - private int _blockIndex; - private int _catches=-1; - private int _throws=-1; - - /** - * This method returns the block index. - * - * @return The block index - */ - public int getBlockIndex() { - return (_blockIndex); - } - - /** - * This method sets the block index. - * - * @param blockIndex The block index - */ - public void setBlockIndex(int blockIndex) { - _blockIndex = blockIndex; - } - - /** - * This method returns the node index associated with catch - * specifications. - * - * @return The catch node index - */ - public int getCatches() { - return (_catches); - } - - /** - * This method sets the node index associated with catch - * specifications. - * - * @param index The catch node index - */ - public void setCatches(int index) { - _catches = index; - } - - /** - * This method returns the node index associated with throw - * specifications. - * - * @return The throw node index - */ - public int getThrows() { - return (_throws); - } - - /** - * This method sets the node index associated with throw - * specifications. - * - * @param index The throw node index - */ - public void setThrows(int index) { - _throws = index; - } - - /** - * {@inheritDoc} - */ - @Override - public boolean evaluate(SessionType type, int index, SessionScope scope) { - SessionScope subScope=new SessionScope(); - - if (Node._nameSessions) { - subScope.setName("Interruptible/"+index); - } - - subScope.setCompletionIndex(getNext()); - - subScope.setCatches(_catches); - subScope.setThrows(_throws); - - Node blockNode=type.getNode(getBlockIndex()); - blockNode.evaluate(type, getBlockIndex(), subScope); - - scope.addSubScope(subScope); - - return (false); - } - -} diff --git a/modules/monitor/src/main/java/org/scribble/monitor/model/MessageNode.java b/modules/monitor/src/main/java/org/scribble/monitor/model/MessageNode.java deleted file mode 100644 index fee3e55a7..000000000 --- a/modules/monitor/src/main/java/org/scribble/monitor/model/MessageNode.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.model; - -import org.scribble.monitor.runtime.MessageComparator; -import org.scribble.monitor.runtime.MonitorContext; -import org.scribble.monitor.runtime.SessionScope; - -/** - * This class represents the base class for message related - * nodes. - * - */ -public abstract class MessageNode extends Node { - - private String _operator; - private java.util.List _types=new java.util.ArrayList(); - - private MessageComparator _comparator; - - /** - * {@inheritDoc} - */ - protected void init(MonitorContext context) { - _comparator = context.getMessageComparator(this); - } - - /** - * This method returns the operator. - * - * @return The operator - */ - public String getOperator() { - return (_operator); - } - - /** - * This method sets the operator. - * - * @param operator The operator - */ - public void setOperator(String operator) { - _operator = operator; - } - - /** - * This method returns the types. - * - * @return The types - */ - public java.util.List getParameters() { - return (_types); - } - - /** - * This method sets the types. - * - * @param types The types - */ - public void setTypes(java.util.List types) { - _types = types; - } - - /** - * This method checks the message against the message node. - * - * @param type The session type - * @param scope The scope - * @param scopeIndex The scope index - * @param message The message - * @return Whether the message is valid - */ - protected boolean checkMessage(SessionType type, - SessionScope scope, int scopeIndex, Object message) { - if (_comparator.isMatch(message)) { - handled(type, scope, scopeIndex); - return (true); - } - - return (false); - } -} diff --git a/modules/monitor/src/main/java/org/scribble/monitor/model/Node.java b/modules/monitor/src/main/java/org/scribble/monitor/model/Node.java deleted file mode 100644 index ca163c2c9..000000000 --- a/modules/monitor/src/main/java/org/scribble/monitor/model/Node.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.model; - -import org.codehaus.jackson.annotate.JsonSubTypes; -import org.codehaus.jackson.annotate.JsonSubTypes.Type; -import org.codehaus.jackson.annotate.JsonTypeInfo; -import org.scribble.monitor.runtime.MonitorContext; -import org.scribble.monitor.runtime.SessionScope; - -/** - * This class represents the base class for all session nodes. - * - */ -@JsonTypeInfo(use=JsonTypeInfo.Id.NAME, include=JsonTypeInfo.As.PROPERTY, property="type") -@JsonSubTypes({@Type(value=Choice.class), - @Type(value=Continue.class), - @Type(value=Do.class), - @Type(value=Interruptible.class), - @Type(value=MessageNode.class), - @Type(value=Parallel.class), - @Type(value=Receive.class), - @Type(value=Recursion.class), - @Type(value=Send.class) }) -public abstract class Node { - - protected static boolean _nameSessions=false; - - private int _next=-1; - - private java.util.List _annotations=new java.util.ArrayList(); - - /** - * This method initializes the monitoring node. - * - * @param context The monitor context - */ - protected abstract void init(MonitorContext context); - - /** - * This method sets whether to name the - * sessions. - * - * @param name Whether to name the sessions - */ - public static void setNameNodes(boolean name) { - _nameSessions = name; - } - - /** - * This method returns the next index. - * - * @return The next index, or -1 if not defined - */ - public int getNext() { - return (_next); - } - - /** - * This method sets the next index. - * - * @param next The next index, or -1 if not defined - */ - public void setNext(int next) { - _next = next; - } - - /** - * This method returns the annotations. - * - * @return The annotations - */ - public java.util.List getAnnotations() { - return (_annotations); - } - - /** - * This method sets the annotations. - * - * @param annotations The annotations - */ - public void setAnnotations(java.util.List annotations) { - _annotations = annotations; - } - - /** - * This method returns the annotation with the specified name. - * - * @param name The name - * @return The annotation, or null if not found - */ - public Annotation getAnnotation(String name) { - for (int i=0; i < _annotations.size(); i++) { - if (_annotations.get(i).getName().equals(name)) { - return (_annotations.get(i)); - } - } - - return (null); - } - - /** - * This method checks whether the node can be evaluated without external trigger. If - * not, then the index should be added to the scope for later processing. - * - * @param type The session type - * @param index The index - * @param scope The session scope - * @return Whether the node was evaluated - */ - public boolean evaluate(SessionType type, int index, SessionScope scope) { - - // Associate the node index with the scope, as it cannot be evaluated - scope.addNodeIndex(index); - - return (false); - } - - /** - * This method unschedules the current node, if part of the session scope, and - * if a next index is identified, this will be evaluated. - * - * @param type The session type - * @param scope The scope - * @param scopeIndex The index in the scope, or -1 if not contained in the scope - */ - protected void handled(SessionType type, SessionScope scope, int scopeIndex) { - - if (scopeIndex != -1) { - // Remove index from scope - scope.getNodeIndexes().remove(scopeIndex); - } - - if (getNext() != -1) { - // Check if node can be directly evaluated - Node nextNode=type.getNode(getNext()); - - nextNode.evaluate(type, getNext(), scope); - } - } - - /** - * This method checks whether the sent message is valid. - * - * @param type The session type - * @param scope The session scope - * @param scopeIndex The index within the scope, or -1 if not currently part of scope - * @param message The message - * @param toRole The optional 'to' role - * @return Whether the sent message was expected - */ - public boolean sent(SessionType type, - SessionScope scope, int scopeIndex, Object message, String toRole) { - return (false); - } - - /** - * This method checks whether the sent message is valid. - * - * @param type The session type - * @param scope The session scope - * @param scopeIndex The index within the scope, or -1 if not currently part of scope - * @param message The message - * @param fromRole The optional 'from' role - * @return Whether the sent message was expected - */ - public boolean received(SessionType type, - SessionScope scope, int scopeIndex, Object message, String fromRole) { - return (false); - } - -} diff --git a/modules/monitor/src/main/java/org/scribble/monitor/model/Parallel.java b/modules/monitor/src/main/java/org/scribble/monitor/model/Parallel.java deleted file mode 100644 index f52047052..000000000 --- a/modules/monitor/src/main/java/org/scribble/monitor/model/Parallel.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.model; - -import org.scribble.monitor.runtime.MonitorContext; -import org.scribble.monitor.runtime.SessionScope; - -/** - * This class represents a Parallel action. - * - */ -public class Parallel extends Node { - - private java.util.List _pathIndexes=new java.util.ArrayList(); - - /** - * {@inheritDoc} - */ - protected void init(MonitorContext context) { - } - - /** - * This method returns the choice path indexes. - * - * @return The choice path indexes - */ - public java.util.List getPathIndexes() { - return (_pathIndexes); - } - - /** - * This method sets the choice path indexes. - * - * @param indexes The choice path indexes - */ - public void getPathIndexes(java.util.List indexes) { - _pathIndexes = indexes; - } - - /** - * {@inheritDoc} - */ - @Override - public boolean evaluate(SessionType type, int index, SessionScope scope) { - - SessionScope parallelScope=new SessionScope(); - parallelScope.setName("Parallel/"+index); - - // Create a sub-scope per path - for (int i=0; i < _pathIndexes.size(); i++) { - SessionScope sub=new SessionScope(); - - if (Node._nameSessions) { - sub.setName("Parallel/"+index+"/"+i); - } - - int subIndex=_pathIndexes.get(i); - Node nextNode=type.getNode(_pathIndexes.get(i)); - - // Evaluate node on sub-scope - nextNode.evaluate(type, subIndex, sub); - - // Check if should add - if (!sub.completed()) { - parallelScope.addSubScope(sub); - } - } - - if (!parallelScope.completed()) { - parallelScope.setCompletionIndex(getNext()); - scope.addSubScope(parallelScope); - } - - return (parallelScope.completed()); - } - -} diff --git a/modules/monitor/src/main/java/org/scribble/monitor/model/Parameter.java b/modules/monitor/src/main/java/org/scribble/monitor/model/Parameter.java deleted file mode 100644 index 729f428fc..000000000 --- a/modules/monitor/src/main/java/org/scribble/monitor/model/Parameter.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.model; - -/** - * This class represents the type name. - * - */ -public class Parameter { - - private String _name; - private String _type; - private java.util.List _annotations=new java.util.ArrayList(); - - /** - * This is the default constructor. - */ - public Parameter() { - } - - /** - * This constructor initializes the parameter type. - * - * @param type The type - */ - public Parameter(String type) { - _type = type; - } - - /** - * This constructor initializes the parameter name and type. - * - * @param name The name - */ - public Parameter(String name, String type) { - _name = name; - _type = type; - } - - /** - * This method returns the name. - * - * @return The name - */ - public String getName() { - return (_name); - } - - /** - * This method sets the name. - * - * @param name The name - */ - public void setName(String name) { - _name = name; - } - - /** - * This method returns the type. - * - * @return The type - */ - public String getType() { - return (_type); - } - - /** - * This method sets the type. - * - * @param type The type - */ - public void setType(String type) { - _type = type; - } - - /** - * This method returns the annotations. - * - * @return The annotations - */ - public java.util.List getAnnotations() { - return (_annotations); - } - - /** - * This method sets the annotations. - * - * @param annotations The annotations - */ - public void setAnnotations(java.util.List annotations) { - _annotations = annotations; - } - - /** - * This method returns the annotation with the specified name. - * - * @param name The name - * @return The annotation, or null if not found - */ - public Annotation getAnnotation(String name) { - for (int i=0; i < _annotations.size(); i++) { - if (_annotations.get(i).getName().equals(name)) { - return (_annotations.get(i)); - } - } - - return (null); - } - -} diff --git a/modules/monitor/src/main/java/org/scribble/monitor/model/Receive.java b/modules/monitor/src/main/java/org/scribble/monitor/model/Receive.java deleted file mode 100644 index 1901afe50..000000000 --- a/modules/monitor/src/main/java/org/scribble/monitor/model/Receive.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.model; - -import org.scribble.monitor.runtime.SessionScope; - -/** - * This class represents a Receive action. - * - */ -public class Receive extends MessageNode { - - private String _fromRole; - - /** - * This method sets the 'from' role. - * - * @param role The 'from' role - */ - public void setFromRole(String role) { - _fromRole = role; - } - - /** - * This method returns the 'from' role. - * - * @return The 'from' role - */ - public String getFromRole() { - return (_fromRole); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean received(SessionType type, - SessionScope scope, int scopeIndex, Object message, String fromRole) { - if (fromRole != null && !fromRole.equals(_fromRole)) { - return (false); - } - return (checkMessage(type, scope, scopeIndex, message)); - } - -} diff --git a/modules/monitor/src/main/java/org/scribble/monitor/model/Recursion.java b/modules/monitor/src/main/java/org/scribble/monitor/model/Recursion.java deleted file mode 100644 index 93de54015..000000000 --- a/modules/monitor/src/main/java/org/scribble/monitor/model/Recursion.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.model; - -import org.scribble.monitor.runtime.MonitorContext; -import org.scribble.monitor.runtime.SessionScope; - -/** - * This class represents a Recursion action. - * - */ -public class Recursion extends Node { - - private int _blockIndex; - - /** - * {@inheritDoc} - */ - protected void init(MonitorContext context) { - } - - /** - * This method returns the block index. - * - * @return The block index - */ - public int getBlockIndex() { - return (_blockIndex); - } - - /** - * This method sets the block index. - * - * @param blockIndex The block index - */ - public void setBlockIndex(int blockIndex) { - _blockIndex = blockIndex; - } - - /** - * {@inheritDoc} - */ - @Override - public boolean evaluate(SessionType type, int index, SessionScope scope) { - SessionScope subScope=new SessionScope(); - - if (Node._nameSessions) { - subScope.setName("Recursion/"+index); - } - - subScope.setCompletionIndex(getNext()); - - Node blockNode=type.getNode(getBlockIndex()); - blockNode.evaluate(type, getBlockIndex(), subScope); - - scope.addSubScope(subScope); - - return (false); - } - -} diff --git a/modules/monitor/src/main/java/org/scribble/monitor/model/Send.java b/modules/monitor/src/main/java/org/scribble/monitor/model/Send.java deleted file mode 100644 index bae230873..000000000 --- a/modules/monitor/src/main/java/org/scribble/monitor/model/Send.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.model; - -import org.scribble.monitor.runtime.SessionScope; - -/** - * This class represents a Send action. - * - */ -public class Send extends MessageNode { - - private String _toRole; - - /** - * This method sets the 'to' role. - * - * @param role The 'to' role - */ - public void setToRole(String role) { - _toRole = role; - } - - /** - * This method returns the 'to' role. - * - * @return The 'to' role - */ - public String getToRole() { - return (_toRole); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean sent(SessionType type, - SessionScope scope, int scopeIndex, Object message, String toRole) { - if (toRole != null && !toRole.equals(_toRole)) { - return (false); - } - return (checkMessage(type, scope, scopeIndex, message)); - } - -} diff --git a/modules/monitor/src/main/java/org/scribble/monitor/model/SessionType.java b/modules/monitor/src/main/java/org/scribble/monitor/model/SessionType.java deleted file mode 100644 index 0001ba9e8..000000000 --- a/modules/monitor/src/main/java/org/scribble/monitor/model/SessionType.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.model; - -import org.scribble.monitor.runtime.MonitorContext; -import org.scribble.monitor.runtime.SessionInstance; -import org.scribble.monitor.runtime.SessionScope; - -/** - * This class represents the monitorable version of a local protocol. - * - */ -public class SessionType { - - private java.util.List _nodes=new java.util.ArrayList(); - - /** - * This method initializes the supplied session instance to monitor - * against this session type. - * - * @param context The monitor context - * @param instance The new session instance - */ - public void initialize(MonitorContext context, SessionInstance instance) { - - for (Node node : _nodes) { - node.init(context); - } - - // Create a new top level session scope - SessionScope scope=new SessionScope(); - - if (Node._nameSessions) { - scope.setName("Main"); - } - - Node node=getNode(0); - - node.evaluate(this, 0, scope); - - instance.setScope(scope); - } - - /** - * This method returns the nodes. - * - * @return The nodes - */ - public java.util.List getNodes() { - return (_nodes); - } - - /** - * This method sets the nodes. - * - * @param nodes The nodes - */ - public void setNodes(java.util.List nodes) { - _nodes = nodes; - } - - /** - * This method returns the node at the specified index. - * - * @param index The index - * @return The node - */ - public Node getNode(int index) { - return (_nodes.get(index)); - } - -} diff --git a/modules/monitor/src/main/java/org/scribble/monitor/runtime/DefaultMonitor.java b/modules/monitor/src/main/java/org/scribble/monitor/runtime/DefaultMonitor.java deleted file mode 100644 index 190deb9a1..000000000 --- a/modules/monitor/src/main/java/org/scribble/monitor/runtime/DefaultMonitor.java +++ /dev/null @@ -1,225 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.runtime; - -import org.scribble.monitor.model.Node; -import org.scribble.monitor.model.SessionType; -import org.scribble.monitor.runtime.SessionInstance; - -/** - * This class represents the monitorable version of a local protocol. - * - */ -public class DefaultMonitor implements Monitor { - - private MonitorContext _context; - - /** - * This method sets the monitor context. - * - * @param context The monitor context - */ - public void setMonitorContext(MonitorContext context) { - _context = context; - } - - /** - * This method returns the monitor context. - * - * @return The monitor context - */ - public MonitorContext getMonitorContext() { - return (_context); - } - - /** - * {@inheritDoc} - */ - public void initializeInstance(SessionType type, SessionInstance instance) { - MonitorContext context=getMonitorContext(); - - if (context == null) { - context = new DefaultMonitorContext(); - } - - type.initialize(context, instance); - } - - /** - * {@inheritDoc} - */ - public boolean sent(SessionType type, SessionInstance instance, - Object message, String toRole) { - return (sent(type, instance.getScope(), message, toRole)); - } - - /** - * This method checks whether the sent message is applicable to the supplied - * session scope or any of its child scopes. - * - * @param type The session type - * @param scope The session scope - * @param message The message - * @param toRole The optional 'to' role - * @return Whether the sent message is applicable to the scope - */ - protected boolean sent(SessionType type, SessionScope scope, - Object message, String toRole) { - boolean ret=false; - - // Check throws - if (scope.getThrows() != -1) { - Node throwNode=type.getNode(scope.getThrows()); - - ret = throwNode.sent(type, scope, -1, message, toRole); - - if (ret) { - scope.completed(true); - return (true); - } - } - - // Check indexes for this session scope - if (scope.getNodeIndexes() != null) { - for (int i=0; i < scope.getNodeIndexes().size(); i++) { - int index=scope.getNodeIndexes().get(i); - Node node=type.getNode(index); - - ret = node.sent(type, scope, i, message, toRole); - - if (ret) { - break; - } - } - } - - if (!ret && scope.getSubScopes() != null) { - for (int i=0; i < scope.getSubScopes().size(); i++) { - SessionScope subScope=scope.getSubScopes().get(i); - - ret = sent(type, subScope, message, toRole); - - if (ret) { - checkScope(type, scope, subScope, i); - break; - } - } - } - - return (ret); - } - - /** - * {@inheritDoc} - */ - public boolean received(SessionType type, SessionInstance instance, - Object message, String fromRole) { - return (received(type, instance.getScope(), message, fromRole)); - } - - /** - * This method checks whether the received message is applicable to the supplied - * session scope or any of its child scopes. - * - * @param type The session type - * @param scope The session scope - * @param message The message - * @param fromRole The optional 'from' role - * @return Whether the sent message is applicable to the scope - */ - protected boolean received(SessionType type, SessionScope scope, - Object message, String fromRole) { - boolean ret=false; - - // Check catches - if (scope.getCatches() != -1) { - Node catchNode=type.getNode(scope.getCatches()); - - ret = catchNode.received(type, scope, -1, message, fromRole); - - if (ret) { - scope.completed(true); - return (true); - } - } - - // Check indexes for this session scope - if (scope.getNodeIndexes() != null) { - for (int i=0; i < scope.getNodeIndexes().size(); i++) { - int index=scope.getNodeIndexes().get(i); - Node node=type.getNode(index); - - ret = node.received(type, scope, i, message, fromRole); - - if (ret) { - break; - } - } - } - - if (!ret && scope.getSubScopes() != null) { - for (int i=0; i < scope.getSubScopes().size(); i++) { - SessionScope subScope=scope.getSubScopes().get(i); - - ret = received(type, subScope, message, fromRole); - - if (ret) { - checkScope(type, scope, subScope, i); - break; - } - } - } - - return (ret); - } - - /** - * This method checks a sub-scope to see whether it has completed, and if so, - * remove it from the parent scope and initiate any optional completion node. - * - * @param type The session type - * @param scope The parent scope - * @param subScope The sub scope to check - * @param scopeIndex The sub-scope's index within the parent scope - */ - protected void checkScope(SessionType type, - SessionScope scope, SessionScope subScope, int scopeIndex) { - - // Check if parent scope is mutually exclusive - if (scope.getMutuallyExclusive() - && scope.getSubScopes().size() != 1) { - scope.getSubScopes().clear(); - scope.getSubScopes().add(subScope); - scopeIndex = 0; - } - - // Check if sub scope is now empty - if (subScope.completed()) { - - // Remove sub-scope - // TODO: Investigate whether scope positions can possibly change - scope.getSubScopes().remove(scopeIndex); - - if (subScope.getCompletionIndex() != -1) { - Node node=type.getNode(subScope.getCompletionIndex()); - - node.evaluate(type, subScope.getCompletionIndex(), scope); - } - } - } - -} diff --git a/modules/monitor/src/main/java/org/scribble/monitor/runtime/DefaultMonitorContext.java b/modules/monitor/src/main/java/org/scribble/monitor/runtime/DefaultMonitorContext.java deleted file mode 100644 index 88f137fc7..000000000 --- a/modules/monitor/src/main/java/org/scribble/monitor/runtime/DefaultMonitorContext.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.runtime; - -import org.scribble.monitor.model.MessageNode; - -public class DefaultMonitorContext implements MonitorContext { - - private java.util.List _messageComparatorFactories= - new java.util.ArrayList(); - - /** - * This method registers a message comparator factory. - * - * @param factory The message comparator factory - */ - public void register(MessageComparatorFactory factory) { - _messageComparatorFactories.add(factory); - } - - /** - * This method unregisters a message comparator factory. - * - * @param factory The message comparator factory - */ - public void unregister(MessageComparatorFactory factory) { - _messageComparatorFactories.remove(factory); - } - - /** - * {@inheritDoc} - */ - public MessageComparator getMessageComparator(MessageNode node) { - - // Iterate though the registered factories to see whether any are - // appropriate for the supplied message node. - for (MessageComparatorFactory factory : _messageComparatorFactories) { - MessageComparator comparator=factory.create(node); - if (comparator != null) { - return (comparator); - } - } - - // Create the default comparator - return (new MonitorMessageComparator(node)); - } - -} diff --git a/modules/monitor/src/main/java/org/scribble/monitor/runtime/MessageComparator.java b/modules/monitor/src/main/java/org/scribble/monitor/runtime/MessageComparator.java deleted file mode 100644 index e98dd643a..000000000 --- a/modules/monitor/src/main/java/org/scribble/monitor/runtime/MessageComparator.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.runtime; - -/** - * This interface represents a message comparator initialized - * with required criteria. - * - */ -public interface MessageComparator { - - /** - * This method checks whether the supplied message matches the criteria - * associated with this comparator. - * - * @param message The message - * @return Whether the message matches - */ - public boolean isMatch(Object message); - -} diff --git a/modules/monitor/src/main/java/org/scribble/monitor/runtime/MessageComparatorFactory.java b/modules/monitor/src/main/java/org/scribble/monitor/runtime/MessageComparatorFactory.java deleted file mode 100644 index 5a3e38103..000000000 --- a/modules/monitor/src/main/java/org/scribble/monitor/runtime/MessageComparatorFactory.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.runtime; - -import org.scribble.monitor.model.MessageNode; - -/** - * This interface represents a message comparator factory. - * - */ -public interface MessageComparatorFactory { - - /** - * This method creates a new MessageComparator instance if the - * factory is appropriate for the supplied message node. - * - * @param node The message node - * @return The message comparator, or null if factory not appropriate for the message node - */ - public MessageComparator create(MessageNode node); - -} diff --git a/modules/monitor/src/main/java/org/scribble/monitor/runtime/Monitor.java b/modules/monitor/src/main/java/org/scribble/monitor/runtime/Monitor.java deleted file mode 100644 index 3a98d73fa..000000000 --- a/modules/monitor/src/main/java/org/scribble/monitor/runtime/Monitor.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.runtime; - -import org.scribble.monitor.model.SessionType; - -public interface Monitor { - - /** - * This method initializes a session instance based on the supplied session type. - * - * @param type The session type - * @param instance The session instance - */ - public void initializeInstance(SessionType type, SessionInstance instance); - - /** - * This method checks whether the sent message is valid. - * - * @param type The session type - * @param instance The session instance - * @param message The message - * @param toRole The optional 'to' role - * @return Whether the sent message was expected - */ - public boolean sent(SessionType type, SessionInstance instance, - Object message, String toRole); - - /** - * This method checks whether the received message is valid. - * - * @param type The session type - * @param instance The session instance - * @param message The message - * @param fromRole The optional 'from' role - * @return Whether the received message was expected - */ - public boolean received(SessionType type, SessionInstance instance, - Object message, String fromRole); - -} diff --git a/modules/monitor/src/main/java/org/scribble/monitor/runtime/MonitorContext.java b/modules/monitor/src/main/java/org/scribble/monitor/runtime/MonitorContext.java deleted file mode 100644 index 65fcd8c45..000000000 --- a/modules/monitor/src/main/java/org/scribble/monitor/runtime/MonitorContext.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.runtime; - -import org.scribble.monitor.model.MessageNode; - -/** - * This interface represents the monitor context. - * - */ -public interface MonitorContext { - - /** - * This method returns a pre-initialized message comparator associated - * with the supplied message node. - * - * @param node The message node - * @return The pre-initialized message comparator - */ - public MessageComparator getMessageComparator(MessageNode node); - -} diff --git a/modules/monitor/src/main/java/org/scribble/monitor/runtime/MonitorMessage.java b/modules/monitor/src/main/java/org/scribble/monitor/runtime/MonitorMessage.java deleted file mode 100644 index 8630bfd79..000000000 --- a/modules/monitor/src/main/java/org/scribble/monitor/runtime/MonitorMessage.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.runtime; - -/** - * This class represents a message being sent or received by the - * role being monitored. - * - */ -public class MonitorMessage { - - private String _operator; - private java.util.List _types=new java.util.ArrayList(); - private java.util.List _values=new java.util.ArrayList(); - - public MonitorMessage() { - } - - /** - * This method returns the operator. - * - * @return The operator - */ - public String getOperator() { - return (_operator); - } - - /** - * This method sets the operator. - * - * @param operator The operator - * @return The message - */ - public MonitorMessage setOperator(String operator) { - _operator = operator; - return (this); - } - - /** - * This method returns the types. - * - * @return The types - */ - public java.util.List getTypes() { - return (_types); - } - - /** - * This method sets the types. - * - * @param types The types - * @return The message - */ - public MonitorMessage setTypes(java.util.List types) { - _types = types; - return (this); - } - - /** - * This method returns the values. - * - * @return The values - */ - public java.util.List getValues() { - return (_values); - } - - /** - * This method sets the values. - * - * @param values The values - * @return The message - */ - public MonitorMessage setValues(java.util.List values) { - _values = values; - return (this); - } - - /** - * {@inheritDoc} - */ - public boolean equals(Object obj) { - boolean ret=false; - - if (obj instanceof MonitorMessage) { - MonitorMessage other=(MonitorMessage)obj; - - if (other._operator != null - && _operator != null - && other._operator.equals(_operator)) { - - if (_types.size() == other._types.size() - && _values.size() == other._values.size()) { - ret = true; - - for (int i=0; ret && i < _types.size(); i++) { - if (_types.get(i) == null || other._types.get(i) == null - || !_types.get(i).equals(other._types.get(i))) { - ret = false; - } - } - - for (int i=0; ret && i < _values.size(); i++) { - if (_values.get(i) == null || other._values.get(i) == null - || !_values.get(i).equals(other._values.get(i))) { - ret = false; - } - } - } - } - } - - return (ret); - } - - /** - * {@inheritDoc} - */ - public String toString() { - StringBuffer buf=new StringBuffer(); - - if (_operator != null) { - buf.append(_operator); - } - - buf.append("("); - - for (int i=0; i < _types.size(); i++) { - if (i > 0) { - buf.append(","); - } - buf.append(_types.get(i)); - } - buf.append(")"); - - return (buf.toString()); - } -} diff --git a/modules/monitor/src/main/java/org/scribble/monitor/runtime/MonitorMessageComparator.java b/modules/monitor/src/main/java/org/scribble/monitor/runtime/MonitorMessageComparator.java deleted file mode 100644 index 375bee623..000000000 --- a/modules/monitor/src/main/java/org/scribble/monitor/runtime/MonitorMessageComparator.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.runtime; - -import org.scribble.monitor.model.MessageNode; - -/** - * This class provides the default message comparator implementation. - * - */ -public class MonitorMessageComparator implements MessageComparator { - - private MessageNode _node; - - /** - * This is the constructor to initialize the message comparator. - * - * @param node The message node - */ - public MonitorMessageComparator(MessageNode node) { - _node = node; - } - - /** - * {@inheritDoc} - */ - public boolean isMatch(Object message) { - boolean ret=false; - - if (_node.getOperator().equals(((MonitorMessage)message).getOperator()) - && _node.getParameters().size() == ((MonitorMessage)message).getTypes().size()) { - - ret = true; - - for (int i=0; ret && i < _node.getParameters().size(); i++) { - ret = _node.getParameters().get(i).getType().equals(((MonitorMessage)message).getTypes().get(i)); - } - } - - return (ret); - } - -} diff --git a/modules/monitor/src/main/java/org/scribble/monitor/runtime/MonitorUtil.java b/modules/monitor/src/main/java/org/scribble/monitor/runtime/MonitorUtil.java deleted file mode 100644 index 18bfc542a..000000000 --- a/modules/monitor/src/main/java/org/scribble/monitor/runtime/MonitorUtil.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.runtime; - -import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jackson.map.SerializationConfig; -import org.codehaus.jackson.map.annotate.JsonSerialize; - -/** - * This class provides model utility functions. - * - */ -public class MonitorUtil { - - protected static final ObjectMapper MAPPER=new ObjectMapper(); - - static { - SerializationConfig config=MAPPER.getSerializationConfig() - .withSerializationInclusion(JsonSerialize.Inclusion.NON_NULL) - .withSerializationInclusion(JsonSerialize.Inclusion.NON_DEFAULT); - - MAPPER.setSerializationConfig(config); - - MAPPER.configure(SerializationConfig.Feature.WRITE_EMPTY_JSON_ARRAYS, false); - } - - /** - * This method returns the JSON representation of the session instance. - * - * @param instance The session instance - * @return The JSON representation - * @throws Exception Failed to serialize - */ - public static byte[] serializeSessionInstance(SessionInstance instance) throws Exception { - byte[] ret=null; - - java.io.ByteArrayOutputStream baos=new java.io.ByteArrayOutputStream(); - - MAPPER.writeValue(baos, instance); - - ret = baos.toByteArray(); - - baos.close(); - - return (ret); - } - - /** - * This method returns the session instance of a supplied JSON representation. - * - * @param instance The JSON representation - * @return The session instance - * @throws Exception Failed to deserialize - */ - public static SessionInstance deserializeSessionInstance(byte[] instance) throws Exception { - SessionInstance ret=null; - - java.io.ByteArrayInputStream bais=new java.io.ByteArrayInputStream(instance); - - ret = MAPPER.readValue(bais, SessionInstance.class); - - bais.close(); - - return (ret); - } - -} diff --git a/modules/monitor/src/main/java/org/scribble/monitor/runtime/SessionInstance.java b/modules/monitor/src/main/java/org/scribble/monitor/runtime/SessionInstance.java deleted file mode 100644 index 9fd26cc0b..000000000 --- a/modules/monitor/src/main/java/org/scribble/monitor/runtime/SessionInstance.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.runtime; - -/** - * This class represents the state associated with an instance of - * a session type. - * - */ -public class SessionInstance { - - private SessionScope _scope; - - /** - * This method returns the top level scope associated with this - * session instance. - * - * @return The session scope - */ - public SessionScope getScope() { - return (_scope); - } - - /** - * This method sets the top level scope associated with this - * session instance. - * - * @param scope The session scope - */ - public void setScope(SessionScope scope) { - _scope = scope; - } - - /** - * This method determines whether the session instance has completed. - * - * @return Whether session completed - */ - public boolean hasCompleted() { - return (_scope.completed()); - } - - /** - * {@inheritDoc} - */ - public String toString() { - String ret=null; - - try { - ret = new String(MonitorUtil.serializeSessionInstance(this)); - } catch (Exception e) { - ret = ""; - } - - return (ret); - } -} diff --git a/modules/monitor/src/main/java/org/scribble/monitor/runtime/SessionScope.java b/modules/monitor/src/main/java/org/scribble/monitor/runtime/SessionScope.java deleted file mode 100644 index 318fa77fc..000000000 --- a/modules/monitor/src/main/java/org/scribble/monitor/runtime/SessionScope.java +++ /dev/null @@ -1,228 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.runtime; - -// TODO: Could try: -// (1) with map of session scopes, with the parent/child relationship defined by scope names, with -// unnamed scopes being given a randomly unique id. -// (2) with subScopes in a map with scope name external to the scope -// NOTE: Some of these impl decisions may have better results for certain protocols/scaling - need -// to identify pros/cons and a way to optimise based on the nature of the protocol. - -/** - * This class represents the state information associated with a scope. - * - */ -public class SessionScope { - - private String _name; - private java.util.List _indexes; - private java.util.List _subScopes; - private int _completionIndex=-1; - private boolean _completed=false; - private boolean _mutuallyExclusive=false; - private int _catches=-1; - private int _throws=-1; - - /** - * The default constructor. - */ - public SessionScope() { - } - - /** - * This method returns the optional name associated with the scope. - * - * @return The name - */ - public String getName() { - return (_name); - } - - /** - * This method sets the optional name associated with the scope. - * - * @param name The name - */ - public void setName(String name) { - _name = name; - } - - /** - * This method returns the list of current nodes associated with the - * session instance. - * - * @return The current nodes - */ - public java.util.List getNodeIndexes() { - return (_indexes); - } - - /** - * This method adds an index to the session scope. - * - * @param index The index - */ - public void addNodeIndex(int index) { - if (_indexes == null) { - _indexes = new java.util.ArrayList(); - } - _indexes.add(index); - } - - /** - * This method sets the list of node indexes associated with this scope. - * - * @param indexes The current nodes - */ - public void setNodeIndexes(java.util.List indexes) { - _indexes = indexes; - } - - /** - * This method returns the list of sub-scopes associated with the - * session instance. - * - * @return The sub-scopes - */ - public java.util.List getSubScopes() { - return (_subScopes); - } - - /** - * This method adds a sub scope to the session's scope. - * - * @param sub The sub scope - */ - public void addSubScope(SessionScope sub) { - if (_subScopes == null) { - _subScopes = new java.util.ArrayList(); - } - _subScopes.add(sub); - } - - /** - * This method sets the list of sub-scopes associated with this scope. - * - * @param subScopes The sub scopes - */ - public void setSubScopes(java.util.List subScopes) { - _subScopes = subScopes; - } - - /** - * This method returns the optional completion index. If specific - * (not -1) then when the scope has no more node indexes or sub-scopes, - * then the completion index should be scheduled in the parent scope. - * - * @return The completion index, or -1 if not defined - */ - public int getCompletionIndex() { - return (_completionIndex); - } - - /** - * This method returns the optional completion index. If specific - * (not -1) then when the scope has no more node indexes or sub-scopes, - * then the completion index should be scheduled in the parent scope. - * - * @param index The completion index, or -1 if not defined - */ - public void setCompletionIndex(int index) { - _completionIndex = index; - } - - /** - * This method sets the completion state of the session scope. - * - * @param completed The completion state - */ - protected void completed(boolean completed) { - _completed = completed; - } - - /** - * This method determines whether the session scope has completed. - * - * @return Whether completed - */ - public boolean completed() { - return (_completed || ((_indexes == null || _indexes.size() == 0) - && (_subScopes == null || _subScopes.size() == 0))); - } - - /** - * This method returns whether the session scope contains sub-scopes - * that are mutually exclusive. - * - * @return Whether mutually exclusive - */ - public boolean getMutuallyExclusive() { - return (_mutuallyExclusive); - } - - /** - * This method sets whether the session scope contains sub-scopes - * that are mutually exclusive. - * - * @param me Whether mutually exclusive - */ - public void setMutuallyExclusive(boolean me) { - _mutuallyExclusive = me; - } - - /** - * This method returns the node index associated with catch - * specifications. - * - * @return The catch node index - */ - public int getCatches() { - return (_catches); - } - - /** - * This method sets the node index associated with catch - * specifications. - * - * @param index The catch node index - */ - public void setCatches(int index) { - _catches = index; - } - - /** - * This method returns the node index associated with throw - * specifications. - * - * @return The throw node index - */ - public int getThrows() { - return (_throws); - } - - /** - * This method sets the list of node indexes associated with throw - * specifications. - * - * @param index The throw node index - */ - public void setThrows(int index) { - _throws = index; - } - -} diff --git a/modules/monitor/src/main/resources/org/scribble/monitor/Messages.properties b/modules/monitor/src/main/resources/org/scribble/monitor/Messages.properties deleted file mode 100644 index 81a38783f..000000000 --- a/modules/monitor/src/main/resources/org/scribble/monitor/Messages.properties +++ /dev/null @@ -1,17 +0,0 @@ -#/* -# * Copyright 2009-10 Scribble.org -# * -# * Licensed under the Apache License, Version 2.0 (the "License"); -# * you may not use this file except in compliance with the License. -# * You may obtain a copy of the License at -# * -# * http://www.apache.org/licenses/LICENSE-2.0 -# * -# * Unless required by applicable law or agreed to in writing, software -# * distributed under the License is distributed on an "AS IS" BASIS, -# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# * See the License for the specific language governing permissions and -# * limitations under the License. -# * -# */ - diff --git a/modules/monitor/src/test/java/org/scribble/monitor/export/ExportStateTest.java b/modules/monitor/src/test/java/org/scribble/monitor/export/ExportStateTest.java deleted file mode 100644 index 25550c318..000000000 --- a/modules/monitor/src/test/java/org/scribble/monitor/export/ExportStateTest.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.export; - -import static org.junit.Assert.*; - -import org.scribble.monitor.export.rules.ExportState; - -public class ExportStateTest { - - private static final String TEST_LABEL = "TestLabel"; - private static final int TEST_INDEX_1 = 53; - private static final int TEST_INDEX_2 = 24; - - @org.junit.Test - public void testRegisterLabel() { - ExportState es=new ExportState(); - - es.push(); - - es.registerLabelIndex(TEST_LABEL, TEST_INDEX_1); - - if (es.getLabelIndex(TEST_LABEL) != TEST_INDEX_1) { - fail("Registered index incorrect: "+es.getLabelIndex(TEST_LABEL)); - } - } - - @org.junit.Test - public void testRegisterLabelInOuterScope() { - ExportState es=new ExportState(); - - es.push(); - - es.registerLabelIndex(TEST_LABEL, TEST_INDEX_1); - - // Create inner scope - es.push(); - - if (es.getLabelIndex(TEST_LABEL) != TEST_INDEX_1) { - fail("Registered index incorrect: "+es.getLabelIndex(TEST_LABEL)); - } - } - - @org.junit.Test - public void testOverrideLabelInOuterScope() { - ExportState es=new ExportState(); - - es.push(); - - es.registerLabelIndex(TEST_LABEL, TEST_INDEX_1); - - // Create inner scope - es.push(); - - // Override index - es.registerLabelIndex(TEST_LABEL, TEST_INDEX_2); - - // Create inner scope - es.push(); - - if (es.getLabelIndex(TEST_LABEL) != TEST_INDEX_2) { - fail("Registered index incorrect: "+es.getLabelIndex(TEST_LABEL)); - } - } -} diff --git a/modules/monitor/src/test/java/org/scribble/monitor/export/MonitorExporterTest.java b/modules/monitor/src/test/java/org/scribble/monitor/export/MonitorExporterTest.java deleted file mode 100644 index d44fe9aeb..000000000 --- a/modules/monitor/src/test/java/org/scribble/monitor/export/MonitorExporterTest.java +++ /dev/null @@ -1,202 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.export; - -import static org.junit.Assert.*; - -import java.util.Map; - -import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jackson.map.SerializationConfig; -import org.codehaus.jackson.map.SerializationConfig.Feature; -import org.codehaus.jackson.map.annotate.JsonSerialize; -import org.scribble.context.DefaultModuleContext; -import org.scribble.logging.ConsoleIssueLogger; -import org.scribble.model.Module; -import org.scribble.model.local.LProtocolDefinition; -import org.scribble.monitor.model.SessionType; -import org.scribble.parser.ProtocolModuleLoader; -import org.scribble.parser.ProtocolParser; -import org.scribble.resources.DirectoryResourceLocator; -import org.scribble.resources.InputStreamResource; - -public class MonitorExporterTest { - - @org.junit.Test - public void testRequestResponse() { - testMonitorExporter("RequestResponse", "Buyer"); - } - - @org.junit.Test - public void testChoice() { - testMonitorExporter("Choice", "Buyer"); - } - - @org.junit.Test - public void testParallel() { - testMonitorExporter("Parallel", "Buyer"); - } - - @org.junit.Test - public void testParallel2() { - testMonitorExporter("Parallel2", "Buyer"); - } - - @org.junit.Test - public void testParallel3() { - testMonitorExporter("Parallel3", "Buyer"); - } - - @org.junit.Test - public void testParallel4() { - testMonitorExporter("Parallel4", "Buyer"); - } - - @org.junit.Test - public void testDo() { - testMonitorExporter("Do", "Buyer"); - } - - @org.junit.Test - public void testRecursion() { - testMonitorExporter("Recursion", "Buyer"); - } - - @org.junit.Test - public void testInterruptible() { - testMonitorExporter("Interruptible", "Buyer"); - } - - @org.junit.Test - public void testInterruptible2() { - testMonitorExporter("Interruptible2", "Buyer"); - } - - protected void testMonitorExporter(String name, String role) { - - try { - String path="scribble/examples/"+name+"_"+role+".scr"; - - java.net.URL scrurl=ClassLoader.getSystemResource(path); - java.io.File scrFile=new java.io.File(scrurl.getFile()); - java.io.InputStream is=new java.io.FileInputStream(scrFile); - - java.net.URL url=ClassLoader.getSystemResource("scribble"); - java.io.File f=new java.io.File(url.getFile()); - - ProtocolParser pp=new ProtocolParser(); - - TestIssueLogger logger=new TestIssueLogger(); - - DirectoryResourceLocator locator=new DirectoryResourceLocator(f.getParentFile().getAbsolutePath()); - - ProtocolModuleLoader loader=new ProtocolModuleLoader(pp, locator, logger); - - InputStreamResource isr=new InputStreamResource(path, is); - - Module module=pp.parse(isr, loader, logger); - - if (module == null) { - fail("Module is null"); - } - - if (logger.isErrorsOrWarnings()) { - fail("Unexpected errors and/or warnings in "+name+"_"+role+".scr"); - } - - // Get first local protocol - LProtocolDefinition lp=(LProtocolDefinition)module.getProtocols().get(0); - - MonitorExporter exporter=new MonitorExporter(); - - DefaultModuleContext context=new DefaultModuleContext(isr, lp.getModule(), loader); - - SessionType type=exporter.export(context, lp); - - is = ClassLoader.getSystemResourceAsStream("scribble/examples/"+name+"_"+role+".monitor"); - - byte[] b=new byte[is.available()]; - is.read(b); - - is.close(); - - ObjectMapper mapper=new ObjectMapper(); - - SerializationConfig config=mapper.getSerializationConfig() - .withSerializationInclusion(JsonSerialize.Inclusion.NON_NULL) - .withSerializationInclusion(JsonSerialize.Inclusion.NON_DEFAULT); - - mapper.setSerializationConfig(config); - - mapper.configure(Feature.SORT_PROPERTIES_ALPHABETICALLY, true); - mapper.configure(SerializationConfig.Feature.WRITE_EMPTY_JSON_ARRAYS, false); - - String monitor=mapper.writeValueAsString(type); - String expecting=new String(b).trim(); - - if (!monitor.equals(expecting)) { - int len=monitor.length(); - if (len > expecting.length()) { - len = expecting.length(); - } - for (int i=0; i < len; i++) { - if (monitor.charAt(i) != expecting.charAt(i)) { - System.out.println("DIFF AT POSITION: "+i); - int showto=i+30; - if (i+10 >= len) { - showto = len; - } - System.out.println("EXPORTED: "+monitor.substring(i, showto)); - System.out.println("EXPECTED: "+expecting.substring(i, showto)); - break; - } - } - - System.err.println("Exported monitor representation '"+name+ - "_"+role+"' mismatch\nExpecting:\n"+expecting+"\nExported:\n"+monitor); - fail("Monitor export '"+name+"_"+role+"' mismatch"); - } - - } catch (Exception e) { - e.printStackTrace(); - fail("Failed to export monitor '"+name+"_"+role+".scr'"); - } - } - - protected class TestIssueLogger extends ConsoleIssueLogger { - - private java.util.List _errors=new java.util.ArrayList(); - private java.util.List _warnings=new java.util.ArrayList(); - - public void error(String issue, Map props) { - super.error(issue, props); - _errors.add(issue); - } - - public void warning(String issue, Map props) { - super.warning(issue, props); - _warnings.add(issue); - } - - public void info(String issue, Map props) { - super.info(issue, props); - } - - public boolean isErrorsOrWarnings() { - return (_errors.size() > 0 || _warnings.size() > 0); - } - } -} diff --git a/modules/monitor/src/test/java/org/scribble/monitor/runtime/DefaultMonitorTest.java b/modules/monitor/src/test/java/org/scribble/monitor/runtime/DefaultMonitorTest.java deleted file mode 100644 index 4b603b1e8..000000000 --- a/modules/monitor/src/test/java/org/scribble/monitor/runtime/DefaultMonitorTest.java +++ /dev/null @@ -1,1851 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.monitor.runtime; - -import static org.junit.Assert.*; - -import org.junit.Test; -import org.scribble.monitor.model.Choice; -import org.scribble.monitor.model.Continue; -import org.scribble.monitor.model.Do; -import org.scribble.monitor.model.Interruptible; -import org.scribble.monitor.model.Parallel; -import org.scribble.monitor.model.Receive; -import org.scribble.monitor.model.Recursion; -import org.scribble.monitor.model.Send; -import org.scribble.monitor.model.SessionType; -import org.scribble.monitor.model.Parameter; -import org.scribble.monitor.runtime.DefaultMonitor; -import org.scribble.monitor.runtime.MonitorMessage; -import org.scribble.monitor.runtime.Monitor; -import org.scribble.monitor.runtime.SessionInstance; - -public class DefaultMonitorTest { - - private static final String ROLE1 = "Role1"; - private static final String ROLE2 = "Role2"; - private static final String OP1 = "op1"; - private static final String OP2 = "op2"; - private static final String OP3 = "op3"; - private static final String OP4 = "op4"; - private static final String OP5 = "op5"; - - private static final String TYPE1 = "type1"; - private static final String TYPE2 = "type2"; - private static final String TYPE3 = "type3"; - private static final String TYPE4 = "type4"; - private static final String TYPE5 = "type5"; - - @Test - public void testRequestResponse() { - Monitor monitor=new DefaultMonitor(); - - SessionType type=new SessionType(); - - Send s1=new Send(); - s1.setOperator(OP1); - s1.getParameters().add(new Parameter(TYPE1)); - s1.setToRole(ROLE1); - s1.setNext(1); - - type.getNodes().add(s1); - - Receive r1=new Receive(); - r1.setOperator(OP2); - r1.getParameters().add(new Parameter(TYPE2)); - r1.setFromRole(ROLE1); - - type.getNodes().add(r1); - - SessionInstance instance=new SessionInstance(); - - monitor.initializeInstance(type, instance); - - MonitorMessage m1=new MonitorMessage(); - m1.setOperator(OP1); - m1.getTypes().add(TYPE1); - - MonitorMessage m2=new MonitorMessage(); - m2.setOperator(OP2); - m2.getTypes().add(TYPE2); - - if (!monitor.sent(type, instance, m1, null)) { - fail("Sent message not expected"); - } - - if (!monitor.received(type, instance, m2, null)) { - fail("Received message not expected"); - } - - if (!instance.hasCompleted()) { - fail("Session hasn't completed"); - } - } - - @Test - public void testRequestResponseWithRoles() { - Monitor monitor=new DefaultMonitor(); - - SessionType type=new SessionType(); - - Send s1=new Send(); - s1.setOperator(OP1); - s1.getParameters().add(new Parameter(TYPE1)); - s1.setToRole(ROLE1); - s1.setNext(1); - - type.getNodes().add(s1); - - Receive r1=new Receive(); - r1.setOperator(OP2); - r1.getParameters().add(new Parameter(TYPE2)); - r1.setFromRole(ROLE1); - - type.getNodes().add(r1); - - SessionInstance instance=new SessionInstance(); - - monitor.initializeInstance(type, instance); - - MonitorMessage m1=new MonitorMessage(); - m1.setOperator(OP1); - m1.getTypes().add(TYPE1); - - MonitorMessage m2=new MonitorMessage(); - m2.setOperator(OP2); - m2.getTypes().add(TYPE2); - - if (!monitor.sent(type, instance, m1, ROLE1)) { - fail("Sent message not expected"); - } - - if (monitor.received(type, instance, m2, ROLE2)) { - fail("Receive should be invalid, as from wrong role"); - } - - if (!monitor.received(type, instance, m2, ROLE1)) { - fail("Received message not expected"); - } - - if (!instance.hasCompleted()) { - fail("Session hasn't completed"); - } - } - - @Test - public void testRequestResponseParallel1() { - Monitor monitor=new DefaultMonitor(); - - SessionType type=new SessionType(); - - Send s1=new Send(); - s1.setOperator(OP1); - s1.getParameters().add(new Parameter(TYPE1)); - s1.setNext(1); - - type.getNodes().add(s1); - - Parallel par=new Parallel(); - par.getPathIndexes().add(2); - par.getPathIndexes().add(3); - - type.getNodes().add(par); - - Receive r1=new Receive(); - r1.setOperator(OP2); - r1.getParameters().add(new Parameter(TYPE2)); - - type.getNodes().add(r1); - - Receive r2=new Receive(); - r2.setOperator(OP3); - r2.getParameters().add(new Parameter(TYPE3)); - - type.getNodes().add(r2); - - SessionInstance instance=new SessionInstance(); - - monitor.initializeInstance(type, instance); - - MonitorMessage m1=new MonitorMessage(); - m1.setOperator(OP1); - m1.getTypes().add(TYPE1); - - MonitorMessage m2=new MonitorMessage(); - m2.setOperator(OP2); - m2.getTypes().add(TYPE2); - - MonitorMessage m3=new MonitorMessage(); - m3.setOperator(OP3); - m3.getTypes().add(TYPE3); - - if (!monitor.sent(type, instance, m1, null)) { - fail("Sent message 1 not expected"); - } - - if (!monitor.received(type, instance, m2, null)) { - fail("Received message 2 not expected"); - } - - if (instance.hasCompleted()) { - fail("Session shouldn't have completed"); - } - - if (!monitor.received(type, instance, m3, null)) { - fail("Received message 3 not expected"); - } - - if (!instance.hasCompleted()) { - fail("Session hasn't completed"); - } - } - - @Test - public void testRequestResponseParallel2() { - Monitor monitor=new DefaultMonitor(); - - SessionType type=new SessionType(); - - Send s1=new Send(); - s1.setOperator(OP1); - s1.getParameters().add(new Parameter(TYPE1)); - s1.setNext(1); - - type.getNodes().add(s1); - - Parallel par=new Parallel(); - par.getPathIndexes().add(2); - par.getPathIndexes().add(3); - - type.getNodes().add(par); - - Receive r1=new Receive(); - r1.setOperator(OP2); - r1.getParameters().add(new Parameter(TYPE2)); - - type.getNodes().add(r1); - - Receive r2=new Receive(); - r2.setOperator(OP3); - r2.getParameters().add(new Parameter(TYPE3)); - - type.getNodes().add(r2); - - SessionInstance instance=new SessionInstance(); - - monitor.initializeInstance(type, instance); - - MonitorMessage m1=new MonitorMessage(); - m1.setOperator(OP1); - m1.getTypes().add(TYPE1); - - MonitorMessage m2=new MonitorMessage(); - m2.setOperator(OP2); - m2.getTypes().add(TYPE2); - - MonitorMessage m3=new MonitorMessage(); - m3.setOperator(OP3); - m3.getTypes().add(TYPE3); - - if (!monitor.sent(type, instance, m1, null)) { - fail("Sent message 1 not expected"); - } - - if (!monitor.received(type, instance, m3, null)) { - fail("Received message 3 not expected"); - } - - if (instance.hasCompleted()) { - fail("Session shouldn't have completed"); - } - - if (!monitor.received(type, instance, m2, null)) { - fail("Received message 2 not expected"); - } - - if (!instance.hasCompleted()) { - fail("Session hasn't completed"); - } - } - - @Test - public void testRequestParallelFollowedBySend() { - Monitor monitor=new DefaultMonitor(); - - SessionType type=new SessionType(); - - Send s1=new Send(); - s1.setOperator(OP1); - s1.getParameters().add(new Parameter(TYPE1)); - s1.setNext(1); - - type.getNodes().add(s1); - - Parallel par=new Parallel(); - par.setNext(4); - par.getPathIndexes().add(2); - par.getPathIndexes().add(3); - - type.getNodes().add(par); - - Receive r1=new Receive(); - r1.setOperator(OP2); - r1.getParameters().add(new Parameter(TYPE2)); - - type.getNodes().add(r1); - - Receive r2=new Receive(); - r2.setOperator(OP3); - r2.getParameters().add(new Parameter(TYPE3)); - - type.getNodes().add(r2); - - Send s2=new Send(); - s2.setOperator(OP4); - s2.getParameters().add(new Parameter(TYPE4)); - - type.getNodes().add(s2); - - SessionInstance instance=new SessionInstance(); - - monitor.initializeInstance(type, instance); - - MonitorMessage m1=new MonitorMessage(); - m1.setOperator(OP1); - m1.getTypes().add(TYPE1); - - MonitorMessage m2=new MonitorMessage(); - m2.setOperator(OP2); - m2.getTypes().add(TYPE2); - - MonitorMessage m3=new MonitorMessage(); - m3.setOperator(OP3); - m3.getTypes().add(TYPE3); - - MonitorMessage m4=new MonitorMessage(); - m4.setOperator(OP4); - m4.getTypes().add(TYPE4); - - if (!monitor.sent(type, instance, m1, null)) { - fail("Sent message 1 not expected"); - } - - if (!monitor.received(type, instance, m2, null)) { - fail("Received message 2 not expected"); - } - - if (instance.hasCompleted()) { - fail("Session shouldn't have completed"); - } - - if (!monitor.received(type, instance, m3, null)) { - fail("Received message 3 not expected"); - } - - if (!monitor.sent(type, instance, m4, null)) { - fail("Sent message 4 not expected"); - } - - if (!instance.hasCompleted()) { - fail("Session hasn't completed"); - } - } - - @Test - public void testRequestResponseChoice1() { - Monitor monitor=new DefaultMonitor(); - - SessionType type=new SessionType(); - - Send s1=new Send(); - s1.setOperator(OP1); - s1.getParameters().add(new Parameter(TYPE1)); - s1.setNext(1); - - type.getNodes().add(s1); - - Choice ch=new Choice(); - ch.getPathIndexes().add(2); - ch.getPathIndexes().add(3); - - type.getNodes().add(ch); - - Receive r1=new Receive(); - r1.setOperator(OP2); - r1.getParameters().add(new Parameter(TYPE2)); - - type.getNodes().add(r1); - - Receive r2=new Receive(); - r2.setOperator(OP3); - r2.getParameters().add(new Parameter(TYPE3)); - - type.getNodes().add(r2); - - SessionInstance instance=new SessionInstance(); - - monitor.initializeInstance(type, instance); - - MonitorMessage m1=new MonitorMessage(); - m1.setOperator(OP1); - m1.getTypes().add(TYPE1); - - MonitorMessage m2=new MonitorMessage(); - m2.setOperator(OP2); - m2.getTypes().add(TYPE2); - - if (!monitor.sent(type, instance, m1, null)) { - fail("Sent message not expected"); - } - - if (!monitor.received(type, instance, m2, null)) { - fail("Received message 2 not expected"); - } - - if (!instance.hasCompleted()) { - fail("Session hasn't completed"); - } - } - - @Test - public void testRequestResponseChoice2() { - Monitor monitor=new DefaultMonitor(); - - SessionType type=new SessionType(); - - Send s1=new Send(); - s1.setOperator(OP1); - s1.getParameters().add(new Parameter(TYPE1)); - s1.setNext(1); - - type.getNodes().add(s1); - - Choice ch=new Choice(); - ch.getPathIndexes().add(2); - ch.getPathIndexes().add(3); - - type.getNodes().add(ch); - - Receive r1=new Receive(); - r1.setOperator(OP2); - r1.getParameters().add(new Parameter(TYPE2)); - - type.getNodes().add(r1); - - Receive r2=new Receive(); - r2.setOperator(OP3); - r2.getParameters().add(new Parameter(TYPE3)); - - type.getNodes().add(r2); - - SessionInstance instance=new SessionInstance(); - - monitor.initializeInstance(type, instance); - - MonitorMessage m1=new MonitorMessage(); - m1.setOperator(OP1); - m1.getTypes().add(TYPE1); - - MonitorMessage m3=new MonitorMessage(); - m3.setOperator(OP3); - m3.getTypes().add(TYPE3); - - if (!monitor.sent(type, instance, m1, null)) { - fail("Sent message not expected"); - } - - if (!monitor.received(type, instance, m3, null)) { - fail("Received message 3 not expected"); - } - - if (!instance.hasCompleted()) { - fail("Session hasn't completed"); - } - } - - @Test - public void testRequestChoiceFollowedBySend() { - Monitor monitor=new DefaultMonitor(); - - SessionType type=new SessionType(); - - Send s1=new Send(); - s1.setOperator(OP1); - s1.getParameters().add(new Parameter(TYPE1)); - s1.setNext(1); - - type.getNodes().add(s1); - - Choice ch=new Choice(); - ch.setNext(4); - ch.getPathIndexes().add(2); - ch.getPathIndexes().add(3); - - type.getNodes().add(ch); - - Receive r1=new Receive(); - r1.setOperator(OP2); - r1.getParameters().add(new Parameter(TYPE2)); - - type.getNodes().add(r1); - - Receive r2=new Receive(); - r2.setOperator(OP3); - r2.getParameters().add(new Parameter(TYPE3)); - - type.getNodes().add(r2); - - Send s2=new Send(); - s2.setOperator(OP4); - s2.getParameters().add(new Parameter(TYPE4)); - - type.getNodes().add(s2); - - SessionInstance instance=new SessionInstance(); - - monitor.initializeInstance(type, instance); - - MonitorMessage m1=new MonitorMessage(); - m1.setOperator(OP1); - m1.getTypes().add(TYPE1); - - MonitorMessage m2=new MonitorMessage(); - m2.setOperator(OP2); - m2.getTypes().add(TYPE2); - - MonitorMessage m3=new MonitorMessage(); - m3.setOperator(OP4); - m3.getTypes().add(TYPE4); - - if (!monitor.sent(type, instance, m1, null)) { - fail("Sent message 1 not expected"); - } - - if (!monitor.received(type, instance, m2, null)) { - fail("Received message 2 not expected"); - } - - if (!monitor.sent(type, instance, m3, null)) { - fail("Sent message 4 not expected"); - } - - if (!instance.hasCompleted()) { - fail("Session hasn't completed"); - } - } - - protected SessionType getParallelOnly() { - SessionType type=new SessionType(); - - // 0 - Parallel par=new Parallel(); - par.getPathIndexes().add(1); - par.getPathIndexes().add(2); - - type.getNodes().add(par); - - // 1 - Receive r1=new Receive(); - r1.setOperator(OP2); - r1.getParameters().add(new Parameter(TYPE2)); - - type.getNodes().add(r1); - - // 2 - Send s2=new Send(); - s2.setOperator(OP5); - s2.getParameters().add(new Parameter(TYPE5)); - - type.getNodes().add(s2); - - return (type); - } - - @Test - public void testParallelOnly() { - Monitor monitor=new DefaultMonitor(); - - SessionType type=getParallelOnly(); - - SessionInstance instance=new SessionInstance(); - - monitor.initializeInstance(type, instance); - - MonitorMessage m2=new MonitorMessage(); - m2.setOperator(OP2); - m2.getTypes().add(TYPE2); - - MonitorMessage m5=new MonitorMessage(); - m5.setOperator(OP5); - m5.getTypes().add(TYPE5); - - if (!monitor.received(type, instance, m2, null)) { - fail("Received message 2 not expected"); - } - - if (!monitor.sent(type, instance, m5, null)) { - fail("Sent message 5 not expected"); - } - - if (!instance.hasCompleted()) { - fail("Session hasn't completed"); - } - } - - protected SessionType getParallelChoiceFollowedBySend() { - SessionType type=new SessionType(); - - // 0 - Send s1=new Send(); - s1.setOperator(OP1); - s1.getParameters().add(new Parameter(TYPE1)); - s1.setNext(1); - - type.getNodes().add(s1); - - // 1 - Parallel par=new Parallel(); - par.setNext(6); - par.getPathIndexes().add(2); - par.getPathIndexes().add(3); - - type.getNodes().add(par); - - // 2 - Receive r1=new Receive(); - r1.setOperator(OP2); - r1.getParameters().add(new Parameter(TYPE2)); - - type.getNodes().add(r1); - - // 3 - Choice ch=new Choice(); - ch.getPathIndexes().add(4); - ch.getPathIndexes().add(5); - - type.getNodes().add(ch); - - // 4 - Receive r2=new Receive(); - r2.setOperator(OP3); - r2.getParameters().add(new Parameter(TYPE3)); - - type.getNodes().add(r2); - - // 5 - Receive r3=new Receive(); - r3.setOperator(OP4); - r3.getParameters().add(new Parameter(TYPE4)); - - type.getNodes().add(r3); - - // 6 - Send s2=new Send(); - s2.setOperator(OP5); - s2.getParameters().add(new Parameter(TYPE5)); - - type.getNodes().add(s2); - - return (type); - } - - @Test - public void testRequestParallelChoiceFollowedBySend1() { - Monitor monitor=new DefaultMonitor(); - - SessionType type=getParallelChoiceFollowedBySend(); - - SessionInstance instance=new SessionInstance(); - - monitor.initializeInstance(type, instance); - - MonitorMessage m1=new MonitorMessage(); - m1.setOperator(OP1); - m1.getTypes().add(TYPE1); - - MonitorMessage m2=new MonitorMessage(); - m2.setOperator(OP2); - m2.getTypes().add(TYPE2); - - MonitorMessage m3=new MonitorMessage(); - m3.setOperator(OP3); - m3.getTypes().add(TYPE3); - - MonitorMessage m4=new MonitorMessage(); - m4.setOperator(OP4); - m4.getTypes().add(TYPE4); - - MonitorMessage m5=new MonitorMessage(); - m5.setOperator(OP5); - m5.getTypes().add(TYPE5); - - if (!monitor.sent(type, instance, m1, null)) { - fail("Sent message 1 not expected"); - } - - if (!monitor.received(type, instance, m2, null)) { - fail("Received message 2 not expected"); - } - - if (!monitor.received(type, instance, m3, null)) { - fail("Received message 3 not expected"); - } - - if (!monitor.sent(type, instance, m5, null)) { - fail("Sent message 5 not expected"); - } - - if (!instance.hasCompleted()) { - fail("Session hasn't completed"); - } - } - - @Test - public void testRequestParallelChoiceFollowedBySend2() { - Monitor monitor=new DefaultMonitor(); - - SessionType type=getParallelChoiceFollowedBySend(); - - SessionInstance instance=new SessionInstance(); - - monitor.initializeInstance(type, instance); - - MonitorMessage m1=new MonitorMessage(); - m1.setOperator(OP1); - m1.getTypes().add(TYPE1); - - MonitorMessage m2=new MonitorMessage(); - m2.setOperator(OP2); - m2.getTypes().add(TYPE2); - - MonitorMessage m3=new MonitorMessage(); - m3.setOperator(OP3); - m3.getTypes().add(TYPE3); - - MonitorMessage m4=new MonitorMessage(); - m4.setOperator(OP4); - m4.getTypes().add(TYPE4); - - MonitorMessage m5=new MonitorMessage(); - m5.setOperator(OP5); - m5.getTypes().add(TYPE5); - - if (!monitor.sent(type, instance, m1, null)) { - fail("Sent message 1 not expected"); - } - - if (!monitor.received(type, instance, m2, null)) { - fail("Received message 2 not expected"); - } - - if (!monitor.received(type, instance, m4, null)) { - fail("Received message 4 not expected"); - } - - if (!monitor.sent(type, instance, m5, null)) { - fail("Sent message 5 not expected"); - } - - if (!instance.hasCompleted()) { - fail("Session hasn't completed"); - } - } - - @Test - public void testRequestParallelChoiceFollowedBySend3() { - Monitor monitor=new DefaultMonitor(); - - SessionType type=getParallelChoiceFollowedBySend(); - - SessionInstance instance=new SessionInstance(); - - monitor.initializeInstance(type, instance); - - MonitorMessage m1=new MonitorMessage(); - m1.setOperator(OP1); - m1.getTypes().add(TYPE1); - - MonitorMessage m2=new MonitorMessage(); - m2.setOperator(OP2); - m2.getTypes().add(TYPE2); - - MonitorMessage m3=new MonitorMessage(); - m3.setOperator(OP3); - m3.getTypes().add(TYPE3); - - MonitorMessage m4=new MonitorMessage(); - m4.setOperator(OP4); - m4.getTypes().add(TYPE4); - - MonitorMessage m5=new MonitorMessage(); - m5.setOperator(OP5); - m5.getTypes().add(TYPE5); - - if (!monitor.sent(type, instance, m1, null)) { - fail("Sent message 1 not expected"); - } - - if (!monitor.received(type, instance, m4, null)) { - fail("Received message 4 not expected"); - } - - if (!monitor.received(type, instance, m2, null)) { - fail("Received message 2 not expected"); - } - - if (!monitor.sent(type, instance, m5, null)) { - fail("Sent message 5 not expected"); - } - - if (!instance.hasCompleted()) { - fail("Session hasn't completed"); - } - } - - @Test - public void testRequestParallelChoiceFollowedBySend4() { - Monitor monitor=new DefaultMonitor(); - - SessionType type=getParallelChoiceFollowedBySend(); - - SessionInstance instance=new SessionInstance(); - - monitor.initializeInstance(type, instance); - - MonitorMessage m1=new MonitorMessage(); - m1.setOperator(OP1); - m1.getTypes().add(TYPE1); - - MonitorMessage m2=new MonitorMessage(); - m2.setOperator(OP2); - m2.getTypes().add(TYPE2); - - MonitorMessage m3=new MonitorMessage(); - m3.setOperator(OP3); - m3.getTypes().add(TYPE3); - - MonitorMessage m4=new MonitorMessage(); - m4.setOperator(OP4); - m4.getTypes().add(TYPE4); - - MonitorMessage m5=new MonitorMessage(); - m5.setOperator(OP5); - m5.getTypes().add(TYPE5); - - if (!monitor.sent(type, instance, m1, null)) { - fail("Sent message 1 not expected"); - } - - if (!monitor.received(type, instance, m3, null)) { - fail("Received message 3 not expected"); - } - - if (!monitor.received(type, instance, m2, null)) { - fail("Received message 2 not expected"); - } - - if (!monitor.sent(type, instance, m5, null)) { - fail("Sent message 5 not expected"); - } - - if (!instance.hasCompleted()) { - fail("Session hasn't completed"); - } - } - - protected SessionType getChoiceParallelFollowedBySend() { - SessionType type=new SessionType(); - - // 0 - Send s1=new Send(); - s1.setOperator(OP1); - s1.getParameters().add(new Parameter(TYPE1)); - s1.setNext(1); - - type.getNodes().add(s1); - - // 1 - Choice ch=new Choice(); - ch.setNext(6); - ch.getPathIndexes().add(2); - ch.getPathIndexes().add(3); - - type.getNodes().add(ch); - - // 2 - Receive r1=new Receive(); - r1.setOperator(OP2); - r1.getParameters().add(new Parameter(TYPE2)); - - type.getNodes().add(r1); - - // 3 - Parallel par=new Parallel(); - par.getPathIndexes().add(4); - par.getPathIndexes().add(5); - - type.getNodes().add(par); - - // 4 - Receive r2=new Receive(); - r2.setOperator(OP3); - r2.getParameters().add(new Parameter(TYPE3)); - - type.getNodes().add(r2); - - // 5 - Receive r3=new Receive(); - r3.setOperator(OP4); - r3.getParameters().add(new Parameter(TYPE4)); - - type.getNodes().add(r3); - - // 6 - Send s2=new Send(); - s2.setOperator(OP5); - s2.getParameters().add(new Parameter(TYPE5)); - - type.getNodes().add(s2); - - return (type); - } - - @Test - public void testRequestChoiceParallelFollowedBySend1() { - Monitor monitor=new DefaultMonitor(); - - SessionType type=getChoiceParallelFollowedBySend(); - - SessionInstance instance=new SessionInstance(); - - monitor.initializeInstance(type, instance); - - MonitorMessage m1=new MonitorMessage(); - m1.setOperator(OP1); - m1.getTypes().add(TYPE1); - - MonitorMessage m2=new MonitorMessage(); - m2.setOperator(OP2); - m2.getTypes().add(TYPE2); - - MonitorMessage m3=new MonitorMessage(); - m3.setOperator(OP3); - m3.getTypes().add(TYPE3); - - MonitorMessage m4=new MonitorMessage(); - m4.setOperator(OP4); - m4.getTypes().add(TYPE4); - - MonitorMessage m5=new MonitorMessage(); - m5.setOperator(OP5); - m5.getTypes().add(TYPE5); - - if (!monitor.sent(type, instance, m1, null)) { - fail("Sent message 1 not expected"); - } - - if (!monitor.received(type, instance, m4, null)) { - fail("Received message 4 not expected"); - } - - if (!monitor.received(type, instance, m3, null)) { - fail("Received message 3 not expected"); - } - - if (!monitor.sent(type, instance, m5, null)) { - fail("Sent message 5 not expected"); - } - - if (!instance.hasCompleted()) { - fail("Session hasn't completed"); - } - } - - @Test - public void testRequestChoiceParallelFollowedBySend2() { - Monitor monitor=new DefaultMonitor(); - - SessionType type=getChoiceParallelFollowedBySend(); - - SessionInstance instance=new SessionInstance(); - - monitor.initializeInstance(type, instance); - - MonitorMessage m1=new MonitorMessage(); - m1.setOperator(OP1); - m1.getTypes().add(TYPE1); - - MonitorMessage m2=new MonitorMessage(); - m2.setOperator(OP2); - m2.getTypes().add(TYPE2); - - MonitorMessage m3=new MonitorMessage(); - m3.setOperator(OP3); - m3.getTypes().add(TYPE3); - - MonitorMessage m4=new MonitorMessage(); - m4.setOperator(OP4); - m4.getTypes().add(TYPE4); - - MonitorMessage m5=new MonitorMessage(); - m5.setOperator(OP5); - m5.getTypes().add(TYPE5); - - if (!monitor.sent(type, instance, m1, null)) { - fail("Sent message 1 not expected"); - } - - if (!monitor.received(type, instance, m3, null)) { - fail("Received message 3 not expected"); - } - - if (!monitor.received(type, instance, m4, null)) { - fail("Received message 4 not expected"); - } - - if (!monitor.sent(type, instance, m5, null)) { - fail("Sent message 5 not expected"); - } - - if (!instance.hasCompleted()) { - fail("Session hasn't completed"); - } - } - - @Test - public void testRequestChoiceParallelFollowedBySend3() { - Monitor monitor=new DefaultMonitor(); - - SessionType type=getChoiceParallelFollowedBySend(); - - SessionInstance instance=new SessionInstance(); - - monitor.initializeInstance(type, instance); - - MonitorMessage m1=new MonitorMessage(); - m1.setOperator(OP1); - m1.getTypes().add(TYPE1); - - MonitorMessage m2=new MonitorMessage(); - m2.setOperator(OP2); - m2.getTypes().add(TYPE2); - - MonitorMessage m3=new MonitorMessage(); - m3.setOperator(OP3); - m3.getTypes().add(TYPE3); - - MonitorMessage m4=new MonitorMessage(); - m4.setOperator(OP4); - m4.getTypes().add(TYPE4); - - MonitorMessage m5=new MonitorMessage(); - m5.setOperator(OP5); - m5.getTypes().add(TYPE5); - - if (!monitor.sent(type, instance, m1, null)) { - fail("Sent message 1 not expected"); - } - - if (!monitor.received(type, instance, m2, null)) { - fail("Received message 2 not expected"); - } - - if (!monitor.sent(type, instance, m5, null)) { - fail("Sent message 5 not expected"); - } - - if (!instance.hasCompleted()) { - fail("Session hasn't completed"); - } - } - - @Test - public void testDo() { - Monitor monitor=new DefaultMonitor(); - - SessionType type=new SessionType(); - - Send s1=new Send(); - s1.setOperator(OP1); - s1.getParameters().add(new Parameter(TYPE1)); - s1.setNext(1); - - type.getNodes().add(s1); - - Do d1=new Do(); - d1.setNext(3); - d1.setProtocolIndex(2); - - type.getNodes().add(d1); - - Receive r1=new Receive(); - r1.setOperator(OP2); - r1.getParameters().add(new Parameter(TYPE2)); - - type.getNodes().add(r1); - - Send s2=new Send(); - s2.setOperator(OP3); - s2.getParameters().add(new Parameter(TYPE3)); - - type.getNodes().add(s2); - - SessionInstance instance=new SessionInstance(); - - monitor.initializeInstance(type, instance); - - MonitorMessage m1=new MonitorMessage(); - m1.setOperator(OP1); - m1.getTypes().add(TYPE1); - - MonitorMessage m2=new MonitorMessage(); - m2.setOperator(OP2); - m2.getTypes().add(TYPE2); - - MonitorMessage m3=new MonitorMessage(); - m3.setOperator(OP3); - m3.getTypes().add(TYPE3); - - if (!monitor.sent(type, instance, m1, null)) { - fail("Sent message 1 not expected"); - } - - if (!monitor.received(type, instance, m2, null)) { - fail("Received message 2 not expected"); - } - - if (!monitor.sent(type, instance, m3, null)) { - fail("Sent message 3 not expected"); - } - - if (!instance.hasCompleted()) { - fail("Session hasn't completed"); - } - } - - @Test - public void testRecursionChoiceContinue() { - Monitor monitor=new DefaultMonitor(); - - SessionType type=new SessionType(); - - Send s1=new Send(); - s1.setOperator(OP1); - s1.getParameters().add(new Parameter(TYPE1)); - s1.setNext(1); - - type.getNodes().add(s1); - - Recursion rec=new Recursion(); - rec.setNext(6); - rec.setBlockIndex(2); - - type.getNodes().add(rec); - - Choice ch=new Choice(); - ch.getPathIndexes().add(3); - ch.getPathIndexes().add(5); - - type.getNodes().add(ch); - - Receive r1=new Receive(); - r1.setNext(4); - r1.setOperator(OP2); - r1.getParameters().add(new Parameter(TYPE2)); - - type.getNodes().add(r1); - - Continue con1=new Continue(); - con1.setNext(2); - - type.getNodes().add(con1); - - Receive r2=new Receive(); - r2.setOperator(OP3); - r2.getParameters().add(new Parameter(TYPE3)); - - type.getNodes().add(r2); - - Send s2=new Send(); - s2.setOperator(OP4); - s2.getParameters().add(new Parameter(TYPE4)); - - type.getNodes().add(s2); - - SessionInstance instance=new SessionInstance(); - - monitor.initializeInstance(type, instance); - - MonitorMessage m1=new MonitorMessage(); - m1.setOperator(OP1); - m1.getTypes().add(TYPE1); - - MonitorMessage m2=new MonitorMessage(); - m2.setOperator(OP2); - m2.getTypes().add(TYPE2); - - MonitorMessage m3=new MonitorMessage(); - m3.setOperator(OP2); - m3.getTypes().add(TYPE2); - - MonitorMessage m4=new MonitorMessage(); - m4.setOperator(OP2); - m4.getTypes().add(TYPE2); - - MonitorMessage m5=new MonitorMessage(); - m5.setOperator(OP3); - m5.getTypes().add(TYPE3); - - MonitorMessage m6=new MonitorMessage(); - m6.setOperator(OP4); - m6.getTypes().add(TYPE4); - - if (!monitor.sent(type, instance, m1, null)) { - fail("Sent message 1 not expected"); - } - - if (!monitor.received(type, instance, m2, null)) { - fail("Received message 2 not expected"); - } - - if (!monitor.received(type, instance, m3, null)) { - fail("Received message 3 not expected"); - } - - if (!monitor.received(type, instance, m4, null)) { - fail("Received message 4 not expected"); - } - - if (!monitor.received(type, instance, m5, null)) { - fail("Received message 5 not expected"); - } - - if (!monitor.sent(type, instance, m6, null)) { - fail("Sent message 6 not expected"); - } - - if (!instance.hasCompleted()) { - fail("Session hasn't completed"); - } - } - - @Test - public void testRecursionParChoiceContinue() { - Monitor monitor=new DefaultMonitor(); - - /* - // Do While Loop - - send op1(type1) - rec X { - par { - choice A { - // do again - receive op2(type2) - continue X; - } or { - // end actions - receive op3(type3) - } - } and { - // concurrent actions - receive op4(type4) - } - } - send op5(type5) - */ - - SessionType type=new SessionType(); - - // 0 - Send s1=new Send(); - s1.setOperator(OP1); - s1.getParameters().add(new Parameter(TYPE1)); - s1.setNext(1); - - type.getNodes().add(s1); - - // 1 - Recursion rec=new Recursion(); - rec.setNext(8); - rec.setBlockIndex(2); - - type.getNodes().add(rec); - - // 2 - Parallel par=new Parallel(); - par.getPathIndexes().add(3); - par.getPathIndexes().add(7); - - type.getNodes().add(par); - - // 3 - Choice ch=new Choice(); - ch.getPathIndexes().add(4); - ch.getPathIndexes().add(6); - - type.getNodes().add(ch); - - // 4 - Receive r1=new Receive(); - r1.setNext(5); - r1.setOperator(OP2); - r1.getParameters().add(new Parameter(TYPE2)); - - type.getNodes().add(r1); - - // 5 - Continue con1=new Continue(); - con1.setNext(2); - - type.getNodes().add(con1); - - // 6 - Receive r2=new Receive(); - r2.setOperator(OP3); - r2.getParameters().add(new Parameter(TYPE3)); - - type.getNodes().add(r2); - - // 7 - Receive r3=new Receive(); - r3.setOperator(OP4); - r3.getParameters().add(new Parameter(TYPE4)); - - type.getNodes().add(r3); - - // 8 - Send s2=new Send(); - s2.setOperator(OP5); - s2.getParameters().add(new Parameter(TYPE5)); - - type.getNodes().add(s2); - - - SessionInstance instance=new SessionInstance(); - - monitor.initializeInstance(type, instance); - - MonitorMessage m1=new MonitorMessage(); - m1.setOperator(OP1); - m1.getTypes().add(TYPE1); - - MonitorMessage m2=new MonitorMessage(); - m2.setOperator(OP4); - m2.getTypes().add(TYPE4); - - MonitorMessage m3=new MonitorMessage(); - m3.setOperator(OP2); - m3.getTypes().add(TYPE2); - - MonitorMessage m4=new MonitorMessage(); - m4.setOperator(OP4); - m4.getTypes().add(TYPE4); - - MonitorMessage m5=new MonitorMessage(); - m5.setOperator(OP3); - m5.getTypes().add(TYPE3); - - MonitorMessage m6=new MonitorMessage(); - m6.setOperator(OP5); - m6.getTypes().add(TYPE5); - - if (!monitor.sent(type, instance, m1, null)) { - fail("Sent message 1 not expected"); - } - - if (!monitor.received(type, instance, m2, null)) { - fail("Received message 2 not expected"); - } - - if (!monitor.received(type, instance, m3, null)) { - fail("Received message 3 not expected"); - } - - if (!monitor.received(type, instance, m4, null)) { - fail("Received message 4 not expected"); - } - - if (!monitor.received(type, instance, m5, null)) { - fail("Received message 5 not expected"); - } - - if (!monitor.sent(type, instance, m6, null)) { - fail("Sent message 6 not expected"); - } - - if (!instance.hasCompleted()) { - fail("Session hasn't completed"); - } - } - - /* - // While Loop - rec X { - choice A { - end activities - } or { - par { - continue X; - } and { - concurrent activities; - } - } - */ - - protected SessionType getInterruptibleThrowSessionType() { - SessionType type=new SessionType(); - - Send s1=new Send(); - s1.setOperator(OP1); - s1.getParameters().add(new Parameter(TYPE1)); - s1.setToRole(ROLE1); - s1.setNext(1); - - type.getNodes().add(s1); - - // 1 - Interruptible i1=new Interruptible(); - i1.setBlockIndex(2); - - i1.setThrows(3); - i1.setNext(4); - - type.getNodes().add(i1); - - // 2 - Receive r1=new Receive(); - r1.setOperator(OP2); - r1.getParameters().add(new Parameter(TYPE2)); - r1.setFromRole(ROLE1); - - type.getNodes().add(r1); - - // 3 - Send throw1=new Send(); - throw1.setOperator(OP5); - throw1.getParameters().add(new Parameter(TYPE5)); - throw1.setToRole(ROLE1); - - type.getNodes().add(throw1); - - // 4 - Send s3=new Send(); - s3.setOperator(OP3); - s3.getParameters().add(new Parameter(TYPE3)); - s3.setToRole(ROLE1); - - type.getNodes().add(s3); - - - return (type); - } - - /** - * This test will use the normal path with no interrupt. - */ - @Test - public void testInterruptibleThrow1() { - Monitor monitor=new DefaultMonitor(); - - SessionType type=getInterruptibleThrowSessionType(); - - SessionInstance instance=new SessionInstance(); - - monitor.initializeInstance(type, instance); - - MonitorMessage m1=new MonitorMessage(); - m1.setOperator(OP1); - m1.getTypes().add(TYPE1); - - MonitorMessage m2=new MonitorMessage(); - m2.setOperator(OP2); - m2.getTypes().add(TYPE2); - - MonitorMessage m3=new MonitorMessage(); - m3.setOperator(OP3); - m3.getTypes().add(TYPE3); - - if (!monitor.sent(type, instance, m1, null)) { - fail("Sent message 1 not expected"); - } - - if (!monitor.received(type, instance, m2, null)) { - fail("Received message 2 not expected"); - } - - if (!monitor.sent(type, instance, m3, null)) { - fail("Sent message 3 not expected"); - } - - if (!instance.hasCompleted()) { - fail("Session hasn't completed"); - } - } - - /** - * This test will use the thrown interrupt path with no normal response. - */ - @Test - public void testInterruptibleThrow2() { - Monitor monitor=new DefaultMonitor(); - - SessionType type=getInterruptibleThrowSessionType(); - - SessionInstance instance=new SessionInstance(); - - monitor.initializeInstance(type, instance); - - MonitorMessage m1=new MonitorMessage(); - m1.setOperator(OP1); - m1.getTypes().add(TYPE1); - - // The interrupt MonitorMessage - MonitorMessage m5=new MonitorMessage(); - m5.setOperator(OP5); - m5.getTypes().add(TYPE5); - - MonitorMessage m3=new MonitorMessage(); - m3.setOperator(OP3); - m3.getTypes().add(TYPE3); - - if (!monitor.sent(type, instance, m1, null)) { - fail("Sent message 1 not expected"); - } - - if (!monitor.sent(type, instance, m5, null)) { - fail("Sent message 5 (thrown interrupt) not expected"); - } - - if (!monitor.sent(type, instance, m3, null)) { - fail("Sent message 3 not expected"); - } - - if (!instance.hasCompleted()) { - fail("Session hasn't completed"); - } - } - - /** - * This test will use the thrown interrupt path with normal response crossing. - */ - @Test - public void testInterruptibleThrow3() { - Monitor monitor=new DefaultMonitor(); - - SessionType type=getInterruptibleThrowSessionType(); - - SessionInstance instance=new SessionInstance(); - - monitor.initializeInstance(type, instance); - - MonitorMessage m1=new MonitorMessage(); - m1.setOperator(OP1); - m1.getTypes().add(TYPE1); - - MonitorMessage m2=new MonitorMessage(); - m2.setOperator(OP2); - m2.getTypes().add(TYPE2); - - // The interrupt MonitorMessage - MonitorMessage m5=new MonitorMessage(); - m5.setOperator(OP5); - m5.getTypes().add(TYPE5); - - MonitorMessage m3=new MonitorMessage(); - m3.setOperator(OP3); - m3.getTypes().add(TYPE3); - - if (!monitor.sent(type, instance, m1, null)) { - fail("Sent message 1 not expected"); - } - - if (!monitor.received(type, instance, m2, null)) { - fail("Received message 2 not expected"); - } - - if (monitor.sent(type, instance, m5, null)) { - fail("Sent message 5 (thrown interrupt) should not be expected"); - } - - if (!monitor.sent(type, instance, m3, null)) { - fail("Sent message 3 not expected"); - } - - if (!instance.hasCompleted()) { - fail("Session hasn't completed"); - } - } - - protected SessionType getInterruptibleCatchSessionType() { - SessionType type=new SessionType(); - - Send s1=new Send(); - s1.setOperator(OP1); - s1.getParameters().add(new Parameter(TYPE1)); - s1.setToRole(ROLE1); - s1.setNext(1); - - type.getNodes().add(s1); - - // 1 - Interruptible i1=new Interruptible(); - i1.setBlockIndex(2); - - i1.setCatches(3); - i1.setNext(4); - - type.getNodes().add(i1); - - // 2 - Send s2=new Send(); - s2.setOperator(OP2); - s2.getParameters().add(new Parameter(TYPE2)); - s2.setToRole(ROLE1); - - type.getNodes().add(s2); - - // 3 - Receive catch1=new Receive(); - catch1.setOperator(OP5); - catch1.getParameters().add(new Parameter(TYPE5)); - catch1.setFromRole(ROLE1); - - type.getNodes().add(catch1); - - // 4 - Send s3=new Send(); - s3.setOperator(OP3); - s3.getParameters().add(new Parameter(TYPE3)); - s3.setToRole(ROLE1); - - type.getNodes().add(s3); - - - return (type); - } - - /** - * This test will use the normal path with no interrupt. - */ - @Test - public void testInterruptibleCatch1() { - Monitor monitor=new DefaultMonitor(); - - SessionType type=getInterruptibleCatchSessionType(); - - SessionInstance instance=new SessionInstance(); - - monitor.initializeInstance(type, instance); - - MonitorMessage m1=new MonitorMessage(); - m1.setOperator(OP1); - m1.getTypes().add(TYPE1); - - MonitorMessage m2=new MonitorMessage(); - m2.setOperator(OP2); - m2.getTypes().add(TYPE2); - - MonitorMessage m3=new MonitorMessage(); - m3.setOperator(OP3); - m3.getTypes().add(TYPE3); - - if (!monitor.sent(type, instance, m1, null)) { - fail("Sent message 1 not expected"); - } - - if (!monitor.sent(type, instance, m2, null)) { - fail("Sent message 2 not expected"); - } - - if (!monitor.sent(type, instance, m3, null)) { - fail("Sent message 3 not expected"); - } - - if (!instance.hasCompleted()) { - fail("Session hasn't completed"); - } - } - - /** - * This test will use the catch interrupt path with no normal response. - */ - @Test - public void testInterruptibleCatch2() { - Monitor monitor=new DefaultMonitor(); - - SessionType type=getInterruptibleCatchSessionType(); - - SessionInstance instance=new SessionInstance(); - - monitor.initializeInstance(type, instance); - - MonitorMessage m1=new MonitorMessage(); - m1.setOperator(OP1); - m1.getTypes().add(TYPE1); - - // The interrupt MonitorMessage - MonitorMessage m5=new MonitorMessage(); - m5.setOperator(OP5); - m5.getTypes().add(TYPE5); - - MonitorMessage m3=new MonitorMessage(); - m3.setOperator(OP3); - m3.getTypes().add(TYPE3); - - if (!monitor.sent(type, instance, m1, null)) { - fail("Sent message 1 not expected"); - } - - if (!monitor.received(type, instance, m5, null)) { - fail("Received message 5 (caught interrupt) not expected"); - } - - if (!monitor.sent(type, instance, m3, null)) { - fail("Sent message 3 not expected"); - } - - if (!instance.hasCompleted()) { - fail("Session hasn't completed"); - } - } - - /** - * This test will use the caught interrupt path with normal response crossing. - */ - @Test - public void testInterruptibleCatch3() { - Monitor monitor=new DefaultMonitor(); - - SessionType type=getInterruptibleCatchSessionType(); - - SessionInstance instance=new SessionInstance(); - - monitor.initializeInstance(type, instance); - - MonitorMessage m1=new MonitorMessage(); - m1.setOperator(OP1); - m1.getTypes().add(TYPE1); - - MonitorMessage m2=new MonitorMessage(); - m2.setOperator(OP2); - m2.getTypes().add(TYPE2); - - // The interrupt MonitorMessage - MonitorMessage m5=new MonitorMessage(); - m5.setOperator(OP5); - m5.getTypes().add(TYPE5); - - MonitorMessage m3=new MonitorMessage(); - m3.setOperator(OP3); - m3.getTypes().add(TYPE3); - - if (!monitor.sent(type, instance, m1, null)) { - fail("Sent message 1 not expected"); - } - - if (!monitor.sent(type, instance, m2, null)) { - fail("Sent message 2 not expected"); - } - - if (monitor.received(type, instance, m5, null)) { - fail("Received message 5 (caught interrupt) should not be expected"); - } - - if (!monitor.sent(type, instance, m3, null)) { - fail("Sent message 3 not expected"); - } - - if (!instance.hasCompleted()) { - fail("Session hasn't completed"); - } - } - - @Test - public void testPerformance() { - Monitor monitor=new DefaultMonitor(); - - SessionType type=new SessionType(); - - Send s1=new Send(); - s1.setOperator(OP1); - s1.getParameters().add(new Parameter(TYPE1)); - s1.setNext(1); - - type.getNodes().add(s1); - - Choice ch=new Choice(); - ch.setNext(4); - ch.getPathIndexes().add(2); - ch.getPathIndexes().add(3); - - type.getNodes().add(ch); - - Receive r1=new Receive(); - r1.setOperator(OP2); - r1.getParameters().add(new Parameter(TYPE2)); - - type.getNodes().add(r1); - - Receive r2=new Receive(); - r2.setOperator(OP3); - r2.getParameters().add(new Parameter(TYPE3)); - - type.getNodes().add(r2); - - Send s2=new Send(); - s2.setOperator(OP4); - s2.getParameters().add(new Parameter(TYPE4)); - - type.getNodes().add(s2); - - MonitorMessage m1=new MonitorMessage(); - m1.setOperator(OP1); - m1.getTypes().add(TYPE1); - - MonitorMessage m2=new MonitorMessage(); - m2.setOperator(OP2); - m2.getTypes().add(TYPE2); - - MonitorMessage m3=new MonitorMessage(); - m3.setOperator(OP4); - m3.getTypes().add(TYPE4); - - long startTime=System.currentTimeMillis(); - - for (int i=0; i < 1000000; i++) { - SessionInstance instance=new SessionInstance(); - - monitor.initializeInstance(type, instance); - - if (!monitor.sent(type, instance, m1, null)) { - fail("Sent message 1 not expected"); - } - - if (!monitor.received(type, instance, m2, null)) { - fail("Received message 2 not expected"); - } - - if (!monitor.sent(type, instance, m3, null)) { - fail("Sent message 4 not expected"); - } - } - - System.out.println("TIME="+(System.currentTimeMillis()-startTime)+"ms"); - } - -} diff --git a/modules/monitor/src/test/resources/scribble/examples/Choice_Buyer.monitor b/modules/monitor/src/test/resources/scribble/examples/Choice_Buyer.monitor deleted file mode 100644 index 1fedee0f1..000000000 --- a/modules/monitor/src/test/resources/scribble/examples/Choice_Buyer.monitor +++ /dev/null @@ -1 +0,0 @@ -{"nodes":[{"type":"Send","next":1,"operator":"op1","parameters":[{"type":"{http://scribble.org/example}M1"}],"toRole":"Seller"},{"type":"Choice","next":4,"pathIndexes":[2,3]},{"type":"Receive","fromRole":"Seller","operator":"op2","parameters":[{"type":"{http://scribble.org/example}M2"}]},{"type":"Receive","fromRole":"Seller","operator":"op3","parameters":[{"type":"{http://scribble.org/example}M3"}]},{"type":"Send","operator":"op4","parameters":[{"type":"{http://scribble.org/example}M4"}],"toRole":"Seller"}]} diff --git a/modules/monitor/src/test/resources/scribble/examples/Choice_Buyer.scr b/modules/monitor/src/test/resources/scribble/examples/Choice_Buyer.scr deleted file mode 100644 index 81b736dec..000000000 --- a/modules/monitor/src/test/resources/scribble/examples/Choice_Buyer.scr +++ /dev/null @@ -1,18 +0,0 @@ -module scribble.examples.Choice; - -type "{http://scribble.org/example}M1" from "http://scribble.org/schema/Example.xsd" as M1; -type "{http://scribble.org/example}M2" from "http://scribble.org/schema/Example.xsd" as M2; -type "{http://scribble.org/example}M3" from "http://scribble.org/schema/Example.xsd" as M3; -type "{http://scribble.org/example}M4" from "http://scribble.org/schema/Example.xsd" as M4; - -local protocol First at Buyer (role Buyer, role Seller) { - op1(M1) to Seller; - - choice at Seller { - op2(M2) from Seller; - } or { - op3(M3) from Seller; - } - - op4(M4) to Seller; -} \ No newline at end of file diff --git a/modules/monitor/src/test/resources/scribble/examples/Do_Buyer.monitor b/modules/monitor/src/test/resources/scribble/examples/Do_Buyer.monitor deleted file mode 100644 index 58009a074..000000000 --- a/modules/monitor/src/test/resources/scribble/examples/Do_Buyer.monitor +++ /dev/null @@ -1 +0,0 @@ -{"nodes":[{"type":"Send","next":1,"operator":"op1","parameters":[{"type":"{http://scribble.org/example}M1"}],"toRole":"Seller"},{"type":"Do","next":3,"protocolIndex":2},{"type":"Receive","fromRole":"Seller","operator":"op2","parameters":[{"type":"{http://scribble.org/example}M2"}]},{"type":"Send","operator":"op3","parameters":[{"type":"{http://scribble.org/example}M3"}],"toRole":"Seller"}]} diff --git a/modules/monitor/src/test/resources/scribble/examples/Do_Buyer.scr b/modules/monitor/src/test/resources/scribble/examples/Do_Buyer.scr deleted file mode 100644 index 0378746cc..000000000 --- a/modules/monitor/src/test/resources/scribble/examples/Do_Buyer.scr +++ /dev/null @@ -1,17 +0,0 @@ -module scribble.examples.Do; - -type "{http://scribble.org/example}M1" from "http://scribble.org/schema/Example.xsd" as M1; -type "{http://scribble.org/example}M2" from "http://scribble.org/schema/Example.xsd" as M2; -type "{http://scribble.org/example}M3" from "http://scribble.org/schema/Example.xsd" as M3; - -local protocol First at Buyer (role Buyer, role Seller) { - op1(M1) to Seller; - - do Second(Buyer, Seller); - - op3(M3) to Seller; -} - -local protocol Second at Buyer (role Buyer, role Seller) { - op2(M2) from Seller; -} \ No newline at end of file diff --git a/modules/monitor/src/test/resources/scribble/examples/Interruptible2_Buyer.monitor b/modules/monitor/src/test/resources/scribble/examples/Interruptible2_Buyer.monitor deleted file mode 100644 index 11dbffcc4..000000000 --- a/modules/monitor/src/test/resources/scribble/examples/Interruptible2_Buyer.monitor +++ /dev/null @@ -1 +0,0 @@ -{"nodes":[{"type":"Send","next":1,"operator":"op1","parameters":[{"type":"{http://scribble.org/example}M1"}],"toRole":"Seller"},{"type":"Interruptible","blockIndex":2,"catches":6,"next":10,"throws":3},{"type":"Receive","fromRole":"Seller","operator":"op2","parameters":[{"type":"{http://scribble.org/example}M2"}]},{"type":"Choice","pathIndexes":[4,5]},{"type":"Send","operator":"op3","parameters":[{"type":"{http://scribble.org/example}M3"}],"toRole":"Seller2"},{"type":"Send","operator":"op4","parameters":[{"type":"{http://scribble.org/example}M4"}],"toRole":"Seller2"},{"type":"Choice","pathIndexes":[7,8,9]},{"type":"Receive","fromRole":"Seller2","operator":"op5","parameters":[{"type":"{http://scribble.org/example}M5"}]},{"type":"Receive","fromRole":"Seller2","operator":"op6","parameters":[{"type":"{http://scribble.org/example}M6"}]},{"type":"Receive","fromRole":"Seller","operator":"op7","parameters":[{"type":"{http://scribble.org/example}M7"}]},{"type":"Send","operator":"op8","parameters":[{"type":"{http://scribble.org/example}M8"}],"toRole":"Seller"}]} diff --git a/modules/monitor/src/test/resources/scribble/examples/Interruptible2_Buyer.scr b/modules/monitor/src/test/resources/scribble/examples/Interruptible2_Buyer.scr deleted file mode 100644 index d7f340b40..000000000 --- a/modules/monitor/src/test/resources/scribble/examples/Interruptible2_Buyer.scr +++ /dev/null @@ -1,25 +0,0 @@ -module scribble.examples.Interruptible2; - -type "{http://scribble.org/example}M1" from "http://scribble.org/schema/Example.xsd" as M1; -type "{http://scribble.org/example}M2" from "http://scribble.org/schema/Example.xsd" as M2; -type "{http://scribble.org/example}M3" from "http://scribble.org/schema/Example.xsd" as M3; -type "{http://scribble.org/example}M4" from "http://scribble.org/schema/Example.xsd" as M4; -type "{http://scribble.org/example}M5" from "http://scribble.org/schema/Example.xsd" as M5; -type "{http://scribble.org/example}M6" from "http://scribble.org/schema/Example.xsd" as M6; -type "{http://scribble.org/example}M7" from "http://scribble.org/schema/Example.xsd" as M7; -type "{http://scribble.org/example}M8" from "http://scribble.org/schema/Example.xsd" as M8; - -local protocol First at Buyer (role Buyer, role Seller, role Seller2) { - op1(M1) to Seller; - - interruptible TestScope: { - op2(M2) from Seller; - - } with { - throws op3(M3),op4(M4) to Seller, Seller2; - catches op5(M5),op6(M6) from Seller2; - catches op7(M7) from Seller; - } - - op8(M8) to Seller; -} diff --git a/modules/monitor/src/test/resources/scribble/examples/Interruptible_Buyer.monitor b/modules/monitor/src/test/resources/scribble/examples/Interruptible_Buyer.monitor deleted file mode 100644 index 8b2d03055..000000000 --- a/modules/monitor/src/test/resources/scribble/examples/Interruptible_Buyer.monitor +++ /dev/null @@ -1 +0,0 @@ -{"nodes":[{"type":"Send","next":1,"operator":"op1","parameters":[{"type":"{http://scribble.org/example}M1"}],"toRole":"Seller"},{"type":"Interruptible","blockIndex":2,"catches":4,"next":5,"throws":3},{"type":"Receive","fromRole":"Seller","operator":"op2","parameters":[{"type":"{http://scribble.org/example}M2"}]},{"type":"Send","operator":"op3","parameters":[{"type":"{http://scribble.org/example}M3"}],"toRole":"Seller"},{"type":"Receive","fromRole":"Seller","operator":"op4","parameters":[{"type":"{http://scribble.org/example}M4"}]},{"type":"Send","operator":"op5","parameters":[{"type":"{http://scribble.org/example}M5"}],"toRole":"Seller"}]} diff --git a/modules/monitor/src/test/resources/scribble/examples/Interruptible_Buyer.scr b/modules/monitor/src/test/resources/scribble/examples/Interruptible_Buyer.scr deleted file mode 100644 index cd854b763..000000000 --- a/modules/monitor/src/test/resources/scribble/examples/Interruptible_Buyer.scr +++ /dev/null @@ -1,21 +0,0 @@ -module scribble.examples.Interruptible; - -type "{http://scribble.org/example}M1" from "http://scribble.org/schema/Example.xsd" as M1; -type "{http://scribble.org/example}M2" from "http://scribble.org/schema/Example.xsd" as M2; -type "{http://scribble.org/example}M3" from "http://scribble.org/schema/Example.xsd" as M3; -type "{http://scribble.org/example}M4" from "http://scribble.org/schema/Example.xsd" as M4; -type "{http://scribble.org/example}M5" from "http://scribble.org/schema/Example.xsd" as M5; - -local protocol First at Buyer (role Buyer, role Seller) { - op1(M1) to Seller; - - interruptible TestScope: { - op2(M2) from Seller; - - } with { - throws op3(M3) to Seller; - catches op4(M4) from Seller; - } - - op5(M5) to Seller; -} diff --git a/modules/monitor/src/test/resources/scribble/examples/Parallel2_Buyer.monitor b/modules/monitor/src/test/resources/scribble/examples/Parallel2_Buyer.monitor deleted file mode 100644 index 663772b96..000000000 --- a/modules/monitor/src/test/resources/scribble/examples/Parallel2_Buyer.monitor +++ /dev/null @@ -1 +0,0 @@ -{"nodes":[{"type":"Parallel","pathIndexes":[1,2]},{"type":"Receive","fromRole":"Seller","operator":"op2","parameters":[{"type":"{http://scribble.org/example}M2"}]},{"type":"Receive","fromRole":"Seller","operator":"op3","parameters":[{"type":"{http://scribble.org/example}M3"}]}]} diff --git a/modules/monitor/src/test/resources/scribble/examples/Parallel2_Buyer.scr b/modules/monitor/src/test/resources/scribble/examples/Parallel2_Buyer.scr deleted file mode 100644 index bdb68b950..000000000 --- a/modules/monitor/src/test/resources/scribble/examples/Parallel2_Buyer.scr +++ /dev/null @@ -1,14 +0,0 @@ -module scribble.examples.Parallel; - -type "{http://scribble.org/example}M1" from "http://scribble.org/schema/Example.xsd" as M1; -type "{http://scribble.org/example}M2" from "http://scribble.org/schema/Example.xsd" as M2; -type "{http://scribble.org/example}M3" from "http://scribble.org/schema/Example.xsd" as M3; -type "{http://scribble.org/example}M4" from "http://scribble.org/schema/Example.xsd" as M4; - -local protocol First at Buyer (role Buyer, role Seller) { - par { - op2(M2) from Seller; - } and { - op3(M3) from Seller; - } -} \ No newline at end of file diff --git a/modules/monitor/src/test/resources/scribble/examples/Parallel3_Buyer.monitor b/modules/monitor/src/test/resources/scribble/examples/Parallel3_Buyer.monitor deleted file mode 100644 index 7431230c9..000000000 --- a/modules/monitor/src/test/resources/scribble/examples/Parallel3_Buyer.monitor +++ /dev/null @@ -1 +0,0 @@ -{"nodes":[{"type":"Parallel","pathIndexes":[1]},{"type":"Receive","fromRole":"Seller","operator":"op2","parameters":[{"type":"{http://scribble.org/example}M2"}]}]} diff --git a/modules/monitor/src/test/resources/scribble/examples/Parallel3_Buyer.scr b/modules/monitor/src/test/resources/scribble/examples/Parallel3_Buyer.scr deleted file mode 100644 index 17216a2cd..000000000 --- a/modules/monitor/src/test/resources/scribble/examples/Parallel3_Buyer.scr +++ /dev/null @@ -1,13 +0,0 @@ -module scribble.examples.Parallel; - -type "{http://scribble.org/example}M1" from "http://scribble.org/schema/Example.xsd" as M1; -type "{http://scribble.org/example}M2" from "http://scribble.org/schema/Example.xsd" as M2; -type "{http://scribble.org/example}M3" from "http://scribble.org/schema/Example.xsd" as M3; -type "{http://scribble.org/example}M4" from "http://scribble.org/schema/Example.xsd" as M4; - -local protocol First at Buyer (role Buyer, role Seller) { - par { - op2(M2) from Seller; - } and { - } -} \ No newline at end of file diff --git a/modules/monitor/src/test/resources/scribble/examples/Parallel4_Buyer.monitor b/modules/monitor/src/test/resources/scribble/examples/Parallel4_Buyer.monitor deleted file mode 100644 index 7431230c9..000000000 --- a/modules/monitor/src/test/resources/scribble/examples/Parallel4_Buyer.monitor +++ /dev/null @@ -1 +0,0 @@ -{"nodes":[{"type":"Parallel","pathIndexes":[1]},{"type":"Receive","fromRole":"Seller","operator":"op2","parameters":[{"type":"{http://scribble.org/example}M2"}]}]} diff --git a/modules/monitor/src/test/resources/scribble/examples/Parallel4_Buyer.scr b/modules/monitor/src/test/resources/scribble/examples/Parallel4_Buyer.scr deleted file mode 100644 index 246514957..000000000 --- a/modules/monitor/src/test/resources/scribble/examples/Parallel4_Buyer.scr +++ /dev/null @@ -1,13 +0,0 @@ -module scribble.examples.Parallel; - -type "{http://scribble.org/example}M1" from "http://scribble.org/schema/Example.xsd" as M1; -type "{http://scribble.org/example}M2" from "http://scribble.org/schema/Example.xsd" as M2; -type "{http://scribble.org/example}M3" from "http://scribble.org/schema/Example.xsd" as M3; -type "{http://scribble.org/example}M4" from "http://scribble.org/schema/Example.xsd" as M4; - -local protocol First at Buyer (role Buyer, role Seller) { - par { - } and { - op2(M2) from Seller; - } -} \ No newline at end of file diff --git a/modules/monitor/src/test/resources/scribble/examples/Parallel_Buyer.monitor b/modules/monitor/src/test/resources/scribble/examples/Parallel_Buyer.monitor deleted file mode 100644 index 80f9b8d28..000000000 --- a/modules/monitor/src/test/resources/scribble/examples/Parallel_Buyer.monitor +++ /dev/null @@ -1 +0,0 @@ -{"nodes":[{"type":"Send","next":1,"operator":"op1","parameters":[{"type":"{http://scribble.org/example}M1"}],"toRole":"Seller"},{"type":"Parallel","next":4,"pathIndexes":[2,3]},{"type":"Receive","fromRole":"Seller","operator":"op2","parameters":[{"type":"{http://scribble.org/example}M2"}]},{"type":"Receive","fromRole":"Seller","operator":"op3","parameters":[{"type":"{http://scribble.org/example}M3"}]},{"type":"Send","operator":"op4","parameters":[{"type":"{http://scribble.org/example}M4"}],"toRole":"Seller"}]} diff --git a/modules/monitor/src/test/resources/scribble/examples/Parallel_Buyer.scr b/modules/monitor/src/test/resources/scribble/examples/Parallel_Buyer.scr deleted file mode 100644 index da4bbf1b8..000000000 --- a/modules/monitor/src/test/resources/scribble/examples/Parallel_Buyer.scr +++ /dev/null @@ -1,18 +0,0 @@ -module scribble.examples.Parallel; - -type "{http://scribble.org/example}M1" from "http://scribble.org/schema/Example.xsd" as M1; -type "{http://scribble.org/example}M2" from "http://scribble.org/schema/Example.xsd" as M2; -type "{http://scribble.org/example}M3" from "http://scribble.org/schema/Example.xsd" as M3; -type "{http://scribble.org/example}M4" from "http://scribble.org/schema/Example.xsd" as M4; - -local protocol First at Buyer (role Buyer, role Seller) { - op1(M1) to Seller; - - par { - op2(M2) from Seller; - } and { - op3(M3) from Seller; - } - - op4(M4) to Seller; -} \ No newline at end of file diff --git a/modules/monitor/src/test/resources/scribble/examples/Recursion_Buyer.monitor b/modules/monitor/src/test/resources/scribble/examples/Recursion_Buyer.monitor deleted file mode 100644 index 20d461c51..000000000 --- a/modules/monitor/src/test/resources/scribble/examples/Recursion_Buyer.monitor +++ /dev/null @@ -1 +0,0 @@ -{"nodes":[{"type":"Send","next":1,"operator":"op1","parameters":[{"type":"{http://scribble.org/example}M1"}],"toRole":"Seller"},{"type":"Recursion","blockIndex":2,"next":7},{"type":"Receive","fromRole":"Seller","next":3,"operator":"op2","parameters":[{"type":"{http://scribble.org/example}M2"}]},{"type":"Choice","pathIndexes":[4,6]},{"type":"Receive","fromRole":"Seller","next":5,"operator":"op3","parameters":[{"type":"{http://scribble.org/example}M3"}]},{"type":"Continue","next":2},{"type":"Receive","fromRole":"Seller","operator":"op4","parameters":[{"type":"{http://scribble.org/example}M4"}]},{"type":"Send","operator":"op5","parameters":[{"type":"{http://scribble.org/example}M5"}],"toRole":"Seller"}]} diff --git a/modules/monitor/src/test/resources/scribble/examples/Recursion_Buyer.scr b/modules/monitor/src/test/resources/scribble/examples/Recursion_Buyer.scr deleted file mode 100644 index 4e62a9b66..000000000 --- a/modules/monitor/src/test/resources/scribble/examples/Recursion_Buyer.scr +++ /dev/null @@ -1,24 +0,0 @@ -module scribble.examples.Recursion; - -type "{http://scribble.org/example}M1" from "http://scribble.org/schema/Example.xsd" as M1; -type "{http://scribble.org/example}M2" from "http://scribble.org/schema/Example.xsd" as M2; -type "{http://scribble.org/example}M3" from "http://scribble.org/schema/Example.xsd" as M3; -type "{http://scribble.org/example}M4" from "http://scribble.org/schema/Example.xsd" as M4; -type "{http://scribble.org/example}M5" from "http://scribble.org/schema/Example.xsd" as M5; - -local protocol First at Buyer (role Buyer, role Seller) { - op1(M1) to Seller; - - rec MyLabel { - op2(M2) from Seller; - - choice at Seller { - op3(M3) from Seller; - continue MyLabel; - } or { - op4(M4) from Seller; - } - } - - op5(M5) to Seller; -} diff --git a/modules/monitor/src/test/resources/scribble/examples/RequestResponse_Buyer.monitor b/modules/monitor/src/test/resources/scribble/examples/RequestResponse_Buyer.monitor deleted file mode 100644 index 6b850b444..000000000 --- a/modules/monitor/src/test/resources/scribble/examples/RequestResponse_Buyer.monitor +++ /dev/null @@ -1 +0,0 @@ -{"nodes":[{"type":"Send","next":1,"operator":"buy","parameters":[{"type":"{http://scribble.org/example}OrderRequest"}],"toRole":"Seller"},{"type":"Receive","fromRole":"Seller","operator":"buy","parameters":[{"type":"{http://scribble.org/example}OrderResponse"}]}]} \ No newline at end of file diff --git a/modules/monitor/src/test/resources/scribble/examples/RequestResponse_Buyer.scr b/modules/monitor/src/test/resources/scribble/examples/RequestResponse_Buyer.scr deleted file mode 100644 index fcde30739..000000000 --- a/modules/monitor/src/test/resources/scribble/examples/RequestResponse_Buyer.scr +++ /dev/null @@ -1,9 +0,0 @@ -module scribble.examples.RequestResponse; - -type "{http://scribble.org/example}OrderRequest" from "http://scribble.org/schema/Example.xsd" as OrderRequest; -type "{http://scribble.org/example}OrderResponse" from "http://scribble.org/schema/Example.xsd" as OrderResponse; - -local protocol First at Buyer (role Buyer, role Seller) { - buy(OrderRequest) to Seller; - buy(OrderResponse) from Seller; -} \ No newline at end of file diff --git a/modules/parser/LICENSE.txt b/modules/parser/LICENSE.txt deleted file mode 100644 index 29f81d812..000000000 --- a/modules/parser/LICENSE.txt +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/modules/parser/build.properties b/modules/parser/build.properties deleted file mode 100644 index b844f8dbe..000000000 --- a/modules/parser/build.properties +++ /dev/null @@ -1,19 +0,0 @@ -source.. = src/main/java/,\ - target/generated-sources/antlr3/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - src/main/resources/lib/antlr-3.2.jar,\ - OSGI-INF/,\ - LICENSE.txt -src.includes = target/generated-sources/,\ - src/,\ - pom.xml,\ - build.properties,\ - META-INF/,\ - .project,\ - .classpath,\ - OSGI-INF/,\ - LICENSE.txt -jars.compile.order = .,\ - lib/antlr-3.2.jar diff --git a/modules/parser/pom.xml b/modules/parser/pom.xml deleted file mode 100644 index 3189ee6b9..000000000 --- a/modules/parser/pom.xml +++ /dev/null @@ -1,53 +0,0 @@ - - 4.0.0 - scribble-parser - jar - Scribble::Modules::Parser - - - org.scribble - modules - 0.3.2-SNAPSHOT - - - - - org.scribble - scribble-core - ${project.version} - - - org.scribble - scribble-validation - ${project.version} - - - org.antlr - antlr-runtime - - - junit - junit - test - - - - - - - org.antlr - antlr3-maven-plugin - ${antlr.version} - - - - antlr - - - - - - - - diff --git a/modules/parser/src/main/antlr3/org/scribble/parser/antlr/Scribble.g b/modules/parser/src/main/antlr3/org/scribble/parser/antlr/Scribble.g deleted file mode 100644 index 7fcc5e86f..000000000 --- a/modules/parser/src/main/antlr3/org/scribble/parser/antlr/Scribble.g +++ /dev/null @@ -1,723 +0,0 @@ -/* - * Raymond@HZHL2 ~/code/python/scribble-tools - * $ java -cp lib/antlr-3.1.3.jar org.antlr.Tool -o bin src/scribble/Scribble.g -*/ - -// Use language actions to directly create lists etc.? but ties the grammar source to that language? - -// Garbage at the end of input file seems to just get ignored, no error raised. but also for e.g. two package declarations -- check if this is still the case? - - -grammar Scribble; - -options -{ - output=AST; - backtrack=true; -} - -tokens -{ - /* - * Parser input constants (lexer output; keywords, Section 2.4) - */ - MODULEKW = 'module'; - IMPORTKW = 'import'; - TYPEKW = 'type'; - PROTOCOLKW = 'protocol'; - GLOBALKW = 'global'; - LOCALKW = 'local'; - ROLEKW = 'role'; - SIGKW = 'sig'; - INSTANTIATESKW = 'instantiates'; - ASKW = 'as'; - - FROMKW = 'from'; - TOKW = 'to'; - CHOICEKW = 'choice'; - ATKW = 'at'; - ORKW = 'or'; - RECKW = 'rec'; - CONTINUEKW = 'continue'; - PARKW = 'par'; - ANDKW = 'and'; - INTERRUPTIBLEKW = 'interruptible'; - WITHKW = 'with'; - BYKW = 'by'; /* from for interrupts is more expected, but from is - not good for multiple roles (generally, the comma - in interrupt message list and role list looks like - "and" rather than "or") */ - THROWSKW = 'throws'; - CATCHESKW = 'catches'; - DOKW = 'do'; - //SPAWNKW = 'spawn'; - - - /* - * Parser output node types (corresponding to the various syntactic - * categories) i.e. the labels used to distinguish resulting AST nodes. - * The value of these token variables doesn't matter, only the token - * (i.e. variable) names themselves are used (for AST node root text - * field) - */ - //MODULE = 'module'; - MODULE = 'modul'; - //PACKAGEDECL = 'package-decl'; - MODULEDECL = 'module-decl'; - //IMPORTDECL = 'import-decl'; - //FROMIMPORTDECL = 'from-import-decl'; - IMPORTMODULE = 'import-module'; - IMPORTMEMBER = 'import-member'; - PAYLOADTYPEDECL = 'payload-type-decl'; - PARAMETERDECLLIST = 'parameter-decl-list'; - PARAMETERDECL = 'parameter-decl'; - MESSAGESIGNATURE = 'message-signature'; - ROLEDECLLIST = 'role-decl-list'; - ROLEDECL = 'role-decl'; - ARGUMENTLIST = 'argument-list'; - ARGUMENT = 'argument'; - PAYLOAD = 'payload'; - PAYLOADELEMENT = 'payloadelement'; - ROLEINSTANTIATIONLIST = 'role-instantiation-list'; - ROLEINSTANTIATION = 'role-instantiation'; - - GLOBALPROTOCOLDECL = 'global-protocol-decl'; - GLOBALPROTOCOLDEF = 'global-protocol-def'; - GLOBALPROTOCOLINSTANCE = 'global-protocol-instance'; - //GLOBALPROTOCOLBODY = 'global-protocol-body'; - GLOBALPROTOCOLBLOCK = 'global-protocol-block'; - GLOBALINTERACTIONSEQUENCE = 'global-interaction-sequence'; - GLOBALMESSAGETRANSFER = 'global-message-transfer'; - GLOBALCHOICE = 'global-choice'; - GLOBALRECURSION = 'global-recursion'; - GLOBALCONTINUE = 'global-continue'; - GLOBALPARALLEL = 'global-parallel'; - GLOBALINTERRUPTIBLE = 'global-interruptible'; - GLOBALINTERRUPT = 'global-interrupt'; - GLOBALDO = 'global-do'; - //GLOBALSPAWN = 'global-spawn'; - - LOCALPROTOCOLDECL = 'local-protocol-decl'; - LOCALPROTOCOLDEF = 'local-protocol-def'; - LOCALPROTOCOLINSTANCE = 'local-protocol-instance'; - LOCALPROTOCOLBLOCK = 'local-protocol-block'; - LOCALINTERACTIONSEQUENCE = 'local-interaction-sequence'; - LOCALMESSAGETRANSFER = 'local-message-transfer'; - LOCALCHOICE = 'local-choice'; - LOCALRECURSION = 'local-recursion'; - LOCALCONTINUE = 'local-continue'; - LOCALPARALLEL = 'local-parallel'; - LOCALINTERRUPTIBLE = 'local-interruptible'; - LOCALINTERRUPT = 'local-interrupt'; - LOCALDO = 'local-do'; - LOCALTHROW = 'local-throw'; - LOCALCATCH = 'local-catch'; - LOCALSEND = 'local-send'; - LOCALRECEIVE = 'local-receive'; - - - /* - * Some utility constants; AST token values are the variable names (not - * the variable values). - * (N.B. Some grammar rules use dummy placeholder values, but others do not) - */ - EMPTY_MESSAGE_OP = '__empty_message_op'; - EMPTY_ANNOTATION = '__empty_annotation'; - EMPTY_PARAMETER_DECL_LIST = '__empty_parameter_decl_list'; - EMPTY_ARGUMENT_LIST = '__empty_argument_list'; - EMPTY_MODULE_NAME = '__empty_module_name'; - EMPTY_SCOPE_NAME = '__empty_scope_name'; - EMPTY_LOCAL_THROW = '__empty_local_throw'; - EMPTY_LOCAL_CATCHES = '__empty_local_catch'; - - KIND_MESSAGE_SIGNATURE = 'KIND_MESSAGE_SIGNATURE'; - KIND_PAYLOAD_TYPE = 'KIND_PAYLOAD_TYPE'; -} - - -/*------------------------------------------------------------------ - * JAVA SPECIFIC DEFINITIONS - *------------------------------------------------------------------*/ - -@header { -package org.scribble.parser.antlr; -} - -@lexer::header { -package org.scribble.parser.antlr; -} - -@members { - private org.scribble.logging.IssueLogger _logger=null; - private String _document=null; - private boolean _errorOccurred=false; - - public void setLogger(org.scribble.logging.IssueLogger logger) { - _logger = logger; - } - - public void setDocument(String doc) { - _document = doc; - } - - public void emitErrorMessage(String mesg) { - if (_logger == null) { - super.emitErrorMessage(mesg); - } else { - _logger.error(org.scribble.parser.antlr.ANTLRMessageUtil.getMessageText(mesg), - org.scribble.parser.antlr.ANTLRMessageUtil.getProperties(mesg, _document)); - } - _errorOccurred = true; - } - - public boolean isErrorOccurred() { - return(_errorOccurred); - } -} - - - - -/**************************************************************************** - * Chapter 2 Lexical Strucure (Lexer rules) - ***************************************************************************/ - -/* - * Section 2.1 White space (Section 2.1) - */ -WHITESPACE: - ('\t' | ' ' | '\r' | '\n'| '\u000C')+ - { - $channel = HIDDEN; - } -; - -/** - * Section 2.2 Comments - */ -COMMENT: - '/*' .* '*/' - { - $channel=HIDDEN; - } -; - -LINE_COMMENT: - '//' ~('\n'|'\r')* '\r'? '\n' - { - $channel=HIDDEN; - } -; - -/** - * Section 2.3 Identifiers - */ -IDENTIFIER: - (LETTER | UNDERSCORE) (LETTER | DIGIT | UNDERSCORE)* -; - -fragment SYMBOL: - '{' | '}' | '(' | ')' | '[' | ']' | ':' | '/' | '\\' | '.' | '\#' -| - '&' | '?' | '!' | UNDERSCORE -; - -// Comes after SYMBOL due to an ANTLR syntax highlighting issue -// involving quotes -EXTIDENTIFIER: - '"' ( ~('\\'|'"') )* '"' - //'\"' (LETTER | UNDERSCORE) (LETTER | DIGIT | SYMBOL)* '\"' -; - -fragment LETTER: - 'a'..'z' | 'A'..'Z' -; - -fragment DIGIT: - '0'..'9' -; - -fragment UNDERSCORE: - '_' -; - - -/**************************************************************************** - * Chapter 3 Syntax (Parser rules) - ***************************************************************************/ - -/* - * Section 3.1 Primitive Names - */ -rolename: IDENTIFIER; -payloadtypename: IDENTIFIER; -protocolname: IDENTIFIER; -parametername: IDENTIFIER; -annotationname: IDENTIFIER; -recursionlabelname: IDENTIFIER; -scopename: IDENTIFIER; - - -/** - * Section 3.2.1 Package, Module and Module Member Names - */ -/*packagename: - IDENTIFIER ('.' IDENTIFIER)* -;*/ - - -modulename: - //packagename '.' IDENTIFIER // Not working - IDENTIFIER ('.' IDENTIFIER)* '.' IDENTIFIER -| - IDENTIFIER -; - -membername: - simplemembername -| - fullmembername -; - -simplemembername: - payloadtypename -| - protocolname /* Generates an ANTLR warning since both are IDENTIFIER - if no backtrack (makes ANTLR think this alternative - is reachable, but actually it isn't) */ -; - -fullmembername: - modulename '.' simplemembername /* Needs backtrack=true - since the simplemembername can/will - be eagerly consumed by modulename */ -; - - -/** - * Section 3.2.2 Top-level Module Structure - */ -module: - moduledecl (importdecl)* (payloadtypedecl)* (protocoldecl)* -; - - -/** - * Section 3.2.3 Module Declarations - */ -moduledecl: - MODULEKW modulename ';' -; - - -/** - * Section 3.3 Import Declarations - */ -importdecl: - importmodule -| - importmember -; - -importmodule: - IMPORTKW modulename ';' -| - IMPORTKW modulename ASKW IDENTIFIER ';' -; - -importmember: - FROMKW modulename IMPORTKW simplemembername ';' -| - FROMKW modulename IMPORTKW simplemembername ASKW IDENTIFIER ';' -; - - -/** - * Section 3.4 Payload Type Declarations - */ -payloadtypedecl: - TYPEKW '<' IDENTIFIER '>' EXTIDENTIFIER FROMKW EXTIDENTIFIER ASKW payloadtypename ';' -; - - -/** - * Section 3.5 Message Signatures - */ -messageoperator: - (LETTER | DIGIT | UNDERSCORE)+ -; - -messagesignature: - '(' payload ')' -| - //messageoperator '(' payload ')' // Doesn't work (conflict with IDENTIFIER?) - IDENTIFIER '(' payload? ')' -; - -payload: - payloadelement (',' payloadelement)* -; - -payloadelement: - payloadtypename -| - parametername /* An IDENTIFIER, like payloadtypename, so generates warnings - (unless backtrack=true) */ -| - annotationname ':' payloadtypename -| - annotationname ':' parametername -; - - -/** - * Section 3.6 Protocol Declarations - */ -protocoldecl: - globalprotocoldecl -| - localprotocoldecl -; - - -/** - * Section 3.7 Global Protocol Declarations - */ -globalprotocoldecl: - globalprotocolheader globalprotocoldefinition -| - globalprotocolheader globalprotocolinstance -; - -globalprotocolheader: // Currently, header is not an explicit category - GLOBALKW PROTOCOLKW protocolname roledecllist -| - GLOBALKW PROTOCOLKW protocolname parameterdecllist roledecllist -; - -roledecllist: - '(' roledecl (',' roledecl)* ')' -; - -roledecl: - ROLEKW rolename -| - ROLEKW rolename ASKW rolename -; - -parameterdecllist: - '<' parameterdecl (',' parameterdecl)* '>' -; - -parameterdecl: - TYPEKW parametername -| - TYPEKW parametername ASKW parametername -| - SIGKW parametername -| - SIGKW parametername ASKW parametername -; - - -/** - * Section 3.7.1 Global Protocol Definitions - */ -globalprotocoldefinition: - globalprotocolblock -; - - -/** - * Section 3.7.2 Global Protocol Instantiation - */ -globalprotocolinstance: - INSTANTIATESKW membername roleinstantiationlist ';' -| - INSTANTIATESKW membername argumentlist roleinstantiationlist ';' -; - -roleinstantiationlist: - '(' roleinstantiation (',' roleinstantiation)* ')' -; - -roleinstantiation: - rolename -| - rolename ASKW rolename -; - -argumentlist: - '<' argument (',' argument)* '>' -; - -argument: - messagesignature -| - messagesignature ASKW parametername -| - payloadtypename -| - payloadtypename ASKW parametername -| - parametername // generates warnings unless backtrack=true -| - parametername ASKW parametername -; - - -/** - * Section 3.7.3 Global Interaction Sequences and Blocks - */ -globalprotocolblock: - '{' globalinteractionsequence '}' -; - -globalinteractionsequence: - (globalinteraction)* -; - -globalinteraction: - globalmessagetransfer -| - globalchoice -| - globalrecursion -| - globalcontinue -| - globalparallel -| - globalinterruptible -| - globaldo -/*| - globalspawn*/ -; - - -/** - * Section 3.7.4 Global Message Transfer - */ -globalmessagetransfer: - message FROMKW rolename TOKW rolename (',' rolename )* ';' -; - -message: - messagesignature -| - parametername -; - - -/** - * Section 3.7.5 Global Choice - */ -globalchoice: - CHOICEKW ATKW rolename globalprotocolblock (ORKW globalprotocolblock)* -; - - -/** - * Section 3.7.6 Global Recursion - */ -globalrecursion: - RECKW recursionlabelname globalprotocolblock -; - -globalcontinue: - CONTINUEKW recursionlabelname ';' -; - - -/** - * Section 3.7.7 Global Parallel - */ -globalparallel: - PARKW globalprotocolblock (ANDKW globalprotocolblock)* -; - - -/** - * Section 3.7.8 Global Interruptible - */ -globalinterruptible: - INTERRUPTIBLEKW globalprotocolblock WITHKW '{' (globalinterrupt)* '}' -| - INTERRUPTIBLEKW scopename ':' globalprotocolblock WITHKW '{' (globalinterrupt)* '}' -; - -globalinterrupt: - message (',' message)* BYKW rolename ';' -; - - -/** - * Section 3.7.9 Global Do - */ -globaldo: - DOKW membername roleinstantiationlist ';' -| - DOKW membername argumentlist roleinstantiationlist ';' -| - DOKW scopename ':' membername roleinstantiationlist ';' -| - DOKW scopename ':' membername argumentlist roleinstantiationlist ';' -; - - -/** - * TODO: Global Spawn - */ -/*globalspawn: - SPAWNKW membername '(' roleinstantiationlist ')' ';' -| - SPAWNKW membername '<' argumentlist '>' '(' roleinstantiationlist ')' ';' -;*/ - - -/* - * Section 3.8 Local Protocol Declarations - */ -localprotocoldecl: - localprotocolheader localprotocoldefinition -| - localprotocolheader localprotocolinstance -; - -localprotocolheader: - LOCALKW PROTOCOLKW protocolname ATKW rolename roledecllist -| - LOCALKW PROTOCOLKW protocolname ATKW rolename parameterdecllist roledecllist -; - - -/** - * Section 3.8.1 Local Protocol Definitions - */ -localprotocoldefinition: - localprotocolblock -; - - -/** - * Section 3.8.2 Local Protocol Instantiation - */ -localprotocolinstance: - INSTANTIATESKW membername roleinstantiationlist ';' -| - INSTANTIATESKW membername argumentlist roleinstantiationlist ';' -; - - -/** - * Section 3.8.3 Local Interaction Blocks and Sequences - */ -localprotocolblock: - '{' localinteractionsequence '}' -; - -localinteractionsequence: - (localinteraction)* -; - -localinteraction: - localsend -| - localreceive -| - localchoice -| - localparallel -| - localrecursion -| - localcontinue -| - localinterruptible -| - localdo -/*| - localspawn*/ -; - - -/** - * Section 3.8.4 Local Send and Receive - */ -localsend: - message TOKW rolename (',' rolename)* ';' -; - -localreceive: - message FROMKW IDENTIFIER ';' -; - - -/** - * Section 3.8.5 Local Choice - */ -localchoice: - CHOICEKW ATKW rolename localprotocolblock (ORKW localprotocolblock)* -; - - -/** - * Section 3.8.6 Local Recursion - */ -localrecursion: - RECKW recursionlabelname localprotocolblock -; - -localcontinue: - CONTINUEKW recursionlabelname ';' -; - - -/** - * Section 3.8.7 Local Parallel - */ -localparallel: - PARKW localprotocolblock (ANDKW localprotocolblock)* -; - - -/** - * Section 3.8.8 Local Interruptible - */ -localinterruptible: - /*INTERRUPTIBLEKW scopename ':' localprotocolblock WITHKW '{' localthrowandorcatch '}' -|*/ - INTERRUPTIBLEKW scopename ':' localprotocolblock WITHKW '{' (localcatch)* '}' -| - INTERRUPTIBLEKW scopename ':' localprotocolblock WITHKW '{' localthrow (localcatch)* '}' -; - -/*localthrowandorcatch: - localthrow (localcatch)* -| - (localcatch)+ -;*/ - -localthrow: - THROWSKW message (',' message)* TOKW rolename (',' rolename)* ';' -; - -localcatch: - CATCHESKW message (',' message)* FROMKW rolename ';' -; - - -/** - * Section 3.8.9 Local Do - */ -localdo: - DOKW membername roleinstantiationlist ';' -| - DOKW membername argumentlist roleinstantiationlist ';' -| - DOKW scopename ':' membername roleinstantiationlist ';' -| - DOKW scopename ':' membername argumentlist roleinstantiationlist ';' -; - diff --git a/modules/parser/src/main/java/org/scribble/parser/ProtocolContext.java b/modules/parser/src/main/java/org/scribble/parser/ProtocolContext.java deleted file mode 100644 index 156ca1669..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/ProtocolContext.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser; - -/** - * This interface provides access to capabilities based on the - * protocol being processed. - * - */ -public interface ProtocolContext { - -} diff --git a/modules/parser/src/main/java/org/scribble/parser/ProtocolDefinitions.java b/modules/parser/src/main/java/org/scribble/parser/ProtocolDefinitions.java deleted file mode 100644 index 14d974982..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/ProtocolDefinitions.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2009-10 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser; - -/** - * This class provides common protocol definitions. - * - */ -public final class ProtocolDefinitions { - - /** - * Default constructor. - */ - private ProtocolDefinitions() { - } - - /** - * The protocol type. - */ - public static final String PROTOCOL_EXTENSION = "scr"; - -} diff --git a/modules/parser/src/main/java/org/scribble/parser/ProtocolModuleLoader.java b/modules/parser/src/main/java/org/scribble/parser/ProtocolModuleLoader.java deleted file mode 100644 index 3f15640d4..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/ProtocolModuleLoader.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.scribble.context.DefaultModuleLoader; -import org.scribble.context.ModuleLoader; -import org.scribble.logging.IssueLogger; -import org.scribble.model.Module; -import org.scribble.resources.Resource; -import org.scribble.resources.ResourceLocator; - -/** - * This class provides a default implementation of the ModuleLoader interface. - * - */ -public class ProtocolModuleLoader extends DefaultModuleLoader implements ModuleLoader { - - private static final Logger LOG=Logger.getLogger(ProtocolModuleLoader.class.getName()); - - private ResourceLocator _locator=null; - private IssueLogger _logger=null; - private ProtocolParser _parser=null; - - /** - * This constructor initializes the module loader. - * - * @param parser The parser - * @param locator The locator - * @param logger The logger - */ - public ProtocolModuleLoader(ProtocolParser parser, ResourceLocator locator, - IssueLogger logger) { - _parser = parser; - _locator = locator; - _logger = logger; - } - - /** - * {@inheritDoc} - */ - public Module loadModule(String module) { - Module ret=super.loadModule(module); - - if (ret == null) { - String relativePath=module.replace('.', java.io.File.separatorChar)+".scr"; - - Resource resource=_locator.getResource(relativePath); - - if (resource != null) { - try { - ret = _parser.parse(resource, this,_logger); - - if (ret != null) { - registerModule(ret); - } - } catch (Exception e) { - LOG.log(Level.SEVERE, "Failed to parse imported module '"+module+"'", e); - } - } - } - - return (ret); - } -} diff --git a/modules/parser/src/main/java/org/scribble/parser/ProtocolParser.java b/modules/parser/src/main/java/org/scribble/parser/ProtocolParser.java deleted file mode 100644 index 715a68811..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/ProtocolParser.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser; - -import java.io.IOException; - -import org.antlr.runtime.ANTLRStringStream; -import org.antlr.runtime.CommonTokenStream; -import org.scribble.context.ModuleLoader; -import org.scribble.logging.IssueLogger; -import org.scribble.model.Module; -import org.scribble.parser.ProtocolParser; -import org.scribble.parser.antlr.ProtocolTreeAdaptor; -import org.scribble.parser.antlr.ScribbleLexer; -import org.scribble.parser.antlr.ScribbleParser; -import org.scribble.resources.Resource; - -/** - * This class provides the ANTLR implementation of the Protocol Parser - * interface. - * - */ -public class ProtocolParser { - - /** - * Default constructor. - */ - public ProtocolParser() { - } - - /** - * This method parses the scribble protocol contained in the supplied - * resource. The resource locator is used to access other resources, - * and the logger reports information, warnings and errors. - * - * @param resource The resource - * @param loader The module locator - * @param logger The logger - * @return The module, or null if an error occurred - * @throws IOException Failed to retrieve protocol from input stream - */ - public Module parse(Resource resource, final ModuleLoader loader, final IssueLogger logger) - throws IOException { - Module ret=null; - - try { - java.io.InputStream is=resource.getInputStream(); - - byte[] b=new byte[is.available()]; - is.read(b); - - is.close(); - - String document=new String(b); - - ScribbleLexer lex = new ScribbleLexer(new ANTLRStringStream(document)); - CommonTokenStream tokens = new CommonTokenStream(lex); - - ScribbleParser parser = new ScribbleParser(tokens); - - ProtocolTreeAdaptor adaptor=new ProtocolTreeAdaptor(); - adaptor.setParser(parser); - - parser.setDocument(document); - parser.setTreeAdaptor(adaptor); - - parser.setLogger(logger); - - parser.module(); - - if (!parser.isErrorOccurred()) { - ret = adaptor.getModule(); - } - - } catch (Exception e) { - e.printStackTrace(); - } - - return (ret); - } - -} diff --git a/modules/parser/src/main/java/org/scribble/parser/antlr/ANTLRMessageUtil.java b/modules/parser/src/main/java/org/scribble/parser/antlr/ANTLRMessageUtil.java deleted file mode 100644 index b5017487d..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/antlr/ANTLRMessageUtil.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright 2009-10 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser.antlr; - -import org.scribble.model.ModelObject; - -/** - * ANTLR message utilities. - * - */ -public final class ANTLRMessageUtil { - - /** - * Private constructor. - */ - private ANTLRMessageUtil() { - } - - /** - * End location separator. - */ - private static final char END_LOCATION_SEPARATOR = ' '; - - /** - * Location prefix token. - */ - private static final String LOCATION_PREFIX_TOKEN = "line "; - - /** - * This method removes the message location prefix. - * - * @param mesg The message - * @return The message with the location information removed - */ - public static String getMessageText(String mesg) { - String ret=mesg; - - if (mesg != null && mesg.startsWith(LOCATION_PREFIX_TOKEN)) { - int index=mesg.indexOf(END_LOCATION_SEPARATOR, LOCATION_PREFIX_TOKEN.length()); - - if (index != -1) { - ret = mesg.substring(index+1); - } - } - - return (ret); - } - - /** - * This method returns the properties. - * - * @param mesg The message - * @param document The document - * @return The properties - */ - public static java.util.Map getProperties(String mesg, String document) { - java.util.Map ret=null; - - if (mesg != null && mesg.startsWith(LOCATION_PREFIX_TOKEN)) { - int index=mesg.indexOf(END_LOCATION_SEPARATOR, LOCATION_PREFIX_TOKEN.length()); - - if (index != -1) { - String lineDetails=mesg.substring(LOCATION_PREFIX_TOKEN.length(), index); - - String[] nums=lineDetails.split(":"); - - if (nums != null && nums.length == 2) { - ret = new java.util.HashMap(); - - Integer line=Integer.parseInt(nums[0]); - Integer col=Integer.parseInt(nums[1]); - - ret.put(ModelObject.START_LINE, line); - ret.put(ModelObject.START_COLUMN, col); - - // Determine the position within the document - int pos=0; - - for (int i=0; pos != -1 && i < line.intValue()-1; i++) { - pos = document.indexOf("\n", pos); - - if (pos != -1) { - pos += 1; - } - } - - if (pos != -1) { - pos += col.intValue(); - - ret.put(ModelObject.START_POSITION, new Integer(pos)); - - // Find next whitespace - int endpos=document.length(); - int nextpos=-1; - - for (int j=pos+1; nextpos == -1 && j < endpos; j++) { - char ch=document.charAt(j); - if (Character.isWhitespace(ch) || !Character.isLetterOrDigit(ch)) { - nextpos = j; - } - } - - if (nextpos == -1) { - nextpos = pos; - } - - ret.put(ModelObject.END_POSITION, new Integer(nextpos)); - } - } - } - } - - return (ret); - } -} diff --git a/modules/parser/src/main/java/org/scribble/parser/antlr/AbstractModelAdaptor.java b/modules/parser/src/main/java/org/scribble/parser/antlr/AbstractModelAdaptor.java deleted file mode 100644 index ffa945b0d..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/antlr/AbstractModelAdaptor.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser.antlr; - -import org.antlr.runtime.CommonToken; -import org.scribble.model.ModelObject; - -/** - * This class provides the absteact based implementation for a model adapter. - * - */ -public abstract class AbstractModelAdaptor implements ModelAdaptor { - - /** - * This method sets the start properties on the supplied model object. - * - * @param mobj The model object - * @param source The source object - */ - protected void setStartProperties(ModelObject mobj, Object source) { - if (source instanceof CommonToken) { - mobj.getProperties().put(ModelObject.START_LINE, ((CommonToken)source).getLine()); - mobj.getProperties().put(ModelObject.START_COLUMN, ((CommonToken)source).getCharPositionInLine()); - } else if (source instanceof ModelObject) { - mobj.getProperties().put(ModelObject.START_LINE, ((ModelObject)source).getProperties().get(ModelObject.START_LINE)); - mobj.getProperties().put(ModelObject.START_COLUMN, ((ModelObject)source).getProperties().get(ModelObject.START_COLUMN)); - } - } - - /** - * This method sets the end properties on the supplied model object. - * - * @param mobj The model object - * @param source The source object - */ - protected void setEndProperties(ModelObject mobj, Object source) { - if (source instanceof CommonToken) { - mobj.getProperties().put(ModelObject.END_LINE, ((CommonToken)source).getLine()); - mobj.getProperties().put(ModelObject.END_COLUMN, ((CommonToken)source).getCharPositionInLine() - +((CommonToken)source).getText().length()); - } else if (source instanceof ModelObject) { - mobj.getProperties().put(ModelObject.END_LINE, ((ModelObject)source).getProperties().get(ModelObject.END_LINE)); - mobj.getProperties().put(ModelObject.END_COLUMN, ((ModelObject)source).getProperties().get(ModelObject.END_COLUMN)); - } - } -} diff --git a/modules/parser/src/main/java/org/scribble/parser/antlr/ArgumentListModelAdaptor.java b/modules/parser/src/main/java/org/scribble/parser/antlr/ArgumentListModelAdaptor.java deleted file mode 100644 index 271121055..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/antlr/ArgumentListModelAdaptor.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser.antlr; - -import org.antlr.runtime.CommonToken; -import org.scribble.model.Argument; - -/** - * This class provides the model adapter for the 'argumentList' parser rule. - * - */ -public class ArgumentListModelAdaptor extends AbstractModelAdaptor { - - /** - * {@inheritDoc} - */ - public Object createModelObject(ParserContext context) { - java.util.List ret=new java.util.ArrayList(); - boolean f_iterate=false; - - context.pop(); // > - - do { - f_iterate = false; - - ret.add(0, (Argument)context.pop()); - - if (context.peek() instanceof CommonToken - && ((CommonToken)context.peek()).getText().equals(",")) { - context.pop(); // , - f_iterate = true; - } - } while (f_iterate); - - context.pop(); // < - - context.push(ret); - - return ret; - } - -} diff --git a/modules/parser/src/main/java/org/scribble/parser/antlr/ArgumentModelAdaptor.java b/modules/parser/src/main/java/org/scribble/parser/antlr/ArgumentModelAdaptor.java deleted file mode 100644 index 9e3027352..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/antlr/ArgumentModelAdaptor.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser.antlr; - -import org.antlr.runtime.CommonToken; -import org.scribble.model.Argument; -import org.scribble.model.MessageSignature; - -/** - * This class provides the model adapter for the 'messageSignature' parser rule. - * - */ -public class ArgumentModelAdaptor extends AbstractModelAdaptor { - - /** - * {@inheritDoc} - */ - public Object createModelObject(ParserContext context) { - - Argument ret=new Argument(); - - if (context.peek() instanceof CommonToken) { - CommonToken end=(CommonToken)context.pop(); - - ret.setAlias(end.getText()); - - setEndProperties(ret, end); - - if (context.peek() instanceof CommonToken && - ((CommonToken)context.peek()).getText().equals("as")) { - context.pop(); // consume 'as' - - if (context.peek() instanceof MessageSignature) { - ret.setMessageSignature((MessageSignature)context.pop()); - - setStartProperties(ret, ret.getMessageSignature()); - } else { - CommonToken nameToken=(CommonToken)context.pop(); - - ret.setName(nameToken.getText()); - - setStartProperties(ret, nameToken); - } - } else { - ret.setName(ret.getAlias()); - ret.setAlias(null); - - setStartProperties(ret, end); - } - } else if (context.peek() instanceof MessageSignature) { - ret.setMessageSignature((MessageSignature)context.pop()); - - setStartProperties(ret, ret.getMessageSignature()); - setEndProperties(ret, ret.getMessageSignature()); - } - - context.push(ret); - - return ret; - } - -} diff --git a/modules/parser/src/main/java/org/scribble/parser/antlr/DefaultParserContext.java b/modules/parser/src/main/java/org/scribble/parser/antlr/DefaultParserContext.java deleted file mode 100644 index 4e8be7e27..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/antlr/DefaultParserContext.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser.antlr; - -/** - * This interface represents the context used by - * the parser. - * - */ -public class DefaultParserContext implements ParserContext { - - private java.util.Stack _components=new java.util.Stack(); - - /** - * {@inheritDoc} - */ - public Object pop() { - return (_components.pop()); - } - - /** - * {@inheritDoc} - */ - public Object peek() { - return (_components.peek()); - } - - /** - * {@inheritDoc} - */ - public void push(Object obj) { - _components.push(obj); - } - -} diff --git a/modules/parser/src/main/java/org/scribble/parser/antlr/GlobalChoiceModelAdaptor.java b/modules/parser/src/main/java/org/scribble/parser/antlr/GlobalChoiceModelAdaptor.java deleted file mode 100644 index 7fe2e7a48..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/antlr/GlobalChoiceModelAdaptor.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser.antlr; - -import org.antlr.runtime.CommonToken; -import org.scribble.model.Role; -import org.scribble.model.global.GBlock; -import org.scribble.model.global.GChoice; - -/** - * This class provides the model adapter for the 'choice' parser rule. - * - */ -public class GlobalChoiceModelAdaptor extends AbstractModelAdaptor { - - /** - * {@inheritDoc} - */ - public Object createModelObject(ParserContext context) { - GChoice ret=new GChoice(); - - setEndProperties(ret, context.peek()); - - while (context.peek() instanceof GBlock) { - ret.getPaths().add(0, (GBlock)context.pop()); - - if (context.peek() instanceof CommonToken - && ((CommonToken)context.peek()).getText().equals("or")) { - context.pop(); - } - } - - Role r=new Role(); - - setStartProperties(r, context.peek()); - setEndProperties(r, context.peek()); - - r.setName(((CommonToken)context.pop()).getText()); - - ret.setRole(r); - - context.pop(); // at - - setStartProperties(ret, context.pop()); // choice - - context.push(ret); - - return ret; - } - -} diff --git a/modules/parser/src/main/java/org/scribble/parser/antlr/GlobalContinueModelAdaptor.java b/modules/parser/src/main/java/org/scribble/parser/antlr/GlobalContinueModelAdaptor.java deleted file mode 100644 index 61eda8881..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/antlr/GlobalContinueModelAdaptor.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser.antlr; - -import org.antlr.runtime.CommonToken; -import org.scribble.model.global.GContinue; - -/** - * This class provides the model adapter for the 'continue' parser rule. - * - */ -public class GlobalContinueModelAdaptor extends AbstractModelAdaptor { - - /** - * {@inheritDoc} - */ - public Object createModelObject(ParserContext context) { - GContinue ret=new GContinue(); - - setEndProperties(ret, context.pop()); // ';' - - ret.setLabel(((CommonToken)context.pop()).getText()); - - setStartProperties(ret, context.pop()); // continue - - context.push(ret); - - return ret; - } - -} diff --git a/modules/parser/src/main/java/org/scribble/parser/antlr/GlobalDoModelAdaptor.java b/modules/parser/src/main/java/org/scribble/parser/antlr/GlobalDoModelAdaptor.java deleted file mode 100644 index f82c4b38a..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/antlr/GlobalDoModelAdaptor.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser.antlr; - -import org.antlr.runtime.CommonToken; -import org.scribble.model.Argument; -import org.scribble.model.RoleInstantiation; -import org.scribble.model.global.GDo; - -/** - * This class provides the model adapter for the 'doDef' parser rule. - * - */ -public class GlobalDoModelAdaptor extends AbstractModelAdaptor { - - /** - * {@inheritDoc} - */ - @SuppressWarnings("unchecked") - public Object createModelObject(ParserContext context) { - GDo ret=new GDo(); - - setEndProperties(ret, context.pop()); // ';' - - ret.getRoleInstantiations().addAll((java.util.List)context.pop()); - - if (context.peek() instanceof java.util.List) { - ret.getArguments().addAll((java.util.List)context.pop()); - } - - StringBuffer protocol=new StringBuffer(((CommonToken)context.pop()).getText()); - - // Check for module and set as separate property - while (context.peek() instanceof CommonToken - && ((CommonToken)context.peek()).getText().equals(".")) { - context.pop(); // consume '.' - - protocol.insert(0, "."); - - protocol.insert(0, ((CommonToken)context.pop()).getText()); - } - - ret.setProtocol(protocol.toString()); - - if (context.peek() instanceof CommonToken - && ((CommonToken)context.peek()).getText().equals(":")) { - context.pop(); // consume ':' - - ret.setScope(((CommonToken)context.pop()).getText()); - } - - setStartProperties(ret, context.pop()); // do - - context.push(ret); - - return ret; - } - -} diff --git a/modules/parser/src/main/java/org/scribble/parser/antlr/GlobalInterruptModelAdaptor.java b/modules/parser/src/main/java/org/scribble/parser/antlr/GlobalInterruptModelAdaptor.java deleted file mode 100644 index c49cbb37c..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/antlr/GlobalInterruptModelAdaptor.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser.antlr; - -import org.antlr.runtime.CommonToken; -import org.scribble.model.Message; -import org.scribble.model.Role; -import org.scribble.model.global.GInterruptible; - -/** - * This class provides the model adapter for the 'interruptible' parser rule. - * - */ -public class GlobalInterruptModelAdaptor extends AbstractModelAdaptor { - - /** - * {@inheritDoc} - */ - public Object createModelObject(ParserContext context) { - GInterruptible.Interrupt ret=new GInterruptible.Interrupt(); - - setEndProperties(ret, context.pop()); // ';' - - Role r=new Role(); - - setStartProperties(r, context.peek()); - setEndProperties(r, context.peek()); - - r.setName(((CommonToken)context.pop()).getText()); - - ret.setRole(r); - - context.pop(); // 'by' - - ret.getMessages().add((Message)context.pop()); - - while (context.peek() instanceof CommonToken && - ((CommonToken)context.peek()).getText().equals(",")) { - context.pop(); // ',' - - ret.getMessages().add(0, (Message)context.pop()); - } - - setStartProperties(ret, ret.getMessages().get(0)); - - context.push(ret); - - return ret; - } - -} diff --git a/modules/parser/src/main/java/org/scribble/parser/antlr/GlobalInterruptibleModelAdaptor.java b/modules/parser/src/main/java/org/scribble/parser/antlr/GlobalInterruptibleModelAdaptor.java deleted file mode 100644 index d186da9c6..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/antlr/GlobalInterruptibleModelAdaptor.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser.antlr; - -import org.antlr.runtime.CommonToken; -import org.scribble.model.global.GBlock; -import org.scribble.model.global.GInterruptible; - -/** - * This class provides the model adapter for the 'interruptible' parser rule. - * - */ -public class GlobalInterruptibleModelAdaptor extends AbstractModelAdaptor { - - /** - * {@inheritDoc} - */ - public Object createModelObject(ParserContext context) { - GInterruptible ret=new GInterruptible(); - - setEndProperties(ret, context.pop()); // '}' - - while (context.peek() instanceof GInterruptible.Interrupt) { - ret.getInterrupts().add(0, (GInterruptible.Interrupt)context.pop()); - } - - context.pop(); // '{' - - context.pop(); // 'with' - - ret.setBlock((GBlock)context.pop()); - - if (((CommonToken)context.peek()).getText().equals(":")) { - context.pop(); // ':' - - ret.setScope(((CommonToken)context.pop()).getText()); - } - - setStartProperties(ret, context.pop()); // interruptible - - context.push(ret); - - return ret; - } - -} diff --git a/modules/parser/src/main/java/org/scribble/parser/antlr/GlobalMessageTransferModelAdaptor.java b/modules/parser/src/main/java/org/scribble/parser/antlr/GlobalMessageTransferModelAdaptor.java deleted file mode 100644 index fb9f31093..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/antlr/GlobalMessageTransferModelAdaptor.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser.antlr; - -import org.antlr.runtime.CommonToken; -import org.scribble.model.Message; -import org.scribble.model.Role; -import org.scribble.model.global.GMessageTransfer; - -/** - * This class provides the model adapter for the 'message' parser rule. - * - */ -public class GlobalMessageTransferModelAdaptor extends AbstractModelAdaptor { - - /** - * {@inheritDoc} - */ - public Object createModelObject(ParserContext context) { - GMessageTransfer ret=new GMessageTransfer(); - - setEndProperties(ret, context.pop()); // ';' - - Role r=new Role(); - - setStartProperties(r, context.peek()); - setEndProperties(r, context.peek()); - - r.setName(((CommonToken)context.pop()).getText()); - - ret.getToRoles().add(r); - - while (context.peek() instanceof CommonToken - && ((CommonToken)context.peek()).getText().equals(",")) { - context.pop(); // ',' - - r = new Role(); - - setStartProperties(r, context.peek()); - setEndProperties(r, context.peek()); - - r.setName(((CommonToken)context.pop()).getText()); - - ret.getToRoles().add(0, r); - } - - context.pop(); // to - - r = new Role(); - - setStartProperties(r, context.peek()); - setEndProperties(r, context.peek()); - - r.setName(((CommonToken)context.pop()).getText()); - - ret.setFromRole(r); - - context.pop(); // from - - ret.setMessage((Message)context.pop()); - - setStartProperties(ret, ret.getMessage()); - - context.push(ret); - - return ret; - } - -} diff --git a/modules/parser/src/main/java/org/scribble/parser/antlr/GlobalParallelModelAdaptor.java b/modules/parser/src/main/java/org/scribble/parser/antlr/GlobalParallelModelAdaptor.java deleted file mode 100644 index 07c46821b..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/antlr/GlobalParallelModelAdaptor.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser.antlr; - -import org.antlr.runtime.CommonToken; -import org.scribble.model.global.GBlock; -import org.scribble.model.global.GParallel; - -/** - * This class provides the model adapter for the 'parallel' parser rule. - * - */ -public class GlobalParallelModelAdaptor extends AbstractModelAdaptor { - - /** - * {@inheritDoc} - */ - public Object createModelObject(ParserContext context) { - GParallel ret=new GParallel(); - - while (context.peek() instanceof GBlock) { - ret.getPaths().add(0, (GBlock)context.pop()); - - if (context.peek() instanceof CommonToken - && ((CommonToken)context.peek()).getText().equals("and")) { - context.pop(); - } - } - - setEndProperties(ret, ret.getPaths().get(ret.getPaths().size()-1)); - - setStartProperties(ret, context.pop()); // par - - context.push(ret); - - return ret; - } - -} diff --git a/modules/parser/src/main/java/org/scribble/parser/antlr/GlobalProtocolBlockModelAdaptor.java b/modules/parser/src/main/java/org/scribble/parser/antlr/GlobalProtocolBlockModelAdaptor.java deleted file mode 100644 index f41a27296..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/antlr/GlobalProtocolBlockModelAdaptor.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser.antlr; - -import org.scribble.model.global.GActivity; -import org.scribble.model.global.GBlock; - -/** - * This class provides the model adapter for the 'globalInterationBlock' parser rule. - * - */ -public class GlobalProtocolBlockModelAdaptor extends AbstractModelAdaptor { - - /** - * {@inheritDoc} - */ - public Object createModelObject(ParserContext context) { - GBlock ret=new GBlock(); - - setEndProperties(ret, context.pop()); // consume } - - while (context.peek() instanceof GActivity) { - ret.getContents().add(0, (GActivity)context.pop()); - } - - setStartProperties(ret, context.pop()); // consume { - - context.push(ret); - - return ret; - } - -} diff --git a/modules/parser/src/main/java/org/scribble/parser/antlr/GlobalProtocolDeclModelAdaptor.java b/modules/parser/src/main/java/org/scribble/parser/antlr/GlobalProtocolDeclModelAdaptor.java deleted file mode 100644 index 2b913b273..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/antlr/GlobalProtocolDeclModelAdaptor.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser.antlr; - -import org.antlr.runtime.CommonToken; -import org.scribble.model.Argument; -import org.scribble.model.ParameterDecl; -import org.scribble.model.ProtocolDecl; -import org.scribble.model.RoleDecl; -import org.scribble.model.RoleInstantiation; -import org.scribble.model.global.GBlock; -import org.scribble.model.global.GProtocolDefinition; -import org.scribble.model.global.GProtocolInstance; - -/** - * This class provides the model adapter for the 'globalProtocolDecl' parser rule. - * - */ -public class GlobalProtocolDeclModelAdaptor extends AbstractModelAdaptor { - - /** - * {@inheritDoc} - */ - @SuppressWarnings("unchecked") - public Object createModelObject(ParserContext context) { - ProtocolDecl ret=null; - - if (context.peek() instanceof GBlock) { - ret = new GProtocolDefinition(); - - setEndProperties(ret, context.peek()); - - ((GProtocolDefinition)ret).setBlock((GBlock)context.pop()); - } else { - ret = new GProtocolInstance(); - - setEndProperties(ret, context.pop()); // consume ; - - ((GProtocolInstance)ret).getRoleInstantiations().addAll((java.util.List)context.pop()); - - if (context.peek() instanceof java.util.List) { - ((GProtocolInstance)ret).getArguments().addAll((java.util.List)context.pop()); - } - - StringBuffer protocol=new StringBuffer(((CommonToken)context.pop()).getText()); - - // Check for module and set as separate property - while (context.peek() instanceof CommonToken - && ((CommonToken)context.peek()).getText().equals(".")) { - context.pop(); // consume '.' - - protocol.insert(0, "."); - - protocol.insert(0, ((CommonToken)context.pop()).getText()); - } - - ((GProtocolInstance)ret).setMemberName(protocol.toString()); - - context.pop(); // instantiates - } - - ret.getRoleDeclarations().addAll((java.util.List)context.pop()); - - if (context.peek() instanceof java.util.List) { - ret.getParameterDeclarations().addAll((java.util.List)context.pop()); - } - - ret.setName(((CommonToken)context.pop()).getText()); - - context.pop(); // protocol - - setStartProperties(ret, context.pop()); // global - - context.push(ret); - - return ret; - } - -} diff --git a/modules/parser/src/main/java/org/scribble/parser/antlr/GlobalRecursionModelAdaptor.java b/modules/parser/src/main/java/org/scribble/parser/antlr/GlobalRecursionModelAdaptor.java deleted file mode 100644 index 1276eb24e..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/antlr/GlobalRecursionModelAdaptor.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser.antlr; - -import org.antlr.runtime.CommonToken; -import org.scribble.model.global.GBlock; -import org.scribble.model.global.GRecursion; - -/** - * This class provides the model adapter for the 'recursion' parser rule. - * - */ -public class GlobalRecursionModelAdaptor extends AbstractModelAdaptor { - - /** - * {@inheritDoc} - */ - public Object createModelObject(ParserContext context) { - GRecursion ret=new GRecursion(); - - setEndProperties(ret, context.peek()); - - ret.setBlock((GBlock)context.pop()); - - ret.setLabel(((CommonToken)context.pop()).getText()); - - setStartProperties(ret, context.pop()); // rec - - context.push(ret); - - return ret; - } - -} diff --git a/modules/parser/src/main/java/org/scribble/parser/antlr/ImportDeclModelAdaptor.java b/modules/parser/src/main/java/org/scribble/parser/antlr/ImportDeclModelAdaptor.java deleted file mode 100644 index e7661d11d..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/antlr/ImportDeclModelAdaptor.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser.antlr; - -import org.antlr.runtime.CommonToken; -import org.scribble.model.ImportDecl; - -/** - * This class provides the model adapter for the 'importDecl' parser rule. - * - */ -public class ImportDeclModelAdaptor extends AbstractModelAdaptor { - - /** - * {@inheritDoc} - */ - public Object createModelObject(ParserContext context) { - - ImportDecl ret=new ImportDecl(); - - setEndProperties(ret, context.pop()); // consume ';' - - String text=((CommonToken)context.pop()).getText(); - - if (((CommonToken)context.peek()).getText().equals("as")) { - context.pop(); // as - ret.setAlias(text); - - ret.setMemberName(((CommonToken)context.pop()).getText()); - - context.pop(); // import - - text=((CommonToken)context.pop()).getText(); - } else if (((CommonToken)context.peek()).getText().equals("import")) { - context.pop(); // import - - ret.setMemberName(text); - - text=((CommonToken)context.pop()).getText(); - } - - while (((CommonToken)context.peek()).getText().equals(".")) { - text = ((CommonToken)context.pop()).getText()+text; - text = ((CommonToken)context.pop()).getText()+text; - } - - ret.setModuleName(text); - - setStartProperties(ret, context.pop()); // consume 'from' or 'import' depending on which path was taken - - /* Import first approach.... - * - * - String text=((CommonToken)context.pop()).getText(); - - if (((CommonToken)context.peek()).getText().equals("as")) { - context.pop(); // as - ret.setAlias(text); - - text=((CommonToken)context.pop()).getText(); - } - - while (((CommonToken)context.peek()).getText().equals(".")) { - text = ((CommonToken)context.pop()).getText()+text; - text = ((CommonToken)context.pop()).getText()+text; - } - - ret.setModuleName(new FullyQualifiedName(text)); - - if (((CommonToken)context.peek()).getText().equals("from")) { - context.pop(); // from - ret.setMemberName(((CommonToken)context.pop()).getText()); - } - - context.pop(); // import - */ - - context.push(ret); - - return ret; - } - -} diff --git a/modules/parser/src/main/java/org/scribble/parser/antlr/LocalCatchModelAdaptor.java b/modules/parser/src/main/java/org/scribble/parser/antlr/LocalCatchModelAdaptor.java deleted file mode 100644 index ef27a1389..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/antlr/LocalCatchModelAdaptor.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser.antlr; - -import org.antlr.runtime.CommonToken; -import org.scribble.model.Message; -import org.scribble.model.Role; -import org.scribble.model.local.LInterruptible; - -/** - * This class provides the model adapter for the 'interruptible' parser rule. - * - */ -public class LocalCatchModelAdaptor extends AbstractModelAdaptor { - - /** - * {@inheritDoc} - */ - public Object createModelObject(ParserContext context) { - LInterruptible.Catch ret=new LInterruptible.Catch(); - - setEndProperties(ret, context.pop()); // ';' - - Role r=new Role(); - - setStartProperties(r, context.peek()); - setEndProperties(r, context.peek()); - - r.setName(((CommonToken)context.pop()).getText()); - - ret.setRole(r); - - context.pop(); // 'from' - - ret.getMessages().add((Message)context.pop()); - - while (context.peek() instanceof CommonToken && - ((CommonToken)context.peek()).getText().equals(",")) { - context.pop(); // ',' - - ret.getMessages().add(0, (Message)context.pop()); - } - - setStartProperties(ret, context.pop()); // 'catches' - - context.push(ret); - - return ret; - } - -} diff --git a/modules/parser/src/main/java/org/scribble/parser/antlr/LocalChoiceModelAdaptor.java b/modules/parser/src/main/java/org/scribble/parser/antlr/LocalChoiceModelAdaptor.java deleted file mode 100644 index 1df8884fb..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/antlr/LocalChoiceModelAdaptor.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser.antlr; - -import org.antlr.runtime.CommonToken; -import org.scribble.model.Role; -import org.scribble.model.local.LBlock; -import org.scribble.model.local.LChoice; - -/** - * This class provides the model adapter for the 'localChoice' parser rule. - * - */ -public class LocalChoiceModelAdaptor extends AbstractModelAdaptor { - - /** - * {@inheritDoc} - */ - public Object createModelObject(ParserContext context) { - LChoice ret=new LChoice(); - - setEndProperties(ret, context.peek()); - - while (context.peek() instanceof LBlock) { - ret.getPaths().add(0, (LBlock)context.pop()); - - if (context.peek() instanceof CommonToken - && ((CommonToken)context.peek()).getText().equals("or")) { - context.pop(); - } - } - - Role r=new Role(); - - setStartProperties(r, context.peek()); - setEndProperties(r, context.peek()); - - r.setName(((CommonToken)context.pop()).getText()); - - ret.setRole(r); - - context.pop(); // at - - setStartProperties(ret, context.pop()); // choice - - context.push(ret); - - return ret; - } - -} diff --git a/modules/parser/src/main/java/org/scribble/parser/antlr/LocalContinueModelAdaptor.java b/modules/parser/src/main/java/org/scribble/parser/antlr/LocalContinueModelAdaptor.java deleted file mode 100644 index 382e647b9..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/antlr/LocalContinueModelAdaptor.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser.antlr; - -import org.antlr.runtime.CommonToken; -import org.scribble.model.local.LContinue; - -/** - * This class provides the model adapter for the 'localContinue' parser rule. - * - */ -public class LocalContinueModelAdaptor extends AbstractModelAdaptor { - - /** - * {@inheritDoc} - */ - public Object createModelObject(ParserContext context) { - LContinue ret=new LContinue(); - - setEndProperties(ret, context.pop()); // ';' - - ret.setLabel(((CommonToken)context.pop()).getText()); - - setStartProperties(ret, context.pop()); // continue - - context.push(ret); - - return ret; - } - -} diff --git a/modules/parser/src/main/java/org/scribble/parser/antlr/LocalDoModelAdaptor.java b/modules/parser/src/main/java/org/scribble/parser/antlr/LocalDoModelAdaptor.java deleted file mode 100644 index ddcc60c06..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/antlr/LocalDoModelAdaptor.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser.antlr; - -import org.antlr.runtime.CommonToken; -import org.scribble.model.Argument; -import org.scribble.model.RoleInstantiation; -import org.scribble.model.local.LDo; - -/** - * This class provides the model adapter for the 'doDef' parser rule. - * - */ -public class LocalDoModelAdaptor extends AbstractModelAdaptor { - - /** - * {@inheritDoc} - */ - @SuppressWarnings("unchecked") - public Object createModelObject(ParserContext context) { - LDo ret=new LDo(); - - setEndProperties(ret, context.pop()); // ';' - - ret.getRoleInstantiations().addAll((java.util.List)context.pop()); - - if (context.peek() instanceof java.util.List) { - ret.getArguments().addAll((java.util.List)context.pop()); - } - - StringBuffer protocol=new StringBuffer(((CommonToken)context.pop()).getText()); - - // Check for module and set as separate property - while (context.peek() instanceof CommonToken - && ((CommonToken)context.peek()).getText().equals(".")) { - context.pop(); // consume '.' - - protocol.insert(0, "."); - - protocol.insert(0, ((CommonToken)context.pop()).getText()); - } - - ret.setProtocol(protocol.toString()); - - if (context.peek() instanceof CommonToken - && ((CommonToken)context.peek()).getText().equals(":")) { - context.pop(); // consume ':' - - ret.setScope(((CommonToken)context.pop()).getText()); - } - - setStartProperties(ret, context.pop()); // do - - context.push(ret); - - return ret; - } - -} diff --git a/modules/parser/src/main/java/org/scribble/parser/antlr/LocalInterruptibleModelAdaptor.java b/modules/parser/src/main/java/org/scribble/parser/antlr/LocalInterruptibleModelAdaptor.java deleted file mode 100644 index a7eab7c80..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/antlr/LocalInterruptibleModelAdaptor.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser.antlr; - -import org.antlr.runtime.CommonToken; -import org.scribble.model.local.LBlock; -import org.scribble.model.local.LInterruptible; - -/** - * This class provides the model adapter for the 'interruptible' parser rule. - * - */ -public class LocalInterruptibleModelAdaptor extends AbstractModelAdaptor { - - /** - * {@inheritDoc} - */ - public Object createModelObject(ParserContext context) { - LInterruptible ret=new LInterruptible(); - - setEndProperties(ret, context.pop()); // '}' - - while (context.peek() instanceof LInterruptible.Catch) { - ret.getCatches().add(0, (LInterruptible.Catch)context.pop()); - } - - if (context.peek() instanceof LInterruptible.Throw) { - ret.setThrows((LInterruptible.Throw)context.pop()); - } - - context.pop(); // '{' - - context.pop(); // with - - ret.setBlock((LBlock)context.pop()); - - if (((CommonToken)context.peek()).getText().equals(":")) { - context.pop(); // ':' - - ret.setScope(((CommonToken)context.pop()).getText()); - } - - setStartProperties(ret, context.pop()); // interruptible - - context.push(ret); - - return ret; - } - -} diff --git a/modules/parser/src/main/java/org/scribble/parser/antlr/LocalParallelModelAdaptor.java b/modules/parser/src/main/java/org/scribble/parser/antlr/LocalParallelModelAdaptor.java deleted file mode 100644 index 02b208066..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/antlr/LocalParallelModelAdaptor.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser.antlr; - -import org.antlr.runtime.CommonToken; -import org.scribble.model.local.LBlock; -import org.scribble.model.local.LParallel; - -/** - * This class provides the model adapter for the 'localParallel' parser rule. - * - */ -public class LocalParallelModelAdaptor extends AbstractModelAdaptor { - - /** - * {@inheritDoc} - */ - public Object createModelObject(ParserContext context) { - LParallel ret=new LParallel(); - - setEndProperties(ret, context.peek()); - - while (context.peek() instanceof LBlock) { - ret.getPaths().add(0, (LBlock)context.pop()); - - if (context.peek() instanceof CommonToken - && ((CommonToken)context.peek()).getText().equals("and")) { - context.pop(); - } - } - - setStartProperties(ret, context.pop()); // par - - context.push(ret); - - return ret; - } - -} diff --git a/modules/parser/src/main/java/org/scribble/parser/antlr/LocalProtocolBlockModelAdaptor.java b/modules/parser/src/main/java/org/scribble/parser/antlr/LocalProtocolBlockModelAdaptor.java deleted file mode 100644 index 6ab88875e..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/antlr/LocalProtocolBlockModelAdaptor.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser.antlr; - -import org.scribble.model.local.LActivity; -import org.scribble.model.local.LBlock; - -/** - * This class provides the model adapter for the 'localInteractionBlock' parser rule. - * - */ -public class LocalProtocolBlockModelAdaptor extends AbstractModelAdaptor { - - /** - * {@inheritDoc} - */ - public Object createModelObject(ParserContext context) { - LBlock ret=new LBlock(); - - setEndProperties(ret, context.pop()); // consume } - - while (context.peek() instanceof LActivity) { - ret.getContents().add(0, (LActivity)context.pop()); - } - - setStartProperties(ret, context.pop()); // consume { - - context.push(ret); - - return ret; - } - -} diff --git a/modules/parser/src/main/java/org/scribble/parser/antlr/LocalProtocolDeclModelAdaptor.java b/modules/parser/src/main/java/org/scribble/parser/antlr/LocalProtocolDeclModelAdaptor.java deleted file mode 100644 index f3176fd2f..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/antlr/LocalProtocolDeclModelAdaptor.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser.antlr; - -import org.antlr.runtime.CommonToken; -import org.scribble.model.Argument; -import org.scribble.model.ParameterDecl; -import org.scribble.model.ProtocolDecl; -import org.scribble.model.Role; -import org.scribble.model.RoleDecl; -import org.scribble.model.RoleInstantiation; -import org.scribble.model.local.LBlock; -import org.scribble.model.local.LProtocolDefinition; -import org.scribble.model.local.LProtocolInstance; - -/** - * This class provides the model adapter for the 'localProtocolDecl' parser rule. - * - */ -public class LocalProtocolDeclModelAdaptor extends AbstractModelAdaptor { - - /** - * {@inheritDoc} - */ - @SuppressWarnings("unchecked") - public Object createModelObject(ParserContext context) { - ProtocolDecl ret=null; - - if (context.peek() instanceof LBlock) { - ret = new LProtocolDefinition(); - - setEndProperties(ret, context.peek()); - - ((LProtocolDefinition)ret).setBlock((LBlock)context.pop()); - } else { - ret = new LProtocolInstance(); - - setEndProperties(ret, context.pop()); // consume ; - - ((LProtocolInstance)ret).getRoleInstantiations().addAll((java.util.List)context.pop()); - - if (context.peek() instanceof java.util.List) { - ((LProtocolInstance)ret).getArguments().addAll((java.util.List)context.pop()); - } - - ((LProtocolInstance)ret).setMemberName(((CommonToken)context.pop()).getText()); - - context.pop(); // instantiates - - } - - ret.getRoleDeclarations().addAll((java.util.List)context.pop()); - - if (context.peek() instanceof java.util.List) { - ret.getParameterDeclarations().addAll((java.util.List)context.pop()); - } - - if (ret instanceof LProtocolDefinition) { - Role r=new Role(); - - setStartProperties(r, context.peek()); - setEndProperties(r, context.peek()); - - r.setName(((CommonToken)context.pop()).getText()); - - ((LProtocolDefinition)ret).setLocalRole(r); - } else if (ret instanceof LProtocolInstance) { - Role r=new Role(); - - setStartProperties(r, context.peek()); - setEndProperties(r, context.peek()); - - r.setName(((CommonToken)context.pop()).getText()); - - ((LProtocolInstance)ret).setLocalRole(r); - } - - context.pop(); // at - - ret.setName(((CommonToken)context.pop()).getText()); - - context.pop(); // protocol - - setStartProperties(ret, context.pop()); // local - - context.push(ret); - - return ret; - } - -} diff --git a/modules/parser/src/main/java/org/scribble/parser/antlr/LocalReceiveModelAdaptor.java b/modules/parser/src/main/java/org/scribble/parser/antlr/LocalReceiveModelAdaptor.java deleted file mode 100644 index 1fc15d9b1..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/antlr/LocalReceiveModelAdaptor.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser.antlr; - -import org.antlr.runtime.CommonToken; -import org.scribble.model.Message; -import org.scribble.model.Role; -import org.scribble.model.local.LReceive; - -/** - * This class provides the model adapter for the 'receive' parser rule. - * - */ -public class LocalReceiveModelAdaptor extends AbstractModelAdaptor { - - /** - * {@inheritDoc} - */ - public Object createModelObject(ParserContext context) { - - LReceive ret=new LReceive(); - - setEndProperties(ret, context.pop()); // ';' - - Role r=new Role(); - - setStartProperties(r, context.peek()); - setEndProperties(r, context.peek()); - - r.setName(((CommonToken)context.pop()).getText()); - - ret.setFromRole(r); - - context.pop(); // from - - ret.setMessage((Message)context.pop()); - - setStartProperties(ret, ret.getMessage()); - - context.push(ret); - - return ret; - } - -} diff --git a/modules/parser/src/main/java/org/scribble/parser/antlr/LocalRecursionModelAdaptor.java b/modules/parser/src/main/java/org/scribble/parser/antlr/LocalRecursionModelAdaptor.java deleted file mode 100644 index f2ed5d2db..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/antlr/LocalRecursionModelAdaptor.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser.antlr; - -import org.antlr.runtime.CommonToken; -import org.scribble.model.local.LBlock; -import org.scribble.model.local.LRecursion; - -/** - * This class provides the model adapter for the 'localRecursion' parser rule. - * - */ -public class LocalRecursionModelAdaptor extends AbstractModelAdaptor { - - /** - * {@inheritDoc} - */ - public Object createModelObject(ParserContext context) { - LRecursion ret=new LRecursion(); - - setEndProperties(ret, context.peek()); - - ret.setBlock((LBlock)context.pop()); - - ret.setLabel(((CommonToken)context.pop()).getText()); - - setStartProperties(ret, context.pop()); // rec - - context.push(ret); - - return ret; - } - -} diff --git a/modules/parser/src/main/java/org/scribble/parser/antlr/LocalSendModelAdaptor.java b/modules/parser/src/main/java/org/scribble/parser/antlr/LocalSendModelAdaptor.java deleted file mode 100644 index cbbd0df4f..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/antlr/LocalSendModelAdaptor.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser.antlr; - -import org.antlr.runtime.CommonToken; -import org.scribble.model.Message; -import org.scribble.model.Role; -import org.scribble.model.local.LSend; - -/** - * This class provides the model adapter for the 'send' parser rule. - * - */ -public class LocalSendModelAdaptor extends AbstractModelAdaptor { - - /** - * {@inheritDoc} - */ - public Object createModelObject(ParserContext context) { - - LSend ret=new LSend(); - - setEndProperties(ret, context.pop()); // ';' - - Role r=new Role(); - - setStartProperties(r, context.peek()); - setEndProperties(r, context.peek()); - - r.setName(((CommonToken)context.pop()).getText()); - - ret.getToRoles().add(r); - - while (context.peek() instanceof CommonToken - && ((CommonToken)context.peek()).getText().equals(",")) { - context.pop(); // ',' - - r = new Role(); - - setStartProperties(r, context.peek()); - setEndProperties(r, context.peek()); - - r.setName(((CommonToken)context.pop()).getText()); - - ret.getToRoles().add(0, r); - } - - context.pop(); // to - - ret.setMessage((Message)context.pop()); - - setStartProperties(ret, ret.getMessage()); - - context.push(ret); - - return ret; - } - -} diff --git a/modules/parser/src/main/java/org/scribble/parser/antlr/LocalThrowModelAdaptor.java b/modules/parser/src/main/java/org/scribble/parser/antlr/LocalThrowModelAdaptor.java deleted file mode 100644 index 70ed29583..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/antlr/LocalThrowModelAdaptor.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser.antlr; - -import org.antlr.runtime.CommonToken; -import org.scribble.model.Message; -import org.scribble.model.Role; -import org.scribble.model.local.LInterruptible; - -/** - * This class provides the model adapter for the 'interruptible' parser rule. - * - */ -public class LocalThrowModelAdaptor extends AbstractModelAdaptor { - - /** - * {@inheritDoc} - */ - public Object createModelObject(ParserContext context) { - LInterruptible.Throw ret=new LInterruptible.Throw(); - - setEndProperties(ret, context.pop()); // ';' - - Role r=new Role(); - - setStartProperties(r, context.peek()); - setEndProperties(r, context.peek()); - - r.setName(((CommonToken)context.pop()).getText()); - - ret.getToRoles().add(r); - - while (((CommonToken)context.peek()).getText().equals(",")) { - context.pop(); // ',' - - r = new Role(); - - setStartProperties(r, context.peek()); - setEndProperties(r, context.peek()); - - r.setName(((CommonToken)context.pop()).getText()); - - ret.getToRoles().add(r); - } - - context.pop(); // 'to' - - ret.getMessages().add((Message)context.pop()); - - while (context.peek() instanceof CommonToken && - ((CommonToken)context.peek()).getText().equals(",")) { - context.pop(); // ',' - - ret.getMessages().add(0, (Message)context.pop()); - } - - setStartProperties(ret, context.pop()); // 'throws' - - context.push(ret); - - return ret; - } - -} diff --git a/modules/parser/src/main/java/org/scribble/parser/antlr/MessageModelAdaptor.java b/modules/parser/src/main/java/org/scribble/parser/antlr/MessageModelAdaptor.java deleted file mode 100644 index 6f3fe4d51..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/antlr/MessageModelAdaptor.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser.antlr; - -import org.antlr.runtime.CommonToken; -import org.scribble.model.Message; -import org.scribble.model.MessageSignature; - -/** - * This class provides the model adapter for the 'messageSignature' parser rule. - * - */ -public class MessageModelAdaptor extends AbstractModelAdaptor { - - /** - * {@inheritDoc} - */ - public Object createModelObject(ParserContext context) { - - Message ret=new Message(); - - setStartProperties(ret, context.peek()); - setEndProperties(ret, context.peek()); - - if (context.peek() instanceof MessageSignature) { - ret.setMessageSignature((MessageSignature)context.pop()); - } else { - ret.setParameter(((CommonToken)context.pop()).getText()); - } - - context.push(ret); - - return ret; - } - -} diff --git a/modules/parser/src/main/java/org/scribble/parser/antlr/MessageSignatureModelAdaptor.java b/modules/parser/src/main/java/org/scribble/parser/antlr/MessageSignatureModelAdaptor.java deleted file mode 100644 index af1d717eb..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/antlr/MessageSignatureModelAdaptor.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser.antlr; - -import org.antlr.runtime.CommonToken; -import org.scribble.model.MessageSignature; -import org.scribble.model.PayloadElement; - -/** - * This class provides the model adapter for the 'messageSignature' parser rule. - * - */ -public class MessageSignatureModelAdaptor extends AbstractModelAdaptor { - - /** - * {@inheritDoc} - */ - public Object createModelObject(ParserContext context) { - - MessageSignature ret=new MessageSignature(); - - setEndProperties(ret, context.pop()); // consume ) - - while (context.peek() instanceof PayloadElement) { - ret.getPayloadElements().add(0, (PayloadElement)context.pop()); - - if (context.peek() instanceof CommonToken - && ((CommonToken)context.peek()).getText().equals(",")) { - context.pop(); // consume , - } - } - - context.pop(); // consume ( - - CommonToken op=(CommonToken)context.pop(); - - ret.setOperator(op.getText()); - - setStartProperties(ret, op); - - context.push(ret); - - return ret; - } - -} diff --git a/modules/parser/src/main/java/org/scribble/parser/antlr/ModelAdaptor.java b/modules/parser/src/main/java/org/scribble/parser/antlr/ModelAdaptor.java deleted file mode 100644 index 001b2da2e..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/antlr/ModelAdaptor.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser.antlr; - -/** - * This interface defines the model adapter for the parser rules. - * - */ -public interface ModelAdaptor { - - /** - * This method creates the model object(s) appropriate for the - * supplied stack of context, and returns them. - * - * @param context The parser context - * @return The created model object - */ - public Object createModelObject(ParserContext context); - -} diff --git a/modules/parser/src/main/java/org/scribble/parser/antlr/ModelAdaptorFactory.java b/modules/parser/src/main/java/org/scribble/parser/antlr/ModelAdaptorFactory.java deleted file mode 100644 index 67cf64cf6..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/antlr/ModelAdaptorFactory.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser.antlr; - -/** - * This class provides the model adaptor factory. - * - */ -public class ModelAdaptorFactory { - - private static java.util.Map _modelAdaptors=new java.util.HashMap(); - - static { - _modelAdaptors.put("argument", new ArgumentModelAdaptor()); - _modelAdaptors.put("argumentlist", new ArgumentListModelAdaptor()); - _modelAdaptors.put("globaldo", new GlobalDoModelAdaptor()); - _modelAdaptors.put("globalchoice", new GlobalChoiceModelAdaptor()); - _modelAdaptors.put("globalcontinue", new GlobalContinueModelAdaptor()); - _modelAdaptors.put("globalinterrupt", new GlobalInterruptModelAdaptor()); - _modelAdaptors.put("globalinterruptible", new GlobalInterruptibleModelAdaptor()); - _modelAdaptors.put("globalmessagetransfer", new GlobalMessageTransferModelAdaptor()); - _modelAdaptors.put("globalparallel", new GlobalParallelModelAdaptor()); - _modelAdaptors.put("globalprotocolblock", new GlobalProtocolBlockModelAdaptor()); - _modelAdaptors.put("globalprotocoldecl", new GlobalProtocolDeclModelAdaptor()); - _modelAdaptors.put("globalrecursion", new GlobalRecursionModelAdaptor()); - _modelAdaptors.put("importdecl", new ImportDeclModelAdaptor()); - _modelAdaptors.put("localcatch", new LocalCatchModelAdaptor()); - _modelAdaptors.put("localchoice", new LocalChoiceModelAdaptor()); - _modelAdaptors.put("localcontinue", new LocalContinueModelAdaptor()); - _modelAdaptors.put("localdo", new LocalDoModelAdaptor()); - _modelAdaptors.put("localinterruptible", new LocalInterruptibleModelAdaptor()); - _modelAdaptors.put("localprotocolblock", new LocalProtocolBlockModelAdaptor()); - _modelAdaptors.put("localparallel", new LocalParallelModelAdaptor()); - _modelAdaptors.put("localprotocoldecl", new LocalProtocolDeclModelAdaptor()); - _modelAdaptors.put("localreceive", new LocalReceiveModelAdaptor()); - _modelAdaptors.put("localrecursion", new LocalRecursionModelAdaptor()); - _modelAdaptors.put("localsend", new LocalSendModelAdaptor()); - _modelAdaptors.put("localthrow", new LocalThrowModelAdaptor()); - _modelAdaptors.put("message", new MessageModelAdaptor()); - _modelAdaptors.put("messagesignature", new MessageSignatureModelAdaptor()); - _modelAdaptors.put("parameterdecllist", new ParameterDeclListModelAdaptor()); - _modelAdaptors.put("parameterlist", new ParameterListModelAdaptor()); - _modelAdaptors.put("payloadelement", new PayloadModelAdaptor()); - _modelAdaptors.put("payloadtypedecl", new PayloadTypeDeclModelAdaptor()); - _modelAdaptors.put("module", new ModuleModelAdaptor()); - _modelAdaptors.put("roledecllist", new RoleDeclListModelAdaptor()); - _modelAdaptors.put("roleinstantiationlist", new RoleInstantiationListModelAdaptor()); - } - - /** - * This method returns the model adaptor implementation associated with - * the supplied rule name. - * - * @param ruleName The rule name - * @return The model adaptor, or null if not relevant - */ - public static ModelAdaptor getModelAdaptor(String ruleName) { - return (_modelAdaptors.get(ruleName)); - } -} diff --git a/modules/parser/src/main/java/org/scribble/parser/antlr/ModuleModelAdaptor.java b/modules/parser/src/main/java/org/scribble/parser/antlr/ModuleModelAdaptor.java deleted file mode 100644 index 4ab56dbb6..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/antlr/ModuleModelAdaptor.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser.antlr; - -import org.antlr.runtime.CommonToken; -import org.scribble.model.ImportDecl; -import org.scribble.model.Module; -import org.scribble.model.PayloadTypeDecl; -import org.scribble.model.ProtocolDecl; - -/** - * This class provides the model adapter for the 'module' parser rule. - * - */ -public class ModuleModelAdaptor extends AbstractModelAdaptor { - - /** - * {@inheritDoc} - */ - public Object createModelObject(ParserContext context) { - Module ret=new Module(); - - setEndProperties(ret, context.peek()); - - while (context.peek() instanceof ProtocolDecl) { - ret.getProtocols().add(0, (ProtocolDecl)context.pop()); - } - - while (context.peek() instanceof PayloadTypeDecl) { - ret.getPayloadTypeDeclarations().add(0, (PayloadTypeDecl)context.pop()); - } - - while (context.peek() instanceof ImportDecl) { - ret.getImports().add(0, (ImportDecl)context.pop()); - } - - // Initialize module name - - Object component=context.pop(); - String packageName=""; - - if (component instanceof CommonToken - && ((CommonToken)component).getText().equals(";")) { - component = context.pop(); // Replace ';' - } - - do { - if (component instanceof CommonToken) { - packageName = ((CommonToken)component).getText()+packageName; - } - - component = context.pop(); - - } while (!(component instanceof CommonToken && ((CommonToken)component).getText().equals("module"))); - - if (packageName.length() > 0) { - ret.setName(packageName); - - setStartProperties(ret, component); - } - - context.push(ret); - - return ret; - } - -} diff --git a/modules/parser/src/main/java/org/scribble/parser/antlr/ParameterDeclListModelAdaptor.java b/modules/parser/src/main/java/org/scribble/parser/antlr/ParameterDeclListModelAdaptor.java deleted file mode 100644 index 68d8f1a61..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/antlr/ParameterDeclListModelAdaptor.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser.antlr; - -import org.antlr.runtime.CommonToken; -import org.scribble.model.ParameterDecl; - -/** - * This class provides the model adapter for the 'roleDef' parser rule. - * - */ -public class ParameterDeclListModelAdaptor extends AbstractModelAdaptor { - - /** - * {@inheritDoc} - */ - public Object createModelObject(ParserContext context) { - java.util.List ret=new java.util.ArrayList(); - boolean f_iterate=false; - - // consume '>' - context.pop(); - - do { - f_iterate = false; - - ParameterDecl pd=new ParameterDecl(); - - setEndProperties(pd, context.peek()); - - pd.setName(((CommonToken)context.pop()).getText()); - - if (context.peek() instanceof CommonToken - && ((CommonToken)context.peek()).getText().equals("as")) { - context.pop(); // 'as' - - pd.setAlias(pd.getName()); - - pd.setName(((CommonToken)context.pop()).getText()); - } - - setStartProperties(pd, context.peek()); - - String type=((CommonToken)context.pop()).getText(); - - if (type.equals("type")) { - pd.setType(ParameterDecl.ParameterType.Type); - } else if (type.equals("sig")) { - pd.setType(ParameterDecl.ParameterType.Sig); - } - - ret.add(0, pd); - - if (context.peek() instanceof CommonToken - && ((CommonToken)context.peek()).getText().equals(",")) { - context.pop(); // , - f_iterate = true; - } - } while (f_iterate); - - // consume '<' - context.pop(); - - context.push(ret); - - return ret; - } - -} diff --git a/modules/parser/src/main/java/org/scribble/parser/antlr/ParameterListModelAdaptor.java b/modules/parser/src/main/java/org/scribble/parser/antlr/ParameterListModelAdaptor.java deleted file mode 100644 index 1f1bdbd75..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/antlr/ParameterListModelAdaptor.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser.antlr; - -import org.antlr.runtime.CommonToken; -import org.scribble.model.Parameter; - -/** - * This class provides the model adapter for the 'parameterList' parser rule. - * - */ -public class ParameterListModelAdaptor extends AbstractModelAdaptor { - - /** - * {@inheritDoc} - */ - public Object createModelObject(ParserContext context) { - java.util.List ret=new java.util.ArrayList(); - boolean f_iterate=false; - - do { - f_iterate = false; - - Parameter p=new Parameter(); - - setEndProperties(p, context.pop()); - - p.setName(((CommonToken)context.pop()).getText()); - - setStartProperties(p, context.pop()); // sig - - ret.add(0, p); - - if (context.peek() instanceof CommonToken - && ((CommonToken)context.peek()).getText().equals(",")) { - context.pop(); // , - f_iterate = true; - } - } while (f_iterate); - - context.push(ret); - - return ret; - } - -} diff --git a/modules/parser/src/main/java/org/scribble/parser/antlr/ParserContext.java b/modules/parser/src/main/java/org/scribble/parser/antlr/ParserContext.java deleted file mode 100644 index 6e7b72659..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/antlr/ParserContext.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser.antlr; - -/** - * This interface represents the context used by - * the parser. - * - */ -public interface ParserContext { - - /** - * This method removes a component from the context - * and returns it to the caller. - * - * @return The popped component - */ - public Object pop(); - - /** - * This method accesses the current component - * from the context and returns it to the caller. - * This operation does not remove the current - * component from the context. - * - * @return The current component - */ - public Object peek(); - - /** - * This method adds a component to the parser - * context. - * - * @param obj The new component - */ - public void push(Object obj); - -} diff --git a/modules/parser/src/main/java/org/scribble/parser/antlr/PayloadModelAdaptor.java b/modules/parser/src/main/java/org/scribble/parser/antlr/PayloadModelAdaptor.java deleted file mode 100644 index 2c5ca36ce..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/antlr/PayloadModelAdaptor.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser.antlr; - -import org.antlr.runtime.CommonToken; -import org.scribble.model.PayloadElement; - -/** - * This class provides the model adapter for the 'payloadType' parser rule. - * - */ -public class PayloadModelAdaptor extends AbstractModelAdaptor { - - /** - * {@inheritDoc} - */ - public Object createModelObject(ParserContext context) { - - PayloadElement ret=new PayloadElement(); - - setEndProperties(ret, context.peek()); - setStartProperties(ret, context.peek()); - - ret.setName(((CommonToken)context.pop()).getText()); - - if (context.peek() instanceof CommonToken - && ((CommonToken)context.peek()).getText().equals(":")) { - context.pop(); // : - - setStartProperties(ret, context.peek()); - - ret.setAnnotation(((CommonToken)context.pop()).getText()); - } - - context.push(ret); - - return ret; - } - -} diff --git a/modules/parser/src/main/java/org/scribble/parser/antlr/PayloadTypeDeclModelAdaptor.java b/modules/parser/src/main/java/org/scribble/parser/antlr/PayloadTypeDeclModelAdaptor.java deleted file mode 100644 index 84271d9a7..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/antlr/PayloadTypeDeclModelAdaptor.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser.antlr; - -import org.antlr.runtime.CommonToken; -import org.scribble.model.PayloadTypeDecl; - -/** - * This class provides the model adapter for the 'payloadTypeDecl' parser rule. - * - */ -public class PayloadTypeDeclModelAdaptor extends AbstractModelAdaptor { - - /** - * {@inheritDoc} - */ - public Object createModelObject(ParserContext context) { - PayloadTypeDecl ret=new PayloadTypeDecl(); - - context.pop(); // Consume ';' - - setEndProperties(ret, context.peek()); - - String alias=((CommonToken)context.pop()).getText(); - context.pop(); // as - String schema=((CommonToken)context.pop()).getText(); - context.pop(); // from - String type=((CommonToken)context.pop()).getText(); - context.pop(); // > - String format=((CommonToken)context.pop()).getText(); - context.pop(); // < - - setStartProperties(ret, context.pop()); // type - - schema = schema.substring(1, schema.length()-1); - type = type.substring(1, type.length()-1); - - ret.setAlias(alias); - ret.setSchema(schema); - ret.setType(type); - ret.setFormat(format); - - context.push(ret); - - return ret; - } - -} diff --git a/modules/parser/src/main/java/org/scribble/parser/antlr/ProtocolTreeAdaptor.java b/modules/parser/src/main/java/org/scribble/parser/antlr/ProtocolTreeAdaptor.java deleted file mode 100644 index e684bcb4d..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/antlr/ProtocolTreeAdaptor.java +++ /dev/null @@ -1,336 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser.antlr; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.antlr.runtime.RecognitionException; -import org.antlr.runtime.Token; -import org.antlr.runtime.TokenStream; - -import org.scribble.model.Module; -import org.scribble.parser.antlr.ScribbleParser; - -/** - * This class provides the antlr tree adaptor. - * - */ -public class ProtocolTreeAdaptor implements org.antlr.runtime.tree.TreeAdaptor { - - private static final Logger LOG=Logger.getLogger(ProtocolTreeAdaptor.class.getName()); - - private ParserContext _context=new DefaultParserContext(); - private ScribbleParser _parser=null; - - /** - * The constructor. - */ - public ProtocolTreeAdaptor() { - } - - /** - * This method returns the module. - * - * @return The module, or null if an error occurred - */ - public Module getModule() { - return (_context.peek() instanceof Module ? (Module)_context.peek() : null); - } - - /** - * This method sets the parser. - * - * @param parser The parser - */ - public void setParser(ScribbleParser parser) { - _parser = parser; - } - - /** - * {@inheritDoc} - */ - public void addChild(Object arg0, Object arg1) { - - } - - /** - * {@inheritDoc} - */ - public Object becomeRoot(Object arg0, Object arg1) { - // TODO Auto-generated method stub - return null; - } - - /** - * {@inheritDoc} - */ - public Object becomeRoot(Token arg0, Object arg1) { - // TODO Auto-generated method stub - return null; - } - - /** - * {@inheritDoc} - */ - public Object create(Token arg0) { - if (LOG.isLoggable(Level.FINE)) { - LOG.fine("CREATE TOKEN="+arg0); - } - _context.push(arg0); - return null; - } - - /** - * {@inheritDoc} - */ - public Object create(int arg0, Token arg1) { - // TODO Auto-generated method stub - return null; - } - - /** - * {@inheritDoc} - */ - public Object create(int arg0, String arg1) { - // TODO Auto-generated method stub - return null; - } - - /** - * {@inheritDoc} - */ - public Object create(int arg0, Token arg1, String arg2) { - // TODO Auto-generated method stub - return null; - } - - /** - * {@inheritDoc} - */ - public Object deleteChild(Object arg0, int arg1) { - // TODO Auto-generated method stub - return null; - } - - /** - * {@inheritDoc} - */ - public Object dupNode(Object arg0) { - // TODO Auto-generated method stub - return null; - } - - /** - * {@inheritDoc} - */ - public Object dupTree(Object arg0) { - // TODO Auto-generated method stub - return null; - } - - /** - * {@inheritDoc} - */ - public Object errorNode(TokenStream arg0, Token arg1, Token arg2, - RecognitionException arg3) { - // TODO Auto-generated method stub - return null; - } - - /** - * {@inheritDoc} - */ - public Object getChild(Object arg0, int arg1) { - // TODO Auto-generated method stub - return null; - } - - /** - * {@inheritDoc} - */ - public int getChildCount(Object arg0) { - // TODO Auto-generated method stub - return 0; - } - - /** - * {@inheritDoc} - */ - public int getChildIndex(Object arg0) { - // TODO Auto-generated method stub - return 0; - } - - /** - * {@inheritDoc} - */ - public Object getParent(Object arg0) { - // TODO Auto-generated method stub - return null; - } - - /** - * {@inheritDoc} - */ - public String getText(Object arg0) { - // TODO Auto-generated method stub - return null; - } - - /** - * {@inheritDoc} - */ - public Token getToken(Object arg0) { - // TODO Auto-generated method stub - return null; - } - - /** - * {@inheritDoc} - */ - public int getTokenStartIndex(Object arg0) { - // TODO Auto-generated method stub - return 0; - } - - /** - * {@inheritDoc} - */ - public int getTokenStopIndex(Object arg0) { - // TODO Auto-generated method stub - return 0; - } - - /** - * {@inheritDoc} - */ - public int getType(Object arg0) { - // TODO Auto-generated method stub - return 0; - } - - /** - * {@inheritDoc} - */ - public int getUniqueID(Object arg0) { - // TODO Auto-generated method stub - return 0; - } - - /** - * {@inheritDoc} - */ - public boolean isNil(Object arg0) { - // TODO Auto-generated method stub - return false; - } - - /** - * {@inheritDoc} - */ - public Object nil() { - // TODO Auto-generated method stub - return null; - } - - /** - * {@inheritDoc} - */ - public void replaceChildren(Object arg0, int arg1, int arg2, Object arg3) { - // TODO Auto-generated method stub - - } - - /** - * {@inheritDoc} - */ - public Object rulePostProcessing(Object arg0) { - Object ret=arg0; - - if (_parser != null - && _parser.getRuleInvocationStack().size() > 0) { - String ruleName=(String)_parser.getRuleInvocationStack().get( - _parser.getRuleInvocationStack().size()-1); - - if (LOG.isLoggable(Level.FINE)) { - LOG.fine("RULE POST PROCESSING="+ruleName); - } - - if (!_parser.isErrorOccurred()) { - ModelAdaptor modelAdaptor=ModelAdaptorFactory.getModelAdaptor(ruleName); - - if (modelAdaptor != null) { - ret = modelAdaptor.createModelObject(_context); - //} else { - // LOG.severe("No ModelAdaptor for rule name: "+ruleName); - } - } - } - - return ret; - } - - /** - * {@inheritDoc} - */ - public void setChild(Object arg0, int arg1, Object arg2) { - // TODO Auto-generated method stub - - } - - /** - * {@inheritDoc} - */ - public void setChildIndex(Object arg0, int arg1) { - // TODO Auto-generated method stub - - } - - /** - * {@inheritDoc} - */ - public void setParent(Object arg0, Object arg1) { - // TODO Auto-generated method stub - - } - - /** - * {@inheritDoc} - */ - public void setText(Object arg0, String arg1) { - // TODO Auto-generated method stub - - } - - /** - * {@inheritDoc} - */ - public void setTokenBoundaries(Object arg0, Token arg1, Token arg2) { - // TODO Auto-generated method stub - - } - - /** - * {@inheritDoc} - */ - public void setType(Object arg0, int arg1) { - // TODO Auto-generated method stub - - } - -} diff --git a/modules/parser/src/main/java/org/scribble/parser/antlr/RoleDeclListModelAdaptor.java b/modules/parser/src/main/java/org/scribble/parser/antlr/RoleDeclListModelAdaptor.java deleted file mode 100644 index 2e757a2ff..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/antlr/RoleDeclListModelAdaptor.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser.antlr; - -import org.antlr.runtime.CommonToken; -import org.scribble.model.RoleDecl; - -/** - * This class provides the model adapter for the 'roleDef' parser rule. - * - */ -public class RoleDeclListModelAdaptor extends AbstractModelAdaptor { - - /** - * {@inheritDoc} - */ - public Object createModelObject(ParserContext context) { - java.util.List ret=new java.util.ArrayList(); - boolean f_iterate=false; - - // consume ')' - context.pop(); - - do { - f_iterate = false; - - RoleDecl rd=new RoleDecl(); - - setEndProperties(rd, context.peek()); - - rd.setName(((CommonToken)context.pop()).getText()); - - if (context.peek() instanceof CommonToken - && ((CommonToken)context.peek()).getText().equals("as")) { - context.pop(); // 'as' - - rd.setAlias(rd.getName()); - - rd.setName(((CommonToken)context.pop()).getText()); - } - - setStartProperties(rd, context.pop()); // role - - ret.add(0, rd); - - if (context.peek() instanceof CommonToken - && ((CommonToken)context.peek()).getText().equals(",")) { - context.pop(); // , - f_iterate = true; - } - } while (f_iterate); - - // consume '(' - context.pop(); - - context.push(ret); - - return ret; - } - -} diff --git a/modules/parser/src/main/java/org/scribble/parser/antlr/RoleInstantiationListModelAdaptor.java b/modules/parser/src/main/java/org/scribble/parser/antlr/RoleInstantiationListModelAdaptor.java deleted file mode 100644 index 5277a3023..000000000 --- a/modules/parser/src/main/java/org/scribble/parser/antlr/RoleInstantiationListModelAdaptor.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser.antlr; - -import org.antlr.runtime.CommonToken; -import org.scribble.model.RoleInstantiation; - -/** - * This class provides the model adapter for the 'roleInstantiationList' parser rule. - * - */ -public class RoleInstantiationListModelAdaptor extends AbstractModelAdaptor { - - /** - * {@inheritDoc} - */ - public Object createModelObject(ParserContext context) { - java.util.List ret=new java.util.ArrayList(); - boolean f_iterate=false; - - // consume ')' - context.pop(); - - do { - f_iterate = false; - - RoleInstantiation ri=new RoleInstantiation(); - - setEndProperties(ri, context.peek()); - - setStartProperties(ri, context.peek()); - - ri.setName(((CommonToken)context.pop()).getText()); - - if (context.peek() instanceof CommonToken - && ((CommonToken)context.peek()).getText().equals("as")) { - context.pop(); // 'as' - - ri.setAlias(ri.getName()); - - setStartProperties(ri, context.peek()); - - ri.setName(((CommonToken)context.pop()).getText()); - } - - ret.add(0, ri); - - if (context.peek() instanceof CommonToken - && ((CommonToken)context.peek()).getText().equals(",")) { - context.pop(); // , - f_iterate = true; - } - } while (f_iterate); - - // consume '(' - context.pop(); - - context.push(ret); - - return ret; - } - -} diff --git a/modules/parser/src/test/java/org/scribble/parser/ProtocolParserTest.java b/modules/parser/src/test/java/org/scribble/parser/ProtocolParserTest.java deleted file mode 100644 index bf50b75d1..000000000 --- a/modules/parser/src/test/java/org/scribble/parser/ProtocolParserTest.java +++ /dev/null @@ -1,223 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser; - -import static org.junit.Assert.*; - -import java.util.Map; - -import org.junit.Ignore; -import org.scribble.logging.ConsoleIssueLogger; -import org.scribble.model.Module; -import org.scribble.parser.ProtocolParser; -import org.scribble.resources.DirectoryResourceLocator; -import org.scribble.resources.InputStreamResource; - -public class ProtocolParserTest { - - @org.junit.Test - public void testRTGOV406() { - testIssue("RTGOV406"); - } - - @org.junit.Test - public void testTypes() { - testExample("Types"); - } - - @org.junit.Test - public void testImports() { - testExample("Imports"); - } - - @org.junit.Test - public void testGMessage() { - testExample("GMessage"); - } - - @org.junit.Test - public void testGProtocol() { - testExample("GProtocol"); - } - - @org.junit.Test - public void testGChoice() { - testExample("GChoice"); - } - - @org.junit.Test - public void testGRecursion() { - testExample("GRecursion"); - } - - @org.junit.Test - public void testGParallel() { - testExample("GParallel"); - } - - @org.junit.Test - @Ignore - public void testGDo() { - testExample("GDo"); - } - - @org.junit.Test - public void testGInterruptible() { - testExample("GInterruptible"); - } - - @org.junit.Test - public void testLProtocol() { - testExample("LProtocol"); - } - - @org.junit.Test - public void testLSend() { - testExample("LSend_Buyer"); - } - - @org.junit.Test - public void testLReceive() { - testExample("LReceive_Seller"); - } - - @org.junit.Test - public void testLChoice() { - testExample("LChoice"); - } - - @org.junit.Test - public void testLParallel() { - testExample("LParallel"); - } - - @org.junit.Test - public void testLRecursion() { - testExample("LRecursion"); - } - - @org.junit.Test - @Ignore - public void testLDo() { - testExample("LDo"); - } - - @org.junit.Test - public void testLInterruptible() { - testExample("LInterruptible"); - } - - protected void testExample(String name) { - testParser("scribble/examples/"+name+".scr"); - } - - protected void testIssue(String name) { - testParser("scribble/issues/"+name+".scr"); - } - - protected void testParser(String path) { - - try { - java.net.URL scrurl=ClassLoader.getSystemResource(path); - java.io.File scrFile=new java.io.File(scrurl.getFile()); - java.io.InputStream is=new java.io.FileInputStream(scrFile); - - java.net.URL url=ClassLoader.getSystemResource("scribble"); - java.io.File f=new java.io.File(url.getFile()); - - ProtocolParser pp=new ProtocolParser(); - - TestIssueLogger logger=new TestIssueLogger(); - - DirectoryResourceLocator locator=new DirectoryResourceLocator(f.getParentFile().getAbsolutePath()); - - ProtocolModuleLoader loader=new ProtocolModuleLoader(pp, locator, logger); - - InputStreamResource isr=new InputStreamResource(path, is); - - Module module=pp.parse(isr, loader, logger); - - if (module == null) { - fail("Module is null"); - } - - if (logger.isErrorsOrWarnings()) { - fail("Unexpected errors and/or warnings in "+path); - } - - is = ClassLoader.getSystemResourceAsStream(path); - - byte[] b=new byte[is.available()]; - is.read(b); - - is.close(); - - String parsed=module.toString().trim(); - String expecting=new String(b).replace("\r", "").trim(); - - if (!parsed.equals(expecting)) { - int len=parsed.length(); - if (len > expecting.length()) { - len = expecting.length(); - } - for (int i=0; i < len; i++) { - if (parsed.charAt(i) != expecting.charAt(i)) { - System.out.println("DIFF AT POSITION: "+i); - int showto=i+30; - if (i+10 >= len) { - showto = len; - } - System.out.println("PARSED: "+parsed.substring(i, showto)); - System.out.println("EXPECT: "+expecting.substring(i, showto)); - break; - } - } - - System.err.println("Parsed protocol '"+path+ - "' mismatch\nExpecting:\n"+expecting+"\nParsed:\n"+parsed); - fail("Parsed protocol '"+path+"' mismatch"); - } - - } catch (Exception e) { - e.printStackTrace(); - fail("Failed to parse '"+path+"'"); - } - } - - protected class TestIssueLogger extends ConsoleIssueLogger { - - private java.util.List _errors=new java.util.ArrayList(); - private java.util.List _warnings=new java.util.ArrayList(); - - public void error(String issue, Map props) { - super.error(issue, props); - _errors.add(issue); - } - - public void warning(String issue, Map props) { - super.warning(issue, props); - _warnings.add(issue); - } - - public void info(String issue, Map props) { - super.info(issue, props); - } - - public boolean isErrorsOrWarnings() { - return (_errors.size() > 0 || _warnings.size() > 0); - } - } -} diff --git a/modules/parser/src/test/java/org/scribble/parser/antlr/ANTLRMessageUtilTest.java b/modules/parser/src/test/java/org/scribble/parser/antlr/ANTLRMessageUtilTest.java deleted file mode 100644 index de2bdcee8..000000000 --- a/modules/parser/src/test/java/org/scribble/parser/antlr/ANTLRMessageUtilTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.parser.antlr; - -import static org.junit.Assert.*; - -import org.junit.Test; -import org.scribble.model.ModelObject; -import org.scribble.parser.antlr.ANTLRMessageUtil; - -public class ANTLRMessageUtilTest { - - @Test - public void testGetProperties() { - String doc="package Test;\n\nglobal protocol Hello (role Buyer, role Seller) {\n buy(Order) from Buyer to Seller;" - +"\n\n choice at Seller {\n confirmed(Receipt) from Seller to Buyer;\n } or {\n" + - " rejected(OutOfStock) from Seller toy Buyer;\n }\n}"; - - String mesg="line 9:35 missing TOKW at 'toy'"; - - java.util.Map props=ANTLRMessageUtil.getProperties(mesg, doc); - - if (props == null) { - fail("Failed to get properties"); - } - - if (!props.containsKey(ModelObject.START_POSITION)) { - fail("No start position"); - } - - if (!props.containsKey(ModelObject.END_POSITION)) { - fail("No end position"); - } - - Integer start=(Integer)props.get(ModelObject.START_POSITION); - - if (start.intValue() != 206) { - fail("Start should be 206, but was: "+start.intValue()); - } - - Integer end=(Integer)props.get(ModelObject.END_POSITION); - - if (end.intValue() != 209) { - fail("End should be 209, but was: "+end.intValue()); - } - } - -} diff --git a/modules/parser/src/test/resources/scribble/examples/GDo.scr b/modules/parser/src/test/resources/scribble/examples/GDo.scr deleted file mode 100644 index 64e2e7ee3..000000000 --- a/modules/parser/src/test/resources/scribble/examples/GDo.scr +++ /dev/null @@ -1,13 +0,0 @@ -module scribble.examples.GDo; - -type "{http://www.acme.com/financial}Order" from "http://www.acme.com/schemas/Order.xsd" as Order; -type "{http://www.acme.com/financial}Receipt" from "http://www.acme.com/schemas/Receipt.xsd" as Receipt; - -global protocol GDoTest(role Buyer,role Seller) { - do OtherProtocol(Buyer as OtherBuyer,Seller as OtherSeller); - do myscope: OtherProtocol(Buyer as OtherBuyer,Seller as OtherSeller); - do a.b.c.OtherProtocol(Buyer as OtherBuyer,Seller as OtherSeller); - do OtherProtocol(Buyer as OtherBuyer,Seller as OtherSeller); - do a.b.c.OtherProtocol(Buyer as OtherBuyer,Seller as OtherSeller); - do myscope: a.b.c.OtherProtocol(Buyer as OtherBuyer,Seller as OtherSeller); -} diff --git a/modules/parser/src/test/resources/scribble/examples/GInterruptible.scr b/modules/parser/src/test/resources/scribble/examples/GInterruptible.scr deleted file mode 100644 index b55e4eca1..000000000 --- a/modules/parser/src/test/resources/scribble/examples/GInterruptible.scr +++ /dev/null @@ -1,10 +0,0 @@ -module scribble.examples.GInterruptible; - -global protocol GInterruptibleTest(role Buyer,role Seller) { - interruptible MyLabel: { - buy(Order) from Buyer to Seller; - } with { - sell(Order),MesgParam by Seller; - cancel(Order) by Seller; - } -} diff --git a/modules/parser/src/test/resources/scribble/examples/GMessage.scr b/modules/parser/src/test/resources/scribble/examples/GMessage.scr deleted file mode 100644 index 7b0507312..000000000 --- a/modules/parser/src/test/resources/scribble/examples/GMessage.scr +++ /dev/null @@ -1,18 +0,0 @@ -module scribble.examples.GMessage; - -type "{http://www.acme.com/financial}Order" from "http://www.acme.com/schemas/Order.xsd" as Order; -type "{http://www.acme.com/financial}Customer" from "http://www.acme.com/schemas/Customer.xsd" as Customer; - -global protocol GMessageTest(role Buyer,role SellerA,role SellerB) { - buy(Order,Customer) from Buyer to SellerA; - buy(Order,Customer) from Buyer to SellerA,SellerB; - buy(o:Order,c:Customer) from Buyer to SellerA; - buy(Order) from Buyer to SellerA,SellerB; - buy(ord:Order) from Buyer to SellerA; -} - -global protocol PlaceOrder(role Buyer,role Seller) { -} - -global protocol Receipt(role Buyer,role Seller) { -} \ No newline at end of file diff --git a/modules/parser/src/test/resources/scribble/examples/GParallel.scr b/modules/parser/src/test/resources/scribble/examples/GParallel.scr deleted file mode 100644 index 2ffee9e3f..000000000 --- a/modules/parser/src/test/resources/scribble/examples/GParallel.scr +++ /dev/null @@ -1,12 +0,0 @@ -module scribble.examples.GParallel; - -type "{http://www.acme.com/financial}Order" from "http://www.acme.com/schemas/Order.xsd" as Order; -type "{http://www.acme.com/financial}QuoteRequest" from "http://www.acme.com/schemas/QuoteRequest.xsd" as QuoteRequest; - -global protocol GParallelTest(role Buyer,role Seller) { - par { - buy(Order) from Buyer to Seller; - } and { - buy(QuoteRequest) from Buyer to Seller; - } -} diff --git a/modules/parser/src/test/resources/scribble/examples/GProtocol.scr b/modules/parser/src/test/resources/scribble/examples/GProtocol.scr deleted file mode 100644 index 07c1d04a0..000000000 --- a/modules/parser/src/test/resources/scribble/examples/GProtocol.scr +++ /dev/null @@ -1,14 +0,0 @@ -module scribble.examples.GProtocol; - -global protocol GMessageTest(role Buyer,role SellerA,role SellerB) { -} - -global protocol Order(role Buyer,role Seller) { -} - -global protocol Receipt(role Buyer as B,role Seller as S) { -} - -global protocol GMessageTest2(role Buyer,role SellerA,role SellerB) instantiates GMessageTest(Buyer,SellerA,SellerB); - -global protocol Order2(role Buyer,role Seller) instantiates Order(Buyer,Seller); diff --git a/modules/parser/src/test/resources/scribble/examples/GRecursion.scr b/modules/parser/src/test/resources/scribble/examples/GRecursion.scr deleted file mode 100644 index b8f1da021..000000000 --- a/modules/parser/src/test/resources/scribble/examples/GRecursion.scr +++ /dev/null @@ -1,10 +0,0 @@ -module scribble.examples.GRecursion; - -type "{http://www.acme.com/financial}Order" from "http://www.acme.com/schemas/Order.xsd" as Order; - -global protocol GRecursionTest(role Buyer,role Seller) { - rec MyLabel { - buy(Order) from Buyer to Seller; - continue MyLabel; - } -} diff --git a/modules/parser/src/test/resources/scribble/examples/Imports.scr b/modules/parser/src/test/resources/scribble/examples/Imports.scr deleted file mode 100644 index 12d3e843e..000000000 --- a/modules/parser/src/test/resources/scribble/examples/Imports.scr +++ /dev/null @@ -1,8 +0,0 @@ -module scribble.examples.Imports; - -import scribble.examples.GMessage; -from scribble.examples.GMessage import PlaceOrder; -from scribble.examples.GMessage import Receipt as OrderReceipt; - -global protocol ImportsTest(role Buyer,role Seller as MySeller) { -} diff --git a/modules/parser/src/test/resources/scribble/examples/LDo.scr b/modules/parser/src/test/resources/scribble/examples/LDo.scr deleted file mode 100644 index f8ab8e0da..000000000 --- a/modules/parser/src/test/resources/scribble/examples/LDo.scr +++ /dev/null @@ -1,10 +0,0 @@ -module scribble.examples.LDo; - -local protocol LDoTest at Buyer(role Seller) { - do OtherProtocol(Buyer as OtherBuyer,Seller as OtherSeller); - do myscope: OtherProtocol(Buyer as OtherBuyer,Seller as OtherSeller); - do a.b.c.OtherProtocol(Buyer as OtherBuyer,Seller as OtherSeller); - do OtherProtocol(Buyer as OtherBuyer,Seller as OtherSeller); - do a.b.c.OtherProtocol(Buyer as OtherBuyer,Seller as OtherSeller); - do myscope: a.b.c.OtherProtocol(Buyer as OtherBuyer,Seller as OtherSeller); -} diff --git a/modules/parser/src/test/resources/scribble/examples/LInterruptible.scr b/modules/parser/src/test/resources/scribble/examples/LInterruptible.scr deleted file mode 100644 index 6b8f0e910..000000000 --- a/modules/parser/src/test/resources/scribble/examples/LInterruptible.scr +++ /dev/null @@ -1,12 +0,0 @@ -module scribble.examples.LInterruptible; - -type "{http://www.acme.com/financial}Order" from "http://www.acme.com/schemas/Order.xsd" as Order; - -local protocol LInterruptibleTest at Buyer(role Buyer,role Seller) { - interruptible MyLabel: { - buy(Order) from Buyer; - } with { - throws sell(Order) to Seller; - catches cancel(Order) from Seller; - } -} diff --git a/modules/parser/src/test/resources/scribble/examples/LParallel.scr b/modules/parser/src/test/resources/scribble/examples/LParallel.scr deleted file mode 100644 index b9fecb681..000000000 --- a/modules/parser/src/test/resources/scribble/examples/LParallel.scr +++ /dev/null @@ -1,12 +0,0 @@ -module scribble.examples.LParallel; - -type "{http://www.acme.com/financial}Order" from "http://www.acme.com/schemas/Order.xsd" as Order; -type "{http://www.acme.com/financial}QuoteRequest" from "http://www.acme.com/schemas/QuoteRequest.xsd" as QuoteRequest; - -local protocol LParallelTest at Buyer(role Buyer,role Seller) { - par { - buy(Order) to Seller; - } and { - buy(QuoteRequest) to Seller; - } -} diff --git a/modules/parser/src/test/resources/scribble/examples/LProtocol.scr b/modules/parser/src/test/resources/scribble/examples/LProtocol.scr deleted file mode 100644 index 45bd80e89..000000000 --- a/modules/parser/src/test/resources/scribble/examples/LProtocol.scr +++ /dev/null @@ -1,14 +0,0 @@ -module scribble.examples.LProtocol; - -local protocol GMessageTest at SellerB(role Buyer,role SellerA,role SellerB) { -} - -local protocol Order at Seller(role Buyer,role Seller) { -} - -local protocol Receipt at Seller(role Buyer as B,role Seller as S) { -} - -local protocol GMessageTest2 at SellerB(role Buyer,role SellerA,role SellerB) instantiates GMessageTest(Buyer,SellerA,SellerB); - -local protocol Order2 at Seller2(role Buyer2,role Seller2) instantiates Order(Buyer2 as Buyer,Seller2 as Seller); diff --git a/modules/parser/src/test/resources/scribble/examples/LReceive_Seller.scr b/modules/parser/src/test/resources/scribble/examples/LReceive_Seller.scr deleted file mode 100644 index 80c4e00c7..000000000 --- a/modules/parser/src/test/resources/scribble/examples/LReceive_Seller.scr +++ /dev/null @@ -1,11 +0,0 @@ -module scribble.examples.LReceive_Seller; - -type "{http://www.acme.com/financial}Order" from "http://www.acme.com/schemas/Order.xsd" as Order; -type "{http://www.acme.com/financial}Customer" from "http://www.acme.com/schemas/Customer.xsd" as Customer; - -local protocol LReceiveTest at Seller(role Buyer,role Seller) { - buy(Order,Customer) from Buyer; - buy(o:Order,c:Customer) from Buyer; - buy(Order) from Buyer; - buy(ord:Order) from Buyer; -} diff --git a/modules/parser/src/test/resources/scribble/examples/LSend_Buyer.scr b/modules/parser/src/test/resources/scribble/examples/LSend_Buyer.scr deleted file mode 100644 index fc507b84e..000000000 --- a/modules/parser/src/test/resources/scribble/examples/LSend_Buyer.scr +++ /dev/null @@ -1,11 +0,0 @@ -module scribble.examples.LSend_Buyer; - -type "{http://www.acme.com/financial}Order" from "http://www.acme.com/schemas/Order.xsd" as Order; -type "{http://www.acme.com/financial}Customer" from "http://www.acme.com/schemas/Customer.xsd" as Customer; - -local protocol LSendTest at Buyer(role Buyer,role Seller) { - buy(Order,Customer) to Seller; - buy(o:Order,c:Customer) to Seller; - buy(Order) to Seller; - buy(ord:Order) to Seller; -} diff --git a/modules/parser/src/test/resources/scribble/examples/Types.scr b/modules/parser/src/test/resources/scribble/examples/Types.scr deleted file mode 100644 index 2724a82f1..000000000 --- a/modules/parser/src/test/resources/scribble/examples/Types.scr +++ /dev/null @@ -1,6 +0,0 @@ -module scribble.examples.Types; - -type "{http://www.acme.com/financial}Trade" from "http://www.acme.com/schemas/Trade.xsd" as Trade; - -global protocol TestTypes(role Buyer,role Seller as MySeller) { -} diff --git a/modules/pom.xml b/modules/pom.xml deleted file mode 100644 index c8fb3ce49..000000000 --- a/modules/pom.xml +++ /dev/null @@ -1,28 +0,0 @@ - - 4.0.0 - modules - pom - 0.3.2-SNAPSHOT - Scribble::Modules - - - org.scribble - parent - 0.3.2-SNAPSHOT - - - - core - parser - projection - validation - monitor - trace - trace-parser - cli - - - - diff --git a/modules/projection/LICENSE.txt b/modules/projection/LICENSE.txt deleted file mode 100644 index 29f81d812..000000000 --- a/modules/projection/LICENSE.txt +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/modules/projection/pom.xml b/modules/projection/pom.xml deleted file mode 100644 index 24146e334..000000000 --- a/modules/projection/pom.xml +++ /dev/null @@ -1,33 +0,0 @@ - - 4.0.0 - scribble-projection - jar - 0.3.2-SNAPSHOT - Scribble::Modules::Projection - - - org.scribble - modules - 0.3.2-SNAPSHOT - - - - - org.scribble - scribble-core - ${project.version} - - - org.scribble - scribble-parser - ${project.version} - - - junit - junit - test - - - - diff --git a/modules/projection/src/main/java/org/scribble/projection/ProtocolProjector.java b/modules/projection/src/main/java/org/scribble/projection/ProtocolProjector.java deleted file mode 100644 index e1a1f02cf..000000000 --- a/modules/projection/src/main/java/org/scribble/projection/ProtocolProjector.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.projection; - -import org.scribble.context.ModuleContext; -import org.scribble.logging.IssueLogger; -import org.scribble.model.Module; -import org.scribble.projection.rules.ProjectionRule; -import org.scribble.projection.rules.ProjectionRuleFactory; - -/** - * This class is responsible for projecting a protocol module. - * - */ -public class ProtocolProjector { - - /** - * This method projects the supplied module, reporting - * any issues to the logger. - * - * @param context The module context - * @param module The module - * @param loader The module loader - * @param logger The logger - * @return The set of modules representing the local projections - */ - @SuppressWarnings("unchecked") - public java.util.Set project(ModuleContext context, Module module, IssueLogger logger) { - java.util.Set ret=null; - ProjectionRule rule=ProjectionRuleFactory.getProjectionRule(module); - - if (rule != null) { - ret = (java.util.Set)rule.project(context, module, null, logger); - } - - return (ret); - } -} diff --git a/modules/projection/src/main/java/org/scribble/projection/rules/AbstractProtocolDeclProjectionRule.java b/modules/projection/src/main/java/org/scribble/projection/rules/AbstractProtocolDeclProjectionRule.java deleted file mode 100644 index aa888c385..000000000 --- a/modules/projection/src/main/java/org/scribble/projection/rules/AbstractProtocolDeclProjectionRule.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.projection.rules; - -import org.scribble.context.ModuleContext; -import org.scribble.logging.IssueLogger; -import org.scribble.model.ParameterDecl; -import org.scribble.model.ProtocolDecl; -import org.scribble.model.Role; -import org.scribble.model.RoleDecl; -import org.scribble.model.local.LProtocolDecl; - -/** - * This class is the abstract base class for the GProtocolDefinition and - * GProtocolInstance projection rules. - * - */ -public class AbstractProtocolDeclProjectionRule { - - /** - * This method projects the protocol declaration information common to protocol - * definitions and instances. - * - * @param context The module context - * @param elem The global protocol declaration - * @param ret The local protocol declaration - * @param role The role - * @param logger The logger - */ - public void projectProtocolDecl(ModuleContext context, - ProtocolDecl elem, LProtocolDecl ret, RoleDecl role, IssueLogger logger) { - ret.setName(elem.getName()); - ret.setLocalRole(new Role(role.getName())); - - for (ParameterDecl pd : elem.getParameterDeclarations()) { - ret.getParameterDeclarations().add(new ParameterDecl(pd)); - } - - for (RoleDecl rd : elem.getRoleDeclarations()) { - ret.getRoleDeclarations().add(new RoleDecl(rd)); - } - } - -} diff --git a/modules/projection/src/main/java/org/scribble/projection/rules/GBlockProjectionRule.java b/modules/projection/src/main/java/org/scribble/projection/rules/GBlockProjectionRule.java deleted file mode 100644 index 422495b8e..000000000 --- a/modules/projection/src/main/java/org/scribble/projection/rules/GBlockProjectionRule.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.projection.rules; - -import org.scribble.context.ModuleContext; -import org.scribble.logging.IssueLogger; -import org.scribble.model.ModelObject; -import org.scribble.model.RoleDecl; -import org.scribble.model.global.GActivity; -import org.scribble.model.global.GBlock; -import org.scribble.model.local.LActivity; -import org.scribble.model.local.LBlock; - -/** - * This class implements the GBlock projection rule. - * - */ -public class GBlockProjectionRule implements ProjectionRule { - - /** - * {@inheritDoc} - */ - public Object project(ModuleContext context, ModelObject mobj, - RoleDecl role, IssueLogger logger) { - LBlock projected=new LBlock(); - GBlock source=(GBlock)mobj; - - projected.derivedFrom(source); - - for (GActivity act : source.getContents()) { - ProjectionRule rule=ProjectionRuleFactory.getProjectionRule(act); - - if (rule != null) { - Object local=rule.project(context, act, role, logger); - - if (local != null) { - if (local instanceof LActivity) { - projected.getContents().add((LActivity)local); - } else if (local instanceof java.util.List) { - for (Object lact : (java.util.List)local) { - if (lact instanceof LActivity) { - projected.getContents().add((LActivity)lact); - } - } - } - } - } - } - - return (projected); - } - -} diff --git a/modules/projection/src/main/java/org/scribble/projection/rules/GChoiceProjectionRule.java b/modules/projection/src/main/java/org/scribble/projection/rules/GChoiceProjectionRule.java deleted file mode 100644 index daa1f82f5..000000000 --- a/modules/projection/src/main/java/org/scribble/projection/rules/GChoiceProjectionRule.java +++ /dev/null @@ -1,258 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.projection.rules; - -import java.util.logging.Logger; - -import org.scribble.context.ModuleContext; -import org.scribble.logging.IssueLogger; -import org.scribble.model.ModelObject; -import org.scribble.model.Role; -import org.scribble.model.RoleDecl; -import org.scribble.model.global.GChoice; -import org.scribble.model.local.LActivity; -import org.scribble.model.local.LBlock; -import org.scribble.model.local.LChoice; - -/** - * This class implements the GChoice projection rule. - * - */ -public class GChoiceProjectionRule implements ProjectionRule { - - private static final Logger LOG=Logger.getLogger(GChoiceProjectionRule.class.getName()); - - /** - * {@inheritDoc} - */ - public Object project(ModuleContext context, ModelObject mobj, - RoleDecl role, IssueLogger logger) { - // TODO: NOTE this implementation differs from the spec currently, which - // does not take into account merging. Using the merging approach - // from the previous implementation. - - LChoice projected=new LChoice(); - GChoice source=(GChoice)mobj; - - projected.derivedFrom(source); - - projected.setRole(new Role(source.getRole())); - - boolean f_missingBranch=false; - - for (int i=0; i < source.getPaths().size(); i++) { - ProjectionRule rule=ProjectionRuleFactory.getProjectionRule(source.getPaths().get(i)); - - if (rule != null) { - LBlock block=(LBlock)rule.project(context, source.getPaths().get(i), role, logger); - - if (block != null) { - if (block.getContents().size() == 1 - && block.getContents().get(0) instanceof LChoice - && isSameRole(projected, (LChoice)block.getContents().get(0))) { - projected.getPaths().addAll(((LChoice)block.getContents().get(0)).getPaths()); - } else { - projected.getPaths().add(block); - } - } else { - f_missingBranch = true; - } - } - } - - if (f_missingBranch) { - - if (projected.getPaths().size() > 0) { - // TODO: REPORT ERROR - not projected to all paths - } else { - return null; - } - } - - return (merge(projected, role, logger)); - } - - /** - * Check whether roles are the same. - * - * @param c1 First choice - * @param c2 Second choice - * @return Whether roles are same - */ - protected boolean isSameRole(LChoice c1, LChoice c2) { - if (c1.getRole() == null && c2.getRole() == null) { - return (true); - } else if (c1.getRole() == null || c2.getRole() == null) { - return (false); - } else { - return (c1.getRole().equals(c2.getRole())); - } - } - - /** - * This method processes a choice construct. - * - * @param projected The projected choice - * @param role The projected role - * @param logger The logger - * @return The processed activities - */ - protected static Object merge(LChoice projected, RoleDecl role, - IssueLogger l) { - Object ret=null; - - ret = extractCommonBehaviour(projected, role, l); - - // If multiple paths have common initiator (but not common to all behaviours) - // then group in sub-choice - groupSubpathsWithCommonInitiator(projected, role, l); - - // Remove all empty paths - for (int i=projected.getPaths().size()-1; i >= 0; i--) { - LBlock b=projected.getPaths().get(i); - - if (b.size() == 0) { - projected.getPaths().remove(i); - } - } - - if (projected.getPaths().size() == 0) { - if (ret == projected) { - ret = null; - } else { - ((java.util.List)ret).remove(projected); - } - projected = null; - } - - return (ret); - } - - /** - * This method checks whether choice paths should be grouped into sub-paths - * with common initiating interaction sentences. - * - * @param projected The projected choice - * @param role The role - * @param l The journal - */ - @SuppressWarnings("unchecked") - protected static void groupSubpathsWithCommonInitiator(LChoice projected, - RoleDecl role, IssueLogger l) { - java.util.Map> pathGroups= - new java.util.HashMap>(); - - for (LBlock path : projected.getPaths()) { - if (path.size() > 0) { - java.util.List plist=pathGroups.get(path.get(0)); - if (plist == null) { - plist = new java.util.Vector(); - pathGroups.put(path.get(0), plist); - } - plist.add(path); - } - } - - for (LActivity act : pathGroups.keySet()) { - java.util.List plist=pathGroups.get(act); - - if (plist.size() >= 2) { - - // Create new choice construct - LChoice sub=new LChoice(); - int pos=-1; - - // TODO: Do we need to determine/set the role associated with choice? - // If different then report error? - - for (LBlock b : plist) { - if (pos == -1) { - pos = projected.getPaths().indexOf(b); - } - projected.getPaths().remove(b); - sub.getPaths().add(b); - } - - LBlock newPath=new LBlock(); - - projected.getPaths().add(pos, newPath); - - Object processed=merge(sub, role, l); - - if (processed instanceof java.util.List) { - newPath.getContents().addAll((java.util.List)processed); - } else { - LOG.severe("Should have returned a list with extracted common activity(s) followed by choice"); - } - } - } - } - - /** - * Extract common behaviour. - * - * @param projected The projected choice - * @param role The role - * @param l The journal - * @return Extracted common behaviour - */ - @SuppressWarnings("unchecked") - protected static Object extractCommonBehaviour(LChoice projected, - RoleDecl role, IssueLogger l) { - Object ret=projected; - - // Check to see whether common interaction sentences can be extracted - // out from each path to precede the choice - boolean checkPaths=true; - do { - boolean allSame=projected.getPaths().size() > 1; - - for (int i=1; allSame && i < projected.getPaths().size(); i++) { - LBlock b1=projected.getPaths().get(0); - LBlock b2=projected.getPaths().get(i); - - if (b1.size() == 0 || b2.size() == 0) { - allSame = false; - } else if (!b1.get(0).equals(b2.get(0))) { - allSame = false; - } - } - - if (allSame) { - // Merge first elements from each path and place before the choice - if (!(ret instanceof java.util.List)) { - ret = new java.util.Vector(); - ((java.util.List)ret).add(projected); - } - - ((java.util.List)ret).add(((java.util.List)ret).size()-1, - projected.getPaths().get(0).getContents().get(0)); - - for (int i=0; i < projected.getPaths().size(); i++) { - // Remove first element - projected.getPaths().get(i).getContents().remove(0); - } - } else { - checkPaths = false; - } - - } while(checkPaths); - - return (ret); - } - -} diff --git a/modules/projection/src/main/java/org/scribble/projection/rules/GContinueProjectionRule.java b/modules/projection/src/main/java/org/scribble/projection/rules/GContinueProjectionRule.java deleted file mode 100644 index 7fdfe8d3d..000000000 --- a/modules/projection/src/main/java/org/scribble/projection/rules/GContinueProjectionRule.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.projection.rules; - -import org.scribble.context.ModuleContext; -import org.scribble.logging.IssueLogger; -import org.scribble.model.ModelObject; -import org.scribble.model.RoleDecl; -import org.scribble.model.global.GContinue; -import org.scribble.model.local.LContinue; - -/** - * This class implements the GContinue projection rule. - * - */ -public class GContinueProjectionRule implements ProjectionRule { - - /** - * {@inheritDoc} - */ - public Object project(ModuleContext context, ModelObject mobj, - RoleDecl role, IssueLogger logger) { - LContinue projected=new LContinue(); - GContinue source=(GContinue)mobj; - - projected.derivedFrom(source); - - projected.setLabel(source.getLabel()); - - return (projected); - } - -} diff --git a/modules/projection/src/main/java/org/scribble/projection/rules/GDoProjectionRule.java b/modules/projection/src/main/java/org/scribble/projection/rules/GDoProjectionRule.java deleted file mode 100644 index b36ac108d..000000000 --- a/modules/projection/src/main/java/org/scribble/projection/rules/GDoProjectionRule.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.projection.rules; - -import org.scribble.context.ModuleContext; -import org.scribble.logging.IssueLogger; -import org.scribble.model.Argument; -import org.scribble.model.ModelObject; -import org.scribble.model.ProtocolDecl; -import org.scribble.model.RoleDecl; -import org.scribble.model.RoleInstantiation; -import org.scribble.model.global.GDo; -import org.scribble.model.local.LDo; - -/** - * This class implements the GDo projection rule. - * - */ -public class GDoProjectionRule implements ProjectionRule { - - /** - * {@inheritDoc} - */ - public Object project(ModuleContext context, ModelObject mobj, - RoleDecl role, IssueLogger logger) { - LDo projected=null; - GDo source=(GDo)mobj; - - if (source.isRoleInvolved(role)) { - projected = new LDo(); - - projected.derivedFrom(source); - - String protocolName=source.getProtocol(); - - if (protocolName.indexOf('.') != -1) { - // Find the role of the target protocol - RoleInstantiation targetri=source.getRoleInstantiation(role); - - if (targetri == null) { - logger.error("Could not find role '"+role+"'", mobj); - return null; - } - - String otherRole=targetri.getAlias(); - - if (otherRole == null) { - // Find position - int index=source.getRoleInstantiations().indexOf(targetri); - - if (index != -1) { - ModelObject mo=context.getMember(source.getProtocol()); - - if (mo instanceof ProtocolDecl) { - ProtocolDecl pd=(ProtocolDecl)mo; - - if (pd.getRoleDeclarations().size() <= index) { - logger.error("Could not determine target role for '"+role+"'", mobj); - } else { - otherRole = pd.getRoleDeclarations().get(index).getName(); - } - } - } - } - - if (otherRole != null) { - // Modify final module part to include role name - int index=protocolName.lastIndexOf('.'); - - protocolName = protocolName.substring(0, index) + "_" + otherRole - + protocolName.substring(index); - } - } - - // TODO: Modify the protocol name as described in section 5.3.6 - - projected.setProtocol(protocolName); - - for (RoleInstantiation ri : source.getRoleInstantiations()) { - projected.getRoleInstantiations().add(new RoleInstantiation(ri)); - } - - for (Argument arg : source.getArguments()) { - projected.getArguments().add(new Argument(arg)); - } - - if (source.getScope() != null) { - projected.setScope(source.getScope()); - } else { - // TODO: Default scoping name??? - } - } - - return (projected); - } - -} diff --git a/modules/projection/src/main/java/org/scribble/projection/rules/GInterruptibleProjectionRule.java b/modules/projection/src/main/java/org/scribble/projection/rules/GInterruptibleProjectionRule.java deleted file mode 100644 index 3b37c54af..000000000 --- a/modules/projection/src/main/java/org/scribble/projection/rules/GInterruptibleProjectionRule.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.projection.rules; - -import org.scribble.context.ModuleContext; -import org.scribble.logging.IssueLogger; -import org.scribble.model.Message; -import org.scribble.model.ModelObject; -import org.scribble.model.Role; -import org.scribble.model.RoleDecl; -import org.scribble.model.global.GInterruptible; -import org.scribble.model.global.GInterruptible.Interrupt; -import org.scribble.model.local.LBlock; -import org.scribble.model.local.LInterruptible; - -/** - * This class implements the GRecursion projection rule. - * - */ -public class GInterruptibleProjectionRule implements ProjectionRule { - - /** - * {@inheritDoc} - */ - public Object project(ModuleContext context, ModelObject mobj, - RoleDecl role, IssueLogger logger) { - LInterruptible projected=null; - GInterruptible source=(GInterruptible)mobj; - - if (source.isRoleInvolved(role)) { - projected = new LInterruptible(); - - projected.derivedFrom(source); - - projected.setScope(source.getScope()); - - ProjectionRule rule=ProjectionRuleFactory.getProjectionRule(source.getBlock()); - - if (rule != null) { - LBlock lb=(LBlock)rule.project(context, source.getBlock(), role, logger); - - if (lb != null) { - projected.setBlock(lb); - } - } - - // Get list of roles involved in the interruptible - java.util.Set roles=new java.util.HashSet(); - source.identifyInvolvedRoles(roles); - - // Project throws - for (Interrupt i : source.getInterrupts()) { - if (role.isRole(i.getRole())) { - LInterruptible.Throw lt=new LInterruptible.Throw(); - - for (Message m : i.getMessages()) { - Message lm=new Message(m); - - lt.getMessages().add(lm); - } - - for (Role r : roles) { - if (!role.isRole(r)) { - lt.getToRoles().add(new Role(r)); - } - } - - projected.setThrows(lt); - - // As only one throws is permitted - break; - } - } - - // Project catches - // Project throws - for (Interrupt i : source.getInterrupts()) { - if (!role.isRole(i.getRole())) { - LInterruptible.Catch lc=new LInterruptible.Catch(); - - for (Message m : i.getMessages()) { - Message lm=new Message(m); - - lc.getMessages().add(lm); - } - - lc.setRole(new Role(i.getRole())); - - projected.getCatches().add(lc); - } - } - } - - return (projected); - } -} diff --git a/modules/projection/src/main/java/org/scribble/projection/rules/GMessageTransferProjectionRule.java b/modules/projection/src/main/java/org/scribble/projection/rules/GMessageTransferProjectionRule.java deleted file mode 100644 index f0e2e6e14..000000000 --- a/modules/projection/src/main/java/org/scribble/projection/rules/GMessageTransferProjectionRule.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.projection.rules; - -import org.scribble.context.ModuleContext; -import org.scribble.logging.IssueLogger; -import org.scribble.model.Message; -import org.scribble.model.ModelObject; -import org.scribble.model.Role; -import org.scribble.model.RoleDecl; -import org.scribble.model.global.GMessageTransfer; -import org.scribble.model.local.LReceive; -import org.scribble.model.local.LSend; - -/** - * This class implements the GMessageTransfer projection rule. - * - */ -public class GMessageTransferProjectionRule implements ProjectionRule { - - /** - * {@inheritDoc} - */ - public Object project(ModuleContext context, ModelObject mobj, - RoleDecl role, IssueLogger logger) { - java.util.List ret=new java.util.ArrayList(); - GMessageTransfer source=(GMessageTransfer)mobj; - - if (role.isRole(source.getFromRole())) { - LSend projected = new LSend(); - projected.setMessage(new Message(source.getMessage())); - - for (Role r : source.getToRoles()) { - projected.getToRoles().add(new Role(r)); - } - - projected.derivedFrom(source); - - ret.add(projected); - } - - for (Role r : source.getToRoles()) { - if (role.isRole(r)) { - LReceive projected = new LReceive(); - projected.setMessage(new Message(source.getMessage())); - projected.setFromRole(new Role(source.getFromRole())); - - projected.derivedFrom(source); - - ret.add(projected); - break; - } - } - - return (ret); - } - -} diff --git a/modules/projection/src/main/java/org/scribble/projection/rules/GParallelProjectionRule.java b/modules/projection/src/main/java/org/scribble/projection/rules/GParallelProjectionRule.java deleted file mode 100644 index 347e5be65..000000000 --- a/modules/projection/src/main/java/org/scribble/projection/rules/GParallelProjectionRule.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.projection.rules; - -import org.scribble.context.ModuleContext; -import org.scribble.logging.IssueLogger; -import org.scribble.model.ModelObject; -import org.scribble.model.RoleDecl; -import org.scribble.model.global.GBlock; -import org.scribble.model.global.GParallel; -import org.scribble.model.local.LBlock; -import org.scribble.model.local.LParallel; - -/** - * This class implements the GParallel projection rule. - * - */ -public class GParallelProjectionRule implements ProjectionRule { - - /** - * {@inheritDoc} - */ - public Object project(ModuleContext context, ModelObject mobj, - RoleDecl role, IssueLogger logger) { - LParallel projected=null; - GParallel source=(GParallel)mobj; - - if (source.isRoleInvolved(role)) { - projected = new LParallel(); - - projected.derivedFrom(source); - - for (GBlock path : source.getPaths()) { - ProjectionRule rule=ProjectionRuleFactory.getProjectionRule(path); - - if (rule != null) { - LBlock lb=(LBlock)rule.project(context, path, role, logger); - - if (lb != null) { - projected.getPaths().add(lb); - } - } - } - } - - return (projected); - } -} diff --git a/modules/projection/src/main/java/org/scribble/projection/rules/GProtocolDefinitionProjectionRule.java b/modules/projection/src/main/java/org/scribble/projection/rules/GProtocolDefinitionProjectionRule.java deleted file mode 100644 index 5c98e263a..000000000 --- a/modules/projection/src/main/java/org/scribble/projection/rules/GProtocolDefinitionProjectionRule.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.projection.rules; - -import org.scribble.context.ModuleContext; -import org.scribble.logging.IssueLogger; -import org.scribble.model.ModelObject; -import org.scribble.model.RoleDecl; -import org.scribble.model.global.GProtocolDefinition; -import org.scribble.model.local.LBlock; -import org.scribble.model.local.LProtocolDefinition; - -/** - * This class implements the GProtocolDefinition projection rule. - * - */ -public class GProtocolDefinitionProjectionRule extends AbstractProtocolDeclProjectionRule - implements ProjectionRule { - - /** - * {@inheritDoc} - */ - public Object project(ModuleContext context, ModelObject mobj, - RoleDecl role, IssueLogger logger) { - LProtocolDefinition projected=new LProtocolDefinition(); - GProtocolDefinition source=(GProtocolDefinition)mobj; - - projected.derivedFrom(source); - - projectProtocolDecl(context, source, projected, role, logger); - - ProjectionRule rule=ProjectionRuleFactory.getProjectionRule(source.getBlock()); - - if (rule != null) { - LBlock lb=(LBlock)rule.project(context, source.getBlock(), role, logger); - - if (lb != null) { - projected.setBlock(lb); - } - } - - return (projected); - } - -} diff --git a/modules/projection/src/main/java/org/scribble/projection/rules/GProtocolInstanceProjectionRule.java b/modules/projection/src/main/java/org/scribble/projection/rules/GProtocolInstanceProjectionRule.java deleted file mode 100644 index 7b821de5d..000000000 --- a/modules/projection/src/main/java/org/scribble/projection/rules/GProtocolInstanceProjectionRule.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.projection.rules; - -import org.scribble.context.ModuleContext; -import org.scribble.logging.IssueLogger; -import org.scribble.model.Argument; -import org.scribble.model.ModelObject; -import org.scribble.model.ProtocolDecl; -import org.scribble.model.RoleDecl; -import org.scribble.model.RoleInstantiation; -import org.scribble.model.global.GProtocolInstance; -import org.scribble.model.local.LProtocolInstance; - -/** - * This class implements the GProtocolInstance projection rule. - * - */ -public class GProtocolInstanceProjectionRule extends AbstractProtocolDeclProjectionRule - implements ProjectionRule { - - /** - * {@inheritDoc} - */ - public Object project(ModuleContext context, ModelObject mobj, RoleDecl role, IssueLogger logger) { - LProtocolInstance projected=new LProtocolInstance(); - GProtocolInstance source=(GProtocolInstance)mobj; - - projected.derivedFrom(source); - - projectProtocolDecl(context, source, projected, role, logger); - - String protocolName=source.getMemberName(); - - if (protocolName.indexOf('.') != -1) { - // Find the role of the target protocol - RoleInstantiation targetri=source.getRoleInstantiation(role); - - if (targetri == null) { - logger.error("Could not find role '"+role+"'", mobj); - return null; - } - - String otherRole=targetri.getAlias(); - - if (otherRole == null) { - // Find position - int index=source.getRoleInstantiations().indexOf(targetri); - - if (index != -1) { - ModelObject mo=context.getMember(protocolName); - - if (mo instanceof ProtocolDecl) { - ProtocolDecl pd=(ProtocolDecl)mo; - - if (pd.getRoleDeclarations().size() <= index) { - logger.error("Could not determine target role for '"+role+"'", mobj); - } else { - otherRole = pd.getRoleDeclarations().get(index).getName(); - } - } - } - } - - if (otherRole != null) { - // Modify final module part to include role name - int index=protocolName.lastIndexOf('.'); - - protocolName = protocolName.substring(0, index) + "_" + otherRole - + protocolName.substring(index); - } - } - - projected.setMemberName(protocolName); - - for (Argument arg : source.getArguments()) { - projected.getArguments().add(new Argument(arg)); - } - - for (RoleInstantiation ri : source.getRoleInstantiations()) { - projected.getRoleInstantiations().add(new RoleInstantiation(ri)); - } - - return (projected); - } - -} diff --git a/modules/projection/src/main/java/org/scribble/projection/rules/GRecursionProjectionRule.java b/modules/projection/src/main/java/org/scribble/projection/rules/GRecursionProjectionRule.java deleted file mode 100644 index 2ad4dab95..000000000 --- a/modules/projection/src/main/java/org/scribble/projection/rules/GRecursionProjectionRule.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.projection.rules; - -import org.scribble.context.ModuleContext; -import org.scribble.logging.IssueLogger; -import org.scribble.model.ModelObject; -import org.scribble.model.RoleDecl; -import org.scribble.model.global.GRecursion; -import org.scribble.model.local.LBlock; -import org.scribble.model.local.LRecursion; - -/** - * This class implements the GRecursion projection rule. - * - */ -public class GRecursionProjectionRule implements ProjectionRule { - - /** - * {@inheritDoc} - */ - public Object project(ModuleContext context, ModelObject mobj, - RoleDecl role, IssueLogger logger) { - LRecursion projected=null; - GRecursion source=(GRecursion)mobj; - - if (source.isRoleInvolved(role)) { - projected = new LRecursion(); - - projected.derivedFrom(source); - - projected.setLabel(source.getLabel()); - - ProjectionRule rule=ProjectionRuleFactory.getProjectionRule(source.getBlock()); - - if (rule != null) { - LBlock lb=(LBlock)rule.project(context, source.getBlock(), role, logger); - - if (lb != null) { - projected.setBlock(lb); - } - } - } - - return (projected); - } -} diff --git a/modules/projection/src/main/java/org/scribble/projection/rules/ModuleProjectionRule.java b/modules/projection/src/main/java/org/scribble/projection/rules/ModuleProjectionRule.java deleted file mode 100644 index b664763c1..000000000 --- a/modules/projection/src/main/java/org/scribble/projection/rules/ModuleProjectionRule.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.projection.rules; - -import org.scribble.context.ModuleContext; -import org.scribble.logging.IssueLogger; -import org.scribble.model.ImportDecl; -import org.scribble.model.ModelObject; -import org.scribble.model.Module; -import org.scribble.model.PayloadTypeDecl; -import org.scribble.model.ProtocolDecl; -import org.scribble.model.RoleDecl; -import org.scribble.model.global.GProtocolDefinition; -import org.scribble.model.global.GProtocolInstance; - -/** - * This class implements the Module projection rule. - * - */ -public class ModuleProjectionRule implements ProjectionRule { - - /** - * {@inheritDoc} - */ - public Object project(ModuleContext context, ModelObject mobj, - RoleDecl role, IssueLogger logger) { - java.util.Set ret=new java.util.HashSet(); - Module source=(Module)mobj; - - java.util.Set roles=new java.util.HashSet(); - - // Build list of roles - for (ProtocolDecl pd : source.getProtocols()) { - roles.addAll(pd.getRoleDeclarations()); - } - - for (RoleDecl rd : roles) { - - // Create new module - Module projected = new Module(); - - projected.derivedFrom(source); - - if (source.getName() != null) { - projected.setName(source.getName()+"_"+rd.getName()); - - // TODO: Need to investigate options for best pro - //projected.getFullyQualifiedName().setName(projected.getFullyQualifiedName().getName() - // +"_"+rd.getName()); - } - - // Copy imports - for (ImportDecl imp : source.getImports()) { - projected.getImports().add(new ImportDecl(imp)); - - // Modify the import statements - } - - // Copy payload type declarations - for (PayloadTypeDecl ptd : source.getPayloadTypeDeclarations()) { - projected.getPayloadTypeDeclarations().add(new PayloadTypeDecl(ptd)); - } - - for (ProtocolDecl pd : source.getProtocols()) { - - if (pd instanceof GProtocolDefinition || pd instanceof GProtocolInstance) { - ProtocolDecl gpd=(ProtocolDecl)pd; - - if (pd.getRoleDeclarations().contains(rd)) { - - ProjectionRule rule=ProjectionRuleFactory.getProjectionRule(gpd); - - if (rule != null) { - ProtocolDecl lpd=(ProtocolDecl)rule.project(context, gpd, rd, logger); - - if (lpd != null) { - projected.getProtocols().add(lpd); - } - } - } - } - } - - ret.add(projected); - } - - return (ret); - } - -} diff --git a/modules/projection/src/main/java/org/scribble/projection/rules/ProjectionMessages.java b/modules/projection/src/main/java/org/scribble/projection/rules/ProjectionMessages.java deleted file mode 100644 index 739967584..000000000 --- a/modules/projection/src/main/java/org/scribble/projection/rules/ProjectionMessages.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.projection.rules; - -/** - * This class is responsible for returning the projection messages - * used by the rules. - * - */ -public class ProjectionMessages { - - /** - * This method returns the message associated with the supplied key. - * - * @param key The key - * @return The message - */ - public static final String getMessage(String key) { - return (java.util.ResourceBundle.getBundle("scribble.projection.Messages").getString(key)); - } -} diff --git a/modules/projection/src/main/java/org/scribble/projection/rules/ProjectionRule.java b/modules/projection/src/main/java/org/scribble/projection/rules/ProjectionRule.java deleted file mode 100644 index 2270c99d8..000000000 --- a/modules/projection/src/main/java/org/scribble/projection/rules/ProjectionRule.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.projection.rules; - -import org.scribble.context.ModuleContext; -import org.scribble.logging.IssueLogger; -import org.scribble.model.ModelObject; -import org.scribble.model.RoleDecl; - -/** - * This interface represents a projection rule. - * - */ -public interface ProjectionRule { - - /** - * This method projects the supplied model object - * and reports any relevant issues to the supplied logger. - * - * @param context The module context - * @param mobj The model object - * @param role The role to project - * @param logger The logger - * @return The projected object, or list of objects - */ - public Object project(ModuleContext context, ModelObject mobj, - RoleDecl role, IssueLogger logger); - -} diff --git a/modules/projection/src/main/java/org/scribble/projection/rules/ProjectionRuleFactory.java b/modules/projection/src/main/java/org/scribble/projection/rules/ProjectionRuleFactory.java deleted file mode 100644 index 81764244f..000000000 --- a/modules/projection/src/main/java/org/scribble/projection/rules/ProjectionRuleFactory.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.projection.rules; - -import org.scribble.model.ModelObject; -import org.scribble.model.Module; -import org.scribble.model.global.GBlock; -import org.scribble.model.global.GChoice; -import org.scribble.model.global.GContinue; -import org.scribble.model.global.GDo; -import org.scribble.model.global.GInterruptible; -import org.scribble.model.global.GMessageTransfer; -import org.scribble.model.global.GParallel; -import org.scribble.model.global.GProtocolDefinition; -import org.scribble.model.global.GProtocolInstance; -import org.scribble.model.global.GRecursion; - -/** - * This class provides the factory capability for projection rules. - * - */ -public class ProjectionRuleFactory { - - private static java.util.Map, ProjectionRule> _rules= - new java.util.HashMap, ProjectionRule>(); - - static { - _rules.put(GBlock.class, new GBlockProjectionRule()); - _rules.put(GDo.class, new GDoProjectionRule()); - _rules.put(GChoice.class, new GChoiceProjectionRule()); - _rules.put(GContinue.class, new GContinueProjectionRule()); - _rules.put(GInterruptible.class, new GInterruptibleProjectionRule()); - _rules.put(GMessageTransfer.class, new GMessageTransferProjectionRule()); - _rules.put(GParallel.class, new GParallelProjectionRule()); - _rules.put(GProtocolDefinition.class, new GProtocolDefinitionProjectionRule()); - _rules.put(GProtocolInstance.class, new GProtocolInstanceProjectionRule()); - _rules.put(GRecursion.class, new GRecursionProjectionRule()); - _rules.put(Module.class, new ModuleProjectionRule()); - } - - /** - * This method returns the projection rule associated with the - * supplied model object. - * - * @param mobj The model object - * @return The projection rule, or null if not relevant - */ - public static ProjectionRule getProjectionRule(ModelObject mobj) { - return (_rules.get(mobj.getClass())); - } -} diff --git a/modules/projection/src/main/resources/scribble/projection/Messages.properties b/modules/projection/src/main/resources/scribble/projection/Messages.properties deleted file mode 100644 index fdd1889ff..000000000 --- a/modules/projection/src/main/resources/scribble/projection/Messages.properties +++ /dev/null @@ -1,2 +0,0 @@ -CODE=Message ''{0}'' - diff --git a/modules/projection/src/test/java/org/scribble/projection/ProtocolProjectionTest.java b/modules/projection/src/test/java/org/scribble/projection/ProtocolProjectionTest.java deleted file mode 100644 index 47585b342..000000000 --- a/modules/projection/src/test/java/org/scribble/projection/ProtocolProjectionTest.java +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.projection; - -import static org.junit.Assert.*; - -import java.util.Map; - -import org.scribble.context.DefaultModuleContext; -import org.scribble.logging.ConsoleIssueLogger; -import org.scribble.model.Module; -import org.scribble.model.local.LProtocolDecl; -import org.scribble.parser.ProtocolParser; -import org.scribble.parser.ProtocolModuleLoader; -import org.scribble.resources.DirectoryResourceLocator; -import org.scribble.resources.InputStreamResource; - -public class ProtocolProjectionTest { - - @org.junit.Test - public void testGProtocolDefinition() { - testProjection("GProtocolDefinition"); - } - - @org.junit.Test - public void testGProtocolInstance() { - testProjection("GProtocolInstance"); - } - - @org.junit.Test - public void testGChoice() { - testProjection("GChoice"); - } - - @org.junit.Test - public void testGRecursion() { - testProjection("GRecursion"); - } - - @org.junit.Test - public void testGParallel() { - testProjection("GParallel"); - } - - @org.junit.Test - public void testGInterruptible() { - testProjection("GInterruptible"); - } - - @org.junit.Test - public void testGDo() { - testProjection("GDo"); - } - - protected void testProjection(String name) { - - try { - String path="scribble/examples/"+name+".scr"; - - java.net.URL scrurl=ClassLoader.getSystemResource(path); - java.io.File scrFile=new java.io.File(scrurl.getFile()); - java.io.InputStream is=new java.io.FileInputStream(scrFile); - - java.net.URL url=ClassLoader.getSystemResource("scribble"); - java.io.File f=new java.io.File(url.getFile()); - - ProtocolParser pp=new ProtocolParser(); - - TestIssueLogger logger=new TestIssueLogger(); - - DirectoryResourceLocator locator=new DirectoryResourceLocator(f.getParentFile().getAbsolutePath()); - - ProtocolModuleLoader loader=new ProtocolModuleLoader(pp, locator, logger); - - InputStreamResource isr=new InputStreamResource(path, is); - - Module module=pp.parse(isr, loader, logger); - - if (module == null) { - fail("Module is null"); - } - - if (logger.isErrorsOrWarnings()) { - fail("Unexpected errors and/or warnings in "+name+".scr"); - } - - ProtocolProjector projector=new ProtocolProjector(); - - DefaultModuleContext context=new DefaultModuleContext(isr, module, loader); - - java.util.Set projected=projector.project(context, module, logger); - - for (Module lm : projected) { - String filename="scribble/results/"+lm.getLocalName(); - - /* - if (lm.getProtocols().size() > 0 && lm.getProtocols().get(0) instanceof LProtocolDecl) { - LProtocolDecl ld=(LProtocolDecl)lm.getProtocols().get(0); - - if (ld.getLocalRole() != null) { - filename += "_"+ld.getLocalRole().getName(); - } - } - */ - - filename += ".scr"; - - is = ClassLoader.getSystemResourceAsStream(filename); - - if (is == null) { - fail("Project result for '"+filename+"' not found"); - } - - byte[] b=new byte[is.available()]; - is.read(b); - - is.close(); - - String projd=lm.toString().trim(); - String expecting=new String(b).trim(); - - if (!projd.equals(expecting)) { - int len=projd.length(); - if (len > expecting.length()) { - len = expecting.length(); - } - for (int i=0; i < len; i++) { - if (projd.charAt(i) != expecting.charAt(i)) { - System.out.println("DIFF AT POSITION: "+i); - int showto=i+30; - if (i+10 >= len) { - showto = len; - } - System.out.println("PROJECTED: "+projd.substring(i, showto)); - System.out.println("EXPECT: "+expecting.substring(i, showto)); - break; - } - } - - System.err.println("Projected protocol '"+name+ - "' mismatch\nExpecting:\n"+expecting+"\nProjected:\n"+projd); - fail("Projected protocol '"+name+"' mismatch"); - } - } - - } catch (Exception e) { - e.printStackTrace(); - fail("Failed to project '"+name+".scr'"); - } - } - - protected class TestIssueLogger extends ConsoleIssueLogger { - - private java.util.List _errors=new java.util.ArrayList(); - private java.util.List _warnings=new java.util.ArrayList(); - - public void error(String issue, Map props) { - super.error(issue, props); - _errors.add(issue); - } - - public void warning(String issue, Map props) { - super.warning(issue, props); - _warnings.add(issue); - } - - public void info(String issue, Map props) { - super.info(issue, props); - } - - public boolean isErrorsOrWarnings() { - return (_errors.size() > 0 || _warnings.size() > 0); - } - } -} diff --git a/modules/projection/src/test/resources/scribble/examples/GChoice.scr b/modules/projection/src/test/resources/scribble/examples/GChoice.scr deleted file mode 100644 index 131a4e1d1..000000000 --- a/modules/projection/src/test/resources/scribble/examples/GChoice.scr +++ /dev/null @@ -1,12 +0,0 @@ -module scribble.examples.GChoice; - -type "{http://www.acme.com/financial}Order" from "http://www.acme.com/schemas/Order.xsd" as Order; -type "{http://www.acme.com/financial}QuoteRequest" from "http://www.acme.com/schemas/QuoteRequest.xsd" as QuoteRequest; - -global protocol GChoiceTest(role Buyer,role Seller) { - choice at Buyer { - buy(Order) from Buyer to Seller; - } or { - buy(QuoteRequest) from Buyer to Seller; - } -} diff --git a/modules/projection/src/test/resources/scribble/examples/GDo.scr b/modules/projection/src/test/resources/scribble/examples/GDo.scr deleted file mode 100644 index 25ce9979a..000000000 --- a/modules/projection/src/test/resources/scribble/examples/GDo.scr +++ /dev/null @@ -1,9 +0,0 @@ -module scribble.examples.GDo; - -type "{http://www.acme.com/financial}Order" from "http://www.acme.com/schemas/Order.xsd" as Order; -type "{http://www.acme.com/financial}Receipt" from "http://www.acme.com/schemas/Receipt.xsd" as Receipt; - -global protocol GDoTest(role Buyer,role Seller) { - do OtherProtocol(Buyer as OtherBuyer,Seller as OtherSeller); - do myscope: a.b.c.OtherProtocol(Buyer as OtherBuyer,Seller as OtherSeller); -} diff --git a/modules/projection/src/test/resources/scribble/examples/GInterruptible.scr b/modules/projection/src/test/resources/scribble/examples/GInterruptible.scr deleted file mode 100644 index 009d93d5c..000000000 --- a/modules/projection/src/test/resources/scribble/examples/GInterruptible.scr +++ /dev/null @@ -1,12 +0,0 @@ -module scribble.examples.GInterruptible; - -type "{http://www.acme.com/financial}Order" from "http://www.acme.com/schemas/Order.xsd" as Order; - -global protocol GInterruptibleTest(role Buyer,role Seller) { - interruptible MyLabel: { - buy(Order) from Buyer to Seller; - } with { - soldout(Order) by Seller; - cancel(Order) by Buyer; - } -} diff --git a/modules/projection/src/test/resources/scribble/examples/GParallel.scr b/modules/projection/src/test/resources/scribble/examples/GParallel.scr deleted file mode 100644 index 2ffee9e3f..000000000 --- a/modules/projection/src/test/resources/scribble/examples/GParallel.scr +++ /dev/null @@ -1,12 +0,0 @@ -module scribble.examples.GParallel; - -type "{http://www.acme.com/financial}Order" from "http://www.acme.com/schemas/Order.xsd" as Order; -type "{http://www.acme.com/financial}QuoteRequest" from "http://www.acme.com/schemas/QuoteRequest.xsd" as QuoteRequest; - -global protocol GParallelTest(role Buyer,role Seller) { - par { - buy(Order) from Buyer to Seller; - } and { - buy(QuoteRequest) from Buyer to Seller; - } -} diff --git a/modules/projection/src/test/resources/scribble/examples/GProtocolDefinition.scr b/modules/projection/src/test/resources/scribble/examples/GProtocolDefinition.scr deleted file mode 100644 index 31b2da38d..000000000 --- a/modules/projection/src/test/resources/scribble/examples/GProtocolDefinition.scr +++ /dev/null @@ -1,17 +0,0 @@ -module scribble.examples.GProtocolDefinition; - -import scribble.examples.ImportDefinitions; -from scribble.examples.ImportDefinitions import PlaceOrder; -from scribble.examples.ImportDefinitions import Receipt as OrderReceipt; - -type "{http://www.acme.com/financial}Order" from "http://www.acme.com/schemas/Order.xsd" as Order; -type "{http://www.acme.com/financial}Customer" from "http://www.acme.com/schemas/Customer.xsd" as Customer; - -global protocol GProtocolDefinition(role Buyer,role SellerA,role SellerB) { - buy(Order,Customer) from Buyer to SellerA; - confirm(OrderReceipt) from SellerA to Buyer; - buy(Order,Customer) from Buyer to SellerA,SellerB; - buy(o:Order,c:Customer) from Buyer to SellerA; - buy(Order) from Buyer to SellerA,SellerB; - buy(ord:Order) from Buyer to SellerA; -} diff --git a/modules/projection/src/test/resources/scribble/examples/GProtocolInstance.scr b/modules/projection/src/test/resources/scribble/examples/GProtocolInstance.scr deleted file mode 100644 index 5fa874644..000000000 --- a/modules/projection/src/test/resources/scribble/examples/GProtocolInstance.scr +++ /dev/null @@ -1,10 +0,0 @@ -module scribble.examples.GProtocolInstance; - -type "{http://www.acme.com/financial}Order" from "http://www.acme.com/schemas/Order.xsd" as OrderRequest; - -global protocol Submit(role Source,role Destination) { -} - -global protocol PlaceOrder(role Buyer,role Seller) instantiates Submit(Buyer,Seller); - -global protocol PlaceOrder2(role Buyer,role Seller) instantiates scribble.examples.GProtocolInstance.Submit(Buyer,Seller); diff --git a/modules/projection/src/test/resources/scribble/examples/GRecursion.scr b/modules/projection/src/test/resources/scribble/examples/GRecursion.scr deleted file mode 100644 index b8f1da021..000000000 --- a/modules/projection/src/test/resources/scribble/examples/GRecursion.scr +++ /dev/null @@ -1,10 +0,0 @@ -module scribble.examples.GRecursion; - -type "{http://www.acme.com/financial}Order" from "http://www.acme.com/schemas/Order.xsd" as Order; - -global protocol GRecursionTest(role Buyer,role Seller) { - rec MyLabel { - buy(Order) from Buyer to Seller; - continue MyLabel; - } -} diff --git a/modules/projection/src/test/resources/scribble/examples/ImportDefinitions.scr b/modules/projection/src/test/resources/scribble/examples/ImportDefinitions.scr deleted file mode 100644 index db1ad5d33..000000000 --- a/modules/projection/src/test/resources/scribble/examples/ImportDefinitions.scr +++ /dev/null @@ -1,4 +0,0 @@ -module scribble.examples.ImportDefinitions; - -type "{http://www.acme.com/financial}PlaceOrder" from "http://www.acme.com/schemas/Order.xsd" as PlaceOrder; -type "{http://www.acme.com/financial}Receipt" from "http://www.acme.com/schemas/Customer.xsd" as Receipt; diff --git a/modules/projection/src/test/resources/scribble/results/GChoice_Buyer.scr b/modules/projection/src/test/resources/scribble/results/GChoice_Buyer.scr deleted file mode 100644 index df583b82a..000000000 --- a/modules/projection/src/test/resources/scribble/results/GChoice_Buyer.scr +++ /dev/null @@ -1,12 +0,0 @@ -module scribble.examples.GChoice_Buyer; - -type "{http://www.acme.com/financial}Order" from "http://www.acme.com/schemas/Order.xsd" as Order; -type "{http://www.acme.com/financial}QuoteRequest" from "http://www.acme.com/schemas/QuoteRequest.xsd" as QuoteRequest; - -local protocol GChoiceTest at Buyer(role Buyer,role Seller) { - choice at Buyer { - buy(Order) to Seller; - } or { - buy(QuoteRequest) to Seller; - } -} diff --git a/modules/projection/src/test/resources/scribble/results/GChoice_Seller.scr b/modules/projection/src/test/resources/scribble/results/GChoice_Seller.scr deleted file mode 100644 index 453f8ae11..000000000 --- a/modules/projection/src/test/resources/scribble/results/GChoice_Seller.scr +++ /dev/null @@ -1,12 +0,0 @@ -module scribble.examples.GChoice_Seller; - -type "{http://www.acme.com/financial}Order" from "http://www.acme.com/schemas/Order.xsd" as Order; -type "{http://www.acme.com/financial}QuoteRequest" from "http://www.acme.com/schemas/QuoteRequest.xsd" as QuoteRequest; - -local protocol GChoiceTest at Seller(role Buyer,role Seller) { - choice at Buyer { - buy(Order) from Buyer; - } or { - buy(QuoteRequest) from Buyer; - } -} diff --git a/modules/projection/src/test/resources/scribble/results/GDo_Buyer.scr b/modules/projection/src/test/resources/scribble/results/GDo_Buyer.scr deleted file mode 100644 index 8c4dc9b8b..000000000 --- a/modules/projection/src/test/resources/scribble/results/GDo_Buyer.scr +++ /dev/null @@ -1,9 +0,0 @@ -module scribble.examples.GDo_Buyer; - -type "{http://www.acme.com/financial}Order" from "http://www.acme.com/schemas/Order.xsd" as Order; -type "{http://www.acme.com/financial}Receipt" from "http://www.acme.com/schemas/Receipt.xsd" as Receipt; - -local protocol GDoTest at Buyer(role Buyer,role Seller) { - do OtherProtocol(Buyer as OtherBuyer,Seller as OtherSeller); - do myscope: a.b.c_OtherBuyer.OtherProtocol(Buyer as OtherBuyer,Seller as OtherSeller); -} diff --git a/modules/projection/src/test/resources/scribble/results/GDo_Seller.scr b/modules/projection/src/test/resources/scribble/results/GDo_Seller.scr deleted file mode 100644 index 426732b93..000000000 --- a/modules/projection/src/test/resources/scribble/results/GDo_Seller.scr +++ /dev/null @@ -1,9 +0,0 @@ -module scribble.examples.GDo_Seller; - -type "{http://www.acme.com/financial}Order" from "http://www.acme.com/schemas/Order.xsd" as Order; -type "{http://www.acme.com/financial}Receipt" from "http://www.acme.com/schemas/Receipt.xsd" as Receipt; - -local protocol GDoTest at Seller(role Buyer,role Seller) { - do OtherProtocol(Buyer as OtherBuyer,Seller as OtherSeller); - do myscope: a.b.c_OtherSeller.OtherProtocol(Buyer as OtherBuyer,Seller as OtherSeller); -} diff --git a/modules/projection/src/test/resources/scribble/results/GInterruptible_Buyer.scr b/modules/projection/src/test/resources/scribble/results/GInterruptible_Buyer.scr deleted file mode 100644 index 2867c5b12..000000000 --- a/modules/projection/src/test/resources/scribble/results/GInterruptible_Buyer.scr +++ /dev/null @@ -1,12 +0,0 @@ -module scribble.examples.GInterruptible_Buyer; - -type "{http://www.acme.com/financial}Order" from "http://www.acme.com/schemas/Order.xsd" as Order; - -local protocol GInterruptibleTest at Buyer(role Buyer,role Seller) { - interruptible MyLabel: { - buy(Order) to Seller; - } with { - throws cancel(Order) to Seller; - catches soldout(Order) from Seller; - } -} diff --git a/modules/projection/src/test/resources/scribble/results/GInterruptible_Seller.scr b/modules/projection/src/test/resources/scribble/results/GInterruptible_Seller.scr deleted file mode 100644 index 0343ac740..000000000 --- a/modules/projection/src/test/resources/scribble/results/GInterruptible_Seller.scr +++ /dev/null @@ -1,12 +0,0 @@ -module scribble.examples.GInterruptible_Seller; - -type "{http://www.acme.com/financial}Order" from "http://www.acme.com/schemas/Order.xsd" as Order; - -local protocol GInterruptibleTest at Seller(role Buyer,role Seller) { - interruptible MyLabel: { - buy(Order) from Buyer; - } with { - throws soldout(Order) to Buyer; - catches cancel(Order) from Buyer; - } -} diff --git a/modules/projection/src/test/resources/scribble/results/GParallel_Buyer.scr b/modules/projection/src/test/resources/scribble/results/GParallel_Buyer.scr deleted file mode 100644 index 80ba7b439..000000000 --- a/modules/projection/src/test/resources/scribble/results/GParallel_Buyer.scr +++ /dev/null @@ -1,12 +0,0 @@ -module scribble.examples.GParallel_Buyer; - -type "{http://www.acme.com/financial}Order" from "http://www.acme.com/schemas/Order.xsd" as Order; -type "{http://www.acme.com/financial}QuoteRequest" from "http://www.acme.com/schemas/QuoteRequest.xsd" as QuoteRequest; - -local protocol GParallelTest at Buyer(role Buyer,role Seller) { - par { - buy(Order) to Seller; - } and { - buy(QuoteRequest) to Seller; - } -} diff --git a/modules/projection/src/test/resources/scribble/results/GParallel_Seller.scr b/modules/projection/src/test/resources/scribble/results/GParallel_Seller.scr deleted file mode 100644 index cc411a557..000000000 --- a/modules/projection/src/test/resources/scribble/results/GParallel_Seller.scr +++ /dev/null @@ -1,12 +0,0 @@ -module scribble.examples.GParallel_Seller; - -type "{http://www.acme.com/financial}Order" from "http://www.acme.com/schemas/Order.xsd" as Order; -type "{http://www.acme.com/financial}QuoteRequest" from "http://www.acme.com/schemas/QuoteRequest.xsd" as QuoteRequest; - -local protocol GParallelTest at Seller(role Buyer,role Seller) { - par { - buy(Order) from Buyer; - } and { - buy(QuoteRequest) from Buyer; - } -} diff --git a/modules/projection/src/test/resources/scribble/results/GProtocolDefinition_Buyer.scr b/modules/projection/src/test/resources/scribble/results/GProtocolDefinition_Buyer.scr deleted file mode 100644 index 3978bf733..000000000 --- a/modules/projection/src/test/resources/scribble/results/GProtocolDefinition_Buyer.scr +++ /dev/null @@ -1,17 +0,0 @@ -module scribble.examples.GProtocolDefinition_Buyer; - -import scribble.examples.ImportDefinitions; -from scribble.examples.ImportDefinitions import PlaceOrder; -from scribble.examples.ImportDefinitions import Receipt as OrderReceipt; - -type "{http://www.acme.com/financial}Order" from "http://www.acme.com/schemas/Order.xsd" as Order; -type "{http://www.acme.com/financial}Customer" from "http://www.acme.com/schemas/Customer.xsd" as Customer; - -local protocol GProtocolDefinition at Buyer(role Buyer,role SellerA,role SellerB) { - buy(Order,Customer) to SellerA; - confirm(OrderReceipt) from SellerA; - buy(Order,Customer) to SellerA,SellerB; - buy(o:Order,c:Customer) to SellerA; - buy(Order) to SellerA,SellerB; - buy(ord:Order) to SellerA; -} diff --git a/modules/projection/src/test/resources/scribble/results/GProtocolDefinition_SellerA.scr b/modules/projection/src/test/resources/scribble/results/GProtocolDefinition_SellerA.scr deleted file mode 100644 index 53b4d8170..000000000 --- a/modules/projection/src/test/resources/scribble/results/GProtocolDefinition_SellerA.scr +++ /dev/null @@ -1,17 +0,0 @@ -module scribble.examples.GProtocolDefinition_SellerA; - -import scribble.examples.ImportDefinitions; -from scribble.examples.ImportDefinitions import PlaceOrder; -from scribble.examples.ImportDefinitions import Receipt as OrderReceipt; - -type "{http://www.acme.com/financial}Order" from "http://www.acme.com/schemas/Order.xsd" as Order; -type "{http://www.acme.com/financial}Customer" from "http://www.acme.com/schemas/Customer.xsd" as Customer; - -local protocol GProtocolDefinition at SellerA(role Buyer,role SellerA,role SellerB) { - buy(Order,Customer) from Buyer; - confirm(OrderReceipt) to Buyer; - buy(Order,Customer) from Buyer; - buy(o:Order,c:Customer) from Buyer; - buy(Order) from Buyer; - buy(ord:Order) from Buyer; -} diff --git a/modules/projection/src/test/resources/scribble/results/GProtocolDefinition_SellerB.scr b/modules/projection/src/test/resources/scribble/results/GProtocolDefinition_SellerB.scr deleted file mode 100644 index 6e65a35d3..000000000 --- a/modules/projection/src/test/resources/scribble/results/GProtocolDefinition_SellerB.scr +++ /dev/null @@ -1,13 +0,0 @@ -module scribble.examples.GProtocolDefinition_SellerB; - -import scribble.examples.ImportDefinitions; -from scribble.examples.ImportDefinitions import PlaceOrder; -from scribble.examples.ImportDefinitions import Receipt as OrderReceipt; - -type "{http://www.acme.com/financial}Order" from "http://www.acme.com/schemas/Order.xsd" as Order; -type "{http://www.acme.com/financial}Customer" from "http://www.acme.com/schemas/Customer.xsd" as Customer; - -local protocol GProtocolDefinition at SellerB(role Buyer,role SellerA,role SellerB) { - buy(Order,Customer) from Buyer; - buy(Order) from Buyer; -} \ No newline at end of file diff --git a/modules/projection/src/test/resources/scribble/results/GProtocolInstance_Buyer.scr b/modules/projection/src/test/resources/scribble/results/GProtocolInstance_Buyer.scr deleted file mode 100644 index 6db7f0d10..000000000 --- a/modules/projection/src/test/resources/scribble/results/GProtocolInstance_Buyer.scr +++ /dev/null @@ -1,7 +0,0 @@ -module scribble.examples.GProtocolInstance_Buyer; - -type "{http://www.acme.com/financial}Order" from "http://www.acme.com/schemas/Order.xsd" as OrderRequest; - -local protocol PlaceOrder at Buyer(role Buyer,role Seller) instantiates Submit(Buyer,Seller); - -local protocol PlaceOrder2 at Buyer(role Buyer,role Seller) instantiates scribble.examples.GProtocolInstance_Source.Submit(Buyer,Seller); diff --git a/modules/projection/src/test/resources/scribble/results/GProtocolInstance_Destination.scr b/modules/projection/src/test/resources/scribble/results/GProtocolInstance_Destination.scr deleted file mode 100644 index 90048186b..000000000 --- a/modules/projection/src/test/resources/scribble/results/GProtocolInstance_Destination.scr +++ /dev/null @@ -1,6 +0,0 @@ -module scribble.examples.GProtocolInstance_Destination; - -type "{http://www.acme.com/financial}Order" from "http://www.acme.com/schemas/Order.xsd" as OrderRequest; - -local protocol Submit at Destination(role Source,role Destination) { -} diff --git a/modules/projection/src/test/resources/scribble/results/GProtocolInstance_Seller.scr b/modules/projection/src/test/resources/scribble/results/GProtocolInstance_Seller.scr deleted file mode 100644 index 9d1aafada..000000000 --- a/modules/projection/src/test/resources/scribble/results/GProtocolInstance_Seller.scr +++ /dev/null @@ -1,7 +0,0 @@ -module scribble.examples.GProtocolInstance_Seller; - -type "{http://www.acme.com/financial}Order" from "http://www.acme.com/schemas/Order.xsd" as OrderRequest; - -local protocol PlaceOrder at Seller(role Buyer,role Seller) instantiates Submit(Buyer,Seller); - -local protocol PlaceOrder2 at Seller(role Buyer,role Seller) instantiates scribble.examples.GProtocolInstance_Destination.Submit(Buyer,Seller); diff --git a/modules/projection/src/test/resources/scribble/results/GProtocolInstance_Source.scr b/modules/projection/src/test/resources/scribble/results/GProtocolInstance_Source.scr deleted file mode 100644 index 3a4a84b3f..000000000 --- a/modules/projection/src/test/resources/scribble/results/GProtocolInstance_Source.scr +++ /dev/null @@ -1,6 +0,0 @@ -module scribble.examples.GProtocolInstance_Source; - -type "{http://www.acme.com/financial}Order" from "http://www.acme.com/schemas/Order.xsd" as OrderRequest; - -local protocol Submit at Source(role Source,role Destination) { -} diff --git a/modules/projection/src/test/resources/scribble/results/GRecursion_Buyer.scr b/modules/projection/src/test/resources/scribble/results/GRecursion_Buyer.scr deleted file mode 100644 index 8c9a8de43..000000000 --- a/modules/projection/src/test/resources/scribble/results/GRecursion_Buyer.scr +++ /dev/null @@ -1,10 +0,0 @@ -module scribble.examples.GRecursion_Buyer; - -type "{http://www.acme.com/financial}Order" from "http://www.acme.com/schemas/Order.xsd" as Order; - -local protocol GRecursionTest at Buyer(role Buyer,role Seller) { - rec MyLabel { - buy(Order) to Seller; - continue MyLabel; - } -} diff --git a/modules/projection/src/test/resources/scribble/results/GRecursion_Seller.scr b/modules/projection/src/test/resources/scribble/results/GRecursion_Seller.scr deleted file mode 100644 index a2bc5497f..000000000 --- a/modules/projection/src/test/resources/scribble/results/GRecursion_Seller.scr +++ /dev/null @@ -1,10 +0,0 @@ -module scribble.examples.GRecursion_Seller; - -type "{http://www.acme.com/financial}Order" from "http://www.acme.com/schemas/Order.xsd" as Order; - -local protocol GRecursionTest at Seller(role Buyer,role Seller) { - rec MyLabel { - buy(Order) from Buyer; - continue MyLabel; - } -} diff --git a/modules/trace-parser/LICENSE.txt b/modules/trace-parser/LICENSE.txt deleted file mode 100644 index 29f81d812..000000000 --- a/modules/trace-parser/LICENSE.txt +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/modules/trace-parser/build.properties b/modules/trace-parser/build.properties deleted file mode 100644 index b844f8dbe..000000000 --- a/modules/trace-parser/build.properties +++ /dev/null @@ -1,19 +0,0 @@ -source.. = src/main/java/,\ - target/generated-sources/antlr3/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - src/main/resources/lib/antlr-3.2.jar,\ - OSGI-INF/,\ - LICENSE.txt -src.includes = target/generated-sources/,\ - src/,\ - pom.xml,\ - build.properties,\ - META-INF/,\ - .project,\ - .classpath,\ - OSGI-INF/,\ - LICENSE.txt -jars.compile.order = .,\ - lib/antlr-3.2.jar diff --git a/modules/trace-parser/pom.xml b/modules/trace-parser/pom.xml deleted file mode 100644 index d9b5e467b..000000000 --- a/modules/trace-parser/pom.xml +++ /dev/null @@ -1,58 +0,0 @@ - - 4.0.0 - scribble-trace-parser - jar - Scribble::Modules::Trace Parser - - - org.scribble - modules - 0.3.2-SNAPSHOT - - - - - org.scribble - scribble-core - ${project.version} - - - org.scribble - scribble-validation - ${project.version} - - - org.scribble - scribble-trace - ${project.version} - - - org.antlr - antlr-runtime - - - junit - junit - test - - - - - - - org.antlr - antlr3-maven-plugin - ${antlr.version} - - - - antlr - - - - - - - - diff --git a/modules/trace-parser/src/main/antlr3/org/scribble/trace/parser/antlr/ScribbleTrace.g b/modules/trace-parser/src/main/antlr3/org/scribble/trace/parser/antlr/ScribbleTrace.g deleted file mode 100644 index 958153b28..000000000 --- a/modules/trace-parser/src/main/antlr3/org/scribble/trace/parser/antlr/ScribbleTrace.g +++ /dev/null @@ -1,145 +0,0 @@ -grammar ScribbleTrace; - -options -{ - output=AST; - backtrack=true; -} - -tokens -{ - TRACEKW = 'trace'; - BYKW = 'by'; - SHOWSKW = 'shows'; - - ROLEKW = 'role'; - SIMULATINGKW = 'simulating'; - PROTOCOLKW = 'protocol'; - ASKW = 'as'; - - FROMKW = 'from'; - TOKW = 'to'; -} - - -/*------------------------------------------------------------------ - * JAVA SPECIFIC DEFINITIONS - *------------------------------------------------------------------*/ - -@header { -package org.scribble.trace.parser.antlr; -} - -@lexer::header { -package org.scribble.trace.parser.antlr; -} - -@members { - private org.scribble.logging.IssueLogger _logger=null; - private String _document=null; - private boolean _errorOccurred=false; - - public void setLogger(org.scribble.logging.IssueLogger logger) { - _logger = logger; - } - - public void setDocument(String doc) { - _document = doc; - } - - public void emitErrorMessage(String mesg) { - if (_logger == null) { - super.emitErrorMessage(mesg); - } else { - _logger.error(org.scribble.trace.parser.antlr.ANTLRMessageUtil.getMessageText(mesg), - org.scribble.trace.parser.antlr.ANTLRMessageUtil.getProperties(mesg, _document)); - } - _errorOccurred = true; - } - - public boolean isErrorOccurred() { - return(_errorOccurred); - } -} - - - - -/**************************************************************************** - * Chapter 2 Lexical Strucure (Lexer rules) - ***************************************************************************/ - -/* - * Section 2.1 White space (Section 2.1) - */ -WHITESPACE: - ('\t' | ' ' | '\r' | '\n'| '\u000C')+ - { - $channel = HIDDEN; - } -; - -/** - * Section 2.2 Comments - */ -COMMENT: - '/*' .* '*/' - { - $channel=HIDDEN; - } -; - -LINE_COMMENT: - '//' ~('\n'|'\r')* '\r'? '\n' - { - $channel=HIDDEN; - } -; - -/** - * Section 2.3 Identifiers - */ -IDENTIFIER: - (LETTER | UNDERSCORE) (LETTER | DIGIT | UNDERSCORE)* -; - -fragment SYMBOL: - '{' | '}' | '(' | ')' | '[' | ']' | ':' | '/' | '\\' | '.' | '\#' -| - '&' | '?' | '!' | UNDERSCORE -; - -// Comes after SYMBOL due to an ANTLR syntax highlighting issue -// involving quotes -EXTIDENTIFIER: - '"' ( ~('\\'|'"') )* '"' -; - -fragment LETTER: - 'a'..'z' | 'A'..'Z' -; - -fragment DIGIT: - '0'..'9' -; - -fragment UNDERSCORE: - '_' -; - -sentence: IDENTIFIER+; - -trace: tracedefn ( roledefn )* ( stepdefn )* ; - -tracedefn: TRACEKW IDENTIFIER ( BYKW sentence ( SHOWSKW sentence )? )? ';' ; - -module: IDENTIFIER ( '.' IDENTIFIER )* ; - -roledefn: ROLEKW IDENTIFIER ( SIMULATINGKW module PROTOCOLKW IDENTIFIER ( ASKW IDENTIFIER )? )? ';' ; - -stepdefn: messagetransfer ; - -messagetransfer: IDENTIFIER ( '(' ( parameter ( ',' parameter )* )? ')' )? FROMKW IDENTIFIER TOKW IDENTIFIER ( ',' IDENTIFIER )* ';' ; - -parameter: EXTIDENTIFIER ( '=' EXTIDENTIFIER )? ; - diff --git a/modules/trace-parser/src/main/java/org/scribble/trace/parser/TraceParser.java b/modules/trace-parser/src/main/java/org/scribble/trace/parser/TraceParser.java deleted file mode 100644 index 6aed9bd31..000000000 --- a/modules/trace-parser/src/main/java/org/scribble/trace/parser/TraceParser.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.trace.parser; - -import java.io.IOException; - -import org.antlr.runtime.ANTLRStringStream; -import org.antlr.runtime.CommonTokenStream; -import org.scribble.logging.IssueLogger; -import org.scribble.trace.model.Trace; -import org.scribble.trace.parser.antlr.TraceTreeAdaptor; -import org.scribble.trace.parser.antlr.ScribbleTraceLexer; -import org.scribble.trace.parser.antlr.ScribbleTraceParser; -import org.scribble.resources.Resource; - -/** - * This class provides the ANTLR implementation of the Protocol Parser - * interface. - * - */ -public class TraceParser { - - /** - * Default constructor. - */ - public TraceParser() { - } - - /** - * This method parses the scribble protocol contained in the supplied - * resource. The resource locator is used to access other resources, - * and the logger reports information, warnings and errors. - * - * @param resource The resource - * @param logger The logger - * @return The module, or null if an error occurred - * @throws IOException Failed to retrieve protocol from input stream - */ - public Trace parse(Resource resource, final IssueLogger logger) - throws IOException { - Trace ret=null; - - try { - java.io.InputStream is=resource.getInputStream(); - - byte[] b=new byte[is.available()]; - is.read(b); - - is.close(); - - String document=new String(b); - - ScribbleTraceLexer lex = new ScribbleTraceLexer(new ANTLRStringStream(document)); - CommonTokenStream tokens = new CommonTokenStream(lex); - - ScribbleTraceParser parser = new ScribbleTraceParser(tokens); - - TraceTreeAdaptor adaptor=new TraceTreeAdaptor(); - adaptor.setParser(parser); - - parser.setDocument(document); - parser.setTreeAdaptor(adaptor); - - parser.setLogger(logger); - - parser.trace(); - - if (!parser.isErrorOccurred()) { - ret = adaptor.getTrace(); - } - - } catch (Exception e) { - e.printStackTrace(); - } - - return (ret); - } - -} diff --git a/modules/trace-parser/src/main/java/org/scribble/trace/parser/antlr/ANTLRMessageUtil.java b/modules/trace-parser/src/main/java/org/scribble/trace/parser/antlr/ANTLRMessageUtil.java deleted file mode 100644 index 77ae7df94..000000000 --- a/modules/trace-parser/src/main/java/org/scribble/trace/parser/antlr/ANTLRMessageUtil.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Copyright 2009-10 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.trace.parser.antlr; - -import org.scribble.model.ModelObject; - -/** - * ANTLR message utilities. - * - */ -public final class ANTLRMessageUtil { - - /** - * Private constructor. - */ - private ANTLRMessageUtil() { - } - - /** - * End location separator. - */ - private static final char END_LOCATION_SEPARATOR = ' '; - - /** - * Location prefix token. - */ - private static final String LOCATION_PREFIX_TOKEN = "line "; - - /** - * This method removes the message location prefix. - * - * @param mesg The message - * @return The message with the location information removed - */ - public static String getMessageText(String mesg) { - String ret=mesg; - - if (mesg != null && mesg.startsWith(LOCATION_PREFIX_TOKEN)) { - int index=mesg.indexOf(END_LOCATION_SEPARATOR, LOCATION_PREFIX_TOKEN.length()); - - if (index != -1) { - ret = mesg.substring(index+1); - } - } - - return (ret); - } - - /** - * This method returns the properties. - * - * @param mesg The message - * @param document The document - * @return The properties - */ - public static java.util.Map getProperties(String mesg, String document) { - java.util.Map ret=null; - - if (mesg != null && mesg.startsWith(LOCATION_PREFIX_TOKEN)) { - int index=mesg.indexOf(END_LOCATION_SEPARATOR, LOCATION_PREFIX_TOKEN.length()); - - if (index != -1) { - String lineDetails=mesg.substring(LOCATION_PREFIX_TOKEN.length(), index); - - String[] nums=lineDetails.split(":"); - - if (nums != null && nums.length == 2) { - ret = new java.util.HashMap(); - - Integer line=Integer.parseInt(nums[0]); - Integer col=Integer.parseInt(nums[1]); - - ret.put(ModelObject.START_LINE, line); - ret.put(ModelObject.START_COLUMN, col); - - // Determine the position within the document - int pos=0; - - for (int i=0; pos != -1 && i < line.intValue()-1; i++) { - pos = document.indexOf("\n", pos); - - if (pos != -1) { - pos += 1; - } - } - - if (pos != -1) { - pos += col.intValue(); - - ret.put(ModelObject.START_POSITION, new Integer(pos)); - - // Find next whitespace - int endpos=document.length(); - int nextpos=-1; - - for (int j=pos+1; nextpos == -1 && j < endpos; j++) { - char ch=document.charAt(j); - if (Character.isWhitespace(ch) || !Character.isLetterOrDigit(ch)) { - nextpos = j; - } - } - - if (nextpos == -1) { - nextpos = pos; - } - - ret.put(ModelObject.END_POSITION, new Integer(nextpos)); - } - } - } - } - - return (ret); - } -} diff --git a/modules/trace-parser/src/main/java/org/scribble/trace/parser/antlr/AbstractModelAdaptor.java b/modules/trace-parser/src/main/java/org/scribble/trace/parser/antlr/AbstractModelAdaptor.java deleted file mode 100644 index 5de4f9371..000000000 --- a/modules/trace-parser/src/main/java/org/scribble/trace/parser/antlr/AbstractModelAdaptor.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.trace.parser.antlr; - -import org.antlr.runtime.CommonToken; -import org.scribble.model.ModelObject; - -/** - * This class provides the abstract based implementation for a model adapter. - * - */ -public abstract class AbstractModelAdaptor implements ModelAdaptor { - - /** - * This method sets the start properties on the supplied model object. - * - * @param mobj The model object - * @param source The source object - */ - protected void setStartProperties(ModelObject mobj, Object source) { - if (source instanceof CommonToken) { - mobj.getProperties().put(ModelObject.START_LINE, ((CommonToken)source).getLine()); - mobj.getProperties().put(ModelObject.START_COLUMN, ((CommonToken)source).getCharPositionInLine()); - } else if (source instanceof ModelObject) { - mobj.getProperties().put(ModelObject.START_LINE, ((ModelObject)source).getProperties().get(ModelObject.START_LINE)); - mobj.getProperties().put(ModelObject.START_COLUMN, ((ModelObject)source).getProperties().get(ModelObject.START_COLUMN)); - } - } - - /** - * This method sets the end properties on the supplied model object. - * - * @param mobj The model object - * @param source The source object - */ - protected void setEndProperties(ModelObject mobj, Object source) { - if (source instanceof CommonToken) { - mobj.getProperties().put(ModelObject.END_LINE, ((CommonToken)source).getLine()); - mobj.getProperties().put(ModelObject.END_COLUMN, ((CommonToken)source).getCharPositionInLine() - +((CommonToken)source).getText().length()); - } else if (source instanceof ModelObject) { - mobj.getProperties().put(ModelObject.END_LINE, ((ModelObject)source).getProperties().get(ModelObject.END_LINE)); - mobj.getProperties().put(ModelObject.END_COLUMN, ((ModelObject)source).getProperties().get(ModelObject.END_COLUMN)); - } - } -} diff --git a/modules/trace-parser/src/main/java/org/scribble/trace/parser/antlr/DefaultParserContext.java b/modules/trace-parser/src/main/java/org/scribble/trace/parser/antlr/DefaultParserContext.java deleted file mode 100644 index 68b989fca..000000000 --- a/modules/trace-parser/src/main/java/org/scribble/trace/parser/antlr/DefaultParserContext.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.trace.parser.antlr; - -/** - * This interface represents the context used by - * the parser. - * - */ -public class DefaultParserContext implements ParserContext { - - private java.util.Stack _components=new java.util.Stack(); - - /** - * {@inheritDoc} - */ - public Object pop() { - return (_components.pop()); - } - - /** - * {@inheritDoc} - */ - public Object peek() { - return (_components.peek()); - } - - /** - * {@inheritDoc} - */ - public void push(Object obj) { - _components.push(obj); - } - -} diff --git a/modules/trace-parser/src/main/java/org/scribble/trace/parser/antlr/MessageTransferModelAdaptor.java b/modules/trace-parser/src/main/java/org/scribble/trace/parser/antlr/MessageTransferModelAdaptor.java deleted file mode 100644 index 6c8e45118..000000000 --- a/modules/trace-parser/src/main/java/org/scribble/trace/parser/antlr/MessageTransferModelAdaptor.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.trace.parser.antlr; - -import org.antlr.runtime.CommonToken; -import org.scribble.trace.model.Message; -import org.scribble.trace.model.MessageTransfer; - -/** - * This class provides the model adapter for the 'message transfer' parser rule. - * - */ -public class MessageTransferModelAdaptor extends AbstractModelAdaptor { - - /** - * {@inheritDoc} - */ - public Object createModelObject(ParserContext context) { - MessageTransfer ret=new MessageTransfer(); - Message mesg=new Message(); - ret.setMessage(mesg); - - // Consume ';' - context.pop(); - - ret.getToRoles().add(((CommonToken)context.pop()).getText()); - - while (((CommonToken)context.peek()).getText().equals(",")) { - context.pop(); - - ret.getToRoles().add(((CommonToken)context.pop()).getText()); - } - - // Consume 'to' - context.pop(); - - ret.setFromRole(((CommonToken)context.pop()).getText()); - - // Consume 'from' - context.pop(); - - if (context.peek() instanceof CommonToken && ((CommonToken)context.peek()).getText().equals(")")) { - // Consume ')' - context.pop(); - - do { - String text=((CommonToken)context.pop()).getText(); - - if (context.peek() instanceof CommonToken && ((CommonToken)context.peek()).getText().equals("=")) { - mesg.getValues().add(0, stripQuotes(text)); - - // Consume '=' - context.pop(); - - mesg.getTypes().add(0, stripQuotes(((CommonToken)context.pop()).getText())); - - } else { - mesg.getTypes().add(0, stripQuotes(text)); - } - } while (((CommonToken)context.pop()).getText().equals(",")); - } - - ret.getMessage().setOperator(((CommonToken)context.pop()).getText()); - - //setStartProperties(ret, component); - - context.push(ret); - - return ret; - } - - protected String stripQuotes(String text) { - return (text.substring(1, text.length()-1)); - } -} diff --git a/modules/trace-parser/src/main/java/org/scribble/trace/parser/antlr/ModelAdaptor.java b/modules/trace-parser/src/main/java/org/scribble/trace/parser/antlr/ModelAdaptor.java deleted file mode 100644 index f3edb7da0..000000000 --- a/modules/trace-parser/src/main/java/org/scribble/trace/parser/antlr/ModelAdaptor.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.trace.parser.antlr; - -/** - * This interface defines the model adapter for the parser rules. - * - */ -public interface ModelAdaptor { - - /** - * This method creates the model object(s) appropriate for the - * supplied stack of context, and returns them. - * - * @param context The parser context - * @return The created model object - */ - public Object createModelObject(ParserContext context); - -} diff --git a/modules/trace-parser/src/main/java/org/scribble/trace/parser/antlr/ModelAdaptorFactory.java b/modules/trace-parser/src/main/java/org/scribble/trace/parser/antlr/ModelAdaptorFactory.java deleted file mode 100644 index 6531a9a43..000000000 --- a/modules/trace-parser/src/main/java/org/scribble/trace/parser/antlr/ModelAdaptorFactory.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.trace.parser.antlr; - -/** - * This class provides the model adaptor factory. - * - */ -public class ModelAdaptorFactory { - - private static java.util.Map _modelAdaptors=new java.util.HashMap(); - - static { - _modelAdaptors.put("trace", new TraceModelAdaptor()); - _modelAdaptors.put("roledefn", new RoleModelAdaptor()); - _modelAdaptors.put("messagetransfer", new MessageTransferModelAdaptor()); - } - - /** - * This method returns the model adaptor implementation associated with - * the supplied rule name. - * - * @param ruleName The rule name - * @return The model adaptor, or null if not relevant - */ - public static ModelAdaptor getModelAdaptor(String ruleName) { - return (_modelAdaptors.get(ruleName)); - } -} diff --git a/modules/trace-parser/src/main/java/org/scribble/trace/parser/antlr/ParserContext.java b/modules/trace-parser/src/main/java/org/scribble/trace/parser/antlr/ParserContext.java deleted file mode 100644 index d3d6374ba..000000000 --- a/modules/trace-parser/src/main/java/org/scribble/trace/parser/antlr/ParserContext.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.trace.parser.antlr; - -/** - * This interface represents the context used by - * the parser. - * - */ -public interface ParserContext { - - /** - * This method removes a component from the context - * and returns it to the caller. - * - * @return The popped component - */ - public Object pop(); - - /** - * This method accesses the current component - * from the context and returns it to the caller. - * This operation does not remove the current - * component from the context. - * - * @return The current component - */ - public Object peek(); - - /** - * This method adds a component to the parser - * context. - * - * @param obj The new component - */ - public void push(Object obj); - -} diff --git a/modules/trace-parser/src/main/java/org/scribble/trace/parser/antlr/RoleModelAdaptor.java b/modules/trace-parser/src/main/java/org/scribble/trace/parser/antlr/RoleModelAdaptor.java deleted file mode 100644 index 4ec583cf0..000000000 --- a/modules/trace-parser/src/main/java/org/scribble/trace/parser/antlr/RoleModelAdaptor.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.trace.parser.antlr; - -import org.antlr.runtime.CommonToken; -import org.scribble.trace.model.MonitorRoleSimulator; -import org.scribble.trace.model.Role; - -/** - * This class provides the model adapter for the 'role' parser rule. - * - */ -public class RoleModelAdaptor extends AbstractModelAdaptor { - - /** - * {@inheritDoc} - */ - public Object createModelObject(ParserContext context) { - Role ret=new Role(); - MonitorRoleSimulator sim=new MonitorRoleSimulator(); - - // Initialize trace details - - Object component=context.pop(); - String text=""; - - if (component instanceof CommonToken - && ((CommonToken)component).getText().equals(";")) { - component = context.pop(); // Replace ';' - } - - do { - if (component instanceof CommonToken) { - - if (((CommonToken)component).getText().equals("role")) { - ret.setName(text); - text = ""; - break; - } else if (((CommonToken)component).getText().equals("as")) { - sim.setRole(text); - text = ""; - } else if (((CommonToken)component).getText().equals("protocol")) { - sim.setProtocol(text); - text = ""; - } else if (((CommonToken)component).getText().equals("simulating")) { - sim.setModule(text); - text = ""; - ret.setSimulator(sim); - } else { - text = ((CommonToken)component).getText()+text; - } - } - - component = context.pop(); - - } while (component instanceof CommonToken); - - //setStartProperties(ret, component); - - context.push(ret); - - return ret; - } - -} diff --git a/modules/trace-parser/src/main/java/org/scribble/trace/parser/antlr/TraceModelAdaptor.java b/modules/trace-parser/src/main/java/org/scribble/trace/parser/antlr/TraceModelAdaptor.java deleted file mode 100644 index 1a530e8d5..000000000 --- a/modules/trace-parser/src/main/java/org/scribble/trace/parser/antlr/TraceModelAdaptor.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.trace.parser.antlr; - -import org.antlr.runtime.CommonToken; -import org.scribble.trace.model.Role; -import org.scribble.trace.model.Step; -import org.scribble.trace.model.Trace; - -/** - * This class provides the model adapter for the 'module' parser rule. - * - */ -public class TraceModelAdaptor extends AbstractModelAdaptor { - - /** - * {@inheritDoc} - */ - public Object createModelObject(ParserContext context) { - Trace ret=new Trace(); - - //setEndProperties(ret, context.peek()); - - while (context.peek() instanceof Step) { - ret.getSteps().add(0, (Step)context.pop()); - } - - while (context.peek() instanceof Role) { - ret.getRoles().add(0, (Role)context.pop()); - } - - // Initialize trace details - - Object component=context.pop(); - String text=""; - - if (component instanceof CommonToken - && ((CommonToken)component).getText().equals(";")) { - component = context.pop(); // Replace ';' - } - - do { - if (component instanceof CommonToken) { - - if (((CommonToken)component).getText().equals("trace")) { - ret.setName(text); - text = ""; - break; - } else if (((CommonToken)component).getText().equals("by")) { - ret.setAuthor(text); - text = ""; - } else if (((CommonToken)component).getText().equals("shows")) { - ret.setDescription(text); - text = ""; - } else { - if (text.length() > 0) { - text = " "+text; - } - text = ((CommonToken)component).getText()+text; - } - } - - component = context.pop(); - - } while (component instanceof CommonToken); - - //setStartProperties(ret, component); - - context.push(ret); - - return ret; - } - -} diff --git a/modules/trace-parser/src/main/java/org/scribble/trace/parser/antlr/TraceTreeAdaptor.java b/modules/trace-parser/src/main/java/org/scribble/trace/parser/antlr/TraceTreeAdaptor.java deleted file mode 100644 index ed083ff14..000000000 --- a/modules/trace-parser/src/main/java/org/scribble/trace/parser/antlr/TraceTreeAdaptor.java +++ /dev/null @@ -1,336 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.trace.parser.antlr; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.antlr.runtime.RecognitionException; -import org.antlr.runtime.Token; -import org.antlr.runtime.TokenStream; - -import org.scribble.trace.model.Trace; -import org.scribble.trace.parser.antlr.ScribbleTraceParser; - -/** - * This class provides the antlr tree adaptor. - * - */ -public class TraceTreeAdaptor implements org.antlr.runtime.tree.TreeAdaptor { - - private static final Logger LOG=Logger.getLogger(TraceTreeAdaptor.class.getName()); - - private ParserContext _context=new DefaultParserContext(); - private ScribbleTraceParser _parser=null; - - /** - * The constructor. - */ - public TraceTreeAdaptor() { - } - - /** - * This method returns the module. - * - * @return The module, or null if an error occurred - */ - public Trace getTrace() { - return (_context.peek() instanceof Trace ? (Trace)_context.peek() : null); - } - - /** - * This method sets the parser. - * - * @param parser The parser - */ - public void setParser(ScribbleTraceParser parser) { - _parser = parser; - } - - /** - * {@inheritDoc} - */ - public void addChild(Object arg0, Object arg1) { - - } - - /** - * {@inheritDoc} - */ - public Object becomeRoot(Object arg0, Object arg1) { - // TODO Auto-generated method stub - return null; - } - - /** - * {@inheritDoc} - */ - public Object becomeRoot(Token arg0, Object arg1) { - // TODO Auto-generated method stub - return null; - } - - /** - * {@inheritDoc} - */ - public Object create(Token arg0) { - if (LOG.isLoggable(Level.FINE)) { - LOG.fine("CREATE TOKEN="+arg0); - } - _context.push(arg0); - return null; - } - - /** - * {@inheritDoc} - */ - public Object create(int arg0, Token arg1) { - // TODO Auto-generated method stub - return null; - } - - /** - * {@inheritDoc} - */ - public Object create(int arg0, String arg1) { - // TODO Auto-generated method stub - return null; - } - - /** - * {@inheritDoc} - */ - public Object create(int arg0, Token arg1, String arg2) { - // TODO Auto-generated method stub - return null; - } - - /** - * {@inheritDoc} - */ - public Object deleteChild(Object arg0, int arg1) { - // TODO Auto-generated method stub - return null; - } - - /** - * {@inheritDoc} - */ - public Object dupNode(Object arg0) { - // TODO Auto-generated method stub - return null; - } - - /** - * {@inheritDoc} - */ - public Object dupTree(Object arg0) { - // TODO Auto-generated method stub - return null; - } - - /** - * {@inheritDoc} - */ - public Object errorNode(TokenStream arg0, Token arg1, Token arg2, - RecognitionException arg3) { - // TODO Auto-generated method stub - return null; - } - - /** - * {@inheritDoc} - */ - public Object getChild(Object arg0, int arg1) { - // TODO Auto-generated method stub - return null; - } - - /** - * {@inheritDoc} - */ - public int getChildCount(Object arg0) { - // TODO Auto-generated method stub - return 0; - } - - /** - * {@inheritDoc} - */ - public int getChildIndex(Object arg0) { - // TODO Auto-generated method stub - return 0; - } - - /** - * {@inheritDoc} - */ - public Object getParent(Object arg0) { - // TODO Auto-generated method stub - return null; - } - - /** - * {@inheritDoc} - */ - public String getText(Object arg0) { - // TODO Auto-generated method stub - return null; - } - - /** - * {@inheritDoc} - */ - public Token getToken(Object arg0) { - // TODO Auto-generated method stub - return null; - } - - /** - * {@inheritDoc} - */ - public int getTokenStartIndex(Object arg0) { - // TODO Auto-generated method stub - return 0; - } - - /** - * {@inheritDoc} - */ - public int getTokenStopIndex(Object arg0) { - // TODO Auto-generated method stub - return 0; - } - - /** - * {@inheritDoc} - */ - public int getType(Object arg0) { - // TODO Auto-generated method stub - return 0; - } - - /** - * {@inheritDoc} - */ - public int getUniqueID(Object arg0) { - // TODO Auto-generated method stub - return 0; - } - - /** - * {@inheritDoc} - */ - public boolean isNil(Object arg0) { - // TODO Auto-generated method stub - return false; - } - - /** - * {@inheritDoc} - */ - public Object nil() { - // TODO Auto-generated method stub - return null; - } - - /** - * {@inheritDoc} - */ - public void replaceChildren(Object arg0, int arg1, int arg2, Object arg3) { - // TODO Auto-generated method stub - - } - - /** - * {@inheritDoc} - */ - public Object rulePostProcessing(Object arg0) { - Object ret=arg0; - - if (_parser != null - && _parser.getRuleInvocationStack().size() > 0) { - String ruleName=(String)_parser.getRuleInvocationStack().get( - _parser.getRuleInvocationStack().size()-1); - - if (LOG.isLoggable(Level.FINE)) { - LOG.fine("RULE POST PROCESSING="+ruleName); - } - - if (!_parser.isErrorOccurred()) { - ModelAdaptor modelAdaptor=ModelAdaptorFactory.getModelAdaptor(ruleName); - - if (modelAdaptor != null) { - ret = modelAdaptor.createModelObject(_context); - //} else { - // LOG.severe("No ModelAdaptor for rule name: "+ruleName); - } - } - } - - return ret; - } - - /** - * {@inheritDoc} - */ - public void setChild(Object arg0, int arg1, Object arg2) { - // TODO Auto-generated method stub - - } - - /** - * {@inheritDoc} - */ - public void setChildIndex(Object arg0, int arg1) { - // TODO Auto-generated method stub - - } - - /** - * {@inheritDoc} - */ - public void setParent(Object arg0, Object arg1) { - // TODO Auto-generated method stub - - } - - /** - * {@inheritDoc} - */ - public void setText(Object arg0, String arg1) { - // TODO Auto-generated method stub - - } - - /** - * {@inheritDoc} - */ - public void setTokenBoundaries(Object arg0, Token arg1, Token arg2) { - // TODO Auto-generated method stub - - } - - /** - * {@inheritDoc} - */ - public void setType(Object arg0, int arg1) { - // TODO Auto-generated method stub - - } - -} diff --git a/modules/trace-parser/src/test/java/org/scribble/trace/parser/TraceParserTest.java b/modules/trace-parser/src/test/java/org/scribble/trace/parser/TraceParserTest.java deleted file mode 100644 index 92f2e7cf4..000000000 --- a/modules/trace-parser/src/test/java/org/scribble/trace/parser/TraceParserTest.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.trace.parser; - -import static org.junit.Assert.*; - -import java.util.Map; - -import org.scribble.logging.ConsoleIssueLogger; -import org.scribble.resources.InputStreamResource; -import org.scribble.trace.model.Trace; - -public class TraceParserTest { - - @org.junit.Test - public void testChoiceBuyer1() { - testExample("ChoiceBuyer1"); - } - - protected void testExample(String name) { - testParser("scribble/examples/"+name+".trace"); - } - - protected void testIssue(String name) { - testParser("scribble/issues/"+name+".trace"); - } - - protected void testParser(String path) { - - try { - java.net.URL scrurl=ClassLoader.getSystemResource(path); - java.io.File scrFile=new java.io.File(scrurl.getFile()); - java.io.InputStream is=new java.io.FileInputStream(scrFile); - - TraceParser tp=new TraceParser(); - - TestIssueLogger logger=new TestIssueLogger(); - - InputStreamResource isr=new InputStreamResource(path, is); - - Trace trace=tp.parse(isr, logger); - - if (trace == null) { - fail("Trace is null"); - } - - if (logger.isErrorsOrWarnings()) { - fail("Unexpected errors and/or warnings in "+path); - } - - is = ClassLoader.getSystemResourceAsStream(path); - - byte[] b=new byte[is.available()]; - is.read(b); - - is.close(); - - String parsed=trace.toString().trim(); - String expecting=new String(b).replace("\r", "").trim(); - - if (!parsed.equals(expecting)) { - int len=parsed.length(); - if (len > expecting.length()) { - len = expecting.length(); - } - for (int i=0; i < len; i++) { - if (parsed.charAt(i) != expecting.charAt(i)) { - System.out.println("DIFF AT POSITION: "+i); - int showto=i+30; - if (showto >= len) { - showto = len; - } - System.out.println("PARSED: "+parsed.substring(i, showto)); - System.out.println("EXPECT: "+expecting.substring(i, showto)); - break; - } - } - - System.err.println("Parsed protocol '"+path+ - "' mismatch\nExpecting:\n"+expecting+"\nParsed:\n"+parsed); - fail("Parsed protocol '"+path+"' mismatch"); - } - - } catch (Exception e) { - e.printStackTrace(); - fail("Failed to parse '"+path+"'"); - } - } - - protected class TestIssueLogger extends ConsoleIssueLogger { - - private java.util.List _errors=new java.util.ArrayList(); - private java.util.List _warnings=new java.util.ArrayList(); - - public void error(String issue, Map props) { - super.error(issue, props); - _errors.add(issue); - } - - public void warning(String issue, Map props) { - super.warning(issue, props); - _warnings.add(issue); - } - - public void info(String issue, Map props) { - super.info(issue, props); - } - - public boolean isErrorsOrWarnings() { - return (_errors.size() > 0 || _warnings.size() > 0); - } - } -} diff --git a/modules/trace-parser/src/test/resources/scribble/examples/ChoiceBuyer1.trace b/modules/trace-parser/src/test/resources/scribble/examples/ChoiceBuyer1.trace deleted file mode 100644 index 9c5312fb9..000000000 --- a/modules/trace-parser/src/test/resources/scribble/examples/ChoiceBuyer1.trace +++ /dev/null @@ -1,8 +0,0 @@ -trace ChoiceBuyer1 by Gary Brown shows This is a test; - -role Buyer simulating scribble.examples.Choice protocol First as Buyer; -role Seller; - -op1("{http://scribble.org/example}M1"="value1") from Buyer to Seller; -op2("{http://scribble.org/example}M2"="value2","{http://scribble.org/example}M3"="value3") from Seller to Buyer; -op4("{http://scribble.org/example}M4"="value4") from Buyer to Seller; diff --git a/modules/trace/LICENSE.txt b/modules/trace/LICENSE.txt deleted file mode 100644 index 29f81d812..000000000 --- a/modules/trace/LICENSE.txt +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/modules/trace/pom.xml b/modules/trace/pom.xml deleted file mode 100644 index b01797dd0..000000000 --- a/modules/trace/pom.xml +++ /dev/null @@ -1,95 +0,0 @@ - - 4.0.0 - scribble-trace - jar - 0.3.2-SNAPSHOT - Scribble::Modules::Trace - - - org.scribble - modules - 0.3.2-SNAPSHOT - - - - - org.scribble - scribble-core - ${project.version} - - - org.scribble - scribble-parser - ${project.version} - - - org.scribble - scribble-monitor - ${project.version} - - - org.scribble - scribble-projection - ${project.version} - - - org.codehaus.jackson - jackson-core-asl - - - org.codehaus.jackson - jackson-mapper-asl - - - junit - junit - test - - - - - - - maven-javadoc-plugin - - - generate-javadoc - package - - jar - - - - - org.jboss.apiviz.APIviz - - org.jboss.apiviz - apiviz - 1.2.4.GA - - true - false - - -d ${project.build.directory}/javadoc - -charset UTF-8 - -docencoding UTF-8 - -version - -author - -breakiterator - -windowtitle "${project.name} ${project.version} API Reference" - -doctitle "${project.name} ${project.version} API Reference" - -bottom "Copyright © ${project.inceptionYear}-Present ${project.organization.name}. All Rights Reserved." - -link http://java.sun.com/javase/6/docs/api/ - -sourceclasspath ${project.build.outputDirectory} - - UTF-8 - en_US - - org.scribble.trace - - - - - - diff --git a/modules/trace/src/main/java/org/scribble/trace/model/Message.java b/modules/trace/src/main/java/org/scribble/trace/model/Message.java deleted file mode 100644 index f2b26cd1e..000000000 --- a/modules/trace/src/main/java/org/scribble/trace/model/Message.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.trace.model; - -/** - * This class represents a message being sent or received by a - * role. - * - */ -public class Message { - - private String _operator; - private java.util.List _types=new java.util.ArrayList(); - private java.util.List _values=new java.util.ArrayList(); - - public Message() { - } - - /** - * This method returns the operator. - * - * @return The operator - */ - public String getOperator() { - return (_operator); - } - - /** - * This method sets the operator. - * - * @param operator The operator - * @return The message - */ - public Message setOperator(String operator) { - _operator = operator; - return (this); - } - - /** - * This method returns the types. - * - * @return The types - */ - public java.util.List getTypes() { - return (_types); - } - - /** - * This method sets the types. - * - * @param types The types - * @return The message - */ - public Message setTypes(java.util.List types) { - _types = types; - return (this); - } - - /** - * This method returns the values. - * - * @return The values - */ - public java.util.List getValues() { - return (_values); - } - - /** - * This method sets the values. - * - * @param values The values - * @return The message - */ - public Message setValues(java.util.List values) { - _values = values; - return (this); - } - - /** - * {@inheritDoc} - */ - public boolean equals(Object obj) { - boolean ret=false; - - if (obj instanceof Message) { - Message other=(Message)obj; - - if (other._operator != null - && _operator != null - && other._operator.equals(_operator)) { - - if (_types.size() == other._types.size() - && _values.size() == other._values.size()) { - ret = true; - - for (int i=0; ret && i < _types.size(); i++) { - if (_types.get(i) == null || other._types.get(i) == null - || !_types.get(i).equals(other._types.get(i))) { - ret = false; - } - } - - for (int i=0; ret && i < _values.size(); i++) { - if (_values.get(i) == null || other._values.get(i) == null - || !_values.get(i).equals(other._values.get(i))) { - ret = false; - } - } - } - } - } - - return (ret); - } - - /** - * {@inheritDoc} - */ - public String toString() { - StringBuffer buf=new StringBuffer(); - - if (_operator != null) { - buf.append(_operator); - } - - buf.append("("); - - for (int i=0; i < _types.size(); i++) { - if (i > 0) { - buf.append(","); - } - buf.append(_types.get(i)); - } - buf.append(")"); - - return (buf.toString()); - } -} diff --git a/modules/trace/src/main/java/org/scribble/trace/model/MessageTransfer.java b/modules/trace/src/main/java/org/scribble/trace/model/MessageTransfer.java deleted file mode 100644 index 3cba0dea8..000000000 --- a/modules/trace/src/main/java/org/scribble/trace/model/MessageTransfer.java +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.trace.model; - -import java.util.Map; - -import org.scribble.trace.simulation.SimulatorContext; - -/** - * This class represents a message being transferred between the specified - * roles. - * - */ -public class MessageTransfer extends Step { - - private String _fromRole; - private java.util.List _toRoles=new java.util.ArrayList(); - private Message _message; - - /** - * This method sets the role. - * - * @param role The role - * @return The message transfer - */ - public MessageTransfer setFromRole(String role) { - _fromRole = role; - return (this); - } - - /** - * This method returns the role. - * - * @return The role - */ - public String getFromRole() { - return (_fromRole); - } - - /** - * This method sets the 'to' roles. - * - * @param roles The 'to' roles - * @return The message transfer - */ - public MessageTransfer setToRoles(java.util.List roles) { - _toRoles = roles; - return (this); - } - - /** - * This method returns the 'to' roles. - * - * @return The 'to' roles - */ - public java.util.List getToRoles() { - return (_toRoles); - } - - /** - * This method returns the values. - * - * @return The values - */ - public Message getMessage() { - return (_message); - } - - /** - * This method sets the message. - * - * @param message The message - * @return The message transfer - */ - public MessageTransfer setMessage(Message message) { - _message = message; - return (this); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean simulate(SimulatorContext context, Map roleSimulators) { - boolean ret=true; - RoleSimulator rs=roleSimulators.get(_fromRole); - - if (rs != null) { - for (String toRole : _toRoles) { - ret = (rs.send(context, _message, toRole) == getSucceeds()); - if (!ret) { - break; - } - } - } - - if (ret) { - for (String toRole : _toRoles) { - rs = roleSimulators.get(toRole); - if (rs != null) { - ret = (rs.receive(context, _message, _fromRole) == getSucceeds()); - } - } - } - - return (ret); - } - - /** - * {@inheritDoc} - */ - public void toText(StringBuffer buf, int level) { - if (getMessage() != null) { - if( getMessage().getOperator() != null) { - buf.append(getMessage().getOperator()); - } - - if (getMessage().getTypes().size() > 0) { - buf.append("("); - - for (int i=0; i < getMessage().getTypes().size(); i++) { - if (i > 0) { - buf.append(","); - } - buf.append("\""); - buf.append(getMessage().getTypes().get(i)); - buf.append("\""); - - if (i < getMessage().getValues().size()) { - buf.append("=\""); - buf.append(getMessage().getValues().get(i)); - buf.append("\""); - } - } - - buf.append(")"); - } - } - - if (getFromRole() != null) { - buf.append(" from "+getFromRole()); - } - - if (getToRoles().size() > 0) { - buf.append(" to "); - - for (int i=0; i < getToRoles().size(); i++) { - if (i > 0) { - buf.append(","); - } - buf.append(getToRoles().get(i)); - } - } - - buf.append(";\n"); - } -} diff --git a/modules/trace/src/main/java/org/scribble/trace/model/MonitorRoleSimulator.java b/modules/trace/src/main/java/org/scribble/trace/model/MonitorRoleSimulator.java deleted file mode 100644 index 4e7cced5e..000000000 --- a/modules/trace/src/main/java/org/scribble/trace/model/MonitorRoleSimulator.java +++ /dev/null @@ -1,252 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.trace.model; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.scribble.context.DefaultModuleContext; -import org.scribble.context.ModuleLoader; -import org.scribble.logging.ConsoleIssueLogger; -import org.scribble.model.Module; -import org.scribble.model.ProtocolDecl; -import org.scribble.model.Role; -import org.scribble.model.local.LProtocolDefinition; -import org.scribble.monitor.export.MonitorExporter; -import org.scribble.monitor.model.SessionType; -import org.scribble.monitor.runtime.DefaultMonitor; -import org.scribble.monitor.runtime.DefaultMonitorContext; -import org.scribble.monitor.runtime.Monitor; -import org.scribble.monitor.runtime.SessionInstance; -import org.scribble.parser.ProtocolModuleLoader; -import org.scribble.parser.ProtocolParser; -import org.scribble.projection.ProtocolProjector; -import org.scribble.trace.simulation.SimulatorContext; -import org.scribble.trace.simulation.TraceMessageComparatorFactory; - -/** - * This abstract class represents a simulator associated with a - * role in a message trace. - * - */ -public class MonitorRoleSimulator extends RoleSimulator { - - private static final Logger LOG=Logger.getLogger(MonitorRoleSimulator.class.getName()); - - private String _module; - private String _role; - private String _protocol; - - private SessionType _type; - private SessionInstance _instance; - - private static final ProtocolParser PARSER=new ProtocolParser(); - private static final MonitorExporter EXPORTER=new MonitorExporter(); - private static final Monitor MONITOR=new DefaultMonitor(); - - static { - DefaultMonitorContext context=new DefaultMonitorContext(); - - ((DefaultMonitor)MONITOR).setMonitorContext(context); - - context.register(new TraceMessageComparatorFactory()); - } - - /** - * This method returns the local module to be monitored. - * - * @return The local module - */ - public String getModule() { - return (_module); - } - - /** - * This method sets the local module to be monitored. - * - * @param module The local module - * @return The simulator - */ - public MonitorRoleSimulator setModule(String module) { - _module = module; - return (this); - } - - /** - * This method returns the role within the module to be monitored. - * - * @return The role - */ - public String getRole() { - return (_role); - } - - /** - * This method sets the role within the module to be monitored. - * - * @param role The role - * @return The simulator - */ - public MonitorRoleSimulator setRole(String role) { - _role = role; - return (this); - } - - /** - * This method returns the protocol to be monitored. - * - * @return The protocol - */ - public String getProtocol() { - return (_protocol); - } - - /** - * This method sets the protocol to be monitored. - * - * @param protocol The protocol - * @return The simulator - */ - public MonitorRoleSimulator setProtocol(String protocol) { - _protocol = protocol; - return (this); - } - - /** - * {@inheritDoc} - */ - @Override - public void init(SimulatorContext context) { - if (LOG.isLoggable(Level.FINE)) { - LOG.fine("Init monitor role simulator for module="+_module+", role=" - +_role+" and protocol="+_protocol); - } - - // TODO: Need to consider different logger impl? - ModuleLoader loader=new ProtocolModuleLoader(PARSER, context.getResourceLocator(), - new ConsoleIssueLogger()); - - String localModule=_module+"_"+_role; - - Module module=loader.loadModule(localModule); - - if (LOG.isLoggable(Level.FINE)) { - LOG.fine("Local module="+module); - } - - if (module == null) { - // Attempt to project the local module from a global module - Module global=loader.loadModule(_module); - - if (LOG.isLoggable(Level.FINE)) { - LOG.fine("Global module="+global); - } - - if (global != null) { - // Project - ProtocolProjector projector=new ProtocolProjector(); - - DefaultModuleContext mc=new DefaultModuleContext(null, global, loader); - - java.util.Set locals=projector.project(mc, global, new ConsoleIssueLogger()); - - for (Module lm : locals) { - Role located=lm.getLocatedRole(); - - if (LOG.isLoggable(Level.FINE)) { - LOG.fine("Check module="+lm+" with located role="+located); - } - - if (located != null && located.getName().equals(_role)) { - module = lm; - break; - } - } - } - } - - if (LOG.isLoggable(Level.FINE)) { - LOG.fine("Module to simulate="+module); - } - - if (module != null) { - ProtocolDecl pd=module.getProtocol(_protocol); - - if (pd instanceof LProtocolDefinition) { - DefaultModuleContext mc=new DefaultModuleContext(null, pd.getModule(), loader); - - _type = EXPORTER.export(mc, (LProtocolDefinition)pd); - - _instance = new SessionInstance(); - - MONITOR.initializeInstance(_type, _instance); - } - } else { - _type = null; - _instance = null; - } - } - - /** - * {@inheritDoc} - */ - @Override - public boolean send(SimulatorContext context, Message mesg, String toRole) { - if (_type != null && _instance != null) { - return (MONITOR.sent(_type, _instance, mesg, toRole)); - } - return (false); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean receive(SimulatorContext context, Message mesg, String fromRole) { - if (_type != null && _instance != null) { - return (MONITOR.received(_type, _instance, mesg, fromRole)); - } - return (false); - } - - /** - * {@inheritDoc} - */ - @Override - public void close(SimulatorContext context) { - _instance = null; - _type = null; - } - - /** - * {@inheritDoc} - */ - public void toText(StringBuffer buf) { - if (_module != null && _module.trim().length() > 0) { - buf.append(" simulating "+_module.trim()); - - if (_protocol != null && _protocol.trim().length() > 0) { - buf.append(" protocol "+_protocol.trim()); - } - - if (_role != null && _role.trim().length() > 0) { - buf.append(" as "+_role.trim()); - } - } - } - -} diff --git a/modules/trace/src/main/java/org/scribble/trace/model/Role.java b/modules/trace/src/main/java/org/scribble/trace/model/Role.java deleted file mode 100644 index 01d2287a1..000000000 --- a/modules/trace/src/main/java/org/scribble/trace/model/Role.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.trace.model; - -/** - * This class represents a role associated with a message trace - * - */ -public class Role { - - private String _name; - private RoleSimulator _simulator; - - /** - * This method returns the name of the trace. - * - * @return The name of the trace - */ - public String getName() { - return (_name); - } - - /** - * This method sets the name of the trace. - * - * @param name The name of the trace - * @return The role - */ - public Role setName(String name) { - _name = name; - return (this); - } - - /** - * This method returns the optional simulator for the role. - * - * @return The optional simulator for the role - */ - public RoleSimulator getSimulator() { - return (_simulator); - } - - /** - * This method sets the optional simulator for the role. - * - * @param description The optional simulator for the role - * @return The role - */ - public Role setSimulator(RoleSimulator simulator) { - _simulator = simulator; - return (this); - } - - /** - * {@inheritDoc} - */ - public String toString() { - StringBuffer buf=new StringBuffer(); - toText(buf, 0); - - return (buf.toString()); - } - - /** - * {@inheritDoc} - */ - public void toText(StringBuffer buf, int level) { - buf.append("role "); - - if (_name != null && _name.trim().length() > 0) { - buf.append(_name.trim()); - } - - if (_simulator != null) { - _simulator.toText(buf); - } - - buf.append(";\n"); - } - -} diff --git a/modules/trace/src/main/java/org/scribble/trace/model/RoleSimulator.java b/modules/trace/src/main/java/org/scribble/trace/model/RoleSimulator.java deleted file mode 100644 index 0faa36567..000000000 --- a/modules/trace/src/main/java/org/scribble/trace/model/RoleSimulator.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.trace.model; - -import org.codehaus.jackson.annotate.JsonSubTypes; -import org.codehaus.jackson.annotate.JsonSubTypes.Type; -import org.codehaus.jackson.annotate.JsonTypeInfo; -import org.scribble.trace.simulation.SimulatorContext; - -// TODO: Need to change subtype mechanism to allow new role simulators to be dynamically -// used - registered using the RoleSimulatorManager. - -/** - * This abstract class represents a simulator associated with a - * role in a message trace. - * - */ -@JsonTypeInfo(use=JsonTypeInfo.Id.NAME, include=JsonTypeInfo.As.PROPERTY, property="type") -@JsonSubTypes({@Type(value=MonitorRoleSimulator.class) }) -public abstract class RoleSimulator { - - /** - * This method initializes the role simulator. - * - * @param context The context - */ - public abstract void init(SimulatorContext context); - - /** - * This method simulates the sending of a message. - * - * @param context The context - * @param mesg The message - * @param toRole The target role - * @return Whether the send simulated as expected - */ - public abstract boolean send(SimulatorContext context, Message mesg, String toRole); - - /** - * This method simulates the receiving of a message. - * - * @param context The context - * @param mesg The message - * @param fromRole The source role - * @return Whether the receive simulated as expected - */ - public abstract boolean receive(SimulatorContext context, Message mesg, String fromRole); - - /** - * This method closes the role simulator. - * - * @param context The context - */ - public abstract void close(SimulatorContext context); - - /** - * This method describes the simulator configuration in text. - */ - public abstract void toText(StringBuffer buf); - -} diff --git a/modules/trace/src/main/java/org/scribble/trace/model/Step.java b/modules/trace/src/main/java/org/scribble/trace/model/Step.java deleted file mode 100644 index 83a234ba4..000000000 --- a/modules/trace/src/main/java/org/scribble/trace/model/Step.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.trace.model; - -import org.codehaus.jackson.annotate.JsonSubTypes; -import org.codehaus.jackson.annotate.JsonSubTypes.Type; -import org.codehaus.jackson.annotate.JsonTypeInfo; -import org.scribble.trace.simulation.SimulatorContext; - -/** - * This class represents the base class from which all simulation actions - * are derived. - * - */ -@JsonTypeInfo(use=JsonTypeInfo.Id.NAME, include=JsonTypeInfo.As.PROPERTY, property="type") -@JsonSubTypes({@Type(value=MessageTransfer.class)}) -public abstract class Step { - - private boolean _succeeds=true; - - /** - * This method returns whether the action should succeed. - * - * @return Whether the action should succeed - */ - public boolean getSucceeds() { - return (_succeeds); - } - - /** - * This method sets the 'to' roles. - * - * @param roles The 'to' roles - * @return The message transfer - */ - public Step setSucceeds(boolean succeeds) { - _succeeds = succeeds; - return (this); - } - - /** - * This method simulates the step against the supplied - * role simulators, taking into account whether the step - * is expected to succeed. - * - * @param context The context - * @param roleSimulators The role simulators - * @return Whether the simulation of the step was successfully - */ - public abstract boolean simulate(SimulatorContext context, - java.util.Map roleSimulators); - - /** - * {@inheritDoc} - */ - public String toString() { - StringBuffer buf=new StringBuffer(); - toText(buf, 0); - - return (buf.toString()); - } - - /** - * This method generates a text based representation of the step. - * - * @param buf The buffer - * @param level The indentation level - */ - public abstract void toText(StringBuffer buf, int level); - -} diff --git a/modules/trace/src/main/java/org/scribble/trace/model/Trace.java b/modules/trace/src/main/java/org/scribble/trace/model/Trace.java deleted file mode 100644 index cac66dbb0..000000000 --- a/modules/trace/src/main/java/org/scribble/trace/model/Trace.java +++ /dev/null @@ -1,175 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.trace.model; - -/** - * This class represents a message trace. - * - */ -public class Trace { - - private String _name; - private String _description; - private String _author; - private java.util.List _roles=new java.util.ArrayList(); - private java.util.List _steps=new java.util.ArrayList(); - - /** - * This method returns the name of the trace. - * - * @return The name of the trace - */ - public String getName() { - return (_name); - } - - /** - * This method sets the name of the trace. - * - * @param name The name of the trace - * @return The trace - */ - public Trace setName(String name) { - _name = name; - return (this); - } - - /** - * This method returns the author of the trace. - * - * @return The author of the trace - */ - public String getAuthor() { - return (_author); - } - - /** - * This method sets the author of the trace. - * - * @param author The author of the trace - * @return The trace - */ - public Trace setAuthor(String author) { - _author = author; - return (this); - } - - /** - * This method returns the description of the trace. - * - * @return The description of the trace - */ - public String getDescription() { - return (_description); - } - - /** - * This method sets the description of the trace. - * - * @param description The description of the trace - * @return The trace - */ - public Trace setDescription(String description) { - _description = description; - return (this); - } - - /** - * This method returns the roles. - * - * @return The roles - */ - public java.util.List getRoles() { - return (_roles); - } - - /** - * This method sets the roles. - * - * @param simulations The roles - * @return The trace - */ - public Trace setRoles(java.util.List roles) { - _roles = roles; - return (this); - } - - /** - * This method returns the trace steps. - * - * @return The trace steps - */ - public java.util.List getSteps() { - return (_steps); - } - - /** - * This method sets the trace steps. - * - * @param steps The trace steps - * @return The trace - */ - public Trace setSteps(java.util.List steps) { - _steps = steps; - return (this); - } - - /** - * {@inheritDoc} - */ - public String toString() { - StringBuffer buf=new StringBuffer(); - toText(buf, 0); - - return (buf.toString()); - } - - /** - * {@inheritDoc} - */ - public void toText(StringBuffer buf, int level) { - buf.append("trace "); - - if (_name != null && _name.trim().length() > 0) { - buf.append(_name.trim()); - } - - if (_author != null && _author.trim().length() > 0) { - buf.append(" by "+_author.trim()); - } - - if (_description != null && _description.trim().length() > 0) { - buf.append(" shows "+_description.trim()); - } - - buf.append(";\n\n"); - - for (Role role : getRoles()) { - role.toText(buf, level); - } - - if (getRoles().size() > 0) { - buf.append("\n"); - } - - for (Step step : getSteps()) { - step.toText(buf, level); - } - - } - -} diff --git a/modules/trace/src/main/java/org/scribble/trace/simulation/DefaultSimulatorContext.java b/modules/trace/src/main/java/org/scribble/trace/simulation/DefaultSimulatorContext.java deleted file mode 100644 index 10e4b9000..000000000 --- a/modules/trace/src/main/java/org/scribble/trace/simulation/DefaultSimulatorContext.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.trace.simulation; - -import org.scribble.resources.ResourceLocator; - -/** - * This class provides the default context support implementation for the simulator. - * - */ -public class DefaultSimulatorContext implements SimulatorContext { - - private ResourceLocator _locator; - - /** - * This constructor initializes the resource locator. - * - * @param locator The resource locator - */ - public DefaultSimulatorContext(ResourceLocator locator) { - _locator = locator; - } - - /** - * This method returns the resource locator. - * - * @return The resource locator - */ - public ResourceLocator getResourceLocator() { - return (_locator); - } - -} diff --git a/modules/trace/src/main/java/org/scribble/trace/simulation/RoleSimulatorManager.java b/modules/trace/src/main/java/org/scribble/trace/simulation/RoleSimulatorManager.java deleted file mode 100644 index 9af22d5ec..000000000 --- a/modules/trace/src/main/java/org/scribble/trace/simulation/RoleSimulatorManager.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.trace.simulation; - -import org.scribble.trace.model.MonitorRoleSimulator; -import org.scribble.trace.model.RoleSimulator; - -/** - * This class provides management of the role simulators. - * - */ -public class RoleSimulatorManager { - - private static final String MONITOR = "Monitor"; - - private static java.util.Map> _roleSimulatorTypes= - new java.util.HashMap>(); - - static { - _roleSimulatorTypes.put(MONITOR, MonitorRoleSimulator.class); - } - - /** - * This method registers a role simulator class against a name. This enables the deserialisation - * of a trace to instantiate the appropriate role simulator for use in simulating a role. - * - * @param name The name of the role simulator - * @param type The class of the role simulator - */ - public static void registerRoleSimulator(String name, Class type) { - _roleSimulatorTypes.put(name, type); - } - - /** - * This method unregisters a role simulator class associated with the specified name. - * - * @param name The name of the role simulator - * @param type The class of the role simulator - */ - public static void unregisterRoleSimulator(String name) { - _roleSimulatorTypes.remove(name); - } - - /** - * This method returns the role simulator type associated with the supplied name. - * - * @param name The name of the role simulator - * @return The role simulator's type, or null if not found - */ - public static Class getRoleSimulatorType(String name) { - return (_roleSimulatorTypes.get(name)); - } - -} diff --git a/modules/trace/src/main/java/org/scribble/trace/simulation/SimulationListener.java b/modules/trace/src/main/java/org/scribble/trace/simulation/SimulationListener.java deleted file mode 100644 index 8bf46bbc8..000000000 --- a/modules/trace/src/main/java/org/scribble/trace/simulation/SimulationListener.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.trace.simulation; - -import org.scribble.trace.model.Step; -import org.scribble.trace.model.Trace; - -/** - * This interface represents a simulation listener. - * - */ -public interface SimulationListener { - - /** - * This method identifies when a trace simulation has started. - * - * @param trace The trace - */ - public void start(Trace trace); - - /** - * This method identifies when the simulation of trace step has - * started. - * - * @param trace The trace - * @param step The step - */ - public void start(Trace trace, Step step); - - /** - * This method identifies when the simulation of trace step has - * been successful. - * - * @param trace The trace - * @param step The step - */ - public void successful(Trace trace, Step step); - - /** - * This method identifies when the simulation of trace step has - * been unsuccessful. - * - * @param trace The trace - * @param step The step - */ - public void failed(Trace trace, Step step); - - /** - * This method identifies when a trace simulation has stopped. - * - * @param trace The trace - */ - public void stop(Trace trace); - -} diff --git a/modules/trace/src/main/java/org/scribble/trace/simulation/Simulator.java b/modules/trace/src/main/java/org/scribble/trace/simulation/Simulator.java deleted file mode 100644 index 9047ad754..000000000 --- a/modules/trace/src/main/java/org/scribble/trace/simulation/Simulator.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.trace.simulation; - -import org.scribble.trace.model.RoleSimulator; -import org.scribble.trace.model.Role; -import org.scribble.trace.model.Step; -import org.scribble.trace.model.Trace; - -/** - * This class represents a simulator. - * - */ -public class Simulator { - - private java.util.Set _listeners=new java.util.HashSet(); - - /** - * This method registers a simulation listener. - * - * @param l The simulation listener - */ - public void addSimulationListener(SimulationListener l) { - synchronized (_listeners) { - _listeners.add(l); - } - } - - /** - * This method unregisters a simulation listener. - * - * @param l The simulation listener - */ - public void removeSimulationListener(SimulationListener l) { - synchronized (_listeners) { - _listeners.remove(l); - } - } - - /** - * This method initiates the simulation of a supplied trace. - * - * @param context The context - * @param trace The trace - * @return Whether the simulation was successful - */ - public boolean simulate(SimulatorContext context, Trace trace) { - boolean ret=true; - java.util.Map sims=new java.util.HashMap(); - - // Initialize the role simulators - for (Role role : trace.getRoles()) { - if (role.getSimulator() != null) { - role.getSimulator().init(context); - - sims.put(role.getName(), role.getSimulator()); - } - } - - for (SimulationListener l : _listeners) { - l.start(trace); - } - - - for (Step step : trace.getSteps()) { - for (SimulationListener l : _listeners) { - l.start(trace, step); - } - - if (step.simulate(context, sims)) { - for (SimulationListener l : _listeners) { - l.successful(trace, step); - } - } else { - ret = false; - - for (SimulationListener l : _listeners) { - l.failed(trace, step); - } - } - } - - for (SimulationListener l : _listeners) { - l.stop(trace); - } - - // Close the role simulators - for (Role role : trace.getRoles()) { - if (role.getSimulator() != null) { - role.getSimulator().close(context); - } - } - - return (ret); - } -} diff --git a/modules/trace/src/main/java/org/scribble/trace/simulation/SimulatorContext.java b/modules/trace/src/main/java/org/scribble/trace/simulation/SimulatorContext.java deleted file mode 100644 index 54fc73f62..000000000 --- a/modules/trace/src/main/java/org/scribble/trace/simulation/SimulatorContext.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.trace.simulation; - -import org.scribble.resources.ResourceLocator; - -/** - * This interface provides context support for the simulator. - * - */ -public interface SimulatorContext { - - /** - * This method returns the resource locator. - * - * @return The resource locator - */ - public ResourceLocator getResourceLocator(); - -} diff --git a/modules/trace/src/main/java/org/scribble/trace/simulation/TraceMessageComparator.java b/modules/trace/src/main/java/org/scribble/trace/simulation/TraceMessageComparator.java deleted file mode 100644 index 83ac14100..000000000 --- a/modules/trace/src/main/java/org/scribble/trace/simulation/TraceMessageComparator.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.trace.simulation; - -import org.scribble.monitor.model.MessageNode; -import org.scribble.monitor.runtime.MessageComparator; -import org.scribble.trace.model.Message; - -/** - * This class provides the default message comparator implementation. - * - */ -public class TraceMessageComparator implements MessageComparator { - - private MessageNode _node; - - /** - * This is the constructor to initialize the message comparator. - * - * @param node The message node - */ - public TraceMessageComparator(MessageNode node) { - _node = node; - } - - /** - * {@inheritDoc} - */ - public boolean isMatch(Object message) { - boolean ret=false; - - if (_node.getOperator().equals(((Message)message).getOperator()) - && _node.getParameters().size() == ((Message)message).getTypes().size()) { - - ret = true; - - for (int i=0; ret && i < _node.getParameters().size(); i++) { - ret = _node.getParameters().get(i).getType().equals(((Message)message).getTypes().get(i)); - } - } - - return (ret); - } - -} diff --git a/modules/trace/src/main/java/org/scribble/trace/simulation/TraceMessageComparatorFactory.java b/modules/trace/src/main/java/org/scribble/trace/simulation/TraceMessageComparatorFactory.java deleted file mode 100644 index 021df5adc..000000000 --- a/modules/trace/src/main/java/org/scribble/trace/simulation/TraceMessageComparatorFactory.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.trace.simulation; - -import org.scribble.monitor.model.MessageNode; -import org.scribble.monitor.runtime.MessageComparator; -import org.scribble.monitor.runtime.MessageComparatorFactory; - -/** - * This class provides the trace implementation of the message comparator factory. - * - */ -public class TraceMessageComparatorFactory implements MessageComparatorFactory { - - /** - * {@inheritDoc} - */ - public MessageComparator create(MessageNode node) { - return (new TraceMessageComparator(node)); - } - -} diff --git a/modules/trace/src/main/java/org/scribble/trace/simulation/junit/JUnitSimulator.java b/modules/trace/src/main/java/org/scribble/trace/simulation/junit/JUnitSimulator.java deleted file mode 100644 index 88162e598..000000000 --- a/modules/trace/src/main/java/org/scribble/trace/simulation/junit/JUnitSimulator.java +++ /dev/null @@ -1,346 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.trace.simulation.junit; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; - -import org.codehaus.jackson.map.ObjectMapper; -import org.scribble.resources.DirectoryResourceLocator; -import org.scribble.resources.ResourceLocator; -import org.scribble.trace.model.Step; -import org.scribble.trace.model.Trace; -import org.scribble.trace.simulation.DefaultSimulatorContext; -import org.scribble.trace.simulation.SimulationListener; -import org.scribble.trace.simulation.Simulator; -import org.scribble.trace.simulation.SimulatorContext; - -/** - * This class performs simulation of one or more trace files, and - * records the output in a JUnit XML file format. - * - */ -public class JUnitSimulator { - - private static final String TRACE = ".trace"; - private org.w3c.dom.Document _junitDoc; - private org.w3c.dom.Element _currentTestSuite; - - private java.io.File _junitFile; - - private ResourceLocator _locator; - - private int _id=0; - - private static final ObjectMapper MAPPER=new ObjectMapper(); - - /** - * This main method is invoked with the path of a single - * trace file, or a folder containing zero or more trace - * files. - * - * @param args The path - */ - public static void main(String args[]) { - if (args.length != 2) { - System.err.println("Usage: JUnitSimulator path junitXmlFile"); - System.exit(1); - } - - if (System.getProperty("MODULE_PATH") == null) { - System.err.println("'MODULE_PATH' envionment parameter has not been set"); - System.exit(2); - } - - JUnitSimulator sim=new JUnitSimulator(); - - try { - DirectoryResourceLocator locator=new DirectoryResourceLocator(System.getProperty("MODULE_PATH")); - - sim.setResourceLocator(locator); - - sim.simulate(args[0], args[1]); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - /** - * This method sets the resource locator. - * - * @param locator The resource locator - */ - public void setResourceLocator(ResourceLocator locator) { - _locator = locator; - } - - /** - * This method returns the resource locator. - * - * @return The resource locator - */ - public ResourceLocator getResourceLocator() { - return (_locator); - } - - /** - * This method simulates the trace file located at the specified - * path, or the zero or more trace files, if a directory is specified. - * The results are recorded in the junit xml schema format in the - * file specified. - * - * @param path The trace(s) location - * @param xmlFile The xml file to record the results - * @throws Exception Failed to simulate - */ - public void simulate(String path, String xmlFile) throws Exception { - - // Initialize the junit output file - _junitFile = new java.io.File(xmlFile); - - if (_junitFile.getParentFile().exists() == false) { - _junitFile.getParentFile().mkdirs(); - } - - // Initialize the junit result DOM - DocumentBuilder builder=DocumentBuilderFactory.newInstance().newDocumentBuilder(); - _junitDoc = builder.newDocument(); - - org.w3c.dom.Element testsuites=_junitDoc.createElement("testsuites"); - _junitDoc.appendChild(testsuites); - - updateResultFile(); - - // Traverse path locating any trace files - java.io.File root=new java.io.File(path); - - scanForTraceFiles(root); - } - - /** - * This method recursively processes a directory hierarchy locating 'trace' - * files, which are the simulated to produce results in the output file. - * - * @param file The file - * @throws Exception Failed to simulate - */ - protected void scanForTraceFiles(java.io.File file) throws Exception { - - if (file.isDirectory()) { - java.io.File[] children=file.listFiles(); - - for (java.io.File f : children) { - scanForTraceFiles(f); - } - } else if (file.isFile() && file.getName().endsWith(TRACE)) { - simulateTrace(file); - } - } - - /** - * This method simulates the supplied trace file. - * - * @param traceFile The trace file - * @throws Exception Failed to simulate trace - */ - protected void simulateTrace(java.io.File traceFile) throws Exception { - java.io.InputStream is=new java.io.FileInputStream(traceFile); - - Trace trace=MAPPER.readValue(is, Trace.class); - - is.close(); - - SimulatorContext context=new DefaultSimulatorContext(_locator); - - Simulator simulator=new Simulator(); - - SimulationListener l=new JUnitSimulationListener(); - - simulator.addSimulationListener(l); - - try { - simulator.simulate(context, trace); - } catch (Exception e) { - e.printStackTrace(); - } - - simulator.removeSimulationListener(l); - } - - /** - * This method initialixes the result file. - * - * @param file The file - * @throws Exception Failed to initialize - */ - public static void initResultsFile(java.io.File file) throws Exception { - // Initialize the junit result DOM - DocumentBuilder builder=DocumentBuilderFactory.newInstance().newDocumentBuilder(); - org.w3c.dom.Document doc = builder.newDocument(); - - org.w3c.dom.Element testsuites=doc.createElement("testsuites"); - doc.appendChild(testsuites); - - if (!file.getParentFile().exists()) { - file.getParentFile().mkdirs(); - } - - if (!file.exists()) { - file.createNewFile(); - } - - updateResultFile(file, doc); - } - - /** - * This method updates the results. - * - * @throws Exception Failed to update - */ - protected void updateResultFile() throws Exception { - updateResultFile(_junitFile, _junitDoc); - } - - /** - * This method updates the results from the junit document into the output - * (result) file. - * - * @param file The file - * @param results The results - * @throws Exception Failed to update the result file - */ - public static void updateResultFile(java.io.File file, org.w3c.dom.Document results) throws Exception { - java.io.FileOutputStream fos=new java.io.FileOutputStream(file); - - javax.xml.transform.dom.DOMSource source=new javax.xml.transform.dom.DOMSource(results); - javax.xml.transform.stream.StreamResult result=new javax.xml.transform.stream.StreamResult(fos); - - javax.xml.transform.Transformer transformer= - javax.xml.transform.TransformerFactory.newInstance().newTransformer(); - - transformer.transform(source, result); - - fos.flush(); - - fos.close(); - } - - /** - * JUnit implementation of the simulation listener interface, used - * to record the intermediate and final results from simulating the - * trace files. - * - */ - public class JUnitSimulationListener implements SimulationListener { - - private long _stepStart; - - /** - * {@inheritDoc} - */ - public void start(Trace trace) { - String name=trace.getName(); - - _currentTestSuite = _junitDoc.createElement("testsuite"); - _currentTestSuite.setAttribute("name", name); - _currentTestSuite.setAttribute("id", ""+(_id++)); - - _junitDoc.getDocumentElement().appendChild(_currentTestSuite); - - try { - updateResultFile(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - /** - * {@inheritDoc} - */ - public void start(Trace trace, Step step) { - _stepStart = System.currentTimeMillis(); - } - - /** - * {@inheritDoc} - */ - public void successful(Trace trace, Step step) { - createTestCase(step); - - try { - updateResultFile(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - /** - * This method creates a testcase entry for the supplied step. - * - * @param step The step being simulated - */ - protected org.w3c.dom.Element createTestCase(Step step) { - org.w3c.dom.Element testcase=_junitDoc.createElement("testcase"); - testcase.setAttribute("name", step.toString()); - - long timeTaken=System.currentTimeMillis()-_stepStart; - timeTaken /= 1000; - - testcase.setAttribute("time", ""+timeTaken); - - _currentTestSuite.appendChild(testcase); - - return (testcase); - } - - /** - * {@inheritDoc} - */ - public void failed(Trace trace, Step step) { - org.w3c.dom.Element testcase=createTestCase(step); - - org.w3c.dom.Element error=_junitDoc.createElement("error"); - error.setAttribute("type", "Unexpected message"); - testcase.appendChild(error); - - org.w3c.dom.Text desc=_junitDoc.createTextNode("Unexpected step: "+step); - error.appendChild(desc); - - try { - updateResultFile(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - /** - * {@inheritDoc} - */ - public void stop(Trace trace) { - _currentTestSuite = null; - - try { - updateResultFile(); - } catch (Exception e) { - e.printStackTrace(); - } - } - }; - - -} diff --git a/modules/trace/src/main/java/org/scribble/trace/util/TraceUtil.java b/modules/trace/src/main/java/org/scribble/trace/util/TraceUtil.java deleted file mode 100644 index ec4636de7..000000000 --- a/modules/trace/src/main/java/org/scribble/trace/util/TraceUtil.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.trace.util; - -import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jackson.map.SerializationConfig; -import org.codehaus.jackson.map.annotate.JsonSerialize; -import org.scribble.trace.model.Trace; - -/** - * This class provides trace utility functions. - * - */ -public class TraceUtil { - - protected static final ObjectMapper MAPPER=new ObjectMapper(); - - static { - SerializationConfig config=MAPPER.getSerializationConfig() - .withSerializationInclusion(JsonSerialize.Inclusion.NON_NULL) - .withSerializationInclusion(JsonSerialize.Inclusion.NON_DEFAULT); - - MAPPER.setSerializationConfig(config); - } - - /** - * This method returns the JSON representation of a trace. - * - * @param trace The trace - * @return The JSON representation - * @throws Exception Failed to serialize - */ - public static byte[] serializeTrace(Trace trace) throws Exception { - byte[] ret=null; - - java.io.ByteArrayOutputStream baos=new java.io.ByteArrayOutputStream(); - - MAPPER.writeValue(baos, trace); - - ret = baos.toByteArray(); - - baos.close(); - - return (ret); - } - - /** - * This method returns the simulation list for a supplied JSON representation. - * - * @param simulations The JSON representation - * @return The simulation list - * @throws Exception Failed to deserialize - */ - public static Trace deserializeTrace(byte[] trace) throws Exception { - Trace ret=null; - - java.io.ByteArrayInputStream bais=new java.io.ByteArrayInputStream(trace); - - ret = MAPPER.readValue(bais, Trace.class); - - bais.close(); - - return (ret); - } -} diff --git a/modules/trace/src/main/resources/org/scribble/trace/Messages.properties b/modules/trace/src/main/resources/org/scribble/trace/Messages.properties deleted file mode 100644 index c7b812ff0..000000000 --- a/modules/trace/src/main/resources/org/scribble/trace/Messages.properties +++ /dev/null @@ -1,17 +0,0 @@ -#/* -# * Copyright 2009-14 Scribble.org -# * -# * Licensed under the Apache License, Version 2.0 (the "License"); -# * you may not use this file except in compliance with the License. -# * You may obtain a copy of the License at -# * -# * http://www.apache.org/licenses/LICENSE-2.0 -# * -# * Unless required by applicable law or agreed to in writing, software -# * distributed under the License is distributed on an "AS IS" BASIS, -# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# * See the License for the specific language governing permissions and -# * limitations under the License. -# * -# */ - diff --git a/modules/trace/src/test/java/org/scribble/trace/SimulatorTest.java b/modules/trace/src/test/java/org/scribble/trace/SimulatorTest.java deleted file mode 100644 index 7c2736561..000000000 --- a/modules/trace/src/test/java/org/scribble/trace/SimulatorTest.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.trace; - -import static org.junit.Assert.*; - -import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jackson.map.SerializationConfig.Feature; -import org.scribble.resources.DirectoryResourceLocator; -import org.scribble.trace.model.Trace; -import org.scribble.trace.simulation.DefaultSimulatorContext; -import org.scribble.trace.simulation.Simulator; -import org.scribble.trace.simulation.SimulatorContext; - -public class SimulatorTest { - - @org.junit.Test - public void testChoice1() { - testSimulator("scribble.examples.Choice_Buyer", "First", 1, true); - } - - @org.junit.Test - public void testChoice2() { - testSimulator("scribble.examples.Choice_Buyer", "First", 2, true); - } - - @org.junit.Test - public void testDo1() { - testSimulator("scribble.examples.Do_Buyer", "First", 1, true); - } - - @org.junit.Test - public void testInterruptible1() { - testSimulator("scribble.examples.Interruptible_Buyer", "First", 1, true); - } - - @org.junit.Test - public void testInterruptible2() { - testSimulator("scribble.examples.Interruptible_Buyer", "First", 2, true); - } - - @org.junit.Test - public void testInterruptible3() { - testSimulator("scribble.examples.Interruptible_Buyer", "First", 3, true); - } - - @org.junit.Test - public void testParallel1() { - testSimulator("scribble.examples.Parallel_Buyer", "First", 1, true); - } - - @org.junit.Test - public void testParallel2() { - testSimulator("scribble.examples.Parallel_Buyer", "First", 2, true); - } - - @org.junit.Test - public void testRecursion1() { - testSimulator("scribble.examples.Recursion_Buyer", "First", 1, true); - } - - @org.junit.Test - public void testRecursion2() { - testSimulator("scribble.examples.Recursion_Buyer", "First", 2, true); - } - - @org.junit.Test - public void testRecursion3() { - testSimulator("scribble.examples.Recursion_Buyer", "First", 3, true); - } - - @org.junit.Test - public void testRequestResponse1() { - testSimulator("scribble.examples.RequestResponse_Buyer", "First", 1, true); - } - - /** - * This test indicates that one of the steps is expected to fail. - */ - @org.junit.Test - public void testRequestResponse2() { - testSimulator("scribble.examples.RequestResponse_Buyer", "First", 2, true); - } - - /** - * This test checks that the simulation failed. - */ - @org.junit.Test - public void testRequestResponse3() { - testSimulator("scribble.examples.RequestResponse_Buyer", "First", 3, false); - } - - protected void testSimulator(String module, String protocol, int testnum, boolean successful) { - - try { - java.net.URL url=ClassLoader.getSystemResource("scribble"); - java.io.File f=new java.io.File(url.getFile()); - - DirectoryResourceLocator locator=new DirectoryResourceLocator(f.getParentFile().getAbsolutePath()); - - ObjectMapper mapper=new ObjectMapper(); - mapper.configure(Feature.SORT_PROPERTIES_ALPHABETICALLY, true); - - java.io.InputStream is=ClassLoader.getSystemResourceAsStream(module.replace('.', '/')+ - "-"+testnum+".trace"); - - Trace trace=mapper.readValue(is, Trace.class); - - is.close(); - - SimulatorContext context=new DefaultSimulatorContext(locator); - - Simulator simulator=new Simulator(); - - if (simulator.simulate(context, trace) != successful) { - fail("Simulation result for module '"+module+"' protocol '"+protocol+"' was not as expected"); - } - - } catch (Exception e) { - e.printStackTrace(); - fail("Failed to simulate module '"+module+"' protocol '"+protocol+"' and trace number: "+testnum); - } - } -} diff --git a/modules/trace/src/test/java/org/scribble/trace/TraceUtilTest.java b/modules/trace/src/test/java/org/scribble/trace/TraceUtilTest.java deleted file mode 100644 index e6e8d6a73..000000000 --- a/modules/trace/src/test/java/org/scribble/trace/TraceUtilTest.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.trace; - -import static org.junit.Assert.*; - -import org.junit.Test; -import org.scribble.trace.model.Message; -import org.scribble.trace.model.MessageTransfer; -import org.scribble.trace.model.MonitorRoleSimulator; -import org.scribble.trace.model.Role; -import org.scribble.trace.model.Trace; -import org.scribble.trace.util.TraceUtil; - -public class TraceUtilTest { - - private static final String ROLE_A = "RoleA"; - private static final String ROLE_B = "RoleB"; - - private static final String V1_2 = "v1-2"; - private static final String V1_1 = "v1-1"; - private static final String T1_2 = "t1-2"; - private static final String T1_1 = "t1-1"; - private static final String OP1 = "op1"; - - private static final String V2_2 = "v2-2"; - private static final String V2_1 = "v2-1"; - private static final String T2_2 = "t2-2"; - private static final String T2_1 = "t2-1"; - private static final String OP2 = "op2"; - - @Test - public void testSerializeTrace() { - - Message m1=new Message(); - m1.setOperator(OP1); - - java.util.List types1=new java.util.ArrayList(); - types1.add(T1_1); - types1.add(T1_2); - m1.setTypes(types1); - - java.util.List values1=new java.util.ArrayList(); - values1.add(V1_1); - values1.add(V1_2); - m1.setValues(values1); - - Message m2=new Message(); - m2.setOperator(OP2); - - java.util.List types2=new java.util.ArrayList(); - types2.add(T2_1); - types2.add(T2_2); - m2.setTypes(types2); - - java.util.List values2=new java.util.ArrayList(); - values2.add(V2_1); - values2.add(V2_2); - m2.setValues(values2); - - Trace t1=new Trace(); - - MessageTransfer mt1=new MessageTransfer(); - mt1.setFromRole("A"); - mt1.getToRoles().add("B"); - mt1.setMessage(m1); - t1.getSteps().add(mt1); - - MessageTransfer mt2=new MessageTransfer(); - mt2.setFromRole("C"); - mt2.getToRoles().add("D"); - mt2.getToRoles().add("E"); - mt2.setMessage(m2); - t1.getSteps().add(mt2); - - Role role1=new Role(); - role1.setName(ROLE_A); - t1.getRoles().add(role1); - - MonitorRoleSimulator mrs1=new MonitorRoleSimulator(); - mrs1.setProtocol("a.b.c.P1"); - role1.setSimulator(mrs1); - - Role role2=new Role(); - role2.setName(ROLE_B); - t1.getRoles().add(role2); - - MonitorRoleSimulator mrs2=new MonitorRoleSimulator(); - mrs2.setProtocol("a.b.c.P2"); - role2.setSimulator(mrs2); - - - byte[] ser=null; - - try { - ser = TraceUtil.serializeTrace(t1); - } catch (Exception e) { - fail("Failed to serialize trace"); - } - - //System.out.println("SERIALISED="+new String(ser)); - - Trace result=null; - - try { - result = TraceUtil.deserializeTrace(ser); - } catch (Exception e) { - e.printStackTrace(); - fail("Failed to deserialize trace"); - } - - if (result == null) { - fail("Null results"); - } - - if (result.getSteps().size() != 2) { - fail("Expecting 2 steps: "+result.getSteps().size()); - } - - if (result.getRoles().size() != 2) { - fail("Expecting 2 simulations: "+result.getRoles().size()); - } - } -} diff --git a/modules/trace/src/test/java/org/scribble/trace/junit/JUnitSimulatorTest.java b/modules/trace/src/test/java/org/scribble/trace/junit/JUnitSimulatorTest.java deleted file mode 100644 index 06e316b52..000000000 --- a/modules/trace/src/test/java/org/scribble/trace/junit/JUnitSimulatorTest.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.trace.junit; - -import static org.junit.Assert.*; - -import org.scribble.resources.DirectoryResourceLocator; -import org.scribble.trace.simulation.junit.JUnitSimulator; - -public class JUnitSimulatorTest { - - @org.junit.Test - public void testSimulate() { - JUnitSimulator sim=new JUnitSimulator(); - - java.net.URL url=ClassLoader.getSystemResource("scribble"); - java.io.File f=new java.io.File(url.getFile()); - - String path=f.getParentFile().getAbsolutePath(); - - String xmlFile=System.getProperty("java.io.tmpdir")+java.io.File.separator+"traceResult"+ - System.currentTimeMillis()+".xml"; - - //System.out.println("XMLFILE="+xmlFile); - - sim.setResourceLocator(new DirectoryResourceLocator(path)); - - try { - sim.simulate(path, xmlFile); - } catch (Exception e) { - e.printStackTrace(); - fail("Failed to simulate with junit results"); - } - - // Check results file - org.w3c.dom.Document doc=null; - - try { - java.io.File resultFile=new java.io.File(xmlFile); - - java.io.InputStream is=new java.io.FileInputStream(resultFile); - - javax.xml.transform.stream.StreamSource source=new javax.xml.transform.stream.StreamSource(is); - javax.xml.transform.dom.DOMResult result=new javax.xml.transform.dom.DOMResult(); - - javax.xml.transform.Transformer transformer= - javax.xml.transform.TransformerFactory.newInstance().newTransformer(); - - transformer.transform(source, result); - - is.close(); - - doc = (org.w3c.dom.Document)result.getNode(); - - // Remove file - if (!resultFile.delete()) { - fail("Failed to delete result file"); - } - - } catch (Exception e) { - e.printStackTrace(); - fail("Failed to check results"); - } - - if (doc.getDocumentElement().getChildNodes().getLength() != 14) { - fail("Expecting 14 testcases, but got: "+doc.getDocumentElement().getChildNodes().getLength()); - } - - for (int i=0; i < doc.getDocumentElement().getChildNodes().getLength(); i++) { - org.w3c.dom.Node node=doc.getDocumentElement().getChildNodes().item(i); - - if (node.getNodeName().equals("testsuite")) { - org.w3c.dom.Element elem=(org.w3c.dom.Element)node; - - for (int j=0; j < elem.getChildNodes().getLength(); j++) { - org.w3c.dom.Element testcase=(org.w3c.dom.Element)elem.getChildNodes().item(j); - - if (testcase.getChildNodes().getLength() != 0 && - !elem.getAttribute("name").equals("RequestResponse@Buyer-3")) { - fail("Test case '"+testcase.getAttribute("name")+"', in testsuite '"+ - elem.getAttribute("name")+ - "' should not have a failure or error"); - } - } - } - } - } -} diff --git a/modules/trace/src/test/resources/scribble/examples/Choice_Buyer-1.trace b/modules/trace/src/test/resources/scribble/examples/Choice_Buyer-1.trace deleted file mode 100644 index b8fce851d..000000000 --- a/modules/trace/src/test/resources/scribble/examples/Choice_Buyer-1.trace +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name":"Choice@Buyer-1", - "steps":[{ - "type":"MessageTransfer", - "message":{ - "operator":"op1", - "types":["{http://scribble.org/example}M1"], - "values":[""] - }, - "fromRole":"Buyer", - "toRoles":["Seller"] - },{ - "type":"MessageTransfer", - "message":{ - "operator":"op2", - "types":["{http://scribble.org/example}M2"], - "values":[""] - }, - "fromRole":"Seller", - "toRoles":["Buyer"] - },{ - "type":"MessageTransfer", - "message":{ - "operator":"op4", - "types":["{http://scribble.org/example}M4"], - "values":[""] - }, - "fromRole":"Buyer", - "toRoles":["Seller"] - }], - "roles":[{ - "name":"Buyer", - "simulator":{ - "type":"MonitorRoleSimulator", - "module":"scribble.examples.Choice", - "role":"Buyer", - "protocol":"First" - } - }] -} diff --git a/modules/trace/src/test/resources/scribble/examples/Choice_Buyer-2.trace b/modules/trace/src/test/resources/scribble/examples/Choice_Buyer-2.trace deleted file mode 100644 index fe4246269..000000000 --- a/modules/trace/src/test/resources/scribble/examples/Choice_Buyer-2.trace +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name":"Choice@Buyer-2", - "steps":[{ - "type":"MessageTransfer", - "message":{ - "operator":"op1", - "types":["{http://scribble.org/example}M1"], - "values":[""] - }, - "fromRole":"Buyer", - "toRoles":["Seller"] - },{ - "type":"MessageTransfer", - "message":{ - "operator":"op3", - "types":["{http://scribble.org/example}M3"], - "values":[""] - }, - "fromRole":"Seller", - "toRoles":["Buyer"] - },{ - "type":"MessageTransfer", - "message":{ - "operator":"op4", - "types":["{http://scribble.org/example}M4"], - "values":[""] - }, - "fromRole":"Buyer", - "toRoles":["Seller"] - }], - "roles":[{ - "name":"Buyer", - "simulator":{ - "type":"MonitorRoleSimulator", - "module":"scribble.examples.Choice", - "role":"Buyer", - "protocol":"First" - } - }] -} diff --git a/modules/trace/src/test/resources/scribble/examples/Choice_Buyer.scr b/modules/trace/src/test/resources/scribble/examples/Choice_Buyer.scr deleted file mode 100644 index 81b736dec..000000000 --- a/modules/trace/src/test/resources/scribble/examples/Choice_Buyer.scr +++ /dev/null @@ -1,18 +0,0 @@ -module scribble.examples.Choice; - -type "{http://scribble.org/example}M1" from "http://scribble.org/schema/Example.xsd" as M1; -type "{http://scribble.org/example}M2" from "http://scribble.org/schema/Example.xsd" as M2; -type "{http://scribble.org/example}M3" from "http://scribble.org/schema/Example.xsd" as M3; -type "{http://scribble.org/example}M4" from "http://scribble.org/schema/Example.xsd" as M4; - -local protocol First at Buyer (role Buyer, role Seller) { - op1(M1) to Seller; - - choice at Seller { - op2(M2) from Seller; - } or { - op3(M3) from Seller; - } - - op4(M4) to Seller; -} \ No newline at end of file diff --git a/modules/trace/src/test/resources/scribble/examples/Do_Buyer-1.trace b/modules/trace/src/test/resources/scribble/examples/Do_Buyer-1.trace deleted file mode 100644 index 6ff755846..000000000 --- a/modules/trace/src/test/resources/scribble/examples/Do_Buyer-1.trace +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name":"Do@Buyer-1", - "steps":[{ - "type":"MessageTransfer", - "message":{ - "operator":"op1", - "types":["{http://scribble.org/example}M1"], - "values":[""] - }, - "fromRole":"Buyer", - "toRoles":["Seller"] - },{ - "type":"MessageTransfer", - "message":{ - "operator":"op2", - "types":["{http://scribble.org/example}M2"], - "values":[""] - }, - "fromRole":"Seller", - "toRoles":["Buyer"] - },{ - "type":"MessageTransfer", - "message":{ - "operator":"op3", - "types":["{http://scribble.org/example}M3"], - "values":[""] - }, - "fromRole":"Buyer", - "toRoles":["Seller"] - }], - "roles":[{ - "name":"Buyer", - "simulator":{ - "type":"MonitorRoleSimulator", - "module":"scribble.examples.Do", - "role":"Buyer", - "protocol":"First" - } - }] -} diff --git a/modules/trace/src/test/resources/scribble/examples/Do_Buyer.scr b/modules/trace/src/test/resources/scribble/examples/Do_Buyer.scr deleted file mode 100644 index 0378746cc..000000000 --- a/modules/trace/src/test/resources/scribble/examples/Do_Buyer.scr +++ /dev/null @@ -1,17 +0,0 @@ -module scribble.examples.Do; - -type "{http://scribble.org/example}M1" from "http://scribble.org/schema/Example.xsd" as M1; -type "{http://scribble.org/example}M2" from "http://scribble.org/schema/Example.xsd" as M2; -type "{http://scribble.org/example}M3" from "http://scribble.org/schema/Example.xsd" as M3; - -local protocol First at Buyer (role Buyer, role Seller) { - op1(M1) to Seller; - - do Second(Buyer, Seller); - - op3(M3) to Seller; -} - -local protocol Second at Buyer (role Buyer, role Seller) { - op2(M2) from Seller; -} \ No newline at end of file diff --git a/modules/trace/src/test/resources/scribble/examples/Interruptible_Buyer-1.trace b/modules/trace/src/test/resources/scribble/examples/Interruptible_Buyer-1.trace deleted file mode 100644 index eace2b793..000000000 --- a/modules/trace/src/test/resources/scribble/examples/Interruptible_Buyer-1.trace +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name":"Interruptible@Buyer-1", - "steps":[{ - "type":"MessageTransfer", - "message":{ - "operator":"op1", - "types":["{http://scribble.org/example}M1"], - "values":[""] - }, - "fromRole":"Buyer", - "toRoles":["Seller"] - },{ - "type":"MessageTransfer", - "message":{ - "operator":"op2", - "types":["{http://scribble.org/example}M2"], - "values":[""] - }, - "fromRole":"Seller", - "toRoles":["Buyer"] - },{ - "type":"MessageTransfer", - "message":{ - "operator":"op5", - "types":["{http://scribble.org/example}M5"], - "values":[""] - }, - "fromRole":"Buyer", - "toRoles":["Seller"] - }], - "roles":[{ - "name":"Buyer", - "simulator":{ - "type":"MonitorRoleSimulator", - "module":"scribble.examples.Interruptible", - "role":"Buyer", - "protocol":"First" - } - }] -} diff --git a/modules/trace/src/test/resources/scribble/examples/Interruptible_Buyer-2.trace b/modules/trace/src/test/resources/scribble/examples/Interruptible_Buyer-2.trace deleted file mode 100644 index 78b0db989..000000000 --- a/modules/trace/src/test/resources/scribble/examples/Interruptible_Buyer-2.trace +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name":"Interruptible@Buyer-2", - "steps":[{ - "type":"MessageTransfer", - "message":{ - "operator":"op1", - "types":["{http://scribble.org/example}M1"], - "values":[""] - }, - "fromRole":"Buyer", - "toRoles":["Seller"] - },{ - "type":"MessageTransfer", - "message":{ - "operator":"op4", - "types":["{http://scribble.org/example}M4"], - "values":[""] - }, - "fromRole":"Seller", - "toRoles":["Buyer"] - },{ - "type":"MessageTransfer", - "message":{ - "operator":"op5", - "types":["{http://scribble.org/example}M5"], - "values":[""] - }, - "fromRole":"Buyer", - "toRoles":["Seller"] - }], - "roles":[{ - "name":"Buyer", - "simulator":{ - "type":"MonitorRoleSimulator", - "module":"scribble.examples.Interruptible", - "role":"Buyer", - "protocol":"First" - } - }] -} diff --git a/modules/trace/src/test/resources/scribble/examples/Interruptible_Buyer-3.trace b/modules/trace/src/test/resources/scribble/examples/Interruptible_Buyer-3.trace deleted file mode 100644 index b9297bf70..000000000 --- a/modules/trace/src/test/resources/scribble/examples/Interruptible_Buyer-3.trace +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name":"Interruptible@Buyer-3", - "steps":[{ - "type":"MessageTransfer", - "message":{ - "operator":"op1", - "types":["{http://scribble.org/example}M1"], - "values":[""] - }, - "fromRole":"Buyer", - "toRoles":["Seller"] - },{ - "type":"MessageTransfer", - "message":{ - "operator":"op3", - "types":["{http://scribble.org/example}M3"], - "values":[""] - }, - "fromRole":"Buyer", - "toRoles":["Seller"] - },{ - "type":"MessageTransfer", - "message":{ - "operator":"op5", - "types":["{http://scribble.org/example}M5"], - "values":[""] - }, - "fromRole":"Buyer", - "toRoles":["Seller"] - }], - "roles":[{ - "name":"Buyer", - "simulator":{ - "type":"MonitorRoleSimulator", - "module":"scribble.examples.Interruptible", - "role":"Buyer", - "protocol":"First" - } - }] -} diff --git a/modules/trace/src/test/resources/scribble/examples/Interruptible_Buyer.scr b/modules/trace/src/test/resources/scribble/examples/Interruptible_Buyer.scr deleted file mode 100644 index cd854b763..000000000 --- a/modules/trace/src/test/resources/scribble/examples/Interruptible_Buyer.scr +++ /dev/null @@ -1,21 +0,0 @@ -module scribble.examples.Interruptible; - -type "{http://scribble.org/example}M1" from "http://scribble.org/schema/Example.xsd" as M1; -type "{http://scribble.org/example}M2" from "http://scribble.org/schema/Example.xsd" as M2; -type "{http://scribble.org/example}M3" from "http://scribble.org/schema/Example.xsd" as M3; -type "{http://scribble.org/example}M4" from "http://scribble.org/schema/Example.xsd" as M4; -type "{http://scribble.org/example}M5" from "http://scribble.org/schema/Example.xsd" as M5; - -local protocol First at Buyer (role Buyer, role Seller) { - op1(M1) to Seller; - - interruptible TestScope: { - op2(M2) from Seller; - - } with { - throws op3(M3) to Seller; - catches op4(M4) from Seller; - } - - op5(M5) to Seller; -} diff --git a/modules/trace/src/test/resources/scribble/examples/Parallel_Buyer-1.trace b/modules/trace/src/test/resources/scribble/examples/Parallel_Buyer-1.trace deleted file mode 100644 index e32958052..000000000 --- a/modules/trace/src/test/resources/scribble/examples/Parallel_Buyer-1.trace +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name":"Parallel@Buyer-1", - "steps":[{ - "type":"MessageTransfer", - "message":{ - "operator":"op1", - "types":["{http://scribble.org/example}M1"], - "values":[""] - }, - "fromRole":"Buyer", - "toRoles":["Seller"] - },{ - "type":"MessageTransfer", - "message":{ - "operator":"op2", - "types":["{http://scribble.org/example}M2"], - "values":[""] - }, - "fromRole":"Seller", - "toRoles":["Buyer"] - },{ - "type":"MessageTransfer", - "message":{ - "operator":"op3", - "types":["{http://scribble.org/example}M3"], - "values":[""] - }, - "fromRole":"Seller", - "toRoles":["Buyer"] - },{ - "type":"MessageTransfer", - "message":{ - "operator":"op4", - "types":["{http://scribble.org/example}M4"], - "values":[""] - }, - "fromRole":"Buyer", - "toRoles":["Seller"] - }], - "roles":[{ - "name":"Buyer", - "simulator":{ - "type":"MonitorRoleSimulator", - "module":"scribble.examples.Parallel", - "role":"Buyer", - "protocol":"First" - } - }] -} diff --git a/modules/trace/src/test/resources/scribble/examples/Parallel_Buyer-2.trace b/modules/trace/src/test/resources/scribble/examples/Parallel_Buyer-2.trace deleted file mode 100644 index be3880367..000000000 --- a/modules/trace/src/test/resources/scribble/examples/Parallel_Buyer-2.trace +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name":"Parallel@Buyer-2", - "steps":[{ - "type":"MessageTransfer", - "message":{ - "operator":"op1", - "types":["{http://scribble.org/example}M1"], - "values":[""] - }, - "fromRole":"Buyer", - "toRoles":["Seller"] - },{ - "type":"MessageTransfer", - "message":{ - "operator":"op3", - "types":["{http://scribble.org/example}M3"], - "values":[""] - }, - "fromRole":"Seller", - "toRoles":["Buyer"] - },{ - "type":"MessageTransfer", - "message":{ - "operator":"op2", - "types":["{http://scribble.org/example}M2"], - "values":[""] - }, - "fromRole":"Seller", - "toRoles":["Buyer"] - },{ - "type":"MessageTransfer", - "message":{ - "operator":"op4", - "types":["{http://scribble.org/example}M4"], - "values":[""] - }, - "fromRole":"Buyer", - "toRoles":["Seller"] - }], - "roles":[{ - "name":"Buyer", - "simulator":{ - "type":"MonitorRoleSimulator", - "module":"scribble.examples.Parallel", - "role":"Buyer", - "protocol":"First" - } - }] -} diff --git a/modules/trace/src/test/resources/scribble/examples/Parallel_Buyer.scr b/modules/trace/src/test/resources/scribble/examples/Parallel_Buyer.scr deleted file mode 100644 index da4bbf1b8..000000000 --- a/modules/trace/src/test/resources/scribble/examples/Parallel_Buyer.scr +++ /dev/null @@ -1,18 +0,0 @@ -module scribble.examples.Parallel; - -type "{http://scribble.org/example}M1" from "http://scribble.org/schema/Example.xsd" as M1; -type "{http://scribble.org/example}M2" from "http://scribble.org/schema/Example.xsd" as M2; -type "{http://scribble.org/example}M3" from "http://scribble.org/schema/Example.xsd" as M3; -type "{http://scribble.org/example}M4" from "http://scribble.org/schema/Example.xsd" as M4; - -local protocol First at Buyer (role Buyer, role Seller) { - op1(M1) to Seller; - - par { - op2(M2) from Seller; - } and { - op3(M3) from Seller; - } - - op4(M4) to Seller; -} \ No newline at end of file diff --git a/modules/trace/src/test/resources/scribble/examples/Recursion_Buyer-1.trace b/modules/trace/src/test/resources/scribble/examples/Recursion_Buyer-1.trace deleted file mode 100644 index 2291f4db7..000000000 --- a/modules/trace/src/test/resources/scribble/examples/Recursion_Buyer-1.trace +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name":"Recursion@Buyer-1", - "steps":[{ - "type":"MessageTransfer", - "message":{ - "operator":"op1", - "types":["{http://scribble.org/example}M1"], - "values":[""] - }, - "fromRole":"Buyer", - "toRoles":["Seller"] - },{ - "type":"MessageTransfer", - "message":{ - "operator":"op2", - "types":["{http://scribble.org/example}M2"], - "values":[""] - }, - "fromRole":"Seller", - "toRoles":["Buyer"] - },{ - "type":"MessageTransfer", - "message":{ - "operator":"op4", - "types":["{http://scribble.org/example}M4"], - "values":[""] - }, - "fromRole":"Seller", - "toRoles":["Buyer"] - },{ - "type":"MessageTransfer", - "message":{ - "operator":"op5", - "types":["{http://scribble.org/example}M5"], - "values":[""] - }, - "fromRole":"Buyer", - "toRoles":["Seller"] - }], - "roles":[{ - "name":"Buyer", - "simulator":{ - "type":"MonitorRoleSimulator", - "module":"scribble.examples.Recursion", - "role":"Buyer", - "protocol":"First" - } - }] -} diff --git a/modules/trace/src/test/resources/scribble/examples/Recursion_Buyer-2.trace b/modules/trace/src/test/resources/scribble/examples/Recursion_Buyer-2.trace deleted file mode 100644 index 283789cda..000000000 --- a/modules/trace/src/test/resources/scribble/examples/Recursion_Buyer-2.trace +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name":"Recursion@Buyer-2", - "steps":[{ - "type":"MessageTransfer", - "message":{ - "operator":"op1", - "types":["{http://scribble.org/example}M1"], - "values":[""] - }, - "fromRole":"Buyer", - "toRoles":["Seller"] - },{ - "type":"MessageTransfer", - "message":{ - "operator":"op2", - "types":["{http://scribble.org/example}M2"], - "values":[""] - }, - "fromRole":"Seller", - "toRoles":["Buyer"] - },{ - "type":"MessageTransfer", - "message":{ - "operator":"op3", - "types":["{http://scribble.org/example}M3"], - "values":[""] - }, - "fromRole":"Seller", - "toRoles":["Buyer"] - },{ - "type":"MessageTransfer", - "message":{ - "operator":"op2", - "types":["{http://scribble.org/example}M2"], - "values":[""] - }, - "fromRole":"Seller", - "toRoles":["Buyer"] - },{ - "type":"MessageTransfer", - "message":{ - "operator":"op4", - "types":["{http://scribble.org/example}M4"], - "values":[""] - }, - "fromRole":"Seller", - "toRoles":["Buyer"] - },{ - "type":"MessageTransfer", - "message":{ - "operator":"op5", - "types":["{http://scribble.org/example}M5"], - "values":[""] - }, - "fromRole":"Buyer", - "toRoles":["Seller"] - }], - "roles":[{ - "name":"Buyer", - "simulator":{ - "type":"MonitorRoleSimulator", - "module":"scribble.examples.Recursion", - "role":"Buyer", - "protocol":"First" - } - }] -} diff --git a/modules/trace/src/test/resources/scribble/examples/Recursion_Buyer-3.trace b/modules/trace/src/test/resources/scribble/examples/Recursion_Buyer-3.trace deleted file mode 100644 index bb497727f..000000000 --- a/modules/trace/src/test/resources/scribble/examples/Recursion_Buyer-3.trace +++ /dev/null @@ -1,85 +0,0 @@ -{ - "name":"Recursion@Buyer-3", - "steps":[{ - "type":"MessageTransfer", - "message":{ - "operator":"op1", - "types":["{http://scribble.org/example}M1"], - "values":[""] - }, - "fromRole":"Buyer", - "toRoles":["Seller"] - },{ - "type":"MessageTransfer", - "message":{ - "operator":"op2", - "types":["{http://scribble.org/example}M2"], - "values":[""] - }, - "fromRole":"Seller", - "toRoles":["Buyer"] - },{ - "type":"MessageTransfer", - "message":{ - "operator":"op3", - "types":["{http://scribble.org/example}M3"], - "values":[""] - }, - "fromRole":"Seller", - "toRoles":["Buyer"] - },{ - "type":"MessageTransfer", - "message":{ - "operator":"op2", - "types":["{http://scribble.org/example}M2"], - "values":[""] - }, - "fromRole":"Seller", - "toRoles":["Buyer"] - },{ - "type":"MessageTransfer", - "message":{ - "operator":"op3", - "types":["{http://scribble.org/example}M3"], - "values":[""] - }, - "fromRole":"Seller", - "toRoles":["Buyer"] - },{ - "type":"MessageTransfer", - "message":{ - "operator":"op2", - "types":["{http://scribble.org/example}M2"], - "values":[""] - }, - "fromRole":"Seller", - "toRoles":["Buyer"] - },{ - "type":"MessageTransfer", - "message":{ - "operator":"op4", - "types":["{http://scribble.org/example}M4"], - "values":[""] - }, - "fromRole":"Seller", - "toRoles":["Buyer"] - },{ - "type":"MessageTransfer", - "message":{ - "operator":"op5", - "types":["{http://scribble.org/example}M5"], - "values":[""] - }, - "fromRole":"Buyer", - "toRoles":["Seller"] - }], - "roles":[{ - "name":"Buyer", - "simulator":{ - "type":"MonitorRoleSimulator", - "module":"scribble.examples.Recursion", - "role":"Buyer", - "protocol":"First" - } - }] -} diff --git a/modules/trace/src/test/resources/scribble/examples/Recursion_Buyer.scr b/modules/trace/src/test/resources/scribble/examples/Recursion_Buyer.scr deleted file mode 100644 index 4e62a9b66..000000000 --- a/modules/trace/src/test/resources/scribble/examples/Recursion_Buyer.scr +++ /dev/null @@ -1,24 +0,0 @@ -module scribble.examples.Recursion; - -type "{http://scribble.org/example}M1" from "http://scribble.org/schema/Example.xsd" as M1; -type "{http://scribble.org/example}M2" from "http://scribble.org/schema/Example.xsd" as M2; -type "{http://scribble.org/example}M3" from "http://scribble.org/schema/Example.xsd" as M3; -type "{http://scribble.org/example}M4" from "http://scribble.org/schema/Example.xsd" as M4; -type "{http://scribble.org/example}M5" from "http://scribble.org/schema/Example.xsd" as M5; - -local protocol First at Buyer (role Buyer, role Seller) { - op1(M1) to Seller; - - rec MyLabel { - op2(M2) from Seller; - - choice at Seller { - op3(M3) from Seller; - continue MyLabel; - } or { - op4(M4) from Seller; - } - } - - op5(M5) to Seller; -} diff --git a/modules/trace/src/test/resources/scribble/examples/RequestResponse_Buyer-1.trace b/modules/trace/src/test/resources/scribble/examples/RequestResponse_Buyer-1.trace deleted file mode 100644 index 244cd7528..000000000 --- a/modules/trace/src/test/resources/scribble/examples/RequestResponse_Buyer-1.trace +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name":"RequestResponse@Buyer-1", - "steps":[{ - "type":"MessageTransfer", - "message":{ - "operator":"buy", - "types":["{http://scribble.org/example}OrderRequest"], - "values":[""] - }, - "fromRole":"Buyer", - "toRoles":["Seller"] - },{ - "type":"MessageTransfer", - "message":{ - "operator":"buy", - "types":["{http://scribble.org/example}OrderResponse"], - "values":[""] - }, - "fromRole":"Seller", - "toRoles":["Buyer"] - }], - "roles":[{ - "name":"Buyer", - "simulator":{ - "type":"MonitorRoleSimulator", - "module":"scribble.examples.RequestResponse", - "role":"Buyer", - "protocol":"First" - } - }] -} diff --git a/modules/trace/src/test/resources/scribble/examples/RequestResponse_Buyer-2.trace b/modules/trace/src/test/resources/scribble/examples/RequestResponse_Buyer-2.trace deleted file mode 100644 index df06cbe53..000000000 --- a/modules/trace/src/test/resources/scribble/examples/RequestResponse_Buyer-2.trace +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name":"RequestResponse@Buyer-2", - "steps":[{ - "type":"MessageTransfer", - "message":{ - "operator":"buy", - "types":["{http://scribble.org/example}OrderRequest"], - "values":[""] - }, - "fromRole":"Buyer", - "toRoles":["Seller"] - },{ - "type":"MessageTransfer", - "message":{ - "operator":"buy", - "types":["{http://scribble.org/example}OrderResponseInvalid"], - "values":[""] - }, - "fromRole":"Seller", - "toRoles":["Buyer"], - "succeeds":false - }], - "roles":[{ - "name":"Buyer", - "simulator":{ - "type":"MonitorRoleSimulator", - "module":"scribble.examples.RequestResponse", - "role":"Buyer", - "protocol":"First" - } - }] -} diff --git a/modules/trace/src/test/resources/scribble/examples/RequestResponse_Buyer-3.trace b/modules/trace/src/test/resources/scribble/examples/RequestResponse_Buyer-3.trace deleted file mode 100644 index afa2c744b..000000000 --- a/modules/trace/src/test/resources/scribble/examples/RequestResponse_Buyer-3.trace +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name":"RequestResponse@Buyer-3", - "steps":[{ - "type":"MessageTransfer", - "message":{ - "operator":"buy", - "types":["{http://scribble.org/example}OrderRequest"], - "values":[""] - }, - "fromRole":"Buyer", - "toRoles":["Seller"] - },{ - "type":"MessageTransfer", - "message":{ - "operator":"buy", - "types":["{http://scribble.org/example}OrderResponseInvalid"], - "values":[""] - }, - "fromRole":"Seller", - "toRoles":["Buyer"] - }], - "roles":[{ - "name":"Buyer", - "simulator":{ - "type":"MonitorRoleSimulator", - "module":"scribble.examples.RequestResponse", - "role":"Buyer", - "protocol":"First" - } - }] -} diff --git a/modules/trace/src/test/resources/scribble/examples/RequestResponse_Buyer.scr b/modules/trace/src/test/resources/scribble/examples/RequestResponse_Buyer.scr deleted file mode 100644 index fcde30739..000000000 --- a/modules/trace/src/test/resources/scribble/examples/RequestResponse_Buyer.scr +++ /dev/null @@ -1,9 +0,0 @@ -module scribble.examples.RequestResponse; - -type "{http://scribble.org/example}OrderRequest" from "http://scribble.org/schema/Example.xsd" as OrderRequest; -type "{http://scribble.org/example}OrderResponse" from "http://scribble.org/schema/Example.xsd" as OrderResponse; - -local protocol First at Buyer (role Buyer, role Seller) { - buy(OrderRequest) to Seller; - buy(OrderResponse) from Seller; -} \ No newline at end of file diff --git a/modules/validation/LICENSE.txt b/modules/validation/LICENSE.txt deleted file mode 100644 index 29f81d812..000000000 --- a/modules/validation/LICENSE.txt +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/modules/validation/build.properties b/modules/validation/build.properties deleted file mode 100644 index b844f8dbe..000000000 --- a/modules/validation/build.properties +++ /dev/null @@ -1,19 +0,0 @@ -source.. = src/main/java/,\ - target/generated-sources/antlr3/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - src/main/resources/lib/antlr-3.2.jar,\ - OSGI-INF/,\ - LICENSE.txt -src.includes = target/generated-sources/,\ - src/,\ - pom.xml,\ - build.properties,\ - META-INF/,\ - .project,\ - .classpath,\ - OSGI-INF/,\ - LICENSE.txt -jars.compile.order = .,\ - lib/antlr-3.2.jar diff --git a/modules/validation/pom.xml b/modules/validation/pom.xml deleted file mode 100644 index 5ffa5cb24..000000000 --- a/modules/validation/pom.xml +++ /dev/null @@ -1,28 +0,0 @@ - - 4.0.0 - scribble-validation - jar - 0.3.2-SNAPSHOT - Scribble::Modules::Validation - - - org.scribble - modules - 0.3.2-SNAPSHOT - - - - - org.scribble - scribble-core - ${project.version} - - - junit - junit - test - - - - diff --git a/modules/validation/src/main/java/org/scribble/validation/ProtocolValidator.java b/modules/validation/src/main/java/org/scribble/validation/ProtocolValidator.java deleted file mode 100644 index 663568eaa..000000000 --- a/modules/validation/src/main/java/org/scribble/validation/ProtocolValidator.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation; - -import org.scribble.context.ModuleContext; -import org.scribble.logging.IssueLogger; -import org.scribble.model.Module; -import org.scribble.validation.rules.ValidationRule; -import org.scribble.validation.rules.ValidationRuleFactory; - -/** - * This class is responsible for validating a protocol module. - * - */ -public class ProtocolValidator { - - /** - * This method validates the supplied module, reporting - * any issues to the logger. - * - * @param context The validation context - * @param module The module - * @param logger The logger - */ - public void validate(ModuleContext context, Module module, IssueLogger logger) { - - ValidationRule rule=ValidationRuleFactory.getValidationRule(module); - - if (rule != null) { - rule.validate(context, module, logger); - } - } -} diff --git a/modules/validation/src/main/java/org/scribble/validation/rules/GBlockValidationRule.java b/modules/validation/src/main/java/org/scribble/validation/rules/GBlockValidationRule.java deleted file mode 100644 index df408e2a0..000000000 --- a/modules/validation/src/main/java/org/scribble/validation/rules/GBlockValidationRule.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import org.scribble.context.ModuleContext; -import org.scribble.logging.IssueLogger; -import org.scribble.model.ModelObject; -import org.scribble.model.global.GActivity; -import org.scribble.model.global.GBlock; - -/** - * This class implements the validation rule for the GBlock - * component. - * - */ -public class GBlockValidationRule implements ValidationRule { - - /** - * {@inheritDoc} - */ - public void validate(ModuleContext context, ModelObject mobj, IssueLogger logger) { - GBlock elem=(GBlock)mobj; - - for (GActivity act : elem.getContents()) { - ValidationRule rule=ValidationRuleFactory.getValidationRule(act); - - if (rule != null) { - rule.validate(context, act, logger); - } - } - } - -} diff --git a/modules/validation/src/main/java/org/scribble/validation/rules/GChoiceValidationRule.java b/modules/validation/src/main/java/org/scribble/validation/rules/GChoiceValidationRule.java deleted file mode 100644 index 1d1716e2d..000000000 --- a/modules/validation/src/main/java/org/scribble/validation/rules/GChoiceValidationRule.java +++ /dev/null @@ -1,246 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import java.text.MessageFormat; - -import org.scribble.context.ModuleContext; -import org.scribble.logging.IssueLogger; -import org.scribble.model.ModelObject; -import org.scribble.model.Role; -import org.scribble.model.global.GActivity; -import org.scribble.model.global.GBlock; -import org.scribble.model.global.GChoice; -import org.scribble.model.global.GMessageTransfer; -import org.scribble.model.global.GMultiPathActivity; -import org.scribble.model.global.GProtocolDefinition; -import org.scribble.model.global.GSinglePathActivity; - -/** - * This class implements the validation rule for the GChoice - * component. - * - */ -public class GChoiceValidationRule implements ValidationRule { - - /** - * {@inheritDoc} - */ - public void validate(ModuleContext context, ModelObject mobj, IssueLogger logger) { - GChoice elem=(GChoice)mobj; - - // Check if decision role has been declared - if (elem.getRole() != null) { - GProtocolDefinition gpd=elem.getParent(GProtocolDefinition.class); - - if (gpd.getRoleDeclaration(elem.getRole().getName()) == null) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("UNKNOWN_ROLE"), - elem.getRole().getName()), elem.getRole()); - } - } else { - logger.error(ValidationMessages.getMessage("UNDEFINED_ROLE"), elem); - } - - // TODO: Should the number of choice paths be validated? - - // TODO: Need to check each path to ensure that the 'decision is communicated - // to each receiving role' - - java.util.Set roles=null; - - for (GBlock subelem : elem.getPaths()) { - ValidationRule rule=ValidationRuleFactory.getValidationRule(subelem); - - if (rule != null) { - rule.validate(context, subelem, logger); - } - - // Check role set for block is same as others - java.util.Set subroles=new java.util.HashSet(); - - subelem.identifyInvolvedRoles(subroles); - - if (roles == null) { - roles = subroles; - } else { - // Check list of roles is the same - if (!roles.equals(subroles)) { - logger.error(ValidationMessages.getMessage("ROLES_MISMATCH"), elem.getRole()); - } - } - } - - if (roles != null) { - // Wellformedness - Check each path has an initial message receiver for each non-choice role, - // before the roles are used in any other activity - java.util.Set otherRoles=new java.util.HashSet(roles); - - // Remove choice role - otherRoles.remove(elem.getRole()); - - for (GBlock block : elem.getPaths()) { - checkReceiverBeforeOtherActivity(context, block, - new java.util.HashSet(otherRoles), logger); - } - - // Check that initial message receivers for each 'other role' are distinct - // in each path - check both operators and signatures - java.util.Map> ops=new java.util.HashMap>(); - java.util.Map> sigs=new java.util.HashMap>(); - - for (GBlock block : elem.getPaths()) { - checkReceiverOpSigDistinct(context, block, - new java.util.HashSet(otherRoles), ops, sigs, logger); - } - } - } - - /** - * This method checks that the first activity for a role is a message transfer where the - * role is the receiver. - * - * @param context The context - * @param block The block - * @param roles The roles to check - * @param logger The logger - */ - protected void checkReceiverBeforeOtherActivity(ModuleContext context, GBlock block, - java.util.Set roles, IssueLogger logger) { - for (GActivity act : block.getContents()) { - - if (act instanceof GMessageTransfer) { - roles.removeAll(((GMessageTransfer)act).getToRoles()); - - if (roles.contains(((GMessageTransfer)act).getFromRole())) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("ROLE_NOT_RECEIVER"), - ((GMessageTransfer)act).getFromRole().getName()), act); - - roles.remove(((GMessageTransfer)act).getFromRole()); - } - - } else if (act instanceof GChoice) { - // Check if target role is in the list - if (roles.contains(((GChoice)act).getRole())) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("ROLE_NOT_RECEIVER"), - ((GChoice)act).getRole().getName()), act); - - roles.remove(((GChoice)act).getRole()); - } - - for (GBlock b : ((GChoice)act).getPaths()) { - checkReceiverBeforeOtherActivity(context, b, - new java.util.HashSet(roles), logger); - } - } else if (act instanceof GMultiPathActivity) { - for (GBlock b : ((GMultiPathActivity)act).getPaths()) { - checkReceiverBeforeOtherActivity(context, b, - new java.util.HashSet(roles), logger); - } - - } else if (act instanceof GSinglePathActivity) { - checkReceiverBeforeOtherActivity(context, ((GSinglePathActivity)act).getBlock(), - roles, logger); - - } else { - java.util.Set involved=new java.util.HashSet(); - - act.identifyInvolvedRoles(involved); - - for (Role r : involved) { - if (roles.contains(r)) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("ROLE_NOT_RECEIVER"), - r.getName()), act); - - roles.remove(r); - } - } - } - } - } - /** - * This method checks that the initial receiver for each non-choice role has a distinct operator - * or signature. - * - * @param context The context - * @param block The block - * @param roles The roles to check - * @param logger The logger - */ - protected void checkReceiverOpSigDistinct(ModuleContext context, GBlock block, - java.util.Set roles, java.util.Map> operators, - java.util.Map> signatures, IssueLogger logger) { - for (int i=0; roles.size() > 0 && i < block.getContents().size(); i++) { - GActivity act=block.getContents().get(i); - - if (act instanceof GMessageTransfer) { - - for (Role r : ((GMessageTransfer)act).getToRoles()) { - if (roles.contains(r)) { - GMessageTransfer mt=(GMessageTransfer)act; - - if (mt.getMessage() == null) { - continue; - } - - if (mt.getMessage().getMessageSignature() != null && - mt.getMessage().getMessageSignature().getOperator() != null) { - java.util.Set ops=operators.get(r); - - if (ops == null) { - ops = new java.util.HashSet(); - operators.put(r, ops); - } - - if (ops.contains(mt.getMessage().getMessageSignature().getOperator())) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("ROLE_OPERATOR_NOT_DISTINCT"), - mt.getMessage().getMessageSignature().getOperator(), r.getName()), act); - } - - ops.add(mt.getMessage().getMessageSignature().getOperator()); - } else if (mt.getMessage().getParameter() != null) { - java.util.Set sigs=signatures.get(r); - - if (sigs == null) { - sigs = new java.util.HashSet(); - signatures.put(r, sigs); - } - - if (sigs.contains(mt.getMessage().getParameter())) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("ROLE_SIGNATURE_NOT_DISTINCT"), - mt.getMessage().getParameter(), r.getName()), act); - } - - sigs.add(mt.getMessage().getParameter()); - } - - roles.remove(r); - } - } - - } else if (act instanceof GMultiPathActivity) { - for (GBlock b : ((GMultiPathActivity)act).getPaths()) { - checkReceiverOpSigDistinct(context, b, - new java.util.HashSet(roles), operators, signatures, logger); - } - - } else if (act instanceof GSinglePathActivity) { - checkReceiverOpSigDistinct(context, ((GSinglePathActivity)act).getBlock(), - roles, operators, signatures, logger); - } - } - } -} diff --git a/modules/validation/src/main/java/org/scribble/validation/rules/GContinueValidationRule.java b/modules/validation/src/main/java/org/scribble/validation/rules/GContinueValidationRule.java deleted file mode 100644 index b243e360d..000000000 --- a/modules/validation/src/main/java/org/scribble/validation/rules/GContinueValidationRule.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import java.text.MessageFormat; - -import org.scribble.context.ModuleContext; -import org.scribble.logging.IssueLogger; -import org.scribble.model.ModelObject; -import org.scribble.model.global.GContinue; -import org.scribble.model.global.GInterruptible; -import org.scribble.model.global.GParallel; -import org.scribble.model.global.GProtocolDefinition; -import org.scribble.model.global.GRecursion; - -/** - * This class implements the validation rule for the GContinue - * component. - * - */ -public class GContinueValidationRule implements ValidationRule { - - /** - * {@inheritDoc} - */ - public void validate(ModuleContext context, ModelObject mobj, IssueLogger logger) { - GContinue elem=(GContinue)mobj; - - if (elem.getLabel() == null) { - logger.error(ValidationMessages.getMessage("LABEL_NOT_DEFINED"), elem); - return; - } - - ModelObject act=elem; - - do { - act = act.getParent(); - - if (act instanceof GProtocolDefinition || act == null) { - // Continue label not bound - logger.error(MessageFormat.format(ValidationMessages.getMessage("LABEL_NOT_BOUND"), - elem.getLabel()), elem); - - break; - - } else if (act instanceof GParallel) { - // Continue cannot be contained within a parallel - logger.error(ValidationMessages.getMessage("LABEL_CONTAINED_IN_PARALLEL"), elem); - - break; - - } else if (act instanceof GInterruptible) { - // Continue cannot be contained within an interruptible - logger.error(ValidationMessages.getMessage("LABEL_CONTAINED_IN_INTERRUPTIBLE"), elem); - - break; - } else if (act instanceof GRecursion && - elem.getLabel().equals(((GRecursion)act).getLabel())) { - break; - } - } while (true); - } - -} diff --git a/modules/validation/src/main/java/org/scribble/validation/rules/GDoValidationRule.java b/modules/validation/src/main/java/org/scribble/validation/rules/GDoValidationRule.java deleted file mode 100644 index 94b844c07..000000000 --- a/modules/validation/src/main/java/org/scribble/validation/rules/GDoValidationRule.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import java.text.MessageFormat; - -import org.scribble.context.ModuleContext; -import org.scribble.logging.IssueLogger; -import org.scribble.model.ModelObject; -import org.scribble.model.global.GDo; -import org.scribble.model.global.GProtocolDefinition; -import org.scribble.model.global.GProtocolInstance; - -/** - * This class implements the validation rule for the GDo - * component. - * - */ -public class GDoValidationRule implements ValidationRule { - - /** - * {@inheritDoc} - */ - public void validate(ModuleContext context, ModelObject mobj, IssueLogger logger) { - GDo elem=(GDo)mobj; - - // Check if protocol has been declared - if (elem.getProtocol() != null) { - - // TODO: Need to sort out locating protocol in the current module, or - // will this be done via the context as well? - - // TODO: Need to register module aliases, so that a search for a module - // based on the alias will also find the member - - ModelObject mo=context.getMember(elem.getProtocol()); - - if (mo == null || ((mo instanceof GProtocolDefinition) == false && - (mo instanceof GProtocolInstance) == false)) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("UNKNOWN_PROTOCOL"), - elem.getProtocol()), elem); - } else { - - // TODO: Verify the args and role instantiations - } - } - } - -} diff --git a/modules/validation/src/main/java/org/scribble/validation/rules/GInterruptibleValidationRule.java b/modules/validation/src/main/java/org/scribble/validation/rules/GInterruptibleValidationRule.java deleted file mode 100644 index ac3cf70a5..000000000 --- a/modules/validation/src/main/java/org/scribble/validation/rules/GInterruptibleValidationRule.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import java.text.MessageFormat; - -import org.scribble.context.ModuleContext; -import org.scribble.logging.IssueLogger; -import org.scribble.model.Message; -import org.scribble.model.ModelObject; -import org.scribble.model.ProtocolDecl; -import org.scribble.model.global.GInterruptible; -import org.scribble.model.global.GInterruptible.Interrupt; - -/** - * This class implements the validation rule for the GInterruptible - * component. - * - */ -public class GInterruptibleValidationRule implements ValidationRule { - - /** - * {@inheritDoc} - */ - public void validate(ModuleContext context, ModelObject mobj, IssueLogger logger) { - GInterruptible elem=(GInterruptible)mobj; - - ProtocolDecl pd=elem.getParent(ProtocolDecl.class); - - for (Interrupt in : elem.getInterrupts()) { - - // Validate messages - for (Message m : in.getMessages()) { - ValidationRule rule=ValidationRuleFactory.getValidationRule(m); - - if (rule != null) { - rule.validate(context, m, logger); - } - } - - // Validate role - if (pd != null && in.getRole() != null - && pd.getRoleDeclaration(in.getRole().getName()) == null) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("UNKNOWN_ROLE"), - in.getRole().getName()), in.getRole()); - } - - // TODO: Wellformedness - check operator/sig parameter is not used in block (need to - // clarify whether in general or just for specific roles) - } - - if (elem.getBlock() != null) { - ValidationRule rule=ValidationRuleFactory.getValidationRule(elem.getBlock()); - - if (rule != null) { - rule.validate(context, elem.getBlock(), logger); - } - } - } - -} diff --git a/modules/validation/src/main/java/org/scribble/validation/rules/GMessageTransferValidationRule.java b/modules/validation/src/main/java/org/scribble/validation/rules/GMessageTransferValidationRule.java deleted file mode 100644 index 4de1b9561..000000000 --- a/modules/validation/src/main/java/org/scribble/validation/rules/GMessageTransferValidationRule.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import java.text.MessageFormat; - -import org.scribble.context.ModuleContext; -import org.scribble.logging.IssueLogger; -import org.scribble.model.ModelObject; -import org.scribble.model.ProtocolDecl; -import org.scribble.model.Role; -import org.scribble.model.global.GMessageTransfer; - -/** - * This class implements the validation rule for the GMessage - * component. - * - */ -public class GMessageTransferValidationRule implements ValidationRule { - - /** - * {@inheritDoc} - */ - public void validate(ModuleContext context, ModelObject mobj, IssueLogger logger) { - GMessageTransfer elem=(GMessageTransfer)mobj; - - // Validate message - if (elem.getMessage() != null) { - ValidationRule rule=ValidationRuleFactory.getValidationRule(elem.getMessage()); - - if (rule != null) { - rule.validate(context, elem.getMessage(), logger); - } - } - - ProtocolDecl pd=elem.getParent(ProtocolDecl.class); - - if (pd != null) { - // Validate roles - if (elem.getFromRole() != null) { - - if (pd.getRoleDeclaration(elem.getFromRole().getName()) == null) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("UNKNOWN_ROLE"), - elem.getFromRole().getName()), elem.getFromRole()); - } - } - - java.util.List toRoles=new java.util.ArrayList(); - - for (Role r : elem.getToRoles()) { - if (toRoles.contains(r.getName())) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("ROLE_NOT_DISTINCT"), - r.getName()), elem); - } else { - toRoles.add(r.getName()); - } - - if (pd.getRoleDeclaration(r.getName()) == null) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("UNKNOWN_ROLE"), - r.getName()), r); - } - } - } - } - -} diff --git a/modules/validation/src/main/java/org/scribble/validation/rules/GParallelValidationRule.java b/modules/validation/src/main/java/org/scribble/validation/rules/GParallelValidationRule.java deleted file mode 100644 index 6ed9d096a..000000000 --- a/modules/validation/src/main/java/org/scribble/validation/rules/GParallelValidationRule.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import java.text.MessageFormat; -import java.util.Collections; - -import org.scribble.context.ModuleContext; -import org.scribble.logging.IssueLogger; -import org.scribble.model.ModelObject; -import org.scribble.model.global.DefaultGVisitor; -import org.scribble.model.global.GBlock; -import org.scribble.model.global.GMessageTransfer; -import org.scribble.model.global.GParallel; - -/** - * This class implements the validation rule for the GParallel - * component. - * - */ -public class GParallelValidationRule implements ValidationRule { - - /** - * {@inheritDoc} - */ - public void validate(ModuleContext context, ModelObject mobj, IssueLogger logger) { - GParallel elem=(GParallel)mobj; - - java.util.List mts=new java.util.ArrayList(); - - for (GBlock subelem : elem.getPaths()) { - ValidationRule rule=ValidationRuleFactory.getValidationRule(subelem); - - if (rule != null) { - rule.validate(context, subelem, logger); - } - - // Build up list of message transfers in this path - // NOTE: This only checks for message transfers contained in this path, - // and therefore would not deal with message transfers in an invoked protocol - final java.util.List pathMTs=new java.util.ArrayList(); - - subelem.visit(new DefaultGVisitor() { - - /** - * {@inheritDoc} - */ - public void accept(GMessageTransfer elem) { - if (!pathMTs.contains(elem)) { - pathMTs.add(elem); - } - } - }); - - // Check for overlap with previously discovered message transfers - if (!Collections.disjoint(pathMTs, mts)) { - - for (GMessageTransfer mt : pathMTs) { - if (mts.contains(mt)) { - // Report message transfer in multiple concurrent paths - logger.error(MessageFormat.format(ValidationMessages.getMessage("INTERACTION_IN_CONCURRENT_PATHS"), - mt), elem); - } - } - } - - mts.addAll(pathMTs); - } - } - -} diff --git a/modules/validation/src/main/java/org/scribble/validation/rules/GProtocolDefinitionValidationRule.java b/modules/validation/src/main/java/org/scribble/validation/rules/GProtocolDefinitionValidationRule.java deleted file mode 100644 index 5b2fb7197..000000000 --- a/modules/validation/src/main/java/org/scribble/validation/rules/GProtocolDefinitionValidationRule.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import java.text.MessageFormat; - -import org.scribble.context.ModuleContext; -import org.scribble.logging.IssueLogger; -import org.scribble.model.ImportDecl; -import org.scribble.model.ModelObject; -import org.scribble.model.ParameterDecl; -import org.scribble.model.PayloadElement; -import org.scribble.model.PayloadTypeDecl; -import org.scribble.model.RoleDecl; -import org.scribble.model.global.DefaultGVisitor; -import org.scribble.model.global.GDo; -import org.scribble.model.global.GInterruptible; -import org.scribble.model.global.GMessageTransfer; -import org.scribble.model.global.GProtocolDefinition; - -/** - * This class implements the validation rule for the GProtocolDefinition - * component. - * - */ -public class GProtocolDefinitionValidationRule implements ValidationRule { - - /** - * {@inheritDoc} - */ - public void validate(ModuleContext context, final ModelObject mobj, final IssueLogger logger) { - GProtocolDefinition elem=(GProtocolDefinition)mobj; - - // Wellformedness - check role declaration names are distinct - java.util.List roleNames=new java.util.ArrayList(); - - for (RoleDecl rd : elem.getRoleDeclarations()) { - String roleName=rd.getDeclarationName(); - - if (roleNames.contains(roleName)) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("ROLE_NAME_NOT_DISTINCT"), - roleName), mobj); - } else { - roleNames.add(roleName); - } - } - - // Wellformedness - check parameter declaration names are distinct - java.util.List paramNames=new java.util.ArrayList(); - - for (PayloadTypeDecl ptd : elem.getModule().getPayloadTypeDeclarations()) { - paramNames.add(ptd.getAlias()); - } - - for (ImportDecl imp : elem.getModule().getImports()) { - paramNames.add(imp.getDeclarationName()); - } - - for (ParameterDecl pd : elem.getParameterDeclarations()) { - String paramName=pd.getDeclarationName(); - - if (paramNames.contains(paramName)) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("PARAMETER_NAME_NOT_DISTINCT"), - paramName), mobj); - } else { - paramNames.add(paramName); - } - } - - // Wellformedness - check scope names are distinct - final java.util.List scopeNames=new java.util.ArrayList(); - - elem.getBlock().visit(new DefaultGVisitor() { - - public boolean start(GInterruptible elem) { - verifyScope(elem.getScope()); - return (true); - } - - public void accept(GDo elem) { - verifyScope(elem.getScope()); - } - - protected void verifyScope(String scope) { - if (scope != null) { - if (scopeNames.contains(scope)) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("SCOPE_NOT_DISTINCT"), - scope), mobj); - } else { - scopeNames.add(scope); - } - } - } - }); - - // Wellformedness - check annotation names are distinct - final java.util.List annotationNames=new java.util.ArrayList(); - - elem.getBlock().visit(new DefaultGVisitor() { - - public void accept(GMessageTransfer elem) { - if (elem.getMessage().getMessageSignature() != null) { - for (PayloadElement pe : elem.getMessage().getMessageSignature().getPayloadElements()) { - if (pe.getAnnotation() != null) { - if (annotationNames.contains(pe.getAnnotation())) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("ANNOTATION_NOT_DISTINCT"), - pe.getAnnotation()), mobj); - } else { - annotationNames.add(pe.getAnnotation()); - } - } - } - } - } - }); - - // Validate the block - if (elem.getBlock() != null) { - ValidationRule rule=ValidationRuleFactory.getValidationRule(elem.getBlock()); - - if (rule != null) { - rule.validate(context, elem.getBlock(), logger); - } - } - } - -} diff --git a/modules/validation/src/main/java/org/scribble/validation/rules/GProtocolInstanceValidationRule.java b/modules/validation/src/main/java/org/scribble/validation/rules/GProtocolInstanceValidationRule.java deleted file mode 100644 index 8dc9e884a..000000000 --- a/modules/validation/src/main/java/org/scribble/validation/rules/GProtocolInstanceValidationRule.java +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import java.text.MessageFormat; - -import org.scribble.context.ModuleContext; -import org.scribble.logging.IssueLogger; -import org.scribble.model.Argument; -import org.scribble.model.ModelObject; -import org.scribble.model.Module; -import org.scribble.model.PayloadTypeDecl; -import org.scribble.model.RoleInstantiation; -import org.scribble.model.global.GProtocolDefinition; -import org.scribble.model.global.GProtocolInstance; - -/** - * This class implements the validation rule for the GProtocolInstance - * component. - * - */ -public class GProtocolInstanceValidationRule implements ValidationRule { - - /** - * {@inheritDoc} - */ - public void validate(ModuleContext context, ModelObject mobj, IssueLogger logger) { - GProtocolInstance elem=(GProtocolInstance)mobj; - - if (elem.getMemberName() != null) { - ModelObject refd=context.getMember(elem.getMemberName()); - - if (refd == null) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("UNKNOWN_MEMBER_NAME"), - elem.getMemberName()), elem); - } else if (!(refd instanceof GProtocolDefinition)) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("MEMBER_NOT_PROTOCOL_DEFINITION"), - elem.getMemberName()), elem); - } else { - GProtocolDefinition pd=(GProtocolDefinition)refd; - - // Verify argument list - if (pd.getParameterDeclarations().size() != elem.getArguments().size()) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("ARG_NUM_MISMATCH"), - elem.getArguments().size(), pd.getParameterDeclarations().size()), elem); - } - - for (Argument arg : elem.getArguments()) { - - // TODO: Rules for arg list wellformedness are not clear - especially - // the inner bullet points referring to corresponding element, however what - // if alias (parameter position) is provided, then it is not clear how - // this impacts the 'corresponding element'?? - - if (arg.getMessageSignature() != null) { - - // Verify message signature is well formed - ValidationRule rule=ValidationRuleFactory.getValidationRule(arg.getMessageSignature()); - - if (rule != null) { - rule.validate(context, arg.getMessageSignature(), logger); - } - - } else if (arg.getName() != null) { - // Check if argument name has been declared on the protocol instance as - // a parameter, or it refers to a payload type name - Module m=elem.getModule(); - PayloadTypeDecl ptd=null; - - if (m != null) { - ptd = m.getTypeDeclaration(arg.getName()); - } - - if (ptd == null) { - ModelObject impmem=context.getMember(arg.getName()); - - if (impmem instanceof PayloadTypeDecl) { - ptd = (PayloadTypeDecl)impmem; - } - } - - if (ptd == null) { - - if (elem.getParameterDeclaration(arg.getName()) == null) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("ARG_NOT_DECLARED"), - arg.getName()), elem); - } - } else { - - } - } - - if (arg.getAlias() != null) { - // Check that target protocol declaration has a parameter name matching - // the alias - if (pd.getParameterDeclaration(arg.getAlias()) == null) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("ARG_ALIAS_NOT_DECLARED"), - arg.getAlias()), elem); - } - } - } - - // Verify role instantiations list - - // Check number of role instantiations matches the number of roles declared in the - // target protocol declaration - if (pd.getRoleDeclarations().size() != elem.getRoleInstantiations().size()) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("ROLE_NUM_MISMATCH"), - elem.getRoleInstantiations().size(), pd.getRoleDeclarations().size()), elem); - } - - // Check that the roles defined in the instantiation exist in the declaration - java.util.List roleNames=new java.util.ArrayList(); - - for (RoleInstantiation ri : elem.getRoleInstantiations()) { - if (ri.getName() != null) { - // Check if instantiated role name has been declared on the protocol instance - if (elem.getRoleDeclaration(ri.getName()) == null) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("ROLE_NOT_DECLARED"), - ri.getName()), elem); - } - - // Wellformedness - check that role name is distinct - if (roleNames.contains(ri.getName())) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("ROLE_NOT_DISTINCT"), - ri.getName()), elem); - } else { - roleNames.add(ri.getName()); - } - } - if (ri.getAlias() != null) { - if (pd.getRoleDeclaration(ri.getAlias()) == null) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("ROLE_ALIAS_NOT_DECLARED"), - ri.getAlias()), elem); - } - } - } - } - } - } - -} diff --git a/modules/validation/src/main/java/org/scribble/validation/rules/GRecursionValidationRule.java b/modules/validation/src/main/java/org/scribble/validation/rules/GRecursionValidationRule.java deleted file mode 100644 index f5d742995..000000000 --- a/modules/validation/src/main/java/org/scribble/validation/rules/GRecursionValidationRule.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import java.text.MessageFormat; - -import org.scribble.context.ModuleContext; -import org.scribble.logging.IssueLogger; -import org.scribble.model.ModelObject; -import org.scribble.model.global.DefaultGVisitor; -import org.scribble.model.global.GProtocolDefinition; -import org.scribble.model.global.GRecursion; - -/** - * This class implements the validation rule for the GRecursion - * component. - * - */ -public class GRecursionValidationRule implements ValidationRule { - - /** - * {@inheritDoc} - */ - public void validate(ModuleContext context, ModelObject mobj, final IssueLogger logger) { - final GRecursion elem=(GRecursion)mobj; - - // Check that bound label is unique - GProtocolDefinition gpd=elem.getParent(GProtocolDefinition.class); - - if (gpd != null && elem.getLabel() != null) { - final java.util.Set labels=new java.util.HashSet(); - labels.add(elem.getLabel()); - - gpd.visit(new DefaultGVisitor() { - public boolean start(GRecursion rec) { - if (elem != rec) { - if (rec.getLabel() != null) { - if (labels.contains(rec.getLabel())) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("LABEL_NOT_UNIQUE"), - rec.getLabel()), elem); - } - labels.add(rec.getLabel()); - } - } - return (true); - } - }); - } - - if (elem.getBlock() != null) { - ValidationRule rule=ValidationRuleFactory.getValidationRule(elem.getBlock()); - - if (rule != null) { - rule.validate(context, elem.getBlock(), logger); - } - } - } - -} diff --git a/modules/validation/src/main/java/org/scribble/validation/rules/ImportDeclValidationRule.java b/modules/validation/src/main/java/org/scribble/validation/rules/ImportDeclValidationRule.java deleted file mode 100644 index d18de6dba..000000000 --- a/modules/validation/src/main/java/org/scribble/validation/rules/ImportDeclValidationRule.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import java.text.MessageFormat; - -import org.scribble.context.ModuleContext; -import org.scribble.logging.IssueLogger; -import org.scribble.model.ImportDecl; -import org.scribble.model.ModelObject; -import org.scribble.model.Module; - -/** - * This class implements the validation rule for the ImportDecl - * component. - * - */ -public class ImportDeclValidationRule implements ValidationRule { - - /** - * {@inheritDoc} - */ - public void validate(ModuleContext context, ModelObject mobj, IssueLogger logger) { - ImportDecl elem=(ImportDecl)mobj; - - if (elem.getModuleName() != null) { - - // Load imported module - Module importedModule=context.importModule(elem.getModuleName()); - - // Wellformedness - check module can be found - if (importedModule == null) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("NOT_FOUND_MODULE"), - elem.getModuleName()), elem); - } else if (elem.getMemberName() != null) { - - // Check if member within module has been specified - // Wellformedness - check member is found in module - ModelObject imported=context.getMember(elem.getModuleName(), - elem.getMemberName()); - - if (imported == null) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("NOT_FOUND_MEMBER"), - elem.getMemberName(), elem.getModuleName()), elem); - - } else if (elem.getAlias() != null && - context.getMember(elem.getAlias()) != imported) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("EXISTS_ALIAS"), - elem.getAlias()), elem); - } - } - } else { - logger.error(ValidationMessages.getMessage("NO_MODULE"), elem); - } - } - -} diff --git a/modules/validation/src/main/java/org/scribble/validation/rules/LBlockValidationRule.java b/modules/validation/src/main/java/org/scribble/validation/rules/LBlockValidationRule.java deleted file mode 100644 index aac7a425b..000000000 --- a/modules/validation/src/main/java/org/scribble/validation/rules/LBlockValidationRule.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import org.scribble.context.ModuleContext; -import org.scribble.logging.IssueLogger; -import org.scribble.model.ModelObject; -import org.scribble.model.local.LActivity; -import org.scribble.model.local.LBlock; - -/** - * This class implements the validation rule for the LBlock - * component. - * - */ -public class LBlockValidationRule implements ValidationRule { - - /** - * {@inheritDoc} - */ - public void validate(ModuleContext context, ModelObject mobj, IssueLogger logger) { - LBlock elem=(LBlock)mobj; - - for (LActivity act : elem.getContents()) { - ValidationRule rule=ValidationRuleFactory.getValidationRule(act); - - if (rule != null) { - rule.validate(context, act, logger); - } - } - } - -} diff --git a/modules/validation/src/main/java/org/scribble/validation/rules/LChoiceValidationRule.java b/modules/validation/src/main/java/org/scribble/validation/rules/LChoiceValidationRule.java deleted file mode 100644 index 76548dd08..000000000 --- a/modules/validation/src/main/java/org/scribble/validation/rules/LChoiceValidationRule.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import java.text.MessageFormat; - -import org.scribble.context.ModuleContext; -import org.scribble.logging.IssueLogger; -import org.scribble.model.ModelObject; -import org.scribble.model.ProtocolDecl; -import org.scribble.model.local.LBlock; -import org.scribble.model.local.LChoice; - -/** - * This class implements the validation rule for the LChoice - * component. - * - */ -public class LChoiceValidationRule implements ValidationRule { - - /** - * {@inheritDoc} - */ - public void validate(ModuleContext context, ModelObject mobj, IssueLogger logger) { - LChoice elem=(LChoice)mobj; - - // Check if decision role has been declared - if (elem.getRole() != null) { - ProtocolDecl pd=elem.getParent(ProtocolDecl.class); - - if (pd.getRoleDeclaration(elem.getRole().getName()) == null) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("UNKNOWN_ROLE"), - elem.getRole().getName()), elem.getRole()); - } - } else { - logger.error(ValidationMessages.getMessage("UNDEFINED_ROLE"), elem); - } - - // TODO: Should the number of choice paths be validated? - - // TODO: Need to check each path to ensure that the 'decision is communicated - // to each receiving role' - - for (LBlock subelem : elem.getPaths()) { - ValidationRule rule=ValidationRuleFactory.getValidationRule(subelem); - - if (rule != null) { - rule.validate(context, subelem, logger); - } - } - } - -} diff --git a/modules/validation/src/main/java/org/scribble/validation/rules/LDoValidationRule.java b/modules/validation/src/main/java/org/scribble/validation/rules/LDoValidationRule.java deleted file mode 100644 index feb2fd9ed..000000000 --- a/modules/validation/src/main/java/org/scribble/validation/rules/LDoValidationRule.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import java.text.MessageFormat; - -import org.scribble.context.ModuleContext; -import org.scribble.logging.IssueLogger; -import org.scribble.model.ModelObject; -import org.scribble.model.local.LDo; -import org.scribble.model.local.LProtocolDefinition; -import org.scribble.model.local.LProtocolInstance; - -/** - * This class implements the validation rule for the LDo - * component. - * - */ -public class LDoValidationRule implements ValidationRule { - - /** - * {@inheritDoc} - */ - public void validate(ModuleContext context, ModelObject mobj, IssueLogger logger) { - LDo elem=(LDo)mobj; - - // Check if protocol has been declared - if (elem.getProtocol() != null) { - ModelObject mo=context.getMember(elem.getProtocol()); - - if (mo == null || ((mo instanceof LProtocolDefinition) == false && - (mo instanceof LProtocolInstance) == false)) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("UNKNOWN_PROTOCOL"), - elem.getProtocol()), elem); - } else { - // TODO: Verify the args and role instantiations - } - } - } - -} diff --git a/modules/validation/src/main/java/org/scribble/validation/rules/LInterruptibleValidationRule.java b/modules/validation/src/main/java/org/scribble/validation/rules/LInterruptibleValidationRule.java deleted file mode 100644 index d448ca864..000000000 --- a/modules/validation/src/main/java/org/scribble/validation/rules/LInterruptibleValidationRule.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import java.text.MessageFormat; - -import org.scribble.context.ModuleContext; -import org.scribble.logging.IssueLogger; -import org.scribble.model.Message; -import org.scribble.model.ModelObject; -import org.scribble.model.ProtocolDecl; -import org.scribble.model.Role; -import org.scribble.model.local.LInterruptible; -import org.scribble.model.local.LInterruptible.Catch; - -/** - * This class implements the validation rule for the LInterruptible - * component. - * - */ -public class LInterruptibleValidationRule implements ValidationRule { - - /** - * {@inheritDoc} - */ - public void validate(ModuleContext context, ModelObject mobj, IssueLogger logger) { - LInterruptible elem=(LInterruptible)mobj; - - ProtocolDecl pd=elem.getParent(ProtocolDecl.class); - - MessageValidationRule mvr=new MessageValidationRule(); - - if (elem.getThrows() != null) { - - // Validate messages - for (Message m : elem.getThrows().getMessages()) { - mvr.validate(context, m, logger); - } - - // Validate roles - if (pd != null) { - for (Role r : elem.getThrows().getToRoles()) { - if (pd.getRoleDeclaration(r.getName()) == null) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("UNKNOWN_ROLE"), - r.getName()), r); - } - } - } - } - - for (Catch cat : elem.getCatches()) { - - // Validate messages - for (Message m : cat.getMessages()) { - mvr.validate(context, m, logger); - } - - // Validate role - if (pd != null && cat.getRole() != null - && pd.getRoleDeclaration(cat.getRole().getName()) == null) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("UNKNOWN_ROLE"), - cat.getRole().getName()), cat.getRole()); - } - } - - if (elem.getBlock() != null) { - ValidationRule rule=ValidationRuleFactory.getValidationRule(elem.getBlock()); - - if (rule != null) { - rule.validate(context, elem.getBlock(), logger); - } - } - } - -} diff --git a/modules/validation/src/main/java/org/scribble/validation/rules/LParallelValidationRule.java b/modules/validation/src/main/java/org/scribble/validation/rules/LParallelValidationRule.java deleted file mode 100644 index 002ba74dd..000000000 --- a/modules/validation/src/main/java/org/scribble/validation/rules/LParallelValidationRule.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import org.scribble.context.ModuleContext; -import org.scribble.logging.IssueLogger; -import org.scribble.model.ModelObject; -import org.scribble.model.local.LBlock; -import org.scribble.model.local.LParallel; - -/** - * This class implements the validation rule for the LParallel - * component. - * - */ -public class LParallelValidationRule implements ValidationRule { - - /** - * {@inheritDoc} - */ - public void validate(ModuleContext context, ModelObject mobj, IssueLogger logger) { - LParallel elem=(LParallel)mobj; - - for (LBlock subelem : elem.getPaths()) { - ValidationRule rule=ValidationRuleFactory.getValidationRule(subelem); - - if (rule != null) { - rule.validate(context, subelem, logger); - } - } - } - -} diff --git a/modules/validation/src/main/java/org/scribble/validation/rules/LProtocolDefinitionValidationRule.java b/modules/validation/src/main/java/org/scribble/validation/rules/LProtocolDefinitionValidationRule.java deleted file mode 100644 index 1e1a601ea..000000000 --- a/modules/validation/src/main/java/org/scribble/validation/rules/LProtocolDefinitionValidationRule.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import java.text.MessageFormat; - -import org.scribble.context.ModuleContext; -import org.scribble.logging.IssueLogger; -import org.scribble.model.ModelObject; -import org.scribble.model.local.LProtocolDefinition; - -/** - * This class implements the validation rule for the LProtocolDefinition - * component. - * - */ -public class LProtocolDefinitionValidationRule implements ValidationRule { - - /** - * {@inheritDoc} - */ - public void validate(ModuleContext context, ModelObject mobj, IssueLogger logger) { - LProtocolDefinition elem=(LProtocolDefinition)mobj; - - if (elem.getLocalRole() != null) { - // Check that local role is explicitly listed in the role declaration list - - if (elem.getRoleDeclaration(elem.getLocalRole().getName()) == null) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("LOCAL_ROLE_NOT_DECLARED"), - elem.getLocalRole().getName()), elem); - } - } - - if (elem.getBlock() != null) { - ValidationRule rule=ValidationRuleFactory.getValidationRule(elem.getBlock()); - - if (rule != null) { - rule.validate(context, elem.getBlock(), logger); - } - } - } - -} diff --git a/modules/validation/src/main/java/org/scribble/validation/rules/LProtocolInstanceValidationRule.java b/modules/validation/src/main/java/org/scribble/validation/rules/LProtocolInstanceValidationRule.java deleted file mode 100644 index 136b5ae0f..000000000 --- a/modules/validation/src/main/java/org/scribble/validation/rules/LProtocolInstanceValidationRule.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import java.text.MessageFormat; - -import org.scribble.context.ModuleContext; -import org.scribble.logging.IssueLogger; -import org.scribble.model.Argument; -import org.scribble.model.ModelObject; -import org.scribble.model.Module; -import org.scribble.model.PayloadTypeDecl; -import org.scribble.model.RoleInstantiation; -import org.scribble.model.local.LProtocolDefinition; -import org.scribble.model.local.LProtocolInstance; - -/** - * This class implements the validation rule for the GProtocolInstance - * component. - * - */ -public class LProtocolInstanceValidationRule implements ValidationRule { - - /** - * {@inheritDoc} - */ - public void validate(ModuleContext context, ModelObject mobj, IssueLogger logger) { - LProtocolInstance elem=(LProtocolInstance)mobj; - - if (elem.getLocalRole() != null) { - // Check that local role is explicitly listed in the role declaration list - - if (elem.getRoleDeclaration(elem.getLocalRole().getName()) == null) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("LOCAL_ROLE_NOT_DECLARED"), - elem.getLocalRole().getName()), elem); - } - } - - if (elem.getMemberName() != null) { - ModelObject refd=context.getMember(elem.getMemberName()); - - if (refd == null) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("UNKNOWN_MEMBER_NAME"), - elem.getMemberName()), elem); - } else if (!(refd instanceof LProtocolDefinition)) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("MEMBER_NOT_PROTOCOL_DEFINITION"), - elem.getMemberName()), elem); - } else { - LProtocolDefinition pd=(LProtocolDefinition)refd; - - // Verify argument list - if (pd.getParameterDeclarations().size() != elem.getArguments().size()) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("ARG_NUM_MISMATCH"), - elem.getArguments().size(), pd.getParameterDeclarations().size()), elem); - } - - for (Argument arg : elem.getArguments()) { - if (arg.getName() != null) { - // Check if argument name has been declared on the protocol instance as - // a parameter, or it refers to a payload type name - Module m=elem.getModule(); - PayloadTypeDecl ptd=null; - - if (m != null) { - ptd = m.getTypeDeclaration(arg.getName()); - } - - if (ptd == null && elem.getParameterDeclaration(arg.getName()) == null) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("ARG_NOT_DECLARED"), - arg.getName()), elem); - } - } - if (arg.getAlias() != null) { - // Check that target protocol declaration has a parameter name matching - // the alias - if (pd.getParameterDeclaration(arg.getAlias()) == null) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("ARG_ALIAS_NOT_DECLARED"), - arg.getAlias()), elem); - } - } - } - - // Verify role instantiations list - - // Check number of role instantiations matches the number of roles declared in the - // target protocol declaration - if (pd.getRoleDeclarations().size() != elem.getRoleInstantiations().size()) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("ROLE_NUM_MISMATCH"), - elem.getRoleInstantiations().size(), pd.getRoleDeclarations().size()), elem); - } - - // Check that the roles defined in the instantiation exist in the declaration - for (RoleInstantiation ri : elem.getRoleInstantiations()) { - if (ri.getName() != null) { - // Check if instantiated role name has been declared on the protocol instance - if (elem.getRoleDeclaration(ri.getName()) == null) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("ROLE_NOT_DECLARED"), - ri.getName()), elem); - } - } - if (ri.getAlias() != null) { - if (pd.getRoleDeclaration(ri.getAlias()) == null) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("ROLE_ALIAS_NOT_DECLARED"), - ri.getAlias()), elem); - } - } - } - } - } - } - -} diff --git a/modules/validation/src/main/java/org/scribble/validation/rules/LReceiveValidationRule.java b/modules/validation/src/main/java/org/scribble/validation/rules/LReceiveValidationRule.java deleted file mode 100644 index d7f1e647f..000000000 --- a/modules/validation/src/main/java/org/scribble/validation/rules/LReceiveValidationRule.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import java.text.MessageFormat; - -import org.scribble.context.ModuleContext; -import org.scribble.logging.IssueLogger; -import org.scribble.model.ModelObject; -import org.scribble.model.ProtocolDecl; -import org.scribble.model.local.LReceive; - -/** - * This class implements the validation rule for the LSend - * component. - * - */ -public class LReceiveValidationRule implements ValidationRule { - - /** - * {@inheritDoc} - */ - public void validate(ModuleContext context, ModelObject mobj, IssueLogger logger) { - LReceive elem=(LReceive)mobj; - - // Validate message - if (elem.getMessage() != null) { - MessageValidationRule mvr=new MessageValidationRule(); - mvr.validate(context, elem.getMessage(), logger); - } - - ProtocolDecl pd=elem.getParent(ProtocolDecl.class); - - if (pd != null) { - // Validate roles - if (elem.getFromRole() != null) { - - if (pd.getRoleDeclaration(elem.getFromRole().getName()) == null) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("UNKNOWN_ROLE"), - elem.getFromRole().getName()), elem.getFromRole()); - } - } - } - } - -} diff --git a/modules/validation/src/main/java/org/scribble/validation/rules/LRecursionValidationRule.java b/modules/validation/src/main/java/org/scribble/validation/rules/LRecursionValidationRule.java deleted file mode 100644 index 2463f9a11..000000000 --- a/modules/validation/src/main/java/org/scribble/validation/rules/LRecursionValidationRule.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import org.scribble.context.ModuleContext; -import org.scribble.logging.IssueLogger; -import org.scribble.model.ModelObject; -import org.scribble.model.local.LRecursion; - -/** - * This class implements the validation rule for the LRecursion - * component. - * - */ -public class LRecursionValidationRule implements ValidationRule { - - /** - * {@inheritDoc} - */ - public void validate(ModuleContext context, ModelObject mobj, IssueLogger logger) { - LRecursion elem=(LRecursion)mobj; - - if (elem.getBlock() != null) { - ValidationRule rule=ValidationRuleFactory.getValidationRule(elem.getBlock()); - - if (rule != null) { - rule.validate(context, elem.getBlock(), logger); - } - } - } - -} diff --git a/modules/validation/src/main/java/org/scribble/validation/rules/LSendValidationRule.java b/modules/validation/src/main/java/org/scribble/validation/rules/LSendValidationRule.java deleted file mode 100644 index c9a53c9c7..000000000 --- a/modules/validation/src/main/java/org/scribble/validation/rules/LSendValidationRule.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import java.text.MessageFormat; - -import org.scribble.context.ModuleContext; -import org.scribble.logging.IssueLogger; -import org.scribble.model.ModelObject; -import org.scribble.model.ProtocolDecl; -import org.scribble.model.Role; -import org.scribble.model.local.LSend; - -/** - * This class implements the validation rule for the LSend - * component. - * - */ -public class LSendValidationRule implements ValidationRule { - - /** - * {@inheritDoc} - */ - public void validate(ModuleContext context, ModelObject mobj, IssueLogger logger) { - LSend elem=(LSend)mobj; - - // Validate message - if (elem.getMessage() != null) { - MessageValidationRule mvr=new MessageValidationRule(); - mvr.validate(context, elem.getMessage(), logger); - } - - ProtocolDecl pd=elem.getParent(ProtocolDecl.class); - - if (pd != null) { - // Validate roles - for (Role r : elem.getToRoles()) { - - if (pd.getRoleDeclaration(r.getName()) == null) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("UNKNOWN_ROLE"), - r.getName()), r); - } - } - } - } - -} diff --git a/modules/validation/src/main/java/org/scribble/validation/rules/MessageSignatureValidationRule.java b/modules/validation/src/main/java/org/scribble/validation/rules/MessageSignatureValidationRule.java deleted file mode 100644 index ed961a7c6..000000000 --- a/modules/validation/src/main/java/org/scribble/validation/rules/MessageSignatureValidationRule.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import java.text.MessageFormat; - -import org.scribble.context.ModuleContext; -import org.scribble.logging.IssueLogger; -import org.scribble.model.MessageSignature; -import org.scribble.model.ModelObject; -import org.scribble.model.ParameterDecl; -import org.scribble.model.PayloadElement; -import org.scribble.model.PayloadTypeDecl; -import org.scribble.model.ProtocolDecl; - -/** - * This class implements the validation rule for the MessageSignature - * component. - * - */ -public class MessageSignatureValidationRule implements ValidationRule { - - /** - * {@inheritDoc} - */ - public void validate(ModuleContext context, ModelObject mobj, IssueLogger logger) { - MessageSignature elem=(MessageSignature)mobj; - - ProtocolDecl gpd=elem.getParent(ProtocolDecl.class); - - for (PayloadElement pt : elem.getPayloadElements()) { - - // Check if 'name' represents a payload type or parameter name - if (pt.getName() != null) { - boolean f_found=false; - - // QUESTION: what takes precedence, the payload type, or parameter name, - // if both are defined? - - if (gpd != null) { - for (ParameterDecl pd : gpd.getParameterDeclarations()) { - if (pd.getName().equals(pt.getName()) || - pd.getAlias() != null && pd.getAlias().equals(pt.getName())) { - f_found = true; - break; - } - } - } - - if (!f_found) { - PayloadTypeDecl ptype=elem.getModule().getTypeDeclaration(pt.getName()); - - f_found = (ptype != null); - } - - if (!f_found && context != null) { - ModelObject alias=context.getMember(pt.getName()); - - if (alias instanceof PayloadTypeDecl) { - f_found = true; - } - } - - if (!f_found) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("UNKNOWN_PAYLOAD_ELEMENT"), - pt.getName()), elem); - } - } - } - } - -} diff --git a/modules/validation/src/main/java/org/scribble/validation/rules/MessageValidationRule.java b/modules/validation/src/main/java/org/scribble/validation/rules/MessageValidationRule.java deleted file mode 100644 index 8af5b1a8e..000000000 --- a/modules/validation/src/main/java/org/scribble/validation/rules/MessageValidationRule.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import java.text.MessageFormat; - -import org.scribble.context.ModuleContext; -import org.scribble.logging.IssueLogger; -import org.scribble.model.Message; -import org.scribble.model.ModelObject; -import org.scribble.model.ParameterDecl; -import org.scribble.model.ProtocolDecl; - -/** - * This class implements the validation rule for the Message - * component. - * - */ -public class MessageValidationRule implements ValidationRule { - - /** - * {@inheritDoc} - */ - public void validate(ModuleContext context, ModelObject mobj, IssueLogger logger) { - Message elem=(Message)mobj; - - ProtocolDecl gpd=elem.getParent(ProtocolDecl.class); - - if (elem.getParameter() != null) { - - if (gpd != null) { - boolean f_found=false; - - for (ParameterDecl pd : gpd.getParameterDeclarations()) { - if (pd.getName().equals(elem.getParameter()) || - pd.getAlias() != null && pd.getAlias().equals(elem.getParameter())) { - f_found = true; - - // Check if parameter is a signature - if (pd.getType() != ParameterDecl.ParameterType.Sig) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("PARAMETER_NOT_SIG"), - elem.getParameter()), elem); - } - break; - } - } - - if (!f_found) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("UNKNOWN_PARAMETER"), - elem.getParameter()), elem); - } - } - } - - if (elem.getMessageSignature() != null) { - ValidationRule rule=ValidationRuleFactory.getValidationRule(elem.getMessageSignature()); - - if (rule != null) { - rule.validate(context, elem.getMessageSignature(), logger); - } - } - } - -} diff --git a/modules/validation/src/main/java/org/scribble/validation/rules/ModuleValidationRule.java b/modules/validation/src/main/java/org/scribble/validation/rules/ModuleValidationRule.java deleted file mode 100644 index 970d1c13d..000000000 --- a/modules/validation/src/main/java/org/scribble/validation/rules/ModuleValidationRule.java +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import java.text.MessageFormat; - -import org.scribble.context.ModuleContext; -import org.scribble.logging.IssueLogger; -import org.scribble.model.ImportDecl; -import org.scribble.model.ModelObject; -import org.scribble.model.Module; -import org.scribble.model.PayloadTypeDecl; -import org.scribble.model.ProtocolDecl; -import org.scribble.model.Role; -import org.scribble.model.local.LProtocolDecl; - -/** - * This class implements the validation rule for the GMessage - * component. - * - */ -public class ModuleValidationRule implements ValidationRule { - - /** - * {@inheritDoc} - */ - public void validate(ModuleContext context, ModelObject mobj, IssueLogger logger) { - Module elem=(Module)mobj; - - if (elem.getName() == null) { - logger.error(ValidationMessages.getMessage("NO_FULLY_QUALIFIED_NAME"), mobj); - } - - for (ImportDecl imp : elem.getImports()) { - ValidationRule rule=ValidationRuleFactory.getValidationRule(imp); - - if (rule != null) { - rule.validate(context, imp, logger); - } - } - - for (PayloadTypeDecl ptd : elem.getPayloadTypeDeclarations()) { - ValidationRule rule=ValidationRuleFactory.getValidationRule(ptd); - - if (rule != null) { - rule.validate(context, ptd, logger); - } - } - - boolean f_global=true; - String localRole=null; - - if (context.getResource() != null) { - int pos=context.getResource().getPath().indexOf('_'); - if (pos != -1) { - f_global = false; - localRole = context.getResource().getPath().substring(pos+1, - context.getResource().getPath().length()-4); - } - } - - for (int i=0; i < elem.getProtocols().size(); i++) { - ProtocolDecl protocol=elem.getProtocols().get(i); - - if (context.getResource() != null) { - if (protocol instanceof LProtocolDecl) { - Role role=((LProtocolDecl)protocol).getLocalRole(); - - if (f_global) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("LOCAL_DEFINED_IN_GLOBAL_MODULE"), - role.getName()), protocol); - } else if (!role.getName().equals(localRole)) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("LOCAL_MODULE_ROLE_MISMATCH"), - role.getName(), localRole), protocol); - } - } else if (!f_global) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("GLOBAL_DEFINED_IN_LOCAL_MODULE"), - localRole), protocol); - } - } - - // Validate the protocol - ValidationRule rule=ValidationRuleFactory.getValidationRule(protocol); - - if (rule != null) { - rule.validate(context, protocol, logger); - } - } - - // Well formed ness checks - if (context.getResource() != null && context.getResource().getPath() != null) { - String filepath=elem.getName().replace('.', java.io.File.separatorChar)+".scr"; - - if (!context.getResource().getPath().equals(filepath)) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("INCORRECT_FILEPATH"), - elem.getName(), filepath), mobj); - } - } - - java.util.List moduleNames=new java.util.ArrayList(); - if (elem.getName() != null) { - moduleNames.add(elem.getLocalName()); - } - - for (ImportDecl imp : elem.getImports()) { - if (imp.getMemberName() == null) { - String declName=imp.getDeclarationName(); - - if (moduleNames.contains(declName)) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("MODULE_NAME_NOT_DISTINCT"), - declName), mobj); - } else { - moduleNames.add(declName); - } - } - } - - java.util.List memberNames=new java.util.ArrayList(); - - for (ImportDecl imp : elem.getImports()) { - if (imp.getMemberName() != null) { - String declName=imp.getDeclarationName(); - - if (memberNames.contains(declName)) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("MEMBER_NAME_NOT_DISTINCT"), - declName), imp); - } else { - memberNames.add(declName); - } - } - } - - for (PayloadTypeDecl plt : elem.getPayloadTypeDeclarations()) { - if (memberNames.contains(plt.getAlias())) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("MEMBER_NAME_NOT_DISTINCT"), - plt.getAlias()), plt); - } else { - memberNames.add(plt.getAlias()); - } - } - - for (ProtocolDecl pd : elem.getProtocols()) { - if (memberNames.contains(pd.getName())) { - logger.error(MessageFormat.format(ValidationMessages.getMessage("MEMBER_NAME_NOT_DISTINCT"), - pd.getName()), pd); - } else { - memberNames.add(pd.getName()); - } - } - } - -} diff --git a/modules/validation/src/main/java/org/scribble/validation/rules/ValidationMessages.java b/modules/validation/src/main/java/org/scribble/validation/rules/ValidationMessages.java deleted file mode 100644 index 1147b6260..000000000 --- a/modules/validation/src/main/java/org/scribble/validation/rules/ValidationMessages.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -/** - * This class is responsible for returning the validation messages - * used by the rules. - * - */ -public class ValidationMessages { - - /** - * This method returns the message associated with the supplied key. - * - * @param key The key - * @return The message - */ - public static final String getMessage(String key) { - return (java.util.ResourceBundle.getBundle("scribble.validation.Messages").getString(key)); - } -} diff --git a/modules/validation/src/main/java/org/scribble/validation/rules/ValidationRule.java b/modules/validation/src/main/java/org/scribble/validation/rules/ValidationRule.java deleted file mode 100644 index 73014d316..000000000 --- a/modules/validation/src/main/java/org/scribble/validation/rules/ValidationRule.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import org.scribble.context.ModuleContext; -import org.scribble.logging.IssueLogger; -import org.scribble.model.ModelObject; - -/** - * This interface represents a validation rule. - * - */ -public interface ValidationRule { - - /** - * This method validates the supplied model object - * and reports any relevant issues to the supplied logger. - * - * @param context The validation context - * @param mobj The model object - * @param logger The logger - */ - public void validate(ModuleContext context, ModelObject mobj, IssueLogger logger); - -} diff --git a/modules/validation/src/main/java/org/scribble/validation/rules/ValidationRuleFactory.java b/modules/validation/src/main/java/org/scribble/validation/rules/ValidationRuleFactory.java deleted file mode 100644 index 03f100948..000000000 --- a/modules/validation/src/main/java/org/scribble/validation/rules/ValidationRuleFactory.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import org.scribble.model.ImportDecl; -import org.scribble.model.Message; -import org.scribble.model.MessageSignature; -import org.scribble.model.ModelObject; -import org.scribble.model.Module; -import org.scribble.model.global.GBlock; -import org.scribble.model.global.GChoice; -import org.scribble.model.global.GDo; -import org.scribble.model.global.GInterruptible; -import org.scribble.model.global.GMessageTransfer; -import org.scribble.model.global.GParallel; -import org.scribble.model.global.GProtocolDefinition; -import org.scribble.model.global.GProtocolInstance; -import org.scribble.model.global.GRecursion; -import org.scribble.model.local.LBlock; -import org.scribble.model.local.LChoice; -import org.scribble.model.local.LDo; -import org.scribble.model.local.LInterruptible; -import org.scribble.model.local.LParallel; -import org.scribble.model.local.LProtocolDefinition; -import org.scribble.model.local.LProtocolInstance; -import org.scribble.model.local.LReceive; -import org.scribble.model.local.LRecursion; -import org.scribble.model.local.LSend; - -/** - * This class provides the factory capability for validation rules. - * - */ -public class ValidationRuleFactory { - - private static java.util.Map, ValidationRule> _rules= - new java.util.HashMap, ValidationRule>(); - - static { - _rules.put(GBlock.class, new GBlockValidationRule()); - _rules.put(GChoice.class, new GChoiceValidationRule()); - _rules.put(GDo.class, new GDoValidationRule()); - _rules.put(GInterruptible.class, new GInterruptibleValidationRule()); - _rules.put(GMessageTransfer.class, new GMessageTransferValidationRule()); - _rules.put(GParallel.class, new GParallelValidationRule()); - _rules.put(GProtocolDefinition.class, new GProtocolDefinitionValidationRule()); - _rules.put(GProtocolInstance.class, new GProtocolInstanceValidationRule()); - _rules.put(GRecursion.class, new GRecursionValidationRule()); - _rules.put(ImportDecl.class, new ImportDeclValidationRule()); - _rules.put(LBlock.class, new LBlockValidationRule()); - _rules.put(LChoice.class, new LChoiceValidationRule()); - _rules.put(LDo.class, new LDoValidationRule()); - _rules.put(LInterruptible.class, new LInterruptibleValidationRule()); - _rules.put(LParallel.class, new LParallelValidationRule()); - _rules.put(LProtocolDefinition.class, new LProtocolDefinitionValidationRule()); - _rules.put(LProtocolInstance.class, new LProtocolInstanceValidationRule()); - _rules.put(LReceive.class, new LReceiveValidationRule()); - _rules.put(LRecursion.class, new LRecursionValidationRule()); - _rules.put(LSend.class, new LSendValidationRule()); - _rules.put(Message.class, new MessageValidationRule()); - _rules.put(MessageSignature.class, new MessageSignatureValidationRule()); - _rules.put(Module.class, new ModuleValidationRule()); - } - - /** - * This method returns the validation rule associated with the - * supplied model object. - * - * @param mobj The model object - * @return The validation rule, or null if not relevant - */ - public static ValidationRule getValidationRule(ModelObject mobj) { - return (_rules.get(mobj.getClass())); - } -} diff --git a/modules/validation/src/main/resources/scribble/validation/Messages.properties b/modules/validation/src/main/resources/scribble/validation/Messages.properties deleted file mode 100644 index e653e8eeb..000000000 --- a/modules/validation/src/main/resources/scribble/validation/Messages.properties +++ /dev/null @@ -1,41 +0,0 @@ -ANNOTATION_NOT_DISTINCT=Annotation ''{0}'' is not distinct -ARG_ALIAS_NOT_DECLARED=Argument alias ''{0}'' does not match a parameter on the target protocol declaration -ARG_NOT_DECLARED=Argument ''{0}'' has not been declared as a parameter or payload type -ARG_NUM_MISMATCH=Number of arguments ''{0}'' does not match number of parameters ''{1}'' -EXISTS_ALIAS=Alias ''{0}'' has already been defined -GLOBAL_DEFINED_IN_LOCAL_MODULE=Global protocol defined in module associated with local role ''{0}'' -INCORRECT_FILEPATH=Module ''{0}'' should be defined within a file path ''{1}'' -INTERACTION_IN_CONCURRENT_PATHS=Interaction ''{0}'' contained in multiple concurrent paths -LABEL_CONTAINED_IN_INTERRUPTIBLE=Continue cannot be contained within an interruptible -LABEL_CONTAINED_IN_PARALLEL=Continue cannot be contained within a parallel -LABEL_NOT_BOUND=Label ''{0}'' is not bound to a recursion -LABEL_NOT_DEFINED=Label has not been defined -LABEL_NOT_UNIQUE=Label ''{0}'' is not unique -LOCAL_DEFINED_IN_GLOBAL_MODULE=Local protocol associated with role ''{0}'' defined in global module -LOCAL_MODULE_ROLE_MISMATCH=Local protocol with role ''{0}'' should be associated with module role ''{1}'' -LOCAL_ROLE_NOT_DECLARED=Local role ''{0}'' has not been declared -MEMBER_NOT_PROTOCOL_DEFINITION=Member ''{0}'' is not a protocol definition -MEMBER_NAME_NOT_DISTINCT=Member name ''{0}'' is not distinct -MODULE_NAME_NOT_DISTINCT=Module name ''{0}'' is not distinct -NOT_FOUND_MEMBER=Unable to find member ''{0}'' in module ''{1}'' -NOT_FOUND_MODULE=Unable to locate imported module ''{0}'' -NO_MODULE=No module has been defined -NO_FULLY_QUALIFIED_NAME=No fully qualified name has been defined for module -PARAMETER_NAME_NOT_DISTINCT=Parameter name ''{0}'' is not distinct -PARAMETER_NOT_SIG=Referenced parameter ''{0}'' is not a signature (i.e. 'sig') -ROLE_ALIAS_NOT_DECLARED=Role alias ''{0}'' does not match a role on the target protocol declaration -ROLE_NAME_NOT_DISTINCT=Role name ''{0}'' is not distinct -ROLE_NOT_DISTINCT=Role ''{0}'' is not distinct -ROLE_NOT_DECLARED=Role ''{0}'' has not been declared -ROLE_NOT_RECEIVER=Role ''{0}'' has not been used as a message receiver prior to use in another activity -ROLE_NUM_MISMATCH=Number of role instantiations ''{0}'' does not match number of declarations ''{1}'' -ROLE_OPERATOR_NOT_DISTINCT=Operator ''{0}'' not distinct at role ''{1}'' -ROLE_SIGNATURE_NOT_DISTINCT=Signature ''{0}'' not distinct at role ''{1}'' -ROLES_MISMATCH=Roles in branch do not match previous branch(es) -SCOPE_NOT_DISTINCT=Scope ''{0}'' is not distinct -UNDEFINED_ROLE=Role has not been specified -UNKNOWN_MEMBER_NAME=Unknown member name ''{0}'' -UNKNOWN_PARAMETER=Unknown parameter ''{0}'' -UNKNOWN_PAYLOAD_ELEMENT=Unknown payload type or parameter ''{0}'' -UNKNOWN_PROTOCOL=Unknown protocol ''{0}'' -UNKNOWN_ROLE=Unknown role ''{0}'' diff --git a/modules/validation/src/test/java/org/scribble/validation/ProtocolValidatorTest.java b/modules/validation/src/test/java/org/scribble/validation/ProtocolValidatorTest.java deleted file mode 100644 index a9294e3d6..000000000 --- a/modules/validation/src/test/java/org/scribble/validation/ProtocolValidatorTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation; - -import static org.junit.Assert.*; - -import org.scribble.context.DefaultModuleContext; -import org.scribble.model.Module; -import org.scribble.model.global.GProtocolDefinition; -import org.scribble.validation.ProtocolValidator; -import org.scribble.validation.rules.ValidationMessages; - -public class ProtocolValidatorTest { - - @org.junit.Test - public void testModuleValid() { - ProtocolValidator pv=new ProtocolValidator(); - TestValidationLogger logger=new TestValidationLogger(); - DefaultModuleContext context=new DefaultModuleContext(null, null, null); - - Module module=new Module(); - module.setName("test"); - - module.getProtocols().add(new GProtocolDefinition()); - - pv.validate(context, module, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testModuleInvalid() { - ProtocolValidator pv=new ProtocolValidator(); - TestValidationLogger logger=new TestValidationLogger(); - DefaultModuleContext context=new DefaultModuleContext(null, null, null); - - Module module=new Module(); - - module.getProtocols().add(new GProtocolDefinition()); - - pv.validate(context, module, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(ValidationMessages.getMessage("NO_FULLY_QUALIFIED_NAME"))) { - fail("Error NO_FULLY_QUALIFIED_NAME not detected"); - } - } - -} diff --git a/modules/validation/src/test/java/org/scribble/validation/TestValidationLogger.java b/modules/validation/src/test/java/org/scribble/validation/TestValidationLogger.java deleted file mode 100644 index baf6fde67..000000000 --- a/modules/validation/src/test/java/org/scribble/validation/TestValidationLogger.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation; - -import org.scribble.logging.ConsoleIssueLogger; -import org.scribble.model.ModelObject; - -public class TestValidationLogger extends ConsoleIssueLogger { - - private java.util.List _errors=new java.util.ArrayList(); - private java.util.List _warnings=new java.util.ArrayList(); - - public void error(String issue, ModelObject mobj) { - super.error(issue, mobj); - _errors.add(issue); - } - - public java.util.List getErrors() { - return (_errors); - } - - public void warning(String issue, ModelObject mobj) { - super.warning(issue, mobj); - _warnings.add(issue); - } - - public void info(String issue, ModelObject mobj) { - super.info(issue, mobj); - } - - public boolean isErrorsOrWarnings() { - return (_errors.size() > 0 || _warnings.size() > 0); - } -} diff --git a/modules/validation/src/test/java/org/scribble/validation/rules/GChoiceValidationRuleTest.java b/modules/validation/src/test/java/org/scribble/validation/rules/GChoiceValidationRuleTest.java deleted file mode 100644 index a04da71af..000000000 --- a/modules/validation/src/test/java/org/scribble/validation/rules/GChoiceValidationRuleTest.java +++ /dev/null @@ -1,824 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import static org.junit.Assert.*; - -import java.text.MessageFormat; - -import org.scribble.model.Message; -import org.scribble.model.MessageSignature; -import org.scribble.model.Module; -import org.scribble.model.ParameterDecl; -import org.scribble.model.ParameterDecl.ParameterType; -import org.scribble.model.Role; -import org.scribble.model.RoleDecl; -import org.scribble.model.global.GBlock; -import org.scribble.model.global.GChoice; -import org.scribble.model.global.GMessageTransfer; -import org.scribble.model.global.GParallel; -import org.scribble.model.global.GProtocolDefinition; -import org.scribble.validation.TestValidationLogger; -import org.scribble.validation.rules.GChoiceValidationRule; - -public class GChoiceValidationRuleTest { - - private static final String OP1 = "op1"; - private static final String OP2 = "op2"; - private static final String OP3 = "op3"; - private static final String SIG1 = "sig1"; - private static final String SIG2 = "sig2"; - private static final String SIG3 = "sig3"; - private static final String SIG4 = "sig4"; - private static final String TEST_ROLE1 = "TestRole1"; - private static final String TEST_ROLE2 = "TestRole2"; - private static final String TEST_ROLE3 = "TestRole3"; - - @org.junit.Test - public void testValidChoice() { - GChoiceValidationRule rule=new GChoiceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolDefinition gpd=new GProtocolDefinition(); - - RoleDecl rd=new RoleDecl(); - rd.setName(TEST_ROLE1); - gpd.getRoleDeclarations().add(rd); - - module.getProtocols().add(gpd); - - GBlock block=new GBlock(); - gpd.setBlock(block); - - GChoice choice=new GChoice(); - Role role=new Role(); - role.setName(TEST_ROLE1); - choice.setRole(role); - block.add(choice); - - rule.validate(null, choice, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testUnknownRole() { - GChoiceValidationRule rule=new GChoiceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolDefinition gpd=new GProtocolDefinition(); - module.getProtocols().add(gpd); - - GBlock block=new GBlock(); - gpd.setBlock(block); - - GChoice choice=new GChoice(); - Role role=new Role(); - role.setName(TEST_ROLE1); - choice.setRole(role); - block.add(choice); - - rule.validate(null, choice, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("UNKNOWN_ROLE"), TEST_ROLE1))) { - fail("Error UNKNOWN_ROLE not detected"); - } - } - - @org.junit.Test - public void testUndefinedRole() { - GChoiceValidationRule rule=new GChoiceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolDefinition gpd=new GProtocolDefinition(); - module.getProtocols().add(gpd); - - GBlock block=new GBlock(); - gpd.setBlock(block); - - GChoice choice=new GChoice(); - block.add(choice); - - rule.validate(null, choice, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(ValidationMessages.getMessage("UNDEFINED_ROLE"))) { - fail("Error UNDEFINED_ROLE not detected"); - } - } - - @org.junit.Test - public void testRolesReceiverBeforeOther() { - GChoiceValidationRule rule=new GChoiceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolDefinition gpd=new GProtocolDefinition(); - module.getProtocols().add(gpd); - - RoleDecl rd1=new RoleDecl(); - rd1.setName(TEST_ROLE1); - gpd.getRoleDeclarations().add(rd1); - - RoleDecl rd2=new RoleDecl(); - rd2.setName(TEST_ROLE2); - gpd.getRoleDeclarations().add(rd2); - - GBlock block=new GBlock(); - gpd.setBlock(block); - - GChoice choice=new GChoice(); - block.add(choice); - - choice.setRole(new Role(TEST_ROLE1)); - - GBlock b1=new GBlock(); - choice.getPaths().add(b1); - - GMessageTransfer mt1=new GMessageTransfer(); - mt1.setFromRole(new Role(TEST_ROLE1)); - mt1.getToRoles().add(new Role(TEST_ROLE2)); - b1.add(mt1); - - GBlock b2=new GBlock(); - choice.getPaths().add(b2); - - GParallel par2=new GParallel(); - b2.add(par2); - - GBlock b3=new GBlock(); - par2.getPaths().add(b3); - - GMessageTransfer mt2=new GMessageTransfer(); - MessageSignature sig2=new MessageSignature(); - sig2.setOperator(OP1); - - Message m2=new Message(); - m2.setMessageSignature(sig2); - - mt2.setMessage(m2); - mt2.setFromRole(new Role(TEST_ROLE1)); - mt2.getToRoles().add(new Role(TEST_ROLE2)); - b3.add(mt2); - - GMessageTransfer mt3=new GMessageTransfer(); - mt3.setFromRole(new Role(TEST_ROLE2)); - mt3.getToRoles().add(new Role(TEST_ROLE1)); - b3.add(mt3); - - GBlock b4=new GBlock(); - par2.getPaths().add(b4); - - GMessageTransfer mt4=new GMessageTransfer(); - - MessageSignature sig4=new MessageSignature(); - sig4.setOperator(OP2); - - Message m4=new Message(); - m4.setMessageSignature(sig4); - - mt4.setMessage(m4); - mt4.setFromRole(new Role(TEST_ROLE1)); - mt4.getToRoles().add(new Role(TEST_ROLE2)); - b4.add(mt4); - - rule.validate(null, choice, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testRolesNotReceiverBeforeOther() { - GChoiceValidationRule rule=new GChoiceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolDefinition gpd=new GProtocolDefinition(); - module.getProtocols().add(gpd); - - RoleDecl rd1=new RoleDecl(); - rd1.setName(TEST_ROLE1); - gpd.getRoleDeclarations().add(rd1); - - RoleDecl rd2=new RoleDecl(); - rd2.setName(TEST_ROLE2); - gpd.getRoleDeclarations().add(rd2); - - GBlock block=new GBlock(); - gpd.setBlock(block); - - GChoice choice=new GChoice(); - block.add(choice); - - choice.setRole(new Role(TEST_ROLE1)); - - GBlock b1=new GBlock(); - choice.getPaths().add(b1); - - GMessageTransfer mt1=new GMessageTransfer(); - mt1.setFromRole(new Role(TEST_ROLE1)); - mt1.getToRoles().add(new Role(TEST_ROLE2)); - b1.add(mt1); - - GBlock b2=new GBlock(); - choice.getPaths().add(b2); - - GParallel par2=new GParallel(); - b2.add(par2); - - GBlock b3=new GBlock(); - par2.getPaths().add(b3); - - GMessageTransfer mt3=new GMessageTransfer(); - mt3.setFromRole(new Role(TEST_ROLE2)); - mt3.getToRoles().add(new Role(TEST_ROLE1)); - b3.add(mt3); - - GMessageTransfer mt2=new GMessageTransfer(); - mt2.setFromRole(new Role(TEST_ROLE1)); - mt2.getToRoles().add(new Role(TEST_ROLE2)); - b3.add(mt2); - - GBlock b4=new GBlock(); - par2.getPaths().add(b4); - - GMessageTransfer mt4=new GMessageTransfer(); - mt4.setFromRole(new Role(TEST_ROLE1)); - mt4.getToRoles().add(new Role(TEST_ROLE2)); - b4.add(mt4); - - rule.validate(null, choice, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("ROLE_NOT_RECEIVER"), TEST_ROLE2))) { - fail("Error UNKNOWN_ROLE not detected"); - } - } - - @org.junit.Test - public void testRolesReceiverOperatorsDistinct() { - GChoiceValidationRule rule=new GChoiceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolDefinition gpd=new GProtocolDefinition(); - module.getProtocols().add(gpd); - - RoleDecl rd1=new RoleDecl(); - rd1.setName(TEST_ROLE1); - gpd.getRoleDeclarations().add(rd1); - - RoleDecl rd2=new RoleDecl(); - rd2.setName(TEST_ROLE2); - gpd.getRoleDeclarations().add(rd2); - - GBlock block=new GBlock(); - gpd.setBlock(block); - - GChoice choice=new GChoice(); - block.add(choice); - - choice.setRole(new Role(TEST_ROLE1)); - - GBlock b1=new GBlock(); - choice.getPaths().add(b1); - - GMessageTransfer mt1=new GMessageTransfer(); - mt1.setFromRole(new Role(TEST_ROLE1)); - mt1.getToRoles().add(new Role(TEST_ROLE2)); - - Message m1=new Message(); - mt1.setMessage(m1); - - MessageSignature ms1=new MessageSignature(); - m1.setMessageSignature(ms1); - ms1.setOperator(OP1); - - b1.add(mt1); - - GBlock b2=new GBlock(); - choice.getPaths().add(b2); - - GParallel par2=new GParallel(); - b2.add(par2); - - GBlock b3=new GBlock(); - par2.getPaths().add(b3); - - GMessageTransfer mt2=new GMessageTransfer(); - mt2.setFromRole(new Role(TEST_ROLE1)); - mt2.getToRoles().add(new Role(TEST_ROLE2)); - b3.add(mt2); - - Message m2=new Message(); - mt2.setMessage(m2); - - MessageSignature ms2=new MessageSignature(); - m2.setMessageSignature(ms2); - ms2.setOperator(OP2); - - GMessageTransfer mt3=new GMessageTransfer(); - mt3.setFromRole(new Role(TEST_ROLE2)); - mt3.getToRoles().add(new Role(TEST_ROLE1)); - b3.add(mt3); - - Message m3=new Message(); - mt3.setMessage(m3); - - MessageSignature ms3=new MessageSignature(); - m3.setMessageSignature(ms3); - ms3.setOperator(OP2); - - GBlock b4=new GBlock(); - par2.getPaths().add(b4); - - GMessageTransfer mt4=new GMessageTransfer(); - mt4.setFromRole(new Role(TEST_ROLE1)); - mt4.getToRoles().add(new Role(TEST_ROLE2)); - b4.add(mt4); - - Message m4=new Message(); - mt4.setMessage(m4); - - MessageSignature ms4=new MessageSignature(); - m4.setMessageSignature(ms4); - ms4.setOperator(OP3); - - rule.validate(null, choice, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testRolesNotReceiverOperatorsNotDistinct() { - GChoiceValidationRule rule=new GChoiceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolDefinition gpd=new GProtocolDefinition(); - module.getProtocols().add(gpd); - - RoleDecl rd1=new RoleDecl(); - rd1.setName(TEST_ROLE1); - gpd.getRoleDeclarations().add(rd1); - - RoleDecl rd2=new RoleDecl(); - rd2.setName(TEST_ROLE2); - gpd.getRoleDeclarations().add(rd2); - - GBlock block=new GBlock(); - gpd.setBlock(block); - - GChoice choice=new GChoice(); - block.add(choice); - - choice.setRole(new Role(TEST_ROLE1)); - - GBlock b1=new GBlock(); - choice.getPaths().add(b1); - - GMessageTransfer mt1=new GMessageTransfer(); - mt1.setFromRole(new Role(TEST_ROLE1)); - mt1.getToRoles().add(new Role(TEST_ROLE2)); - - Message m1=new Message(); - mt1.setMessage(m1); - - MessageSignature ms1=new MessageSignature(); - m1.setMessageSignature(ms1); - ms1.setOperator(OP1); - - b1.add(mt1); - - GBlock b2=new GBlock(); - choice.getPaths().add(b2); - - GParallel par2=new GParallel(); - b2.add(par2); - - GBlock b3=new GBlock(); - par2.getPaths().add(b3); - - GMessageTransfer mt2=new GMessageTransfer(); - mt2.setFromRole(new Role(TEST_ROLE1)); - mt2.getToRoles().add(new Role(TEST_ROLE2)); - b3.add(mt2); - - Message m2=new Message(); - mt2.setMessage(m2); - - MessageSignature ms2=new MessageSignature(); - m2.setMessageSignature(ms2); - ms2.setOperator(OP2); - - GMessageTransfer mt3=new GMessageTransfer(); - mt3.setFromRole(new Role(TEST_ROLE2)); - mt3.getToRoles().add(new Role(TEST_ROLE1)); - b3.add(mt3); - - Message m3=new Message(); - mt3.setMessage(m3); - - MessageSignature ms3=new MessageSignature(); - m3.setMessageSignature(ms3); - ms3.setOperator(OP2); - - GBlock b4=new GBlock(); - par2.getPaths().add(b4); - - GMessageTransfer mt4=new GMessageTransfer(); - mt4.setFromRole(new Role(TEST_ROLE1)); - mt4.getToRoles().add(new Role(TEST_ROLE2)); - b4.add(mt4); - - Message m4=new Message(); - mt4.setMessage(m4); - - MessageSignature ms4=new MessageSignature(); - m4.setMessageSignature(ms4); - ms4.setOperator(OP1); - - rule.validate(null, choice, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("ROLE_OPERATOR_NOT_DISTINCT"), - OP1, TEST_ROLE2))) { - fail("Error ROLE_OPERATOR_NOT_DISTINCT not detected"); - } - } - - @org.junit.Test - public void testRolesReceiverSignaturesDistinct() { - GChoiceValidationRule rule=new GChoiceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolDefinition gpd=new GProtocolDefinition(); - module.getProtocols().add(gpd); - - RoleDecl rd1=new RoleDecl(); - rd1.setName(TEST_ROLE1); - gpd.getRoleDeclarations().add(rd1); - - RoleDecl rd2=new RoleDecl(); - rd2.setName(TEST_ROLE2); - gpd.getRoleDeclarations().add(rd2); - - ParameterDecl pd1=new ParameterDecl(); - pd1.setName(SIG1); - pd1.setType(ParameterType.Sig); - gpd.getParameterDeclarations().add(pd1); - - ParameterDecl pd2=new ParameterDecl(); - pd2.setName(SIG2); - pd2.setType(ParameterType.Sig); - gpd.getParameterDeclarations().add(pd2); - - ParameterDecl pd3=new ParameterDecl(); - pd3.setName(SIG3); - pd3.setType(ParameterType.Sig); - gpd.getParameterDeclarations().add(pd3); - - ParameterDecl pd4=new ParameterDecl(); - pd4.setName(SIG4); - pd4.setType(ParameterType.Sig); - gpd.getParameterDeclarations().add(pd4); - - GBlock block=new GBlock(); - gpd.setBlock(block); - - GChoice choice=new GChoice(); - block.add(choice); - - choice.setRole(new Role(TEST_ROLE1)); - - GBlock b1=new GBlock(); - choice.getPaths().add(b1); - - GMessageTransfer mt1=new GMessageTransfer(); - mt1.setFromRole(new Role(TEST_ROLE1)); - mt1.getToRoles().add(new Role(TEST_ROLE2)); - - Message m1=new Message(); - m1.setParameter(SIG1); - mt1.setMessage(m1); - - b1.add(mt1); - - GBlock b2=new GBlock(); - choice.getPaths().add(b2); - - GParallel par2=new GParallel(); - b2.add(par2); - - GBlock b3=new GBlock(); - par2.getPaths().add(b3); - - GMessageTransfer mt2=new GMessageTransfer(); - mt2.setFromRole(new Role(TEST_ROLE1)); - mt2.getToRoles().add(new Role(TEST_ROLE2)); - b3.add(mt2); - - Message m2=new Message(); - m2.setParameter(SIG2); - mt2.setMessage(m2); - - GMessageTransfer mt3=new GMessageTransfer(); - mt3.setFromRole(new Role(TEST_ROLE2)); - mt3.getToRoles().add(new Role(TEST_ROLE1)); - b3.add(mt3); - - Message m3=new Message(); - m3.setParameter(SIG3); - mt3.setMessage(m3); - - GBlock b4=new GBlock(); - par2.getPaths().add(b4); - - GMessageTransfer mt4=new GMessageTransfer(); - mt4.setFromRole(new Role(TEST_ROLE1)); - mt4.getToRoles().add(new Role(TEST_ROLE2)); - b4.add(mt4); - - Message m4=new Message(); - m4.setParameter(SIG4); - mt4.setMessage(m4); - - rule.validate(null, choice, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testRolesNotReceiverSignaturesNotDistinct() { - GChoiceValidationRule rule=new GChoiceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolDefinition gpd=new GProtocolDefinition(); - module.getProtocols().add(gpd); - - RoleDecl rd1=new RoleDecl(); - rd1.setName(TEST_ROLE1); - gpd.getRoleDeclarations().add(rd1); - - RoleDecl rd2=new RoleDecl(); - rd2.setName(TEST_ROLE2); - gpd.getRoleDeclarations().add(rd2); - - ParameterDecl pd1=new ParameterDecl(); - pd1.setName(SIG1); - pd1.setType(ParameterType.Sig); - gpd.getParameterDeclarations().add(pd1); - - ParameterDecl pd2=new ParameterDecl(); - pd2.setName(SIG2); - pd2.setType(ParameterType.Sig); - gpd.getParameterDeclarations().add(pd2); - - ParameterDecl pd3=new ParameterDecl(); - pd3.setName(SIG3); - pd3.setType(ParameterType.Sig); - gpd.getParameterDeclarations().add(pd3); - - ParameterDecl pd4=new ParameterDecl(); - pd4.setName(SIG4); - pd4.setType(ParameterType.Sig); - gpd.getParameterDeclarations().add(pd4); - - GBlock block=new GBlock(); - gpd.setBlock(block); - - GChoice choice=new GChoice(); - block.add(choice); - - choice.setRole(new Role(TEST_ROLE1)); - - GBlock b1=new GBlock(); - choice.getPaths().add(b1); - - GMessageTransfer mt1=new GMessageTransfer(); - mt1.setFromRole(new Role(TEST_ROLE1)); - mt1.getToRoles().add(new Role(TEST_ROLE2)); - - Message m1=new Message(); - m1.setParameter(SIG1); - mt1.setMessage(m1); - - b1.add(mt1); - - GBlock b2=new GBlock(); - choice.getPaths().add(b2); - - GParallel par2=new GParallel(); - b2.add(par2); - - GBlock b3=new GBlock(); - par2.getPaths().add(b3); - - GMessageTransfer mt2=new GMessageTransfer(); - mt2.setFromRole(new Role(TEST_ROLE1)); - mt2.getToRoles().add(new Role(TEST_ROLE2)); - b3.add(mt2); - - Message m2=new Message(); - m2.setParameter(SIG2); - mt2.setMessage(m2); - - GMessageTransfer mt3=new GMessageTransfer(); - mt3.setFromRole(new Role(TEST_ROLE2)); - mt3.getToRoles().add(new Role(TEST_ROLE1)); - b3.add(mt3); - - Message m3=new Message(); - m3.setParameter(SIG3); - mt3.setMessage(m3); - - GBlock b4=new GBlock(); - par2.getPaths().add(b4); - - GMessageTransfer mt4=new GMessageTransfer(); - mt4.setFromRole(new Role(TEST_ROLE1)); - mt4.getToRoles().add(new Role(TEST_ROLE2)); - b4.add(mt4); - - Message m4=new Message(); - m4.setParameter(SIG1); - mt4.setMessage(m4); - - rule.validate(null, choice, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("ROLE_SIGNATURE_NOT_DISTINCT"), - SIG1, TEST_ROLE2))) { - fail("Error ROLE_SIGNATURE_NOT_DISTINCT not detected"); - } - } - - @org.junit.Test - public void testRolesMatch() { - GChoiceValidationRule rule=new GChoiceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolDefinition gpd=new GProtocolDefinition(); - module.getProtocols().add(gpd); - - RoleDecl rd1=new RoleDecl(); - rd1.setName(TEST_ROLE1); - gpd.getRoleDeclarations().add(rd1); - - RoleDecl rd2=new RoleDecl(); - rd2.setName(TEST_ROLE2); - gpd.getRoleDeclarations().add(rd2); - - GBlock block=new GBlock(); - gpd.setBlock(block); - - GChoice choice=new GChoice(); - block.add(choice); - - choice.setRole(new Role(TEST_ROLE1)); - - GBlock b1=new GBlock(); - choice.getPaths().add(b1); - - GMessageTransfer mt1=new GMessageTransfer(); - mt1.setFromRole(new Role(TEST_ROLE1)); - mt1.getToRoles().add(new Role(TEST_ROLE2)); - b1.add(mt1); - - GBlock b2=new GBlock(); - choice.getPaths().add(b2); - - GMessageTransfer mt2=new GMessageTransfer(); - mt2.setFromRole(new Role(TEST_ROLE1)); - mt2.getToRoles().add(new Role(TEST_ROLE2)); - b2.add(mt2); - - rule.validate(null, choice, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testRolesMisMatch() { - GChoiceValidationRule rule=new GChoiceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolDefinition gpd=new GProtocolDefinition(); - module.getProtocols().add(gpd); - - RoleDecl rd1=new RoleDecl(); - rd1.setName(TEST_ROLE1); - gpd.getRoleDeclarations().add(rd1); - - RoleDecl rd2=new RoleDecl(); - rd2.setName(TEST_ROLE2); - gpd.getRoleDeclarations().add(rd2); - - RoleDecl rd3=new RoleDecl(); - rd3.setName(TEST_ROLE3); - gpd.getRoleDeclarations().add(rd3); - - GBlock block=new GBlock(); - gpd.setBlock(block); - - GChoice choice=new GChoice(); - block.add(choice); - - choice.setRole(new Role(TEST_ROLE1)); - - GBlock b1=new GBlock(); - choice.getPaths().add(b1); - - GMessageTransfer mt1=new GMessageTransfer(); - mt1.setFromRole(new Role(TEST_ROLE1)); - mt1.getToRoles().add(new Role(TEST_ROLE2)); - b1.add(mt1); - - GBlock b2=new GBlock(); - choice.getPaths().add(b2); - - GMessageTransfer mt2=new GMessageTransfer(); - mt2.setFromRole(new Role(TEST_ROLE1)); - mt2.getToRoles().add(new Role(TEST_ROLE3)); - b2.add(mt2); - - rule.validate(null, choice, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(ValidationMessages.getMessage("ROLES_MISMATCH"))) { - fail("Error ROLES_MISMATCH not detected"); - } - } -} diff --git a/modules/validation/src/test/java/org/scribble/validation/rules/GContinueValidationRuleTest.java b/modules/validation/src/test/java/org/scribble/validation/rules/GContinueValidationRuleTest.java deleted file mode 100644 index 1359425b8..000000000 --- a/modules/validation/src/test/java/org/scribble/validation/rules/GContinueValidationRuleTest.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import static org.junit.Assert.*; - -import java.text.MessageFormat; - -import org.scribble.context.DefaultModuleContext; -import org.scribble.context.ModuleContext; -import org.scribble.model.Module; -import org.scribble.model.global.GBlock; -import org.scribble.model.global.GContinue; -import org.scribble.model.global.GInterruptible; -import org.scribble.model.global.GParallel; -import org.scribble.model.global.GProtocolDefinition; -import org.scribble.model.global.GRecursion; -import org.scribble.validation.TestValidationLogger; - -public class GContinueValidationRuleTest { - - private static final String LABEL1 = "label1"; - private static final String LABEL2 = "label2"; - - @org.junit.Test - public void testContinueValid() { - GContinueValidationRule rule=new GContinueValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolDefinition gpd1=new GProtocolDefinition(); - module.getProtocols().add(gpd1); - - GBlock block=new GBlock(); - gpd1.setBlock(block); - - GRecursion recur=new GRecursion(); - recur.setLabel(LABEL1); - block.add(recur); - - GContinue cont=new GContinue(); - cont.setLabel(LABEL1); - recur.getBlock().add(cont); - - ModuleContext context=new DefaultModuleContext(null, null, null); - - rule.validate(context, cont, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testContinueNotBound() { - GContinueValidationRule rule=new GContinueValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolDefinition gpd1=new GProtocolDefinition(); - module.getProtocols().add(gpd1); - - GBlock block=new GBlock(); - gpd1.setBlock(block); - - GRecursion recur=new GRecursion(); - recur.setLabel(LABEL1); - block.add(recur); - - GContinue cont=new GContinue(); - cont.setLabel(LABEL2); - recur.getBlock().add(cont); - - ModuleContext context=new DefaultModuleContext(null, null, null); - - rule.validate(context, cont, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("LABEL_NOT_BOUND"), LABEL2))) { - fail("Error LABEL_NOT_BOUND not detected"); - } - } - - @org.junit.Test - public void testContinueContainedInParallel() { - GContinueValidationRule rule=new GContinueValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolDefinition gpd1=new GProtocolDefinition(); - module.getProtocols().add(gpd1); - - GBlock block=new GBlock(); - gpd1.setBlock(block); - - GRecursion recur=new GRecursion(); - recur.setLabel(LABEL1); - block.add(recur); - - GParallel par=new GParallel(); - recur.getBlock().add(par); - - GBlock p1=new GBlock(); - par.getPaths().add(p1); - - GContinue cont=new GContinue(); - cont.setLabel(LABEL1); - p1.add(cont); - - ModuleContext context=new DefaultModuleContext(null, null, null); - - rule.validate(context, cont, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(ValidationMessages.getMessage("LABEL_CONTAINED_IN_PARALLEL"))) { - fail("Error LABEL_CONTAINED_IN_PARALLEL not detected"); - } - } - - @org.junit.Test - public void testContinueContainedInInterruptible() { - GContinueValidationRule rule=new GContinueValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolDefinition gpd1=new GProtocolDefinition(); - module.getProtocols().add(gpd1); - - GBlock block=new GBlock(); - gpd1.setBlock(block); - - GRecursion recur=new GRecursion(); - recur.setLabel(LABEL1); - block.add(recur); - - GInterruptible interrupt=new GInterruptible(); - recur.getBlock().add(interrupt); - - GBlock p1=new GBlock(); - interrupt.getBlock().add(p1); - - GContinue cont=new GContinue(); - cont.setLabel(LABEL1); - p1.add(cont); - - ModuleContext context=new DefaultModuleContext(null, null, null); - - rule.validate(context, cont, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(ValidationMessages.getMessage("LABEL_CONTAINED_IN_INTERRUPTIBLE"))) { - fail("Error LABEL_CONTAINED_IN_INTERRUPTIBLE not detected"); - } - } -} diff --git a/modules/validation/src/test/java/org/scribble/validation/rules/GDoValidationRuleTest.java b/modules/validation/src/test/java/org/scribble/validation/rules/GDoValidationRuleTest.java deleted file mode 100644 index 10b7a2bd7..000000000 --- a/modules/validation/src/test/java/org/scribble/validation/rules/GDoValidationRuleTest.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import static org.junit.Assert.*; - -import java.text.MessageFormat; - -import org.scribble.context.DefaultModuleContext; -import org.scribble.context.ModuleContext; -import org.scribble.model.ModelObject; -import org.scribble.model.Module; -import org.scribble.model.global.GBlock; -import org.scribble.model.global.GDo; -import org.scribble.model.global.GProtocolDefinition; -import org.scribble.validation.TestValidationLogger; -import org.scribble.validation.rules.GDoValidationRule; - -public class GDoValidationRuleTest { - - private static final String PROTOCOL2 = "Protocol2"; - private static final String PROTOCOL1 = "Protocol1"; - - @org.junit.Test - public void testValidDo() { - GDoValidationRule rule=new GDoValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolDefinition gpd1=new GProtocolDefinition(); - gpd1.setName(PROTOCOL1); - - module.getProtocols().add(gpd1); - - GBlock block=new GBlock(); - gpd1.setBlock(block); - - GDo gdo=new GDo(); - gdo.setProtocol(PROTOCOL2); - block.add(gdo); - - ModuleContext context=new DefaultModuleContext(null, null, null) { - - public ModelObject getMember(String fqn) { - return new GProtocolDefinition(); - } - }; - - rule.validate(context, gdo, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testUnknownProtocol() { - GDoValidationRule rule=new GDoValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolDefinition gpd1=new GProtocolDefinition(); - gpd1.setName(PROTOCOL1); - - module.getProtocols().add(gpd1); - - GBlock block=new GBlock(); - gpd1.setBlock(block); - - GDo gdo=new GDo(); - gdo.setProtocol(PROTOCOL2); - block.add(gdo); - - ModuleContext context=new DefaultModuleContext(null, null, null) { - - public ModelObject getMember(String fqn) { - return null; - } - }; - - rule.validate(context, gdo, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("UNKNOWN_PROTOCOL"), PROTOCOL2))) { - fail("Error UNKNOWN_PROTOCOL not detected"); - } - } -} diff --git a/modules/validation/src/test/java/org/scribble/validation/rules/GInterruptibleValidationRuleTest.java b/modules/validation/src/test/java/org/scribble/validation/rules/GInterruptibleValidationRuleTest.java deleted file mode 100644 index 436d94756..000000000 --- a/modules/validation/src/test/java/org/scribble/validation/rules/GInterruptibleValidationRuleTest.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import static org.junit.Assert.*; - -import java.text.MessageFormat; - -import org.scribble.model.Message; -import org.scribble.model.Module; -import org.scribble.model.Role; -import org.scribble.model.RoleDecl; -import org.scribble.model.global.GBlock; -import org.scribble.model.global.GInterruptible; -import org.scribble.model.global.GProtocolDefinition; -import org.scribble.validation.TestValidationLogger; -import org.scribble.validation.rules.GInterruptibleValidationRule; - -public class GInterruptibleValidationRuleTest { - - private static final String TEST_ROLE1 = "TestRole1"; - private static final String TEST_ROLE2 = "TestRole2"; - - @org.junit.Test - public void testRoleFound() { - GInterruptibleValidationRule rule=new GInterruptibleValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolDefinition gpd=new GProtocolDefinition(); - - RoleDecl rd=new RoleDecl(); - rd.setName(TEST_ROLE1); - gpd.getRoleDeclarations().add(rd); - - module.getProtocols().add(gpd); - - GBlock block=new GBlock(); - gpd.setBlock(block); - - GInterruptible gm=new GInterruptible(); - - GInterruptible.Interrupt in=new GInterruptible.Interrupt(); - in.setRole(new Role(TEST_ROLE1)); - - Message message=new Message(); - in.getMessages().add(message); - - gm.getInterrupts().add(in); - - block.add(gm); - - rule.validate(null, gm, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testRoleNotFound() { - GInterruptibleValidationRule rule=new GInterruptibleValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolDefinition gpd=new GProtocolDefinition(); - - RoleDecl rd=new RoleDecl(); - rd.setName(TEST_ROLE1); - gpd.getRoleDeclarations().add(rd); - - module.getProtocols().add(gpd); - - GBlock block=new GBlock(); - gpd.setBlock(block); - - GInterruptible gm=new GInterruptible(); - - GInterruptible.Interrupt in=new GInterruptible.Interrupt(); - in.setRole(new Role(TEST_ROLE2)); - - Message message=new Message(); - in.getMessages().add(message); - - gm.getInterrupts().add(in); - - block.add(gm); - - rule.validate(null, gm, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("UNKNOWN_ROLE"), TEST_ROLE2))) { - fail("Error UNKNOWN_ROLE not detected"); - } - } - -} diff --git a/modules/validation/src/test/java/org/scribble/validation/rules/GMessageTransferValidationRuleTest.java b/modules/validation/src/test/java/org/scribble/validation/rules/GMessageTransferValidationRuleTest.java deleted file mode 100644 index 211f3934e..000000000 --- a/modules/validation/src/test/java/org/scribble/validation/rules/GMessageTransferValidationRuleTest.java +++ /dev/null @@ -1,257 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import static org.junit.Assert.*; - -import java.text.MessageFormat; - -import org.scribble.model.Message; -import org.scribble.model.Module; -import org.scribble.model.Role; -import org.scribble.model.RoleDecl; -import org.scribble.model.global.GBlock; -import org.scribble.model.global.GMessageTransfer; -import org.scribble.model.global.GProtocolDefinition; -import org.scribble.validation.TestValidationLogger; -import org.scribble.validation.rules.GMessageTransferValidationRule; - -public class GMessageTransferValidationRuleTest { - - private static final String TEST_ROLE1 = "TestRole1"; - private static final String TEST_ROLE2 = "TestRole2"; - - @org.junit.Test - public void testFromRoleFound() { - GMessageTransferValidationRule rule=new GMessageTransferValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolDefinition gpd=new GProtocolDefinition(); - - RoleDecl rd=new RoleDecl(); - rd.setName(TEST_ROLE1); - gpd.getRoleDeclarations().add(rd); - - module.getProtocols().add(gpd); - - GBlock block=new GBlock(); - gpd.setBlock(block); - - GMessageTransfer gm=new GMessageTransfer(); - gm.setFromRole(new Role(TEST_ROLE1)); - block.add(gm); - - Message message=new Message(); - gm.setMessage(message); - - rule.validate(null, gm, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testFromRoleNotFound() { - GMessageTransferValidationRule rule=new GMessageTransferValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolDefinition gpd=new GProtocolDefinition(); - - RoleDecl rd=new RoleDecl(); - rd.setName(TEST_ROLE1); - gpd.getRoleDeclarations().add(rd); - - module.getProtocols().add(gpd); - - GBlock block=new GBlock(); - gpd.setBlock(block); - - GMessageTransfer gm=new GMessageTransfer(); - gm.setFromRole(new Role(TEST_ROLE2)); - block.add(gm); - - Message message=new Message(); - gm.setMessage(message); - - rule.validate(null, gm, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("UNKNOWN_ROLE"), TEST_ROLE2))) { - fail("Error UNKNOWN_ROLE not detected"); - } - } - - @org.junit.Test - public void testToRoleFound() { - GMessageTransferValidationRule rule=new GMessageTransferValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolDefinition gpd=new GProtocolDefinition(); - - RoleDecl rd=new RoleDecl(); - rd.setName(TEST_ROLE1); - gpd.getRoleDeclarations().add(rd); - - module.getProtocols().add(gpd); - - GBlock block=new GBlock(); - gpd.setBlock(block); - - GMessageTransfer gm=new GMessageTransfer(); - gm.getToRoles().add(new Role(TEST_ROLE1)); - block.add(gm); - - Message message=new Message(); - gm.setMessage(message); - - rule.validate(null, gm, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testToRoleNotFound() { - GMessageTransferValidationRule rule=new GMessageTransferValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolDefinition gpd=new GProtocolDefinition(); - - RoleDecl rd=new RoleDecl(); - rd.setName(TEST_ROLE1); - gpd.getRoleDeclarations().add(rd); - - module.getProtocols().add(gpd); - - GBlock block=new GBlock(); - gpd.setBlock(block); - - GMessageTransfer gm=new GMessageTransfer(); - gm.getToRoles().add(new Role(TEST_ROLE2)); - block.add(gm); - - Message message=new Message(); - gm.setMessage(message); - - rule.validate(null, gm, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("UNKNOWN_ROLE"), TEST_ROLE2))) { - fail("Error UNKNOWN_ROLE not detected"); - } - } - - @org.junit.Test - public void testToRolesDistinct() { - GMessageTransferValidationRule rule=new GMessageTransferValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolDefinition gpd=new GProtocolDefinition(); - - RoleDecl rd1=new RoleDecl(); - rd1.setName(TEST_ROLE1); - gpd.getRoleDeclarations().add(rd1); - - RoleDecl rd2=new RoleDecl(); - rd2.setName(TEST_ROLE2); - gpd.getRoleDeclarations().add(rd2); - - module.getProtocols().add(gpd); - - GBlock block=new GBlock(); - gpd.setBlock(block); - - GMessageTransfer gm=new GMessageTransfer(); - gm.getToRoles().add(new Role(TEST_ROLE1)); - gm.getToRoles().add(new Role(TEST_ROLE2)); - block.add(gm); - - Message message=new Message(); - gm.setMessage(message); - - rule.validate(null, gm, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testToRolesNotDistinct() { - GMessageTransferValidationRule rule=new GMessageTransferValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolDefinition gpd=new GProtocolDefinition(); - - RoleDecl rd1=new RoleDecl(); - rd1.setName(TEST_ROLE1); - gpd.getRoleDeclarations().add(rd1); - - RoleDecl rd2=new RoleDecl(); - rd2.setName(TEST_ROLE2); - gpd.getRoleDeclarations().add(rd2); - - module.getProtocols().add(gpd); - - GBlock block=new GBlock(); - gpd.setBlock(block); - - GMessageTransfer gm=new GMessageTransfer(); - gm.getToRoles().add(new Role(TEST_ROLE1)); - gm.getToRoles().add(new Role(TEST_ROLE1)); - block.add(gm); - - Message message=new Message(); - gm.setMessage(message); - - rule.validate(null, gm, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("ROLE_NOT_DISTINCT"), TEST_ROLE1))) { - fail("Error ROLE_NOT_DISTINCT not detected"); - } - } -} diff --git a/modules/validation/src/test/java/org/scribble/validation/rules/GParallelValidationRuleTest.java b/modules/validation/src/test/java/org/scribble/validation/rules/GParallelValidationRuleTest.java deleted file mode 100644 index 747140ad4..000000000 --- a/modules/validation/src/test/java/org/scribble/validation/rules/GParallelValidationRuleTest.java +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import static org.junit.Assert.*; - -import java.text.MessageFormat; - -import org.scribble.model.Message; -import org.scribble.model.MessageSignature; -import org.scribble.model.Module; -import org.scribble.model.Role; -import org.scribble.model.RoleDecl; -import org.scribble.model.global.GBlock; -import org.scribble.model.global.GMessageTransfer; -import org.scribble.model.global.GParallel; -import org.scribble.model.global.GProtocolDefinition; -import org.scribble.validation.TestValidationLogger; - -public class GParallelValidationRuleTest { - - private static final String OP1 = "op1"; - private static final String OP2 = "op2"; - private static final String TEST_ROLE1 = "TestRole1"; - private static final String TEST_ROLE2 = "TestRole2"; - private static final String TEST_ROLE3 = "TestRole3"; - - @org.junit.Test - public void testParallelValid() { - GParallelValidationRule rule=new GParallelValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolDefinition gpd=new GProtocolDefinition(); - module.getProtocols().add(gpd); - - RoleDecl rd1=new RoleDecl(); - rd1.setName(TEST_ROLE1); - gpd.getRoleDeclarations().add(rd1); - - RoleDecl rd2=new RoleDecl(); - rd2.setName(TEST_ROLE2); - gpd.getRoleDeclarations().add(rd2); - - RoleDecl rd3=new RoleDecl(); - rd3.setName(TEST_ROLE3); - gpd.getRoleDeclarations().add(rd3); - - GBlock block=new GBlock(); - gpd.setBlock(block); - - GParallel par=new GParallel(); - block.add(par); - - GBlock b1=new GBlock(); - par.getPaths().add(b1); - - GMessageTransfer mt1=new GMessageTransfer(); - - MessageSignature sig1=new MessageSignature(); - sig1.setOperator(OP1); - - Message m1=new Message(); - m1.setMessageSignature(sig1); - - mt1.setMessage(m1); - mt1.setFromRole(new Role(TEST_ROLE1)); - mt1.getToRoles().add(new Role(TEST_ROLE2)); - b1.add(mt1); - - GBlock b2=new GBlock(); - par.getPaths().add(b2); - - GMessageTransfer mt2=new GMessageTransfer(); - - MessageSignature sig2=new MessageSignature(); - sig2.setOperator(OP2); - - Message m2=new Message(); - m2.setMessageSignature(sig2); - - mt2.setMessage(m2); - mt2.setFromRole(new Role(TEST_ROLE1)); - mt2.getToRoles().add(new Role(TEST_ROLE2)); - b2.add(mt2); - - rule.validate(null, par, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testInteractionInConncurrentPath() { - GParallelValidationRule rule=new GParallelValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolDefinition gpd=new GProtocolDefinition(); - module.getProtocols().add(gpd); - - RoleDecl rd1=new RoleDecl(); - rd1.setName(TEST_ROLE1); - gpd.getRoleDeclarations().add(rd1); - - RoleDecl rd2=new RoleDecl(); - rd2.setName(TEST_ROLE2); - gpd.getRoleDeclarations().add(rd2); - - RoleDecl rd3=new RoleDecl(); - rd3.setName(TEST_ROLE3); - gpd.getRoleDeclarations().add(rd3); - - GBlock block=new GBlock(); - gpd.setBlock(block); - - GParallel par=new GParallel(); - block.add(par); - - GBlock b1=new GBlock(); - par.getPaths().add(b1); - - GMessageTransfer mt1=new GMessageTransfer(); - - MessageSignature sig1=new MessageSignature(); - sig1.setOperator(OP1); - - Message m1=new Message(); - m1.setMessageSignature(sig1); - - mt1.setMessage(m1); - mt1.setFromRole(new Role(TEST_ROLE1)); - mt1.getToRoles().add(new Role(TEST_ROLE2)); - b1.add(mt1); - - GBlock b2=new GBlock(); - par.getPaths().add(b2); - - GMessageTransfer mt2=new GMessageTransfer(); - - MessageSignature sig2=new MessageSignature(); - sig2.setOperator(OP2); - - Message m2=new Message(); - m2.setMessageSignature(sig2); - - mt2.setMessage(m2); - mt2.setFromRole(new Role(TEST_ROLE1)); - mt2.getToRoles().add(new Role(TEST_ROLE2)); - b2.add(mt2); - - GMessageTransfer mt3=new GMessageTransfer(); - - MessageSignature sig3=new MessageSignature(); - sig3.setOperator(OP1); - - Message m3=new Message(); - m3.setMessageSignature(sig3); - - mt3.setMessage(m3); - mt3.setFromRole(new Role(TEST_ROLE1)); - mt3.getToRoles().add(new Role(TEST_ROLE2)); - b2.add(mt3); - - rule.validate(null, par, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("INTERACTION_IN_CONCURRENT_PATHS"), - mt1))) { - fail("Error INTERACTION_IN_CONCURRENT_PATHS not detected"); - } - } -} diff --git a/modules/validation/src/test/java/org/scribble/validation/rules/GProtocolDefinitionValidationRuleTest.java b/modules/validation/src/test/java/org/scribble/validation/rules/GProtocolDefinitionValidationRuleTest.java deleted file mode 100644 index 648911e92..000000000 --- a/modules/validation/src/test/java/org/scribble/validation/rules/GProtocolDefinitionValidationRuleTest.java +++ /dev/null @@ -1,324 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import static org.junit.Assert.*; - -import java.text.MessageFormat; - -import org.scribble.context.DefaultModuleContext; -import org.scribble.model.Message; -import org.scribble.model.MessageSignature; -import org.scribble.model.Module; -import org.scribble.model.ParameterDecl; -import org.scribble.model.PayloadElement; -import org.scribble.model.RoleDecl; -import org.scribble.model.global.GDo; -import org.scribble.model.global.GInterruptible; -import org.scribble.model.global.GMessageTransfer; -import org.scribble.model.global.GProtocolDefinition; -import org.scribble.validation.TestValidationLogger; - -public class GProtocolDefinitionValidationRuleTest { - - private static final String NAME2 = "name2"; - private static final String NAME1 = "name1"; - - @org.junit.Test - public void testRoleNamesDistinct() { - GProtocolDefinitionValidationRule rule=new GProtocolDefinitionValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - - GProtocolDefinition gpd=new GProtocolDefinition(); - module.getProtocols().add(gpd); - - RoleDecl rd1=new RoleDecl(); - rd1.setName(NAME1); - - RoleDecl rd2=new RoleDecl(); - rd2.setName(NAME2); - - gpd.getRoleDeclarations().add(rd1); - gpd.getRoleDeclarations().add(rd2); - - DefaultModuleContext context=new DefaultModuleContext(null, null, null); - - rule.validate(context, gpd, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testRoleNamesNotDistinct() { - GProtocolDefinitionValidationRule rule=new GProtocolDefinitionValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - - GProtocolDefinition gpd=new GProtocolDefinition(); - module.getProtocols().add(gpd); - - RoleDecl rd1=new RoleDecl(); - rd1.setName(NAME1); - - RoleDecl rd2=new RoleDecl(); - rd2.setName(NAME1); - - gpd.getRoleDeclarations().add(rd1); - gpd.getRoleDeclarations().add(rd2); - - DefaultModuleContext context=new DefaultModuleContext(null, null, null); - - rule.validate(context, gpd, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("ROLE_NAME_NOT_DISTINCT"), NAME1))) { - fail("Error ROLE_NAME_NOT_DISTINCT not detected"); - } - } - - @org.junit.Test - public void testParameterNamesDistinct() { - GProtocolDefinitionValidationRule rule=new GProtocolDefinitionValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - - GProtocolDefinition gpd=new GProtocolDefinition(); - module.getProtocols().add(gpd); - - ParameterDecl pd1=new ParameterDecl(); - pd1.setName(NAME1); - - ParameterDecl pd2=new ParameterDecl(); - pd2.setName(NAME2); - - gpd.getParameterDeclarations().add(pd1); - gpd.getParameterDeclarations().add(pd2); - - DefaultModuleContext context=new DefaultModuleContext(null, null, null); - - rule.validate(context, gpd, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testParameterNamesNotDistinct() { - GProtocolDefinitionValidationRule rule=new GProtocolDefinitionValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - - GProtocolDefinition gpd=new GProtocolDefinition(); - module.getProtocols().add(gpd); - - ParameterDecl pd1=new ParameterDecl(); - pd1.setName(NAME1); - - ParameterDecl pd2=new ParameterDecl(); - pd2.setName(NAME1); - - gpd.getParameterDeclarations().add(pd1); - gpd.getParameterDeclarations().add(pd2); - - DefaultModuleContext context=new DefaultModuleContext(null, null, null); - - rule.validate(context, gpd, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("PARAMETER_NAME_NOT_DISTINCT"), NAME1))) { - fail("Error PARAMETER_NAME_NOT_DISTINCT not detected"); - } - } - - @org.junit.Test - public void testScopesDistinct() { - GProtocolDefinitionValidationRule rule=new GProtocolDefinitionValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - - GProtocolDefinition gpd=new GProtocolDefinition(); - module.getProtocols().add(gpd); - - GInterruptible i1=new GInterruptible(); - gpd.getBlock().add(i1); - - i1.setScope(NAME1); - - GDo d1=new GDo(); - gpd.getBlock().add(d1); - - d1.setScope(NAME2); - - - DefaultModuleContext context=new DefaultModuleContext(null, null, null); - - rule.validate(context, gpd, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testScopesNotDistinct() { - GProtocolDefinitionValidationRule rule=new GProtocolDefinitionValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - - GProtocolDefinition gpd=new GProtocolDefinition(); - module.getProtocols().add(gpd); - - GInterruptible i1=new GInterruptible(); - gpd.getBlock().add(i1); - - i1.setScope(NAME1); - - GDo d1=new GDo(); - gpd.getBlock().add(d1); - - d1.setScope(NAME1); - - - DefaultModuleContext context=new DefaultModuleContext(null, null, null); - - rule.validate(context, gpd, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("SCOPE_NOT_DISTINCT"), NAME1))) { - fail("Error SCOPE_NOT_DISTINCT not detected"); - } - } - - @org.junit.Test - public void testAnnotationsDistinct() { - GProtocolDefinitionValidationRule rule=new GProtocolDefinitionValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - - GProtocolDefinition gpd=new GProtocolDefinition(); - module.getProtocols().add(gpd); - - GMessageTransfer mt1=new GMessageTransfer(); - gpd.getBlock().add(mt1); - - Message m1=new Message(); - mt1.setMessage(m1); - - MessageSignature ms1=new MessageSignature(); - m1.setMessageSignature(ms1); - - PayloadElement pe1=new PayloadElement(); - ms1.getPayloadElements().add(pe1); - - pe1.setAnnotation(NAME1); - - GMessageTransfer mt2=new GMessageTransfer(); - gpd.getBlock().add(mt2); - - Message m2=new Message(); - mt2.setMessage(m2); - - MessageSignature ms2=new MessageSignature(); - m2.setMessageSignature(ms2); - - PayloadElement pe2=new PayloadElement(); - ms2.getPayloadElements().add(pe2); - - pe2.setAnnotation(NAME2); - - - DefaultModuleContext context=new DefaultModuleContext(null, null, null); - - rule.validate(context, gpd, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testAnnotationsNotDistinct() { - GProtocolDefinitionValidationRule rule=new GProtocolDefinitionValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - - GProtocolDefinition gpd=new GProtocolDefinition(); - module.getProtocols().add(gpd); - - GMessageTransfer mt1=new GMessageTransfer(); - gpd.getBlock().add(mt1); - - Message m1=new Message(); - mt1.setMessage(m1); - - MessageSignature ms1=new MessageSignature(); - m1.setMessageSignature(ms1); - - PayloadElement pe1=new PayloadElement(); - ms1.getPayloadElements().add(pe1); - - pe1.setAnnotation(NAME1); - - GMessageTransfer mt2=new GMessageTransfer(); - gpd.getBlock().add(mt2); - - Message m2=new Message(); - mt2.setMessage(m2); - - MessageSignature ms2=new MessageSignature(); - m2.setMessageSignature(ms2); - - PayloadElement pe2=new PayloadElement(); - ms2.getPayloadElements().add(pe2); - - pe2.setAnnotation(NAME1); - - - DefaultModuleContext context=new DefaultModuleContext(null, null, null); - - rule.validate(context, gpd, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("ANNOTATION_NOT_DISTINCT"), NAME1))) { - fail("Error ANNOTATION_NOT_DISTINCT not detected"); - } - } -} diff --git a/modules/validation/src/test/java/org/scribble/validation/rules/GProtocolInstanceValidationRuleTest.java b/modules/validation/src/test/java/org/scribble/validation/rules/GProtocolInstanceValidationRuleTest.java deleted file mode 100644 index 1224f8e00..000000000 --- a/modules/validation/src/test/java/org/scribble/validation/rules/GProtocolInstanceValidationRuleTest.java +++ /dev/null @@ -1,590 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import static org.junit.Assert.*; - -import java.text.MessageFormat; - -import org.scribble.context.DefaultModuleContext; -import org.scribble.context.ModuleContext; -import org.scribble.model.Argument; -import org.scribble.model.ModelObject; -import org.scribble.model.Module; -import org.scribble.model.ParameterDecl; -import org.scribble.model.PayloadTypeDecl; -import org.scribble.model.Role; -import org.scribble.model.RoleDecl; -import org.scribble.model.RoleInstantiation; -import org.scribble.model.global.GProtocolDefinition; -import org.scribble.model.global.GProtocolInstance; -import org.scribble.validation.TestValidationLogger; -import org.scribble.validation.rules.GProtocolInstanceValidationRule; - -public class GProtocolInstanceValidationRuleTest { - - private static final String TEST_NAME1 = "TestName1"; - private static final String TEST_NAME2 = "TestName2"; - private static final String TEST_NAME3 = "TestName3"; - private static final String TEST_MEMBER_NAME = "TestMemberName"; - - @org.junit.Test - public void testValidProtocolInstance() { - GProtocolInstanceValidationRule rule=new GProtocolInstanceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolInstance gpi=new GProtocolInstance(); - gpi.setMemberName(TEST_MEMBER_NAME); - module.getProtocols().add(gpi); - - ModuleContext context=new DefaultModuleContext(null, null, null) { - - public ModelObject getMember(String fqn) { - return new GProtocolDefinition(); - } - }; - - rule.validate(context, gpi, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testUnknownMemberName() { - GProtocolInstanceValidationRule rule=new GProtocolInstanceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolInstance gpi=new GProtocolInstance(); - gpi.setMemberName(TEST_MEMBER_NAME); - module.getProtocols().add(gpi); - - ModuleContext context=new DefaultModuleContext(null, null, null) { - - public ModelObject getMember(String fqn) { - return null; - } - }; - - rule.validate(context, gpi, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("UNKNOWN_MEMBER_NAME"), TEST_MEMBER_NAME))) { - fail("Error UNKNOWN_MEMBER_NAME not detected"); - } - } - - @org.junit.Test - public void testMemberNotProtocolDefinition() { - GProtocolInstanceValidationRule rule=new GProtocolInstanceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolInstance gpi=new GProtocolInstance(); - gpi.setMemberName(TEST_MEMBER_NAME); - module.getProtocols().add(gpi); - - ModuleContext context=new DefaultModuleContext(null, null, null) { - - public ModelObject getMember(String fqn) { - return new Role(); - } - }; - - rule.validate(context, gpi, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("MEMBER_NOT_PROTOCOL_DEFINITION"), TEST_MEMBER_NAME))) { - fail("Error MEMBER_NOT_PROTOCOL_DEFINITION not detected"); - } - } - - @org.junit.Test - public void testMismatchArguParamNum() { - GProtocolInstanceValidationRule rule=new GProtocolInstanceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolInstance gpi=new GProtocolInstance(); - gpi.setMemberName(TEST_MEMBER_NAME); - gpi.getArguments().add(new Argument()); - module.getProtocols().add(gpi); - - ModuleContext context=new DefaultModuleContext(null, null, null) { - - public ModelObject getMember(String fqn) { - return new GProtocolDefinition(); - } - }; - - rule.validate(context, gpi, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("ARG_NUM_MISMATCH"), 1, 0))) { - fail("Error ARG_NUM_MISMATCH not detected"); - } - } - - @org.junit.Test - public void testMismatchRoleNum() { - GProtocolInstanceValidationRule rule=new GProtocolInstanceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolInstance gpi=new GProtocolInstance(); - gpi.setMemberName(TEST_MEMBER_NAME); - gpi.getRoleInstantiations().add(new RoleInstantiation()); - module.getProtocols().add(gpi); - - ModuleContext context=new DefaultModuleContext(null, null, null) { - - public ModelObject getMember(String fqn) { - return new GProtocolDefinition(); - } - }; - - rule.validate(context, gpi, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("ROLE_NUM_MISMATCH"), 1, 0))) { - fail("Error ROLE_NUM_MISMATCH not detected"); - } - } - - @org.junit.Test - public void testRoleDeclared() { - GProtocolInstanceValidationRule rule=new GProtocolInstanceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolInstance gpi=new GProtocolInstance(); - gpi.setMemberName(TEST_MEMBER_NAME); - - RoleDecl rd=new RoleDecl(); - rd.setName(TEST_NAME1); - gpi.getRoleDeclarations().add(rd); - - RoleInstantiation ri=new RoleInstantiation(); - ri.setName(TEST_NAME1); - gpi.getRoleInstantiations().add(ri); - - module.getProtocols().add(gpi); - - ModuleContext context=new DefaultModuleContext(null, null, null) { - - public ModelObject getMember(String fqn) { - GProtocolDefinition ret=new GProtocolDefinition(); - ret.getRoleDeclarations().add(new RoleDecl()); - return ret; - } - }; - - rule.validate(context, gpi, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testRoleNotDeclared() { - GProtocolInstanceValidationRule rule=new GProtocolInstanceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolInstance gpi=new GProtocolInstance(); - gpi.setMemberName(TEST_MEMBER_NAME); - - RoleInstantiation ri=new RoleInstantiation(); - ri.setName(TEST_NAME1); - - gpi.getRoleInstantiations().add(ri); - module.getProtocols().add(gpi); - - ModuleContext context=new DefaultModuleContext(null, null, null) { - - public ModelObject getMember(String fqn) { - GProtocolDefinition ret=new GProtocolDefinition(); - ret.getRoleDeclarations().add(new RoleDecl()); - return ret; - } - }; - - rule.validate(context, gpi, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("ROLE_NOT_DECLARED"), TEST_NAME1))) { - fail("Error ROLE_NOT_DECLARED not detected"); - } - } - - @org.junit.Test - public void testRoleNotDistinct() { - GProtocolInstanceValidationRule rule=new GProtocolInstanceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolInstance gpi=new GProtocolInstance(); - gpi.setMemberName(TEST_MEMBER_NAME); - - RoleDecl rd=new RoleDecl(); - rd.setName(TEST_NAME1); - gpi.getRoleDeclarations().add(rd); - - RoleInstantiation ri1=new RoleInstantiation(); - ri1.setName(TEST_NAME1); - gpi.getRoleInstantiations().add(ri1); - - RoleInstantiation ri2=new RoleInstantiation(); - ri2.setName(TEST_NAME1); - gpi.getRoleInstantiations().add(ri2); - - module.getProtocols().add(gpi); - - ModuleContext context=new DefaultModuleContext(null, null, null) { - - public ModelObject getMember(String fqn) { - GProtocolDefinition ret=new GProtocolDefinition(); - ret.getRoleDeclarations().add(new RoleDecl()); - return ret; - } - }; - - rule.validate(context, gpi, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("ROLE_NOT_DISTINCT"), TEST_NAME1))) { - fail("Error ROLE_NOT_DISTINCT not detected"); - } - } - - @org.junit.Test - public void testRoleAliasDeclared() { - GProtocolInstanceValidationRule rule=new GProtocolInstanceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolInstance gpi=new GProtocolInstance(); - gpi.setMemberName(TEST_MEMBER_NAME); - - RoleDecl rd=new RoleDecl(); - rd.setName(TEST_NAME1); - gpi.getRoleDeclarations().add(rd); - - RoleInstantiation ri=new RoleInstantiation(); - ri.setName(TEST_NAME1); - ri.setAlias(TEST_NAME2); - gpi.getRoleInstantiations().add(ri); - - module.getProtocols().add(gpi); - - ModuleContext context=new DefaultModuleContext(null, null, null) { - - public ModelObject getMember(String fqn) { - GProtocolDefinition ret=new GProtocolDefinition(); - RoleDecl rd=new RoleDecl(); - rd.setName(TEST_NAME2); - ret.getRoleDeclarations().add(rd); - return ret; - } - }; - - rule.validate(context, gpi, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testRoleAliasNotDeclared() { - GProtocolInstanceValidationRule rule=new GProtocolInstanceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolInstance gpi=new GProtocolInstance(); - gpi.setMemberName(TEST_MEMBER_NAME); - - RoleDecl rd=new RoleDecl(); - rd.setName(TEST_NAME1); - gpi.getRoleDeclarations().add(rd); - - RoleInstantiation ri=new RoleInstantiation(); - ri.setName(TEST_NAME1); - ri.setAlias(TEST_NAME2); - - gpi.getRoleInstantiations().add(ri); - module.getProtocols().add(gpi); - - ModuleContext context=new DefaultModuleContext(null, null, null) { - - public ModelObject getMember(String fqn) { - GProtocolDefinition ret=new GProtocolDefinition(); - RoleDecl rd=new RoleDecl(); - rd.setName(TEST_NAME3); - ret.getRoleDeclarations().add(rd); - return ret; - } - }; - - rule.validate(context, gpi, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("ROLE_ALIAS_NOT_DECLARED"), TEST_NAME2))) { - fail("Error ROLE_ALIAS_NOT_DECLARED not detected"); - } - } - - @org.junit.Test - public void testArgDeclaredAsParameter() { - GProtocolInstanceValidationRule rule=new GProtocolInstanceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolInstance gpi=new GProtocolInstance(); - gpi.setMemberName(TEST_MEMBER_NAME); - - ParameterDecl pd=new ParameterDecl(); - pd.setName(TEST_NAME1); - gpi.getParameterDeclarations().add(pd); - - Argument arg=new Argument(); - arg.setName(TEST_NAME1); - gpi.getArguments().add(arg); - - module.getProtocols().add(gpi); - - ModuleContext context=new DefaultModuleContext(null, null, null) { - - public ModelObject getMember(String fqn) { - GProtocolDefinition ret=new GProtocolDefinition(); - ret.getParameterDeclarations().add(new ParameterDecl()); - return ret; - } - }; - - rule.validate(context, gpi, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testArgDeclaredAsPayloadType() { - GProtocolInstanceValidationRule rule=new GProtocolInstanceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - PayloadTypeDecl ptd=new PayloadTypeDecl(); - ptd.setAlias(TEST_NAME1); - module.getPayloadTypeDeclarations().add(ptd); - - GProtocolInstance gpi=new GProtocolInstance(); - gpi.setMemberName(TEST_MEMBER_NAME); - - Argument arg=new Argument(); - arg.setName(TEST_NAME1); - gpi.getArguments().add(arg); - - module.getProtocols().add(gpi); - - ModuleContext context=new DefaultModuleContext(null, null, null) { - - public ModelObject getMember(String fqn) { - GProtocolDefinition ret=new GProtocolDefinition(); - ret.getParameterDeclarations().add(new ParameterDecl()); - return ret; - } - }; - - rule.validate(context, gpi, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testParameterAndPayloadTypeNotDeclared() { - GProtocolInstanceValidationRule rule=new GProtocolInstanceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolInstance gpi=new GProtocolInstance(); - gpi.setMemberName(TEST_MEMBER_NAME); - - Argument arg=new Argument(); - arg.setName(TEST_NAME1); - - gpi.getArguments().add(arg); - module.getProtocols().add(gpi); - - ModuleContext context=new DefaultModuleContext(null, null, null) { - - public ModelObject getMember(String fqn) { - GProtocolDefinition ret=new GProtocolDefinition(); - ret.getParameterDeclarations().add(new ParameterDecl()); - return ret; - } - }; - - rule.validate(context, gpi, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("ARG_NOT_DECLARED"), TEST_NAME1))) { - fail("Error ARG_NOT_DECLARED not detected"); - } - } - - @org.junit.Test - public void testArgAliasDeclared() { - GProtocolInstanceValidationRule rule=new GProtocolInstanceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolInstance gpi=new GProtocolInstance(); - gpi.setMemberName(TEST_MEMBER_NAME); - - ParameterDecl pd=new ParameterDecl(); - pd.setName(TEST_NAME1); - gpi.getParameterDeclarations().add(pd); - - Argument arg=new Argument(); - arg.setName(TEST_NAME1); - arg.setAlias(TEST_NAME2); - gpi.getArguments().add(arg); - - module.getProtocols().add(gpi); - - ModuleContext context=new DefaultModuleContext(null, null, null) { - - public ModelObject getMember(String fqn) { - GProtocolDefinition ret=new GProtocolDefinition(); - ParameterDecl pd=new ParameterDecl(); - pd.setName(TEST_NAME2); - ret.getParameterDeclarations().add(pd); - return ret; - } - }; - - rule.validate(context, gpi, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testArgAliasNotDeclared() { - GProtocolInstanceValidationRule rule=new GProtocolInstanceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolInstance gpi=new GProtocolInstance(); - gpi.setMemberName(TEST_MEMBER_NAME); - - ParameterDecl pd=new ParameterDecl(); - pd.setName(TEST_NAME1); - gpi.getParameterDeclarations().add(pd); - - Argument arg=new Argument(); - arg.setName(TEST_NAME1); - arg.setAlias(TEST_NAME2); - - gpi.getArguments().add(arg); - module.getProtocols().add(gpi); - - ModuleContext context=new DefaultModuleContext(null, null, null) { - - public ModelObject getMember(String fqn) { - GProtocolDefinition ret=new GProtocolDefinition(); - ParameterDecl pd=new ParameterDecl(); - pd.setName(TEST_NAME3); - ret.getParameterDeclarations().add(pd); - return ret; - } - }; - - rule.validate(context, gpi, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("ARG_ALIAS_NOT_DECLARED"), TEST_NAME2))) { - fail("Error ARG_ALIAS_NOT_DECLARED not detected"); - } - } -} diff --git a/modules/validation/src/test/java/org/scribble/validation/rules/GRecursionValidationRuleTest.java b/modules/validation/src/test/java/org/scribble/validation/rules/GRecursionValidationRuleTest.java deleted file mode 100644 index 50f7f5c19..000000000 --- a/modules/validation/src/test/java/org/scribble/validation/rules/GRecursionValidationRuleTest.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import static org.junit.Assert.*; - -import java.text.MessageFormat; - -import org.scribble.context.DefaultModuleContext; -import org.scribble.context.ModuleContext; -import org.scribble.model.Module; -import org.scribble.model.global.GBlock; -import org.scribble.model.global.GProtocolDefinition; -import org.scribble.model.global.GRecursion; -import org.scribble.validation.TestValidationLogger; - -public class GRecursionValidationRuleTest { - - private static final String LABEL1 = "label1"; - private static final String LABEL2 = "label2"; - - @org.junit.Test - public void testLabelsUnique() { - GRecursionValidationRule rule=new GRecursionValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolDefinition gpd1=new GProtocolDefinition(); - module.getProtocols().add(gpd1); - - GBlock block=new GBlock(); - gpd1.setBlock(block); - - GRecursion recur1=new GRecursion(); - recur1.setLabel(LABEL1); - block.add(recur1); - - GRecursion recur2=new GRecursion(); - recur2.setLabel(LABEL2); - block.add(recur2); - - ModuleContext context=new DefaultModuleContext(null, null, null); - - rule.validate(context, recur1, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testLabelNotUnique() { - GRecursionValidationRule rule=new GRecursionValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolDefinition gpd1=new GProtocolDefinition(); - module.getProtocols().add(gpd1); - - GBlock block=new GBlock(); - gpd1.setBlock(block); - - GRecursion recur1=new GRecursion(); - recur1.setLabel(LABEL1); - block.add(recur1); - - GRecursion recur2=new GRecursion(); - recur2.setLabel(LABEL1); - block.add(recur2); - - ModuleContext context=new DefaultModuleContext(null, null, null); - - rule.validate(context, recur1, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("LABEL_NOT_UNIQUE"), LABEL1))) { - fail("Error LABEL_NOT_UNIQUE not detected"); - } - } - -} diff --git a/modules/validation/src/test/java/org/scribble/validation/rules/ImportDeclValidationRuleTest.java b/modules/validation/src/test/java/org/scribble/validation/rules/ImportDeclValidationRuleTest.java deleted file mode 100644 index be19f0ec0..000000000 --- a/modules/validation/src/test/java/org/scribble/validation/rules/ImportDeclValidationRuleTest.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import static org.junit.Assert.*; - -import java.text.MessageFormat; - -import org.scribble.context.DefaultModuleContext; -import org.scribble.context.DefaultModuleLoader; -import org.scribble.model.ImportDecl; -import org.scribble.model.Module; -import org.scribble.model.ProtocolDecl; -import org.scribble.model.global.GProtocolDefinition; -import org.scribble.validation.TestValidationLogger; -import org.scribble.validation.rules.ImportDeclValidationRule; - -public class ImportDeclValidationRuleTest { - - @org.junit.Test - public void testImportDeclValid() { - ImportDeclValidationRule rule=new ImportDeclValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - DefaultModuleLoader loader=new DefaultModuleLoader(); - DefaultModuleContext context=new DefaultModuleContext(null, null, loader); - - Module impmodule=new Module(); - impmodule.setName("a.b.c"); - loader.registerModule(impmodule); - - ImportDecl elem=new ImportDecl(); - elem.setModuleName("a.b.c"); - - rule.validate(context, elem, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testImportDeclNoModule() { - ImportDeclValidationRule rule=new ImportDeclValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - DefaultModuleContext context=new DefaultModuleContext(null, null, null); - - ImportDecl elem=new ImportDecl(); - - rule.validate(context, elem, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(ValidationMessages.getMessage("NO_MODULE"))) { - fail("Error NO_MODULE not detected"); - } - } - - @org.junit.Test - public void testImportDeclNotFoundModule() { - ImportDeclValidationRule rule=new ImportDeclValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - DefaultModuleContext context=new DefaultModuleContext(null, null, null); - - ImportDecl elem=new ImportDecl(); - elem.setModuleName("a.b.c"); - - rule.validate(context, elem, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("NOT_FOUND_MODULE"), "a.b.c"))) { - fail("Error NOT_FOUND_MODULE not detected"); - } - } - - @org.junit.Test - public void testImportDeclNotFoundMember() { - ImportDeclValidationRule rule=new ImportDeclValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - DefaultModuleLoader loader=new DefaultModuleLoader(); - DefaultModuleContext context=new DefaultModuleContext(null, null, loader); - - Module impmodule=new Module(); - impmodule.setName("a.b.c"); - loader.registerModule(impmodule); - - ImportDecl elem=new ImportDecl(); - elem.setModuleName("a.b.c"); - elem.setMemberName("Test"); - - rule.validate(context, elem, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("NOT_FOUND_MEMBER"), "Test", "a.b.c"))) { - fail("Error NOT_FOUND_MEMBER not detected"); - } - } - - @org.junit.Test - public void testImportDeclExistsAlias() { - ImportDeclValidationRule rule=new ImportDeclValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - DefaultModuleLoader loader=new DefaultModuleLoader(); - DefaultModuleContext context=new DefaultModuleContext(null, null, loader); - - Module m=new Module(); - m.setName("a.b.c"); - ProtocolDecl p1=new GProtocolDefinition(); - p1.setName("First"); - m.getProtocols().add(p1); - ProtocolDecl p2=new GProtocolDefinition(); - p2.setName("Second"); - m.getProtocols().add(p2); - loader.registerModule(m); - - ImportDecl elem1=new ImportDecl(); - elem1.setModuleName("a.b.c"); - elem1.setMemberName("First"); - elem1.setAlias("MyAlias"); - - ImportDecl elem2=new ImportDecl(); - elem2.setModuleName("a.b.c"); - elem2.setMemberName("Second"); - elem2.setAlias("MyAlias"); - - rule.validate(context, elem2, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("EXISTS_ALIAS"), "MyAlias"))) { - fail("Error EXISTS_ALIAS not detected"); - } - } -} diff --git a/modules/validation/src/test/java/org/scribble/validation/rules/LChoiceValidationRuleTest.java b/modules/validation/src/test/java/org/scribble/validation/rules/LChoiceValidationRuleTest.java deleted file mode 100644 index 772472d4c..000000000 --- a/modules/validation/src/test/java/org/scribble/validation/rules/LChoiceValidationRuleTest.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import static org.junit.Assert.*; - -import java.text.MessageFormat; - -import org.scribble.model.Module; -import org.scribble.model.Role; -import org.scribble.model.RoleDecl; -import org.scribble.model.local.LBlock; -import org.scribble.model.local.LChoice; -import org.scribble.model.local.LProtocolDefinition; -import org.scribble.validation.TestValidationLogger; -import org.scribble.validation.rules.LChoiceValidationRule; - -public class LChoiceValidationRuleTest { - - private static final String TEST_ROLE = "TestRole"; - - @org.junit.Test - public void testValidChoice() { - LChoiceValidationRule rule=new LChoiceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - LProtocolDefinition pd=new LProtocolDefinition(); - - RoleDecl rd=new RoleDecl(); - rd.setName(TEST_ROLE); - pd.getRoleDeclarations().add(rd); - - module.getProtocols().add(pd); - - LBlock block=new LBlock(); - pd.setBlock(block); - - LChoice choice=new LChoice(); - Role role=new Role(); - role.setName(TEST_ROLE); - choice.setRole(role); - block.add(choice); - - rule.validate(null, choice, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testUnknownRole() { - LChoiceValidationRule rule=new LChoiceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - LProtocolDefinition lpd=new LProtocolDefinition(); - module.getProtocols().add(lpd); - - LBlock block=new LBlock(); - lpd.setBlock(block); - - LChoice choice=new LChoice(); - Role role=new Role(); - role.setName(TEST_ROLE); - choice.setRole(role); - block.add(choice); - - rule.validate(null, choice, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("UNKNOWN_ROLE"), TEST_ROLE))) { - fail("Error UNKNOWN_ROLE not detected"); - } - } - - @org.junit.Test - public void testUndefinedRole() { - LChoiceValidationRule rule=new LChoiceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - LProtocolDefinition pd=new LProtocolDefinition(); - module.getProtocols().add(pd); - - LBlock block=new LBlock(); - pd.setBlock(block); - - LChoice choice=new LChoice(); - block.add(choice); - - rule.validate(null, choice, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(ValidationMessages.getMessage("UNDEFINED_ROLE"))) { - fail("Error UNDEFINED_ROLE not detected"); - } - } -} diff --git a/modules/validation/src/test/java/org/scribble/validation/rules/LDoValidationRuleTest.java b/modules/validation/src/test/java/org/scribble/validation/rules/LDoValidationRuleTest.java deleted file mode 100644 index fcd95bcf5..000000000 --- a/modules/validation/src/test/java/org/scribble/validation/rules/LDoValidationRuleTest.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import static org.junit.Assert.*; - -import java.text.MessageFormat; - -import org.scribble.context.DefaultModuleContext; -import org.scribble.context.ModuleContext; -import org.scribble.model.ModelObject; -import org.scribble.model.Module; -import org.scribble.model.local.LBlock; -import org.scribble.model.local.LDo; -import org.scribble.model.local.LProtocolDefinition; -import org.scribble.validation.TestValidationLogger; -import org.scribble.validation.rules.LDoValidationRule; - -public class LDoValidationRuleTest { - - private static final String PROTOCOL2 = "Protocol2"; - private static final String PROTOCOL1 = "Protocol1"; - - @org.junit.Test - public void testValidDo() { - LDoValidationRule rule=new LDoValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - LProtocolDefinition lpd1=new LProtocolDefinition(); - lpd1.setName(PROTOCOL1); - - module.getProtocols().add(lpd1); - - LBlock block=new LBlock(); - lpd1.setBlock(block); - - LDo ldo=new LDo(); - ldo.setProtocol(PROTOCOL2); - block.add(ldo); - - ModuleContext context=new DefaultModuleContext(null, null, null) { - - public ModelObject getMember(String fqn) { - return new LProtocolDefinition(); - } - }; - - rule.validate(context, ldo, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testUnknownProtocol() { - LDoValidationRule rule=new LDoValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - LProtocolDefinition lpd1=new LProtocolDefinition(); - lpd1.setName(PROTOCOL1); - - module.getProtocols().add(lpd1); - - LBlock block=new LBlock(); - lpd1.setBlock(block); - - LDo ldo=new LDo(); - ldo.setProtocol(PROTOCOL2); - block.add(ldo); - - ModuleContext context=new DefaultModuleContext(null, null, null) { - - public ModelObject getMember(String fqn) { - return null; - } - }; - - rule.validate(context, ldo, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("UNKNOWN_PROTOCOL"), PROTOCOL2))) { - fail("Error UNKNOWN_PROTOCOL not detected"); - } - } -} diff --git a/modules/validation/src/test/java/org/scribble/validation/rules/LInterruptibleValidationRuleTest.java b/modules/validation/src/test/java/org/scribble/validation/rules/LInterruptibleValidationRuleTest.java deleted file mode 100644 index 2a63f7e27..000000000 --- a/modules/validation/src/test/java/org/scribble/validation/rules/LInterruptibleValidationRuleTest.java +++ /dev/null @@ -1,198 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import static org.junit.Assert.*; - -import java.text.MessageFormat; - -import org.scribble.model.Message; -import org.scribble.model.Module; -import org.scribble.model.Role; -import org.scribble.model.RoleDecl; -import org.scribble.model.local.LBlock; -import org.scribble.model.local.LInterruptible; -import org.scribble.model.local.LProtocolDefinition; -import org.scribble.validation.TestValidationLogger; -import org.scribble.validation.rules.LInterruptibleValidationRule; - -public class LInterruptibleValidationRuleTest { - - private static final String TEST_ROLE1 = "TestRole1"; - private static final String TEST_ROLE2 = "TestRole2"; - - @org.junit.Test - public void testThrowRoleFound() { - LInterruptibleValidationRule rule=new LInterruptibleValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - LProtocolDefinition lpd=new LProtocolDefinition(); - - RoleDecl rd=new RoleDecl(); - rd.setName(TEST_ROLE1); - lpd.getRoleDeclarations().add(rd); - - module.getProtocols().add(lpd); - - LBlock block=new LBlock(); - lpd.setBlock(block); - - LInterruptible gm=new LInterruptible(); - - LInterruptible.Throw t=new LInterruptible.Throw(); - t.getToRoles().add(new Role(TEST_ROLE1)); - - Message message=new Message(); - t.getMessages().add(message); - - gm.setThrows(t); - - block.add(gm); - - rule.validate(null, gm, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testCatchRoleFound() { - LInterruptibleValidationRule rule=new LInterruptibleValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - LProtocolDefinition lpd=new LProtocolDefinition(); - - RoleDecl rd=new RoleDecl(); - rd.setName(TEST_ROLE1); - lpd.getRoleDeclarations().add(rd); - - module.getProtocols().add(lpd); - - LBlock block=new LBlock(); - lpd.setBlock(block); - - LInterruptible gm=new LInterruptible(); - - LInterruptible.Catch c=new LInterruptible.Catch(); - c.setRole(new Role(TEST_ROLE1)); - - Message message=new Message(); - c.getMessages().add(message); - - gm.getCatches().add(c); - - block.add(gm); - - rule.validate(null, gm, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testThrowRoleNotFound() { - LInterruptibleValidationRule rule=new LInterruptibleValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - LProtocolDefinition lpd=new LProtocolDefinition(); - - RoleDecl rd=new RoleDecl(); - rd.setName(TEST_ROLE1); - lpd.getRoleDeclarations().add(rd); - - module.getProtocols().add(lpd); - - LBlock block=new LBlock(); - lpd.setBlock(block); - - LInterruptible gm=new LInterruptible(); - - LInterruptible.Throw t=new LInterruptible.Throw(); - t.getToRoles().add(new Role(TEST_ROLE2)); - - Message message=new Message(); - t.getMessages().add(message); - - gm.setThrows(t); - - block.add(gm); - - rule.validate(null, gm, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("UNKNOWN_ROLE"), TEST_ROLE2))) { - fail("Error UNKNOWN_ROLE not detected"); - } - } - - @org.junit.Test - public void testCatchRoleNotFound() { - LInterruptibleValidationRule rule=new LInterruptibleValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - LProtocolDefinition lpd=new LProtocolDefinition(); - - RoleDecl rd=new RoleDecl(); - rd.setName(TEST_ROLE1); - lpd.getRoleDeclarations().add(rd); - - module.getProtocols().add(lpd); - - LBlock block=new LBlock(); - lpd.setBlock(block); - - LInterruptible gm=new LInterruptible(); - - LInterruptible.Catch c=new LInterruptible.Catch(); - c.setRole(new Role(TEST_ROLE2)); - - Message message=new Message(); - c.getMessages().add(message); - - gm.getCatches().add(c); - - block.add(gm); - - rule.validate(null, gm, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("UNKNOWN_ROLE"), TEST_ROLE2))) { - fail("Error UNKNOWN_ROLE not detected"); - } - } - -} diff --git a/modules/validation/src/test/java/org/scribble/validation/rules/LProtocolDefinitionValidationRuleTest.java b/modules/validation/src/test/java/org/scribble/validation/rules/LProtocolDefinitionValidationRuleTest.java deleted file mode 100644 index 4676e08ff..000000000 --- a/modules/validation/src/test/java/org/scribble/validation/rules/LProtocolDefinitionValidationRuleTest.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import static org.junit.Assert.*; - -import java.text.MessageFormat; - -import org.scribble.context.DefaultModuleContext; -import org.scribble.context.ModuleContext; -import org.scribble.model.ModelObject; -import org.scribble.model.Module; -import org.scribble.model.Role; -import org.scribble.model.RoleDecl; -import org.scribble.model.local.LProtocolDefinition; -import org.scribble.validation.TestValidationLogger; -import org.scribble.validation.rules.LProtocolDefinitionValidationRule; - -public class LProtocolDefinitionValidationRuleTest { - - private static final String TEST_NAME1 = "TestName1"; - private static final String TEST_NAME2 = "TestName2"; - private static final String TEST_MEMBER_NAME = "TestMemberName"; - - @org.junit.Test - public void testLocalRoleDeclared() { - LProtocolDefinitionValidationRule rule=new LProtocolDefinitionValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - LProtocolDefinition gpi=new LProtocolDefinition(); - gpi.setLocalRole(new Role(TEST_NAME1)); - gpi.setName(TEST_MEMBER_NAME); - - RoleDecl rd=new RoleDecl(); - rd.setName(TEST_NAME1); - gpi.getRoleDeclarations().add(rd); - - module.getProtocols().add(gpi); - - ModuleContext context=new DefaultModuleContext(null, null, null) { - - public ModelObject getMember(String fqn) { - LProtocolDefinition ret=new LProtocolDefinition(); - ret.getRoleDeclarations().add(new RoleDecl()); - return ret; - } - }; - - rule.validate(context, gpi, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testLocalRoleNotDeclared() { - LProtocolDefinitionValidationRule rule=new LProtocolDefinitionValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - LProtocolDefinition gpi=new LProtocolDefinition(); - gpi.setLocalRole(new Role(TEST_NAME2)); - gpi.setName(TEST_MEMBER_NAME); - - RoleDecl rd=new RoleDecl(); - rd.setName(TEST_NAME1); - gpi.getRoleDeclarations().add(rd); - - module.getProtocols().add(gpi); - - ModuleContext context=new DefaultModuleContext(null, null, null) { - - public ModelObject getMember(String fqn) { - LProtocolDefinition ret=new LProtocolDefinition(); - ret.getRoleDeclarations().add(new RoleDecl()); - return ret; - } - }; - - rule.validate(context, gpi, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("LOCAL_ROLE_NOT_DECLARED"), TEST_NAME2))) { - fail("Error LOCAL_ROLE_NOT_DECLARED not detected"); - } - } -} diff --git a/modules/validation/src/test/java/org/scribble/validation/rules/LProtocolInstanceValidationRuleTest.java b/modules/validation/src/test/java/org/scribble/validation/rules/LProtocolInstanceValidationRuleTest.java deleted file mode 100644 index 008b993a4..000000000 --- a/modules/validation/src/test/java/org/scribble/validation/rules/LProtocolInstanceValidationRuleTest.java +++ /dev/null @@ -1,625 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import static org.junit.Assert.*; - -import java.text.MessageFormat; - -import org.scribble.context.DefaultModuleContext; -import org.scribble.context.ModuleContext; -import org.scribble.model.Argument; -import org.scribble.model.ModelObject; -import org.scribble.model.Module; -import org.scribble.model.ParameterDecl; -import org.scribble.model.PayloadTypeDecl; -import org.scribble.model.Role; -import org.scribble.model.RoleDecl; -import org.scribble.model.RoleInstantiation; -import org.scribble.model.local.LProtocolDefinition; -import org.scribble.model.local.LProtocolInstance; -import org.scribble.validation.TestValidationLogger; -import org.scribble.validation.rules.LProtocolInstanceValidationRule; - -public class LProtocolInstanceValidationRuleTest { - - private static final String TEST_NAME1 = "TestName1"; - private static final String TEST_NAME2 = "TestName2"; - private static final String TEST_NAME3 = "TestName3"; - private static final String TEST_MEMBER_NAME = "TestMemberName"; - - @org.junit.Test - public void testValidProtocolInstance() { - LProtocolInstanceValidationRule rule=new LProtocolInstanceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - LProtocolInstance gpi=new LProtocolInstance(); - gpi.setMemberName(TEST_MEMBER_NAME); - module.getProtocols().add(gpi); - - ModuleContext context=new DefaultModuleContext(null, null, null) { - - public ModelObject getMember(String fqn) { - return new LProtocolDefinition(); - } - }; - - rule.validate(context, gpi, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testUnknownMemberName() { - LProtocolInstanceValidationRule rule=new LProtocolInstanceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - LProtocolInstance gpi=new LProtocolInstance(); - gpi.setMemberName(TEST_MEMBER_NAME); - module.getProtocols().add(gpi); - - ModuleContext context=new DefaultModuleContext(null, null, null) { - - public ModelObject getMember(String fqn) { - return null; - } - }; - - rule.validate(context, gpi, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("UNKNOWN_MEMBER_NAME"), TEST_MEMBER_NAME))) { - fail("Error UNKNOWN_MEMBER_NAME not detected"); - } - } - - @org.junit.Test - public void testMemberNotProtocolDefinition() { - LProtocolInstanceValidationRule rule=new LProtocolInstanceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - LProtocolInstance gpi=new LProtocolInstance(); - gpi.setMemberName(TEST_MEMBER_NAME); - module.getProtocols().add(gpi); - - ModuleContext context=new DefaultModuleContext(null, null, null) { - - public ModelObject getMember(String fqn) { - return new Role(); - } - }; - - rule.validate(context, gpi, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("MEMBER_NOT_PROTOCOL_DEFINITION"), TEST_MEMBER_NAME))) { - fail("Error MEMBER_NOT_PROTOCOL_DEFINITION not detected"); - } - } - - @org.junit.Test - public void testMismatchArguParamNum() { - LProtocolInstanceValidationRule rule=new LProtocolInstanceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - LProtocolInstance gpi=new LProtocolInstance(); - gpi.setMemberName(TEST_MEMBER_NAME); - gpi.getArguments().add(new Argument()); - module.getProtocols().add(gpi); - - ModuleContext context=new DefaultModuleContext(null, null, null) { - - public ModelObject getMember(String fqn) { - return new LProtocolDefinition(); - } - }; - - rule.validate(context, gpi, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("ARG_NUM_MISMATCH"), 1, 0))) { - fail("Error ARG_NUM_MISMATCH not detected"); - } - } - - @org.junit.Test - public void testMismatchRoleNum() { - LProtocolInstanceValidationRule rule=new LProtocolInstanceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - LProtocolInstance gpi=new LProtocolInstance(); - gpi.setMemberName(TEST_MEMBER_NAME); - gpi.getRoleInstantiations().add(new RoleInstantiation()); - module.getProtocols().add(gpi); - - ModuleContext context=new DefaultModuleContext(null, null, null) { - - public ModelObject getMember(String fqn) { - return new LProtocolDefinition(); - } - }; - - rule.validate(context, gpi, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("ROLE_NUM_MISMATCH"), 1, 0))) { - fail("Error ROLE_NUM_MISMATCH not detected"); - } - } - - @org.junit.Test - public void testRoleDeclared() { - LProtocolInstanceValidationRule rule=new LProtocolInstanceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - LProtocolInstance gpi=new LProtocolInstance(); - gpi.setMemberName(TEST_MEMBER_NAME); - - RoleDecl rd=new RoleDecl(); - rd.setName(TEST_NAME1); - gpi.getRoleDeclarations().add(rd); - - RoleInstantiation ri=new RoleInstantiation(); - ri.setName(TEST_NAME1); - gpi.getRoleInstantiations().add(ri); - - module.getProtocols().add(gpi); - - ModuleContext context=new DefaultModuleContext(null, null, null) { - - public ModelObject getMember(String fqn) { - LProtocolDefinition ret=new LProtocolDefinition(); - ret.getRoleDeclarations().add(new RoleDecl()); - return ret; - } - }; - - rule.validate(context, gpi, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testRoleNotDeclared() { - LProtocolInstanceValidationRule rule=new LProtocolInstanceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - LProtocolInstance gpi=new LProtocolInstance(); - gpi.setMemberName(TEST_MEMBER_NAME); - - RoleInstantiation ri=new RoleInstantiation(); - ri.setName(TEST_NAME1); - - gpi.getRoleInstantiations().add(ri); - module.getProtocols().add(gpi); - - ModuleContext context=new DefaultModuleContext(null, null, null) { - - public ModelObject getMember(String fqn) { - LProtocolDefinition ret=new LProtocolDefinition(); - ret.getRoleDeclarations().add(new RoleDecl()); - return ret; - } - }; - - rule.validate(context, gpi, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("ROLE_NOT_DECLARED"), TEST_NAME1))) { - fail("Error ROLE_NOT_DECLARED not detected"); - } - } - - @org.junit.Test - public void testRoleAliasDeclared() { - LProtocolInstanceValidationRule rule=new LProtocolInstanceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - LProtocolInstance gpi=new LProtocolInstance(); - gpi.setMemberName(TEST_MEMBER_NAME); - - RoleDecl rd=new RoleDecl(); - rd.setName(TEST_NAME1); - gpi.getRoleDeclarations().add(rd); - - RoleInstantiation ri=new RoleInstantiation(); - ri.setName(TEST_NAME1); - ri.setAlias(TEST_NAME2); - gpi.getRoleInstantiations().add(ri); - - module.getProtocols().add(gpi); - - ModuleContext context=new DefaultModuleContext(null, null, null) { - - public ModelObject getMember(String fqn) { - LProtocolDefinition ret=new LProtocolDefinition(); - RoleDecl rd=new RoleDecl(); - rd.setName(TEST_NAME2); - ret.getRoleDeclarations().add(rd); - return ret; - } - }; - - rule.validate(context, gpi, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testRoleAliasNotDeclared() { - LProtocolInstanceValidationRule rule=new LProtocolInstanceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - LProtocolInstance gpi=new LProtocolInstance(); - gpi.setMemberName(TEST_MEMBER_NAME); - - RoleDecl rd=new RoleDecl(); - rd.setName(TEST_NAME1); - gpi.getRoleDeclarations().add(rd); - - RoleInstantiation ri=new RoleInstantiation(); - ri.setName(TEST_NAME1); - ri.setAlias(TEST_NAME2); - - gpi.getRoleInstantiations().add(ri); - module.getProtocols().add(gpi); - - ModuleContext context=new DefaultModuleContext(null, null, null) { - - public ModelObject getMember(String fqn) { - LProtocolDefinition ret=new LProtocolDefinition(); - RoleDecl rd=new RoleDecl(); - rd.setName(TEST_NAME3); - ret.getRoleDeclarations().add(rd); - return ret; - } - }; - - rule.validate(context, gpi, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("ROLE_ALIAS_NOT_DECLARED"), TEST_NAME2))) { - fail("Error ROLE_ALIAS_NOT_DECLARED not detected"); - } - } - - @org.junit.Test - public void testArgDeclaredAsParameter() { - LProtocolInstanceValidationRule rule=new LProtocolInstanceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - LProtocolInstance gpi=new LProtocolInstance(); - gpi.setMemberName(TEST_MEMBER_NAME); - - ParameterDecl pd=new ParameterDecl(); - pd.setName(TEST_NAME1); - gpi.getParameterDeclarations().add(pd); - - Argument arg=new Argument(); - arg.setName(TEST_NAME1); - gpi.getArguments().add(arg); - - module.getProtocols().add(gpi); - - ModuleContext context=new DefaultModuleContext(null, null, null) { - - public ModelObject getMember(String fqn) { - LProtocolDefinition ret=new LProtocolDefinition(); - ret.getParameterDeclarations().add(new ParameterDecl()); - return ret; - } - }; - - rule.validate(context, gpi, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testArgDeclaredAsPayloadType() { - LProtocolInstanceValidationRule rule=new LProtocolInstanceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - PayloadTypeDecl ptd=new PayloadTypeDecl(); - ptd.setAlias(TEST_NAME1); - module.getPayloadTypeDeclarations().add(ptd); - - LProtocolInstance gpi=new LProtocolInstance(); - gpi.setMemberName(TEST_MEMBER_NAME); - - Argument arg=new Argument(); - arg.setName(TEST_NAME1); - gpi.getArguments().add(arg); - - module.getProtocols().add(gpi); - - ModuleContext context=new DefaultModuleContext(null, null, null) { - - public ModelObject getMember(String fqn) { - LProtocolDefinition ret=new LProtocolDefinition(); - ret.getParameterDeclarations().add(new ParameterDecl()); - return ret; - } - }; - - rule.validate(context, gpi, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testParameterAndPayloadTypeNotDeclared() { - LProtocolInstanceValidationRule rule=new LProtocolInstanceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - LProtocolInstance gpi=new LProtocolInstance(); - gpi.setMemberName(TEST_MEMBER_NAME); - - Argument arg=new Argument(); - arg.setName(TEST_NAME1); - - gpi.getArguments().add(arg); - module.getProtocols().add(gpi); - - ModuleContext context=new DefaultModuleContext(null, null, null) { - - public ModelObject getMember(String fqn) { - LProtocolDefinition ret=new LProtocolDefinition(); - ret.getParameterDeclarations().add(new ParameterDecl()); - return ret; - } - }; - - rule.validate(context, gpi, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("ARG_NOT_DECLARED"), TEST_NAME1))) { - fail("Error ARG_NOT_DECLARED not detected"); - } - } - - @org.junit.Test - public void testArgAliasDeclared() { - LProtocolInstanceValidationRule rule=new LProtocolInstanceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - LProtocolInstance gpi=new LProtocolInstance(); - gpi.setMemberName(TEST_MEMBER_NAME); - - ParameterDecl pd=new ParameterDecl(); - pd.setName(TEST_NAME1); - gpi.getParameterDeclarations().add(pd); - - Argument arg=new Argument(); - arg.setName(TEST_NAME1); - arg.setAlias(TEST_NAME2); - gpi.getArguments().add(arg); - - module.getProtocols().add(gpi); - - ModuleContext context=new DefaultModuleContext(null, null, null) { - - public ModelObject getMember(String fqn) { - LProtocolDefinition ret=new LProtocolDefinition(); - ParameterDecl pd=new ParameterDecl(); - pd.setName(TEST_NAME2); - ret.getParameterDeclarations().add(pd); - return ret; - } - }; - - rule.validate(context, gpi, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testArgAliasNotDeclared() { - LProtocolInstanceValidationRule rule=new LProtocolInstanceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - LProtocolInstance gpi=new LProtocolInstance(); - gpi.setMemberName(TEST_MEMBER_NAME); - - ParameterDecl pd=new ParameterDecl(); - pd.setName(TEST_NAME1); - gpi.getParameterDeclarations().add(pd); - - Argument arg=new Argument(); - arg.setName(TEST_NAME1); - arg.setAlias(TEST_NAME2); - - gpi.getArguments().add(arg); - module.getProtocols().add(gpi); - - ModuleContext context=new DefaultModuleContext(null, null, null) { - - public ModelObject getMember(String fqn) { - LProtocolDefinition ret=new LProtocolDefinition(); - ParameterDecl pd=new ParameterDecl(); - pd.setName(TEST_NAME3); - ret.getParameterDeclarations().add(pd); - return ret; - } - }; - - rule.validate(context, gpi, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("ARG_ALIAS_NOT_DECLARED"), TEST_NAME2))) { - fail("Error ARG_ALIAS_NOT_DECLARED not detected"); - } - } - - @org.junit.Test - public void testLocalRoleDeclared() { - LProtocolInstanceValidationRule rule=new LProtocolInstanceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - LProtocolInstance gpi=new LProtocolInstance(); - gpi.setLocalRole(new Role(TEST_NAME1)); - gpi.setMemberName(TEST_MEMBER_NAME); - - RoleDecl rd=new RoleDecl(); - rd.setName(TEST_NAME1); - gpi.getRoleDeclarations().add(rd); - - RoleInstantiation ri=new RoleInstantiation(); - ri.setName(TEST_NAME1); - gpi.getRoleInstantiations().add(ri); - - module.getProtocols().add(gpi); - - ModuleContext context=new DefaultModuleContext(null, null, null) { - - public ModelObject getMember(String fqn) { - LProtocolDefinition ret=new LProtocolDefinition(); - ret.getRoleDeclarations().add(new RoleDecl()); - return ret; - } - }; - - rule.validate(context, gpi, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testLocalRoleNotDeclared() { - LProtocolInstanceValidationRule rule=new LProtocolInstanceValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - LProtocolInstance gpi=new LProtocolInstance(); - gpi.setLocalRole(new Role(TEST_NAME2)); - gpi.setMemberName(TEST_MEMBER_NAME); - - RoleDecl rd=new RoleDecl(); - rd.setName(TEST_NAME1); - gpi.getRoleDeclarations().add(rd); - - RoleInstantiation ri=new RoleInstantiation(); - ri.setName(TEST_NAME1); - gpi.getRoleInstantiations().add(ri); - - module.getProtocols().add(gpi); - - ModuleContext context=new DefaultModuleContext(null, null, null) { - - public ModelObject getMember(String fqn) { - LProtocolDefinition ret=new LProtocolDefinition(); - ret.getRoleDeclarations().add(new RoleDecl()); - return ret; - } - }; - - rule.validate(context, gpi, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("LOCAL_ROLE_NOT_DECLARED"), TEST_NAME2))) { - fail("Error LOCAL_ROLE_NOT_DECLARED not detected"); - } - } -} diff --git a/modules/validation/src/test/java/org/scribble/validation/rules/LReceiveValidationRuleTest.java b/modules/validation/src/test/java/org/scribble/validation/rules/LReceiveValidationRuleTest.java deleted file mode 100644 index c76d785c8..000000000 --- a/modules/validation/src/test/java/org/scribble/validation/rules/LReceiveValidationRuleTest.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import static org.junit.Assert.*; - -import java.text.MessageFormat; - -import org.scribble.model.Message; -import org.scribble.model.Module; -import org.scribble.model.Role; -import org.scribble.model.RoleDecl; -import org.scribble.model.local.LBlock; -import org.scribble.model.local.LProtocolDefinition; -import org.scribble.model.local.LReceive; -import org.scribble.validation.TestValidationLogger; -import org.scribble.validation.rules.LReceiveValidationRule; - -public class LReceiveValidationRuleTest { - - private static final String TEST_ROLE1 = "TestRole1"; - private static final String TEST_ROLE2 = "TestRole2"; - - @org.junit.Test - public void testFromRoleFound() { - LReceiveValidationRule rule=new LReceiveValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - LProtocolDefinition lpd=new LProtocolDefinition(); - - RoleDecl rd=new RoleDecl(); - rd.setName(TEST_ROLE1); - lpd.getRoleDeclarations().add(rd); - - module.getProtocols().add(lpd); - - LBlock block=new LBlock(); - lpd.setBlock(block); - - LReceive recv=new LReceive(); - recv.setFromRole(new Role(TEST_ROLE1)); - block.add(recv); - - Message message=new Message(); - recv.setMessage(message); - - rule.validate(null, recv, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testFromRoleNotFound() { - LReceiveValidationRule rule=new LReceiveValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - LProtocolDefinition lpd=new LProtocolDefinition(); - - RoleDecl rd=new RoleDecl(); - rd.setName(TEST_ROLE1); - lpd.getRoleDeclarations().add(rd); - - module.getProtocols().add(lpd); - - LBlock block=new LBlock(); - lpd.setBlock(block); - - LReceive recv=new LReceive(); - recv.setFromRole(new Role(TEST_ROLE2)); - block.add(recv); - - Message message=new Message(); - recv.setMessage(message); - - rule.validate(null, recv, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("UNKNOWN_ROLE"), TEST_ROLE2))) { - fail("Error UNKNOWN_ROLE not detected"); - } - } -} diff --git a/modules/validation/src/test/java/org/scribble/validation/rules/LSendValidationRuleTest.java b/modules/validation/src/test/java/org/scribble/validation/rules/LSendValidationRuleTest.java deleted file mode 100644 index 69de6718d..000000000 --- a/modules/validation/src/test/java/org/scribble/validation/rules/LSendValidationRuleTest.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import static org.junit.Assert.*; - -import java.text.MessageFormat; - -import org.scribble.model.Message; -import org.scribble.model.Module; -import org.scribble.model.Role; -import org.scribble.model.RoleDecl; -import org.scribble.model.local.LBlock; -import org.scribble.model.local.LProtocolDefinition; -import org.scribble.model.local.LSend; -import org.scribble.validation.TestValidationLogger; -import org.scribble.validation.rules.LSendValidationRule; - -public class LSendValidationRuleTest { - - private static final String TEST_ROLE1 = "TestRole1"; - private static final String TEST_ROLE2 = "TestRole2"; - - @org.junit.Test - public void testToRoleFound() { - LSendValidationRule rule=new LSendValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - LProtocolDefinition lpd=new LProtocolDefinition(); - - RoleDecl rd=new RoleDecl(); - rd.setName(TEST_ROLE1); - lpd.getRoleDeclarations().add(rd); - - module.getProtocols().add(lpd); - - LBlock block=new LBlock(); - lpd.setBlock(block); - - LSend send=new LSend(); - send.getToRoles().add(new Role(TEST_ROLE1)); - block.add(send); - - Message message=new Message(); - send.setMessage(message); - - rule.validate(null, send, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testToRoleNotFound() { - LSendValidationRule rule=new LSendValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - LProtocolDefinition lpd=new LProtocolDefinition(); - - RoleDecl rd=new RoleDecl(); - rd.setName(TEST_ROLE1); - lpd.getRoleDeclarations().add(rd); - - module.getProtocols().add(lpd); - - LBlock block=new LBlock(); - lpd.setBlock(block); - - LSend send=new LSend(); - send.getToRoles().add(new Role(TEST_ROLE2)); - block.add(send); - - Message message=new Message(); - send.setMessage(message); - - rule.validate(null, send, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("UNKNOWN_ROLE"), TEST_ROLE2))) { - fail("Error UNKNOWN_ROLE not detected"); - } - } -} diff --git a/modules/validation/src/test/java/org/scribble/validation/rules/MessageSignatureValidationRuleTest.java b/modules/validation/src/test/java/org/scribble/validation/rules/MessageSignatureValidationRuleTest.java deleted file mode 100644 index f97638348..000000000 --- a/modules/validation/src/test/java/org/scribble/validation/rules/MessageSignatureValidationRuleTest.java +++ /dev/null @@ -1,198 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import static org.junit.Assert.*; - -import java.text.MessageFormat; - -import org.scribble.model.Message; -import org.scribble.model.MessageSignature; -import org.scribble.model.Module; -import org.scribble.model.ParameterDecl; -import org.scribble.model.PayloadElement; -import org.scribble.model.PayloadTypeDecl; -import org.scribble.model.global.GBlock; -import org.scribble.model.global.GMessageTransfer; -import org.scribble.model.global.GProtocolDefinition; -import org.scribble.validation.TestValidationLogger; - -public class MessageSignatureValidationRuleTest { - - private static final String KNOWN_PAYLOAD_TYPE = "KnownPayloadType"; - - @org.junit.Test - public void testPayloadTypeFound() { - MessageSignatureValidationRule rule=new MessageSignatureValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - PayloadTypeDecl pltd=new PayloadTypeDecl(); - module.getPayloadTypeDeclarations().add(pltd); - - pltd.setAlias(KNOWN_PAYLOAD_TYPE); - - GProtocolDefinition gpd=new GProtocolDefinition(); - module.getProtocols().add(gpd); - - GBlock block=new GBlock(); - gpd.setBlock(block); - - GMessageTransfer gm=new GMessageTransfer(); - block.add(gm); - - Message message=new Message(); - gm.setMessage(message); - - MessageSignature ms=new MessageSignature(); - message.setMessageSignature(ms); - - PayloadElement plt=new PayloadElement(); - ms.getPayloadElements().add(plt); - - plt.setName(KNOWN_PAYLOAD_TYPE); - - rule.validate(null, ms, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testProtocolParameterNameFound() { - MessageSignatureValidationRule rule=new MessageSignatureValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolDefinition gpd=new GProtocolDefinition(); - module.getProtocols().add(gpd); - - ParameterDecl pd=new ParameterDecl(); - gpd.getParameterDeclarations().add(pd); - - pd.setName(KNOWN_PAYLOAD_TYPE); - - GBlock block=new GBlock(); - gpd.setBlock(block); - - GMessageTransfer gm=new GMessageTransfer(); - block.add(gm); - - Message message=new Message(); - gm.setMessage(message); - - MessageSignature ms=new MessageSignature(); - message.setMessageSignature(ms); - - PayloadElement plt=new PayloadElement(); - ms.getPayloadElements().add(plt); - - plt.setName(KNOWN_PAYLOAD_TYPE); - - rule.validate(null, ms, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testProtocolParameterAliasFound() { - MessageSignatureValidationRule rule=new MessageSignatureValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolDefinition gpd=new GProtocolDefinition(); - module.getProtocols().add(gpd); - - ParameterDecl pd=new ParameterDecl(); - gpd.getParameterDeclarations().add(pd); - - pd.setName("A_Name"); - pd.setAlias(KNOWN_PAYLOAD_TYPE); - - GBlock block=new GBlock(); - gpd.setBlock(block); - - GMessageTransfer gm=new GMessageTransfer(); - block.add(gm); - - Message message=new Message(); - gm.setMessage(message); - - MessageSignature ms=new MessageSignature(); - message.setMessageSignature(ms); - - PayloadElement plt=new PayloadElement(); - ms.getPayloadElements().add(plt); - - plt.setName(KNOWN_PAYLOAD_TYPE); - - rule.validate(null, ms, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testPayloadNameUnknown() { - MessageSignatureValidationRule rule=new MessageSignatureValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolDefinition gpd=new GProtocolDefinition(); - module.getProtocols().add(gpd); - - GBlock block=new GBlock(); - gpd.setBlock(block); - - GMessageTransfer gm=new GMessageTransfer(); - block.add(gm); - - Message message=new Message(); - gm.setMessage(message); - - MessageSignature ms=new MessageSignature(); - message.setMessageSignature(ms); - - PayloadElement plt=new PayloadElement(); - ms.getPayloadElements().add(plt); - - plt.setName(KNOWN_PAYLOAD_TYPE); - - rule.validate(null, ms, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("UNKNOWN_PAYLOAD_ELEMENT"), KNOWN_PAYLOAD_TYPE))) { - fail("Error UNKNOWN_PAYLOAD_ELEMENT not detected"); - } - } - -} diff --git a/modules/validation/src/test/java/org/scribble/validation/rules/MessageValidationRuleTest.java b/modules/validation/src/test/java/org/scribble/validation/rules/MessageValidationRuleTest.java deleted file mode 100644 index b20d8bbd7..000000000 --- a/modules/validation/src/test/java/org/scribble/validation/rules/MessageValidationRuleTest.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import static org.junit.Assert.*; - -import java.text.MessageFormat; - -import org.scribble.model.Message; -import org.scribble.model.Module; -import org.scribble.model.ParameterDecl; -import org.scribble.model.ParameterDecl.ParameterType; -import org.scribble.model.global.GBlock; -import org.scribble.model.global.GMessageTransfer; -import org.scribble.model.global.GProtocolDefinition; -import org.scribble.validation.TestValidationLogger; -import org.scribble.validation.rules.MessageValidationRule; - -public class MessageValidationRuleTest { - - private static final String TEST_PARAMETER = "TestParameter"; - - @org.junit.Test - public void testParameterNotFound() { - MessageValidationRule rule=new MessageValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolDefinition gpd=new GProtocolDefinition(); - module.getProtocols().add(gpd); - - GBlock block=new GBlock(); - gpd.setBlock(block); - - GMessageTransfer gm=new GMessageTransfer(); - block.add(gm); - - Message message=new Message(); - gm.setMessage(message); - - message.setParameter(TEST_PARAMETER); - - rule.validate(null, message, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("UNKNOWN_PARAMETER"), TEST_PARAMETER))) { - fail("Error UNKNOWN_PARAMETER not detected"); - } - } - - @org.junit.Test - public void testParameterNotSig() { - MessageValidationRule rule=new MessageValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolDefinition gpd=new GProtocolDefinition(); - module.getProtocols().add(gpd); - - ParameterDecl pd=new ParameterDecl(); - pd.setName(TEST_PARAMETER); - pd.setType(ParameterType.Type); - gpd.getParameterDeclarations().add(pd); - - GBlock block=new GBlock(); - gpd.setBlock(block); - - GMessageTransfer gm=new GMessageTransfer(); - block.add(gm); - - Message message=new Message(); - gm.setMessage(message); - - message.setParameter(TEST_PARAMETER); - - rule.validate(null, message, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format(ValidationMessages.getMessage("PARAMETER_NOT_SIG"), TEST_PARAMETER))) { - fail("Error PARAMETER_NOT_SIG not detected"); - } - } - - @org.junit.Test - public void testParameterFound() { - MessageValidationRule rule=new MessageValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - GProtocolDefinition gpd=new GProtocolDefinition(); - - ParameterDecl pd=new ParameterDecl(); - pd.setName(TEST_PARAMETER); - pd.setType(ParameterType.Sig); - gpd.getParameterDeclarations().add(pd); - - module.getProtocols().add(gpd); - - GBlock block=new GBlock(); - gpd.setBlock(block); - - GMessageTransfer gm=new GMessageTransfer(); - block.add(gm); - - Message message=new Message(); - gm.setMessage(message); - - message.setParameter(TEST_PARAMETER); - - rule.validate(null, message, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - -} diff --git a/modules/validation/src/test/java/org/scribble/validation/rules/ModuleValidationRuleTest.java b/modules/validation/src/test/java/org/scribble/validation/rules/ModuleValidationRuleTest.java deleted file mode 100644 index fc42cae32..000000000 --- a/modules/validation/src/test/java/org/scribble/validation/rules/ModuleValidationRuleTest.java +++ /dev/null @@ -1,270 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.validation.rules; - -import static org.junit.Assert.*; - -import java.text.MessageFormat; - -import org.scribble.context.DefaultModuleContext; -import org.scribble.context.DefaultModuleLoader; -import org.scribble.model.ImportDecl; -import org.scribble.model.Module; -import org.scribble.model.PayloadTypeDecl; -import org.scribble.model.global.GProtocolDefinition; -import org.scribble.resources.InputStreamResource; -import org.scribble.validation.TestValidationLogger; -import org.scribble.validation.rules.ModuleValidationRule; - -public class ModuleValidationRuleTest { - - @org.junit.Test - public void testModuleValid() { - ModuleValidationRule rule=new ModuleValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - module.setName("test"); - - module.getProtocols().add(new GProtocolDefinition()); - - rule.validate(new DefaultModuleContext(null, null, null), module, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testModuleNoFullyQualifiedName() { - ModuleValidationRule rule=new ModuleValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - - module.getProtocols().add(new GProtocolDefinition()); - - rule.validate(new DefaultModuleContext(null, null, null), module, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(ValidationMessages.getMessage("NO_FULLY_QUALIFIED_NAME"))) { - fail("Error NO_FULLY_QUALIFIED_NAME not detected"); - } - } - - @org.junit.Test - public void testFilenameValid() { - ModuleValidationRule rule=new ModuleValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - - module.setName("a.b.C"); - - String path="a"+java.io.File.separatorChar+"b"+java.io.File.separatorChar+"C.scr"; - - InputStreamResource resource=new InputStreamResource(path, null); - - DefaultModuleContext context=new DefaultModuleContext(resource, null, null); - - rule.validate(context, module, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testFilenameInvalid() { - ModuleValidationRule rule=new ModuleValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - - module.setName("a.b.D"); - - String path="a"+java.io.File.separatorChar+"b"+java.io.File.separatorChar+"C.scr"; - - InputStreamResource resource=new InputStreamResource(path, null); - - DefaultModuleContext context=new DefaultModuleContext(resource, null, null); - - rule.validate(context, module, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - String moduleName="a.b.D"; - String filepath=moduleName.replace('.', java.io.File.separatorChar)+".scr"; - - if (!logger.getErrors().contains(MessageFormat.format( - ValidationMessages.getMessage("INCORRECT_FILEPATH"), moduleName, filepath))) { - fail("Error INCORRECT_FILEPATH not detected"); - } - } - - @org.junit.Test - public void testModuleNamesDistinct() { - ModuleValidationRule rule=new ModuleValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - - module.setName("a.b.C"); - - ImportDecl imp=new ImportDecl(); - imp.setModuleName("a.b.D"); - module.getImports().add(imp); - - DefaultModuleLoader loader=new DefaultModuleLoader(); - DefaultModuleContext context=new DefaultModuleContext(null, null, loader); - - Module impmodule=new Module(); - impmodule.setName("a.b.D"); - loader.registerModule(impmodule); - - rule.validate(context, module, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testModuleNamesNotDistinct() { - ModuleValidationRule rule=new ModuleValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - - module.setName("a.b.C"); - - ImportDecl imp=new ImportDecl(); - imp.setModuleName("a.b.D"); - imp.setAlias("C"); - module.getImports().add(imp); - - DefaultModuleLoader loader=new DefaultModuleLoader(); - DefaultModuleContext context=new DefaultModuleContext(null, null, loader); - - Module impmodule=new Module(); - impmodule.setName("a.b.D"); - loader.registerModule(impmodule); - - rule.validate(context, module, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format( - ValidationMessages.getMessage("MODULE_NAME_NOT_DISTINCT"), "C"))) { - fail("Error MODULE_NAME_NOT_DISTINCT not detected"); - } - } - - @org.junit.Test - public void testMemberNamesDistinct() { - ModuleValidationRule rule=new ModuleValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - - module.setName("a.b.C"); - - ImportDecl imp=new ImportDecl(); - imp.setModuleName("a.b.D"); - imp.setMemberName("E"); - module.getImports().add(imp); - - PayloadTypeDecl ptd=new PayloadTypeDecl(); - ptd.setAlias("F"); - module.getPayloadTypeDeclarations().add(ptd); - - GProtocolDefinition gpd=new GProtocolDefinition(); - gpd.setName("G"); - module.getProtocols().add(gpd); - - DefaultModuleLoader loader=new DefaultModuleLoader(); - DefaultModuleContext context=new DefaultModuleContext(null, null, loader); - - Module impmodule=new Module(); - impmodule.setName("a.b.D"); - - PayloadTypeDecl impptd=new PayloadTypeDecl(); - impptd.setAlias("E"); - impmodule.getPayloadTypeDeclarations().add(impptd); - - loader.registerModule(impmodule); - - rule.validate(context, module, logger); - - if (logger.isErrorsOrWarnings()) { - fail("Errors detected"); - } - } - - @org.junit.Test - public void testMemberNamesNotDistinct1() { - ModuleValidationRule rule=new ModuleValidationRule(); - TestValidationLogger logger=new TestValidationLogger(); - - Module module=new Module(); - - module.setName("a.b.C"); - - ImportDecl imp=new ImportDecl(); - imp.setModuleName("a.b.D"); - imp.setMemberName("E"); - module.getImports().add(imp); - - PayloadTypeDecl ptd=new PayloadTypeDecl(); - ptd.setAlias("F"); - module.getPayloadTypeDeclarations().add(ptd); - - GProtocolDefinition gpd=new GProtocolDefinition(); - gpd.setName("F"); - module.getProtocols().add(gpd); - - DefaultModuleLoader loader=new DefaultModuleLoader(); - DefaultModuleContext context=new DefaultModuleContext(null, null, loader); - - Module impmodule=new Module(); - impmodule.setName("a.b.D"); - - PayloadTypeDecl impptd=new PayloadTypeDecl(); - impptd.setAlias("E"); - impmodule.getPayloadTypeDeclarations().add(impptd); - - loader.registerModule(impmodule); - - rule.validate(context, module, logger); - - if (!logger.isErrorsOrWarnings()) { - fail("Errors not detected"); - } - - if (!logger.getErrors().contains(MessageFormat.format( - ValidationMessages.getMessage("MEMBER_NAME_NOT_DISTINCT"), "F"))) { - fail("Error MEMBER_NAME_NOT_DISTINCT not detected"); - } - } -} diff --git a/mvnw b/mvnw new file mode 100755 index 000000000..6ecc150ae --- /dev/null +++ b/mvnw @@ -0,0 +1,236 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven2 Start Up Batch script +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# M2_HOME - location of maven2's installed home dir +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "`uname`" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # + # Look for the Apple JDKs first to preserve the existing behaviour, and then look + # for the new JDKs provided by Oracle. + # + if [ -z "$JAVA_HOME" ] && [ -L /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK ] ; then + # + # Apple JDKs + # + export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home + fi + + if [ -z "$JAVA_HOME" ] && [ -L /System/Library/Java/JavaVirtualMachines/CurrentJDK ] ; then + # + # Apple JDKs + # + export JAVA_HOME=/System/Library/Java/JavaVirtualMachines/CurrentJDK/Contents/Home + fi + + if [ -z "$JAVA_HOME" ] && [ -L "/Library/Java/JavaVirtualMachines/CurrentJDK" ] ; then + # + # Oracle JDKs + # + export JAVA_HOME=/Library/Java/JavaVirtualMachines/CurrentJDK/Contents/Home + fi + + if [ -z "$JAVA_HOME" ] && [ -x "/usr/libexec/java_home" ]; then + # + # Apple JDKs + # + export JAVA_HOME=`/usr/libexec/java_home` + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=`java-config --jre-home` + fi +fi + +if [ -z "$M2_HOME" ] ; then + ## resolve links - $0 may be a link to maven's home + PRG="$0" + + # need this for relative symlinks + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi + done + + saveddir=`pwd` + + M2_HOME=`dirname "$PRG"`/.. + + # make it fully qualified + M2_HOME=`cd "$M2_HOME" && pwd` + + cd "$saveddir" + # echo Using m2 at $M2_HOME +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --unix "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# For Migwn, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$M2_HOME" ] && + M2_HOME="`(cd "$M2_HOME"; pwd)`" + [ -n "$JAVA_HOME" ] && + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" + # TODO classpath? +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="`which javac`" + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=`which readlink` + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then + if $darwin ; then + javaHome="`dirname \"$javaExecutable\"`" + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + else + javaExecutable="`readlink -f \"$javaExecutable\"`" + fi + javaHome="`dirname \"$javaExecutable\"`" + javaHome=`expr "$javaHome" : '\(.*\)/bin'` + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="`which java`" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + local basedir=$(pwd) + local wdir=$(pwd) + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + wdir=$(cd "$wdir/.."; pwd) + done + echo "${basedir}" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + echo "$(tr -s '\n' ' ' < "$1")" + fi +} + +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-$(find_maven_basedir)} +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --path --windows "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` +fi + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" +export MAVEN_CMD_LINE_ARGS + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +# avoid using MAVEN_CMD_LINE_ARGS below since that would loose parameter escaping in $@ +exec "$JAVACMD" \ + $MAVEN_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/mvnw.cmd b/mvnw.cmd new file mode 100644 index 000000000..8e2b7459f --- /dev/null +++ b/mvnw.cmd @@ -0,0 +1,146 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Maven2 Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" +if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +set MAVEN_CMD_LINE_ARGS=%MAVEN_CONFIG% %* + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" + +set WRAPPER_JAR=""%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +# avoid using MAVEN_CMD_LINE_ARGS below since that would loose parameter escaping in %* +%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" +if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%" == "on" pause + +if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% + +exit /B %ERROR_CODE% diff --git a/pom.xml b/pom.xml index 341340d39..188655f30 100644 --- a/pom.xml +++ b/pom.xml @@ -1,262 +1,418 @@ - - 4.0.0 - org.scribble - parent - 0.3.2-SNAPSHOT - pom - Scribble - http://www.scribble.org - - Scribble - - - - https://github.com/scribble/scribble-java - https://github.com/scribble/scribble-java - - - - - Apache 2 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - Apache License V2 - - - - - - Gary Brown - objectiser - gary.pi4tech@gmail.com - Scribble.org - - Developer - - +0 - - - - - Scribble.org - 2008 - 3.2 - 1.2.14 - 1.9.9 - 4.7 - - - - build - modules - extensions - docs - tools - - - - - - org.scribble - scribble-core - ${project.version} - - - org.scribble - scribble-parser - ${project.version} - - - - org.scribble.docs - scribble-userguide - jdocbook - ${project.version} - - - org.scribble.docs - scribble-developerguide - jdocbook - ${project.version} - - - org.scribble.docs - javadoc - javadoc - ${project.version} - - - - org.codehaus.jackson - jackson-core-asl - ${jackson.version} - - - org.codehaus.jackson - jackson-mapper-asl - ${jackson.version} - - - org.antlr - antlr-runtime - ${antlr.version} - - - log4j - log4j - ${log4j.version} - - - junit - junit - ${junit.version} - - - - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 2.2 - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.9 - - - org.apache.maven.plugins - maven-antrun-plugin - 1.7 - - - org.apache.maven.plugins - maven-assembly-plugin - 2.4 - - - org.jboss.maven.plugins - maven-jdocbook-plugin - 2.3.8 - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 2.3.2 - - 1.6 - 1.6 - false - false - true - -verbose - - - - - org.apache.maven.plugins - maven-source-plugin - - - attach-sources - verify - - jar - - - - - - maven-surefire-plugin - 2.5 - - - **/*TestCase.java - **/*Test.java - - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - 2.6 - - checkstyle/checkstyle.xml - false - checkstyle/suppressions.xml - false - - - - - org.scribble - build - ${project.version} - - - - - check-style - site - - checkstyle - - - - - - - - - - - org.apache.maven.plugins - maven-surefire-report-plugin - - - - - - - jboss-public-repository-group - JBoss Public Maven Repository Group - https://repository.jboss.org/nexus/content/groups/public/ - - true - never - - - true - never - - - - - - - jboss-releases-repository - JBoss Releases Repository - https://repository.jboss.org/nexus/service/local/staging/deploy/maven2/ - - - jboss-snapshots-repository - JBoss Snapshots Repository - https://repository.jboss.org/nexus/content/repositories/snapshots/ - false - - - - - + + + + 4.0.0 + + + org.scribble + parent + 0.5.1-SNAPSHOT + pom + + + + + org.scribble + scribble-core + ${project.version} + + + org.scribble + scribble-parser + ${project.version} + + + org.scribble + scribble-ast + ${project.version} + + + org.scribble + scribble-cli + ${project.version} + + + org.scribble + scribble-runtime + ${project.version} + + + org.scribble + scribble-codegen + ${project.version} + + + org.scribble + scribble-main + ${project.version} + + + + org.scribble + scribble-test + ${project.version} + + + + org.antlr + antlr-runtime + ${antlr.version} + + + junit + junit + ${junit.version} + + + + commons-io + commons-io + ${version.commons-io} + + + + + + + scribble-core + scribble-runtime + scribble-ast + scribble-parser + scribble-codegen + scribble-main + scribble-cli + scribble-test + scribble-dist + scribble-demos + + + + 3.4 + 4.13.1 + + + 2.7 + + + 1.8 + 1.8 + true + + + 2.5.3 + 3.2.1 + + 2.9 + 0.3.4 + 0.1.0 + + + UTF-8 + + + + scribble-java + Scribble + http://www.scribble.org + 2008 + + + + Apache 2 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + Apache License V2 + + + + + Scribble + http://www.scribble.org + + + + + Gary Brown + objectiser + gary.pi4tech@gmail.com + Scribble.org + + Developer + + +0 + + + Raymond Hu + rhu1 + r.z.h.hu@herts.ac.uk + University of Hertfordshire + + Developer + + +0 + + + + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + org.apache.maven.plugins + maven-javadoc-plugin + ${version.maven-javadoc-plugin} + + + org.apache.maven.plugins + maven-antrun-plugin + 1.7 + + + org.apache.maven.plugins + maven-assembly-plugin + 2.4 + + + org.jboss.maven.plugins + maven-jdocbook-plugin + 2.3.8 + + + com.mycila + license-maven-plugin + 3.0 + + + + + io.takari + maven + ${version.io.takari-maven} + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.2 + + + + org.apache.maven.plugins + maven-source-plugin + ${version.maven-source-plugin} + + + attach-sources + verify + + jar + + + + + + maven-surefire-plugin + 2.5 + + + **/*TestCase.java + **/*Test.java + + + **/ScribAllTest.java + + + + + + + com.mycila + license-maven-plugin + +
header.txt
+ true + true + + **/*.xml + **/*.g + **/*.scr + **/*.policy + **/*.txt + mvnw + mvnw.cmd + travis/publish.sh + .mvn/wrapper/maven-wrapper.properties + **/*.versionsBackup + **/Scribble-0.3.original + bin/*.sh + scribblec.sh + **/*.swp + scribble-test/**/*.* + + **/IGNORE + + scribble-f17/**/* + +
+ + + + check + + compile + + +
+ + maven-release-plugin + ${version.maven-release-plugin} + + false + release + true + @{project.version} + + + + io.zipkin.centralsync-maven-plugin + centralsync-maven-plugin + ${version.io.zikin.centralsync-maven-plugin} + + scribble + maven + scribble-java + + +
+
+ + + + + org.apache.maven.plugins + maven-surefire-report-plugin + 3.0.0-M5 + + + + + + + https://github.com/scribble/scribble-java + scm:git:https://github.com/scribble/scribble-java.git + + + scm:git:https://github.com/scribble/scribble-java.git + + HEAD + + + + + + + release + + + + + maven-source-plugin + ${version.maven-source-plugin} + + + attach-sources + + jar + + + + + + + maven-javadoc-plugin + ${version.maven-javadoc-plugin} + + false + + + + attach-javadocs + + jar + + package + + + + + + + + +
diff --git a/scribble-ast/pom.xml b/scribble-ast/pom.xml new file mode 100644 index 000000000..30b214f24 --- /dev/null +++ b/scribble-ast/pom.xml @@ -0,0 +1,26 @@ + + + 4.0.0 + + + scribble-ast + jar + + + + org.scribble + scribble-core + + + + + org.scribble + parent + 0.5.1-SNAPSHOT + + + + scribble-ast + + diff --git a/scribble-ast/src/main/java/org/scribble/ast/AstFactory.java b/scribble-ast/src/main/java/org/scribble/ast/AstFactory.java new file mode 100644 index 000000000..9507be715 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/AstFactory.java @@ -0,0 +1,259 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import java.util.List; + +import org.antlr.runtime.Token; +import org.scribble.ast.global.GChoice; +import org.scribble.ast.global.GConnect; +import org.scribble.ast.global.GContinue; +import org.scribble.ast.global.GDelegPayElem; +import org.scribble.ast.global.GDisconnect; +import org.scribble.ast.global.GDo; +import org.scribble.ast.global.GInteractionSeq; +import org.scribble.ast.global.GMsgTransfer; +import org.scribble.ast.global.GProtoBlock; +import org.scribble.ast.global.GProtoDecl; +import org.scribble.ast.global.GProtoDef; +import org.scribble.ast.global.GProtoHeader; +import org.scribble.ast.global.GRecursion; +import org.scribble.ast.global.GSessionNode; +import org.scribble.ast.global.GWrap; +import org.scribble.ast.local.LAcc; +import org.scribble.ast.local.LChoice; +import org.scribble.ast.local.LClientWrap; +import org.scribble.ast.local.LContinue; +import org.scribble.ast.local.LDisconnect; +import org.scribble.ast.local.LDo; +import org.scribble.ast.local.LInteractionSeq; +import org.scribble.ast.local.LProjectionDecl; +import org.scribble.ast.local.LProtoBlock; +import org.scribble.ast.local.LProtoDef; +import org.scribble.ast.local.LProtoHeader; +import org.scribble.ast.local.LRecursion; +import org.scribble.ast.local.LRecv; +import org.scribble.ast.local.LReq; +import org.scribble.ast.local.LSelfDecl; +import org.scribble.ast.local.LSend; +import org.scribble.ast.local.LServerWrap; +import org.scribble.ast.local.LSessionNode; +import org.scribble.ast.name.PayElemNameNode; +import org.scribble.ast.name.qualified.DataNameNode; +import org.scribble.ast.name.qualified.GProtoNameNode; +import org.scribble.ast.name.qualified.LProtoNameNode; +import org.scribble.ast.name.qualified.ModuleNameNode; +import org.scribble.ast.name.qualified.SigNameNode; +import org.scribble.ast.name.simple.AmbigNameNode; +import org.scribble.ast.name.simple.DataParamNode; +import org.scribble.ast.name.simple.ExtIdNode; +import org.scribble.ast.name.simple.IdNode; +import org.scribble.ast.name.simple.OpNode; +import org.scribble.ast.name.simple.RecVarNode; +import org.scribble.ast.name.simple.RoleNode; +import org.scribble.ast.name.simple.SigParamNode; +import org.scribble.core.type.kind.NonRoleParamKind; +import org.scribble.core.type.kind.PayElemKind; + + +// Pass null as Token t to create a fresh Token +// AstFactory is for making "fresh" nodes ("fresh" Tokens) with new dels -- cf. ScribNode reconstruct pattern (for Token and del preservation) +// Implementations located in scribble-parser, use ScribbleParser for Token construction +// Currently, used only in relatively niche places (since ANTLR now constructs all parsed nodes "directly") +public interface AstFactory +{ + IdNode IdNode(Token t, String text); + ExtIdNode ExtIdNode(Token t, String text); + + AmbigNameNode AmbigNameNode(Token t, String text); // Deprecate? Never need to make ambigname "manually" via af? (constructed only by ScribbleParser) + DataParamNode DataParamNode(Token t, String text); + OpNode OpNode(Token t, String text); + RecVarNode RecVarNode(Token t, String text); + RoleNode RoleNode(Token t, String text); + SigParamNode SigParamNode(Token t, String text); + + DataNameNode DataNameNode(Token t, List elems); + GProtoNameNode GProtoNameNode(Token t, List elems); + LProtoNameNode LProtoNameNode(Token t, List elems); + ModuleNameNode ModuleNameNode(Token t, List elems); + SigNameNode SigNameNode(Token t, List elems); + + Module Module(Token t, ModuleDecl mdecl, + List> imports, + List> nonprotos, + List> protos); + + ModuleDecl ModuleDecl(Token t, ModuleNameNode fullname); + ImportModule ImportModule(Token t, ModuleNameNode modname, + ModuleNameNode alias); // alias == null for no alias (child not added) + + DataDecl DataDecl(Token t, IdNode schema, ExtIdNode extName, + ExtIdNode extSource, DataNameNode name); + SigDecl SigDecl(Token t, IdNode schema, ExtIdNode extName, + ExtIdNode extSource, SigNameNode name); + GProtoDecl GProtoDecl(Token t, ProtoModList mods, GProtoHeader header, + GProtoDef def); + + // TODO: refactor to use ProtoModList, etc. + ProtoModList ProtoModList(Token t, List mods); + AuxMod AuxMod(Token t); + ExplicitMod ExplicitMod(Token t); + + GProtoHeader GProtocolHeader(Token t, GProtoNameNode name, RoleDeclList rs, + NonRoleParamDeclList ps); + RoleDeclList RoleDeclList(Token t, List ds); + RoleDecl RoleDecl(Token t, RoleNode r); + NonRoleParamDeclList NonRoleParamDeclList(Token t, + List> ds); + DataParamDecl DataParamDecl(Token t, DataParamNode p); + SigParamDecl SigParamDecl(Token t, SigParamNode p); + + GProtoDef GProtoDef(Token t, GProtoBlock block); + GProtoBlock GProtoBlock(Token t, GInteractionSeq seq); + GInteractionSeq GInteractionSeq(Token t, List elems); // CHECKME: ? extends GSessionNode ? -- and similar others? + + SigLitNode SigLitNode(Token t, OpNode op, PayElemList pay); + PayElemList PayElemList(Token t, List> elems); + UnaryPayElem UnaryPayElem(Token t, + PayElemNameNode name); + GDelegPayElem GDelegPayElem(Token t, GProtoNameNode name, RoleNode r); + + GMsgTransfer GMsgTransfer(Token t, RoleNode src, MsgNode msg, + List dsts); + GConnect GConnect(Token t, RoleNode src, MsgNode msg, RoleNode dst); + GDisconnect GDisconnect(Token t, RoleNode left, RoleNode right); + GWrap GWrap(Token t, RoleNode client, RoleNode server); + + GContinue GContinue(Token t, RecVarNode rv); + GDo GDo(Token t, GProtoNameNode proto, NonRoleArgList args, RoleArgList rs); + + RoleArgList RoleArgList(Token t, List rs); + RoleArg RoleArg(Token t, RoleNode r); + NonRoleArgList NonRoleArgList(Token t, List args); + NonRoleArg NonRoleArg(Token t, NonRoleArgNode arg); + + GChoice GChoice(Token t, RoleNode subj, List blocks); + GRecursion GRecursion(Token t, RecVarNode rv, GProtoBlock block); + + /*LProtoDecl LProtoDecl(Token t, ProtoModList mods, + LProtoHeader header, LProtoDef def); // Not currently used -- local protos not yet parsed, only projected*/ + + LProjectionDecl LProjectionDecl(Token t, ProtoModList mods, + LProtoHeader header, LProtoDef def, GProtoNameNode fullname, + RoleNode self); // del extends that of LProtoDecl + + LProtoHeader LProtoHeader(Token t, LProtoNameNode name, RoleDeclList rs, + NonRoleParamDeclList ps); + LSelfDecl LSelfDecl(Token t, RoleNode r); + + LProtoDef LProtoDef(Token t, LProtoBlock block); + LProtoBlock LProtoBlock(Token t, LInteractionSeq seq); + LInteractionSeq LInteractionSeq(Token t, List elems); + + // Following take "self" param in case of parsed Token (not actually supported yet) + LSend LSend(Token t, RoleNode self, MsgNode msg, RoleNode dst); + LRecv LRecv(Token t, RoleNode src, MsgNode msg, RoleNode self); + LAcc LAcc(Token t, RoleNode src, MsgNode msg, RoleNode self); + LReq LReq(Token t, RoleNode self, MsgNode msg, RoleNode dst); + LDisconnect LDisconnect(Token t, RoleNode self, RoleNode peer); + LClientWrap LClientWrap(Token t, RoleNode client, RoleNode server); + LServerWrap LServerWrap(Token t, RoleNode client, RoleNode server); + + LContinue LContinue(Token t, RecVarNode rv); + LDo LDo(Token t, LProtoNameNode proto, NonRoleArgList as, RoleArgList rs); + + LChoice LChoice(Token t, RoleNode subj, List blocks); + LRecursion LRecursion(Token t, RecVarNode rv, LProtoBlock block); +} + + + + + + + + + + + + + + + + + + + + + + + +/* + DummyProjectionRoleNode DummyProjectionRoleNode(); + + LDelegationElem LDelegationElem(CommonTree source, LProtocolNameNode name); + + LProtocolDecl LProtocolDecl(CommonTree source, List modifiers, + LProtocolHeader header, LProtocolDef def); + // Not currently used -- local protos not parsed, only projected + + LProjectionDecl LProjectionDecl(CommonTree source, + List modifiers, GProtocolName fullname, Role self, + LProtocolHeader header, LProtocolDef def); + // del extends that of LProtocolDecl + + LProtocolHeader LProtocolHeader(CommonTree source, LProtocolNameNode name, + RoleDeclList roledecls, NonRoleParamDeclList paramdecls); + + SelfRoleDecl SelfRoleDecl(CommonTree source, RoleNode namenode); + + LProtocolDef LProtocolDef(CommonTree source, LProtocolBlock block); + + LProtocolBlock LProtocolBlock(CommonTree source, LInteractionSeq seq); + + LInteractionSeq LInteractionSeq(CommonTree source, + List actions); + + LSend LSend(CommonTree source, RoleNode src, MessageNode msg, + List dests); + + LRecv LReceive(CommonTree source, RoleNode src, MessageNode msg, + List dests); + + LRequest LRequest(CommonTree source, RoleNode src, MessageNode msg, + RoleNode dest); + + LAccept LAccept(CommonTree source, RoleNode src, MessageNode msg, + RoleNode dest); + + /*LConnect LConnect(CommonTree source, RoleNode src, RoleNode dest); + LAccept LAccept(CommonTree source, RoleNode src, RoleNode dest);* / + + LDisconnect LDisconnect(CommonTree source, RoleNode self, RoleNode peer); + + LWrapClient LWrapClient(CommonTree source, RoleNode self, RoleNode peer); + + LWrapServer LWrapServer(CommonTree source, RoleNode self, RoleNode peer); + + LChoice LChoice(CommonTree source, RoleNode subj, + List blocks); + + LRecursion LRecursion(CommonTree source, RecVarNode recvar, + LProtocolBlock block); + + LContinue LContinue(CommonTree source, RecVarNode recvar); + + LDo LDo(CommonTree source, RoleArgList roles, NonRoleArgList args, + LProtocolNameNode proto); +*/ diff --git a/scribble-ast/src/main/java/org/scribble/ast/AuxMod.java b/scribble-ast/src/main/java/org/scribble/ast/AuxMod.java new file mode 100644 index 000000000..53fac4bb5 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/AuxMod.java @@ -0,0 +1,65 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import org.antlr.runtime.Token; +import org.scribble.del.DelFactory; + +public class AuxMod extends ProtoModNode +{ + // ScribTreeAdaptor#create constructor + public AuxMod(Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected AuxMod(AuxMod node) + { + super(node); + } + + @Override + public AuxMod dupNode() + { + return new AuxMod(this); // return this also OK, since no children + } + + @Override + public void decorateDel(DelFactory df) + { + df.AuxMod(this); + } + + @Override + public boolean isAux() + { + return true; + } + + @Override + public String toString() + { + return "aux"; + } + + + + + + + + + public static final AuxMod AUX = new AuxMod((Token) null); +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/BasicInteraction.java b/scribble-ast/src/main/java/org/scribble/ast/BasicInteraction.java new file mode 100644 index 000000000..a205e8f77 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/BasicInteraction.java @@ -0,0 +1,34 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import org.antlr.runtime.Token; +import org.scribble.core.type.kind.ProtoKind; + +public abstract class BasicInteraction + extends SimpleSessionNode +{ + // ScribTreeAdaptor#create constructor + public BasicInteraction(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public BasicInteraction(BasicInteraction node) + { + super(node); + } +} + diff --git a/scribble-ast/src/main/java/org/scribble/ast/Choice.java b/scribble-ast/src/main/java/org/scribble/ast/Choice.java new file mode 100644 index 000000000..1823047fb --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/Choice.java @@ -0,0 +1,91 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import java.util.List; +import java.util.stream.Collectors; + +import org.antlr.runtime.Token; +import org.scribble.ast.name.simple.RoleNode; +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.util.Constants; +import org.scribble.util.ScribException; +import org.scribble.visit.AstVisitor; + +public abstract class Choice + extends CompoundInteraction +{ + public static final int SUBJ_CHILD_INDEX = 0; + public static final int BLOCK_CHILDREN_START_INDEX = 1; + + // ScribTreeAdaptor#create constructor + public Choice(Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected Choice(Choice node) + { + super(node); + } + + public RoleNode getSubjectChild() + { + return (RoleNode) getChild(SUBJ_CHILD_INDEX); + } + + // Override in concrete sub for cast + public abstract List> getBlockChildren(); + + // "add", not "set" + public void addScribChildren(RoleNode subj, + List> blocks) + { + // Cf. above getters and Scribble.g children order + addChild(subj); + addChildren(blocks); + } + + @Override + public abstract Choice dupNode(); + + public Choice reconstruct(RoleNode subj, + List> blocks) + { + Choice dup = dupNode(); + dup.addScribChildren(subj, blocks); + dup.setDel(del()); // No copy + return dup; + } + + @Override + public Choice visitChildren(AstVisitor nv) throws ScribException + { + RoleNode subj = (RoleNode) visitChild(getSubjectChild(), nv); + List> blocks = + visitChildListWithClassEqualityCheck(this, getBlockChildren(), nv); + return reconstruct(subj, blocks); + } + + @Override + public String toString() + { + String sep = " " + Constants.OR_KW + " "; + return Constants.CHOICE_KW + " " + + Constants.AT_KW + " " + getSubjectChild() + " " + + getBlockChildren().stream().map(b -> b.toString()) + .collect(Collectors.joining(sep)); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/CompoundInteraction.java b/scribble-ast/src/main/java/org/scribble/ast/CompoundInteraction.java new file mode 100644 index 000000000..716948b1b --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/CompoundInteraction.java @@ -0,0 +1,33 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import org.antlr.runtime.Token; +import org.scribble.core.type.kind.ProtoKind; + +public abstract class CompoundInteraction + extends CompoundSessionNode +{ + // ScribTreeAdaptor#create constructor + public CompoundInteraction(Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected CompoundInteraction(CompoundInteraction node) + { + super(node); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/CompoundSessionNode.java b/scribble-ast/src/main/java/org/scribble/ast/CompoundSessionNode.java new file mode 100644 index 000000000..f320a43da --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/CompoundSessionNode.java @@ -0,0 +1,34 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import org.antlr.runtime.Token; +import org.scribble.core.type.kind.ProtoKind; + +// Redundant? Is always a CompoundInteraction -- cf. SimpleSessionNode +public abstract class CompoundSessionNode + extends ScribNodeBase implements SessionNode +{ + // ScribTreeAdaptor#create constructor + public CompoundSessionNode(Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected CompoundSessionNode(CompoundSessionNode node) + { + super(node); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/ConnectAction.java b/scribble-ast/src/main/java/org/scribble/ast/ConnectAction.java new file mode 100644 index 000000000..37c64dcfc --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/ConnectAction.java @@ -0,0 +1,61 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import java.util.List; + +import org.antlr.runtime.Token; +import org.scribble.ast.name.simple.RoleNode; +import org.scribble.core.type.kind.ProtoKind; + +// TODO CHECKME: factor with MessageTransfer? +public abstract class ConnectAction + extends DirectedInteraction +{ + // ScribTreeAdaptor#create constructor + public ConnectAction(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public ConnectAction(ConnectAction node) + { + super(node); + } + + // TODO: refactor + public RoleNode getDestinationChild() + { + List dests = getDestinationChildren(); + if (dests.size() != 1) + { + throw new RuntimeException("Shouldn't get in here: " + this); + // CHECKME: don't use common src/dst pattern between global/local? + } + return dests.get(0); + } + + // CHECKME: currently only used for toString, because current syntax allows "connect" with no explicit message ? + protected boolean isUnitMessage() + { + MsgNode n = getMessageNodeChild(); + if (!n.isSigLitNode()) + { + return false; + } + SigLitNode msn = (SigLitNode) n; + return msn.getOpChild().isEmpty() && msn.getPayloadListChild().isEmpty(); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/Continue.java b/scribble-ast/src/main/java/org/scribble/ast/Continue.java new file mode 100644 index 000000000..f64dd6eb6 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/Continue.java @@ -0,0 +1,74 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import org.antlr.runtime.Token; +import org.scribble.ast.name.simple.RecVarNode; +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.util.Constants; +import org.scribble.util.ScribException; +import org.scribble.visit.AstVisitor; + +public abstract class Continue + extends SimpleSessionNode +{ + public static final int RECVAR_CHILD_INDEX = 0; + + // ScribTreeAdaptor#create constructor + public Continue(Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected Continue(Continue node) + { + super(node); + } + + // "add", not "set" + public void addScribChildren(RecVarNode rv) + { + // Cf. above getters and Scribble.g children order + addChild(rv); + } + + public abstract Continue dupNode(); + + public RecVarNode getRecVarChild() + { + return (RecVarNode) getChild(RECVAR_CHILD_INDEX); + } + + public Continue reconstruct(RecVarNode rv) + { + Continue dup = dupNode(); + dup.addScribChildren(rv); + dup.setDel(del()); // No copy + return dup; + } + + @Override + public Continue visitChildren(AstVisitor nv) throws ScribException + { + RecVarNode recvar = (RecVarNode) visitChild(getRecVarChild(), nv); + return reconstruct(recvar); + } + + @Override + public String toString() + { + return Constants.CONTINUE_KW + " " + getRecVarChild() + ";"; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/DataDecl.java b/scribble-ast/src/main/java/org/scribble/ast/DataDecl.java new file mode 100644 index 000000000..56f5f59e0 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/DataDecl.java @@ -0,0 +1,86 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import org.antlr.runtime.Token; +import org.scribble.ast.name.qualified.DataNameNode; +import org.scribble.core.type.kind.DataKind; +import org.scribble.core.type.name.DataName; +import org.scribble.core.type.name.ModuleName; +import org.scribble.del.DelFactory; +import org.scribble.util.Constants; + +public class DataDecl extends NonProtoDecl +{ + // ScribTreeAdaptor#create constructor + public DataDecl(Token payload) + { + super(payload); + } + + // Tree#dupNode constructor + protected DataDecl(DataDecl node) + { + super(node); + } + + @Override + public DataNameNode getNameNodeChild() + { + return (DataNameNode) getRawNameNodeChild(); + } + + // Cf. CommonTree#dupNode + @Override + public DataDecl dupNode() + { + return new DataDecl(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.DataDecl(this); + } + + @Override + public boolean isDataDecl() + { + return true; + } + + // Simple name (ModuleDecl is the only NameDeclNode that uses qualified names) + @Override + public DataName getDeclName() + { + return getNameNodeChild().toName(); + } + + @Override + public DataName getFullMemberName(Module mod) + { + ModuleName fullmodname = mod.getFullModuleName(); + return new DataName(fullmodname, getDeclName()); + } + + @Override + public String toString() + { + return Constants.DATA_KW + " <" + getSchemaChild() + "> " + + getExtNameChild() + " " + + Constants.FROM_KW + " " + getExtSourceChild() + " " + + Constants.AS_KW + " " + getDeclName() + + ";"; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/DataParamDecl.java b/scribble-ast/src/main/java/org/scribble/ast/DataParamDecl.java new file mode 100644 index 000000000..732edec8b --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/DataParamDecl.java @@ -0,0 +1,66 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import org.antlr.runtime.Token; +import org.scribble.ast.name.simple.DataParamNode; +import org.scribble.core.type.kind.DataKind; +import org.scribble.core.type.name.DataName; +import org.scribble.del.DelFactory; +import org.scribble.util.Constants; + +public class DataParamDecl extends NonRoleParamDecl +{ + // ScribTreeAdaptor#create constructor + public DataParamDecl(Token t) + { + super(t, DataKind.KIND); + } + + // Tree#dupNode constructor + public DataParamDecl(DataParamDecl node) + { + super(node); + } + + @Override + public DataParamNode getNameNodeChild() + { + return (DataParamNode) getRawNameNodeChild(); + } + + @Override + public DataParamDecl dupNode() + { + return new DataParamDecl(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.DataParamDecl(this); + } + + @Override + public DataName getDeclName() + { + return (DataName) getNameNodeChild().toName(); + } + + @Override + public String getKeyword() + { + return Constants.DATA_KW; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/DirectedInteraction.java b/scribble-ast/src/main/java/org/scribble/ast/DirectedInteraction.java new file mode 100644 index 000000000..2b3eeda06 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/DirectedInteraction.java @@ -0,0 +1,101 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import java.util.List; +import java.util.stream.Collectors; + +import org.antlr.runtime.Token; +import org.scribble.ast.name.simple.RoleNode; +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.core.type.name.Role; +import org.scribble.util.ScribException; +import org.scribble.visit.AstVisitor; + +// FIXME: rename (Simple)Interaction, after existing SimpleInteraction renamed +public abstract class DirectedInteraction + extends BasicInteraction +{ + public static final int MSG_CHILD_INDEX = 0; + public static final int SRC_CHILD_INDEX = 1; + public static final int DST_CHILDREN_START_INDEX = 2; + + // ScribTreeAdaptor#create constructor + public DirectedInteraction(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public DirectedInteraction(DirectedInteraction node) + { + super(node); + } + + public MsgNode getMessageNodeChild() + { + return (MsgNode) getChild(MSG_CHILD_INDEX); + } + + public RoleNode getSourceChild() + { + return (RoleNode) getChild(SRC_CHILD_INDEX); + } + + public List getDestinationChildren() + { + List cs = getChildren(); + return cs.subList(DST_CHILDREN_START_INDEX, cs.size()).stream() + .map(x -> (RoleNode) x).collect(Collectors.toList()); + } + + public final List getDestinationRoles() + { + return getDestinationChildren().stream().map(rn -> rn.toName()) + .collect(Collectors.toList()); + } + + // "add", not "set" + public void addScribChildren(MsgNode msg, RoleNode src, List dsts) + { + // Cf. above getters and Scribble.g children order + addChild(msg); + addChild(src); + addChildren(dsts); + } + + public abstract DirectedInteraction dupNode(); + + public DirectedInteraction reconstruct(MsgNode msg, RoleNode src, + List dsts) + { + DirectedInteraction dup = dupNode(); + // Same order as getter indices + dup.addScribChildren(msg, src, dsts); + dup.setDel(del()); // No copy + return dup; + } + + @Override + public DirectedInteraction visitChildren(AstVisitor nv) + throws ScribException + { + MsgNode msg = (MsgNode) visitChild(getMessageNodeChild(), nv); + RoleNode src = (RoleNode) visitChild(getSourceChild(), nv); + List dests = visitChildListWithClassEqualityCheck(this, + getDestinationChildren(), nv); + return reconstruct(msg, src, dests); + } +} + diff --git a/scribble-ast/src/main/java/org/scribble/ast/DisconnectAction.java b/scribble-ast/src/main/java/org/scribble/ast/DisconnectAction.java new file mode 100644 index 000000000..2d4befc1d --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/DisconnectAction.java @@ -0,0 +1,86 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import org.antlr.runtime.Token; +import org.scribble.ast.name.simple.RoleNode; +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.util.Constants; +import org.scribble.util.ScribException; +import org.scribble.visit.AstVisitor; + +// (G)Disconnect is symmetric (send/receive asymmetric/async; request/accept asymmetric/sync; (g)disconnect symmetric/async) +// However, LDisconnect is "symmetric" but self-oriented -- "left" used for self +public abstract class DisconnectAction + extends BasicInteraction +{ + public static final int LEFT_CHILD_INDEX = 0; + public static final int RIGHT_CHILD_INDEX = 1; + + // ScribTreeAdaptor#create constructor + public DisconnectAction(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public DisconnectAction(DisconnectAction node) + { + super(node); + } + + public RoleNode getLeftChild() + { + return (RoleNode) getChild(LEFT_CHILD_INDEX); + } + + public RoleNode getRightChild() + { + return (RoleNode) getChild(RIGHT_CHILD_INDEX); + } + + // "add", not "set" + public void addScribChildren(RoleNode left, RoleNode right) + { + // Cf. above getters and Scribble.g children order + addChild(left); + addChild(right); + } + + public abstract DisconnectAction dupNode(); + + public DisconnectAction reconstruct(RoleNode left, RoleNode right) + { + DisconnectAction dup = dupNode(); + dup.addScribChildren(left, right); + dup.setDel(del()); // No copy + return dup; + } + + @Override + public DisconnectAction visitChildren(AstVisitor nv) + throws ScribException + { + RoleNode src = (RoleNode) visitChild(getLeftChild(), nv); + RoleNode dest = (RoleNode) visitChild(getRightChild(), nv); + return reconstruct(src, dest); + } + + @Override + public String toString() + { + return Constants.DISCONNECT_KW + " " + getLeftChild() + + " " + Constants.AND_KW + " " + getRightChild() + ";"; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/Do.java b/scribble-ast/src/main/java/org/scribble/ast/Do.java new file mode 100644 index 000000000..36d60cbbe --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/Do.java @@ -0,0 +1,130 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import java.util.Iterator; + +import org.antlr.runtime.Token; +import org.scribble.ast.name.qualified.ProtoNameNode; +import org.scribble.core.lang.context.ModuleContext; +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.core.type.name.ProtoName; +import org.scribble.core.type.name.Role; +import org.scribble.job.JobContext; +import org.scribble.util.Constants; +import org.scribble.util.ScribException; +import org.scribble.visit.AstVisitor; + +public abstract class Do + extends SimpleSessionNode // implements ScopedNode +{ + public static final int NAME_CHILD_INDEX = 0; + public static final int ARG_LIST_CHILD_INDEX = 1; + public static final int ROLE_LIST_CHILD_INDEX = 2; + + // ScribTreeAdaptor#create constructor + public Do(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public Do(Do node) + { + super(node); + } + + public abstract ProtoNameNode getProtocolNameNode(); + + public NonRoleArgList getNonRoleListChild() + { + return (NonRoleArgList) getChild(ARG_LIST_CHILD_INDEX); + } + + // CHECKME: maybe wrap up role args and non-role args within the same container? + public RoleArgList getRoleListChild() + { + return (RoleArgList) getChild(ROLE_LIST_CHILD_INDEX); + } + + // "add", not "set" + public void addScribChildren(ProtoNameNode proto, NonRoleArgList as, + RoleArgList rs) + { + // Cf. above getters and Scribble.g children order + addChild(proto); // Order re. getter indices + addChild(as); + addChild(rs); + } + + public abstract Do dupNode(); + + public Do reconstruct(ProtoNameNode proto, NonRoleArgList as, + RoleArgList rs) + { + Do dup = dupNode(); + dup.addScribChildren(proto, as, rs); + dup.setDel(del()); // No copy + return dup; + } + + @Override + public Do visitChildren(AstVisitor nv) throws ScribException + { + RoleArgList ril = (RoleArgList) visitChild(getRoleListChild(), nv); + NonRoleArgList al = (NonRoleArgList) visitChild(getNonRoleListChild(), nv); + ProtoNameNode proto = visitChildWithClassEqualityCheck(this, + getProtocolNameNode(), nv); + return reconstruct(proto, al, ril); + } + + // FIXME: mcontext now redundant because NameDisambiguator converts all targets to full names -- NO: currently disamb doesn't + // To get full name from original target name, use mcontext visible names (e.g. in or before name disambiguation pass) + // This is still useful for subclass casting to G/LProtocolName + public ProtoName getTargetProtoDeclFullName(ModuleContext mcontext) + { + //return mcontext.checkProtocolDeclDependencyFullName(this.proto.toName()); + return getProtocolNameNode().toName(); // Pre: use after name disambiguation (maybe drop FullName suffix) + } + + // CHECKME: mcontext redundant, because redundant for getTargetProtocolDeclFullName + public abstract ProtoDecl getTargetProtocolDecl(JobContext jcontext, + ModuleContext mcontext); + + public Role getTargetRoleParameter(JobContext jcontext, + ModuleContext mcontext, Role role) + { + Iterator args = getRoleListChild().getRoles().iterator(); + Iterator params = getTargetProtocolDecl(jcontext, mcontext) + .getHeaderChild().getRoleDeclListChild().getRoles().iterator(); + while (args.hasNext()) + { + Role arg = args.next(); + Role param = params.next(); + if (arg.equals(role)) + { + return param; + } + } + throw new RuntimeException("Not an argument role: " + role); + } + + @Override + public String toString() + { + String s = Constants.DO_KW + " "; + return s + getProtocolNameNode() + getNonRoleListChild() + getRoleListChild() + + ";"; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/DoArg.java b/scribble-ast/src/main/java/org/scribble/ast/DoArg.java new file mode 100644 index 000000000..cd063a8c3 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/DoArg.java @@ -0,0 +1,76 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import org.antlr.runtime.Token; +import org.scribble.util.ScribException; +import org.scribble.visit.AstVisitor; + +// TODO: rename better? DoArg, DoArgNode, ... +// CHECKME: make DoArg into an interface and have DoArgNode as direct children of Do? +// Cf. NameDeclNode/HeaderParameterDecl, i.e. wrappers for param names/arg values +// Simpler than NameDeclNode, doesn't constrain node-type correspondence for names +public abstract class DoArg extends ScribNodeBase +{ + // ScribTreeAdaptor#create constructor + public DoArg(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public DoArg(DoArg node) + { + super(node); + } + + public abstract T getArgNodeChild(); + + // "add", not "set" + public void addScribChildren(T arg) + { + // Cf. above getters and Scribble.g children order + addChild(arg); + } + + public abstract DoArg dupNode(); + + public DoArg reconstruct(T arg) + { + DoArg dup = dupNode(); + dup.addScribChildren(arg); + dup.setDel(del()); // No copy + return dup; + } + + @Override + public DoArg visitChildren(AstVisitor nv) throws ScribException + { + ScribNode visited = visitChild(getArgNodeChild(), nv); // Disambiguation will replace AmbiguousNameNodes + // CHECKME: use visitChildWithClassEqualityCheck? + if (!(visited instanceof DoArgNode)) + { + throw new RuntimeException("Shouldn't get in here: " + visited); + } + @SuppressWarnings("unchecked") + T arg = (T) visited; + return reconstruct(arg); + } + + @Override + public String toString() + { + return getArgNodeChild().toString(); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/DoArgList.java b/scribble-ast/src/main/java/org/scribble/ast/DoArgList.java new file mode 100644 index 000000000..daccb7251 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/DoArgList.java @@ -0,0 +1,85 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import java.util.List; +import java.util.stream.Collectors; + +import org.antlr.runtime.Token; +import org.scribble.util.ScribException; +import org.scribble.visit.AstVisitor; + +// Cf. HeaderParameterDeclList -- but not kinded, because cannot determine Arg kind directly from node syntax itself (kinding for ModelNodes is to supplement syntactic information, not "typing" work) +// DoArgList (NonRoleArgList) can be of mixed kinds, so DoArg (NonRoleArg) used as "wildcard" wrapper +// "? extends InstantiationNode" not enforced here (e.g. can put "? extends ModelNode"), because ultimately any instantiation of this class needs an actual instance of "Instantiation" which has to have a parameter that extends "InstantiationNode" +public abstract class DoArgList> extends ScribNodeBase +{ + // ScribTreeAdaptor#create constructor + public DoArgList(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public DoArgList(DoArgList node) + { + super(node); + } + + protected List getRawArgChildren() + { + return getChildren(); + } + + public abstract List getArgChildren(); + + // "add", not "set" + public void addScribChildren(List args) + { + // Cf. above getters and Scribble.g children order + addChildren(args); + } + + @Override + public abstract DoArgList dupNode(); + + public DoArgList reconstruct(List args) + { + DoArgList dup = dupNode(); + dup.addScribChildren(args); + dup.setDel(del()); // No copy + return dup; + } + + @Override + public DoArgList visitChildren(AstVisitor nv) throws ScribException + { + List nds = + visitChildListWithClassEqualityCheck(this, getArgChildren(), nv); + return reconstruct(nds); + } + + public int length() + { + return getChildCount(); + } + + // Like HeaderParamDeclList, without enclosing braces -- added by subclasses + @Override + public String toString() + { + return getArgChildren().stream().map(a -> a.toString()) + .collect(Collectors.joining(", ")); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/DoArgNode.java b/scribble-ast/src/main/java/org/scribble/ast/DoArgNode.java new file mode 100644 index 000000000..7f9ea2209 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/DoArgNode.java @@ -0,0 +1,21 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +// DoArgNode for DoArg is "dual" to (Simple)NameNode for HeaderParamDecls -- but do args are not all necessarily e.g. simplenames so have to introduce a new interface +// RoleNodes and NonRoleArgNodes +public interface DoArgNode extends ScribNode +{ + +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/ExplicitMod.java b/scribble-ast/src/main/java/org/scribble/ast/ExplicitMod.java new file mode 100644 index 000000000..82cdb2470 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/ExplicitMod.java @@ -0,0 +1,56 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import org.antlr.runtime.Token; +import org.scribble.del.DelFactory; + +public class ExplicitMod extends ProtoModNode +{ + // ScribTreeAdaptor#create constructor + public ExplicitMod(Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected ExplicitMod(ExplicitMod node) + { + super(node); + } + + @Override + public boolean isExplicit() + { + return true; + } + + @Override + public ExplicitMod dupNode() + { + return new ExplicitMod(this); // return this also OK, since no children + } + + @Override + public void decorateDel(DelFactory df) + { + df.ExplicitMod(this); + } + + @Override + public String toString() + { + return "explicit"; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/ImportDecl.java b/scribble-ast/src/main/java/org/scribble/ast/ImportDecl.java new file mode 100644 index 000000000..331a3155a --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/ImportDecl.java @@ -0,0 +1,45 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import org.antlr.runtime.Token; +import org.scribble.core.type.kind.ImportKind; +import org.scribble.core.type.name.Name; + +// CHECKME: factor out more stuff from ImportModule and ImportMember into here? e.g. alias/name, reconstruct (or else no need for common super?) +public abstract class ImportDecl extends ScribNodeBase +{ + // ScribTreeAdaptor#create constructor + public ImportDecl(Token payload) + { + super(payload); + } + + // Tree#dupNode constructor + protected ImportDecl(ImportDecl node) + { + super(node); + } + + public abstract ImportDecl dupNode(); + + public boolean isImportModule() + { + return false; + } + + public abstract boolean hasAlias(); + + public abstract Name getAlias(); +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/ImportModule.java b/scribble-ast/src/main/java/org/scribble/ast/ImportModule.java new file mode 100644 index 000000000..b7af51c3d --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/ImportModule.java @@ -0,0 +1,128 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import org.antlr.runtime.Token; +import org.scribble.ast.name.qualified.ModuleNameNode; +import org.scribble.core.type.kind.ModuleKind; +import org.scribble.core.type.name.ModuleName; +import org.scribble.del.DelFactory; +import org.scribble.util.Constants; +import org.scribble.util.ScribException; +import org.scribble.visit.AstVisitor; + +public class ImportModule extends ImportDecl +{ + public static final int MODULENAME_CHILD = 0; + public static final int ALIAS_CHILD = 1; + + // ScribTreeAdaptor#create constructor + public ImportModule(Token payload) + { + super(payload); + } + + // Tree#dupNode constructor + protected ImportModule(ImportModule node) + { + super(node); + } + + // Full name ("import x.y.Z") + public ModuleNameNode getModuleNameNodeChild() + { + return (ModuleNameNode) getChild(MODULENAME_CHILD); + } + + // Pre: hasAlias -- no alias means no child + // Simple name + // No child if no alias (cf. hasAlias) -- cf. addScribChildren, alias == null + public ModuleNameNode getAliasNameNodeChild() + { + return (ModuleNameNode) getChild(ALIAS_CHILD); + } + + // "add", not "set" + public void addScribChildren(ModuleNameNode modname, ModuleNameNode alias) + { + // Cf. above getters and Scribble.g children order + addChild(modname); + if (alias != null) + { + addChild(alias); + } + } + + // Cf. CommonTree#dupNode + @Override + public ImportModule dupNode() + { + return new ImportModule(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.ImportModule(this); + } + + // alias == null if no alias + public ImportModule reconstruct(ModuleNameNode modname, ModuleNameNode alias) + { + ImportModule dup = dupNode(); + dup.addScribChildren(modname, alias); + dup.setDel(del()); // No copy + return dup; + } + + @Override + public ImportModule visitChildren(AstVisitor nv) throws ScribException + { + ModuleNameNode modname = (ModuleNameNode) + visitChild(getModuleNameNodeChild(), nv); + ModuleNameNode alias = hasAlias() + ? (ModuleNameNode) visitChild(getAliasNameNodeChild(), nv) + : null; + return reconstruct(modname, alias); + } + + @Override + public boolean isImportModule() + { + return true; + } + + @Override + public boolean hasAlias() + { + return getChildCount() > 1; + } + + @Override + public ModuleName getAlias() + { + return getAliasNameNodeChild().toName(); + } + + @Override + public String toString() + { + String s = Constants.IMPORT_KW + " " + getModuleNameNodeChild(); + if (hasAlias()) + { + s += " " + Constants.AS_KW + " " + getAlias(); + } + return s + ";"; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/InteractionSeq.java b/scribble-ast/src/main/java/org/scribble/ast/InteractionSeq.java new file mode 100644 index 000000000..60477d36f --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/InteractionSeq.java @@ -0,0 +1,97 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import java.util.LinkedList; +import java.util.List; +import java.util.stream.Collectors; + +import org.antlr.runtime.Token; +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.util.ScribException; +import org.scribble.visit.AstVisitor; + +public abstract class InteractionSeq + extends ScribNodeBase implements ProtoKindNode +{ + // ScribTreeAdaptor#create constructor + public InteractionSeq(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public InteractionSeq(InteractionSeq node) + { + super(node); + } + + public abstract List> getInteractionChildren(); + + // "add", not "set" + public void addScribChildren(List> elems) + { + // Cf. above getters and Scribble.g children order + addChildren(elems); + } + + @Override + public abstract InteractionSeq dupNode(); + + public InteractionSeq reconstruct(List> elems) + { + InteractionSeq dup = dupNode(); + dup.addScribChildren(elems); + dup.setDel(del()); // No copy + return dup; + } + + @Override + public ScribNode visitChildren(AstVisitor nv) throws ScribException + { + List> actions = new LinkedList<>(); + for (SessionNode in : getInteractionChildren()) + { + //ProtocolKindNode visited = visitProtocolKindChildWithCastCheck(this, in, nv, ProtocolKindNode.class, in.getKind(), KIND_CAST); + // No: ProjectedChoiceDoPruning (and others?) needs to return null; CastCheck doesn't allow that // CHECKME + // TODO: make a unit test for this + ScribNode visited = visitChild(in, nv); + if (visited instanceof InteractionSeq) + { + @SuppressWarnings("unchecked") + InteractionSeq tmp = (InteractionSeq) visited; + actions.addAll(tmp.getInteractionChildren()); + } + else + { + @SuppressWarnings("unchecked") + SessionNode tmp = (SessionNode) visited; + actions.add(tmp); + } + } + return reconstruct(actions); + } + + public boolean isEmpty() + { + return getChildCount() == 0; //this.inters.isEmpty(); + } + + @Override + public String toString() + { + return getInteractionChildren().stream().map(i -> i.toString()) + .collect(Collectors.joining("\n")); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/Module.java b/scribble-ast/src/main/java/org/scribble/ast/Module.java new file mode 100644 index 000000000..2902e5ae6 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/Module.java @@ -0,0 +1,264 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import java.util.LinkedList; +import java.util.List; +import java.util.Optional; +import java.util.function.Function; +import java.util.function.Predicate; +import java.util.stream.Collectors; + +import org.antlr.runtime.Token; +import org.scribble.ast.global.GProtoDecl; +import org.scribble.ast.local.LProtoDecl; +import org.scribble.core.type.kind.Kind; +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.core.type.name.DataName; +import org.scribble.core.type.name.GProtoName; +import org.scribble.core.type.name.LProtoName; +import org.scribble.core.type.name.MemberName; +import org.scribble.core.type.name.ModuleName; +import org.scribble.core.type.name.ProtoName; +import org.scribble.core.type.name.SigName; +import org.scribble.del.DelFactory; +import org.scribble.util.ScribException; +import org.scribble.visit.AstVisitor; + +public class Module extends ScribNodeBase +{ + public static final int MODDECL_CHILD_INDEX = 0; + + // ScribTreeAdaptor#create constructor + public Module(Token payload) + { + super(payload); + } + + // Tree#dupNode constructor + protected Module(Module node) + { + super(node); + } + + public ModuleDecl getModuleDeclChild() + { + return (ModuleDecl) getChild(MODDECL_CHILD_INDEX); + } + + public List> getImportDeclChildren() + { + return getMemberChildren(x -> x instanceof ImportDecl, + x -> (ImportDecl) x); + } + + public List> getNonProtoDeclChildren() + { + return getMemberChildren(x -> x instanceof NonProtoDecl, + x -> (NonProtoDecl) x); + } + + public List> getProtoDeclChildren() + { + return getMemberChildren(x -> x instanceof ProtoDecl, + x -> (ProtoDecl) x); + } + + // Not requiring T extends ModuleMember, ImportDecl is not a ModuleMember + private List getMemberChildren( + Predicate instanceOf, Function cast) + { + List res = new LinkedList<>(); + boolean b = false; + // Start collecting from first instance, and stop on first non-instance or end + for (ScribNode c : getChildren()) + { + if (!b && instanceOf.test(c)) b = true; + else if (b && !instanceOf.test(c)) break; + if (b) res.add(cast.apply(c)); + } + return res; + } + + // "add", not "set" + public void addScribChildren(ModuleDecl moddecl, + List> imports, + List> data, List> protos) + { + // Cf. above getters and Scribble.g children order + addChild(moddecl); + addChildren(imports); + addChildren(data); + addChildren(protos); + } + + // Cf. CommonTree#dupNode + @Override + public Module dupNode() + { + return new Module(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.Module(this); + } + + // Set args as children on a dup of this -- children *not* cloned + protected Module reconstruct(ModuleDecl moddecl, List> imports, + List> data, List> protos) + { + Module dup = dupNode(); + dup.addScribChildren(moddecl, imports, data, protos); + dup.setDel(del()); // No copy + return dup; + } + + @Override + public Module visitChildren(AstVisitor nv) throws ScribException + { + ModuleDecl moddecl = (ModuleDecl) visitChild(getModuleDeclChild(), nv); + // class equality check probably too restrictive -- FIXME: remove class checks + List> imports = ScribNodeBase + .visitChildListWithClassEqualityCheck(this, getImportDeclChildren(), nv); + List> data = ScribNodeBase + .visitChildListWithClassEqualityCheck(this, getNonProtoDeclChildren(), nv); + List> protos = ScribNodeBase + .visitChildListWithClassEqualityCheck(this, getProtoDeclChildren(), nv); + return reconstruct(moddecl, imports, data, protos); + } + + public DataDecl getTypeDeclChild(DataName simpname) + { + return (DataDecl) getNonProtoDeclChild(simpname, NonProtoDecl::isDataDecl); + } + + public SigDecl getSigDeclChild(SigName simpname) + { + return (SigDecl) getNonProtoDeclChild(simpname, NonProtoDecl::isSigDecl); + } + + private NonProtoDecl getNonProtoDeclChild(MemberName simpname, + Predicate> f) + { + Optional> res = getNonProtoDeclChildren().stream() + .filter(x -> f.test(x) && x.getDeclName().equals(simpname)) + .findFirst(); // No duplication check, rely on WF + if (!res.isPresent()) + { + throw new RuntimeException("Data decl not found: " + simpname); + } + return res.get(); + } + + public List getGProtoDeclChildren() + { + return getProtoDeclChildren().stream().filter(x -> x.isGlobal()) + .map(x -> (GProtoDecl) x).collect(Collectors.toList()); + // Less efficient, but smaller code + } + + public List getLProtoDeclChildren() + { + return getProtoDeclChildren().stream().filter(x -> x.isLocal()) + .map(x -> (LProtoDecl) x).collect(Collectors.toList()); + // Less efficient, but smaller code + } + + // CHECKME: allow global and local protocols with same simpname in same module? -- currently, no? + public boolean hasGProtocolDecl(GProtoName simpname) + { + return hasProtocolDeclChild(simpname, ProtoDecl::isGlobal).isPresent(); + } + + // Pre: hasGProtocolDecl(simpname) + public GProtoDecl getGProtocolDeclChild(GProtoName simpname) + { + Optional> res = hasProtocolDeclChild(simpname, + ProtoDecl::isGlobal); + if (!res.isPresent()) + { + throw new RuntimeException("Global proto decl not found: " + simpname); + } + return (GProtoDecl) res.get(); + } + + public LProtoDecl getLProtocolDeclChild(LProtoName simpname) + { + Optional> res = hasProtocolDeclChild(simpname, + ProtoDecl::isLocal); + if (!res.isPresent()) + { + throw new RuntimeException("Local proto decl not found: " + simpname); + } + return (LProtoDecl) res.get(); + } + + private Optional> hasProtocolDeclChild( + ProtoName simpname, Predicate> f) + { + return getProtoDeclChildren().stream() + .filter(x -> f.test(x) && x.getHeaderChild().getDeclName().equals(simpname)) + .findFirst(); // No duplication check, rely on WF + } + + public ModuleName getFullModuleName() + { + return getModuleDeclChild().getFullModuleName(); + } + + @Override + public String toString() + { + String s = getModuleDeclChild().toString(); + for (ImportDecl id : getImportDeclChildren()) + { + s += "\n" + id; + } + for (NonProtoDecl dtd : getNonProtoDeclChildren()) + { + s += "\n" + dtd; + } + for (ProtoDecl pd : getProtoDeclChildren()) + { + s += "\n" + pd; + } + return s; + } +} + + + + + + + + + + + + + + + + + + + + /*private static final Predicate IS_GPROTOCOLDECL = + x -> (x instanceof ProtocolDecl) && ((ProtocolDecl) x).isGlobal(); + + private static final Function TO_GPROTOCOLDECL = + x -> (GProtocolDecl) x;*/ diff --git a/scribble-ast/src/main/java/org/scribble/ast/ModuleDecl.java b/scribble-ast/src/main/java/org/scribble/ast/ModuleDecl.java new file mode 100644 index 000000000..98c24e591 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/ModuleDecl.java @@ -0,0 +1,96 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import org.antlr.runtime.Token; +import org.scribble.ast.name.qualified.ModuleNameNode; +import org.scribble.core.type.kind.ModuleKind; +import org.scribble.core.type.name.ModuleName; +import org.scribble.del.DelFactory; +import org.scribble.util.Constants; +import org.scribble.util.ScribException; +import org.scribble.visit.AstVisitor; + +public class ModuleDecl extends NameDeclNode +{ + // ScribTreeAdaptor#create constructor + public ModuleDecl(Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected ModuleDecl(ModuleDecl node) + { + super(node); + } + + @Override + public ModuleNameNode getNameNodeChild() + { + return (ModuleNameNode) getRawNameNodeChild(); + } + + // "add", not "set" + public void addScribChildren(ModuleNameNode name) + { + // Cf. above getters and Scribble.g children order + addChild(name); + } + + // Cf. CommonTree#dupNode + @Override + public ModuleDecl dupNode() + { + return new ModuleDecl(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.ModuleDecl(this); + } + + protected ModuleDecl reconstruct(ModuleNameNode name) + { + ModuleDecl dup = dupNode(); + dup.addScribChildren(name); + dup.setDel(del()); // No copy + return dup; + } + + @Override + public ModuleDecl visitChildren(AstVisitor nv) throws ScribException + { + ModuleNameNode name = (ModuleNameNode) visitChild(getNameNodeChild(), nv); + return reconstruct(name); + } + + public ModuleName getFullModuleName() + { + return (ModuleName) getNameNodeChild().toName(); + } + + @Override + public ModuleName getDeclName() + { + return getNameNodeChild().toName().getSimpleName(); // Uniform with other NameDeclNodes wrt. returning simple name + } + + @Override + public String toString() + { + return Constants.MODULE_KW + " " + getFullModuleName() + ";"; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/ModuleMember.java b/scribble-ast/src/main/java/org/scribble/ast/ModuleMember.java new file mode 100644 index 000000000..c0ce26cab --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/ModuleMember.java @@ -0,0 +1,24 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import org.scribble.core.type.kind.ModuleMemberKind; +import org.scribble.core.type.name.MemberName; + +// Not an abstract class, NonProtocolDecl extends NameDeclNode (whereas ProtocolDecl uses ProtocolHeader for that) +public interface ModuleMember +{ + MemberName getFullMemberName(Module mod); + // Should not use ModuleContext -- i.e. works before ModuleContext is built (indeed, context building uses this) +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/MsgNode.java b/scribble-ast/src/main/java/org/scribble/ast/MsgNode.java new file mode 100644 index 000000000..26c4eaf5f --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/MsgNode.java @@ -0,0 +1,24 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import org.scribble.core.type.session.Msg; + +// A sig kind node: MessageSignatureNode, MessageSignatureNameNode or NonRoleParamNode +public interface MsgNode extends NonRoleArgNode +{ + Msg toMsg(); + + //Arg toArg(); // Not possible due to "diamond" with PayloadElemNameNode at AmbigNameNode +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/MsgTransfer.java b/scribble-ast/src/main/java/org/scribble/ast/MsgTransfer.java new file mode 100644 index 000000000..b73eb146d --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/MsgTransfer.java @@ -0,0 +1,35 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import org.antlr.runtime.Token; +import org.scribble.core.type.kind.ProtoKind; + +public abstract class MsgTransfer + extends DirectedInteraction +{ + // ScribTreeAdaptor#create constructor + public MsgTransfer(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public MsgTransfer(MsgTransfer node) + { + super(node); + } +} + + diff --git a/scribble-ast/src/main/java/org/scribble/ast/NameDeclNode.java b/scribble-ast/src/main/java/org/scribble/ast/NameDeclNode.java new file mode 100644 index 000000000..5492874bb --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/NameDeclNode.java @@ -0,0 +1,57 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import org.antlr.runtime.Token; +import org.scribble.ast.name.NameNode; +import org.scribble.core.type.kind.Kind; +import org.scribble.core.type.name.Name; + +public abstract class NameDeclNode extends ScribNodeBase +{ + public static final int NAMENODE_CHILD_INDEX = 0; + + // ScribTreeAdaptor#create constructor + public NameDeclNode(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public NameDeclNode(NameDeclNode node) + { + super(node); + } + + // CHECKME: always AmbigNameNode? + protected final NameNode getRawNameNodeChild() + { + if (getChildCount() < 1) // E.g., ProtocolHeader three children + { + throw new RuntimeException("Shouldn't get in here: " + getClass()); + } + NameNode name = (NameNode) getChild(NAMENODE_CHILD_INDEX); + return name; + } + + // Concrete subclasses should use getRawNameNodeChild() and cast + // (Avoids needing to explicitly record the kind, cf. NonRoleParamDecl) + // (Gets overridden anyway for return type) + public abstract NameNode getNameNodeChild(); + + // Return: *simple* name (cf. ModuleDecl) + // Concrete subclasses should use getNameNode, toName (simple name) and cast + // (Gets overridden anyway for return type) + public abstract Name getDeclName(); +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/NonProtoDecl.java b/scribble-ast/src/main/java/org/scribble/ast/NonProtoDecl.java new file mode 100644 index 000000000..2a87b1de6 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/NonProtoDecl.java @@ -0,0 +1,124 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import org.antlr.runtime.Token; +import org.scribble.ast.name.NameNode; +import org.scribble.ast.name.simple.ExtIdNode; +import org.scribble.ast.name.simple.IdNode; +import org.scribble.core.type.kind.NonProtoKind; +import org.scribble.util.ScribException; +import org.scribble.visit.AstVisitor; + +// Rename to something better +public abstract class NonProtoDecl + extends NameDeclNode implements ModuleMember +{ + // NameDeclNode.NAMENODE_CHILD_INDEX = 0; + public static final int SCHEMA_NODE_CHILD_INDEX = 1; + public static final int EXTNAME_NODE_CHILD_INDEX = 2; + public static final int EXTSOURCE_NODE_CHILD_INDEX = 3; + + // ScribTreeAdaptor#create constructor + public NonProtoDecl(Token payload) + { + super(payload); + } + + // Tree#dupNode constructor + protected NonProtoDecl(NonProtoDecl node) + { + super(node); + } + + // Redundant override, just for documentation + @Override + public abstract NameNode getNameNodeChild(); + + public IdNode getSchemaChild() + { + return (IdNode) getChild(SCHEMA_NODE_CHILD_INDEX); + } + + public ExtIdNode getExtNameChild() + { + return (ExtIdNode) getChild(EXTNAME_NODE_CHILD_INDEX); + } + + public ExtIdNode getExtSourceChild() + { + return (ExtIdNode) getChild(EXTSOURCE_NODE_CHILD_INDEX); + } + + // "add", not "set" + public void addScribChildren(NameNode name, IdNode schema, + ExtIdNode extName, ExtIdNode extSource) + { + // Cf. above getters and Scribble.g children order + addChild(name); + addChild(schema); + addChild(extName); + addChild(extSource); + } + + // CHECKME: maybe move to ModuleMember + public boolean isDataDecl() + { + return false; + } + + public boolean isSigDecl() + { + return false; + } + + @Override + public abstract NonProtoDecl dupNode(); + + public NonProtoDecl reconstruct(NameNode name, IdNode schema, + ExtIdNode extName, ExtIdNode extSource) + { + NonProtoDecl dup = dupNode(); + dup.addScribChildren(name, schema, extName, extSource); + dup.setDel(del()); // No copy + return dup; + } + + @Override + public NonProtoDecl visitChildren(AstVisitor nv) + throws ScribException + { + NameNode name = (NameNode) visitChildWithClassEqualityCheck(this, + getNameNodeChild(), nv); + IdNode schema = getSchemaChild(); + ExtIdNode extName = getExtNameChild(); + ExtIdNode extSource = getExtSourceChild(); + return reconstruct(name, schema, extName, extSource); + } + + public String getSchema() + { + return getSchemaChild().getText(); + } + + public String getExtName() + { + return getExtNameChild().getText(); + } + + public String getExtSource() + { + return getExtSourceChild().getText(); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/NonRoleArg.java b/scribble-ast/src/main/java/org/scribble/ast/NonRoleArg.java new file mode 100644 index 000000000..9358573f1 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/NonRoleArg.java @@ -0,0 +1,52 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import org.antlr.runtime.Token; +import org.scribble.del.DelFactory; + +public class NonRoleArg extends DoArg +{ + public static final int ARG_NODE_CHILD_INDEX = 0; + + // ScribTreeAdaptor#create constructor + public NonRoleArg(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public NonRoleArg(NonRoleArg node) + { + super(node); + } + + @Override + public NonRoleArgNode getArgNodeChild() + { + return (NonRoleArgNode) getChild(ARG_NODE_CHILD_INDEX); + } + + @Override + public NonRoleArg dupNode() + { + return new NonRoleArg(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.NonRoleArg(this); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/NonRoleArgList.java b/scribble-ast/src/main/java/org/scribble/ast/NonRoleArgList.java new file mode 100644 index 000000000..bc9b951d7 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/NonRoleArgList.java @@ -0,0 +1,115 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import java.util.LinkedList; +import java.util.List; +import java.util.stream.Collectors; + +import org.antlr.runtime.Token; +import org.scribble.core.type.kind.NonRoleArgKind; +import org.scribble.core.type.kind.NonRoleParamKind; +import org.scribble.core.type.name.DataName; +import org.scribble.core.type.name.SigName; +import org.scribble.core.type.session.Arg; +import org.scribble.core.type.session.SigLit; +import org.scribble.del.DelFactory; + +// Cf. NonRoleParamDeclList +public class NonRoleArgList extends DoArgList +{ + // ScribTreeAdaptor#create constructor + public NonRoleArgList(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public NonRoleArgList(NonRoleArgList node) + { + super(node); + } + + @Override + public List getArgChildren() + { + return getRawArgChildren().stream().map(x -> (NonRoleArg) x) + .collect(Collectors.toList()); + } + + public List getArgNodes() + { + return getArgChildren().stream().map(x -> x.getArgNodeChild()) + .collect(Collectors.toList()); + } + + public boolean isEmpty() + { + return getArgChildren().isEmpty(); + } + + // Can return a mix of arg kinds + public List> getArguments() + { + return getArgChildren().stream() + .map(x -> (Arg) x.getArgNodeChild().toArg()) + .collect(Collectors.toList()); + } + + // Cast all, assuming no Ambig + public List> getParamKindArgs() + { + List> cast = new LinkedList<>(); + for (Arg a : getArguments()) + { + if (a instanceof SigLit) + { + cast.add((SigLit) a); + } + else if (a instanceof DataName) + { + cast.add((DataName) a); + } + else if (a instanceof SigName) + { + cast.add((SigName) a); + } + else + { + throw new RuntimeException("TODO: " + a); + } + } + return cast; + } + + @Override + public NonRoleArgList dupNode() + { + return new NonRoleArgList(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.NonRoleArgList(this); + } + + @Override + public String toString() + { + return getArgChildren().isEmpty() + ? "" + : "<" + super.toString() + ">"; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/NonRoleArgNode.java b/scribble-ast/src/main/java/org/scribble/ast/NonRoleArgNode.java new file mode 100644 index 000000000..8a1f0ff4e --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/NonRoleArgNode.java @@ -0,0 +1,52 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import org.scribble.core.type.kind.NonRoleArgKind; +import org.scribble.core.type.session.Arg; + +// sig or payloadtype kinds that can be used as do arg vals, cf. RoleNode +// "Value nodes" (sigs or names) that can be used as non-role subprotocol arguments (doesn't include role instantation arguments) +// N.B. not the actual argument node itself (that is NonRoleArg, element of NonRoleArgList, which wraps these nodes) +public interface NonRoleArgNode extends DoArgNode +{ + Arg toArg(); + + // Not kinded: point of this interface is don't know which kind the node is -- so use the "is" methods -- cf. AmbigNameNode inherits both sig and data kind + // And not all values are names, e.g. message sigs + default boolean isSigLitNode() + { + return false; + } + + default boolean isSigNameNode() + { + return false; + } + + default boolean isDataNameNode() + { + return false; + } + + default boolean isSigParamNode() + { + return false; + } + + default boolean isDataParamNode() + { + return false; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/NonRoleParamDecl.java b/scribble-ast/src/main/java/org/scribble/ast/NonRoleParamDecl.java new file mode 100644 index 000000000..680964d38 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/NonRoleParamDecl.java @@ -0,0 +1,42 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import org.antlr.runtime.Token; +import org.scribble.core.type.kind.NonRoleParamKind; +import org.scribble.core.type.name.MemberName; + +// CHECKME: drop generic parameter and kind? +public abstract class NonRoleParamDecl + extends ParamDecl +{ + public final K kind; // CHECKME: factor up to super? + + // ScribTreeAdaptor#create constructor + public NonRoleParamDecl(Token t, K kind) + { + super(t); + this.kind = kind; + } + + // Tree#dupNode constructor + public NonRoleParamDecl(NonRoleParamDecl node) + { + super(node); + this.kind = node.kind; + } + + @Override + public abstract MemberName getDeclName(); // DataType/MessageSigName are MemberNames +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/NonRoleParamDeclList.java b/scribble-ast/src/main/java/org/scribble/ast/NonRoleParamDeclList.java new file mode 100644 index 000000000..deecc8b45 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/NonRoleParamDeclList.java @@ -0,0 +1,94 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import java.util.List; +import java.util.stream.Collectors; + +import org.antlr.runtime.Token; +import org.scribble.core.type.kind.NonRoleParamKind; +import org.scribble.core.type.name.MemberName; +import org.scribble.del.DelFactory; + +// Can contain "mixed" type/sig kinds +// Typing a bit awkward that this list has to use NonRoleParamKind as the "concrete" kind, while the NonRoleParamDecl elements use the actual concrete kind +// But OK because the NonRoleParamDecl nodes are immutable (the generic kind value is never rewritten after instantiation, only read) +public class NonRoleParamDeclList extends ParamDeclList +{ + // ScribTreeAdaptor#create constructor + public NonRoleParamDeclList(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public NonRoleParamDeclList(NonRoleParamDeclList node) + { + super(node); + } + + @Override + public List> getDeclChildren() + { + @SuppressWarnings("unchecked") + List> cast = + getChildren().stream() + .map(x -> (NonRoleParamDecl) x) // Cast specifically to NonRoleParamKind (not "?") for hetero list + .collect(Collectors.toList()); + return cast; + } + + /*// "add", not "set" + public void addScribChildren(List> ds) + { + // Cf. above getters and Scribble.g children order + super.addChildren(ds); + }*/ + + @Override + public NonRoleParamDeclList dupNode() + { + return new NonRoleParamDeclList(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.NonRoleParamDeclList(this); + } + + @Override + public NonRoleParamDeclList reconstruct( + List> ds) + { + NonRoleParamDeclList dup = dupNode(); + dup.addScribChildren(ds); + dup.setDel(del()); // No copy + return dup; + } + + public List> getParams() + { + return getDeclChildren().stream().map(decl -> decl.getDeclName()) + .collect(Collectors.toList()); + } + + @Override + public String toString() + { + return (isEmpty()) + ? "" + : "<" + super.toString() + ">"; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/ParamDecl.java b/scribble-ast/src/main/java/org/scribble/ast/ParamDecl.java new file mode 100644 index 000000000..026e306a6 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/ParamDecl.java @@ -0,0 +1,75 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import org.antlr.runtime.Token; +import org.scribble.ast.name.NameNode; +import org.scribble.core.type.kind.ParamKind; +import org.scribble.util.ScribException; +import org.scribble.visit.AstVisitor; + +// Names that are declared in a protocol header (roles and parameters -- not the protocol name though) +// RoleKind or (NonRole)ParamKind +public abstract class ParamDecl + extends NameDeclNode +{ + // ScribTreeAdaptor#create constructor + public ParamDecl(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public ParamDecl(ParamDecl node) + { + super(node); + } + + @Override + public abstract NameNode getNameNodeChild(); // Always a "simple" name (e.g., like Role), but Type/Sig names are not SimpleNames + + public abstract String getKeyword(); + + // "add", not "set" + public void addScribChildren(NameNode name) + { + // Cf. above getters and Scribble.g children order + addChild(name); + } + + public abstract ParamDecl dupNode(); + + public ParamDecl reconstruct(NameNode name) // Always a "simple" name (e.g., like Role), but Type/Sig names are not SimpleNames + { + ParamDecl dup = dupNode(); + dup.addScribChildren(name); + dup.setDel(del()); // No copy + return dup; + } + + @Override + public ParamDecl visitChildren(AstVisitor nv) + throws ScribException + { + NameNode name = + visitChildWithClassEqualityCheck(this, getNameNodeChild(), nv); + return reconstruct(name); + } + + @Override + public String toString() + { + return getKeyword() + " " + getDeclName().toString(); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/ParamDeclList.java b/scribble-ast/src/main/java/org/scribble/ast/ParamDeclList.java new file mode 100644 index 000000000..0637fa0d4 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/ParamDeclList.java @@ -0,0 +1,87 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import java.util.List; +import java.util.stream.Collectors; + +import org.antlr.runtime.Token; +import org.scribble.core.type.kind.ParamKind; +import org.scribble.util.ScribException; +import org.scribble.visit.AstVisitor; + + +// RoleKind or (NonRole)ParamKind +public abstract class ParamDeclList extends ScribNodeBase +{ + // ScribTreeAdaptor#create constructor + public ParamDeclList(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public ParamDeclList(ParamDeclList node) + { + super(node); + } + + public abstract List> getDeclChildren(); + + // "add", not "set" + public void addScribChildren(List> ds) + { + // Cf. above getters and Scribble.g children order + super.addChildren(ds); + } + + @Override + public abstract ParamDeclList dupNode(); + + public ParamDeclList reconstruct( + List> ds) + { + ParamDeclList dup = dupNode(); + dup.addScribChildren(ds); + dup.setDel(del()); // No copy + return dup; + } + + @Override + public ParamDeclList visitChildren(AstVisitor v) + throws ScribException + { + List> ps = + visitChildListWithClassEqualityCheck(this, getDeclChildren(), v); + return reconstruct(ps); + } + + public final int length() + { + return getDeclChildren().size(); + } + + public final boolean isEmpty() + { + return length() == 0; + } + + // Without enclosing braces -- added by subclasses + @Override + public String toString() + { + return getDeclChildren().stream().map(x -> x.toString()) + .collect(Collectors.joining(", ")); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/PayElem.java b/scribble-ast/src/main/java/org/scribble/ast/PayElem.java new file mode 100644 index 000000000..6ee4c8711 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/PayElem.java @@ -0,0 +1,33 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import org.scribble.core.type.kind.PayElemKind; +import org.scribble.core.type.name.PayElemType; + +// Not in grammar file -- but cf. DoArg (and PayloadElemList cf. DoArgList) -- i.e. need a wrapper for mixed and initially ambiguous name kinds +public interface PayElem extends ScribNode +{ + PayElemType toPayloadType(); // Mainly a wrapper method for the wrapped NameNode + + default boolean isGlobalDelegationElem() + { + return false; + } + + default boolean isLocalDelegationElem() + { + return false; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/PayElemList.java b/scribble-ast/src/main/java/org/scribble/ast/PayElemList.java new file mode 100644 index 000000000..83320b044 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/PayElemList.java @@ -0,0 +1,100 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import java.util.List; +import java.util.stream.Collectors; + +import org.antlr.runtime.Token; +import org.scribble.core.type.name.PayElemType; +import org.scribble.core.type.session.Payload; +import org.scribble.del.DelFactory; +import org.scribble.util.ScribException; +import org.scribble.visit.AstVisitor; + +// Cf. DoArgList, but here we don't need as much abstraction (cf. RoleArgList, NonRoleArgList) +public class PayElemList extends ScribNodeBase +{ + // ScribTreeAdaptor#create constructor + public PayElemList(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public PayElemList(PayElemList node) + { + super(node); + } + + List> getElementChildren() + { + return getChildren().stream().map(x -> (PayElem) x) + .collect(Collectors.toList()); + } + + // "add", not "set" + public void addScribChildren(List> elems) + { + // Cf. above getters and Scribble.g children order + super.addChildren(elems); + } + + @Override + public PayElemList dupNode() + { + return new PayElemList(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.PayElemList(this); + } + + protected PayElemList reconstruct(List> elems) + { + PayElemList dup = dupNode(); + dup.addScribChildren(elems); + dup.setDel(del()); // No copy + return dup; + } + + @Override + public PayElemList visitChildren(AstVisitor nv) throws ScribException + { + List> elems = + visitChildListWithClassEqualityCheck(this, getElementChildren(), nv); + return reconstruct(elems); + } + + public Payload toPayload() + { + List> elems = getElementChildren().stream() + .map(x -> x.toPayloadType()).collect(Collectors.toList()); + return new Payload(elems); + } + + public boolean isEmpty() + { + return getChildCount() == 0; + } + + @Override + public String toString() + { + return "(" + getElementChildren().stream().map(x -> x.toString()) + .collect(Collectors.joining(", ")) + ")"; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/ProtoBlock.java b/scribble-ast/src/main/java/org/scribble/ast/ProtoBlock.java new file mode 100644 index 000000000..292392c0d --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/ProtoBlock.java @@ -0,0 +1,76 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import org.antlr.runtime.Token; +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.util.ScribException; +import org.scribble.visit.AstVisitor; + +public abstract class ProtoBlock + extends ScribNodeBase +{ + public static final int SEQ_CHILD_INDEX = 0; + + // ScribTreeAdaptor#create constructor + public ProtoBlock(Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected ProtoBlock(ProtoBlock node) + { + super(node); + } + + public abstract InteractionSeq getInteractSeqChild(); + + public boolean isEmpty() + { + return getInteractSeqChild().isEmpty(); + } + + // "add", not "set" + public void addScribChildren(InteractionSeq seq) + { + // Cf. above getters and Scribble.g children order + addChild(seq); + } + + @Override + public abstract ProtoBlock dupNode(); + + public ProtoBlock reconstruct(InteractionSeq seq) + { + ProtoBlock dup = dupNode(); + dup.addScribChildren(seq); + dup.setDel(del()); // No copy + return dup; + } + + @Override + public ProtoBlock visitChildren(AstVisitor nv) throws ScribException + { + InteractionSeq seq = + visitChildWithClassEqualityCheck(this, getInteractSeqChild(), nv); + return reconstruct(seq); + } + + @Override + public String toString() + { + return "{\n" + getInteractSeqChild() + "\n}"; // Empty block will contain an blank line + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/ProtoDecl.java b/scribble-ast/src/main/java/org/scribble/ast/ProtoDecl.java new file mode 100644 index 000000000..a5c0dbc6a --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/ProtoDecl.java @@ -0,0 +1,108 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import java.util.List; + +import org.antlr.runtime.Token; +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.core.type.name.Role; +import org.scribble.util.ScribException; +import org.scribble.visit.AstVisitor; + +// CHECKME: visitChildren for modifiers +public abstract class ProtoDecl extends ScribNodeBase + implements ModuleMember, ProtoKindNode +{ + public static final int MODLIST_CHILD = 0; + public static final int HEADER_CHILD = 1; + public static final int DEF_CHILD = 2; + + // ScribTreeAdaptor#create constructor + protected ProtoDecl(Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected ProtoDecl(ProtoDecl node) + { + super(node); + } + + public ProtoModList getModifierListChild() + { + return (ProtoModList) getChild(MODLIST_CHILD); + } + + // Implement in subclasses to avoid generic cast + public abstract ProtoHeader getHeaderChild(); + public abstract ProtoDef getDefChild(); + + // "add", not "set" + public void addScribChildren(ProtoModList mods, ProtoHeader header, + ProtoDef def) + { + // Cf. above getters and Scribble.g children order + addChild(mods); + addChild(header); + addChild(def); + } + + public boolean isAux() + { + return getModifierListChild().hasAux(); + } + + public boolean isExplicit() + { + return getModifierListChild().hasExplicit(); + } + + public abstract ProtoDecl dupNode(); + + public ProtoDecl reconstruct(ProtoModList mods, ProtoHeader header, + ProtoDef def) + { + ProtoDecl dup = dupNode(); + dup.addScribChildren(mods, header, def); + dup.setDel(del()); // No copy + return dup; + } + + @Override + public ProtoDecl visitChildren(AstVisitor v) throws ScribException + { + ProtoModList mods = visitChildWithClassEqualityCheck(this, + getModifierListChild(), v); + ProtoHeader header = + visitChildWithClassEqualityCheck(this, getHeaderChild(), v); + ProtoDef def = visitChildWithClassEqualityCheck(this, getDefChild(), v); + return reconstruct(mods, header, def); + } + + public List getRoles() + { + // WF disallows unused role declarations + return getHeaderChild().getRoleDeclListChild().getRoles(); + } + + @Override + public String toString() + { + ProtoModList mods = getModifierListChild(); + return (mods.isEmpty() ? "" : mods + " ") + getHeaderChild() + " " + + getDefChild(); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/ProtoDef.java b/scribble-ast/src/main/java/org/scribble/ast/ProtoDef.java new file mode 100644 index 000000000..85d75c949 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/ProtoDef.java @@ -0,0 +1,69 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import org.antlr.runtime.Token; +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.util.ScribException; +import org.scribble.visit.AstVisitor; + +public abstract class ProtoDef extends ScribNodeBase + implements ProtoKindNode +{ + public static final int BLOCK_CHILD_INDEX = 0; + + // ScribTreeAdaptor#create constructor + public ProtoDef(Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected ProtoDef(ProtoDef node) + { + super(node); + } + public abstract ProtoBlock getBlockChild(); + + // "add", not "set" + public void addScribChildren(ProtoBlock block) + { + // Cf. above getters and Scribble.g children order + addChild(block); + } + + public abstract ProtoDef dupNode(); + + public ProtoDef reconstruct(ProtoBlock block) + { + ProtoDef dup = dupNode(); + dup.addScribChildren(block); + dup.setDel(del()); // No copy + return dup; + } + + @Override + public ProtoDef visitChildren(AstVisitor nv) throws ScribException + { + ProtoBlock block = + visitChildWithClassEqualityCheck(this, getBlockChild(), nv); + return reconstruct(block); + } + + @Override + public String toString() + { + return getBlockChild().toString(); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/ProtoHeader.java b/scribble-ast/src/main/java/org/scribble/ast/ProtoHeader.java new file mode 100644 index 000000000..980f1a32c --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/ProtoHeader.java @@ -0,0 +1,111 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import org.antlr.runtime.Token; +import org.scribble.ast.name.qualified.ProtoNameNode; +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.core.type.name.ProtoName; +import org.scribble.util.Constants; +import org.scribble.util.ScribException; +import org.scribble.visit.AstVisitor; + +// TODO: parameterize on global/local name node and role decl list (i.e. self roles) +public abstract class ProtoHeader + extends NameDeclNode implements ProtoKindNode +{ + public static final int NAMENODE_CHILD = 0; + public static final int PARAMDECLLIST_CHILD = 1; + public static final int ROLEDECLLIST_CHILD = 2; + + // ScribTreeAdaptor#create constructor + public ProtoHeader(Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected ProtoHeader(ProtoHeader node) + { + super(node); + } + + // Simple name + @Override + public abstract ProtoNameNode getNameNodeChild(); + + public NonRoleParamDeclList getParamDeclListChild() + { + return (NonRoleParamDeclList) getChild(PARAMDECLLIST_CHILD); + } + + public RoleDeclList getRoleDeclListChild() + { + return (RoleDeclList) getChild(ROLEDECLLIST_CHILD); // TODO: swap order with paramdecllist (in grammar) + } + + // "add", not "set" + public void addScribChildren(ProtoNameNode name, NonRoleParamDeclList ps, + RoleDeclList rs) + { + // Cf. above getters and Scribble.g children order + addChild(name); + addChild(ps); + addChild(rs); + } + + public abstract ProtoHeader dupNode(); + + public ProtoHeader reconstruct(ProtoNameNode name, NonRoleParamDeclList ps, + RoleDeclList rs) + { + ProtoHeader dup = dupNode(); + dup.addScribChildren(name, ps, rs); + dup.setDel(del()); // No copy + return dup; + } + + @Override + public ProtoHeader visitChildren(AstVisitor nv) throws ScribException + { + /*ProtocolNameNode nameNodeChild = (ProtocolNameNode) visitChild( + getNameNodeChild(), nv);*/ // Don't really need to visit, and can avoid generic cast + RoleDeclList rdl = (RoleDeclList) visitChild(getRoleDeclListChild(), nv); + NonRoleParamDeclList pdl = (NonRoleParamDeclList) + visitChild(getParamDeclListChild(), nv); + return reconstruct(getNameNodeChild(), pdl, rdl); + } + + public boolean isParamDeclListEmpty() + { + return getParamDeclListChild().isEmpty(); + } + + @Override + public ProtoName getDeclName() + { + return getNameNodeChild().toName(); + } + + @Override + public String toString() + { + String s = Constants.PROTOCOL_KW + " " + getNameNodeChild(); + if (!isParamDeclListEmpty()) + { + s += getParamDeclListChild(); + } + return s + getRoleDeclListChild(); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/ProtoKindNode.java b/scribble-ast/src/main/java/org/scribble/ast/ProtoKindNode.java new file mode 100644 index 000000000..dfa28f83c --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/ProtoKindNode.java @@ -0,0 +1,31 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import org.scribble.core.type.kind.ProtoKind; + +public interface ProtoKindNode extends ScribNode +{ + K getKind(); + + default boolean isGlobal() + { + return false; + } + + default boolean isLocal() + { + return false; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/ProtoModList.java b/scribble-ast/src/main/java/org/scribble/ast/ProtoModList.java new file mode 100644 index 000000000..d19fc5ab7 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/ProtoModList.java @@ -0,0 +1,98 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import java.util.List; +import java.util.stream.Collectors; + +import org.antlr.runtime.Token; +import org.scribble.del.DelFactory; +import org.scribble.util.ScribException; +import org.scribble.visit.AstVisitor; + +// (Currently) a list of mod leaf nodes as AmbigNameNodes (cf., NameNode "elements") +public class ProtoModList extends ScribNodeBase +{ + // ScribTreeAdaptor#create constructor + public ProtoModList(Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected ProtoModList(ProtoModList node) + { + super(node); + } + + public List getModChildren() + { + return ((List) getChildren()).stream().map(x -> (ProtoModNode) x) + .collect(Collectors.toList()); + } + + // "add", not "set" + public void addScribChildren(List mods) + { + addChildren(mods); + } + + // CHECKME: deprecate? cf. getModChildren + // Cf., NameNode::getSimpleNameList + public List getModList() + { + return getModChildren(); + } + + public boolean hasAux() + { + return getModList().stream().anyMatch(x -> x.isAux()); + } + + public boolean hasExplicit() + { + return getModList().stream().anyMatch(x -> x.isExplicit()); + } + + public boolean isEmpty() + { + return getChildCount() == 0; + } + + @Override + public ProtoModList dupNode() + { + return new ProtoModList(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.ProtoModList(this); + } + + @Override + public ProtoModList visitChildren(AstVisitor nv) throws ScribException + { + // CHECKME: no child visiting, no reconstruct? + return this; + } + + @Override + public String toString() + { + return getModList().stream().map(x -> x.toString()) + .collect(Collectors.joining(" ")); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/ProtoModNode.java b/scribble-ast/src/main/java/org/scribble/ast/ProtoModNode.java new file mode 100644 index 000000000..6e8cf88ff --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/ProtoModNode.java @@ -0,0 +1,61 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import org.antlr.runtime.Token; +import org.scribble.core.lang.ProtoMod; +import org.scribble.util.ScribException; +import org.scribble.visit.AstVisitor; + +public abstract class ProtoModNode extends ScribNodeBase +{ + // ScribTreeAdaptor#create constructor + public ProtoModNode(Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected ProtoModNode(ProtoModNode node) + { + super(node); + } + + public boolean isAux() + { + return false; + } + + public boolean isExplicit() + { + return false; + } + + @Override + public ProtoModNode visitChildren(AstVisitor nv) throws ScribException + { + return this; + } + + // cf. toName + public ProtoMod toProtoMod() // TODO: rename + { + switch (toString()) // Directly from Scribble.g KW + { + case "aux": return ProtoMod.AUX; + case "explicit": return ProtoMod.EXPLICIT; + default: throw new RuntimeException("Unknown modifier: " + this); + } + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/Recursion.java b/scribble-ast/src/main/java/org/scribble/ast/Recursion.java new file mode 100644 index 000000000..7cc0d6519 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/Recursion.java @@ -0,0 +1,80 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import org.antlr.runtime.Token; +import org.scribble.ast.name.simple.RecVarNode; +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.util.Constants; +import org.scribble.util.ScribException; +import org.scribble.visit.AstVisitor; + +public abstract class Recursion + extends CompoundInteraction +{ + public static final int RECVAR_CHILD_INDEX = 0; + public static final int BODY_CHILD_INDEX = 1; + + // ScribTreeAdaptor#create constructor + public Recursion(Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected Recursion(Recursion node) + { + super(node); + } + + public abstract Recursion dupNode(); + + public RecVarNode getRecVarChild() + { + return (RecVarNode) getChild(RECVAR_CHILD_INDEX); + } + + // "add", not "set" + public void addScribChildren(RecVarNode recvar, ProtoBlock block) + { + // Cf. above getters and Scribble.g children order + addChild(recvar); + addChild(block); + } + + public abstract ProtoBlock getBlockChild(); + + public Recursion reconstruct(RecVarNode recvar, ProtoBlock block) + { + Recursion dup = dupNode(); + dup.addScribChildren(recvar, block); + dup.setDel(del()); // No copy + return dup; + } + + @Override + public Recursion visitChildren(AstVisitor nv) throws ScribException + { + RecVarNode recvar = (RecVarNode) visitChild(getRecVarChild(), nv); + ProtoBlock block = visitChildWithClassEqualityCheck(this, + getBlockChild(), nv); + return reconstruct(recvar, block); + } + + @Override + public String toString() + { + return Constants.REC_KW + " " + getRecVarChild() + " " + getBlockChild(); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/RoleArg.java b/scribble-ast/src/main/java/org/scribble/ast/RoleArg.java new file mode 100644 index 000000000..72445d5a0 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/RoleArg.java @@ -0,0 +1,52 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import org.antlr.runtime.Token; +import org.scribble.ast.name.simple.RoleNode; +import org.scribble.del.DelFactory; + +// CHECKME: can this be simplified to an interface? (also NonRoleArg) +public class RoleArg extends DoArg +{ + // ScribTreeAdaptor#create constructor + public RoleArg(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public RoleArg(RoleArg node) + { + super(node); + } + + @Override + public RoleNode getArgNodeChild() + { + return (RoleNode) getChild(0); + } + + @Override + public RoleArg dupNode() + { + return new RoleArg(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.RoleArg(this); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/RoleArgList.java b/scribble-ast/src/main/java/org/scribble/ast/RoleArgList.java new file mode 100644 index 000000000..9c0587e78 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/RoleArgList.java @@ -0,0 +1,68 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import java.util.List; +import java.util.stream.Collectors; + +import org.antlr.runtime.Token; +import org.scribble.core.type.name.Role; +import org.scribble.del.DelFactory; + +public class RoleArgList extends DoArgList +{ + // ScribTreeAdaptor#create constructor + public RoleArgList(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public RoleArgList(RoleArgList node) + { + super(node); + } + + @Override + public List getArgChildren() + { + return getRawArgChildren().stream().map(x -> (RoleArg) x) + .collect(Collectors.toList()); + } + + // The role arguments + public List getRoles() + { + return getArgChildren().stream().map(ri -> ri.getArgNodeChild().toName()) + .collect(Collectors.toList()); + } + + @Override + public RoleArgList dupNode() + { + return new RoleArgList(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.RoleArgList(this); + } + + @Override + public String toString() + { + return "(" + super.toString() + ")"; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/RoleDecl.java b/scribble-ast/src/main/java/org/scribble/ast/RoleDecl.java new file mode 100644 index 000000000..5ac6380b7 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/RoleDecl.java @@ -0,0 +1,66 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import org.antlr.runtime.Token; +import org.scribble.ast.name.simple.RoleNode; +import org.scribble.core.type.kind.RoleKind; +import org.scribble.core.type.name.Role; +import org.scribble.del.DelFactory; +import org.scribble.util.Constants; + +public class RoleDecl extends ParamDecl +{ + // ScribTreeAdaptor#create constructor + public RoleDecl(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public RoleDecl(RoleDecl node) + { + super(node); + } + + @Override + public RoleNode getNameNodeChild() + { + return (RoleNode) getRawNameNodeChild(); + } + + @Override + public RoleDecl dupNode() + { + return new RoleDecl(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.RoleDecl(this); + } + + @Override + public Role getDeclName() + { + return getNameNodeChild().toName(); + } + + @Override + public String getKeyword() + { + return Constants.ROLE_KW; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/RoleDeclList.java b/scribble-ast/src/main/java/org/scribble/ast/RoleDeclList.java new file mode 100644 index 000000000..d95750e47 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/RoleDeclList.java @@ -0,0 +1,68 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import java.util.List; +import java.util.stream.Collectors; + +import org.antlr.runtime.Token; +import org.scribble.core.type.kind.RoleKind; +import org.scribble.core.type.name.Role; +import org.scribble.del.DelFactory; + +public class RoleDeclList extends ParamDeclList +{ + // ScribTreeAdaptor#create constructor + public RoleDeclList(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public RoleDeclList(RoleDeclList node) + { + super(node); + } + + @Override + public List getDeclChildren() + { + return ((List) getChildren()).stream().map(x -> (RoleDecl) x) + .collect(Collectors.toList()); + } + + public List getRoles() + { + return getDeclChildren().stream().map(decl -> decl.getDeclName()) + .collect(Collectors.toList()); + } + + @Override + public RoleDeclList dupNode() + { + return new RoleDeclList(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.RoleDeclList(this); + } + + @Override + public String toString() + { + return "(" + super.toString() + ")"; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/ScribNil.java b/scribble-ast/src/main/java/org/scribble/ast/ScribNil.java new file mode 100644 index 000000000..b3a10b3be --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/ScribNil.java @@ -0,0 +1,45 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import org.antlr.runtime.Token; +import org.antlr.runtime.tree.CommonTree; +import org.scribble.del.DelFactory; + +public class ScribNil extends ScribNodeBase +{ + // Used by (Scrib)TreeAdapator + public ScribNil() + { + super((Token) null); // CHECKME: null Token + } + + // Copy constructor + protected ScribNil(CommonTree node) + { + super((ScribNodeBase) node); + } + + @Override + public ScribNodeBase dupNode() + { + return new ScribNil(this); // CHECKME: nil can have children(?), so may need to actually copy + } + + @Override + public void decorateDel(DelFactory df) + { + throw new RuntimeException("Shouldn't get in here: "); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/ScribNode.java b/scribble-ast/src/main/java/org/scribble/ast/ScribNode.java new file mode 100644 index 000000000..32115ef0b --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/ScribNode.java @@ -0,0 +1,60 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import java.util.List; + +import org.antlr.runtime.tree.CommonTree; +import org.antlr.runtime.tree.Tree; +import org.scribble.del.ScribDel; +import org.scribble.util.ScribException; +import org.scribble.visit.AstVisitor; +import org.scribble.visit.SimpleAstVisitor; +import org.scribble.visit.SimpleAstVisitorNoThrows; + +/** + * This is the generic object from which all Scribble AST objects + * are derived. + */ +public interface ScribNode extends Tree +{ + CommonTree getSource(); + // Can explicitly track an "original" source, cf. always using the "current" node as its own source + // Can be better for some error messages, e.g., during/after some AST transfomations + + @Override + ScribNode getParent(); + + //@Override -- no: super return not generic + List getChildren(); + + ScribNode clone(); + + ScribDel del(); + //ScribNode del(ScribDel del); + + ScribNode accept(AstVisitor nv) throws ScribException; // The "top-level" method, e.g., module.accept(v) (cf. Job::runVisitorOnModule) + ScribNode visitChildren(AstVisitor nv) throws ScribException; + + // For "simpler" visiting patterns than above + default T visitWith(SimpleAstVisitor v) throws ScribException // "Top-level" visitor entry method + { + return v.visit(this); // N.B. ScribNode has getParent + } + + default T visitWith(SimpleAstVisitorNoThrows v) // "Top-level" visitor entry method, c.f. STypeAggNoThrow + { + return v.visit(this); // N.B. ScribNode has getParent + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/ScribNodeBase.java b/scribble-ast/src/main/java/org/scribble/ast/ScribNodeBase.java new file mode 100644 index 000000000..5cc7202fa --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/ScribNodeBase.java @@ -0,0 +1,272 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import java.util.Collections; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; + +import org.antlr.runtime.Token; +import org.antlr.runtime.tree.CommonTree; +import org.scribble.core.type.kind.Global; +import org.scribble.core.type.kind.Local; +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.del.DelFactory; +import org.scribble.del.ScribDel; +import org.scribble.util.RuntimeScribException; +import org.scribble.util.ScribException; +import org.scribble.util.ScribNodeUtil; +import org.scribble.util.ScribUtil; +import org.scribble.visit.AstVisitor; + +/** + * This is the generic object from which all Scribble model objects + * are derived. + * + * ScribNodeBase is to ScribNode, as ANTLR CommonTree is to Tree. + */ +public abstract class ScribNodeBase extends CommonTree implements ScribNode +{ + private final CommonTree source; // Track "original" source where applicable + + protected ScribDel del; + + // Used by (Scrib)TreeAdapator + public ScribNodeBase(Token payload) + { + super(payload); + this.source = this; // Record parser construction as source + } + + // Copy constructor + protected ScribNodeBase(ScribNodeBase node) + { + super(node); + this.source = node.getSource(); // Keep ref to original as source (cf., this) + // A (partially) reconstructed/generated node may still have no parent (i.e., null) at the moment an error is raised during visit pass + // Can always use AntlrSourceException to blame the "child" (the original node) during visit rather than "visited", E.g., bad.syntax.disamb.doarglist.DoArgList06 + } + + @Override + public final CommonTree getSource() + { + return this.source; + } + + @Override + public ScribNode getParent() + { + return (ScribNode) super.getParent(); + } + + @Override + public ScribNode getChild(int i) + { + return (ScribNode) super.getChild(i); + } + + // N.B. "overriding" base ANTLR behaviour of (sometimes?) returning null when + // getChildCount() == 0 by returning an empty list instead + @Override + public List getChildren() + { + if (getChildCount() == 0) + { + return Collections.emptyList(); + } + return ((List) super.getChildren()).stream().map(x -> (ScribNode) x) + .collect(Collectors.toList()); + } + + // CHECKME: redundant? given this.addChildren + // Non-defenseive + // CHECKME: "generic" visitChildren and reconstruct via get/setChildren? -- maybe too implicit, cannot easily see child visiting order + protected void setChildren(List children) + { + children.forEach(x -> + { + //x.setParent(this); // Not needed, cf. BaseTree#addChild(Tree) + addChild(x); + }); + } + + // CHECKME: rework as ANTLR node (deep) copy (maybe "clone") -- no: ANTLR dupNode is node only copy (actually, dupNode is node "shell" only, doesn't even keep children, let alone copy them) + // N.B. does not copy children nor del + // Should call Tree#dupNode constructor (i.e., children not dup'd) -- do not "return this" (unless childress), ends up with children duplicated (because node "dup'd" with children, then children added again) + @Override + public abstract ScribNodeBase dupNode(); + + // Internal shallow copy for (immutable) ModelNodes -- does not keep the del (copy is used internally for del setter, and keeping the del needs knowledge of super fields) + // Generally copy is only for shallow copy of object and "immediate" fields (not super fields), cf. ProtocolDecl, ProtocolDeclContext, etc + @Deprecated + protected final ScribNodeBase copy() // Deprecated: because ANTLR Tree is not immutable (has a "parent" field) + { + throw new RuntimeException("Deprecated"); + } + + // Deep (tree) clone, i.e., children also cloned + // Makes a new del via AF (i.e. fresh, not a copy of old del) -- cf. reconstruct, keeps old del (the same instance) + // No: now just keep old del -- by default, del's are immutable + /*@Override + public abstract ScribNodeBase clone(AstFactory af);*/ + + public ScribNodeBase clone() + { + ScribNodeBase dup = (ScribNodeBase) dupNode(); + getChildren().forEach(x -> dup.addChild(x.clone())); + dup.del = this.del; + return dup; + } + + @Override + public final ScribDel del() + { + return this.del; + } + + // Decorate with a fresh del (cf. reconstruct: dupNode, setDel) + public abstract void decorateDel(DelFactory df); + + // Defensive + /*@Override + public final ScribNodeBase del(ScribDel del) + { + ScribNodeBase clone = clone(); // Need full clone because parent field prevents immutable construction + clone.setDel(del); + return clone; + }*/ + + // Non-defensive + protected final void setDel(ScribDel del) + { + this.del = del; + } + + // Defensive helper with cast check -- currently unused + public static final T del(T n, ScribDel del) + { + ScribNodeBase copy = ((ScribNodeBase) n).clone(); // Need deep clone, since children have parent field + copy.setDel(del); + return ScribNodeUtil.castNodeByClass(n, copy); + } + + @Override + public ScribNode accept(AstVisitor v) throws ScribException + { + return v.visit(this); + } + + @Override + public ScribNode visitChildren(AstVisitor v) throws ScribException + { + return this; + } + + // Used to be more relevant, previously there was an explicit parent parameter + protected ScribNode visitChild(ScribNode child, AstVisitor v) throws ScribException + { + return v.visit(child); // cf. child.accept(v) ? + } + + // FIXME: remove parent parameter, to make uniform with visitChild + // Used when a generic cast would otherwise be needed (non-generic children casts don't need this) -- doesn't check any generic parameters, relies on concrete values being instances of non-parameterised types + // Subtype constraint on visited could still be too restrictive, e.g. AmbigNameNodeDel (although it doesn't matter there), e.g. unfolding continue's into recursion's + protected final static T visitChildWithClassEqualityCheck( + ScribNode parent, T child, AstVisitor v) throws ScribException + { + ScribNode visited = ((ScribNodeBase) parent).visitChild(child, v); + // Same subtyping flexibility as standard cast + return ScribNodeUtil.checkNodeClassEquality(child, visited); + } + + protected final static List + visitChildListWithClassEqualityCheck( + ScribNode parent, List children, AstVisitor v) + throws ScribException + { + return visitChildListWith(parent, children, v, + (T t) -> ScribUtil.handleLambdaScribbleException( + () -> ScribNodeBase + .visitChildWithClassEqualityCheck(parent, t, v))); // -> T + } + + // Just a list-map with handling for promoted exceptions (via handleLambdaScribbleException) -- could move to Util (where handleLambdaScribbleException is) + private final static List visitChildListWith( + ScribNode parent, List children, AstVisitor nv, Function c) + throws ScribException + { + /*List visited = new LinkedList<>(); + for (T n : children) + { + visited.add(c.call()); + } + return visited;*/ + // Maybe the below exception hack is not worth it? Simpler to throw directly as ScribbleException, as above + try + { + return children.stream().map(x -> c.apply(x)) + .collect(Collectors.toList()); + } + catch (RuntimeScribException rse) + { + Throwable cause = rse.getCause(); + if (cause instanceof ScribException) + { + throw (ScribException) cause; + } + throw (RuntimeException) cause; + } + } + + + // Following would fit better in ProtocolKindNode, except it is an interface + + // Takes clazz+kind to handle generic ProtocolKindNodes -- cf. ScribUtil.castNodeByClass, for casting to ground class types + // R is expected to be N, i.e. the generic (ProtocolKindNode) class N parameterised by K + protected final static , K extends ProtoKind, + R extends ProtoKindNode> + R visitProtocolKindChildWithCastCheck( + ScribNode parent, ScribNode child, AstVisitor nv, Class clazz, K kind, + Function cast) throws ScribException + { + ScribNode visited = ((ScribNodeBase) parent).visitChild(child, nv); + if (!clazz.isAssignableFrom(visited.getClass())) + { + throw new RuntimeException(nv.getClass() + " generic visit error: " + + clazz + ", " + visited.getClass()); + } + ProtoKindNode pkn = (ProtoKindNode) visited; + if ((pkn.isGlobal() && !kind.equals(Global.KIND)) + || (pkn.isLocal() && !kind.equals(Local.KIND))) + { + throw new RuntimeException(nv.getClass() + " generic visit error: " + + pkn.getClass() + ", " + kind); + } + return cast.apply(pkn); + } + + protected final static , + K extends ProtoKind, R extends ProtoKindNode> + List visitProtocolKindChildListWithCastCheck( + ScribNode parent, List children, AstVisitor nv, Class c, K k, + Function f) throws ScribException + { + return visitChildListWith(parent, children, nv, + (T t) -> ScribUtil.handleLambdaScribbleException( + () -> ScribNodeBase + .visitProtocolKindChildWithCastCheck(parent, t, nv, c, k, f))); + // -> R + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/SessionNode.java b/scribble-ast/src/main/java/org/scribble/ast/SessionNode.java new file mode 100644 index 000000000..38c2ab63e --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/SessionNode.java @@ -0,0 +1,23 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import org.scribble.core.type.kind.ProtoKind; + +// A SessionNode is an AST node that corresponds to a session type constructor -- elements of InteractionSeq nodes +// The SessionNodeDel hierarchy corresponds to this SessionNode hierarchy +public interface SessionNode extends ProtoKindNode +{ + +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/SigDecl.java b/scribble-ast/src/main/java/org/scribble/ast/SigDecl.java new file mode 100644 index 000000000..692a3cbb6 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/SigDecl.java @@ -0,0 +1,85 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import org.antlr.runtime.Token; +import org.scribble.ast.name.qualified.SigNameNode; +import org.scribble.core.type.kind.SigKind; +import org.scribble.core.type.name.ModuleName; +import org.scribble.core.type.name.SigName; +import org.scribble.del.DelFactory; +import org.scribble.util.Constants; + +public class SigDecl extends NonProtoDecl +{ + // ScribTreeAdaptor#create constructor + public SigDecl(Token payload) + { + super(payload); + } + + // Tree#dupNode constructor + protected SigDecl(SigDecl node) + { + super(node); + } + + @Override + public SigNameNode getNameNodeChild() + { + return (SigNameNode) getRawNameNodeChild(); + } + + // Cf. CommonTree#dupNode + @Override + public SigDecl dupNode() + { + return new SigDecl(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.SigDecl(this); + } + + @Override + public boolean isSigDecl() + { + return true; + } + + @Override + public SigName getDeclName() + { + return getNameNodeChild().toName(); + } + + @Override + public SigName getFullMemberName(Module mod) + { + ModuleName fullmodname = mod.getFullModuleName(); + return new SigName(fullmodname, getDeclName()); + } + + @Override + public String toString() + { + return Constants.SIG_KW + " <" + getSchemaChild() + "> " + + getExtNameChild() + " " + + Constants.FROM_KW + " " + getExtSourceChild() + " " + + Constants.AS_KW + " " + getDeclName() + + ";"; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/SigLitNode.java b/scribble-ast/src/main/java/org/scribble/ast/SigLitNode.java new file mode 100644 index 000000000..b7d31ee32 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/SigLitNode.java @@ -0,0 +1,111 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import org.antlr.runtime.Token; +import org.scribble.ast.name.simple.OpNode; +import org.scribble.core.type.session.SigLit; +import org.scribble.del.DelFactory; +import org.scribble.util.ScribException; +import org.scribble.visit.AstVisitor; + +public class SigLitNode extends ScribNodeBase implements MsgNode +{ + public static final int OP_CHILD_INDEX = 0; + public static final int PAYLOAD_CHILD_INDEX = 1; + + // ScribTreeAdaptor#create constructor + public SigLitNode(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public SigLitNode(SigLitNode node) + { + super(node); + } + + public OpNode getOpChild() + { + return (OpNode) getChild(OP_CHILD_INDEX); + } + + public PayElemList getPayloadListChild() + { + return (PayElemList) getChild(PAYLOAD_CHILD_INDEX); + } + + // "add", not "set" + public void addScribChildren(OpNode op, PayElemList pay) + { + addChild(op); + addChild(pay); + } + + @Override + public SigLitNode dupNode() + { + return new SigLitNode(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.SigLitNode(this); + } + + public SigLitNode reconstruct(OpNode op, PayElemList pay) + { + SigLitNode dup = dupNode(); + dup.addScribChildren(op, pay); + dup.setDel(del()); // No copy + return dup; + } + + @Override + public SigLitNode visitChildren(AstVisitor nv) throws ScribException + { + OpNode op = (OpNode) visitChild(getOpChild(), nv); + PayElemList pay = (PayElemList) + visitChild(getPayloadListChild(), nv); + return reconstruct(op, pay); + } + + @Override + public boolean isSigLitNode() + { + return true; + } + + // Make a direct scoped version? (taking scope as argument) + @Override + public SigLit toArg() + { + return new SigLit(getOpChild().toName(), + getPayloadListChild().toPayload()); + } + + @Override + public SigLit toMsg() + { + return toArg(); + } + + @Override + public String toString() + { + return getOpChild().toString() + getPayloadListChild().toString(); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/SigParamDecl.java b/scribble-ast/src/main/java/org/scribble/ast/SigParamDecl.java new file mode 100644 index 000000000..d5c868699 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/SigParamDecl.java @@ -0,0 +1,67 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import org.antlr.runtime.Token; +import org.scribble.ast.name.simple.SigParamNode; +import org.scribble.core.type.kind.SigKind; +import org.scribble.core.type.name.SigName; +import org.scribble.del.DelFactory; +import org.scribble.util.Constants; + +public class SigParamDecl extends NonRoleParamDecl +{ + // ScribTreeAdaptor#create constructor + public SigParamDecl(Token t) + { + super(t, SigKind.KIND); + } + + // Tree#dupNode constructor + public SigParamDecl(SigParamDecl node) + { + super(node); + } + + @Override + public SigParamNode getNameNodeChild() + { + return (SigParamNode) getRawNameNodeChild(); // CHECKME: make Type/Sig(Param)Node? + } + + @Override + public SigParamDecl dupNode() + { + return new SigParamDecl(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.SigParamDecl(this); + } + + @Override + //public MemberName getDeclName() + public SigName getDeclName() + { + return (SigName) getNameNodeChild().toName(); + } + + @Override + public String getKeyword() + { + return Constants.SIG_KW; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/SimpleSessionNode.java b/scribble-ast/src/main/java/org/scribble/ast/SimpleSessionNode.java new file mode 100644 index 000000000..e64bc5692 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/SimpleSessionNode.java @@ -0,0 +1,34 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import org.antlr.runtime.Token; +import org.scribble.core.type.kind.ProtoKind; + +// Name should be read (Simple ( SessionNode )) +public abstract class SimpleSessionNode + extends ScribNodeBase implements SessionNode +{ + // ScribTreeAdaptor#create constructor + public SimpleSessionNode(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public SimpleSessionNode(SimpleSessionNode node) + { + super(node); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/UnaryPayElem.java b/scribble-ast/src/main/java/org/scribble/ast/UnaryPayElem.java new file mode 100644 index 000000000..8066acbfc --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/UnaryPayElem.java @@ -0,0 +1,110 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import org.antlr.runtime.Token; +import org.scribble.ast.name.PayElemNameNode; +import org.scribble.core.type.kind.PayElemKind; +import org.scribble.core.type.name.PayElemType; +import org.scribble.del.DelFactory; +import org.scribble.util.ScribException; +import org.scribble.visit.AstVisitor; + + +// TODO: make abstract, and make a DataTypeElem subclass with DataTypeKind parameter instance (alongside LDelegationElem) + +// FIXME: refactor: generic typing issues, no concrete name field any more +// Cf. DoArg, wrapper for a (unary) name node of potentially unknown kind (needs disamb) +// PayloadTypeKind is DataType or Local, but Local has its own special subclass (and protocol params not allowed), so this should implicitly be for DataType only +// AST hierarchy requires unary and delegation (binary pair) payloads to be structurally distinguished +//public class DataTypeElem extends PayloadElem +public class UnaryPayElem extends ScribNodeBase + implements PayElem// extends PayloadElem +{ + // cf. Scribble.g + public static final int NAME_CHILD_INDEX = 0; + + // ScribTreeAdaptor#create constructor + public UnaryPayElem(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public UnaryPayElem(UnaryPayElem node) + { + super(node); + } + + public PayElemNameNode getNameChild() + { + // FIXME + PayElemNameNode name = (PayElemNameNode) getChild(NAME_CHILD_INDEX); + // CHECKME: probably need to record an explicit kind token, for "cast checking" + // Cannot use ScribNodeBase.visitChildWithCastCheck because this is not a ProtocolKindNode + return name; + } + + // "add", not "set" + public void addScribChildren(PayElemNameNode name) + { + // Cf. above getters and Scribble.g children order + addChild(name); + } + + @Override + public UnaryPayElem dupNode() + { + return new UnaryPayElem<>(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.UnaryPayElem(this); + } + + public UnaryPayElem reconstruct(PayElemNameNode name) + { + UnaryPayElem dup = dupNode(); + dup.addScribChildren(name); + dup.setDel(del()); // No copy + return dup; + } + + @Override + public UnaryPayElem visitChildren(AstVisitor nv) + throws ScribException + { + @SuppressWarnings("unchecked") + PayElemNameNode name = (PayElemNameNode) visitChild( + getNameChild(), nv); + // CHECKME: probably need to record an explicit kind token, for "cast checking" + // Cannot use ScribNodeBase.visitChildWithCastCheck because this is not a ProtocolKindNode + return reconstruct(name); + } + + @Override + public PayElemType toPayloadType() + { + return getNameChild().toPayloadType(); + } + + @Override + public String toString() + { + return getNameChild().toString(); + } +} + diff --git a/scribble-ast/src/main/java/org/scribble/ast/WrapAction.java b/scribble-ast/src/main/java/org/scribble/ast/WrapAction.java new file mode 100644 index 000000000..60b2b4eef --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/WrapAction.java @@ -0,0 +1,73 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import java.util.List; + +import org.antlr.runtime.Token; +import org.scribble.ast.name.simple.RoleNode; +import org.scribble.core.type.kind.ProtoKind; + +public abstract class WrapAction + extends DirectedInteraction +{ + // ScribTreeAdaptor#create constructor + public WrapAction(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public WrapAction(WrapAction node) + { + super(node); + } + + public RoleNode getClientChild() + { + return (RoleNode) getSourceChild(); + } + + public RoleNode getServerChild() + { + return getDestinationChild(); + } + + // Cf. ConnectAction + public RoleNode getDestinationChild() + { + List dests = getDestinationChildren(); + if (dests.size() != 1) + { + throw new RuntimeException("Shouldn't get in here: " + this); + // CHECKME: don't use common src/dst pattern between global/local? + } + return dests.get(0); + } + + @Override + public void addScribChildren(MsgNode msg, RoleNode src, List dsts) + { + throw new RuntimeException("Unsupported for LWrapAction: " + msg); + } + + // "add", not "set" + // "Overrides" DirectedInteraction::addScribChildren + public void addScribChildren(RoleNode client, RoleNode server) + { + // Cf. above getters and Scribble.g children order + addChild(client); + addChild(server); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/global/GChoice.java b/scribble-ast/src/main/java/org/scribble/ast/global/GChoice.java new file mode 100644 index 000000000..c0fe600cc --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/global/GChoice.java @@ -0,0 +1,58 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.global; + +import java.util.List; +import java.util.stream.Collectors; + +import org.antlr.runtime.Token; +import org.scribble.ast.Choice; +import org.scribble.ast.ScribNode; +import org.scribble.core.type.kind.Global; +import org.scribble.del.DelFactory; + +public class GChoice extends Choice implements GCompoundSessionNode +{ + // ScribTreeAdaptor#create constructor + public GChoice(Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected GChoice(GChoice node) + { + super(node); + } + + @Override + public List getBlockChildren() + { + List cs = getChildren(); + return cs.subList(Choice.BLOCK_CHILDREN_START_INDEX, cs.size()).stream() + .map(x -> (GProtoBlock) x).collect(Collectors.toList()); + } + + @Override + public GChoice dupNode() + { + return new GChoice(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.GChoice(this); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/global/GCompoundSessionNode.java b/scribble-ast/src/main/java/org/scribble/ast/global/GCompoundSessionNode.java new file mode 100644 index 000000000..07306a52c --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/global/GCompoundSessionNode.java @@ -0,0 +1,19 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.global; + +public interface GCompoundSessionNode extends GSessionNode +{ + +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/global/GConnect.java b/scribble-ast/src/main/java/org/scribble/ast/global/GConnect.java new file mode 100644 index 000000000..b43e652bb --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/global/GConnect.java @@ -0,0 +1,57 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.global; + +import org.antlr.runtime.Token; +import org.scribble.ast.ConnectAction; +import org.scribble.core.type.kind.Global; +import org.scribble.del.DelFactory; +import org.scribble.util.Constants; + +// TODO: make GConnectionAction and factor this class with GWrap (cf. LConnectionAction) +public class GConnect extends ConnectAction + implements GSimpleSessionNode +{ + // ScribTreeAdaptor#create constructor + public GConnect(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public GConnect(GConnect node) + { + super(node); + } + + @Override + public GConnect dupNode() + { + return new GConnect(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.GConnect(this); + } + + @Override + public String toString() + { + return (isUnitMessage() ? "" : getMessageNodeChild() + " ") + + Constants.CONNECT_KW + " " + getSourceChild() + " " + Constants.TO_KW + + " " + getDestinationChild() + ";"; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/global/GContinue.java b/scribble-ast/src/main/java/org/scribble/ast/global/GContinue.java new file mode 100644 index 000000000..6957bde1b --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/global/GContinue.java @@ -0,0 +1,46 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.global; + +import org.antlr.runtime.Token; +import org.scribble.ast.Continue; +import org.scribble.core.type.kind.Global; +import org.scribble.del.DelFactory; + +public class GContinue extends Continue implements GSimpleSessionNode +{ + // ScribTreeAdaptor#create constructor + public GContinue(Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected GContinue(GContinue node) + { + super(node); + } + + @Override + public GContinue dupNode() + { + return new GContinue(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.GContinue(this); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/global/GDelegPayElem.java b/scribble-ast/src/main/java/org/scribble/ast/global/GDelegPayElem.java new file mode 100644 index 000000000..4ad4614aa --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/global/GDelegPayElem.java @@ -0,0 +1,114 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.global; + +import org.antlr.runtime.Token; +import org.scribble.ast.PayElem; +import org.scribble.ast.ScribNodeBase; +import org.scribble.ast.name.qualified.GProtoNameNode; +import org.scribble.ast.name.simple.RoleNode; +import org.scribble.core.type.kind.Local; +import org.scribble.core.type.name.GDelegType; +import org.scribble.core.type.name.PayElemType; +import org.scribble.del.DelFactory; +import org.scribble.util.ScribException; +import org.scribble.visit.AstVisitor; + +// A "name pair" payload elem (current AST hierarchy induces this pattern), cf. UnaryPayloadElem (also differs in no parsing ambig against parameters) +// The this.name will be global kind, but overall this node is local kind +//public class DelegationElem extends PayloadElem +public class GDelegPayElem extends ScribNodeBase implements PayElem +{ + public static final int PROTO_CHILD_INDEX = 0; + public static final int ROLE_CHILD_INDEX = 1; + + // ScribTreeAdaptor#create constructor + public GDelegPayElem(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public GDelegPayElem(GDelegPayElem node) + { + super(node); + } + + // Becomes full name after disambiguation + public GProtoNameNode getProtocolChild() + { + return (GProtoNameNode) getChild(PROTO_CHILD_INDEX); + } + + public RoleNode getRoleChild() + { + return (RoleNode) getChild(ROLE_CHILD_INDEX); + } + + // "add", not "set" + public void addScribChildren(GProtoNameNode proto, RoleNode role) + { + // Cf. above getters and Scribble.g children order + addChild(proto); + addChild(role); + } + + @Override + public GDelegPayElem dupNode() + { + return new GDelegPayElem(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.GDelegPayElem(this); + } + + public GDelegPayElem reconstruct(GProtoNameNode proto, RoleNode role) + { + GDelegPayElem dup = dupNode(); + dup.addScribChildren(proto, role); + dup.setDel(del()); // No copy + return dup; + } + + @Override + public GDelegPayElem visitChildren(AstVisitor nv) throws ScribException + { + GProtoNameNode name = (GProtoNameNode) + visitChild(getProtocolChild(), nv); + RoleNode role = (RoleNode) visitChild(getRoleChild(), nv); + return reconstruct(name, role); + } + + @Override + public boolean isGlobalDelegationElem() + { + return true; + } + + @Override + public PayElemType toPayloadType() + { + return new GDelegType(getProtocolChild().toName(), + getRoleChild().toName()); + } + + @Override + public String toString() + { + return getProtocolChild() + "@" + getRoleChild(); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/global/GDisconnect.java b/scribble-ast/src/main/java/org/scribble/ast/global/GDisconnect.java new file mode 100644 index 000000000..a324f4aac --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/global/GDisconnect.java @@ -0,0 +1,47 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.global; + +import org.antlr.runtime.Token; +import org.scribble.ast.DisconnectAction; +import org.scribble.core.type.kind.Global; +import org.scribble.del.DelFactory; + +public class GDisconnect extends DisconnectAction + implements GSimpleSessionNode +{ + // ScribTreeAdaptor#create constructor + public GDisconnect(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public GDisconnect(GDisconnect node) + { + super(node); + } + + @Override + public void decorateDel(DelFactory df) + { + df.GDisconnect(this); + } + + @Override + public GDisconnect dupNode() + { + return new GDisconnect(this); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/global/GDo.java b/scribble-ast/src/main/java/org/scribble/ast/global/GDo.java new file mode 100644 index 000000000..c00216659 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/global/GDo.java @@ -0,0 +1,71 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.global; + +import org.antlr.runtime.Token; +import org.scribble.ast.Do; +import org.scribble.ast.name.qualified.GProtoNameNode; +import org.scribble.core.lang.context.ModuleContext; +import org.scribble.core.type.kind.Global; +import org.scribble.core.type.name.GProtoName; +import org.scribble.del.DelFactory; +import org.scribble.job.JobContext; + +public class GDo extends Do implements GSimpleSessionNode +{ + // ScribTreeAdaptor#create constructor + public GDo(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public GDo(GDo node) + { + super(node); + } + + @Override + public GProtoNameNode getProtocolNameNode() + { + return (GProtoNameNode) getChild(Do.NAME_CHILD_INDEX); + } + + @Override + public GProtoDecl getTargetProtocolDecl(JobContext jobc, + ModuleContext modc) + { + GProtoName fullname = getTargetProtoDeclFullName(modc); + return jobc.getModule(fullname.getPrefix()) + .getGProtocolDeclChild(fullname.getSimpleName()); + } + + @Override + public GDo dupNode() + { + return new GDo(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.GDo(this); + } + + @Override + public GProtoName getTargetProtoDeclFullName(ModuleContext modc) + { + return (GProtoName) super.getTargetProtoDeclFullName(modc); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/global/GInteractionSeq.java b/scribble-ast/src/main/java/org/scribble/ast/global/GInteractionSeq.java new file mode 100644 index 000000000..88435a816 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/global/GInteractionSeq.java @@ -0,0 +1,57 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.global; + +import java.util.List; +import java.util.stream.Collectors; + +import org.antlr.runtime.Token; +import org.scribble.ast.InteractionSeq; +import org.scribble.core.type.kind.Global; +import org.scribble.del.DelFactory; + +public class GInteractionSeq extends InteractionSeq + implements GScribNode +{ + // ScribTreeAdaptor#create constructor + public GInteractionSeq(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public GInteractionSeq(GInteractionSeq node) + { + super(node); + } + + @Override + public List getInteractionChildren() + { + return getChildren().stream().map(n -> (GSessionNode) n) + .collect(Collectors.toList()); + } + + @Override + public GInteractionSeq dupNode() + { + return new GInteractionSeq(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.GInteractionSeq(this); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/global/GMsgTransfer.java b/scribble-ast/src/main/java/org/scribble/ast/global/GMsgTransfer.java new file mode 100644 index 000000000..dfc90632c --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/global/GMsgTransfer.java @@ -0,0 +1,61 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.global; + +import java.util.stream.Collectors; + +import org.antlr.runtime.Token; +import org.scribble.ast.MsgTransfer; +import org.scribble.core.type.kind.Global; +import org.scribble.del.DelFactory; +import org.scribble.util.Constants; + +public class GMsgTransfer extends MsgTransfer + implements GSimpleSessionNode +{ + // ScribTreeAdaptor#create constructor + public GMsgTransfer(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public GMsgTransfer(GMsgTransfer node) + { + super(node); + } + + @Override + public GMsgTransfer dupNode() + { + return new GMsgTransfer(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.GMsgTransfer(this); + } + + @Override + public String toString() + { + return getMessageNodeChild() + " " + Constants.FROM_KW + + " " + getSourceChild() + " " + Constants.TO_KW + + " " + + getDestinationChildren().stream().map(x -> x.toString()) + .collect(Collectors.joining(", ")) + + ";"; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/global/GProtoBlock.java b/scribble-ast/src/main/java/org/scribble/ast/global/GProtoBlock.java new file mode 100644 index 000000000..0ff579d50 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/global/GProtoBlock.java @@ -0,0 +1,52 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.global; + +import org.antlr.runtime.Token; +import org.scribble.ast.ProtoBlock; +import org.scribble.core.type.kind.Global; +import org.scribble.del.DelFactory; + +public class GProtoBlock extends ProtoBlock implements GScribNode +{ + // ScribTreeAdaptor#create constructor + public GProtoBlock(Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected GProtoBlock(GProtoBlock node) + { + super(node); + } + + @Override + public GInteractionSeq getInteractSeqChild() + { + return (GInteractionSeq) getChild(ProtoBlock.SEQ_CHILD_INDEX); + } + + @Override + public GProtoBlock dupNode() + { + return new GProtoBlock(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.GProtoBlock(this); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/global/GProtoDecl.java b/scribble-ast/src/main/java/org/scribble/ast/global/GProtoDecl.java new file mode 100644 index 000000000..aac0be95c --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/global/GProtoDecl.java @@ -0,0 +1,69 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.global; + +import org.antlr.runtime.Token; +import org.scribble.ast.Module; +import org.scribble.ast.ProtoDecl; +import org.scribble.core.type.kind.Global; +import org.scribble.core.type.name.GProtoName; +import org.scribble.del.DelFactory; + +public class GProtoDecl extends ProtoDecl implements GScribNode +{ + // ScribTreeAdaptor#create constructor + public GProtoDecl(Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected GProtoDecl(GProtoDecl node) + { + super(node); + } + + @Override + public GProtoHeader getHeaderChild() + { + return (GProtoHeader) getChild(ProtoDecl.HEADER_CHILD); + } + + @Override + public GProtoDef getDefChild() + { + return (GProtoDef) getChild(ProtoDecl.DEF_CHILD); + } + + // Cf. CommonTree#dupNode + @Override + public GProtoDecl dupNode() + { + return new GProtoDecl(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.GProtoDecl(this); + } + + @Override + public GProtoName getFullMemberName(Module mod) // TODO: remove mod from meth sig + { + Module m = (Module) getParent(); + return new GProtoName(m.getFullModuleName(), + getHeaderChild().getDeclName()); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/global/GProtoDef.java b/scribble-ast/src/main/java/org/scribble/ast/global/GProtoDef.java new file mode 100644 index 000000000..6f656425f --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/global/GProtoDef.java @@ -0,0 +1,52 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.global; + +import org.antlr.runtime.Token; +import org.scribble.ast.ProtoDef; +import org.scribble.core.type.kind.Global; +import org.scribble.del.DelFactory; + +public class GProtoDef extends ProtoDef implements GScribNode +{ + // ScribTreeAdaptor#create constructor + public GProtoDef(Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected GProtoDef(GProtoDef node) + { + super(node); + } + + @Override + public GProtoBlock getBlockChild() + { + return (GProtoBlock) getChild(ProtoDef.BLOCK_CHILD_INDEX); + } + + @Override + public GProtoDef dupNode() + { + return new GProtoDef(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.GProtoDef(this); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/global/GProtoHeader.java b/scribble-ast/src/main/java/org/scribble/ast/global/GProtoHeader.java new file mode 100644 index 000000000..affbe1ff5 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/global/GProtoHeader.java @@ -0,0 +1,67 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.global; + +import org.antlr.runtime.Token; +import org.scribble.ast.ProtoHeader; +import org.scribble.ast.name.qualified.GProtoNameNode; +import org.scribble.core.type.kind.Global; +import org.scribble.core.type.name.GProtoName; +import org.scribble.del.DelFactory; +import org.scribble.util.Constants; + +public class GProtoHeader extends ProtoHeader implements GScribNode +{ + // ScribTreeAdaptor#create constructor + public GProtoHeader(Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected GProtoHeader(GProtoHeader node) + { + super(node); + } + + @Override + public GProtoHeader dupNode() + { + return new GProtoHeader(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.GProtoHeader(this); + } + + @Override + public GProtoNameNode getNameNodeChild() + { + return (GProtoNameNode) getRawNameNodeChild(); + } + + @Override + public GProtoName getDeclName() + { + return (GProtoName) super.getDeclName(); + } + + @Override + public String toString() + { + return Constants.GLOBAL_KW + " " + super.toString(); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/global/GRecursion.java b/scribble-ast/src/main/java/org/scribble/ast/global/GRecursion.java new file mode 100644 index 000000000..3f1f76159 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/global/GRecursion.java @@ -0,0 +1,54 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.global; + +import org.antlr.runtime.Token; +import org.scribble.ast.Recursion; +import org.scribble.core.type.kind.Global; +import org.scribble.del.DelFactory; + + +public class GRecursion extends Recursion + implements GCompoundSessionNode +{ + // ScribTreeAdaptor#create constructor + public GRecursion(Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected GRecursion(GRecursion node) + { + super(node); + } + + @Override + public GProtoBlock getBlockChild() + { + return (GProtoBlock) getChild(Recursion.BODY_CHILD_INDEX); + } + + @Override + public GRecursion dupNode() + { + return new GRecursion(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.GRecursion(this); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/global/GScribNode.java b/scribble-ast/src/main/java/org/scribble/ast/global/GScribNode.java new file mode 100644 index 000000000..74d175207 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/global/GScribNode.java @@ -0,0 +1,32 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.global; + +import org.scribble.ast.ProtoKindNode; +import org.scribble.core.type.kind.Global; + +public interface GScribNode extends ProtoKindNode +{ + @Override + default boolean isGlobal() + { + return true; + } + + @Override + default Global getKind() + { + return Global.KIND; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/global/GSessionNode.java b/scribble-ast/src/main/java/org/scribble/ast/global/GSessionNode.java new file mode 100644 index 000000000..f5268b1aa --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/global/GSessionNode.java @@ -0,0 +1,23 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.global; + +import org.scribble.ast.SessionNode; +import org.scribble.core.type.kind.Global; + +// Alternatively to interface, use GlobalNode subclass with delegation to "super" base (e.g. Choice) classes +public interface GSessionNode extends SessionNode, GScribNode +{ + //public LInteractionSeq project(AstFactory af, Role self); // TODO +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/global/GSimpleSessionNode.java b/scribble-ast/src/main/java/org/scribble/ast/global/GSimpleSessionNode.java new file mode 100644 index 000000000..7088f7993 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/global/GSimpleSessionNode.java @@ -0,0 +1,19 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.global; + +public interface GSimpleSessionNode extends GSessionNode +{ + +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/global/GWrap.java b/scribble-ast/src/main/java/org/scribble/ast/global/GWrap.java new file mode 100644 index 000000000..162afc363 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/global/GWrap.java @@ -0,0 +1,75 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.global; + +import org.antlr.runtime.Token; +import org.scribble.ast.WrapAction; +import org.scribble.ast.name.simple.RoleNode; +import org.scribble.core.type.kind.Global; +import org.scribble.del.DelFactory; +import org.scribble.util.Constants; +import org.scribble.util.ScribException; +import org.scribble.visit.AstVisitor; + +// TODO: factor out base Wrap (cf. Disconnect) -- Wrap is a ConnectionAction? +public class GWrap extends WrapAction + implements GSimpleSessionNode +{ + // ScribTreeAdaptor#create constructor + public GWrap(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public GWrap(GWrap node) + { + super(node); + } + + @Override + public GWrap dupNode() + { + return new GWrap(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.GWrap(this); + } + + public GWrap reconstruct(RoleNode client, RoleNode server) + { + GWrap n = dupNode(); + n.addScribChildren(client, server); + n.setDel(del()); // No copy + return n; + } + + @Override + public GWrap visitChildren(AstVisitor nv) throws ScribException + { + RoleNode src = (RoleNode) visitChild(getClientChild(), nv); + RoleNode dest = (RoleNode) visitChild(getServerChild(), nv); + return reconstruct(src, dest); + } + + @Override + public String toString() + { + return Constants.WRAP_KW + " " + getClientChild() + + " " + Constants.TO_KW + " " + getServerChild() + ";"; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/local/LAcc.java b/scribble-ast/src/main/java/org/scribble/ast/local/LAcc.java new file mode 100644 index 000000000..2a9874041 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/local/LAcc.java @@ -0,0 +1,66 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.local; + +import org.antlr.runtime.Token; +import org.scribble.ast.name.simple.RoleNode; +import org.scribble.del.DelFactory; +import org.scribble.util.Constants; + +public class LAcc extends LConnectAction implements LSimpleSessionNode +{ + // ScribTreeAdaptor#create constructor + public LAcc(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public LAcc(LAcc node) + { + super(node); + } + + // CHECKME: factor out implementations with LRecv as default methods + @Override + public RoleNode getSelfChild() + { + return getDestinationChild(); // CHECKME: don't use common src/dst pattern between global/local? + } + + @Override + public RoleNode getPeerChild() + { + return getSourceChild(); + } + + @Override + public LAcc dupNode() + { + return new LAcc(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.LAcc(this); + } + + @Override + public String toString() + { + return (isUnitMessage() ? "" : getMessageNodeChild() + " ") // TODO: deprecate ommitted "()" special case + + Constants.ACCEPT_KW + " " + getSourceChild() + ";"; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/local/LChoice.java b/scribble-ast/src/main/java/org/scribble/ast/local/LChoice.java new file mode 100644 index 000000000..b2d04b8cf --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/local/LChoice.java @@ -0,0 +1,58 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.local; + +import java.util.List; +import java.util.stream.Collectors; + +import org.antlr.runtime.Token; +import org.scribble.ast.Choice; +import org.scribble.ast.ScribNode; +import org.scribble.core.type.kind.Local; +import org.scribble.del.DelFactory; + +public class LChoice extends Choice implements LCompoundSessionNode +{ + // ScribTreeAdaptor#create constructor + public LChoice(Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected LChoice(LChoice node) + { + super(node); + } + + @Override + public List getBlockChildren() + { + List cs = getChildren(); + return cs.subList(Choice.BLOCK_CHILDREN_START_INDEX, cs.size()).stream() + .map(x -> (LProtoBlock) x).collect(Collectors.toList()); + } + + @Override + public LChoice dupNode() + { + return new LChoice(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.LChoice(this); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/local/LClientWrap.java b/scribble-ast/src/main/java/org/scribble/ast/local/LClientWrap.java new file mode 100644 index 000000000..d80e4617b --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/local/LClientWrap.java @@ -0,0 +1,86 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.local; + +import org.antlr.runtime.Token; +import org.scribble.ast.name.simple.RoleNode; +import org.scribble.del.DelFactory; +import org.scribble.util.Constants; +import org.scribble.util.ScribException; +import org.scribble.visit.AstVisitor; + +public class LClientWrap extends LWrapAction + implements LSimpleSessionNode +{ + // ScribTreeAdaptor#create constructor + public LClientWrap(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public LClientWrap(LClientWrap node) + { + super(node); + } + + // CHECKME: factor out implementations with LSend as default methods + @Override + public RoleNode getSelfChild() + { + return getSourceChild(); + } + + @Override + public RoleNode getPeerChild() + { + return getDestinationChild(); // Multi-connect/req not supported + } + + @Override + public LClientWrap dupNode() + { + return new LClientWrap(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.LClientWrap(this); + } + + // TODO: factor out a base + public LClientWrap reconstruct(RoleNode client, RoleNode server) + { + LClientWrap n = dupNode(); + n.addScribChildren(client, server); + n.setDel(del()); // No copy + return n; + } + + // TODO: factor out a base + @Override + public LClientWrap visitChildren(AstVisitor nv) throws ScribException + { + RoleNode src = (RoleNode) visitChild(getClientChild(), nv); + RoleNode dest = (RoleNode) visitChild(getClientChild(), nv); + return reconstruct(src, dest); + } + + @Override + public String toString() + { + return Constants.CLIENTWRAP_KW + getServerChild() + ";"; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/local/LCompoundSessionNode.java b/scribble-ast/src/main/java/org/scribble/ast/local/LCompoundSessionNode.java new file mode 100644 index 000000000..3072c52ab --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/local/LCompoundSessionNode.java @@ -0,0 +1,19 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.local; + +public interface LCompoundSessionNode extends LSessionNode +{ + +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/local/LConnectAction.java b/scribble-ast/src/main/java/org/scribble/ast/local/LConnectAction.java new file mode 100644 index 000000000..7c7348f88 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/local/LConnectAction.java @@ -0,0 +1,39 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.local; + +import org.antlr.runtime.Token; +import org.scribble.ast.ConnectAction; +import org.scribble.ast.name.simple.RoleNode; +import org.scribble.core.type.kind.Local; + +public abstract class LConnectAction extends ConnectAction + implements LSimpleSessionNode +{ + // ScribTreeAdaptor#create constructor + public LConnectAction(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public LConnectAction(LConnectAction node) + { + super(node); + } + + // CHECKME: make an LDirectedAction interface? cf. LMsgTransfer -- CHECKME: factor out implementations as default methods with Send/Recv? + public abstract RoleNode getSelfChild(); // Post: "self" RoleNode + public abstract RoleNode getPeerChild(); +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/local/LContinue.java b/scribble-ast/src/main/java/org/scribble/ast/local/LContinue.java new file mode 100644 index 000000000..8b79ddd56 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/local/LContinue.java @@ -0,0 +1,46 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.local; + +import org.antlr.runtime.Token; +import org.scribble.ast.Continue; +import org.scribble.core.type.kind.Local; +import org.scribble.del.DelFactory; + +public class LContinue extends Continue implements LSimpleSessionNode +{ + // ScribTreeAdaptor#create constructor + public LContinue(Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected LContinue(LContinue node) + { + super(node); + } + + @Override + public LContinue dupNode() + { + return new LContinue(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.LContinue(this); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/local/LDelegElem.java b/scribble-ast/src/main/java/org/scribble/ast/local/LDelegElem.java new file mode 100644 index 000000000..f78393a1d --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/local/LDelegElem.java @@ -0,0 +1,47 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.local; + +import org.antlr.runtime.Token; +import org.scribble.ast.UnaryPayElem; +import org.scribble.core.type.kind.Local; +import org.scribble.del.DelFactory; + +// N.B. extends UnaryPayloadElem, not DelegationElem +public class LDelegElem extends UnaryPayElem +{ + // ScribTreeAdaptor#create constructor + public LDelegElem(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public LDelegElem(LDelegElem node) + { + super(node); + } + + @Override + public LDelegElem dupNode() + { + return new LDelegElem(this); + } + + @Override + public void decorateDel(DelFactory df) + { + throw new RuntimeException("TODO: " + this); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/local/LDisconnect.java b/scribble-ast/src/main/java/org/scribble/ast/local/LDisconnect.java new file mode 100644 index 000000000..cc529195d --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/local/LDisconnect.java @@ -0,0 +1,66 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.local; + +import org.antlr.runtime.Token; +import org.scribble.ast.DisconnectAction; +import org.scribble.ast.name.simple.RoleNode; +import org.scribble.core.type.kind.Local; +import org.scribble.del.DelFactory; +import org.scribble.util.Constants; + +public class LDisconnect extends DisconnectAction + implements LSimpleSessionNode +{ + // ScribTreeAdaptor#create constructor + public LDisconnect(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public LDisconnect(LDisconnect node) + { + super(node); + } + + // Cf. core LDisconnect + public RoleNode getSelfChild() + { + return getLeftChild(); + } + + public RoleNode getPeerChild() + { + return getRightChild(); + } + + @Override + public void decorateDel(DelFactory df) + { + df.LDisconnect(this); + } + + @Override + public LDisconnect dupNode() + { + return new LDisconnect(this); + } + + @Override + public String toString() + { + return Constants.DISCONNECT_KW + " " + getRightChild() + ";"; // FIXME: make explicit, using right as peer (cf. core.type) + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/local/LDo.java b/scribble-ast/src/main/java/org/scribble/ast/local/LDo.java new file mode 100644 index 000000000..14da7ab36 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/local/LDo.java @@ -0,0 +1,72 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.local; + +import org.antlr.runtime.Token; +import org.scribble.ast.Do; +import org.scribble.ast.name.qualified.LProtoNameNode; +import org.scribble.core.lang.context.ModuleContext; +import org.scribble.core.type.kind.Local; +import org.scribble.core.type.name.LProtoName; +import org.scribble.del.DelFactory; +import org.scribble.job.JobContext; + +public class LDo extends Do implements LSimpleSessionNode +{ + + // ScribTreeAdaptor#create constructor + public LDo(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public LDo(LDo node) + { + super(node); + } + + @Override + public LProtoNameNode getProtocolNameNode() + { + return (LProtoNameNode) getChild(Do.NAME_CHILD_INDEX); + } + + @Override + public LProtoDecl getTargetProtocolDecl(JobContext jobc, + ModuleContext modc) + { + LProtoName fullname = getTargetProtoDeclFullName(modc); + return jobc.getModule(fullname.getPrefix()) + .getLProtocolDeclChild(fullname.getSimpleName()); + } + + @Override + public LDo dupNode() + { + return new LDo(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.LDo(this); + } + + @Override + public LProtoName getTargetProtoDeclFullName(ModuleContext modc) + { + return (LProtoName) super.getTargetProtoDeclFullName(modc); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/local/LInteractionSeq.java b/scribble-ast/src/main/java/org/scribble/ast/local/LInteractionSeq.java new file mode 100644 index 000000000..d2be6a0c4 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/local/LInteractionSeq.java @@ -0,0 +1,57 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.local; + +import java.util.List; +import java.util.stream.Collectors; + +import org.antlr.runtime.Token; +import org.scribble.ast.InteractionSeq; +import org.scribble.core.type.kind.Local; +import org.scribble.del.DelFactory; + +public class LInteractionSeq extends InteractionSeq + implements LSessionNode +{ + // ScribTreeAdaptor#create constructor + public LInteractionSeq(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public LInteractionSeq(LInteractionSeq node) + { + super(node); + } + + @Override + public List getInteractionChildren() + { + return getChildren().stream().map(n -> (LSessionNode) n) + .collect(Collectors.toList()); + } + + @Override + public LInteractionSeq dupNode() + { + return new LInteractionSeq(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.LInteractionSeq(this); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/local/LMsgTransfer.java b/scribble-ast/src/main/java/org/scribble/ast/local/LMsgTransfer.java new file mode 100644 index 000000000..20bfd4dd2 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/local/LMsgTransfer.java @@ -0,0 +1,39 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.local; + +import org.antlr.runtime.Token; +import org.scribble.ast.MsgTransfer; +import org.scribble.ast.name.simple.RoleNode; +import org.scribble.core.type.kind.Local; + +public abstract class LMsgTransfer extends MsgTransfer + implements LSimpleSessionNode +{ + // ScribTreeAdaptor#create constructor + public LMsgTransfer(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public LMsgTransfer(LMsgTransfer node) + { + super(node); + } + + // CHECKME: make an LDirectedAction interface? cf. LConnectAction -- CHECKME: factor out implementations as default methods with Acc/Req? + public abstract RoleNode getSelfChild(); // Post: "self" RoleNode + public abstract RoleNode getPeerChild(); +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/local/LProjectionDecl.java b/scribble-ast/src/main/java/org/scribble/ast/local/LProjectionDecl.java new file mode 100644 index 000000000..0baa89b71 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/local/LProjectionDecl.java @@ -0,0 +1,87 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.local; + +import org.antlr.runtime.Token; +import org.scribble.ast.ProtoDef; +import org.scribble.ast.ProtoHeader; +import org.scribble.ast.ProtoModList; +import org.scribble.ast.name.qualified.GProtoNameNode; +import org.scribble.ast.name.simple.RoleNode; +import org.scribble.core.type.kind.Local; +import org.scribble.del.DelFactory; + +public class LProjectionDecl extends LProtoDecl +{ + // Continues on from ProtoDecl, cf. ProtoDecl.DEF_CHILD + public static final int GLOBAL_CHILD = 3; // Cf. "parent", confusing with Antlr + public static final int SELF_CHILD = 4; + + //public final GProtoName parent; // FIXME: additional ast child? + + // ScribTreeAdaptor#create constructor + public LProjectionDecl(Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected LProjectionDecl(LProtoDecl node) + { + super(node); + } + + public GProtoNameNode getGlobalChild() + { + return (GProtoNameNode) getChild(GLOBAL_CHILD); + } + + public RoleNode getSelfChild() + { + return (RoleNode) getChild(SELF_CHILD); + } + + // "add", not "set" + public void addScribChildren(ProtoModList mods, ProtoHeader header, + ProtoDef def, GProtoNameNode global, RoleNode self) + { + // Cf. above getters and Scribble.g children order + super.addScribChildren(mods, header, def); + addChild(global); + addChild(self); + } + + // Cf. CommonTree#dupNode + @Override + public LProtoDecl dupNode() + { + return new LProtoDecl(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.LProjectionDecl(this); + } + + @Override + public String toString() + { + // Duplicated from ProtoDecl + ProtoModList mods = getModifierListChild(); + return (mods.isEmpty() ? "" : mods + " ") + getHeaderChild() + " " // FIXME: self role decl (cf. LProtocol.rolesToString) + + "projects " + getGlobalChild() + " " // Cf. core.lang.local.LProjection + + getDefChild(); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/local/LProtoBlock.java b/scribble-ast/src/main/java/org/scribble/ast/local/LProtoBlock.java new file mode 100644 index 000000000..591ea878a --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/local/LProtoBlock.java @@ -0,0 +1,52 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.local; + +import org.antlr.runtime.Token; +import org.scribble.ast.ProtoBlock; +import org.scribble.core.type.kind.Local; +import org.scribble.del.DelFactory; + +public class LProtoBlock extends ProtoBlock implements LScribNode +{ + // ScribTreeAdaptor#create constructor + public LProtoBlock(Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected LProtoBlock(LProtoBlock node) + { + super(node); + } + + @Override + public LInteractionSeq getInteractSeqChild() + { + return (LInteractionSeq) getChild(ProtoBlock.SEQ_CHILD_INDEX); + } + + @Override + public LProtoBlock dupNode() + { + return new LProtoBlock(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.LProtoBlock(this); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/local/LProtoDecl.java b/scribble-ast/src/main/java/org/scribble/ast/local/LProtoDecl.java new file mode 100644 index 000000000..e06ded600 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/local/LProtoDecl.java @@ -0,0 +1,70 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.local; + +import org.antlr.runtime.Token; +import org.scribble.ast.Module; +import org.scribble.ast.ProtoDecl; +import org.scribble.core.type.kind.Local; +import org.scribble.core.type.name.LProtoName; +import org.scribble.del.DelFactory; + +// Maybe make abstract with concrete parsed (LParsedDecl) and projected (LProjectionDecl) subclasses +public class LProtoDecl extends ProtoDecl implements LSessionNode +{ + // ScribTreeAdaptor#create constructor + public LProtoDecl(Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected LProtoDecl(LProtoDecl node) + { + super(node); + } + + @Override + public LProtoHeader getHeaderChild() + { + return (LProtoHeader) getChild(ProtoDecl.HEADER_CHILD); + } + + @Override + public LProtoDef getDefChild() + { + return (LProtoDef) getChild(ProtoDecl.DEF_CHILD); + } + + // Cf. CommonTree#dupNode + @Override + public LProtoDecl dupNode() + { + return new LProtoDecl(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.LProtoDecl(this); + } + + @Override + public LProtoName getFullMemberName(Module mod) // TODO: remove mod from meth sig + { + Module m = (Module) getParent(); + return new LProtoName(m.getFullModuleName(), + getHeaderChild().getDeclName()); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/local/LProtoDef.java b/scribble-ast/src/main/java/org/scribble/ast/local/LProtoDef.java new file mode 100644 index 000000000..8e98afdcd --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/local/LProtoDef.java @@ -0,0 +1,52 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.local; + +import org.antlr.runtime.Token; +import org.scribble.ast.ProtoDef; +import org.scribble.core.type.kind.Local; +import org.scribble.del.DelFactory; + +public class LProtoDef extends ProtoDef implements LSessionNode +{ + // ScribTreeAdaptor#create constructor + public LProtoDef(Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected LProtoDef(LProtoDef node) + { + super(node); + } + + @Override + public LProtoBlock getBlockChild() + { + return (LProtoBlock) getChild(ProtoDef.BLOCK_CHILD_INDEX); + } + + @Override + public LProtoDef dupNode() + { + return new LProtoDef(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.LProtoDef(this); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/local/LProtoHeader.java b/scribble-ast/src/main/java/org/scribble/ast/local/LProtoHeader.java new file mode 100644 index 000000000..ccb64f5c3 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/local/LProtoHeader.java @@ -0,0 +1,67 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.local; + +import org.antlr.runtime.Token; +import org.scribble.ast.ProtoHeader; +import org.scribble.ast.name.qualified.LProtoNameNode; +import org.scribble.core.type.kind.Local; +import org.scribble.core.type.name.LProtoName; +import org.scribble.del.DelFactory; +import org.scribble.util.Constants; + +public class LProtoHeader extends ProtoHeader implements LSessionNode +{ + // ScribTreeAdaptor#create constructor + public LProtoHeader(Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected LProtoHeader(LProtoHeader node) + { + super(node); + } + + @Override + public LProtoHeader dupNode() + { + return new LProtoHeader(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.LProtoHeader(this); + } + + @Override + public LProtoNameNode getNameNodeChild() + { + return (LProtoNameNode) getRawNameNodeChild(); + } + + @Override + public LProtoName getDeclName() + { + return (LProtoName) super.getDeclName(); + } + + @Override + public String toString() + { + return Constants.LOCAL_KW + " " + super.toString(); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/local/LRecursion.java b/scribble-ast/src/main/java/org/scribble/ast/local/LRecursion.java new file mode 100644 index 000000000..e806db82b --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/local/LRecursion.java @@ -0,0 +1,52 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.local; + +import org.antlr.runtime.Token; +import org.scribble.ast.Recursion; +import org.scribble.core.type.kind.Local; +import org.scribble.del.DelFactory; + +public class LRecursion extends Recursion implements LCompoundSessionNode +{ + // ScribTreeAdaptor#create constructor + public LRecursion(Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected LRecursion(LRecursion node) + { + super(node); + } + + @Override + public LProtoBlock getBlockChild() + { + return (LProtoBlock) getChild(Recursion.BODY_CHILD_INDEX); + } + + @Override + public LRecursion dupNode() + { + return new LRecursion(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.LRecursion(this); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/local/LRecv.java b/scribble-ast/src/main/java/org/scribble/ast/local/LRecv.java new file mode 100644 index 000000000..74efffc98 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/local/LRecv.java @@ -0,0 +1,72 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.local; + +import java.util.List; + +import org.antlr.runtime.Token; +import org.scribble.ast.name.simple.RoleNode; +import org.scribble.del.DelFactory; +import org.scribble.util.Constants; + +public class LRecv extends LMsgTransfer +{ + // ScribTreeAdaptor#create constructor + public LRecv(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public LRecv(LRecv node) + { + super(node); + } + + @Override + public RoleNode getSelfChild() + { + List dsts = getDestinationChildren(); + if (dsts.size() > 1) + { + throw new RuntimeException("Shouldn't get in here: " + this); // CHECKME: don't use common src/dst pattern between global/local? + } + return dsts.get(0); + } + + @Override + public RoleNode getPeerChild() + { + return getSourceChild(); + } + + @Override + public LRecv dupNode() + { + return new LRecv(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.LRecv(this); + } + + @Override + public String toString() + { + return getMessageNodeChild() + " " + Constants.FROM_KW + " " + + getSourceChild() + ";"; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/local/LReq.java b/scribble-ast/src/main/java/org/scribble/ast/local/LReq.java new file mode 100644 index 000000000..5ec85e2d3 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/local/LReq.java @@ -0,0 +1,66 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.local; + +import org.antlr.runtime.Token; +import org.scribble.ast.name.simple.RoleNode; +import org.scribble.del.DelFactory; +import org.scribble.util.Constants; + +public class LReq extends LConnectAction implements LSimpleSessionNode +{ + // ScribTreeAdaptor#create constructor + public LReq(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public LReq(LReq node) + { + super(node); + } + + // CHECKME: factor out implementations with LSend as default methods + @Override + public RoleNode getSelfChild() + { + return getSourceChild(); + } + + @Override + public RoleNode getPeerChild() + { + return getDestinationChild(); // Multi-connect/req not supported + } + + @Override + public LReq dupNode() + { + return new LReq(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.LReq(this); + } + + @Override + public String toString() + { + return (isUnitMessage() ? "" : getMessageNodeChild() + " ") // TODO: deprecate ommitted "()" special case + + Constants.REQUEST_KW + " " + getDestinationChild() + ";"; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/local/LScribNode.java b/scribble-ast/src/main/java/org/scribble/ast/local/LScribNode.java new file mode 100644 index 000000000..ada5ec403 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/local/LScribNode.java @@ -0,0 +1,32 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.local; + +import org.scribble.ast.ProtoKindNode; +import org.scribble.core.type.kind.Local; + +public interface LScribNode extends ProtoKindNode +{ + @Override + default boolean isLocal() + { + return true; + } + + @Override + default Local getKind() + { + return Local.KIND; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/local/LSelfDecl.java b/scribble-ast/src/main/java/org/scribble/ast/local/LSelfDecl.java new file mode 100644 index 000000000..4782a36a4 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/local/LSelfDecl.java @@ -0,0 +1,52 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.local; + +import org.antlr.runtime.Token; +import org.scribble.ast.RoleDecl; +import org.scribble.del.DelFactory; +import org.scribble.util.Constants; + +public class LSelfDecl extends RoleDecl +{ + // ScribTreeAdaptor#create constructor + public LSelfDecl(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public LSelfDecl(LSelfDecl node) + { + super(node); + } + + @Override + public LSelfDecl dupNode() + { + return new LSelfDecl(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.LSelfDecl(this); + } + + @Override + public String getKeyword() + { + return Constants.SELF_KW; // Main reason for this subclass; overriding various toStrings awkward + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/local/LSend.java b/scribble-ast/src/main/java/org/scribble/ast/local/LSend.java new file mode 100644 index 000000000..eb8c8a254 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/local/LSend.java @@ -0,0 +1,76 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.local; + +import java.util.List; +import java.util.stream.Collectors; + +import org.antlr.runtime.Token; +import org.scribble.ast.name.simple.RoleNode; +import org.scribble.del.DelFactory; +import org.scribble.util.Constants; + +public class LSend extends LMsgTransfer +{ + // ScribTreeAdaptor#create constructor + public LSend(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public LSend(LSend node) + { + super(node); + } + + @Override + public RoleNode getSelfChild() + { + return getSourceChild(); + } + + @Override + public RoleNode getPeerChild() + { + List dsts = getDestinationChildren(); + if (dsts.size() > 1) + { + throw new RuntimeException("[TODO] Multi-send: " + this); + } + return dsts.get(0); + } + + @Override + public LSend dupNode() + { + return new LSend(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.LSend(this); + } + + @Override + public String toString() + { + return getMessageNodeChild() + " " + Constants.TO_KW + + " " + + getDestinationChildren().stream().map(x -> x.toString()) + .collect(Collectors.joining(", ")) + + ";"; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/local/LServerWrap.java b/scribble-ast/src/main/java/org/scribble/ast/local/LServerWrap.java new file mode 100644 index 000000000..2656bd785 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/local/LServerWrap.java @@ -0,0 +1,87 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.local; + +import org.antlr.runtime.Token; +import org.scribble.ast.name.simple.RoleNode; +import org.scribble.del.DelFactory; +import org.scribble.util.Constants; +import org.scribble.util.ScribException; +import org.scribble.visit.AstVisitor; + +// TODO: factor out base Wrap (cf. Disconnect) +public class LServerWrap extends LWrapAction + implements LSimpleSessionNode +{ + // ScribTreeAdaptor#create constructor + public LServerWrap(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public LServerWrap(LServerWrap node) + { + super(node); + } + + // CHECKME: factor out implementations with LRecv as default methods + @Override + public RoleNode getSelfChild() + { + return getDestinationChild(); // CHECKME: don't use common src/dst pattern between global/local? + } + + @Override + public RoleNode getPeerChild() + { + return getSourceChild(); + } + + @Override + public LServerWrap dupNode() + { + return new LServerWrap(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.LServerWrap(this); + } + + // TODO: factor out a base + public LServerWrap reconstruct(RoleNode client, RoleNode server) + { + LServerWrap n = dupNode(); + n.addScribChildren(client, server); + n.setDel(del()); // No copy + return n; + } + + // TODO: factor out a base + @Override + public LServerWrap visitChildren(AstVisitor nv) throws ScribException + { + RoleNode src = (RoleNode) visitChild(getClientChild(), nv); + RoleNode dest = (RoleNode) visitChild(getServerChild(), nv); + return reconstruct(src, dest); + } + + @Override + public String toString() + { + return Constants.SERVERWRAP_KW + " " + getClientChild() + ";"; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/local/LSessionNode.java b/scribble-ast/src/main/java/org/scribble/ast/local/LSessionNode.java new file mode 100644 index 000000000..c4b1c07bd --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/local/LSessionNode.java @@ -0,0 +1,32 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.local; + +import org.scribble.ast.SessionNode; +import org.scribble.core.type.kind.Local; + +public interface LSessionNode extends SessionNode, LScribNode +{ + @Override + default boolean isLocal() + { + return true; + } + + @Override + default Local getKind() + { + return Local.KIND; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/local/LSimpleSessionNode.java b/scribble-ast/src/main/java/org/scribble/ast/local/LSimpleSessionNode.java new file mode 100644 index 000000000..88861cd57 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/local/LSimpleSessionNode.java @@ -0,0 +1,19 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.local; + +public interface LSimpleSessionNode extends LSessionNode +{ + +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/local/LWrapAction.java b/scribble-ast/src/main/java/org/scribble/ast/local/LWrapAction.java new file mode 100644 index 000000000..b233e5a84 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/local/LWrapAction.java @@ -0,0 +1,38 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.local; + +import org.antlr.runtime.Token; +import org.scribble.ast.WrapAction; +import org.scribble.ast.name.simple.RoleNode; +import org.scribble.core.type.kind.Local; + +public abstract class LWrapAction extends WrapAction +{ + // ScribTreeAdaptor#create constructor + public LWrapAction(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public LWrapAction(LWrapAction node) + { + super(node); + } + + // CHECKME: make an LDirectedAction interface? cf. LMsgTransfer -- CHECKME: factor out implementations as default methods with Send/Recv? + public abstract RoleNode getSelfChild(); // Post: "self" RoleNode + public abstract RoleNode getPeerChild(); +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/name/NameNode.java b/scribble-ast/src/main/java/org/scribble/ast/name/NameNode.java new file mode 100644 index 000000000..70c4a2689 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/name/NameNode.java @@ -0,0 +1,119 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.name; + +import java.util.List; +import java.util.stream.Collectors; + +import org.antlr.runtime.Token; +import org.scribble.ast.ScribNodeBase; +import org.scribble.ast.name.simple.IdNode; +import org.scribble.core.type.kind.Kind; +import org.scribble.core.type.name.Named; + +// Children are IdNode elements (each IdNode records a String text element) +// Kind parameter used for typing help, but NameNodes don't record kind as state (not part of the syntax) -- so kind doesn't affect e.g. equals (i.e. name nodes of different kinds are still only compared syntactically) +public abstract class NameNode extends ScribNodeBase + implements Named +{ + // ScribTreeAdaptor#create constructor + public NameNode(Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected NameNode(NameNode node) + { + super(node); + } + + @Override + public List getChildren() + { + return super.getChildren().stream().map(x -> (IdNode) x) + .collect(Collectors.toList()); + } + + public abstract NameNode dupNode(); + + // Factored abstractly from getChildren, for SimpleNameNode to override (SimpleNameNode has no children) + public List getElements() + { + return getChildren().stream() + .map(x -> x.getText()).collect(Collectors.toList()); + } + + protected final List getPrefixElements() + { + List elems = getElements(); + return elems.subList(0, elems.size()-1); + } + + protected final String getLastElement() + { + List names = getElements(); + return names.get(names.size() - 1); + } + + public int getElementCount() + { + return getChildCount(); + } + + public boolean isEmpty() + { + return getElementCount() == 0; + } + + protected boolean isPrefixed() + { + return getElementCount() > 1; + } + + @Override + public String toString() + { + return toName().toString(); + } + + // CHECKME: is equals/hashCode actually needed for these ScribNodes? (cf. Name) + // CHECKME: should NameNodes ever be used in an equality checking context? (cf. other AST nodes) -- this work should be done using sesstype.Name instead? + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof NameNode)) + { + return false; + } + NameNode them = (NameNode) o; + return them.canEquals(this) + && getElements().equals(them.getElements()); + } + + public abstract boolean canEquals(Object o); + + @Override + public int hashCode() + { + int hash = 317; + hash = 31 * hash + getElements().hashCode(); + // Hash the String values, not the actual Tree nodes + return hash; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/name/PayElemNameNode.java b/scribble-ast/src/main/java/org/scribble/ast/name/PayElemNameNode.java new file mode 100644 index 000000000..3a5017168 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/name/PayElemNameNode.java @@ -0,0 +1,30 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.name; + +import org.scribble.ast.NonRoleArgNode; +import org.scribble.core.type.kind.PayElemKind; +import org.scribble.core.type.name.PayElemType; + + +// A datatype kind node: DataTypeNode or NonRoleParameterNode -- not necessarily simple nor qualified +// Actually, datatype or global protocol kind, if delegation supported -- for "structural delegation" this would not directly be a name node any more (like MessageNode) +//public interface PayloadElemNameNode extends NonRoleArgNode +public interface PayElemNameNode extends NonRoleArgNode +{ + //PayloadType toPayloadType(); + //PayloadType toPayloadType(); // Currently can assume the only possible kind is DataTypeKind (delegation is by (non-ambig) delegationelem) + //PayloadType toPayloadType(); // FIXME: generic parameter for kind (data/local) + PayElemType toPayloadType(); +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/name/qualified/DataNameNode.java b/scribble-ast/src/main/java/org/scribble/ast/name/qualified/DataNameNode.java new file mode 100644 index 000000000..667936ddd --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/name/qualified/DataNameNode.java @@ -0,0 +1,106 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.name.qualified; + +import org.antlr.runtime.Token; +import org.scribble.ast.name.PayElemNameNode; +import org.scribble.core.type.kind.DataKind; +import org.scribble.core.type.name.DataName; +import org.scribble.core.type.session.Arg; +import org.scribble.del.DelFactory; + +//public class DataTypeNode extends MemberNameNode implements PayloadElemNameNode +public class DataNameNode extends MemberNameNode + implements PayElemNameNode +{ + // ScribTreeAdaptor#create constructor + public DataNameNode(Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected DataNameNode(DataNameNode node) + { + super(node); + } + + @Override + public DataNameNode dupNode() + { + return new DataNameNode(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.DataNameNode(this); + } + + @Override + public DataName toName() + { + DataName membname = new DataName(getLastElement()); + return isPrefixed() + ? new DataName(getModuleNamePrefix(), membname) + : membname; + } + + @Override + public boolean isDataNameNode() + { + return true; + } + + @Override + public Arg toArg() + { + return toPayloadType(); + } + + @Override + public DataName toPayloadType() + { + return toName(); + } + + // CHECKME: is equals/hashCode actually needed for these ScribNodes? (cf. Name) + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof DataNameNode)) + { + return false; + } + return ((DataNameNode) o).canEquals(this) && super.equals(o); + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof DataNameNode; + } + + @Override + public int hashCode() + { + int hash = 409; + hash = 31 * hash + super.hashCode(); + return hash; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/name/qualified/GProtoNameNode.java b/scribble-ast/src/main/java/org/scribble/ast/name/qualified/GProtoNameNode.java new file mode 100644 index 000000000..dd46e4ee7 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/name/qualified/GProtoNameNode.java @@ -0,0 +1,83 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.name.qualified; + +import org.antlr.runtime.Token; +import org.scribble.core.type.kind.Global; +import org.scribble.core.type.name.GProtoName; +import org.scribble.del.DelFactory; + +public class GProtoNameNode extends ProtoNameNode +{ + // ScribTreeAdaptor#create constructor + public GProtoNameNode(Token t) + { + super(t); + } + + // Tree#dupNode constructor + public GProtoNameNode(GProtoNameNode node) + { + super(node); + } + + @Override + public GProtoNameNode dupNode() + { + return new GProtoNameNode(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.GProtoNameNode(this); + } + + @Override + public GProtoName toName() + { + GProtoName membname = new GProtoName(getLastElement()); + return isPrefixed() + ? new GProtoName(getModuleNamePrefix(), membname) + : membname; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof GProtoNameNode)) + { + return false; + } + return ((GProtoNameNode) o).canEquals(this) && super.equals(o); + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof GProtoNameNode; + } + + @Override + public int hashCode() + { + int hash = 419; + hash = 31 * hash + super.hashCode(); + return hash; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/name/qualified/LProtoNameNode.java b/scribble-ast/src/main/java/org/scribble/ast/name/qualified/LProtoNameNode.java new file mode 100644 index 000000000..e74077bb8 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/name/qualified/LProtoNameNode.java @@ -0,0 +1,98 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.name.qualified; + +import org.antlr.runtime.Token; +import org.scribble.ast.name.PayElemNameNode; +import org.scribble.core.type.kind.Local; +import org.scribble.core.type.name.LProtoName; +import org.scribble.core.type.session.Arg; +import org.scribble.del.DelFactory; + +public class LProtoNameNode extends ProtoNameNode + implements PayElemNameNode +{ + // ScribTreeAdaptor#create constructor + public LProtoNameNode(Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected LProtoNameNode(LProtoNameNode node) + { + super(node); + } + + @Override + public LProtoNameNode dupNode() + { + return new LProtoNameNode(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.LProtoNameNode(this); + } + + @Override + public LProtoName toName() + { + LProtoName membname = new LProtoName(getLastElement()); + return isPrefixed() + ? new LProtoName(getModuleNamePrefix(), membname) + : membname; + } + + @Override + public LProtoName toPayloadType() + { + return toName(); + } + + @Override + public Arg toArg() + { + return toPayloadType(); + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof LProtoNameNode)) + { + return false; + } + return super.equals(o); // Does canEqual + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof LProtoNameNode; + } + + @Override + public int hashCode() + { + int hash = 421; + hash = 31 * hash + super.hashCode(); + return hash; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/name/qualified/MemberNameNode.java b/scribble-ast/src/main/java/org/scribble/ast/name/qualified/MemberNameNode.java new file mode 100644 index 000000000..fcd7e8391 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/name/qualified/MemberNameNode.java @@ -0,0 +1,52 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.name.qualified; + +import java.util.Arrays; +import java.util.List; + +import org.antlr.runtime.Token; +import org.scribble.core.type.kind.Kind; +import org.scribble.core.type.name.ModuleName; +import org.scribble.core.type.name.PackageName; + +public abstract class MemberNameNode + extends QualNameNode +{ + // ScribTreeAdaptor#create constructor + public MemberNameNode(Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected MemberNameNode(MemberNameNode node) + { + super(node); + } + + protected ModuleName getModuleNamePrefix() + { + List prefix = getPrefixElements(); + ModuleName mn = new ModuleName(prefix.get(prefix.size()-1)); + if (prefix.size() == 1) + { + return mn; + } + return new ModuleName( + new PackageName( + Arrays.copyOf(prefix.toArray(new String[0]), prefix.size() - 1)), + mn); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/name/qualified/ModuleNameNode.java b/scribble-ast/src/main/java/org/scribble/ast/name/qualified/ModuleNameNode.java new file mode 100644 index 000000000..2c80a0b81 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/name/qualified/ModuleNameNode.java @@ -0,0 +1,86 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.name.qualified; + +import org.antlr.runtime.Token; +import org.scribble.core.type.kind.ModuleKind; +import org.scribble.core.type.name.ModuleName; +import org.scribble.core.type.name.PackageName; +import org.scribble.del.DelFactory; + +public class ModuleNameNode extends QualNameNode +{ + // ScribTreeAdaptor#create constructor + public ModuleNameNode(Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected ModuleNameNode(ModuleNameNode node) + { + super(node); + } + + @Override + public ModuleNameNode dupNode() + { + return new ModuleNameNode(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.ModuleNameNode(this); + } + + @Override + public ModuleName toName() + { + ModuleName modname = new ModuleName(getLastElement()); + return isPrefixed() + ? new ModuleName( + new PackageName(getPrefixElements().toArray(new String[0])), + modname) + : modname; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof ModuleNameNode)) + { + return false; + } + return ((ModuleNameNode) o).canEquals(this) && super.equals(o); + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof ModuleNameNode; + } + + @Override + public int hashCode() + { + int hash = 409; + hash = 31 * hash + super.hashCode(); + return hash; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/name/qualified/ProtoNameNode.java b/scribble-ast/src/main/java/org/scribble/ast/name/qualified/ProtoNameNode.java new file mode 100644 index 000000000..0b7722e0a --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/name/qualified/ProtoNameNode.java @@ -0,0 +1,36 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.name.qualified; + +import org.antlr.runtime.Token; +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.core.type.name.ProtoName; + +public abstract class ProtoNameNode + extends MemberNameNode +{ + // ScribTreeAdaptor#create constructor + public ProtoNameNode(Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected ProtoNameNode(ProtoNameNode node) + { + super(node); + } + + public abstract ProtoName toName(); +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/name/qualified/QualNameNode.java b/scribble-ast/src/main/java/org/scribble/ast/name/qualified/QualNameNode.java new file mode 100644 index 000000000..7e0f92573 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/name/qualified/QualNameNode.java @@ -0,0 +1,34 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.name.qualified; + +import org.antlr.runtime.Token; +import org.scribble.ast.name.NameNode; +import org.scribble.core.type.kind.Kind; + +// Any name that could be compound/qualified (but could also be a singleton) +public abstract class QualNameNode extends NameNode +{ + // ScribTreeAdaptor#create constructor + public QualNameNode(Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected QualNameNode(QualNameNode node) + { + super(node); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/name/qualified/SigNameNode.java b/scribble-ast/src/main/java/org/scribble/ast/name/qualified/SigNameNode.java new file mode 100644 index 000000000..162da080e --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/name/qualified/SigNameNode.java @@ -0,0 +1,103 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.name.qualified; + +import org.antlr.runtime.Token; +import org.scribble.ast.MsgNode; +import org.scribble.core.type.kind.SigKind; +import org.scribble.core.type.name.SigName; +import org.scribble.del.DelFactory; + +public class SigNameNode extends MemberNameNode + implements MsgNode +{ + // ScribTreeAdaptor#create constructor + public SigNameNode(Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected SigNameNode(SigNameNode node) + { + super(node); + } + + @Override + public SigNameNode dupNode() + { + return new SigNameNode(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.SigNameNode(this); + } + + @Override + public SigName toName() + { + SigName membname = new SigName(getLastElement()); + return isPrefixed() ? new SigName(getModuleNamePrefix(), membname) + : membname; + } + + @Override + public boolean isSigNameNode() + { + return true; + } + + // Difference between toName and toMessage is scope? does that make sense? + @Override + public SigName toMsg() + { + return toName(); + } + + @Override + public SigName toArg() + { + return toMsg(); + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof SigNameNode)) + { + return false; + } + return ((SigNameNode) o).canEquals(this) && super.equals(o); + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof SigNameNode; + } + + @Override + public int hashCode() + { + int hash = 421; + hash = 31 * hash + super.hashCode(); + return hash; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/name/simple/AmbigNameNode.java b/scribble-ast/src/main/java/org/scribble/ast/name/simple/AmbigNameNode.java new file mode 100644 index 000000000..5c525e9ce --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/name/simple/AmbigNameNode.java @@ -0,0 +1,111 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.name.simple; + +import org.antlr.runtime.Token; +import org.scribble.ast.MsgNode; +import org.scribble.ast.name.PayElemNameNode; +import org.scribble.core.type.kind.AmbigKind; +import org.scribble.core.type.kind.DataKind; +import org.scribble.core.type.kind.NonRoleArgKind; +import org.scribble.core.type.name.AmbigName; +import org.scribble.core.type.name.PayElemType; +import org.scribble.core.type.session.Arg; +import org.scribble.core.type.session.Msg; +import org.scribble.del.DelFactory; + +// Primitive payload type, MessageSigName or parameter names only: if name is parsed as a CompoundNameNodes, it must be a payload type (not ambiguous in this case) +public class AmbigNameNode extends SimpleNameNode + implements MsgNode, PayElemNameNode // FIXME: currently hardcoded to DataTypeKind for payload elems ? +{ + // Scribble.g, IDENTIFIER<...Node>[$IDENTIFIER] + // N.B. ttype (an "imaginary node" type) is discarded, t is a ScribbleParser.ID token type + public AmbigNameNode(int ttype, Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected AmbigNameNode(AmbigNameNode node) + { + super(node); + } + + @Override + public AmbigNameNode dupNode() + { + return new AmbigNameNode(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.AmbigNameNode(this); + } + + @Override + public Arg toArg() + { + throw new RuntimeException( + "Ambiguous name node not disambiguated: " + this); + } + + @Override + public Msg toMsg() + { + throw new RuntimeException( + "Ambiguous name node not disambiguated: " + this); + } + + @Override + public PayElemType toPayloadType() // As a payload elem, currently hardcoded to expect only DataTypeKind (protocol payloads not supported) + { + throw new RuntimeException( + "Ambiguous name node not disambiguated: " + this); + } + + @Override + public AmbigName toName() + { + return new AmbigName(getText()); + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof AmbigNameNode)) + { + return false; + } + return ((AmbigNameNode) o).canEquals(this) && super.equals(o); + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof AmbigNameNode; + } + + @Override + public int hashCode() + { + int hash = 3659; + hash = 31 * super.hashCode(); + return hash; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/name/simple/DataParamNode.java b/scribble-ast/src/main/java/org/scribble/ast/name/simple/DataParamNode.java new file mode 100644 index 000000000..34c9e018a --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/name/simple/DataParamNode.java @@ -0,0 +1,103 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.name.simple; + +import org.antlr.runtime.Token; +import org.scribble.ast.name.PayElemNameNode; +import org.scribble.core.type.kind.DataKind; +import org.scribble.core.type.name.DataName; +import org.scribble.del.DelFactory; + +public class DataParamNode extends NonRoleParamNode + implements PayElemNameNode // As a payload, can only be a DataType (so hardcode) +{ + // Scribble.g, IDENTIFIER<...Node>[$IDENTIFIER] + // N.B. ttype (an "imaginary node" type) is discarded, t is a ScribbleParser.ID token type + public DataParamNode(int ttype, Token t) + { + super(t, DataKind.KIND); + } + + // Tree#dupNode constructor + protected DataParamNode(DataParamNode node) + { + super(node); + } + + @Override + public DataParamNode dupNode() + { + return new DataParamNode(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.DataParamNode(this); + } + + // N.B. no "DataParamName" + @Override + public DataName toName() + { + return new DataName(getText()); + } + + @Override + public DataName toArg() + { + // As a payload kind, currently hardcorded to data type kinds (protocol payloads not supported) + return toPayloadType(); + } + + @Override + public DataName toPayloadType() // Currently can assume the only possible kind for NonRoleParamNode is DataTypeKind + { + return toName(); + } + + @Override + public boolean isDataParamNode() + { + return true; + } + + @Override + public int hashCode() + { + int hash = 8599; + hash = 31 * super.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof DataParamNode)) + { + return false; + } + return super.equals(o); + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof DataParamNode; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/name/simple/ExtIdNode.java b/scribble-ast/src/main/java/org/scribble/ast/name/simple/ExtIdNode.java new file mode 100644 index 000000000..eea5bddf4 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/name/simple/ExtIdNode.java @@ -0,0 +1,67 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.name.simple; + +import org.antlr.runtime.Token; + +// N.B. without surrounding quotes "..." -- cf. ScribTreeAdaptor.create +// N.B. no del attached, so not currently visited +public class ExtIdNode extends IdNode // CHECKME: e.g., toName gives Id +{ + // ScribTreeAdaptor#create constructor + public ExtIdNode(Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected ExtIdNode(ExtIdNode node) + { + super(node); + } + + @Override + public ExtIdNode dupNode() + { + return new ExtIdNode(this); + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof ExtIdNode)) + { + return false; + } + return ((ExtIdNode) o).canEquals(this) && super.equals(o); + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof ExtIdNode; + } + + @Override + public int hashCode() + { + int hash = 13007; + hash = 31 * super.hashCode(); + return hash; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/name/simple/IdNode.java b/scribble-ast/src/main/java/org/scribble/ast/name/simple/IdNode.java new file mode 100644 index 000000000..d3122e40a --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/name/simple/IdNode.java @@ -0,0 +1,99 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.name.simple; + +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.antlr.runtime.Token; +import org.scribble.ast.AstFactory; +import org.scribble.core.type.kind.IdKind; +import org.scribble.core.type.name.Id; +import org.scribble.del.DelFactory; + +// Kind can be disregarded, the "true" kind (for qualified names) recorded by the parent +public class IdNode extends SimpleNameNode +{ + // ScribTreeAdaptor#create constructor + public IdNode(Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected IdNode(IdNode node) + { + super(node); + } + + // CHECKME: move to af? + public static List from(AstFactory af, String[] elems) + { + return Stream.of(elems).map(x -> af.IdNode(null, x)) + .collect(Collectors.toList()); + } + + @Override + public IdNode dupNode() + { + return new IdNode(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.IdNode(this); + } + + @Override + public String getText() + { + return getToken().getText(); + } + + @Override + public Id toName() + { + return new Id(getText()); + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof IdNode)) + { + return false; + } + return ((IdNode) o).canEquals(this) && super.equals(o); + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof IdNode; + } + + @Override + public int hashCode() + { + int hash = 331; + hash = 31 * super.hashCode(); + return hash; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/name/simple/NonRoleParamNode.java b/scribble-ast/src/main/java/org/scribble/ast/name/simple/NonRoleParamNode.java new file mode 100644 index 000000000..dae52b068 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/name/simple/NonRoleParamNode.java @@ -0,0 +1,68 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.name.simple; + +import org.antlr.runtime.Token; +import org.scribble.core.type.kind.NonRoleParamKind; + +// An unambiguous kinded parameter (ambiguous parameters handled by disambiguation) that isn't a role -- e.g. DataType/MessageSigName param +public abstract class NonRoleParamNode extends + SimpleNameNode // As a payload, can only be a DataType (so hardcode) +{ + public final K kind; // CHECKME: still useful, now there are concrete subclasses? + + public NonRoleParamNode(Token t, K kind) + { + super(t); + this.kind = kind; + } + + // Tree#dupNode constructor + protected NonRoleParamNode(NonRoleParamNode node)//, String id) + { + super(node); + this.kind = node.kind; + } + + @Override + public int hashCode() + { + int hash = 317; + hash = 31 * super.hashCode(); + hash = 31 * this.kind.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof NonRoleParamNode)) + { + return false; + } + NonRoleParamNode them = (NonRoleParamNode) o; + return super.equals(o) // Does canEqual + && this.kind.equals(them.kind); + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof NonRoleParamNode; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/name/simple/OpNode.java b/scribble-ast/src/main/java/org/scribble/ast/name/simple/OpNode.java new file mode 100644 index 000000000..7618f81d7 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/name/simple/OpNode.java @@ -0,0 +1,95 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.name.simple; + +import org.antlr.runtime.Token; +import org.scribble.core.type.kind.OpKind; +import org.scribble.core.type.name.Op; +import org.scribble.del.DelFactory; + + +public class OpNode extends SimpleNameNode +{ + // Determine by token text -- cannot use token type int in core, value is a ScribbleParser constant + public static final String EMPTY_OP_TOKEN_TEXT = "__EMPTY_OP"; // Cf. Scribble.g + + public OpNode(Token t) + { + super(t); + } + + // Scribble.g, IDENTIFIER<...Node>[$IDENTIFIER] + // ttype is just ScribblParser.IDENTIFIER, t is the IDENTIFIER token + public OpNode(int ttype, Token t) + { + this(t); + } + + // Tree#dupNode constructor + protected OpNode(OpNode node) + { + super(node); + } + + @Override + public OpNode dupNode() + { + return new OpNode(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.OpNode(this); + } + + @Override + public Op toName() + { + String id = getText(); + if (id.equals(EMPTY_OP_TOKEN_TEXT)) + { + return Op.EMPTY_OP; + } + return new Op(id); + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof OpNode)) + { + return false; + } + return super.equals(o); // Does canEqual + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof OpNode; + } + + @Override + public int hashCode() + { + int hash = 347; + hash = 31 * super.hashCode(); + return hash; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/name/simple/RecVarNode.java b/scribble-ast/src/main/java/org/scribble/ast/name/simple/RecVarNode.java new file mode 100644 index 000000000..34a1c90d8 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/name/simple/RecVarNode.java @@ -0,0 +1,81 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.name.simple; + +import org.antlr.runtime.Token; +import org.scribble.core.type.kind.RecVarKind; +import org.scribble.core.type.name.RecVar; +import org.scribble.del.DelFactory; + +public class RecVarNode extends SimpleNameNode +{ + // Scribble.g, IDENTIFIER<...Node>[$IDENTIFIER] + // N.B. ttype (an "imaginary node" type) is discarded, t is a ScribbleParser.ID token type + public RecVarNode(int ttype, Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected RecVarNode(RecVarNode node) + { + super(node); + } + + @Override + public RecVarNode dupNode() + { + return new RecVarNode(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.RecVarNode(this); + } + + @Override + public RecVar toName() + { + return new RecVar(getText()); + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof RecVarNode)) + { + return false; + } + return super.equals(o); // Does canEqual + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof RecVarNode; + } + + @Override + public int hashCode() + { + int hash = 349; + hash = 31 * super.hashCode(); + return hash; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/name/simple/RoleNode.java b/scribble-ast/src/main/java/org/scribble/ast/name/simple/RoleNode.java new file mode 100644 index 000000000..da32135cf --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/name/simple/RoleNode.java @@ -0,0 +1,84 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.name.simple; + +import org.antlr.runtime.Token; +import org.scribble.ast.DoArgNode; +import org.scribble.core.type.kind.RoleKind; +import org.scribble.core.type.name.Role; +import org.scribble.del.DelFactory; + +public class RoleNode extends SimpleNameNode implements DoArgNode +{ + //public static final RoleNode SELF = ...; // No: no token info + + // Scribble.g, IDENTIFIER<...Node>[$IDENTIFIER] + // N.B. ttype (an "imaginary node" type) is discarded, t is a ScribbleParser.ID token type + public RoleNode(int ttype, Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected RoleNode(RoleNode node) + { + super(node); + } + + @Override + public RoleNode dupNode() + { + return new RoleNode(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.RoleNode(this); + } + + @Override + public Role toName() + { + return new Role(getText()); + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof RoleNode)) + { + return false; + } + return ((RoleNode) o).canEquals(this) && super.equals(o); + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof RoleNode; + } + + @Override + public int hashCode() + { + int hash = 353; + hash = 31 * super.hashCode(); + return hash; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/name/simple/SigParamNode.java b/scribble-ast/src/main/java/org/scribble/ast/name/simple/SigParamNode.java new file mode 100644 index 000000000..a23afb405 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/name/simple/SigParamNode.java @@ -0,0 +1,102 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.name.simple; + +import org.antlr.runtime.Token; +import org.scribble.ast.MsgNode; +import org.scribble.core.type.kind.SigKind; +import org.scribble.core.type.name.SigName; +import org.scribble.del.DelFactory; + +public class SigParamNode extends NonRoleParamNode + implements MsgNode +{ + // Scribble.g, IDENTIFIER<...Node>[$IDENTIFIER] + // N.B. ttype (an "imaginary node" type) is discarded, t is a ScribbleParser.ID token type + public SigParamNode(int ttype, Token t) + { + super(t, SigKind.KIND); + } + + // Tree#dupNode constructor + protected SigParamNode(SigParamNode node) + { + super(node); + } + + @Override + public SigParamNode dupNode() + { + return new SigParamNode(this); + } + + @Override + public void decorateDel(DelFactory df) + { + df.SigParamNode(this); + } + + // N.B. no "SigParamName" + @Override + public SigName toName() + { + return new SigName(getText()); + } + + @Override + public SigName toArg() + { + return toMsg(); + } + + @Override + public SigName toMsg() + { + return toName(); + } + + @Override + public boolean isSigParamNode() + { + return true; + } + + @Override + public int hashCode() + { + int hash = 8609; + hash = 31 * super.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof SigParamNode)) + { + return false; + } + return super.equals(o); + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof SigParamNode; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/ast/name/simple/SimpleNameNode.java b/scribble-ast/src/main/java/org/scribble/ast/name/simple/SimpleNameNode.java new file mode 100644 index 000000000..9495c8e02 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/ast/name/simple/SimpleNameNode.java @@ -0,0 +1,51 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast.name.simple; + +import java.util.Arrays; +import java.util.List; + +import org.antlr.runtime.Token; +import org.scribble.ast.name.NameNode; +import org.scribble.core.type.kind.Kind; + +// "ID" in Scribble.g, token type is ScribbleParser.ID, token text is the string value +// Names that are necessarily "simple", i.e., never compound qualified (cf. qualified, that may be simple or compound) +// CHECKME: refactor NameNode elem structure down the QualifiedNameNode side? -- e.g., NameNode.getChildren is misleading for SimpleNameNode (should use getElements instead) +public abstract class SimpleNameNode extends NameNode +{ + // token type is ScribbleParser.ID, token text is the string value + public SimpleNameNode(Token t) + { + super(t); + } + + // Tree#dupNode constructor + protected SimpleNameNode(SimpleNameNode node) + { + super(node); + } + + @Override + public String getText() + { + return this.token.getText(); + } + + @Override + public List getElements() + { + return Arrays.asList(getText()); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/del/BasicInteractionDel.java b/scribble-ast/src/main/java/org/scribble/del/BasicInteractionDel.java new file mode 100644 index 000000000..6c30afb2d --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/BasicInteractionDel.java @@ -0,0 +1,19 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del; + +public abstract class BasicInteractionDel extends SimpleSessionNodeDel +{ + +} diff --git a/scribble-ast/src/main/java/org/scribble/del/ChoiceDel.java b/scribble-ast/src/main/java/org/scribble/del/ChoiceDel.java new file mode 100644 index 000000000..c59dc1b86 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/ChoiceDel.java @@ -0,0 +1,22 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del; + +public abstract class ChoiceDel extends CompoundInteractionDel +{ + public ChoiceDel() + { + + } +} diff --git a/scribble-ast/src/main/java/org/scribble/del/CompoundInteractionDel.java b/scribble-ast/src/main/java/org/scribble/del/CompoundInteractionDel.java new file mode 100644 index 000000000..692447ab7 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/CompoundInteractionDel.java @@ -0,0 +1,22 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del; + +public abstract class CompoundInteractionDel extends CompoundSessionNodeDel +{ + public CompoundInteractionDel() + { + + } +} diff --git a/scribble-ast/src/main/java/org/scribble/del/CompoundSessionNodeDel.java b/scribble-ast/src/main/java/org/scribble/del/CompoundSessionNodeDel.java new file mode 100644 index 000000000..6861fd7f5 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/CompoundSessionNodeDel.java @@ -0,0 +1,24 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del; + +// For CompoundInteractionNode and ProtocolBlock +public abstract class CompoundSessionNodeDel extends ScribDelBase + implements SessionNodeDel +{ + public CompoundSessionNodeDel() + { + + } +} diff --git a/scribble-ast/src/main/java/org/scribble/del/ConnectionActionDel.java b/scribble-ast/src/main/java/org/scribble/del/ConnectionActionDel.java new file mode 100644 index 000000000..74e74c398 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/ConnectionActionDel.java @@ -0,0 +1,22 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del; + +public abstract class ConnectionActionDel extends DirectedInteractionDel +{ + public ConnectionActionDel() + { + + } +} diff --git a/scribble-ast/src/main/java/org/scribble/del/ContinueDel.java b/scribble-ast/src/main/java/org/scribble/del/ContinueDel.java new file mode 100644 index 000000000..e7fbb67ce --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/ContinueDel.java @@ -0,0 +1,22 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del; + +public abstract class ContinueDel extends SimpleSessionNodeDel +{ + public ContinueDel() + { + + } +} diff --git a/scribble-ast/src/main/java/org/scribble/del/DefaultDel.java b/scribble-ast/src/main/java/org/scribble/del/DefaultDel.java new file mode 100644 index 000000000..eb8555c30 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/DefaultDel.java @@ -0,0 +1,22 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del; + +public class DefaultDel extends ScribDelBase +{ + public DefaultDel() + { + + } +} diff --git a/scribble-ast/src/main/java/org/scribble/del/DelFactory.java b/scribble-ast/src/main/java/org/scribble/del/DelFactory.java new file mode 100644 index 000000000..e4d48ed79 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/DelFactory.java @@ -0,0 +1,184 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del; + +import org.scribble.ast.AuxMod; +import org.scribble.ast.DataDecl; +import org.scribble.ast.DataParamDecl; +import org.scribble.ast.ExplicitMod; +import org.scribble.ast.ImportModule; +import org.scribble.ast.Module; +import org.scribble.ast.ModuleDecl; +import org.scribble.ast.NonRoleArg; +import org.scribble.ast.NonRoleArgList; +import org.scribble.ast.NonRoleParamDeclList; +import org.scribble.ast.PayElemList; +import org.scribble.ast.ProtoModList; +import org.scribble.ast.RoleArg; +import org.scribble.ast.RoleArgList; +import org.scribble.ast.RoleDecl; +import org.scribble.ast.RoleDeclList; +import org.scribble.ast.SigDecl; +import org.scribble.ast.SigLitNode; +import org.scribble.ast.SigParamDecl; +import org.scribble.ast.UnaryPayElem; +import org.scribble.ast.global.GChoice; +import org.scribble.ast.global.GConnect; +import org.scribble.ast.global.GContinue; +import org.scribble.ast.global.GDelegPayElem; +import org.scribble.ast.global.GDisconnect; +import org.scribble.ast.global.GDo; +import org.scribble.ast.global.GInteractionSeq; +import org.scribble.ast.global.GMsgTransfer; +import org.scribble.ast.global.GProtoBlock; +import org.scribble.ast.global.GProtoDecl; +import org.scribble.ast.global.GProtoDef; +import org.scribble.ast.global.GProtoHeader; +import org.scribble.ast.global.GRecursion; +import org.scribble.ast.global.GWrap; +import org.scribble.ast.local.LAcc; +import org.scribble.ast.local.LChoice; +import org.scribble.ast.local.LClientWrap; +import org.scribble.ast.local.LContinue; +import org.scribble.ast.local.LDisconnect; +import org.scribble.ast.local.LDo; +import org.scribble.ast.local.LInteractionSeq; +import org.scribble.ast.local.LProjectionDecl; +import org.scribble.ast.local.LProtoBlock; +import org.scribble.ast.local.LProtoDecl; +import org.scribble.ast.local.LProtoDef; +import org.scribble.ast.local.LProtoHeader; +import org.scribble.ast.local.LRecursion; +import org.scribble.ast.local.LRecv; +import org.scribble.ast.local.LReq; +import org.scribble.ast.local.LSelfDecl; +import org.scribble.ast.local.LSend; +import org.scribble.ast.local.LServerWrap; +import org.scribble.ast.name.qualified.DataNameNode; +import org.scribble.ast.name.qualified.GProtoNameNode; +import org.scribble.ast.name.qualified.LProtoNameNode; +import org.scribble.ast.name.qualified.ModuleNameNode; +import org.scribble.ast.name.qualified.SigNameNode; +import org.scribble.ast.name.simple.AmbigNameNode; +import org.scribble.ast.name.simple.DataParamNode; +import org.scribble.ast.name.simple.ExtIdNode; +import org.scribble.ast.name.simple.IdNode; +import org.scribble.ast.name.simple.OpNode; +import org.scribble.ast.name.simple.RecVarNode; +import org.scribble.ast.name.simple.RoleNode; +import org.scribble.ast.name.simple.SigParamNode; + + +// A little bit more than a "plain" factory, methods do the decoration via ScribNodeBase.setDel +// Use after ANTLR parsing (specifically, ScribTreeAdaptor) -- not needed for AstFactory constructions +// (Perhaps could integrate with ScribTreeAdaptor, but easier to do after -- AST construction technically may further create/dup nodes during the ongoing pass) +// A dec method for each AST class -- method name must be the same as target class name +// Implementations (DelDecoratorImpl) in scribble-parser, can depend on parser implementation +// E.g., DelDecoratorImpl: each method named after the class name +public interface DelFactory +{ + // Names + void IdNode(IdNode n); + void ExtIdNode(ExtIdNode n); + + void AmbigNameNode(AmbigNameNode n); + void DataParamNode(DataParamNode n); + void OpNode(OpNode n); + void RecVarNode(RecVarNode n); + void RoleNode(RoleNode n); + void SigParamNode(SigParamNode n); + + void DataNameNode(DataNameNode n); + void GProtoNameNode(GProtoNameNode n); + void LProtoNameNode(LProtoNameNode n); + void ModuleNameNode(ModuleNameNode n); + void SigNameNode(SigNameNode n); + + + // General and globals + void Module(Module m); + void ModuleDecl(ModuleDecl n); + void ImportModule(ImportModule n); + + void DataDecl(DataDecl n); + void SigDecl(SigDecl n); + void GProtoDecl(GProtoDecl n); + + void ProtoModList(ProtoModList n); + void AuxMod(AuxMod n); + void ExplicitMod(ExplicitMod n); + + void GProtoHeader(GProtoHeader n); + void RoleDeclList(RoleDeclList n); + void RoleDecl(RoleDecl n); + void NonRoleParamDeclList(NonRoleParamDeclList n); + void DataParamDecl(DataParamDecl n); + void SigParamDecl(SigParamDecl n); + + void GProtoDef(GProtoDef n); + void GProtoBlock(GProtoBlock n); + void GInteractionSeq(GInteractionSeq n); + + void SigLitNode(SigLitNode n); + void PayElemList(PayElemList n); + void UnaryPayElem(UnaryPayElem n); + void GDelegPayElem(GDelegPayElem n); + + void GMsgTransfer(GMsgTransfer n); + void GConnect(GConnect n); + void GDisconnect(GDisconnect n); + void GWrap(GWrap n); + + void GContinue(GContinue n); + void GDo(GDo n); + + void RoleArgList(RoleArgList n); + void RoleArg(RoleArg r); + void NonRoleArgList(NonRoleArgList n); + void NonRoleArg(NonRoleArg n); + + void GChoice(GChoice n); + void GRecursion(GRecursion n); + + + // Locals + void LProtoDecl(LProtoDecl n); + void LProjectionDecl(LProjectionDecl n); + + void LProtoHeader(LProtoHeader n); + + void LSelfDecl(LSelfDecl n); + + void LProtoDef(LProtoDef n); + void LProtoBlock(LProtoBlock n); + void LInteractionSeq(LInteractionSeq n); + + //void LDelegElem(LDelegElem n); + + void LSend(LSend n); + void LRecv(LRecv n); + void LAcc(LAcc n); + void LReq(LReq n); + void LDisconnect(LDisconnect n); + void LClientWrap(LClientWrap n); + void LServerWrap(LServerWrap n); + + void LContinue(LContinue n); + void LDo(LDo n); + + void LChoice(LChoice n); + void LRecursion(LRecursion n); +} + + diff --git a/scribble-ast/src/main/java/org/scribble/del/DirectedInteractionDel.java b/scribble-ast/src/main/java/org/scribble/del/DirectedInteractionDel.java new file mode 100644 index 000000000..2831692b7 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/DirectedInteractionDel.java @@ -0,0 +1,19 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del; + +public abstract class DirectedInteractionDel extends BasicInteractionDel +{ + +} diff --git a/scribble-ast/src/main/java/org/scribble/del/DisconnectDel.java b/scribble-ast/src/main/java/org/scribble/del/DisconnectDel.java new file mode 100644 index 000000000..7001d7a12 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/DisconnectDel.java @@ -0,0 +1,19 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del; + +public abstract class DisconnectDel extends BasicInteractionDel +{ + +} diff --git a/scribble-ast/src/main/java/org/scribble/del/DoArgListDel.java b/scribble-ast/src/main/java/org/scribble/del/DoArgListDel.java new file mode 100644 index 000000000..08d172767 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/DoArgListDel.java @@ -0,0 +1,84 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del; + +import java.util.List; +import java.util.stream.Collectors; + +import org.scribble.ast.Do; +import org.scribble.ast.DoArgList; +import org.scribble.ast.ParamDeclList; +import org.scribble.ast.Module; +import org.scribble.ast.ProtoDecl; +import org.scribble.ast.ScribNode; +import org.scribble.core.lang.context.ModuleContext; +import org.scribble.core.type.name.ProtoName; +import org.scribble.job.JobContext; +import org.scribble.util.ScribException; +import org.scribble.visit.NameDisambiguator; + +public abstract class DoArgListDel extends ScribDelBase +{ + public DoArgListDel() + { + + } + + // Doing in leave allows the arguments to be individually checked first + @Override + public DoArgList leaveDisambiguation(ScribNode child, + NameDisambiguator disamb, ScribNode visited) throws ScribException + { + ScribNode parent = child.getParent(); + DoArgList dal = (DoArgList) visited; + List args = dal.getArgChildren(); + ProtoDecl pd = getTargetProtocolDecl((Do) parent, disamb); + if (args.size() != getDeclList(pd).getDeclChildren().size()) + { + throw new ScribException(child.getSource(), + "Do arity mismatch for " + pd.getHeaderChild() + ": " + args); + } + + return dal; + } + + // Not using Do#getTargetProtocolDecl, because that currently relies on namedisamb pass to convert targets to fullnames (because it just gets the full name dependency, it doesn't do visible name resolution) + protected ProtoDecl getTargetProtocolDecl(Do parent, + NameDisambiguator disamb) throws ScribException + { + ModuleContext mc = disamb.getModuleContext(); + JobContext jc = disamb.job.getContext(); + Do doo = (Do) parent; + ProtoName pn = doo.getProtocolNameNode().toName(); + /*if (!mc.isVisibleProtocolDeclName(simpname)) // FIXME: should be checked somewhere else? earlier (do-entry?) -- done + { + throw new ScribbleException("Protocol decl not visible: " + simpname); + }*/ + ProtoName fullname = mc.getVisibleProtocolDeclFullName(pn); // Lookup in visible names -- not deps, because do target name not disambiguated yet (will be done later this pass) + Module mod = jc.getModule(fullname.getPrefix()); + //return mod.getProtocolDeclChild(pn.getSimpleName()); + List> pd = mod.getProtoDeclChildren().stream() + .filter( // cf. Module::hasProtocolDecl + x -> x.getHeaderChild().getDeclName().equals(pn.getSimpleName())) + .collect(Collectors.toList()); + if (pd.size() != 1) + { + throw new ScribException("[disamb] Target protocol ambiguous or not found: " + pn); + } + return pd.get(0); + } + + protected abstract ParamDeclList getDeclList( + ProtoDecl pd); +} diff --git a/scribble-ast/src/main/java/org/scribble/del/DoDel.java b/scribble-ast/src/main/java/org/scribble/del/DoDel.java new file mode 100644 index 000000000..ff23cc22f --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/DoDel.java @@ -0,0 +1,94 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del; + +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +import org.scribble.ast.Do; +import org.scribble.ast.ScribNode; +import org.scribble.ast.name.qualified.ProtoNameNode; +import org.scribble.ast.name.simple.IdNode; +import org.scribble.core.lang.context.ModuleContext; +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.core.type.name.GProtoName; +import org.scribble.core.type.name.ProtoName; +import org.scribble.util.ScribException; +import org.scribble.visit.NameDisambiguator; + +public abstract class DoDel extends SimpleSessionNodeDel +{ + public DoDel() + { + + } + + @Override + public void enterDisambiguation(ScribNode child, NameDisambiguator disamb) + throws ScribException + { + ModuleContext mc = disamb.getModuleContext(); + Do doo = (Do) child; + ProtoNameNode proto = doo.getProtocolNameNode(); + ProtoName simpname = proto.toName(); + if (!mc.isVisibleProtocolDeclName(simpname)) // CHECKME: do on entry here, before visiting DoArgListDel + { + throw new ScribException(proto.getSource(), + "Protocol decl not visible: " + simpname); + } + } + + @Override + public ScribNode leaveDisambiguation(ScribNode child, + NameDisambiguator disamb, ScribNode visited) throws ScribException + { + return leaveDisambiguationAux((Do) visited, disamb); + // To introduce type parameter + } + + // Convert all visible names to full names for protocol inlining: otherwise could get clashes if directly inlining external visible names under the root modulecontext + // Not done in G/LProtocolNameNodeDel because it's only for do-targets that this is needed (cf. ProtocolHeader) + private ScribNode leaveDisambiguationAux( + Do visited, NameDisambiguator disamb) throws ScribException + { + ProtoNameNode proto = visited.getProtocolNameNode(); + + // CHECKME: do full name expansion in disamb? or leave to imed translation? -- FIXME: sort out full name expansion between here and GDoDel.translate + ProtoNameNode n = makeProtoNameNode(disamb, proto); + + // Didn't keep original namenode del -- ? + return visited.reconstruct(n, + visited.getNonRoleListChild(), visited.getRoleListChild()); + } + + private ProtoNameNode makeProtoNameNode( + NameDisambiguator disamb, ProtoNameNode proto) + { + ModuleContext modc = disamb.getModuleContext(); + ProtoName fullname = modc + .getVisibleProtocolDeclFullName(proto.toName()); + if (fullname instanceof GProtoName) + { + List elems = Arrays.asList(fullname.getElements()).stream() + .map(x -> disamb.job.config.af.IdNode(null, x)) + .collect(Collectors.toList()); + @SuppressWarnings("unchecked") // FIXME + ProtoNameNode cast = (ProtoNameNode) disamb.job.config.af + .GProtoNameNode(proto.token, elems); + return cast; + } + throw new RuntimeException("[TODO] " + fullname.getKind() + ": " + fullname); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/del/HeaderParamDeclListDel.java b/scribble-ast/src/main/java/org/scribble/del/HeaderParamDeclListDel.java new file mode 100644 index 000000000..d679f2e42 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/HeaderParamDeclListDel.java @@ -0,0 +1,47 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del; + +import java.util.List; + +import org.scribble.ast.ParamDecl; +import org.scribble.ast.ParamDeclList; +import org.scribble.ast.ScribNode; +import org.scribble.util.ScribException; +import org.scribble.visit.NameDisambiguator; + +public abstract class HeaderParamDeclListDel extends ScribDelBase +{ + public HeaderParamDeclListDel() + { + + } + + // Doing in leave allows the arguments to be individually checked first + @Override + public ParamDeclList leaveDisambiguation(ScribNode child, + NameDisambiguator disamb, ScribNode visited) throws ScribException + { + ParamDeclList pdl = (ParamDeclList) visited; + List> decls = pdl.getDeclChildren(); + // grammar enforces RoleDeclList size > 0 + if (decls.size() != decls.stream().map(d -> d.getDeclName()).distinct() + .count()) + { + throw new ScribException(pdl.getSource(), + "Duplicate header decls: " + pdl); + } + return pdl; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/del/ImportModuleDel.java b/scribble-ast/src/main/java/org/scribble/del/ImportModuleDel.java new file mode 100644 index 000000000..a92d2ebf6 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/ImportModuleDel.java @@ -0,0 +1,22 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del; + +public class ImportModuleDel extends ScribDelBase +{ + public ImportModuleDel() + { + + } +} diff --git a/scribble-ast/src/main/java/org/scribble/del/InteractionSeqDel.java b/scribble-ast/src/main/java/org/scribble/del/InteractionSeqDel.java new file mode 100644 index 000000000..23cd02548 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/InteractionSeqDel.java @@ -0,0 +1,19 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del; + +public abstract class InteractionSeqDel extends ScribDelBase +{ + +} diff --git a/scribble-ast/src/main/java/org/scribble/del/ModuleDel.java b/scribble-ast/src/main/java/org/scribble/del/ModuleDel.java new file mode 100644 index 000000000..28e26125a --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/ModuleDel.java @@ -0,0 +1,92 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del; + +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +import org.scribble.ast.Module; +import org.scribble.ast.NonProtoDecl; +import org.scribble.ast.ProtoDecl; +import org.scribble.ast.ScribNode; +import org.scribble.util.ScribException; +import org.scribble.visit.NameDisambiguator; + +public class ModuleDel extends ScribDelBase +{ + public ModuleDel() + { + + } + + @Override + public Module leaveDisambiguation(ScribNode child, NameDisambiguator disamb, + ScribNode visited) throws ScribException + { + Module mod = (Module) visited; + // Imports checked in ModuleContext -- that is built before disamb is run + List> npds = mod.getNonProtoDeclChildren(); + List npdnames = npds.stream() + .map(x -> x.getDeclName().toString()) + .collect(Collectors.toList()); + // Have to use Strings, as can be different kinds (datatype, sig) + final Set dups1 = getDuplicates(npdnames); + if (!dups1.isEmpty()) + { + NonProtoDecl first = + npds.stream() + .filter(x -> dups1.contains(x.getDeclName().toString())) + .collect(Collectors.toList()).get(0); + throw new ScribException(first.getSource(), + "Duplicate non-protocol decls: " + first.getDeclName()); + } + List> pds = mod.getProtoDeclChildren(); + List pdnames = pds.stream() + .map(pd -> pd.getHeaderChild().getDeclName().toString()) + .collect(Collectors.toList()); + // Have to use Strings, as can be different kinds (global, local) + final Set dups2 = getDuplicates(pdnames); + if (pds.size() != pdnames.stream().distinct().count()) + if (!dups2.isEmpty()) + { + ProtoDecl first = + pds.stream() + .filter(x -> dups2 + .contains(x.getHeaderChild().getDeclName().toString())) + .collect(Collectors.toList()).get(0); + throw new ScribException(first.getSource(), + "Duplicate protocol decls: " + + first.getHeaderChild().getDeclName()); + // Global and locals also required to be distinct + } + return mod; + } + + private static Set getDuplicates(Collection ss) + { + Set uniques = new HashSet<>(); + Set dups = new HashSet<>(); + for (String npd : ss) + { + if (!uniques.add(npd)) + { + dups.add(npd); + } + } + return dups; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/del/MsgTransferDel.java b/scribble-ast/src/main/java/org/scribble/del/MsgTransferDel.java new file mode 100644 index 000000000..8f1351206 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/MsgTransferDel.java @@ -0,0 +1,22 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del; + +public abstract class MsgTransferDel extends DirectedInteractionDel +{ + public MsgTransferDel() + { + + } +} diff --git a/scribble-ast/src/main/java/org/scribble/del/NonRoleArgListDel.java b/scribble-ast/src/main/java/org/scribble/del/NonRoleArgListDel.java new file mode 100644 index 000000000..3e92d4647 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/NonRoleArgListDel.java @@ -0,0 +1,96 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del; + +import java.util.Iterator; + +import org.scribble.ast.Do; +import org.scribble.ast.NonRoleArg; +import org.scribble.ast.NonRoleArgList; +import org.scribble.ast.NonRoleArgNode; +import org.scribble.ast.NonRoleParamDecl; +import org.scribble.ast.NonRoleParamDeclList; +import org.scribble.ast.ProtoDecl; +import org.scribble.ast.ScribNode; +import org.scribble.ast.name.simple.NonRoleParamNode; +import org.scribble.core.type.kind.DataKind; +import org.scribble.core.type.kind.NonRoleParamKind; +import org.scribble.core.type.kind.SigKind; +import org.scribble.util.ScribException; +import org.scribble.visit.NameDisambiguator; + +public class NonRoleArgListDel extends DoArgListDel +{ + public NonRoleArgListDel() + { + + } + + // Doing in leave allows the arguments to be individually checked first + @Override + public NonRoleArgList leaveDisambiguation(ScribNode child, + NameDisambiguator disamb, ScribNode visited) throws ScribException + { + NonRoleArgList nral = (NonRoleArgList) super.leaveDisambiguation(child, + disamb, visited); + // Checks matching arity + + Do parent = (Do) child.getParent(); + ProtoDecl pd = getTargetProtocolDecl((Do) parent, disamb); + Iterator args = nral.getArgChildren().iterator(); + for (NonRoleParamDecl param : pd.getHeaderChild().getParamDeclListChild() + .getDeclChildren()) + { + NonRoleParamKind pkind = param.kind; + NonRoleArg arg = args.next(); + NonRoleArgNode val = arg.getArgNodeChild(); + if (val.isDataParamNode() || val.isSigParamNode()) + { + if (!((NonRoleParamNode) val).kind.equals(pkind)) + { + throw new ScribException(arg.getSource(), + "Invalid arg " + arg + " for param kind: " + pkind); + } + } + else if (pkind.equals(SigKind.KIND)) + { + if (!val.isSigLitNode() && !val.isSigNameNode()) + { + throw new ScribException(arg.getSource(), + "Invalid arg " + arg + " for param kind: " + pkind); + } + } + else if (pkind.equals(DataKind.KIND)) + { + if (!val.isDataNameNode()) + { + throw new ScribException(arg.getSource(), + "Invalid arg " + arg + " for param kind: " + pkind); + } + } + else + { + throw new RuntimeException("Shouldn't get in here: " + pkind); + } + } + + return nral; + } + + @Override + protected NonRoleParamDeclList getDeclList(ProtoDecl pd) + { + return pd.getHeaderChild().getParamDeclListChild(); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/del/NonRoleParamDeclDel.java b/scribble-ast/src/main/java/org/scribble/del/NonRoleParamDeclDel.java new file mode 100644 index 000000000..6ff5c68a1 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/NonRoleParamDeclDel.java @@ -0,0 +1,30 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del; + +import org.scribble.ast.NonRoleParamDecl; +import org.scribble.ast.ScribNode; +import org.scribble.util.ScribException; +import org.scribble.visit.NameDisambiguator; + +public class NonRoleParamDeclDel extends ScribDelBase +{ + @Override + public void enterDisambiguation(ScribNode child, NameDisambiguator disamb) + throws ScribException + { + NonRoleParamDecl pd = (NonRoleParamDecl) child; + disamb.addParam(pd.getDeclName(), pd.kind); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/del/NonRoleParamDeclListDel.java b/scribble-ast/src/main/java/org/scribble/del/NonRoleParamDeclListDel.java new file mode 100644 index 000000000..42ad66f37 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/NonRoleParamDeclListDel.java @@ -0,0 +1,23 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del; + + +public class NonRoleParamDeclListDel extends HeaderParamDeclListDel +{ + public NonRoleParamDeclListDel() + { + + } +} diff --git a/scribble-ast/src/main/java/org/scribble/del/ProtoBlockDel.java b/scribble-ast/src/main/java/org/scribble/del/ProtoBlockDel.java new file mode 100644 index 000000000..a2cad9876 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/ProtoBlockDel.java @@ -0,0 +1,22 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del; + + +// Not a CompoundSessionNodeDel -- corresponds to ProtocolBlock, not a CompoundSessionNode +// A ProtocolBlock is not a "direct" session type constructor (cf. SessionNode) +public abstract class ProtoBlockDel extends ScribDelBase +{ + +} diff --git a/scribble-ast/src/main/java/org/scribble/del/ProtoDeclDel.java b/scribble-ast/src/main/java/org/scribble/del/ProtoDeclDel.java new file mode 100644 index 000000000..a7bf069bf --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/ProtoDeclDel.java @@ -0,0 +1,36 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del; + +import org.scribble.ast.ScribNode; +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.util.ScribException; +import org.scribble.visit.NameDisambiguator; + +public abstract class ProtoDeclDel + extends ScribDelBase +{ + protected ProtoDeclDel() + { + + } + + @Override + public ScribNode leaveDisambiguation(ScribNode child, + NameDisambiguator disamb, ScribNode visited) throws ScribException + { + disamb.clear(); + return visited; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/del/ProtoDefDel.java b/scribble-ast/src/main/java/org/scribble/del/ProtoDefDel.java new file mode 100644 index 000000000..7990d1628 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/ProtoDefDel.java @@ -0,0 +1,19 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del; + +public abstract class ProtoDefDel extends ScribDelBase +{ + +} diff --git a/scribble-ast/src/main/java/org/scribble/del/RecursionDel.java b/scribble-ast/src/main/java/org/scribble/del/RecursionDel.java new file mode 100644 index 000000000..1a0d3d34e --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/RecursionDel.java @@ -0,0 +1,48 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del; + +import org.scribble.ast.Recursion; +import org.scribble.ast.ScribNode; +import org.scribble.core.type.name.RecVar; +import org.scribble.util.ScribException; +import org.scribble.visit.NameDisambiguator; + +public abstract class RecursionDel extends CompoundInteractionDel +{ + public RecursionDel() + { + + } + + @Override + public void enterDisambiguation(ScribNode child, + NameDisambiguator disamb) throws ScribException + { + Recursion rec = (Recursion) child; + RecVar rv = rec.getRecVarChild().toName(); + disamb.pushRecVar(rv); + } + + @Override + public ScribNode leaveDisambiguation(ScribNode child, + NameDisambiguator disamb, ScribNode visited) throws ScribException + { + Recursion rec = (Recursion) visited; + RecVar rv = ((Recursion) child).getRecVarChild().toName(); + // visited may be already name mangled // Not any more (refactored to inlining) + disamb.popRecVar(rv); + return rec; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/del/RoleArgListDel.java b/scribble-ast/src/main/java/org/scribble/del/RoleArgListDel.java new file mode 100644 index 000000000..aa2513fec --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/RoleArgListDel.java @@ -0,0 +1,55 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del; + +import java.util.List; + +import org.scribble.ast.ProtoDecl; +import org.scribble.ast.RoleArgList; +import org.scribble.ast.RoleDeclList; +import org.scribble.ast.ScribNode; +import org.scribble.core.type.name.Role; +import org.scribble.util.ScribException; +import org.scribble.visit.NameDisambiguator; + +public class RoleArgListDel extends DoArgListDel +{ + public RoleArgListDel() + { + + } + + @Override + public RoleArgList leaveDisambiguation(ScribNode child, + NameDisambiguator disamb, ScribNode visited) throws ScribException + { + visited = super.leaveDisambiguation(child, disamb, visited); // Checks matching arity + + // Duplicate check not needed for NonRoleArgList + RoleArgList ral = (RoleArgList) visited; + List roles = ral.getRoles(); + if (roles.size() != roles.stream().distinct().count()) + { + throw new ScribException(ral.getSource(), + "Duplicate role args: " + roles); + } + return ral; + } + + @Override + protected RoleDeclList getDeclList(ProtoDecl pd) + { + return pd.getHeaderChild().getRoleDeclListChild(); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/del/RoleDeclDel.java b/scribble-ast/src/main/java/org/scribble/del/RoleDeclDel.java new file mode 100644 index 000000000..55eaefdd5 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/RoleDeclDel.java @@ -0,0 +1,30 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del; + +import org.scribble.ast.RoleDecl; +import org.scribble.ast.ScribNode; +import org.scribble.util.ScribException; +import org.scribble.visit.NameDisambiguator; + +public class RoleDeclDel extends ScribDelBase +{ + @Override + public void enterDisambiguation(ScribNode child, NameDisambiguator disamb) + throws ScribException + { + RoleDecl rd = (RoleDecl) child; + disamb.addRole(rd.getDeclName()); // Could check distinct here, but doing it uniformly in HeaderParamDeclListDel + } +} diff --git a/scribble-ast/src/main/java/org/scribble/del/RoleDeclListDel.java b/scribble-ast/src/main/java/org/scribble/del/RoleDeclListDel.java new file mode 100644 index 000000000..748777204 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/RoleDeclListDel.java @@ -0,0 +1,23 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del; + + +public class RoleDeclListDel extends HeaderParamDeclListDel +{ + public RoleDeclListDel() + { + + } +} diff --git a/scribble-ast/src/main/java/org/scribble/del/ScribDel.java b/scribble-ast/src/main/java/org/scribble/del/ScribDel.java new file mode 100644 index 000000000..0d5a82b6e --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/ScribDel.java @@ -0,0 +1,34 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del; + +import org.scribble.ast.ScribNode; +import org.scribble.util.ScribException; +import org.scribble.visit.NameDisambiguator; + +// Parameterise by AstNode type? Would inhibit del sharing between types (but that's not currently needed) +public interface ScribDel +{ + default void enterDisambiguation(ScribNode child, NameDisambiguator disamb) + throws ScribException + { + + } + + default ScribNode leaveDisambiguation(ScribNode child, + NameDisambiguator disamb, ScribNode visited) throws ScribException + { + return visited; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/del/ScribDelBase.java b/scribble-ast/src/main/java/org/scribble/del/ScribDelBase.java new file mode 100644 index 000000000..d8a3a4db6 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/ScribDelBase.java @@ -0,0 +1,22 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del; + +public abstract class ScribDelBase implements ScribDel +{ + public ScribDelBase() + { + + } +} diff --git a/scribble-ast/src/main/java/org/scribble/del/SessionNodeDel.java b/scribble-ast/src/main/java/org/scribble/del/SessionNodeDel.java new file mode 100644 index 000000000..bd264b2bd --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/SessionNodeDel.java @@ -0,0 +1,19 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del; + +public interface SessionNodeDel extends ScribDel +{ + +} diff --git a/scribble-ast/src/main/java/org/scribble/del/SimpleSessionNodeDel.java b/scribble-ast/src/main/java/org/scribble/del/SimpleSessionNodeDel.java new file mode 100644 index 000000000..2b41b09f4 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/SimpleSessionNodeDel.java @@ -0,0 +1,20 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del; + +public abstract class SimpleSessionNodeDel extends ScribDelBase + implements SessionNodeDel +{ + +} diff --git a/scribble-ast/src/main/java/org/scribble/del/global/GChoiceDel.java b/scribble-ast/src/main/java/org/scribble/del/global/GChoiceDel.java new file mode 100644 index 000000000..f8376b491 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/global/GChoiceDel.java @@ -0,0 +1,43 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.global; + +import java.util.LinkedList; +import java.util.List; + +import org.scribble.ast.ScribNode; +import org.scribble.ast.global.GChoice; +import org.scribble.ast.global.GProtoBlock; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.global.GSeq; +import org.scribble.del.ChoiceDel; +import org.scribble.visit.GTypeTranslator; + +public class GChoiceDel extends ChoiceDel implements GCompoundSessionNodeDel +{ + + @Override + public org.scribble.core.type.session.global.GChoice translate(ScribNode n, + GTypeTranslator t) + { + GChoice source = (GChoice) n; + Role subj = source.getSubjectChild().toName(); + List blocks = new LinkedList<>(); + for (GProtoBlock b : source.getBlockChildren()) + { + blocks.add((GSeq) b.visitWith(t)); + } + return t.tf.global.GChoice(source, subj, blocks); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/del/global/GCompoundSessionNodeDel.java b/scribble-ast/src/main/java/org/scribble/del/global/GCompoundSessionNodeDel.java new file mode 100644 index 000000000..5f6e4f35c --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/global/GCompoundSessionNodeDel.java @@ -0,0 +1,19 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.global; + +public interface GCompoundSessionNodeDel extends GSessionNodeDel +{ + +} diff --git a/scribble-ast/src/main/java/org/scribble/del/global/GConnectDel.java b/scribble-ast/src/main/java/org/scribble/del/global/GConnectDel.java new file mode 100644 index 000000000..ddf77d05c --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/global/GConnectDel.java @@ -0,0 +1,59 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.global; + +import java.util.List; + +import org.scribble.ast.ScribNode; +import org.scribble.ast.global.GConnect; +import org.scribble.ast.name.simple.RoleNode; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Msg; +import org.scribble.del.ConnectionActionDel; +import org.scribble.util.ScribException; +import org.scribble.visit.GTypeTranslator; +import org.scribble.visit.NameDisambiguator; + +public class GConnectDel extends ConnectionActionDel + implements GSimpleSessionNodeDel +{ + public GConnectDel() + { + + } + + @Override + public ScribNode leaveDisambiguation(ScribNode child, + NameDisambiguator disamb, ScribNode visited) throws ScribException + { + GConnect gc = (GConnect) visited; + return gc; + } + + @Override + public org.scribble.core.type.session.global.GConnect translate(ScribNode n, + GTypeTranslator t) + { + GConnect source = (GConnect) n; + Role src = source.getSourceChild().toName(); + List ds = source.getDestinationChildren(); + if (ds.size() > 1) + { + throw new RuntimeException("TODO: multiple destination roles: " + source); + } + Role dst = ds.get(0).toName(); + Msg msg = source.getMessageNodeChild().toMsg(); + return t.tf.global.GConnect(source, src, msg, dst); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/del/global/GContinueDel.java b/scribble-ast/src/main/java/org/scribble/del/global/GContinueDel.java new file mode 100644 index 000000000..1f37b1fca --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/global/GContinueDel.java @@ -0,0 +1,34 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.global; + +import org.scribble.ast.ScribNode; +import org.scribble.ast.global.GContinue; +import org.scribble.core.type.name.RecVar; +import org.scribble.del.ContinueDel; +import org.scribble.visit.GTypeTranslator; + +public class GContinueDel extends ContinueDel + implements GSimpleSessionNodeDel +{ + + @Override + public org.scribble.core.type.session.global.GContinue translate(ScribNode n, + GTypeTranslator t) + { + GContinue source = (GContinue) n; + RecVar recvar = source.getRecVarChild().toName(); + return t.tf.global.GContinue(source, recvar); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/del/global/GDel.java b/scribble-ast/src/main/java/org/scribble/del/global/GDel.java new file mode 100644 index 000000000..8da532de3 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/global/GDel.java @@ -0,0 +1,24 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.global; + +import org.scribble.ast.ScribNode; +import org.scribble.core.lang.global.GNode; +import org.scribble.del.ScribDel; +import org.scribble.visit.GTypeTranslator; + +public interface GDel extends ScribDel +{ + GNode translate(ScribNode n, GTypeTranslator t); +} diff --git a/scribble-ast/src/main/java/org/scribble/del/global/GDelegationElemDel.java b/scribble-ast/src/main/java/org/scribble/del/global/GDelegationElemDel.java new file mode 100644 index 000000000..e9a36b49b --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/global/GDelegationElemDel.java @@ -0,0 +1,83 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.global; + +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +import org.scribble.ast.ProtoDecl; +import org.scribble.ast.ScribNode; +import org.scribble.ast.global.GDelegPayElem; +import org.scribble.ast.name.qualified.GProtoNameNode; +import org.scribble.ast.name.simple.IdNode; +import org.scribble.ast.name.simple.RoleNode; +import org.scribble.core.lang.context.ModuleContext; +import org.scribble.core.type.kind.Global; +import org.scribble.core.type.name.GProtoName; +import org.scribble.core.type.name.Role; +import org.scribble.del.ScribDelBase; +import org.scribble.util.ScribException; +import org.scribble.visit.NameDisambiguator; + +public class GDelegationElemDel extends ScribDelBase +{ + public GDelegationElemDel() + { + + } + + // Duplicated from DoDel + @Override + public void enterDisambiguation(ScribNode child, + NameDisambiguator disamb) throws ScribException + { + ModuleContext mc = disamb.getModuleContext(); + GDelegPayElem de = (GDelegPayElem) child; + GProtoNameNode proto = de.getProtocolChild(); + GProtoName gpn = proto.toName(); + if (!mc.isVisibleProtocolDeclName(gpn)) + { + throw new ScribException(proto.getSource(), + "Protocol decl not visible: " + gpn); + } + } + + // Duplicated from DoDel + //@Override + public GDelegPayElem visitForNameDisambiguation(NameDisambiguator disamb, // CHECKME: why "visitFor" pattern? + GDelegPayElem deleg) throws ScribException + { + ModuleContext mc = disamb.getModuleContext(); + GProtoNameNode proto = deleg.getProtocolChild(); + GProtoName fullname = (GProtoName) mc + .getVisibleProtocolDeclFullName(proto.toName()); + RoleNode r = deleg.getRoleChild(); + + Role rn = r.toName(); + ProtoDecl gpd = disamb.job.getContext() + .getModule(fullname.getPrefix()) + .getGProtocolDeclChild(fullname.getSimpleName()); + if (!gpd.getHeaderChild().getRoleDeclListChild().getRoles().contains(rn)) + { + throw new ScribException(r.getSource(), "Invalid delegation role: " + deleg); + } + List elems = Arrays.asList(fullname.getElements()).stream() + .map(x -> disamb.job.config.af.IdNode(null, x)).collect(Collectors.toList()); + GProtoNameNode pnn = (GProtoNameNode) disamb.job.config.af + .GProtoNameNode(proto.token, elems); + // Not keeping original namenode del + return deleg.reconstruct(pnn, r); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/del/global/GDisconnectDel.java b/scribble-ast/src/main/java/org/scribble/del/global/GDisconnectDel.java new file mode 100644 index 000000000..ed3ad5a36 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/global/GDisconnectDel.java @@ -0,0 +1,50 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.global; + +import org.scribble.ast.ScribNode; +import org.scribble.ast.global.GDisconnect; +import org.scribble.core.type.name.Role; +import org.scribble.del.ConnectionActionDel; +import org.scribble.util.ScribException; +import org.scribble.visit.GTypeTranslator; +import org.scribble.visit.NameDisambiguator; + +// TODO: make DisconnectDel (cf., G/LMessageTransferDel) +public class GDisconnectDel extends ConnectionActionDel + implements GSimpleSessionNodeDel +{ + public GDisconnectDel() + { + + } + + @Override + public ScribNode leaveDisambiguation(ScribNode child, + NameDisambiguator disamb, ScribNode visited) throws ScribException + { + GDisconnect gc = (GDisconnect) visited; + return gc; + } + + @Override + public org.scribble.core.type.session.global.GDisconnect translate(ScribNode n, + GTypeTranslator t) + { + GDisconnect source = (GDisconnect) n; + Role left = source.getLeftChild().toName(); + Role right = source.getRightChild().toName(); + return t.tf.global.GDisconnect(source, left, right); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/del/global/GDoDel.java b/scribble-ast/src/main/java/org/scribble/del/global/GDoDel.java new file mode 100644 index 000000000..804d8185c --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/global/GDoDel.java @@ -0,0 +1,52 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.global; + +import java.util.List; + +import org.scribble.ast.ScribNode; +import org.scribble.ast.global.GDo; +import org.scribble.core.lang.context.ModuleContext; +import org.scribble.core.type.kind.NonRoleParamKind; +import org.scribble.core.type.name.GProtoName; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Arg; +import org.scribble.del.DoDel; +import org.scribble.util.RuntimeScribException; +import org.scribble.visit.GTypeTranslator; + +public class GDoDel extends DoDel implements GSimpleSessionNodeDel +{ + @Override + public org.scribble.core.type.session.global.GDo translate(ScribNode n, + GTypeTranslator t) + { + GDo source = (GDo) n; + + // Resolve full name -- CHECKME: factor out? cf., NameDisambiguator, DoDel::enter/leaveDisambiguation + GProtoName proto = source.getProtocolNameNode().toName(); + ModuleContext modc = t.getModuleContext(); + if (!modc.isVisibleProtocolDeclName(proto)) // CHECKME: should be already checked by NameDisamb? + { + throw new RuntimeScribException(source, + "Protocol decl not visible: " + proto); + } + GProtoName fullname = (GProtoName) modc // FIXME: sort out full name expansion between here and DoDel.leaveDisambiguation + .getVisibleProtocolDeclFullName(proto); + List roles = source.getRoleListChild().getRoles(); + List> params = source.getNonRoleListChild() + .getParamKindArgs(); + return t.tf.global.GDo(source, fullname, roles, params); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/del/global/GInteractionSeqDel.java b/scribble-ast/src/main/java/org/scribble/del/global/GInteractionSeqDel.java new file mode 100644 index 000000000..d8357b925 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/global/GInteractionSeqDel.java @@ -0,0 +1,41 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.global; + +import java.util.LinkedList; +import java.util.List; + +import org.scribble.ast.ScribNode; +import org.scribble.ast.global.GInteractionSeq; +import org.scribble.ast.global.GSessionNode; +import org.scribble.core.type.session.global.GSeq; +import org.scribble.core.type.session.global.GType; +import org.scribble.del.InteractionSeqDel; +import org.scribble.visit.GTypeTranslator; + +public class GInteractionSeqDel extends InteractionSeqDel implements GDel +{ + + @Override + public GSeq translate(ScribNode n, GTypeTranslator t) + { + GInteractionSeq source = (GInteractionSeq) n; + List elems = new LinkedList<>(); + for (GSessionNode c : source.getInteractionChildren()) + { + elems.add((GType) c.visitWith(t)); // throws ScribbleException + } + return t.tf.global.GSeq(source, elems); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/del/global/GMessageTransferDel.java b/scribble-ast/src/main/java/org/scribble/del/global/GMessageTransferDel.java new file mode 100644 index 000000000..4027352e7 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/global/GMessageTransferDel.java @@ -0,0 +1,67 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.global; + +import java.util.List; + +import org.scribble.ast.ScribNode; +import org.scribble.ast.global.GMsgTransfer; +import org.scribble.ast.name.simple.RoleNode; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Msg; +import org.scribble.del.MsgTransferDel; +import org.scribble.util.ScribException; +import org.scribble.visit.GTypeTranslator; +import org.scribble.visit.NameDisambiguator; + +public class GMessageTransferDel extends MsgTransferDel + implements GSimpleSessionNodeDel +{ + public GMessageTransferDel() + { + + } + + @Override + public ScribNode leaveDisambiguation(ScribNode child, + NameDisambiguator disamb, ScribNode visited) throws ScribException + { + GMsgTransfer gmt = (GMsgTransfer) visited; + Role src = gmt.getSourceChild().toName(); + List dests = gmt.getDestinationRoles(); + if (dests.contains(src)) + { + throw new ScribException(gmt.getSource(), + "[TODO] Self connections not supported: " + gmt); // TODO: refactor to Job validation pass + // CHECKME: subsumed by unconnected check ? + } + return gmt; + } + + @Override + public org.scribble.core.type.session.global.GMessageTransfer translate(ScribNode n, + GTypeTranslator t) + { + GMsgTransfer source = (GMsgTransfer) n; + Role src = source.getSourceChild().toName(); + List ds = source.getDestinationChildren(); + if (ds.size() > 1) + { + throw new RuntimeException("[TODO] multiple destination roles: " + source); + } + Role dst = ds.get(0).toName(); + Msg msg = source.getMessageNodeChild().toMsg(); + return t.tf.global.GMessageTransfer(source, src, msg, dst); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/del/global/GProtoBlockDel.java b/scribble-ast/src/main/java/org/scribble/del/global/GProtoBlockDel.java new file mode 100644 index 000000000..2e1e63635 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/global/GProtoBlockDel.java @@ -0,0 +1,29 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.global; + +import org.scribble.ast.ScribNode; +import org.scribble.ast.global.GProtoBlock; +import org.scribble.core.type.session.global.GSeq; +import org.scribble.del.ProtoBlockDel; +import org.scribble.visit.GTypeTranslator; + +public class GProtoBlockDel extends ProtoBlockDel implements GDel +{ + @Override + public GSeq translate(ScribNode n, GTypeTranslator t) + { + return (GSeq) ((GProtoBlock) n).getInteractSeqChild().visitWith(t); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/del/global/GProtoDeclDel.java b/scribble-ast/src/main/java/org/scribble/del/global/GProtoDeclDel.java new file mode 100644 index 000000000..9f49389b3 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/global/GProtoDeclDel.java @@ -0,0 +1,55 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.global; + +import java.util.List; +import java.util.stream.Collectors; + +import org.scribble.ast.Module; +import org.scribble.ast.ScribNode; +import org.scribble.ast.global.GProtoDecl; +import org.scribble.core.lang.ProtoMod; +import org.scribble.core.lang.global.GProtocol; +import org.scribble.core.type.kind.Global; +import org.scribble.core.type.kind.NonRoleParamKind; +import org.scribble.core.type.name.GProtoName; +import org.scribble.core.type.name.MemberName; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.global.GSeq; +import org.scribble.del.ProtoDeclDel; +import org.scribble.visit.GTypeTranslator; + +public class GProtoDeclDel extends ProtoDeclDel implements GDel +{ + public GProtoDeclDel() + { + + } + + @Override + public GProtocol translate(ScribNode n, GTypeTranslator t) + { + GProtoDecl source = (GProtoDecl) n; + Module m = (Module) n.getParent(); + List mods = source.getModifierListChild().getModList().stream() + .map(x -> x.toProtoMod()).collect(Collectors.toList()); + GProtoName fullname = new GProtoName(m.getFullModuleName(), + source.getHeaderChild().getDeclName()); + List rs = source.getRoles(); + List> ps = source.getHeaderChild() + .getParamDeclListChild().getParams(); // CHECKME: make more uniform with source::getRoles ? + GSeq body = (GSeq) source.getDefChild().getBlockChild().visitWith(t); + return new GProtocol(source, mods, fullname, rs, ps, body); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/del/global/GProtoDefDel.java b/scribble-ast/src/main/java/org/scribble/del/global/GProtoDefDel.java new file mode 100644 index 000000000..fe0e0cc3a --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/global/GProtoDefDel.java @@ -0,0 +1,24 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.global; + +import org.scribble.del.ProtoDefDel; + +public class GProtoDefDel extends ProtoDefDel +{ + public GProtoDefDel() + { + + } +} diff --git a/scribble-ast/src/main/java/org/scribble/del/global/GRecursionDel.java b/scribble-ast/src/main/java/org/scribble/del/global/GRecursionDel.java new file mode 100644 index 000000000..caf874371 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/global/GRecursionDel.java @@ -0,0 +1,36 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.global; + +import org.scribble.ast.ScribNode; +import org.scribble.ast.global.GRecursion; +import org.scribble.core.type.name.RecVar; +import org.scribble.core.type.session.global.GSeq; +import org.scribble.del.RecursionDel; +import org.scribble.visit.GTypeTranslator; + +public class GRecursionDel extends RecursionDel + implements GCompoundSessionNodeDel +{ + + @Override + public org.scribble.core.type.session.global.GRecursion translate(ScribNode n, + GTypeTranslator t) + { + GRecursion source = (GRecursion) n; + RecVar recvar = source.getRecVarChild().toName(); + GSeq block = (GSeq) source.getBlockChild().visitWith(t); + return t.tf.global.GRecursion(source, recvar, block); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/del/global/GSessionNodeDel.java b/scribble-ast/src/main/java/org/scribble/del/global/GSessionNodeDel.java new file mode 100644 index 000000000..91556ec47 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/global/GSessionNodeDel.java @@ -0,0 +1,21 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.global; + +import org.scribble.del.SessionNodeDel; + +public interface GSessionNodeDel extends SessionNodeDel, GDel +{ + +} diff --git a/scribble-ast/src/main/java/org/scribble/del/global/GSimpleSessionNodeDel.java b/scribble-ast/src/main/java/org/scribble/del/global/GSimpleSessionNodeDel.java new file mode 100644 index 000000000..56098bbbd --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/global/GSimpleSessionNodeDel.java @@ -0,0 +1,19 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.global; + +public interface GSimpleSessionNodeDel extends GSessionNodeDel +{ + +} diff --git a/scribble-ast/src/main/java/org/scribble/del/global/GWrapDel.java b/scribble-ast/src/main/java/org/scribble/del/global/GWrapDel.java new file mode 100644 index 000000000..59b541314 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/global/GWrapDel.java @@ -0,0 +1,46 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.global; + +import org.scribble.ast.ScribNode; +import org.scribble.ast.global.GWrap; +import org.scribble.core.lang.global.GNode; +import org.scribble.del.BasicInteractionDel; +import org.scribble.util.ScribException; +import org.scribble.visit.GTypeTranslator; +import org.scribble.visit.NameDisambiguator; + +// TODO: make WrapDel (cf., G/LMessageTransferDel) +public class GWrapDel extends BasicInteractionDel //ConnectionActionDel + implements GSimpleSessionNodeDel +{ + public GWrapDel() + { + + } + + @Override + public ScribNode leaveDisambiguation(ScribNode child, + NameDisambiguator disamb, ScribNode visited) throws ScribException + { + GWrap gw = (GWrap) visited; + return gw; + } + + @Override + public GNode translate(ScribNode n, GTypeTranslator t) + { + throw new RuntimeException("[TODO] :" + n); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/del/local/LAccDel.java b/scribble-ast/src/main/java/org/scribble/del/local/LAccDel.java new file mode 100644 index 000000000..898ec5f11 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/local/LAccDel.java @@ -0,0 +1,36 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.local; + +public class LAccDel extends LConnectionActionDel +{ + /*@Override + public void enterProjectedChoiceSubjectFixing(ScribNode parent, + ScribNode child, ProjectedChoiceSubjectFixer fixer) + { + fixer.setChoiceSubject(((LAcc) child).src.toName()); + } + + @Override + public void enterUnguardedChoiceDoProjectionCheck(ScribNode parent, + ScribNode child, UnguardedChoiceDoProjectionChecker checker) + throws ScribException + { + super.enterUnguardedChoiceDoProjectionCheck(parent, child, checker); + LAcc la = (LAcc) child; + UnguardedChoiceDoEnv env = checker.popEnv(); + env = env.setChoiceSubject(la.getSourceChild().toName()); + checker.pushEnv(env); + }*/ +} diff --git a/scribble-ast/src/main/java/org/scribble/del/local/LChoiceDel.java b/scribble-ast/src/main/java/org/scribble/del/local/LChoiceDel.java new file mode 100644 index 000000000..e9649fd4b --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/local/LChoiceDel.java @@ -0,0 +1,93 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.local; + +import org.scribble.del.ChoiceDel; + +public class LChoiceDel extends ChoiceDel implements LCompoundSessionNodeDel +{ + /*@Override + public ScribNode leaveUnguardedChoiceDoProjectionCheck(ScribNode parent, + ScribNode child, UnguardedChoiceDoProjectionChecker checker, + ScribNode visited) throws ScribException + { + Choice cho = (Choice) visited; + List benvs = cho.getBlocks().stream() + .map((b) -> (UnguardedChoiceDoEnv) b.del().env()) + .collect(Collectors.toList()); + UnguardedChoiceDoEnv merged = checker.popEnv().mergeContexts(benvs); + checker.pushEnv(merged); + return (Choice) super.leaveUnguardedChoiceDoProjectionCheck(parent, + child, checker, cho); + // Done merge of children here, super does merge into parent + } + + @Override + public ScribNode leaveProjectedChoiceDoPruning(ScribNode parent, + ScribNode child, ProjectedChoiceDoPruner pruner, ScribNode visited) + throws ScribException + { + LChoice lc = (LChoice) visited; + List blocks = lc.getBlocks().stream() + .filter(b -> !b.isEmpty()).collect(Collectors.toList()); + if (blocks.isEmpty()) + { + return null; + } + return lc.reconstruct(lc.subj, blocks); + } + + @Override + public ScribNode leaveProjectedChoiceSubjectFixing(ScribNode parent, + ScribNode child, ProjectedChoiceSubjectFixer fixer, ScribNode visited) + throws ScribException + { + LChoice lc = (LChoice) visited; + List blocks = lc.getBlocks(); + + Set subjs = blocks.stream() + .map((b) -> b.getInteractionSeq().getInteractions().get(0).inferLocalChoiceSubject(fixer)) + //.filter((r) -> !r.toString().equals(DummyProjectionRoleNode.DUMMY_PROJECTION_ROLE)) + .collect(Collectors.toSet()); + if (subjs.size() == 0) + { + //throw new RuntimeScribException("TODO: unable to infer projection subject: " + parent); + throw new RuntimeException("Shouldn't get in here: " + subjs); // FIXME: should be OK now by model-based WF + } + else + { + subjs = subjs.stream() + .map((r) -> fixer.isRecVarRole(r) + ? fixer.getChoiceSubject(new RecVar(r.toString())) : r) // Never needed? + .collect(Collectors.toSet()); + } + + // HACK? (for non- role-balanced choice cases) + subjs = subjs.stream().filter((s) -> s != null).collect(Collectors.toSet()); + + if (subjs.size() > 1) // Unnecessary: due to WF check in GChoiceDel.leaveInlinedPathCollection -- would be better as a check on locals than in projection anyway + { + String self = fixer.getModuleContext().root.getSimpleName().toString(); // HACK + self = self.substring(self.lastIndexOf('_')+1, self.length()); // FIXME: not sound (if role names include "_") + throw new ScribException(lc.getSource(), "Cannot project onto " + self + " due to inconsistent local choice subjects: " + subjs); // self not recorded -- can derive from LProtocolDecl RoleDeclList + //throw new RuntimeException("Shouldn't get in here: " + subjs); + } + RoleNode subj = (RoleNode) fixer.job.af.SimpleNameNode(null, RoleKind.KIND, // FIXME? null source OK? + //blocks.get(0).getInteractionSeq().getInteractions().get(0).inferLocalChoiceSubject(fixer).toString()); + subjs.iterator().next().toString()); + fixer.setChoiceSubject(subj.toName()); + LChoice projection = fixer.job.af.LChoice(lc.getSource(), subj, blocks); + return projection; + }*/ +} diff --git a/scribble-ast/src/main/java/org/scribble/del/local/LClientWrapDel.java b/scribble-ast/src/main/java/org/scribble/del/local/LClientWrapDel.java new file mode 100644 index 000000000..2caa1fa05 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/local/LClientWrapDel.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.local; + +import org.scribble.del.BasicInteractionDel; + +public class LClientWrapDel extends BasicInteractionDel // LWrapDel + implements LSimpleSessionNodeDel +{ + /*@Override + public void enterProjectedChoiceSubjectFixing(ScribNode parent, + ScribNode child, ProjectedChoiceSubjectFixer fixer) + { + fixer.setChoiceSubject(((LClientWrap) child).getClientChild().toName()); + }*/ +} diff --git a/scribble-ast/src/main/java/org/scribble/del/local/LCompoundSessionNodeDel.java b/scribble-ast/src/main/java/org/scribble/del/local/LCompoundSessionNodeDel.java new file mode 100644 index 000000000..842703aa7 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/local/LCompoundSessionNodeDel.java @@ -0,0 +1,19 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.local; + +public interface LCompoundSessionNodeDel extends LSessionNodeDel +{ + +} diff --git a/scribble-ast/src/main/java/org/scribble/del/local/LConnectionActionDel.java b/scribble-ast/src/main/java/org/scribble/del/local/LConnectionActionDel.java new file mode 100644 index 000000000..2d78eebc1 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/local/LConnectionActionDel.java @@ -0,0 +1,22 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.local; + +import org.scribble.del.ConnectionActionDel; + +public abstract class LConnectionActionDel extends ConnectionActionDel + implements LSimpleSessionNodeDel +{ + +} diff --git a/scribble-ast/src/main/java/org/scribble/del/local/LContinueDel.java b/scribble-ast/src/main/java/org/scribble/del/local/LContinueDel.java new file mode 100644 index 000000000..b278e2893 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/local/LContinueDel.java @@ -0,0 +1,21 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.local; + +import org.scribble.del.ContinueDel; + +public class LContinueDel extends ContinueDel implements LSimpleSessionNodeDel +{ + +} diff --git a/scribble-ast/src/main/java/org/scribble/del/local/LDel.java b/scribble-ast/src/main/java/org/scribble/del/local/LDel.java new file mode 100644 index 000000000..596e1937f --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/local/LDel.java @@ -0,0 +1,21 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.local; + +import org.scribble.del.ScribDel; + +public interface LDel extends ScribDel +{ + +} diff --git a/scribble-ast/src/main/java/org/scribble/del/local/LDisconnectDel.java b/scribble-ast/src/main/java/org/scribble/del/local/LDisconnectDel.java new file mode 100644 index 000000000..1f7236070 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/local/LDisconnectDel.java @@ -0,0 +1,35 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.local; + +import org.scribble.del.ConnectionActionDel; + +public class LDisconnectDel extends ConnectionActionDel + implements LSimpleSessionNodeDel +{ + /*@Override + public LDisconnect leaveEGraphBuilding(ScribNode parent, ScribNode child, EGraphBuilder builder, ScribNode visited) throws ScribbleException + { + LDisconnect ld = (LDisconnect) visited; + Role peer = ld.peer.toName(); + builder.util.addEdge(builder.util.getEntry(), builder.job.ef.newEDisconnect(peer), builder.util.getExit()); + return (LDisconnect) super.leaveEGraphBuilding(parent, child, builder, ld); + } + + @Override + public void enterProjectedChoiceSubjectFixing(ScribNode parent, ScribNode child, ProjectedChoiceSubjectFixer fixer) + { + fixer.setChoiceSubject(((LDisconnect) child).src.toName()); + }*/ +} diff --git a/scribble-ast/src/main/java/org/scribble/del/local/LDoDel.java b/scribble-ast/src/main/java/org/scribble/del/local/LDoDel.java new file mode 100644 index 000000000..124f30c30 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/local/LDoDel.java @@ -0,0 +1,85 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.local; + +import org.scribble.del.DoDel; + +public class LDoDel extends DoDel implements LSimpleSessionNodeDel +{ + /*// Pre: this pass is only run on projections (LProjectionDeclDel has source global protocol info) + @Override + public ScribNode leaveProjectedRoleDeclFixing(ScribNode parent, + ScribNode child, ProjectedRoleDeclFixer fixer, ScribNode visited) + throws ScribException + { + JobContext jc = fixer.job.getContext(); + LDo ld = (LDo) visited; + LProtoDecl lpd = ld.getTargetProtoDecl(jc, fixer.getModuleContext()); + + // do role args are currently as inherited from the global type -- so need to derive role map against the global protocol header + // Doing it off the global roledecls allows this to be done in one pass, but would probably be easier to split into two (e.g. 1st cache the proposed changes, 2nd write all changes -- the problem with a single pass is e.g. looking up the localdecl info while localdecls are being rewritten during the pass) + // Could possibly factor out rolemap making with SubprotocolVisitor a bit, but there it maps to RoleNode and works off a root map + GProtoName source = ((LProjectionDeclDel) lpd.del()).getSourceProto(); + GProtoDecl gpd = (GProtoDecl) jc.getModule(source.getPrefix()).getProtoDecl(source.getSimpleName()); + Iterator roleargs = ld.roles.getDoArgs().iterator(); + Map rolemap = gpd.header.roledecls.getRoles().stream().collect( + Collectors.toMap(r -> r, r -> roleargs.next().val.toName())); + Set occs = ((LProtoDeclDel) lpd.del()).getProtoDeclContext().getRoleOccurrences().stream().map(r -> + rolemap.get(r)).collect(Collectors.toSet()); + + List ras = ld.roles.getDoArgs().stream().filter(ra -> occs.contains(ra.val.toName())).collect(Collectors.toList()); + RoleArgList roles = ld.roles.reconstruct(ras); + return super.leaveProjectedRoleDeclFixing(parent, child, fixer, ld.reconstruct(roles, ld.args, ld.getProtoNameNode())); + } + + @Override + public ScribNode leaveUnguardedChoiceDoProjectionCheck(ScribNode parent, ScribNode child, UnguardedChoiceDoProjectionChecker checker, ScribNode visited) throws ScribException + { + /* //if (checker.isCycle()) + if (checker.isRootedCycle()) // ChoiceUnguardedSubprotocolChecker is a (regular) SubprotocolVisitor which pushes a subprotosig on root decl entry (ProjectedSubprotocolPruner.visit) + // Check for "rooted" cycle to ensure it's specifically the cycle from the root proto decl (back) to the target do + // FIXME: but cycle to specific "target do" is not ensured: could be another instance of a do with the same subprotosig... an inherent issue of the current subprotocolvisitor framework + + // FIXME: this algorithm works for some use cases for is still wrong (prunes some that it shouldn't -- e.g. mutually pruneable choice-unguarded do's) + // *** what we really need is to check for 0 inferred choice subjects up to recursion back (if any) to to the parent choice -- problem is current framework doesn't make identifying (e.g. ==) the original choice easy *** + // the issue is arising since WF was relaxed to allow unbalanced choice case roles: with balanced, subject inference is always fine as long as roles are used? (and prev assumed no choice-unguarded do's?) + { + //System.out.println("ABC: " + checker.peekEnv().subjs + ", " + checker.SHOULD_PRUNE); + + //if (checker.peekEnv().shouldPrune()) + if (checker.peekEnv().subjs.isEmpty()) + { + /*ChoiceUnguardedSubprotocolEnv env = checker.popEnv(); + checker.pushEnv(env.disablePrune());* / + //checker.enablePrune(); + } + }* / + return super.leaveUnguardedChoiceDoProjectionCheck(parent, child, checker, visited); + + + // for each do: check shouldPrune condition by following the control flow: if terminates or cycles with no actions then prune + // Let the main pruning visitor be a regular visitor, and use the subprotocol visitor to follow the calls for pruning analysis + + //FIXME: maybe similar to project roledecl fixing? use role occurrences saved in protocoldecl? + // role occurrences collected by RoleCollector which is indeed subprotocol visitor + // problem is RoleCollector currently comes after subject fixing... but maybe it doesn't need to collect subject roles in the end? due to WF enabling checks? + + //..not role collection, that's a "may" usage of roles + //..should be: start from a candidate unguarded-do inside a choice: want to know if this choice case should be removed + //......follow protocol flow through do until either end or return to this choice, looking for actions + // ... but look only on direct path or across all branches? + + //...or else it should be: start from the target protocoldecl and go through to the candidate do (cf grecursion.prune) + }*/ +} diff --git a/scribble-ast/src/main/java/org/scribble/del/local/LInteractionSeqDel.java b/scribble-ast/src/main/java/org/scribble/del/local/LInteractionSeqDel.java new file mode 100644 index 000000000..0a63dc5b3 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/local/LInteractionSeqDel.java @@ -0,0 +1,44 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.local; + +import org.scribble.del.InteractionSeqDel; + +public class LInteractionSeqDel extends InteractionSeqDel implements LDel +{ + /*@Override + public ScribNode leaveProjectedChoiceDoPruning(ScribNode parent, + ScribNode child, ProjectedChoiceDoPruner pruner, ScribNode visited) + throws ScribException + { + LInteractionSeq lc = (LInteractionSeq) visited; + List actions = lc.getInteractionChildren().stream() + .filter(li -> li != null).collect(Collectors.toList()); + return lc.reconstruct(actions); + }*/ + + /*// Duplicated from GInteractionSeq + @Override + public LInteractionSeq leaveRecRemoval(ScribNode parent, ScribNode child, RecRemover rem, ScribNode visited) + throws ScribException + { + LInteractionSeq lis = (LInteractionSeq) visited; + List lins = lis.getInteractions().stream().flatMap((li) -> + (li instanceof LRecursion && rem.toRemove(((LRecursion) li).recvar.toName())) + ? ((LRecursion) li).getBlock().getInteractionSeq().getInteractions().stream() + : Stream.of(li) + ).collect(Collectors.toList()); + return rem.job.af.LInteractionSeq(lis.getSource(), lins); + }*/ +} diff --git a/scribble-ast/src/main/java/org/scribble/del/local/LMsgTransferDel.java b/scribble-ast/src/main/java/org/scribble/del/local/LMsgTransferDel.java new file mode 100644 index 000000000..cc94f4a02 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/local/LMsgTransferDel.java @@ -0,0 +1,22 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.local; + +import org.scribble.del.MsgTransferDel; + +public abstract class LMsgTransferDel extends MsgTransferDel + implements LSimpleSessionNodeDel +{ + +} diff --git a/scribble-ast/src/main/java/org/scribble/del/local/LProjectionDeclDel.java b/scribble-ast/src/main/java/org/scribble/del/local/LProjectionDeclDel.java new file mode 100644 index 000000000..7e7aac52b --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/local/LProjectionDeclDel.java @@ -0,0 +1,47 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.local; + +public class LProjectionDeclDel extends LProtoDeclDel +{ + public LProjectionDeclDel() + { + + } + + /*@Override + public ScribNode leaveProjectedRoleDeclFixing(ScribNode parent, + ScribNode child, ProjectedRoleDeclFixer fixer, ScribNode visited) + throws ScribException + { + LProjectionDecl lpd = (LProjectionDecl) visited; + LProtoHeader hdrtmp = lpd.getHeaderChild(); + // FIXME: ensure all role params are used, to avoid empty roledecllist + Set occs = ((LProtoDeclDel) lpd.del()).getProtoDeclContext() + .getRoleOccurrences(); + List rds = hdrtmp.getRoleDeclListChild().getDeclChildren() + .stream().filter(rd -> occs.contains(rd.getDeclName())) + .collect(Collectors.toList()); + RoleDeclList rdl = fixer.job.af + .RoleDeclList(hdrtmp.getRoleDeclListChild().getSource(), rds); + LProtoHeader hdr = (LProtoHeader) hdrtmp.reconstruct(hdrtmp.getNameNodeChild(), + hdrtmp.getParamDeclListChild(), rdl); + LProjectionDecl fixed = (LProjectionDecl) lpd.reconstruct(lpd.getModifierListChild(), hdr, lpd.getDefChild()); + + fixer.job.debugPrintln("\n[DEBUG] Projected " + lpd//.getParentChild() + + " for " + lpd.getSelfRole() + ":\n" + fixed); + + return super.leaveProjectedRoleDeclFixing(parent, child, fixer, fixed); + }*/ +} diff --git a/scribble-ast/src/main/java/org/scribble/del/local/LProtoBlockDel.java b/scribble-ast/src/main/java/org/scribble/del/local/LProtoBlockDel.java new file mode 100644 index 000000000..e4481aaaf --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/local/LProtoBlockDel.java @@ -0,0 +1,21 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.local; + +import org.scribble.del.ProtoBlockDel; + +public class LProtoBlockDel extends ProtoBlockDel implements LDel +{ + +} diff --git a/scribble-ast/src/main/java/org/scribble/del/local/LProtoDeclDel.java b/scribble-ast/src/main/java/org/scribble/del/local/LProtoDeclDel.java new file mode 100644 index 000000000..f6240f0fe --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/local/LProtoDeclDel.java @@ -0,0 +1,25 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.local; + +import org.scribble.core.type.kind.Local; +import org.scribble.del.ProtoDeclDel; + +public class LProtoDeclDel extends ProtoDeclDel +{ + public LProtoDeclDel() + { + + } +} diff --git a/scribble-ast/src/main/java/org/scribble/del/local/LProtoDefDel.java b/scribble-ast/src/main/java/org/scribble/del/local/LProtoDefDel.java new file mode 100644 index 000000000..3fe77f1a2 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/local/LProtoDefDel.java @@ -0,0 +1,24 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.local; + +import org.scribble.del.ProtoDefDel; + +public class LProtoDefDel extends ProtoDefDel +{ + public LProtoDefDel() + { + + } +} diff --git a/scribble-ast/src/main/java/org/scribble/del/local/LRecursionDel.java b/scribble-ast/src/main/java/org/scribble/del/local/LRecursionDel.java new file mode 100644 index 000000000..0ca64ccd7 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/local/LRecursionDel.java @@ -0,0 +1,48 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.local; + +import org.scribble.del.RecursionDel; + +public class LRecursionDel extends RecursionDel + implements LCompoundSessionNodeDel +{ + /*@Override + public ScribNode leaveUnguardedChoiceDoProjectionCheck(ScribNode parent, + ScribNode child, UnguardedChoiceDoProjectionChecker checker, + ScribNode visited) throws ScribException + { + Recursion rec = (Recursion) visited; + UnguardedChoiceDoEnv merged = checker.popEnv() + .mergeContext((UnguardedChoiceDoEnv) rec.getBlockChild().del().env()); + checker.pushEnv(merged); + return (Recursion) super.leaveUnguardedChoiceDoProjectionCheck(parent, + child, checker, rec); + } + + @Override + public void enterProjectedChoiceSubjectFixing(ScribNode parent, + ScribNode child, ProjectedChoiceSubjectFixer fixer) + { + fixer.pushRec(((LRecursion) child).getRecVarChild.toName()); + } + + @Override + public ScribNode leaveProjectedChoiceSubjectFixing(ScribNode parent, + ScribNode child, ProjectedChoiceSubjectFixer fixer, ScribNode visited) + { + fixer.popRec(((LRecursion) child).getRecVarChild().toName()); + return visited; + }*/ +} diff --git a/scribble-ast/src/main/java/org/scribble/del/local/LRecvDel.java b/scribble-ast/src/main/java/org/scribble/del/local/LRecvDel.java new file mode 100644 index 000000000..cd6b6786d --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/local/LRecvDel.java @@ -0,0 +1,36 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.local; + +public class LRecvDel extends LMsgTransferDel +{ + /*@Override + public void enterProjectedChoiceSubjectFixing(ScribNode parent, + ScribNode child, ProjectedChoiceSubjectFixer fixer) + { + fixer.setChoiceSubject(((LRecv) child).src.toName()); + } + + @Override + public void enterUnguardedChoiceDoProjectionCheck(ScribNode parent, + ScribNode child, UnguardedChoiceDoProjectionChecker checker) + throws ScribException + { + super.enterUnguardedChoiceDoProjectionCheck(parent, child, checker); + LRecv lr = (LRecv) child; + UnguardedChoiceDoEnv env = checker.popEnv(); + env = env.setChoiceSubject(lr.getSourceChild().toName()); + checker.pushEnv(env); + }*/ +} diff --git a/scribble-ast/src/main/java/org/scribble/del/local/LReqDel.java b/scribble-ast/src/main/java/org/scribble/del/local/LReqDel.java new file mode 100644 index 000000000..6980bf896 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/local/LReqDel.java @@ -0,0 +1,24 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.local; + +public class LReqDel extends LConnectionActionDel +{ + /*@Override + public void enterProjectedChoiceSubjectFixing(ScribNode parent, + ScribNode child, ProjectedChoiceSubjectFixer fixer) + { + fixer.setChoiceSubject(((LReq) child).getSourceChild().toName()); + }*/ +} diff --git a/scribble-ast/src/main/java/org/scribble/del/local/LSendDel.java b/scribble-ast/src/main/java/org/scribble/del/local/LSendDel.java new file mode 100644 index 000000000..072411970 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/local/LSendDel.java @@ -0,0 +1,35 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.local; + +public class LSendDel extends LMsgTransferDel +{ + /*// Could make a LMsgTransferDel to factor this out with LReceiveDel + @Override + public void enterProjectedChoiceSubjectFixing(ScribNode parent, + ScribNode child, ProjectedChoiceSubjectFixer fixer) + { + fixer.setChoiceSubject(((LSend) child).src.toName()); + } + + @Override + public LMsgTransfer leaveExplicitCorrelationCheck(ScribNode parent, + ScribNode child, ExplicitCorrelationChecker checker, ScribNode visited) + throws ScribException + { + LMsgTransfer lmt = (LMsgTransfer) visited; + checker.pushEnv(checker.popEnv().disableAccept()); + return lmt; + }*/ +} diff --git a/scribble-ast/src/main/java/org/scribble/del/local/LServerWrapDel.java b/scribble-ast/src/main/java/org/scribble/del/local/LServerWrapDel.java new file mode 100644 index 000000000..51cd0ca95 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/local/LServerWrapDel.java @@ -0,0 +1,40 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.local; + +import org.scribble.del.BasicInteractionDel; + +public class LServerWrapDel extends BasicInteractionDel // LWrapDel + implements LSimpleSessionNodeDel +{ + + /*@Override + public void enterProjectedChoiceSubjectFixing(ScribNode parent, + ScribNode child, ProjectedChoiceSubjectFixer fixer) + { + fixer.setChoiceSubject(((LServerWrap) child).getClientChild().toName()); + } + + @Override + public void enterUnguardedChoiceDoProjectionCheck(ScribNode parent, + ScribNode child, UnguardedChoiceDoProjectionChecker checker) + throws ScribException + { + super.enterUnguardedChoiceDoProjectionCheck(parent, child, checker); + LServerWrap la = (LServerWrap) child; + UnguardedChoiceDoEnv env = checker.popEnv(); + env = env.setChoiceSubject(la.getClientChild().toName()); + checker.pushEnv(env); + }*/ +} diff --git a/scribble-ast/src/main/java/org/scribble/del/local/LSessionNodeDel.java b/scribble-ast/src/main/java/org/scribble/del/local/LSessionNodeDel.java new file mode 100644 index 000000000..1c379a4d3 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/local/LSessionNodeDel.java @@ -0,0 +1,21 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.local; + +import org.scribble.del.SessionNodeDel; + +public interface LSessionNodeDel extends SessionNodeDel, LDel +{ + +} diff --git a/scribble-ast/src/main/java/org/scribble/del/local/LSimpleSessionNodeDel.java b/scribble-ast/src/main/java/org/scribble/del/local/LSimpleSessionNodeDel.java new file mode 100644 index 000000000..df94d5c19 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/local/LSimpleSessionNodeDel.java @@ -0,0 +1,19 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.local; + +public interface LSimpleSessionNodeDel extends LSessionNodeDel +{ + +} diff --git a/scribble-ast/src/main/java/org/scribble/del/name/qualified/DataNameNodeDel.java b/scribble-ast/src/main/java/org/scribble/del/name/qualified/DataNameNodeDel.java new file mode 100644 index 000000000..d70a3f467 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/name/qualified/DataNameNodeDel.java @@ -0,0 +1,64 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.name.qualified; + +import org.antlr.runtime.CommonToken; +import org.scribble.ast.DataDecl; +import org.scribble.ast.ScribNode; +import org.scribble.ast.name.qualified.DataNameNode; +import org.scribble.ast.name.simple.IdNode; +import org.scribble.core.lang.context.ModuleContext; +import org.scribble.core.type.name.DataName; +import org.scribble.del.ScribDelBase; +import org.scribble.util.ScribException; +import org.scribble.visit.NameDisambiguator; + +public class DataNameNodeDel extends ScribDelBase +{ + public DataNameNodeDel() + { + + } + + // Is this needed? Or DataTypeNodes always created from AmbigNameNode? (in this same pass) + @Override + public ScribNode leaveDisambiguation(ScribNode child, + NameDisambiguator disamb, ScribNode visited) throws ScribException + { + ScribNode parent = child.getParent(); + if (parent instanceof DataDecl) // Hacky? don't want to do for decl simplenames (generally, don't do if parent is namedeclnode) + { + return visited; + } + ModuleContext mc = disamb.getModuleContext(); + DataNameNode dtn = (DataNameNode) visited; + DataName dt = dtn.toName(); + if (!mc.isVisibleDataType(dt)) + { + throw new ScribException(dtn.getSource(), + "Data type not visible: " + dt); + } + DataName fullname = mc.getVisibleDataTypeFullName(dt); + /*return (DataTypeNode) disamb.job.config.af.QualifiedNameNode( + dtn.getSource(), DataTypeKind.KIND, fullname.getElements());*/ + DataNameNode res = new DataNameNode(dtn.token); + for (String e : fullname.getElements()) + { + IdNode n = new IdNode(new CommonToken(23, e)); // FIXME TODO: refactor ast into parser module to access token type constants + res.addChild(n); + } + return res; + // Don't keep original del (so not using clone) + } +} diff --git a/scribble-ast/src/main/java/org/scribble/del/name/qualified/SigNameNodeDel.java b/scribble-ast/src/main/java/org/scribble/del/name/qualified/SigNameNodeDel.java new file mode 100644 index 000000000..a2d73456c --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/name/qualified/SigNameNodeDel.java @@ -0,0 +1,59 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.name.qualified; + +import org.antlr.runtime.CommonToken; +import org.scribble.ast.SigDecl; +import org.scribble.ast.ScribNode; +import org.scribble.ast.name.qualified.SigNameNode; +import org.scribble.ast.name.simple.IdNode; +import org.scribble.core.lang.context.ModuleContext; +import org.scribble.core.type.name.SigName; +import org.scribble.del.ScribDelBase; +import org.scribble.util.ScribException; +import org.scribble.visit.NameDisambiguator; + +public class SigNameNodeDel extends ScribDelBase +{ + public SigNameNodeDel() + { + + } + + // Is this needed? Or DataTypeNodes always created from AmbigNameNode? (in this same pass) + @Override + public ScribNode leaveDisambiguation(ScribNode child, + NameDisambiguator disamb, ScribNode visited) throws ScribException + { + ScribNode parent = child.getParent(); + if (parent instanceof SigDecl) // Hacky? don't want to do for decl simplenames (generally, don't do if parent is namedeclnode) + { + return visited; + } + ModuleContext mc = disamb.getModuleContext(); + SigNameNode msnn = (SigNameNode) visited; + SigName fullname = + mc.getVisibleMessageSigNameFullName(msnn.toName()); + /*return (MessageSigNameNode) disamb.job.config.af.QualifiedNameNode( + msnn.getSource(), SigKind.KIND, fullname.getElements());*/ + SigNameNode res = new SigNameNode(msnn.token); + for (String e : fullname.getElements()) + { + IdNode n = new IdNode(new CommonToken(23, e)); // FIXME TODO: refactor ast into parser module to access token type constants + res.addChild(n); + } + return res; + // Don't keep original del (so not using clone) + } +} diff --git a/scribble-ast/src/main/java/org/scribble/del/name/simple/AmbigNameNodeDel.java b/scribble-ast/src/main/java/org/scribble/del/name/simple/AmbigNameNodeDel.java new file mode 100644 index 000000000..180ac5bc4 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/name/simple/AmbigNameNodeDel.java @@ -0,0 +1,86 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.name.simple; + +import java.util.List; +import java.util.stream.Collectors; + +import org.scribble.ast.MsgTransfer; +import org.scribble.ast.PayElem; +import org.scribble.ast.ScribNode; +import org.scribble.ast.name.simple.AmbigNameNode; +import org.scribble.ast.name.simple.IdNode; +import org.scribble.core.lang.context.ModuleContext; +import org.scribble.core.type.kind.DataKind; +import org.scribble.core.type.kind.NonRoleParamKind; +import org.scribble.core.type.name.AmbigName; +import org.scribble.del.ScribDelBase; +import org.scribble.util.ScribException; +import org.scribble.visit.NameDisambiguator; + +public class AmbigNameNodeDel extends ScribDelBase +{ + public AmbigNameNodeDel() + { + + } + + @Override + public ScribNode leaveDisambiguation(ScribNode child, + NameDisambiguator disamb, ScribNode visited) throws ScribException + { + ScribNode parent = child.getParent(); + ModuleContext modc = disamb.getModuleContext(); + AmbigNameNode a = (AmbigNameNode) visited; + AmbigName name = a.toName(); + // By well-formedness (checked later), payload type and parameter names are distinct + // CHECKME: are conflicts checked elsewhere? -- ? + if (modc.isDataTypeVisible(name.toDataName())) + { + // CHECKME HACK: MsgTransfer assumes MessageNode (cast in visitChildren), so this needs to be caught here + // CHECKME: any other similar cases? + if (parent instanceof MsgTransfer) + { + throw new ScribException(a.getSource(), + "Invalid occurrence of data name: " + parent); + } + List elems = a.getElements().stream() + .map(x -> disamb.job.config.af.IdNode(null, x)) + .collect(Collectors.toList()); + return disamb.job.config.af.DataNameNode(a.token, elems); + } + else if (modc.isMessageSigNameVisible(name.toSigName())) + { + if (parent instanceof PayElem) // FIXME HACK + { + throw new ScribException(a.getSource(), + "Invalid occurrence of message signature name: " + parent); + } + List elems = a.getElements().stream() + .map(x -> disamb.job.config.af.IdNode(null, x)) + .collect(Collectors.toList()); + return disamb.job.config.af.SigNameNode(a.token, elems); + } + else if (disamb.isBoundParam(name)) + { + NonRoleParamKind kind = disamb.getParamKind(name); + return kind.equals(DataKind.KIND) + ? disamb.job.config.af.DataParamNode(a.token, a.getText()) + // else if(kind.equals(SigKind.KIND)) + : disamb.job.config.af.SigParamNode(a.token, a.getText()); + } + throw new ScribException(a.getSource(), + "Cannot disambiguate name: " + name); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/del/name/simple/NonRoleParamNodeDel.java b/scribble-ast/src/main/java/org/scribble/del/name/simple/NonRoleParamNodeDel.java new file mode 100644 index 000000000..e644452b5 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/name/simple/NonRoleParamNodeDel.java @@ -0,0 +1,24 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.name.simple; + +import org.scribble.del.ScribDelBase; + +public class NonRoleParamNodeDel extends ScribDelBase +{ + public NonRoleParamNodeDel() + { + + } +} diff --git a/scribble-ast/src/main/java/org/scribble/del/name/simple/RecVarNodeDel.java b/scribble-ast/src/main/java/org/scribble/del/name/simple/RecVarNodeDel.java new file mode 100644 index 000000000..8cbad895f --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/name/simple/RecVarNodeDel.java @@ -0,0 +1,44 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.name.simple; + +import org.scribble.ast.ScribNode; +import org.scribble.ast.name.simple.RecVarNode; +import org.scribble.core.type.name.RecVar; +import org.scribble.del.ScribDelBase; +import org.scribble.util.ScribException; +import org.scribble.visit.NameDisambiguator; + +public class RecVarNodeDel extends ScribDelBase +{ + public RecVarNodeDel() + { + + } + + @Override + public RecVarNode leaveDisambiguation(ScribNode child, + NameDisambiguator disamb, ScribNode visited) throws ScribException + { + // Consistent with bound RoleNode checking + RecVarNode rn = (RecVarNode) visited; + RecVar rv = rn.toName(); + if (!disamb.isBoundRecVar(rv)) + { + throw new ScribException(rn.getSource(), + "Rec variable not bound: " + rn); + } + return (RecVarNode) super.leaveDisambiguation(child, disamb, rn); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/del/name/simple/RoleNodeDel.java b/scribble-ast/src/main/java/org/scribble/del/name/simple/RoleNodeDel.java new file mode 100644 index 000000000..e96b27f1e --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/del/name/simple/RoleNodeDel.java @@ -0,0 +1,40 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del.name.simple; + +import org.scribble.ast.ScribNode; +import org.scribble.ast.name.simple.RoleNode; +import org.scribble.del.ScribDelBase; +import org.scribble.util.ScribException; +import org.scribble.visit.NameDisambiguator; + +public class RoleNodeDel extends ScribDelBase +{ + public RoleNodeDel() + { + + } + + @Override + public RoleNode leaveDisambiguation(ScribNode child, NameDisambiguator disamb, + ScribNode visited) throws ScribException + { + RoleNode rn = (RoleNode) visited; + if (!disamb.isBoundRole(rn.toName())) // Added on RoleDecl entry + { + throw new ScribException(rn.getSource(), "Role not bound: " + rn); + } + return rn; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/job/Job.java b/scribble-ast/src/main/java/org/scribble/job/Job.java new file mode 100644 index 000000000..153b7fbcc --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/job/Job.java @@ -0,0 +1,293 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.job; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedHashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +import org.scribble.ast.AstFactory; +import org.scribble.ast.ImportDecl; +import org.scribble.ast.Module; +import org.scribble.ast.ModuleDecl; +import org.scribble.ast.NonProtoDecl; +import org.scribble.ast.global.GProtoDecl; +import org.scribble.ast.local.LProjectionDecl; +import org.scribble.ast.name.qualified.ModuleNameNode; +import org.scribble.ast.name.simple.IdNode; +import org.scribble.core.job.Core; +import org.scribble.core.job.CoreArgs; +import org.scribble.core.lang.global.GProtocol; +import org.scribble.core.lang.local.LProjection; +import org.scribble.core.type.kind.DataKind; +import org.scribble.core.type.kind.Kind; +import org.scribble.core.type.kind.Local; +import org.scribble.core.type.kind.SigKind; +import org.scribble.core.type.name.DataName; +import org.scribble.core.type.name.GProtoName; +import org.scribble.core.type.name.MemberName; +import org.scribble.core.type.name.ModuleName; +import org.scribble.core.type.name.ProtoName; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.name.SigName; +import org.scribble.core.type.session.STypeFactory; +import org.scribble.core.type.session.global.GTypeFactoryImpl; +import org.scribble.core.type.session.local.LSeq; +import org.scribble.core.type.session.local.LTypeFactoryImpl; +import org.scribble.core.visit.gather.NonProtoDepsGatherer; +import org.scribble.core.visit.gather.ProtoDepsCollector; +import org.scribble.del.DelFactory; +import org.scribble.util.LProjectionTranslator; +import org.scribble.util.ScribException; +import org.scribble.visit.AstVisitor; +import org.scribble.visit.GTypeTranslator; +import org.scribble.visit.VisitorFactory; +import org.scribble.visit.VisitorFactoryImpl; + +// A "compiler job" front-end that supports operations comprising visitor passes over the AST and/or local/global models +public class Job +{ + public final JobConfig config; // Immutable + + private final JobContext context; // Mutable: Visitor passes update modules + + private Core core; + + public Job(ModuleName mainFullname, Map args, + Map parsed, AstFactory af, DelFactory df) + throws ScribException + { + // CHECKME(?): main modname comes from the inlined mod decl -- check for issues if this clashes with an existing file system resource + VisitorFactory vf = newVisitorFactory(); + STypeFactory tf = newSTypeFactory(); + this.config = newJobConfig(mainFullname, args, af, df, vf, tf); + this.context = newJobContext(this, parsed); // Single instance per Job, should not be shared between Jobs + } + + protected VisitorFactory newVisitorFactory() + { + return new VisitorFactoryImpl(); + } + + // Used by GTypeTranslator (cf. getCore) + protected STypeFactory newSTypeFactory() + { + return new STypeFactory(new GTypeFactoryImpl(), + new LTypeFactoryImpl()); + } + + // A Scribble extension should override newJobConfig/Context/Core as appropriate + protected JobConfig newJobConfig(ModuleName mainFullname, + Map args, AstFactory af, DelFactory df, + VisitorFactory vf, STypeFactory tf) + { + return new JobConfig(mainFullname, args, af, df, vf, tf); + } + + // A Scribble extension should override newJobConfig/Context/Core as appropriate + protected JobContext newJobContext(Job job, + Map parsed) throws ScribException + { + return new JobContext(this, parsed); + } + + // First run Visitor passes, then call toJob + // Base implementation: ambigname disamb pass only + public void runPasses() throws ScribException + { + verbosePrintPass("Starting Job passes on:"); + for (ModuleName fullname : this.context.getFullModuleNames()) + { + verbosePrintln(this.context.getModule(fullname).toString()); + } + + // Disamb is a "leftover" aspect of parsing -- so not in core + // N.B. disamb is mainly w.r.t. ambignames -- e.g., doesn't fully qualify names (currently mainly done by imed translation) + // CHECKME: disamb also currently does checks like do-arg kind and arity -- refactor into core? -- also does, e.g., distinct roledecls, protodecls, etc. + runVisitorPassOnAllModules(this.config.vf.DelDecorator(this)); + // Currently, only for the simple name nodes "constructed directly" by parser, e.g., t=ID -> ID<...Node>[$t] + // CHECKME: refactor to construct (and set del) all uniformly via ScribTreeAdaptor, to deprecate DelDecorator? + + runVisitorPassOnAllModules(this.config.vf.NameDisambiguator(this)); // Includes validating names used in subprotocol calls.. + } + + // "Finalises" this Job -- initialises the Job at this point, and cannot run futher Visitor passes on Job + // So, typically, Job passes should be finished before calling this + // Core passes may subsequently mutate Core(Context) though + // CHECKME: revise this pattern? -- maybe fork Core for a snapshot of current Job(Context) -- and, possibly, convert Core back to Job + public final Core getCore() + { + if (this.core == null) + { + Map parsed = this.context.getParsed(); + Set imeds = new HashSet<>(); + for (ModuleName fullname : parsed.keySet()) + { + GTypeTranslator t = this.config.vf.GTypeTranslator(this, fullname, + this.config.tf); + // CHECKME: factor out STypeTranslator, for future local parsing + Module m = parsed.get(fullname); + for (GProtoDecl ast : m.getGProtoDeclChildren()) + { + GProtocol imed = (GProtocol) ast.visitWith(t); + imeds.add(imed); + verbosePrintPass( + //"\nParsed:\n" + gpd + + "Translated Scribble intermediate: " + ast.getFullMemberName(m) + + "\n" + imed); + } + } + this.core = newCore(this.config.main, this.config.args, + //this.context.getModuleContexts(), + imeds, this.config.tf); + } + return this.core; + } + + // A Scribble extension should override newJobConfig/Context/Core as appropriate + protected Core newCore(ModuleName mainFullname, Map args, + //Map modcs, + Set imeds, STypeFactory tf) + { + return new Core(mainFullname, args, //modcs, + imeds, tf); + } + + // Returns: fullname -> Module -- CHECKME TODO: refactor local Module creation to Job? + // CHECKME: generate projection Modules for an *inline* main? + public Map, Module> getProjections(GProtoName fullname, + Role self) throws ScribException + { + AstFactory af = this.config.af; + LProjectionTranslator t = new LProjectionTranslator(this); + Map, Module> res = new HashMap<>(); + + Map, LProjection> projs = getCore() + .getProjections(fullname, self); + for (ProtoName pfullname : projs.keySet()) + { + LProjection proj = projs.get(pfullname); + + List> imports = new LinkedList<>(); + List> pdeps = proj.def + .gather(new ProtoDepsCollector()::visit).distinct() + .collect(Collectors.toList()); // Gathering only from this proto decl (no subproto visiting) // Overlaps with Core::getProjections + pdeps.remove(pfullname); + for (ProtoName imp : pdeps) + { + ModuleNameNode modnn = af.ModuleNameNode(null, + IdNode.from(af, imp.getElements())); + imports.add(af.ImportModule(null, modnn, null)); + } + + LinkedHashSet> npdeps = new LinkedHashSet<>(); + proj.def.gather(new NonProtoDepsGatherer()::visit) // Gathering only from this proto decl (no subproto visiting) + .forEachOrdered(x -> npdeps.add(x)); // set-ify while preserving order + List> nonprods = new LinkedList<>(); + for (MemberName nonpro : npdeps) + { + Kind kind = nonpro.getKind(); + ModuleName pref = nonpro.getPrefix(); + Module m = this.context + .getModule(pref.isEmpty() ? fullname.getPrefix() : pref); + // CHECKME: currently just "copying" decl from source (global) Module, how about importing the Module instead? (and re-qualifying names as needed) + if (kind.equals(DataKind.KIND)) + { + nonprods.add(m.getTypeDeclChild(((DataName) nonpro).getSimpleName())); + } + else if (kind.equals(SigKind.KIND)) + { + nonprods.add(m.getSigDeclChild(((SigName) nonpro).getSimpleName())); + } + else + { + throw new RuntimeException("Unhandled: " + kind + "\n\t" + nonpro); + } + } + + ModuleNameNode modn = af.ModuleNameNode(null, + IdNode.from(af, pfullname.getPrefix().getElements())); + ModuleDecl modd = af.ModuleDecl(null, modn); + List protos = Arrays.asList(t.translate(proj)); + Module mod = af.Module(null, modd, imports, nonprods, protos); + res.put(pfullname, mod); + } + + // CHECKME: nonprotos should refer to source global module? i.e., projection modules should import globals? maybe consistent with "projects" clause + return res; + // CHECKME: (interleaved) ordering between proto and nonproto (Module) imports -- order by original Global import order? + } + + public void runVisitorPassOnAllModules(AstVisitor v) throws ScribException + { + verbosePrintPass("Running " + v.getClass() + " on all modules..."); + runVisitorPass(v, this.context.getFullModuleNames()); + } + + private void runVisitorPass(AstVisitor v, Set fullnames) + throws ScribException + { + for (ModuleName fullname : fullnames) + { + runVisitorOnModule(fullname, v); + } + } + + private void runVisitorOnModule(ModuleName modname, AstVisitor v) + throws ScribException + { + if (this.core != null) + { + throw new RuntimeException("toJob already finalised: "); + } + verbosePrintPass("Running " + v.getClass() + " on: " + modname); + Module visited = (Module) this.context.getModule(modname).accept(v); + verbosePrintln(visited.toString()); + this.context.replaceModule(visited); + } + + public JobContext getContext() + { + return this.context; + } + + public boolean isVerbose() + { + return this.config.args.get(CoreArgs.VERBOSE); + } + + public void verbosePrintln(String s) + { + if (isVerbose()) + { + System.out.println(s); + } + } + + private void verbosePrintPass(String s) + { + verbosePrintln("\n[Job] " + s); + } + + public void warningPrintln(String s) + { + System.err.println("[Warning] " + s); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/job/JobConfig.java b/scribble-ast/src/main/java/org/scribble/job/JobConfig.java new file mode 100644 index 000000000..373864478 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/job/JobConfig.java @@ -0,0 +1,49 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.job; + +import java.util.Collections; +import java.util.Map; + +import org.scribble.ast.AstFactory; +import org.scribble.core.job.CoreArgs; +import org.scribble.core.type.name.ModuleName; +import org.scribble.core.type.session.STypeFactory; +import org.scribble.del.DelFactory; +import org.scribble.visit.VisitorFactory; + +// The "static" (constant) info for Lang -- cf. LangContext "dynamic" state +public class JobConfig +{ + public final ModuleName main; // Full name + + public final Map args; // CHECKME: Set ? + + public final AstFactory af; + public final DelFactory df; + public final VisitorFactory vf; + public final STypeFactory tf; + + // N.B. MainContext is in a different non-visible (by Maven) package + public JobConfig(ModuleName mainFullname, Map args, + AstFactory af, DelFactory df, VisitorFactory vf, STypeFactory tf) + { + this.main = mainFullname; + this.args = Collections.unmodifiableMap(args); + this.af = af; + this.df = df; + this.vf = vf; + this.tf = tf; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/job/JobContext.java b/scribble-ast/src/main/java/org/scribble/job/JobContext.java new file mode 100644 index 000000000..6f3553d45 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/job/JobContext.java @@ -0,0 +1,159 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.job; + +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +import org.scribble.ast.Module; +import org.scribble.ast.global.GProtoDecl; +import org.scribble.core.lang.context.ModuleContext; +import org.scribble.core.type.name.GProtoName; +import org.scribble.core.type.name.ModuleName; +import org.scribble.util.ScribException; + +// Global "static" context information for a Job -- single instance per Job, should not be shared between Jobs +// Mutable: projections, graphs, etc are added mutably later -- replaceModule also mutable setter -- "users" get this from the Job and expect to setter mutate "in place" +public class JobContext +{ + public final Job job; + + //public final ModuleName main; // The "main" root module from MainContext + + // Modules that were originally parsed (obtained from MainContext), but may be modified during the Job + // ModuleName keys are full module names -- currently the modules read from file, distinguished from the generated projection modules + // CHECKME: separate original parsed from "working set"? -- store parsed constants in config? + private final Map parsed;// = new HashMap<>(); + + // Used by, e.g., SimpleAstVisitor (cf. getModuleContext) + // Keys are full names + // Currently assuming ModuleContexts are constant, and considering parsed Modules only (i.e., not generated) -- CHECKME + private final Map modcs; + // CHECKME: constant? depends on adding projections? + + protected JobContext(Job job, Map parsed) + throws ScribException + { + this.job = job; + this.parsed = new HashMap(parsed); + this.modcs = Collections.unmodifiableMap(buildModuleContexts(parsed)); + } + + // Currently assuming ModuleContexts are constant, and considering parsed Modules only (i.e., not generated) -- CHECKME + protected Map buildModuleContexts( + Map parsed) throws ScribException + { + // CHECKME: how does this relate to the ModuleContextBuilder pass? + // Job.modcs seems unused? Lang.modcs is used though, by old AST visitors -- basically old ModuleContextVisitor is redundant? + // Job.modcs could be used, but disamb already done by Lang + // Lang/Job modcs should be moved to config/context though + ModuleContextBuilder b = new ModuleContextBuilder(); // TODO: factor out newModuleContextBuilder + Map modcs = new HashMap<>(); + for (ModuleName fullname : parsed.keySet()) + { + modcs.put(fullname, b.build(parsed, parsed.get(fullname))); + // Throws ScribException + } + return modcs; + } + + public Module getMainModule() + { + return getModule(this.job.config.main); + } + + // HACK -- CHECKME: separate original parsed from "working set"? + public Map getParsed() + { + return Collections.unmodifiableMap(this.parsed); + } + + public GProtoDecl getParsed(GProtoName fullname) + { + return this.parsed.get(fullname.getPrefix()) + .getGProtoDeclChildren().stream().filter(x -> x.getHeaderChild() + .getDeclName().equals(fullname.getSimpleName())) + .findAny().get(); + } + + public Map getModuleContexts() + { + return this.modcs; + } + + public ModuleContext getModuleContext(ModuleName fullname) + { + return this.modcs.get(fullname); + } + + + // The following are used for Visitor pass running + + // Safer to get module names and require user to re-fetch the module by the getter each time (after replacing), to make sure the latest is used + public Set getFullModuleNames() + { + Set modnames = new HashSet<>(); + modnames.addAll(getParsedFullModuleNames()); + //modnames.addAll(getProjectedFullModuleNames()); + return modnames; + } + + public Set getParsedFullModuleNames() + { + return Collections.unmodifiableSet(this.parsed.keySet()); + } + + private boolean isParsedModule(ModuleName fullname) + { + return this.parsed.containsKey(fullname); + } + + public Module getModule(ModuleName fullname) + { + if (isParsedModule(fullname)) + { + return this.parsed.get(fullname); + } + /*else if (isProjectedModule(fullname)) + { + return this.projected.get(this.projected.keySet().stream() + .filter(lpn -> lpn.getPrefix().equals(fullname)) + .collect(Collectors.toList()).get(0)); + }*/ + else + { + throw new RuntimeException("Unknown module: " + fullname); + } + } + + protected void replaceModule(Module module) + { + ModuleName fullname = module.getFullModuleName(); + if (isParsedModule(fullname)) + { + this.parsed.put(fullname, module); + } + /*else if (isProjectedModule(fullname)) + { + addProjection(module); + }*/ + else + { + throw new RuntimeException("Unknown module: " + fullname); + } + } +} diff --git a/scribble-ast/src/main/java/org/scribble/job/ModuleContextBuilder.java b/scribble-ast/src/main/java/org/scribble/job/ModuleContextBuilder.java new file mode 100644 index 000000000..ec76818f8 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/job/ModuleContextBuilder.java @@ -0,0 +1,207 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.job; + +import java.util.Map; + +import org.scribble.ast.DataDecl; +import org.scribble.ast.ImportDecl; +import org.scribble.ast.ImportModule; +import org.scribble.ast.SigDecl; +import org.scribble.ast.Module; +import org.scribble.ast.NonProtoDecl; +import org.scribble.ast.global.GProtoDecl; +import org.scribble.core.lang.context.ModuleContext; +import org.scribble.core.lang.context.ScribNames; +import org.scribble.core.type.name.DataName; +import org.scribble.core.type.name.GProtoName; +import org.scribble.core.type.name.SigName; +import org.scribble.core.type.name.ModuleName; +import org.scribble.util.ScribException; +// TODO: rename and refactor -- also factor out newModuleContextBuilder in Lang +public class ModuleContextBuilder +{ + private Module root; // full name // The root Module for this ModuleContext (cf. the "main" root module from CLI) + + // All transitive name dependencies of this module: all names fully qualified + // The ScribNames maps are basically just used as sets (identity map) + // Cf. ProtocolDeclContext protocol dependencies from protocoldecl as root + private ScribNames deps;// = new ScribNames(); + + // The modules and member names that are visible from this Module -- mapped to "cannonical" (fully qualified) names + // visible names -> fully qualified names + // Directly visible names from this module + private ScribNames visible;// = new ScribNames(); + + // Made by ModuleContextBuilder + // ModuleContext is the root context + public ModuleContextBuilder() //JobContext jcontext, + { + + } + + public ModuleContext build( + Map parsed, // From MainContext (N.B., in a different non-visible package) + Module root) throws ScribException + { + this.root = root; + this.deps = new ScribNames(); + this.visible = new ScribNames(); + + ModuleName fullname = this.root.getFullModuleName(); + ModuleName simpname = this.root.getModuleDeclChild().getDeclName(); + + // All transitive dependencies (for inlined and subprotocol visiting) + addModule(this.deps, this.root, fullname); + addImportDependencies(parsed, this.root); + + // Names directly visible from this module + addModule(this.visible, this.root, fullname); + if (!fullname.equals(simpname)) + { + addModule(this.visible, this.root, simpname); + // Adds simple name of root as visible, and members qualified by simple name + } + addVisible(parsed, root); + // Adds imports and members by their "direct" names (unqualified, except for no-alias imports) + + return new ModuleContext(root.getFullModuleName(), deps, visible); + } + + // Register mod under name modname, modname could be the full module name or an import alias + // Adds member names qualified by mod + private static void addModule(ScribNames names, Module mod, + ModuleName modname) throws ScribException + { + names.modules.put(modname, mod.getFullModuleName()); + for (NonProtoDecl npd : mod.getNonProtoDeclChildren()) + { + if (npd.isDataDecl()) + { + DataDecl dtd = (DataDecl) npd; + DataName qualif = new DataName(modname, dtd.getDeclName()); + names.data.put(qualif, dtd.getFullMemberName(mod)); + } + else //if (npd.isMessageSigNameDecl()) + { + SigDecl msnd = (SigDecl) npd; + SigName qualif = new SigName(modname, msnd.getDeclName()); + names.sigs.put(qualif, msnd.getFullMemberName(mod)); + } + } + for (GProtoDecl gpd : mod.getGProtoDeclChildren()) + { + GProtoName qualif = new GProtoName(modname, + gpd.getHeaderChild().getDeclName()); + names.globals.put(qualif, gpd.getFullMemberName(mod)); + } + } + + // Could move to ImportModule but would need a defensive copy setter, or cache info in builder and create on leave + private void addImportDependencies(Map parsed, Module mod) + throws ScribException + { + for (ImportDecl id : mod.getImportDeclChildren()) + { + if (id.isImportModule()) + { + ImportModule im = (ImportModule) id; + ModuleName fullmodname = im.getModuleNameNodeChild().toName(); + if (!this.deps.modules.containsKey(fullmodname)) + { + Module imported = parsed.get(fullmodname); // TODO: Can get from MainContext instead of JobContext? + addModule(this.deps, imported, fullmodname); // Unlike for visible, only doing full names here + addImportDependencies(parsed, imported); + + // FIXME: also do for npds -- factor out with below + for (GProtoDecl gpd : imported.getGProtoDeclChildren()) + { + GProtoName fullname = gpd.getFullMemberName(root); + this.visible.globals.put(fullname, fullname); + } + } + } + else + { + throw new RuntimeException("TODO: " + id); + } + } + } + + // Adds "local" imports by alias or full name + // Adds "local" members by simple names + private void addVisible(Map parsed, Module root) + throws ScribException + { + // Unlike for deps, visible is not done transitively + for (ImportDecl id : root.getImportDeclChildren()) + { + if (id.isImportModule()) + { + ImportModule im = (ImportModule) id; + ModuleName fullname = im.getModuleNameNodeChild().toName(); + ModuleName visname = (im.hasAlias()) ? im.getAlias() : fullname; + // getVisibleName doesn't use fullname + if (this.visible.modules.containsKey(visname)) + { + throw new ScribException(id.getSource(), + "Duplicate visible module name: " + visname); + } + Module imported = parsed.get(fullname); // TODO: Can get from MainContext instead of JobContext? + addModule(this.visible, imported, visname); + + } + else + { + throw new RuntimeException("TODO: " + id); + } + } + + for (NonProtoDecl npd : root.getNonProtoDeclChildren()) + { + if (npd.isDataDecl()) + { + DataDecl dtd = (DataDecl) npd; + DataName visname = new DataName(dtd.getDeclName().toString()); + DataName fullname = dtd.getFullMemberName(root); + this.visible.data.put(fullname, fullname); + this.visible.data.put(visname, fullname); + } + else // if (npd.isMessageSigNameDecl()) + { + SigDecl msnd = (SigDecl) npd; + SigName fullname = msnd.getFullMemberName(root); + SigName visname = new SigName( + msnd.getDeclName().toString()); + this.visible.sigs.put(fullname, fullname); + this.visible.sigs.put(visname, fullname); + } + } + + for (GProtoDecl gpd : root.getGProtoDeclChildren()) + { + GProtoName visname = new GProtoName( + gpd.getHeaderChild().getDeclName().toString()); + GProtoName fullname = gpd.getFullMemberName(root); + this.visible.globals.put(fullname, fullname); + this.visible.globals.put(visname, fullname); + } + } + + /*@Override + public String toString() + { + return "Maker[deps=" + this.deps + ", visible=" + this.visible + "]"; + }*/ +} diff --git a/scribble-ast/src/main/java/org/scribble/util/LProjectionTranslator.java b/scribble-ast/src/main/java/org/scribble/util/LProjectionTranslator.java new file mode 100644 index 000000000..99c3e2a21 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/util/LProjectionTranslator.java @@ -0,0 +1,347 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.util; + +import java.util.Arrays; +import java.util.LinkedList; +import java.util.List; +import java.util.stream.Collectors; + +import org.scribble.ast.AstFactory; +import org.scribble.ast.MsgNode; +import org.scribble.ast.NonRoleArg; +import org.scribble.ast.NonRoleArgList; +import org.scribble.ast.NonRoleArgNode; +import org.scribble.ast.NonRoleParamDecl; +import org.scribble.ast.NonRoleParamDeclList; +import org.scribble.ast.PayElem; +import org.scribble.ast.PayElemList; +import org.scribble.ast.ProtoModNode; +import org.scribble.ast.ProtoModList; +import org.scribble.ast.RoleArgList; +import org.scribble.ast.RoleDeclList; +import org.scribble.ast.local.LProjectionDecl; +import org.scribble.ast.local.LProtoBlock; +import org.scribble.ast.local.LProtoDef; +import org.scribble.ast.local.LProtoHeader; +import org.scribble.ast.local.LSessionNode; +import org.scribble.ast.name.qualified.DataNameNode; +import org.scribble.ast.name.qualified.GProtoNameNode; +import org.scribble.ast.name.qualified.LProtoNameNode; +import org.scribble.ast.name.simple.DataParamNode; +import org.scribble.ast.name.simple.IdNode; +import org.scribble.ast.name.simple.OpNode; +import org.scribble.ast.name.simple.RecVarNode; +import org.scribble.ast.name.simple.RoleNode; +import org.scribble.ast.name.simple.SigParamNode; +import org.scribble.core.lang.ProtoMod; +import org.scribble.core.lang.local.LProjection; +import org.scribble.core.type.kind.DataKind; +import org.scribble.core.type.kind.NonRoleArgKind; +import org.scribble.core.type.kind.NonRoleParamKind; +import org.scribble.core.type.kind.SigKind; +import org.scribble.core.type.name.DataName; +import org.scribble.core.type.name.MemberName; +import org.scribble.core.type.name.PayElemType; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.name.SigName; +import org.scribble.core.type.session.Arg; +import org.scribble.core.type.session.Msg; +import org.scribble.core.type.session.SigLit; +import org.scribble.core.type.session.local.LAcc; +import org.scribble.core.type.session.local.LChoice; +import org.scribble.core.type.session.local.LContinue; +import org.scribble.core.type.session.local.LDisconnect; +import org.scribble.core.type.session.local.LDo; +import org.scribble.core.type.session.local.LRecursion; +import org.scribble.core.type.session.local.LRecv; +import org.scribble.core.type.session.local.LReq; +import org.scribble.core.type.session.local.LSend; +import org.scribble.core.type.session.local.LSeq; +import org.scribble.core.type.session.local.LType; +import org.scribble.job.Job; + +// Cannot refactor into LType hierarchy, due to Maven module dependencies (scribble-core cannot see scribble-ast) +// Actually, this is a quite general LScribNode translator +public class LProjectionTranslator +{ + public final Job job; + private final AstFactory af; + + private final RoleNode SELF_NODE; // translate LChoice/LDo currently make their own self RoleNodes (convenience) + + public LProjectionTranslator(Job job) + { + this.job = job; + this.af = job.config.af; + SELF_NODE = this.af.RoleNode(null, Role.SELF.toString()); + } + + public LProjectionDecl translate(LProjection proj) + { + RoleDeclList rs = this.af.RoleDeclList(null, proj.roles.stream().map(x -> + { + RoleNode r = this.af.RoleNode(null, x.toString()); + return x.equals(proj.self) + ? this.af.LSelfDecl(null, r) + : this.af.RoleDecl(null, r); + }).collect(Collectors.toList())); + List> pds = new LinkedList<>(); + for (MemberName p : proj.params) + { + if (p instanceof SigName) + { + SigParamNode n = this.af.SigParamNode(null, p.toString()); + pds.add(this.af.SigParamDecl(null, n)); + } + else if (p instanceof DataName) + { + DataParamNode n = this.af.DataParamNode(null, p.toString()); + pds.add(this.af.DataParamDecl(null, n)); + } + else + { + throw new RuntimeException( + "[TODO] Unsupported kind: " + p.getClass() + "\n\t" + p); + } + } + NonRoleParamDeclList ps = this.af.NonRoleParamDeclList(null, pds); + + ProtoModList mods = this.af.ProtoModList(null, proj.mods.stream() + .map(x -> translate(x)).collect(Collectors.toList())); + GProtoNameNode global = this.af.GProtoNameNode(null, + IdNode.from(this.af, proj.global.getElements())); + RoleNode self1 = this.af.RoleNode(null, proj.self.toString()); // FIXME: special "self" node? + LProtoNameNode projFullname = this.af.LProtoNameNode(null, + IdNode.from(this.af, proj.fullname.getElements())); + LProtoHeader header = this.af.LProtoHeader(null, projFullname, rs, ps); + LProtoDef def = this.af.LProtoDef(null, translate(proj.def)); + return this.af.LProjectionDecl(null, mods, header, def, global, self1); + } + + // Cf. IdNode.from + protected ProtoModNode translate(ProtoMod mod) + { + switch (mod) + { + case AUX: return af.AuxMod(null); + case EXPLICIT: return af.ExplicitMod(null); + default: throw new RuntimeException("Unknown modifier: " + mod); + } + } + + protected MsgNode translate(Msg msg) + { + if (msg.isSigLit()) + { + SigLit cast = (SigLit) msg; + OpNode op = this.af.OpNode(null, cast.op.toString()); + PayElemList pay = this.af.PayElemList(null, cast.payload.elems.stream() + .map(x -> translate(x)).collect(Collectors.toList())); + return this.af.SigLitNode(null, op, pay); + } + else + { + SigName cast = (SigName) msg; + List elems = Arrays.asList(cast.getElements()).stream() + .map(x -> this.af.IdNode(null, x)).collect(Collectors.toList()); + return this.af.SigNameNode(null, elems); + } + } + + protected PayElem translate(PayElemType e) + { + if (e instanceof DataName) + { + DataNameNode res = this.af.DataNameNode(null, + IdNode.from(af, ((DataName) e).getElements())); + return this.af.UnaryPayElem(null, res); + } + else + { + throw new RuntimeException( + "[TODO] Unsupported PayElemType: " + e.getClass() + "\n\t" + e); + } + } + + // N.B. in the following, "self" are just regular Role names, and translated to regular RoleNode (cf. LSelfDecl) + + protected org.scribble.ast.local.LSend translate(LSend t) + { + RoleNode dst = this.af.RoleNode(null, t.dst.toString()); + MsgNode msg = translate(t.msg); + return this.af.LSend(null, SELF_NODE, msg, dst); // Ignoring t.src, but it's "self" + } + + protected org.scribble.ast.local.LRecv translate(LRecv t) + { + RoleNode src = this.af.RoleNode(null, t.src.toString()); + MsgNode msg = translate(t.msg); + return this.af.LRecv(null, src, msg, SELF_NODE); // Ignoring t.src, but it's "self" + } + + protected org.scribble.ast.local.LAcc translate(LAcc t) + { + RoleNode src = this.af.RoleNode(null, t.src.toString()); + MsgNode msg = translate(t.msg); + return this.af.LAcc(null, src, msg, SELF_NODE); // Ignoring t.src, but it's "self" + } + + protected org.scribble.ast.local.LReq translate(LReq t) + { + RoleNode dst = this.af.RoleNode(null, t.dst.toString()); + MsgNode msg = translate(t.msg); + return this.af.LReq(null, SELF_NODE, msg, dst); // Ignoring t.src, but it's "self" + } + + protected org.scribble.ast.local.LDisconnect translate(LDisconnect t) + { + RoleNode peer = this.af.RoleNode(null, t.getPeer().toString()); + return this.af.LDisconnect(null, SELF_NODE, peer); // Ignoring t.src, but it's "self" + } + + protected org.scribble.ast.local.LContinue translate(LContinue t) + { + RecVarNode rv = this.af.RecVarNode(null, t.recvar.toString()); + return this.af.LContinue(null, rv); + } + + protected org.scribble.ast.local.LDo translate(LDo t) + { + List args = new LinkedList<>(); + for (Arg p : t.args) + { + NonRoleArgKind k = p.getKind(); + NonRoleArgNode a; + if (k.equals(SigKind.KIND)) + { + if (p instanceof SigLit) + { + SigLit cast = (SigLit) p; + OpNode op = this.af.OpNode(null, cast.op.toString()); + PayElemList pay = this.af.PayElemList(null, cast.payload.elems + .stream().map(x -> translate(x)).collect(Collectors.toList())); + a = this.af.SigLitNode(null, op, pay); // FIXME: could need to be SigParamNode + } + else if (p instanceof SigName) + { + a = this.af.SigNameNode(null, + IdNode.from(this.af, ((SigName) p).getElements())); + // FIXME: could need to be SigParamNode + } + else + { + throw new RuntimeException( + "Shouldn't get in here: " + p.getClass() + "\n\t" + p); + } + } + else if (k.equals(DataKind.KIND)) + { + if (p instanceof DataName) + { + a = this.af.DataNameNode(null, + IdNode.from(this.af, ((SigName) p).getElements())); + // FIXME: could need to be DataParamNode + } + else + { + throw new RuntimeException( + "[TODO] : " + p.getClass() + "\n\t" + p); + } + } + else + { + throw new RuntimeException( + "[TODO] Unsupported kind: " + p.getClass() + "\n\t" + p); + } + args.add(this.af.NonRoleArg(null, a)); + } + NonRoleArgList as = this.af.NonRoleArgList(null, args); + + LProtoNameNode proto = this.af.LProtoNameNode(null, + IdNode.from(this.af, t.proto.getElements())); + RoleArgList rs = this.af.RoleArgList(null, // Cf. translate(LProjectionDecl) + t.roles.stream().map( + x -> this.af.RoleArg(null, this.af.RoleNode(null, x.toString()))) // Includes "self" + .collect(Collectors.toList())); + return this.af.LDo(null, proto, as, rs); + } + + protected org.scribble.ast.local.LChoice translate(LChoice t) + { + RoleNode subj = this.af.RoleNode(null, t.subj.toString()); // Includes "self" + List blocks = t.blocks.stream().map(x -> translate(x)) + .collect(Collectors.toList()); + return this.af.LChoice(null, subj, blocks); + } + + protected org.scribble.ast.local.LRecursion translate(LRecursion t) + { + RecVarNode rv = this.af.RecVarNode(null, t.recvar.toString()); + return this.af.LRecursion(null, rv, translate(t.body)); + } + + protected org.scribble.ast.local.LProtoBlock translate(LSeq t) + { + List elems = t.getElements().stream().map(x -> translate(x)) + .collect(Collectors.toList()); + return this.af.LProtoBlock(null, this.af.LInteractionSeq(null, elems)); + } + + // Cannot refactor into LType hierarchy, due to Maven module dependencies (scribble-core cannot see scribble-ast) + // Only LSeq not done, return is not an LSessionNode + protected LSessionNode translate(LType t) + { + if (t instanceof LAcc) + { + return translate((LAcc) t); + } + else if (t instanceof LChoice) + { + return translate((LChoice) t); + } + else if (t instanceof LContinue) + { + return translate((LContinue) t); + } + else if (t instanceof LDisconnect) + { + return translate((LDisconnect) t); + } + else if (t instanceof LDo) + { + return translate((LDo) t); + } + else if (t instanceof LRecursion) + { + return translate((LRecursion) t); + } + else if (t instanceof LRecv) + { + return translate((LRecv) t); + } + else if (t instanceof LReq) + { + return translate((LReq) t); + } + else if (t instanceof LSend) + { + return translate((LSend) t); + } + else + { + throw new RuntimeException("[TODO] Unhandled LType: " + t.getClass() + "\n" + t); + } + } +} diff --git a/scribble-ast/src/main/java/org/scribble/util/ScribNodeUtil.java b/scribble-ast/src/main/java/org/scribble/util/ScribNodeUtil.java new file mode 100644 index 000000000..4cca8d937 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/util/ScribNodeUtil.java @@ -0,0 +1,58 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.util; + +import java.util.List; +import java.util.stream.Collectors; + +import org.scribble.ast.AstFactory; +import org.scribble.ast.ScribNode; + +public class ScribNodeUtil +{ + // Strict class equality, cf. ScribNodeBase#visitChildWithClassCheck + // C is expected to be of a ground class type + // Maybe pointless (in terms of formal guarantees) to use equality instead of assignable + public static C checkNodeClassEquality(C c, ScribNode n) + { + if (!c.getClass().equals(n.getClass())) + { + throw new RuntimeException( + "Node class not equal: " + c.getClass() + ", " + n.getClass()); + } + @SuppressWarnings("unchecked") + C tmp = (C) n; + return tmp; + } + + // C is expected to be of a ground class type + public static C castNodeByClass(C cast, ScribNode n) + { + if (!cast.getClass().isAssignableFrom(n.getClass())) + { + throw new RuntimeException( + "Node class cast error: " + cast.getClass() + ", " + n.getClass()); + } + @SuppressWarnings("unchecked") + C tmp = (C) n; + return tmp; + } + + public static List cloneList(AstFactory af, + List ns) + { + return ns.stream().map(n -> checkNodeClassEquality(n, // n.clone(af))) + n.clone())).collect(Collectors.toList()); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/visit/AstVisitor.java b/scribble-ast/src/main/java/org/scribble/visit/AstVisitor.java new file mode 100644 index 000000000..74b8d9a0f --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/visit/AstVisitor.java @@ -0,0 +1,50 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.visit; + +import org.scribble.ast.ScribNode; +import org.scribble.job.Job; +import org.scribble.util.ScribException; + +// Pattern: node accepts visitor and calls visitor back (standard visitor pattern -- adding a new operation doesn't affect the Ast classes), but then visitor delegates back to node delegate (so routines for handling each node type not centralised in visitor, but decentralised to delegates) +// More general than SimpleAstVisitor, retrieves ModuleContext on entry and offers enter/leave around visitChildren +public abstract class AstVisitor +{ + public final Job job; // Immutable except for JobContext internals + + protected AstVisitor(Job job) + { + this.job = job; + } + + // Used by ScribNodeBase::accept + public ScribNode visit(ScribNode child) throws ScribException + { + enter(child); + ScribNode visited = child.visitChildren(this); // visited means "children visited so far"; we're about to visit "this" now via "leave" + return leave(child, visited); + } + + protected void enter(ScribNode child) + throws ScribException + { + + } + + protected ScribNode leave(ScribNode child, ScribNode visited) + throws ScribException + { + return visited; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/visit/DelDecorator.java b/scribble-ast/src/main/java/org/scribble/visit/DelDecorator.java new file mode 100644 index 000000000..57de4723c --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/visit/DelDecorator.java @@ -0,0 +1,76 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.visit; + +import org.scribble.ast.ScribNode; +import org.scribble.ast.ScribNodeBase; +import org.scribble.del.DelFactory; +import org.scribble.job.Job; +import org.scribble.util.ScribException; + +// A visitor that caches the ModuleContext from the *entered* Module, for later access +// N.B. may be a different Module than the "root" Module of the job +// Looking up the "entered" Module context is otherwise inconvenient +public class DelDecorator extends AstVisitor +{ + protected final DelFactory df; + + protected DelDecorator(Job job) + { + super(job); + this.df = job.config.df; + } + + // AstVisitor enter/leave typically delegates to dels -- DelDecorator is a "proto-visitor", no del to delegate to (yet) + @Override + protected ScribNode leave(ScribNode child, ScribNode visited) + throws ScribException + { + decorate(visited); // Mutating setter + return visited; + } + + protected void decorate(ScribNode n) + { + if (n.del() != null) // Currently, only the simple name nodes "constructed directly" by parser, e.g., t=ID -> ID<...Node>[$t] + { + return; + } + ((ScribNodeBase) n).decorateDel(this.df); + + /*try + { + String cname = n.getClass().getName(); + String mname = cname.substring(cname.lastIndexOf('.')+1, cname.length()); + Class param = Class.forName(cname); + Method m = DelFactory.class.getMethod(mname, param); + m.invoke(this.df, n); + } + catch (NoSuchMethodException | SecurityException | ClassNotFoundException + | IllegalAccessException | IllegalArgumentException + | InvocationTargetException e) + { + throw new RuntimeException(e); + }*/ + } + + /*protected void decorateChildren(ScribNode n) + { + n.getChildren().stream().forEach(x -> decorate(x)); + }*/ +} + + + + diff --git a/scribble-ast/src/main/java/org/scribble/visit/GTypeTranslator.java b/scribble-ast/src/main/java/org/scribble/visit/GTypeTranslator.java new file mode 100644 index 000000000..d2f50e7b8 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/visit/GTypeTranslator.java @@ -0,0 +1,38 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.visit; + +import org.scribble.ast.ScribNode; +import org.scribble.core.lang.global.GNode; +import org.scribble.core.type.name.ModuleName; +import org.scribble.core.type.session.STypeFactory; +import org.scribble.del.global.GDel; +import org.scribble.job.Job; + +public class GTypeTranslator extends SimpleAstVisitorNoThrows +{ + public final STypeFactory tf; + + public GTypeTranslator(Job job, ModuleName rootFullname, STypeFactory tf) + { + super(job, rootFullname); + this.tf = tf; + } + + @Override + public GNode visit(ScribNode n) + { + return ((GDel) n.del()).translate(n, this); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/visit/ModuleContextVisitor.java b/scribble-ast/src/main/java/org/scribble/visit/ModuleContextVisitor.java new file mode 100644 index 000000000..29e04b315 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/visit/ModuleContextVisitor.java @@ -0,0 +1,57 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.visit; + +import org.scribble.ast.Module; +import org.scribble.ast.ScribNode; +import org.scribble.core.lang.context.ModuleContext; +import org.scribble.core.type.name.ModuleName; +import org.scribble.job.Job; +import org.scribble.util.ScribException; + +// A visitor that caches the ModuleContext from the *entered* Module, for later access +// N.B. may be a different Module than the "root" Module of the job +// Looking up the "entered" Module context is otherwise inconvenient +public abstract class ModuleContextVisitor extends AstVisitor +{ + private ModuleContext mcon; // The "current" module context, gathered on entry -- different than the front-end "main" module + + public ModuleContextVisitor(Job job) + { + super(job); + } + + @Override + protected void enter(ScribNode child) + throws ScribException + { + super.enter(child); + if (child instanceof Module) // Factor out? (e.g., Module?) + { + ModuleName fullname = ((Module) child).getFullModuleName(); + setModuleContext(this.job.getContext().getModuleContext(fullname)); + } + } + + public ModuleContext getModuleContext() + { + return this.mcon; + } + + // Factor out -- e.g. some Visitors want to root on ProtocolDecl, not Module + protected void setModuleContext(ModuleContext mcontext) + { + this.mcon = mcontext; + } +} diff --git a/scribble-ast/src/main/java/org/scribble/visit/NameDisambiguator.java b/scribble-ast/src/main/java/org/scribble/visit/NameDisambiguator.java new file mode 100644 index 000000000..fc700401f --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/visit/NameDisambiguator.java @@ -0,0 +1,206 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.visit; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +import org.scribble.ast.ScribNode; +import org.scribble.ast.global.GDelegPayElem; +import org.scribble.core.type.kind.NonRoleArgKind; +import org.scribble.core.type.kind.NonRoleParamKind; +import org.scribble.core.type.name.Name; +import org.scribble.core.type.name.RecVar; +import org.scribble.core.type.name.Role; +import org.scribble.del.global.GDelegationElemDel; +import org.scribble.job.Job; +import org.scribble.util.ScribException; + +// Disambiguates ambiguous PayloadTypeOrParameter names and inserts implicit Scope names +// Also canonicalises recvars -- CHECKME ? +public class NameDisambiguator extends ModuleContextVisitor +{ + // For implicit scope generation: reset per ProtocolDecl + //private int counter = 1; + + private Set roles = new HashSet<>(); + private Map params = new HashMap<>(); + //private Set recvars = new HashSet<>(); + //private Map> recvars = new HashMap<>(); + private Map recvars = new HashMap<>(); // Nesting count integer now unused (recvar renaming refactored to inlining -- don't want to mangle source AST) + + //private ProtocolDecl root; // FIXME: factor out // Now unused (recvar renaming refactored to inlining -- don't want to mangle source AST) + + protected NameDisambiguator(Job job) + { + super(job); + } + + /*public ScopeNode getFreshScope() + { + return new ScopeNode(null, Scope.IMPLICIT_SCOPE_PREFIX + "." + counter++); + }*/ + + // Most subclasses will override visitForSubprotocols (e.g. ReachabilityChecker, FsmConstructor), but sometimes still want to change whole visit pattern (e.g. Projector) + @Override + public ScribNode visit(ScribNode child) throws ScribException + { + /*if (child instanceof ProtocolDecl) // FIXME: factor out + { + this.root = (ProtocolDecl) child; + }*/ + enter(child); + ScribNode visited = visitForDisamb(child); + return leave(child, visited); + } + + // CHECKME: why "visitFor" pattern? + protected ScribNode visitForDisamb(ScribNode child) throws ScribException + { + if (child instanceof GDelegPayElem) + { + return ((GDelegationElemDel) child.del()).visitForNameDisambiguation(this, + (GDelegPayElem) child); + } + else + { + return child.visitChildren(this); + } + } + + @Override + //public NameDisambiguator enter(ModelNode parent, ModelNode child) throws ScribbleException + public void enter(ScribNode child) throws ScribException + { + super.enter(child); + child.del().enterDisambiguation(child, this); + } + + @Override + public ScribNode leave(ScribNode child, ScribNode visited) + throws ScribException + { + visited = visited.del().leaveDisambiguation(child, this, visited); + return super.leave(child, visited); + } + + public void clear() + { + //this.counter = 1; + this.roles.clear(); + this.params.clear(); + this.recvars.clear(); // Should be unnecessary + + //this.pds.clear(); // No: called by ProtocolDecl leaveDisambiguation (i.e. before the above leave override) -- should be unnecessary anyway + } + + public void addRole(Role role) + { + this.roles.add(role); + } + + public boolean isBoundRole(Role role) + { + return this.roles.contains(role); + } + + public void addParam(Name param, + NonRoleParamKind kind) + { + this.params.put(param.toString(), kind); + } + + // name is a simple name (compound names are not ambiguous) + public boolean isBoundParam(Name name) // ArgKind allows AmbigNames + { + return this.params.containsKey(name.toString()); + } + + public NonRoleParamKind getParamKind(Name name) // ArgKind allows AmbigNames + { + return this.params.get(name.toString()); + } + + //public void addRecVar(RecVar rv) + public void pushRecVar(RecVar rv) + { + //this.recvars.add(rv); + /*Deque deque = this.recvars.get(rv); + if (deque.isEmpty()) + { + deque = new LinkedList(); + this.recvars.put(rv, deque); + } + deque.push(..canonicalised name..);*/ + if (!this.recvars.containsKey(rv)) + { + this.recvars.put(rv, 0); + } + else + { + this.recvars.put(rv, this.recvars.get(rv) + 1); + } + } + + public boolean isBoundRecVar(RecVar rv) + { + //return this.recvars.contains(rv); + return this.recvars.containsKey(rv); + } + + //public void removeRecVar(RecVar rv) + public void popRecVar(RecVar rv) + { + //this.recvars.remove(rv); + /*Deque deque = this.recvars.get(rv); + deque.pop(); + if (deque.isEmpty()) + { + this.recvars.remove(rv); + }*/ + Integer i = this.recvars.get(rv); + if (i == 0) + { + this.recvars.remove(rv); // Cf. isBoundRecVar, uses containsKey + } + else + { + this.recvars.put(rv, i - 1); + } + } +} + + + + + + + + + + + + /*public String getCanonicalRecVarName(RecVar rv) + { + return getCanonicalRecVarName(this.getModuleContext().root, this.root.header.getDeclName(), rv.toString() + "_" + this.recvars.get(rv)); + } + + // Cf. ProtocolDefInliner.newRecVarId + public static String getCanonicalRecVarName(ModuleName fullmodname, ProtocolName simpprotoname, String rv) + { + //return rv.toString(); + return ("__" + fullmodname + "_" + simpprotoname + "_" + rv).replace('.', '_'); + }*/ diff --git a/scribble-ast/src/main/java/org/scribble/visit/SimpleAstVisitor.java b/scribble-ast/src/main/java/org/scribble/visit/SimpleAstVisitor.java new file mode 100644 index 000000000..e2602b8ba --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/visit/SimpleAstVisitor.java @@ -0,0 +1,45 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.visit; + +import org.scribble.ast.ScribNode; +import org.scribble.core.lang.context.ModuleContext; +import org.scribble.core.type.name.ModuleName; +import org.scribble.job.Job; +import org.scribble.util.ScribException; + +// A SimpleVisitor visits a Module (or some part of one) for a given Job +// Apart from delegating to del-specific visiting methods, SimpleVisitors are mainly for holding data and collecting common operations +// A SimpleVisitor must be given the root ModuleContext, cf. ModuleContextVisitor that retrieves the "current" ModuleContext on entry +// TODO CHECKME: refactor AstVisitor as a SimpleVisitor? i.e., T=ScribNode ? +public abstract class SimpleAstVisitor +{ + public final Job job; + public final ModuleName root; // Root module, full name -- used to get ModuleContext + + public SimpleAstVisitor(Job job, ModuleName rootFullname) + { + this.job = job; + this.root = rootFullname; + } + + // Override to delegate to del-specific method, e.g., n.del().visit(n, this) + // N.B. ScribNode has getParent + public abstract T visit(ScribNode n) throws ScribException; + + public ModuleContext getModuleContext() + { + return this.job.getContext().getModuleContext(this.root); + } +} diff --git a/scribble-ast/src/main/java/org/scribble/visit/SimpleAstVisitorNoThrows.java b/scribble-ast/src/main/java/org/scribble/visit/SimpleAstVisitorNoThrows.java new file mode 100644 index 000000000..ed03cb814 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/visit/SimpleAstVisitorNoThrows.java @@ -0,0 +1,29 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.visit; + +import org.scribble.ast.ScribNode; +import org.scribble.core.type.name.ModuleName; +import org.scribble.job.Job; + +public abstract class SimpleAstVisitorNoThrows extends SimpleAstVisitor +{ + public SimpleAstVisitorNoThrows(Job job, ModuleName rootFullname) + { + super(job, rootFullname); + } + + @Override + public abstract T visit(ScribNode n); +} diff --git a/scribble-ast/src/main/java/org/scribble/visit/VisitorFactory.java b/scribble-ast/src/main/java/org/scribble/visit/VisitorFactory.java new file mode 100644 index 000000000..e7030320b --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/visit/VisitorFactory.java @@ -0,0 +1,31 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.visit; + +import org.scribble.core.type.name.ModuleName; +import org.scribble.core.type.session.STypeFactory; +import org.scribble.job.Job; + +// Both Ast and SimpleVisitor +public interface VisitorFactory +{ + // SimpleVisitor + GTypeTranslator GTypeTranslator(Job job, ModuleName rootFullname, + STypeFactory tf); + + // AstVisitor + DelDecorator DelDecorator(Job job); + + NameDisambiguator NameDisambiguator(Job job); +} diff --git a/scribble-ast/src/main/java/org/scribble/visit/VisitorFactoryImpl.java b/scribble-ast/src/main/java/org/scribble/visit/VisitorFactoryImpl.java new file mode 100644 index 000000000..b0ce8d460 --- /dev/null +++ b/scribble-ast/src/main/java/org/scribble/visit/VisitorFactoryImpl.java @@ -0,0 +1,46 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.visit; + +import org.scribble.core.type.name.ModuleName; +import org.scribble.core.type.session.STypeFactory; +import org.scribble.job.Job; + +// Both Ast and SimpleVisitor +public class VisitorFactoryImpl implements VisitorFactory +{ + // SimpleVisitors + + @Override + public GTypeTranslator GTypeTranslator(Job job, ModuleName rootFullname, + STypeFactory tf) + { + return new GTypeTranslator(job, rootFullname, tf); + } + + + // AstVisitors + + @Override + public DelDecorator DelDecorator(Job job) + { + return new DelDecorator(job); + } + + @Override + public NameDisambiguator NameDisambiguator(Job job) + { + return new NameDisambiguator(job); + } +} diff --git a/modules/cli/LICENSE.txt b/scribble-cli/LICENSE.txt similarity index 100% rename from modules/cli/LICENSE.txt rename to scribble-cli/LICENSE.txt diff --git a/scribble-cli/build.properties b/scribble-cli/build.properties new file mode 100644 index 000000000..c987bb752 --- /dev/null +++ b/scribble-cli/build.properties @@ -0,0 +1,33 @@ +# +# Copyright 2008 The Scribble Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except +# in compliance with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License +# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +# or implied. See the License for the specific language governing permissions and limitations under +# the License. +# + +source.. = src/main/java/,\ + target/generated-sources/antlr3/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + src/main/resources/lib/antlr-3.2.jar,\ + OSGI-INF/,\ + LICENSE.txt +src.includes = target/generated-sources/,\ + src/,\ + pom.xml,\ + build.properties,\ + META-INF/,\ + .project,\ + .classpath,\ + OSGI-INF/,\ + LICENSE.txt +jars.compile.order = .,\ + lib/antlr-3.2.jar diff --git a/scribble-cli/lib/commons-io-2.4.jar b/scribble-cli/lib/commons-io-2.4.jar new file mode 100644 index 000000000..90035a4fe Binary files /dev/null and b/scribble-cli/lib/commons-io-2.4.jar differ diff --git a/scribble-cli/pom.xml b/scribble-cli/pom.xml new file mode 100644 index 000000000..a8b6028f1 --- /dev/null +++ b/scribble-cli/pom.xml @@ -0,0 +1,47 @@ + + 4.0.0 + + + scribble-cli + jar + + + + org.scribble + scribble-core + + + org.scribble + scribble-parser + + + org.scribble + scribble-ast + + + org.scribble + scribble-codegen + + + org.scribble + scribble-main + + + + commons-io + commons-io + + + + + org.scribble + parent + 0.5.1-SNAPSHOT + ../pom.xml + + + + scribble-cli + + diff --git a/scribble-cli/src/main/java/org/scribble/cli/CLArgParser.java b/scribble-cli/src/main/java/org/scribble/cli/CLArgParser.java new file mode 100644 index 000000000..fc77b1158 --- /dev/null +++ b/scribble-cli/src/main/java/org/scribble/cli/CLArgParser.java @@ -0,0 +1,177 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.cli; + +import java.io.File; +import java.util.LinkedList; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; + +import org.scribble.util.Pair; + +// A Scribble extension should call the super constructor, then add any additional flags to this.info -- FIXME: do in CLFlags, not here +// String[] -> Map -- Map array values are the arguments associated to each CommandLine.Arg +public class CLArgParser +{ + private final CLFlags flags; + private final String[] raw; // Raw args from main method + + // Flag String constants from CLFlags -> flag arguments (possibly none) + private final List> parsed = new LinkedList<>(); + + public CLArgParser(CLFlags flags, String[] raw) + { + this.flags = flags; + this.raw = raw; + } + + // Return: left = CLFlags String constant, right = flag args (if any) + public List> getParsed() throws CommandLineException + { + parseArgs(); + List labs = getParsedKeys(); + if (!(labs.contains(CLFlags.MAIN_MOD_FLAG) + ^ labs.contains(CLFlags.INLINE_MAIN_MOD_FLAG))) + { + throw new CommandLineException("No/multiple main module specified\n"); + } + if (labs.contains(CLFlags.MAIN_MOD_FLAG)) + { + String main = getParsedUnique(CLFlags.MAIN_MOD_FLAG)[0]; + if (!validateModuleArg(main)) + { + throw new CommandLineException("Bad module arg: " + main); + } + } + if (labs.contains(CLFlags.IMPORT_PATH_FLAG)) + { + validatePaths(getParsedUnique(CLFlags.IMPORT_PATH_FLAG)[0]); + } + return this.parsed; + } + + private void parseArgs() throws CommandLineException + { + for (int i = 0; i < this.raw.length; ) // Parse args in order + { + String arg = this.raw[i]; + if (this.flags.explicit.containsKey(arg)) + { + List labs = getParsedKeys(); + List clashes = this.flags.explicit.get(arg).clashes.stream() + .filter(x -> labs.contains(x)).collect(Collectors.toList()); + if (!clashes.isEmpty()) + { + throw new CommandLineException( + "Flag clash for " + arg + ": " + clashes); + } + i = this.parseFlag(i); // Returns index of next arg to parse + } + else + { + if (isMainModuleParsed()) + { + if (arg.startsWith("-")) + { + throw new CommandLineException( + "Unknown flag or bad main module arg: " + arg); + } + // Could actually be the second "bad argument" -- we didn't validate the value of the (supposed) "main arg" + throw new CommandLineException( + "Bad/multiple main module arg: " + arg); + } + i = parseMain(i); + } + } + } + + // Pre: i = (the index of the current flag to parse) + // Puts into this.parsed + // Post: i = 1 + (the index of the last argument parsed) + // N.B. currently allows repeat flag decls: last overwrites previous + protected int parseFlag(int i) throws CommandLineException + { + String lab = this.raw[i]; + if (this.flags.explicit.get(lab).unique) + { + if (getParsedKeys().contains(lab)) + { + throw new CommandLineException("duplicate: " + lab); + } + } + int num = this.flags.explicit.get(lab).numArgs; + if ((i + num) >= this.raw.length) + { + throw new CommandLineException(this.flags.explicit.get(lab).err); + } + String[] flagArgs = new String[num]; + if (num > 0) + { + System.arraycopy(this.raw, i+1, flagArgs, 0, num); + } + this.parsed.add(new Pair<>(lab, flagArgs)); + return i+1 + num; + } + + // Puts into this.parsed + protected int parseMain(int i) throws CommandLineException + { + String main = this.raw[i]; + this.parsed.add(new Pair<>(CLFlags.MAIN_MOD_FLAG, new String[]{main})); + return i+1; + } + + private boolean isMainModuleParsed() + { + List labs = getParsedKeys(); + return labs.contains(CLFlags.MAIN_MOD_FLAG) + || labs.contains(CLFlags.INLINE_MAIN_MOD_FLAG); + } + + // This check guards the subsequent file open attempt? + private boolean validateModuleArg(String arg) + { + return arg.chars() + .noneMatch(i -> !Character.isLetterOrDigit(i) && i != '.' + && i != File.separatorChar && i != ':' && i != '-' && i != '_' + && i != '/'); // Hack? (cygwin) + } + + private boolean validatePaths(String paths) + { + for (String path : paths.split(File.pathSeparator)) + { + if (!new File(path).isDirectory()) + { + return false; + } + } + return true; + } + + private List getParsedKeys() + { + return this.parsed.stream().map(x -> x.left).collect(Collectors.toList()); + } + + // Hardcoded to find any one, so applies to uniques only + private String[] getParsedUnique(String flag) + { + Optional> res = this.parsed.stream() + .filter(x -> x.left.equals(flag)).findAny(); + return res.isPresent() ? res.get().right : null; + } +} + diff --git a/scribble-cli/src/main/java/org/scribble/cli/CLFlag.java b/scribble-cli/src/main/java/org/scribble/cli/CLFlag.java new file mode 100644 index 000000000..c2e21db1b --- /dev/null +++ b/scribble-cli/src/main/java/org/scribble/cli/CLFlag.java @@ -0,0 +1,64 @@ +package org.scribble.cli; + +import java.util.Arrays; +import java.util.List; + + +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +public class CLFlag +{ + final String lab; // ID field: CLFlags String constant -- N.B. includes "-" prefix + final int numArgs; + final boolean unique; + final boolean enact; + final boolean barrier; // TODO: rename, barrier misleading (sounds like a sync) + final String err; + final List clashes; + + public CLFlag(String lab, int numArgs, boolean unique, boolean enact, + boolean barrier, String err, String... clashes) + { + this.lab = lab; + this.numArgs = numArgs; + this.unique = unique; + this.enact = enact; + this.barrier = barrier; + this.err = err; + this.clashes = Arrays.asList(clashes); + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof CLFlag)) + { + return false; + } + CLFlag them = (CLFlag) o; + return this.lab.equals(them.lab); + } + + @Override + public int hashCode() + { + int hash = 14411; + hash = 31 * this.lab.hashCode(); + return hash; + } +} \ No newline at end of file diff --git a/scribble-cli/src/main/java/org/scribble/cli/CLFlags.java b/scribble-cli/src/main/java/org/scribble/cli/CLFlags.java new file mode 100644 index 000000000..f44ca67ad --- /dev/null +++ b/scribble-cli/src/main/java/org/scribble/cli/CLFlags.java @@ -0,0 +1,178 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.cli; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + + +// Flag Strings must start with "-", e.g., "-project" +// A Scribble extension should override getFlags +public class CLFlags +{ + // Maps flag String constant to CLFlag object + // N.B. does not include MAIN_MOD_FLAG + public final Map explicit; + + // Unique flags + public static final String JUNIT_FLAG = "-junit"; // For internal use (JUnit test harness) + public static final String IMPORT_PATH_FLAG = "-ip"; + public static final String API_OUTPUT_DIR_FLAG = "-d"; + public static final String VERBOSE_FLAG = "-v"; + public static final String STATECHAN_SUBTYPES_FLAG = "-subtypes"; + public static final String OLD_WF_FLAG = "-oldwf"; + public static final String NO_PROGRESS_FLAG = "-noprogress"; + public static final String LTSCONVERT_MIN_FLAG = "-minlts"; // Currently only affects EFSM output (i.e. -fsm..) and API gen -- doesn't affect validation + public static final String FAIR_FLAG = "-fair"; + public static final String NO_LOCAL_CHOICE_SUBJECT_CHECK_FLAG = "-nolocalchoicecheck"; + public static final String NO_ACCEPT_CORRELATION_CHECK_FLAG = "-nocorrelation"; + public static final String DOT_FLAG = "-dot"; + public static final String AUT_FLAG = "-aut"; + public static final String NO_VALIDATION_FLAG = "-novalid"; + public static final String INLINE_MAIN_MOD_FLAG = "-inline"; + + // Non-unique flags + public static final String PROJECT_FLAG = "-project"; + public static final String EFSM_FLAG = "-fsm"; + public static final String VALIDATION_EFSM_FLAG = "-vfsm"; + public static final String UNFAIR_EFSM_FLAG = "-ufsm"; + public static final String UNFAIR_EFSM_PNG_FLAG = "-ufsmpng"; + public static final String EFSM_PNG_FLAG = "-fsmpng"; + public static final String VALIDATION_EFSM_PNG_FLAG = "-vfsmpng"; + public static final String SGRAPH_FLAG = "-model"; + public static final String UNFAIR_SGRAPH_FLAG = "-umodel"; + public static final String SGRAPH_PNG_FLAG = "-modelpng"; + public static final String UNFAIR_SGRAPH_PNG_FLAG = "-umodelpng"; + public static final String API_GEN_FLAG = "-api"; + public static final String SESSION_API_GEN_FLAG = "-sessapi"; + public static final String STATECHAN_API_GEN_FLAG = "-chanapi"; + public static final String EVENTDRIVEN_API_GEN_FLAG = "-cbapi"; + + // Implicit (and unique) -- N.B. not added to this.flags, because implicit + public static final String MAIN_MOD_FLAG = "__main"; + + public CLFlags() + { + this.explicit = Collections.unmodifiableMap(getFlags()); + } + + // Return a map of flag Strings to flag objects + // A Scribble extension should override getFlags -- e.g., call super, then put any additional + protected Map getFlags() + { + Map flags = new HashMap<>(); + + // Unique; barrier irrelevant + flags.put(IMPORT_PATH_FLAG, + new CLFlag(IMPORT_PATH_FLAG, 1, true, false, false, + "Missing path argument: ")); + flags.put(API_OUTPUT_DIR_FLAG, + new CLFlag(API_OUTPUT_DIR_FLAG, 1, true, false, false, + "Missing directory argument: ")); + flags.put(INLINE_MAIN_MOD_FLAG, + new CLFlag(INLINE_MAIN_MOD_FLAG, 1, true, false, false, + "Missing inline module: ")); + + flags.put(JUNIT_FLAG, + new CLFlag(JUNIT_FLAG, 0, true, false, false, "Duplicate flag: ")); + flags.put(VERBOSE_FLAG, + new CLFlag(VERBOSE_FLAG, 0, true, false, false, "Duplicate flag: ")); + flags.put(STATECHAN_SUBTYPES_FLAG, + new CLFlag(STATECHAN_SUBTYPES_FLAG, 0, true, false, false, + "Duplicate flag: ")); + flags.put(OLD_WF_FLAG, + new CLFlag(OLD_WF_FLAG, 0, true, false, false, "Duplicate flag: ", + SGRAPH_FLAG, UNFAIR_SGRAPH_FLAG, SGRAPH_PNG_FLAG, + UNFAIR_SGRAPH_PNG_FLAG)); + flags.put(NO_PROGRESS_FLAG, + new CLFlag(NO_PROGRESS_FLAG, 0, true, false, false, "Duplicate flag: ")); + flags.put(LTSCONVERT_MIN_FLAG, + new CLFlag(LTSCONVERT_MIN_FLAG, 0, true, false, false, + "Duplicate flag: ")); + flags.put(FAIR_FLAG, + new CLFlag(FAIR_FLAG, 0, true, false, false, "Duplicate flag: ")); + flags.put(NO_LOCAL_CHOICE_SUBJECT_CHECK_FLAG, + new CLFlag(NO_LOCAL_CHOICE_SUBJECT_CHECK_FLAG, 0, true, false, false, + "Duplicate flag: ")); + flags.put(NO_ACCEPT_CORRELATION_CHECK_FLAG, + new CLFlag(NO_ACCEPT_CORRELATION_CHECK_FLAG, 0, true, false, false, + "Duplicate flag: ")); + flags.put(NO_VALIDATION_FLAG, + new CLFlag(NO_VALIDATION_FLAG, 0, true, false, false, + "Duplicate flag: ")); + + // These two are mutually exclusive + flags.put(DOT_FLAG, + new CLFlag(DOT_FLAG, 0, true, false, false, "Duplicate flag: ", + CLFlags.AUT_FLAG)); + flags.put(AUT_FLAG, + new CLFlag(AUT_FLAG, 0, true, false, false, "Duplicate flag: ", + CLFlags.DOT_FLAG)); + + // Non-unique, no barrier + flags.put(PROJECT_FLAG, + new CLFlag(PROJECT_FLAG, 2, false, true, false, + "Missing protocol/role arguments: ")); + flags.put(EFSM_FLAG, + new CLFlag(EFSM_FLAG, 2, false, true, false, + "Missing protocol/role arguments: ")); + flags.put(VALIDATION_EFSM_FLAG, + new CLFlag(VALIDATION_EFSM_FLAG, 2, false, true, false, + "Missing protocol/role arguments: ")); + flags.put(UNFAIR_EFSM_FLAG, + new CLFlag(UNFAIR_EFSM_FLAG, 2, false, true, false, + "Missing protocol/role arguments: ")); + + flags.put(EFSM_PNG_FLAG, + new CLFlag(EFSM_PNG_FLAG, 3, false, true, false, + "Missing protocol/role/file arguments: ")); + flags.put(VALIDATION_EFSM_PNG_FLAG, + new CLFlag(VALIDATION_EFSM_PNG_FLAG, 3, false, true, false, + "Missing protocol/role/file arguments: ")); + flags.put(UNFAIR_EFSM_PNG_FLAG, + new CLFlag(UNFAIR_EFSM_PNG_FLAG, 3, false, true, false, + "Missing protocol/role/file arguments: ")); + + flags.put(SGRAPH_FLAG, + new CLFlag(SGRAPH_FLAG, 1, false, true, false, + "Missing protocol argument: ", OLD_WF_FLAG)); + flags.put(UNFAIR_SGRAPH_FLAG, + new CLFlag(UNFAIR_SGRAPH_FLAG, 1, false, true, false, + "Missing protocol argument: ", OLD_WF_FLAG)); + + flags.put(SGRAPH_PNG_FLAG, + new CLFlag(SGRAPH_PNG_FLAG, 2, false, true, false, + "Missing protocol/file arguments: ", OLD_WF_FLAG)); + flags.put(UNFAIR_SGRAPH_PNG_FLAG, + new CLFlag(UNFAIR_SGRAPH_PNG_FLAG, 2, false, true, false, + "Missing protocol/file arguments: ", OLD_WF_FLAG)); + + // // Non-unique, barrier + flags.put(SESSION_API_GEN_FLAG, + new CLFlag(SESSION_API_GEN_FLAG, 1, false, true, true, + "Missing protocol argument: ")); + flags.put(API_GEN_FLAG, + new CLFlag(API_GEN_FLAG, 2, false, true, true, + "Missing protocol/role arguments: ")); + flags.put(STATECHAN_API_GEN_FLAG, + new CLFlag(STATECHAN_API_GEN_FLAG, 2, false, true, true, + "Missing protocol/role arguments: ")); + flags.put(EVENTDRIVEN_API_GEN_FLAG, + new CLFlag(EVENTDRIVEN_API_GEN_FLAG, 2, false, true, true, + "Missing protocol/role arguments: ")); + + return flags; + } +} diff --git a/scribble-cli/src/main/java/org/scribble/cli/CommandLine.java b/scribble-cli/src/main/java/org/scribble/cli/CommandLine.java new file mode 100644 index 000000000..6b1d78698 --- /dev/null +++ b/scribble-cli/src/main/java/org/scribble/cli/CommandLine.java @@ -0,0 +1,559 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.cli; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.function.Consumer; +import java.util.stream.Collectors; + +import org.scribble.ast.Module; +import org.scribble.ast.ProtoDecl; +import org.scribble.ast.global.GProtoDecl; +import org.scribble.codegen.java.JEndpointApiGenerator; +import org.scribble.codegen.java.callbackapi.CBEndpointApiGenerator3; +import org.scribble.core.job.CoreArgs; +import org.scribble.core.job.CoreContext; +import org.scribble.core.model.endpoint.EGraph; +import org.scribble.core.model.global.SGraph; +import org.scribble.core.type.kind.Local; +import org.scribble.core.type.name.GProtoName; +import org.scribble.core.type.name.LProtoName; +import org.scribble.core.type.name.ProtoName; +import org.scribble.core.type.name.Role; +import org.scribble.core.visit.global.InlinedProjector; +import org.scribble.job.Job; +import org.scribble.job.JobContext; +import org.scribble.main.Main; +import org.scribble.main.resource.locator.DirectoryResourceLocator; +import org.scribble.main.resource.locator.ResourceLocator; +import org.scribble.util.AntlrSourceException; +import org.scribble.util.Pair; +import org.scribble.util.RuntimeScribException; +import org.scribble.util.ScribException; +import org.scribble.util.ScribParserException; +import org.scribble.util.ScribUtil; + +/** + * A Scribble extension should override newCLFlags, newCLArgParser, newMain, + * parseJobArgs, doValidationTasks, tryNonBarrierTask and tryBarrierTask as + * appropriate + * + * @author rhu1 + */ +public class CommandLine +{ + protected final CLFlags flags; + protected final List> args; + // left = CLFlags String constant, right = flag args (if any) -- ordered by parsing order + + public CommandLine(String... args) + { + this.flags = newCLFlags(); + try + { + this.args = newCLArgParser(this.flags, args).getParsed(); + } + catch (CommandLineException e) + { + System.err.println(e.getMessage()); + System.exit(1); + throw new RuntimeException("Dummy"); // Already exited above + } + } + + private boolean hasFlag(String flag) + { + return this.args.stream().anyMatch(x -> x.left.equals(flag)); + } + + private String[] getUniqueFlagArgs(String flag) + { + return this.args.stream().filter(x -> x.left.equals(flag)).findAny() + .get().right; + } + + protected CLFlags newCLFlags() + { + return new CLFlags(); + } + + // A Scribble extension should override as appropriate + protected CLArgParser newCLArgParser(CLFlags flags, String[] args) + { + return new CLArgParser(flags, args); + } + + // A Scribble extension should override as appropriate + protected Main newMain() throws ScribParserException, ScribException + { + Map args = Collections.unmodifiableMap(parseCoreArgs()); + if (hasFlag(CLFlags.INLINE_MAIN_MOD_FLAG)) + { + String inline = getUniqueFlagArgs(CLFlags.INLINE_MAIN_MOD_FLAG)[0]; + return new Main(inline, args); + } + else + { + List impaths = hasFlag(CLFlags.IMPORT_PATH_FLAG) + ? CommandLine + .parseImportPaths(getUniqueFlagArgs(CLFlags.IMPORT_PATH_FLAG)[0]) + : Collections.emptyList(); + ResourceLocator locator = new DirectoryResourceLocator(impaths); + Path mainpath = CommandLine + .parseMainPath(getUniqueFlagArgs(CLFlags.MAIN_MOD_FLAG)[0]); + return new Main(locator, mainpath, args); + } + } + + // A Scribble extension should override as appropriate + protected Map parseCoreArgs() + { + Map args = new HashMap<>(); + args.put(CoreArgs.VERBOSE, hasFlag(CLFlags.VERBOSE_FLAG)); + args.put(CoreArgs.OLD_WF, hasFlag(CLFlags.OLD_WF_FLAG)); + args.put(CoreArgs.NO_PROGRESS, hasFlag(CLFlags.NO_PROGRESS_FLAG)); + args.put(CoreArgs.MIN_EFSM, hasFlag(CLFlags.LTSCONVERT_MIN_FLAG)); + args.put(CoreArgs.FAIR, hasFlag(CLFlags.FAIR_FLAG)); + args.put(CoreArgs.NO_LCHOICE_SUBJ_CHECK, + hasFlag(CLFlags.NO_LOCAL_CHOICE_SUBJECT_CHECK_FLAG)); + args.put(CoreArgs.NO_ACC_CORRELATION_CHECK, + hasFlag(CLFlags.NO_ACCEPT_CORRELATION_CHECK_FLAG)); + args.put(CoreArgs.NO_VALIDATION, hasFlag(CLFlags.NO_VALIDATION_FLAG)); + return args; + } + + // AntlrSourceException super of ScribbleException -- needed for, e.g., AssrtCoreSyntaxException + // A Scribble extension should override as appropriate + protected void doValidationTasks(Job job) + throws AntlrSourceException, ScribParserException, // Latter in case needed by subclasses + CommandLineException + { + job.runPasses(); + job.getCore().runPasses(); + } + + // A Scribble extension should override as appropriate + // TODO: rename, barrier misleading (sounds like a sync) + protected void tryNonBarrierTask(Job job, Pair task) + throws CommandLineException, ScribException + { + switch (task.left) // Flag lab (CLFlags String constants) + { + case CLFlags.PROJECT_FLAG: + printProjection(job, task.right); + break; + case CLFlags.EFSM_FLAG: + outputEGraph(job, task.right, true, true, false); + break; + case CLFlags.EFSM_PNG_FLAG: + outputEGraph(job, task.right, true, true, true); + break; + case CLFlags.SGRAPH_FLAG: + outputSGraph(job, task.right, true, false); + break; + case CLFlags.SGRAPH_PNG_FLAG: + outputSGraph(job, task.right, true, true); + break; + + // CHECKME: -unfair needs to be barrier-ed on syntactic WF? (o/w unfair-transform graph building may crash, e.g., bad.wfchoice.enabling.threeparty.Test02) + // Currently, "construction-on-demand" CoreContext getters will still cause these to be attempted even if syntactic WF fails + case CLFlags.VALIDATION_EFSM_FLAG: + outputEGraph(job, task.right, false, true, false); + break; + case CLFlags.VALIDATION_EFSM_PNG_FLAG: + outputEGraph(job, task.right, false, true, true); + break; + case CLFlags.UNFAIR_EFSM_FLAG: + outputEGraph(job, task.right, false, false, false); + break; + case CLFlags.UNFAIR_EFSM_PNG_FLAG: + outputEGraph(job, task.right, false, false, true); + break; + case CLFlags.UNFAIR_SGRAPH_FLAG: + outputSGraph(job, task.right, false, false); + break; + case CLFlags.UNFAIR_SGRAPH_PNG_FLAG: + outputSGraph(job, task.right, false, true); + break; + + default: + throw new RuntimeException("Shouldn't get here: " + task.left); + // Bad flag should be caught by CLArgParser + } + } + + // A Scribble extension should override as appropriate + // TODO: rename, barrier misleading (sounds like a sync) + protected void tryBarrierTask(Job job, + Pair task) throws ScribException, CommandLineException + { + switch (task.left) + { + case CLFlags.SESSION_API_GEN_FLAG: + outputEndpointApi(job, task.right, true, false, false); + break; + case CLFlags.STATECHAN_API_GEN_FLAG: + outputEndpointApi(job, task.right, false, true, false); + break; + case CLFlags.API_GEN_FLAG: + outputEndpointApi(job, task.right, true, true, false); + break; + case CLFlags.EVENTDRIVEN_API_GEN_FLAG: + outputEndpointApi(job, task.right, false, true, true); // FIXME: currently need to gen sess API separately? + break; + default: + throw new RuntimeException("Shouldn't get here: " + task.left); + // Bad flag should be caught by CLArgParser + } + } + + public static void main(String[] args) + throws CommandLineException, AntlrSourceException + { + new CommandLine(args).run(); + } + + public void run() throws CommandLineException, + AntlrSourceException // For JUnit harness (ScribException) + { + try + { + try + { + runTasks(); + } + catch (ScribException e) // Wouldn't need to do this if not Runnable (so maybe change) + { + if (hasFlag(CLFlags.JUNIT_FLAG) // JUnit harness looks for an exception + || hasFlag(CLFlags.VERBOSE_FLAG)) // Also print full trace for -V + { + throw e; + } + else + { + System.err.println(e.getMessage()); + System.exit(1); + } + } + } + catch (ScribParserException | CommandLineException e) + { + System.err.println(e.getMessage()); // No need to give full stack trace, even for debug, for command line errors + System.exit(1); + } + catch (RuntimeScribException e) + { + System.err.println(e.getMessage()); + System.exit(1); + } + } + + protected void runTasks() + throws AntlrSourceException, ScribParserException, CommandLineException + { + Main mc = newMain(); // Represents current instance of tooling for given CL args + Job job = mc.newJob(); // A Job is some series of passes performed on each Module in the MainContext (e.g., cf. Job::runVisitorPass) + ScribException err = null; + try { doValidationTasks(job); } catch (ScribException x) { err = x; } + for (Pair a : this.args) + { + CLFlag flag = this.flags.explicit.get(a.left); // null for CLFlags.MAIN_MOD_FLAG + if (a.left.equals(CLFlags.MAIN_MOD_FLAG) || !flag.enact) + { + continue; + } + if (!flag.barrier) + { + try { tryNonBarrierTask(job, a); } + catch (ScribException x) { if (err == null) { err = x; } } + } + else + { + if (err == null) + { + try { tryBarrierTask(job, a); } + catch (ScribException x) { err = x; } + } + } + } + if (err != null) + { + throw err; + } + } + + // TODO: option to write to file, like API classes + private void printProjection(Job job, String[] args) + throws CommandLineException, ScribException + { + JobContext jobc = job.getContext(); + for (int i = 0; i < args.length; i += 2) + { + GProtoName fullname = checkGlobalProtocolArg(jobc, args[i]); + Role self = checkRoleArg(jobc, fullname, args[i+1]); + Map, Module> projs = job.getProjections(fullname, self); + LProtoName rootFullname = InlinedProjector.getFullProjectionName(fullname, + self); + Module root = projs.get(rootFullname); + System.out.println( + "\nProjection modules for " + fullname + "@" + self + ":\n\n" + root); + for (ProtoName pfullname : projs.keySet()) + { + // CHECKME: projection decl name is currently *compound* full name (not simple name), OK? + if (!pfullname.equals(rootFullname)) + { + System.out.println("\n" + projs.get(pfullname)); + } + } + } + } + + // dot/aut text output + // forUser: true means for API gen and general user info (may be minimised), false means for validation (non-minimised, fair or unfair) + // (forUser && !fair) should not hold, i.e. unfair doesn't make sense if forUser + private void outputEGraph(Job job, String[] args, boolean forUser, + boolean fair, boolean draw) throws ScribException, CommandLineException + { + JobContext jobc = job.getContext(); + + GProtoName fullname = checkGlobalProtocolArg(jobc, args[0]); + Role role = checkRoleArg(jobc, fullname, args[1]); + EGraph fsm = getEGraph(job, fullname, role, forUser, fair); + if (draw) + { + String png = args[2]; + runDot(fsm.toDot(), png); + } + else // print + { + String out = hasFlag(CLFlags.AUT_FLAG) + ? fsm.toAut() + : fsm.toDot(); // default: dot + System.out.println("\n" + out); // Endpoint graphs are "inlined" (a single graph is built) + } + } + + private void outputSGraph(Job job, String[] args, boolean fair, + boolean draw) throws ScribException, CommandLineException + { + JobContext jobc = job.getContext(); + { + GProtoName fullname = checkGlobalProtocolArg(jobc, args[0]); + SGraph model = getSGraph(job, fullname, fair); + if (draw) + { + String png = args[1]; + runDot(model.toDot(), png); + } + else // print + { + String out = hasFlag(CLFlags.AUT_FLAG) + ? model.toAut() + : model.toDot(); + System.out.println("\n" + out); + } + } + } + + private void outputEndpointApi(Job job, String[] args, boolean sess, + boolean schan, boolean cb) throws ScribException, CommandLineException + { + JobContext jobc = job.getContext(); + JEndpointApiGenerator jgen = new JEndpointApiGenerator(job); // FIXME: refactor (generalise -- use new API) + { + GProtoName fullname = checkGlobalProtocolArg(jobc, args[0]); + if (sess) + { + Map out = jgen.generateSessionApi(fullname); + outputClasses(out); + } + if (schan) // CHECKME: does not implicitly generate sess API? + { + Role self = checkRoleArg(jobc, fullname, args[1]); + if (cb) + { + CBEndpointApiGenerator3 cbgen = new CBEndpointApiGenerator3(job, + fullname, self, hasFlag(CLFlags.STATECHAN_SUBTYPES_FLAG)); + Map out = cbgen.build(); + outputClasses(out); + } + else + { + Map out = jgen.generateStateChannelApi(fullname, + self, hasFlag(CLFlags.STATECHAN_SUBTYPES_FLAG)); + outputClasses(out); + } + } + } + } + + // Endpoint graphs are "inlined", so only a single graph is built (cf. projection output) + private EGraph getEGraph(Job job, GProtoName fullname, Role role, + boolean forUser, boolean fair) + throws ScribException, CommandLineException + { + JobContext jobc = job.getContext(); + CoreContext corec = job.getCore().getContext(); + GProtoDecl gpd = jobc.getMainModule() + .getGProtocolDeclChild(fullname.getSimpleName()); + if (gpd == null || !gpd.getHeaderChild().getRoleDeclListChild().getRoles() + .contains(role)) + { + throw new CommandLineException("Bad FSM construction args: " + + gpd + ", " + role); + } + EGraph graph; + if (forUser) // The (possibly minimised) user-output EFSM for API gen + { + graph = hasFlag(CLFlags.LTSCONVERT_MIN_FLAG) + ? corec.getMinimisedEGraph(fullname, role) + : corec.getEGraph(fullname, role); + } + else // The (possibly unfair-transformed) internal EFSM for validation + { + graph = //(!this.args.containsKey(ArgFlag.FAIR) && !this.args.containsKey(ArgFlag.NO_LIVENESS)) // Cf. GlobalModelChecker.getEndpointFSMs + !fair + ? corec.getUnfairEGraph(fullname, role) + : corec.getEGraph(fullname, role); + } + if (graph == null) + { + throw new RuntimeScribException("Shouldn't see this: " + fullname); + // Should be caught by some earlier failure + } + return graph; + } + + private SGraph getSGraph(Job job, GProtoName fullname, boolean fair) + throws ScribException + { + CoreContext jobc2 = job.getCore().getContext(); + SGraph model = fair + ? jobc2.getSGraph(fullname) + : jobc2.getUnfairSGraph(fullname); + if (model == null) + { + throw new RuntimeScribException("Shouldn't see this: " + fullname); + // Should be caught by some earlier failure + } + return model; + } + + // classes: filepath -> class source + protected void outputClasses(Map classes) + throws ScribException + { + Consumer f; + if (hasFlag(CLFlags.API_OUTPUT_DIR_FLAG)) + { + String dir = getUniqueFlagArgs(CLFlags.API_OUTPUT_DIR_FLAG)[0]; + f = path -> { ScribUtil.handleLambdaScribbleException(() -> + { + String tmp = dir + "/" + path; + if (hasFlag(CLFlags.VERBOSE_FLAG)) + { + System.out.println("[DEBUG] Writing to: " + tmp); + } + ScribUtil.writeToFile(tmp, classes.get(path)); + return null; + }); + }; + } + else + { + f = path -> { System.out.println(path + ":\n" + classes.get(path)); }; + } + classes.keySet().forEach(f); + } + + protected static void runDot(String dot, String png) + throws ScribException, CommandLineException + { + File tmp = null; + try + { + tmp = File.createTempFile(png, ".tmp"); + String tmpName = tmp.getAbsolutePath(); + ScribUtil.writeToFile(tmpName, dot); + String[] res = ScribUtil.runProcess("dot", "-Tpng", "-o" + png, tmpName); + System.out.print(!res[1].isEmpty() ? res[1] : res[0]); // already "\n" terminated + } + catch (IOException e) + { + throw new CommandLineException(e); + } + finally + { + if (tmp != null) + { + tmp.delete(); + } + } + } + + protected static Path parseMainPath(String path) + { + return Paths.get(path); + } + + protected static List parseImportPaths(String paths) + { + return Arrays.stream(paths.split(File.pathSeparator)).map(s -> Paths.get(s)) + .collect(Collectors.toList()); + } + + protected static GProtoName checkGlobalProtocolArg(JobContext jobc, + String simpname) throws CommandLineException + { + GProtoName simpgpn = new GProtoName(simpname); + Module main = jobc.getMainModule(); + if (!main.hasGProtocolDecl(simpgpn)) + { + throw new CommandLineException("Global protocol not found: " + simpname); + } + ProtoDecl pd = main.getGProtocolDeclChild(simpgpn); + if (pd == null || !pd.isGlobal()) + { + throw new CommandLineException("Global protocol not found: " + simpname); + } + if (pd.isAux()) // CHECKME: maybe don't check for all, e.g. -project + { + throw new CommandLineException( + "Invalid aux protocol specified as root: " + simpname); + } + return new GProtoName(jobc.job.config.main, simpgpn); // TODO: take Job param instead of Jobcontext + } + + protected static Role checkRoleArg(JobContext jobc, + GProtoName fullname, String rolename) throws CommandLineException + { + ProtoDecl pd = jobc.getMainModule() + .getGProtocolDeclChild(fullname.getSimpleName()); + Role role = new Role(rolename); + if (!pd.getHeaderChild().getRoleDeclListChild().getRoles().contains(role)) + { + throw new CommandLineException( + "Role not declared for " + fullname + ": " + role); + } + return role; + } +} diff --git a/scribble-cli/src/main/java/org/scribble/cli/CommandLineException.java b/scribble-cli/src/main/java/org/scribble/cli/CommandLineException.java new file mode 100644 index 000000000..62e594706 --- /dev/null +++ b/scribble-cli/src/main/java/org/scribble/cli/CommandLineException.java @@ -0,0 +1,48 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.cli; + +public class CommandLineException extends Exception +{ + private static final long serialVersionUID = 1L; + + public CommandLineException() + { + // TODO Auto-generated constructor stub + } + + public CommandLineException(String arg0) + { + super(arg0); + // TODO Auto-generated constructor stub + } + + public CommandLineException(Throwable arg0) + { + super(arg0); + // TODO Auto-generated constructor stub + } + + public CommandLineException(String arg0, Throwable arg1) + { + super(arg0, arg1); + // TODO Auto-generated constructor stub + } + + public CommandLineException(String arg0, Throwable arg1, boolean arg2, boolean arg3) + { + super(arg0, arg1, arg2, arg3); + // TODO Auto-generated constructor stub + } +} diff --git a/scribble-codegen/pom.xml b/scribble-codegen/pom.xml new file mode 100644 index 000000000..058edd750 --- /dev/null +++ b/scribble-codegen/pom.xml @@ -0,0 +1,30 @@ + + + 4.0.0 + + + scribble-codegen + + + + org.scribble + scribble-core + + + org.scribble + scribble-ast + + + + + org.scribble + parent + 0.5.1-SNAPSHOT + ../pom.xml + + + + scribble-codegen + + diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/java/ApiGen.java b/scribble-codegen/src/main/java/org/scribble/codegen/java/ApiGen.java new file mode 100644 index 000000000..08c02557f --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/java/ApiGen.java @@ -0,0 +1,44 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.java; + +import java.util.Map; + +import org.scribble.core.job.Core; +import org.scribble.core.type.name.GProtoName; +import org.scribble.job.Job; + +// Basic pattern: use TypeGenerators to create all necessary TypeBuilders and cache them, and generateApi should call build on all as a final step +public abstract class ApiGen +{ + public final Job job; + public final Core core; + public final GProtoName gpn; // full name + + public ApiGen(Job job, GProtoName fullname) + { + this.job = job; + this.core = job.getCore(); + this.gpn = fullname; + } + + // Return: key (package and Java class file path) -> val (Java class source) + // FIXME: Path instead of String key? + public abstract Map generateApi(); + + public Job getJob() + { + return this.job; + } +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/java/JEndpointApiGenerator.java b/scribble-codegen/src/main/java/org/scribble/codegen/java/JEndpointApiGenerator.java new file mode 100644 index 000000000..c30ad3c7f --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/java/JEndpointApiGenerator.java @@ -0,0 +1,80 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.java; + +import java.util.HashMap; +import java.util.Map; + +import org.scribble.codegen.java.sessionapi.SessionApiGenerator; +import org.scribble.codegen.java.statechanapi.StateChannelApiGenerator; +import org.scribble.codegen.java.statechanapi.ioifaces.IOInterfacesGenerator; +import org.scribble.core.type.name.GProtoName; +import org.scribble.core.type.name.Role; +import org.scribble.job.Job; +import org.scribble.util.RuntimeScribException; +import org.scribble.util.ScribException; + +public class JEndpointApiGenerator +{ + public final Job job; + + public JEndpointApiGenerator(Job job) + { + this.job = job; + } + + public Map generateSessionApi(GProtoName fullname) + throws ScribException + { + this.job.verbosePrintln("\n[Java API gen] Running " + + SessionApiGenerator.class + " for " + fullname); + SessionApiGenerator sg = new SessionApiGenerator(this.job, fullname); // FIXME: reuse? + Map map = sg.generateApi(); // filepath -> class source + return map; + } + + // CHECKME: refactor an EndpointApiGenerator -- ? + public Map generateStateChannelApi(GProtoName fullname, + Role self, boolean subtypes) throws ScribException + { + /*JobContext jc = this.job.getContext(); + if (jc.getEndpointGraph(fullname, self) == null) + { + buildGraph(fullname, self); + }*/ + job.verbosePrintln("\n[Java API gen] Running " + + StateChannelApiGenerator.class + " for " + fullname + "@" + self); + StateChannelApiGenerator apigen = new StateChannelApiGenerator(this.job, + fullname, self); + IOInterfacesGenerator iogen = null; + try + { + iogen = new IOInterfacesGenerator(apigen, subtypes); + } + catch (RuntimeScribException e) // FIXME: use IOInterfacesGenerator.skipIOInterfacesGeneration + { + //System.err.println("[Warning] Skipping I/O Interface generation for protocol featuring: " + fullname); + this.job.warningPrintln("Skipping I/O Interface generation for: " + + fullname + "\n Cause: " + e.getMessage()); + } + // Construct the Generators first, to build all the types -- then call generate to "compile" all Builders to text (further building changes will not be output) + Map api = new HashMap<>(); // filepath -> class source // Store results? + api.putAll(apigen.generateApi()); + if (iogen != null) + { + api.putAll(iogen.generateApi()); + } + return api; + } +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/java/callbackapi/CBEndpointApiGenerator.java b/scribble-codegen/src/main/java/org/scribble/codegen/java/callbackapi/CBEndpointApiGenerator.java new file mode 100644 index 000000000..539b534d2 --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/java/callbackapi/CBEndpointApiGenerator.java @@ -0,0 +1,639 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.java.callbackapi; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.IntStream; +import java.util.stream.Stream; + +import org.scribble.ast.DataDecl; +import org.scribble.ast.Module; +import org.scribble.ast.SigDecl; +import org.scribble.codegen.java.sessionapi.SessionApiGenerator; +import org.scribble.core.job.Core; +import org.scribble.core.job.CoreArgs; +import org.scribble.core.job.CoreContext; +import org.scribble.core.model.endpoint.EState; +import org.scribble.core.model.endpoint.EStateKind; +import org.scribble.core.model.endpoint.actions.EAction; +import org.scribble.core.type.name.DataName; +import org.scribble.core.type.name.GProtoName; +import org.scribble.core.type.name.PayElemType; +import org.scribble.core.type.name.Role; +import org.scribble.job.Job; +import org.scribble.util.ScribException; + +// FIXME: integrate with JEndpointApiGenerator -- this class should correspond to StateChanApiGenerator (relying on the common SessionApiGenerator) +// From ParamCoreEndpointApiGenerator +@Deprecated +public class CBEndpointApiGenerator +{ + public final Job job; + public final Core core; + public final GProtoName proto; + public final Role self; // FIXME: base endpoint API gen is role-oriented, while session API generator should be neutral + + private final boolean subtypes; + + public CBEndpointApiGenerator(Job job, GProtoName fullname, Role self, boolean subtypes) + { + this.job = job; + this.core = job.getCore(); + this.proto = fullname; + this.self = self; + + this.subtypes = subtypes; + if (this.subtypes) + { + throw new RuntimeException("TODO: -subtypes"); + } + } + + public Map build() throws ScribException + { + Map res = new HashMap<>(); // filepath -> source + res.putAll(buildSessionApi()); + return res; + } + + public Map buildSessionApi() throws ScribException // FIXME: factor out -- integrate with JEndpointApiGenerator + { + this.job.verbosePrintln("\n[param-core] Running " + CBEndpointApiGenerator.class + " for " + this.proto + "@" + this.self); + + Map res = new HashMap<>(); + res.putAll(new SessionApiGenerator(this.job, this.proto).generateApi()); + res.putAll(buildEndpointClass()); + return res; + } + + public Map buildEndpointClass() throws ScribException + { + Module main = this.job.getContext().getMainModule(); + CoreContext jobc2 = this.core.getContext(); + EState init = (this.core.config.args.get(CoreArgs.MIN_EFSM) + ? jobc2.getMinimisedEGraph(this.proto, this.self) + : jobc2.getEGraph(this.proto, this.self) + ).init; + // TODO: factor out with StateChannelApiGenerator constructor + Set states = new HashSet<>(); + states.add(init); + states.addAll(init.getReachableStates()); + + // frontend handler class + String pack = SessionApiGenerator.getEndpointApiRootPackageName(this.proto); + String name = this.proto.getSimpleName() + "_" + this.self; + String sess = pack + "." + this.proto.getSimpleName(); + String role = SessionApiGenerator.getRolesPackageName(this.proto) + "." + this.self; + String epClass = ""; + + epClass += "package " + pack + ".handlers." + this.self + ";\n"; + epClass += "\n"; + /*epClass += "import java.util.function.Function;\n"; + epClass += "import java.util.HashMap;\n"; + epClass += "import java.util.Map;\n";*/ + epClass += "\n"; + epClass += "public class " + name + " extends org.scribble.runtime.session.CBEndpoint<" + sess + ", " + role + ", D> {\n"; + + /*epClass += "private final Map> outputs = new HashMap<>();\n"; + epClass += "\n";*/ + + epClass += "public " + name + "(" + sess + " sess, " + role + + " self, org.scribble.runtime.message.ScribMessageFormatter smf, D data) throws java.io.IOException, org.scribble.main.ScribbleRuntimeException {\n"; + epClass += "super(sess, self, smf, " + pack + ".handlers.states." + this.self + "." + name + "_" + init.id + ".id" + ", data);\n"; // FIXME: factor out + for (EState s : states) + { + String tmp = (s.getStateKind() == EStateKind.TERMINAL) ? "End" : this.proto.getSimpleName() + "_" + this.self + "_" + s.id; + epClass += "this.states.put(\"" + tmp + "\", " + SessionApiGenerator.getEndpointApiRootPackageName(this.proto) + ".handlers.states." + this.self + "." + tmp + ".id);\n"; + } + epClass += "}\n"; + epClass += "\n"; + + /*epClass += "public enum State {" + states.stream().map(s -> getEDStateEnum(this.proto, this.self, s)) + "}\n"; + epClass += "\n";*/ + + epClass += states.stream().map(s -> generateRegister(this.proto, this.self, s)).collect(Collectors.joining("\n")); + /*epClass += "public void register(State s, Function h) {\n"; + epClass += "this.outputs.put(s, h)"; + epClass += "}\n"; + epClass += "\n"; + epClass += "public void register(State s, Function h) {\n"; + epClass += "this.outputs.put(s, h)"; + epClass += "}\n";*/ + + epClass += "@Override\n"; + epClass += "public java.util.concurrent.Future run() throws org.scribble.main.ScribbleRuntimeException {\n"; + epClass += "java.util.Set states = java.util.stream.Stream.of(" + + states.stream().filter(s -> s.getStateKind() != EStateKind.TERMINAL) + .map(s -> SessionApiGenerator.getEndpointApiRootPackageName(this.proto) + ".handlers.states." + this.self + "." + this.proto.getSimpleName() + "_" + this.self + "_" + s.id + ".id") + .collect(Collectors.joining(", ")) + ").collect(java.util.stream.Collectors.toSet());\n"; + epClass += "java.util.Set regd = new java.util.HashSet<>();\n"; + epClass += "regd.addAll(this.inputs.keySet());\n"; + epClass += "regd.addAll(this.outputs.keySet());\n"; + epClass += "if (!states.equals(regd)) {\n"; + epClass += "states.removeAll(regd);\n"; + epClass += "throw new org.scribble.main.ScribbleRuntimeException(\"Missing state registrations: \" + states);\n"; + epClass += "}\n"; + epClass += "return super.run();\n"; + epClass += "}\n"; + + epClass += "}\n"; + + Map res = new HashMap<>(); + String prefix = SessionApiGenerator.getEndpointApiRootPackageName(this.proto).replace('.', '/') + "/handlers/" + this.self + "/"; // StateChannelApiGenerator#generateApi + res.put(prefix + name + ".java", epClass); + + // states + String sprefix = SessionApiGenerator.getEndpointApiRootPackageName(this.proto).replace('.', '/') + "/handlers/states/" + this.self + "/"; // StateChannelApiGenerator#generateApi + for (EState s : states) + { + EStateKind kind = s.getStateKind(); + String stateId = (kind == EStateKind.TERMINAL) ? "End" : name + "_" + s.id; + String stateKind; + switch (kind) + { + case OUTPUT: stateKind = "org.scribble.runtime.handlers.states.ScribOutputState"; break; + case UNARY_RECEIVE: + case POLY_RECIEVE: stateKind = "org.scribble.runtime.handlers.states.ScribInputState"; break; + case TERMINAL: stateKind = "org.scribble.runtime.handlers.states.ScribEndState"; break; + case ACCEPT: + case SERVER_WRAP: + throw new RuntimeException("TODO"); + default: + throw new RuntimeException("TODO"); + } + String stateClass = ""; + stateClass += "package " + pack + ".handlers.states." + this.self + ";\n"; + stateClass += "\n"; + stateClass += "public final class " + stateId + " extends " + stateKind + " {\n"; + stateClass += "public static final " + stateId + " id = new " + stateId + "(" + + ((kind == EStateKind.UNARY_RECEIVE || kind == EStateKind.POLY_RECIEVE) ? SessionApiGenerator.getEndpointApiRootPackageName(this.proto) + ".roles." + s.getDetActions().get(0).peer + "." + s.getDetActions().get(0).peer : "") + + ");\n"; + stateClass += "private " + stateId + "(" + + ((kind == EStateKind.UNARY_RECEIVE || kind == EStateKind.POLY_RECIEVE) ? "org.scribble.type.name.Role peer" : "") + + ") {\n"; + stateClass += ((kind == EStateKind.UNARY_RECEIVE || kind == EStateKind.POLY_RECIEVE) ? "super(\"" + stateId + "\", peer);" : "super(\"" + stateId + "\");") + "\n"; + for (EAction a : s.getActions()) + { + stateClass += "this.succs.put(" + SessionApiGenerator.getEndpointApiRootPackageName(this.proto) + ".ops." + SessionApiGenerator.getOpClassName(a.mid) + "." + SessionApiGenerator.getOpClassName(a.mid) + + ", " + /*+ ((s.getSuccessor(a).id == s.id) + ? "this" + : ((s.getSuccessor(a).getStateKind() == EStateKind.TERMINAL) ? "End" : this.proto.getSimpleName() + "_" + this.self + "_" + s.getSuccessor(a).id) + ".id")*/ + + "\"" + ((s.getDetSuccessor(a).getStateKind() == EStateKind.TERMINAL) ? "End" : this.proto.getSimpleName() + "_" + this.self + "_" + s.getDetSuccessor(a).id) + "\"" + + ");\n"; + } + stateClass += "}\n"; + stateClass += "}\n"; + res.put(sprefix + stateId + ".java", stateClass); + + // messages + if (s.getStateKind() == EStateKind.OUTPUT) + { + String mprefix = SessionApiGenerator.getEndpointApiRootPackageName(this.proto).replace('.', '/') + "/handlers/states/" + this.self + "/messages/"; + + // FIXME: sort cases + // FIXME: generate lattice -- cf. original handler i/f's (with "subtyping") + String messageIfName = name + + //a.peer + "_" + SessionApiGenerator.getOpClassName(a.mid) + a.payload.elems.stream().map(e -> "_" + e).collect(Collectors.joining()); + s.getDetActions().stream().map(a -> "__" + a.peer + "_" + SessionApiGenerator.getOpClassName(a.mid) + a.payload.elems.stream().map(e -> "_" + e).collect(Collectors.joining())).collect(Collectors.joining()); + String messageInterface = ""; + messageInterface += "package " + pack + ".handlers.states." + this.self + ".messages.interfaces;\n"; + messageInterface += "\n"; + messageInterface += "public interface " + messageIfName + " {\n"; + messageInterface += "}\n"; + res.put(mprefix + "interfaces/" + messageIfName + ".java", messageInterface); + + String messageAbstractName = name + "_" + s.id + "_Message"; + String messageAbstract = ""; + messageAbstract += "package " + pack + ".handlers.states." + this.self + ".messages;\n"; + messageAbstract += "\n"; + messageAbstract += "public interface " + messageAbstractName + " extends org.scribble.runtime.handlers.ScribOutputEvent, " + pack + ".handlers.states." + this.self + ".messages.interfaces." + messageIfName + " {\n"; + /*messageAbstract += "private static final long serialVersionUID = 1L;\n"; + messageAbstract += "\n"; + messageAbstract += "public " + messageAbstractName + "(org.scribble.type.name.Role peer, org.scribble.type.name.Op op, Object... payload) {\n"; + messageAbstract += "super(peer, op, payload);\n"; + messageAbstract += "}\n";*/ + messageAbstract += "}\n"; + res.put(mprefix + messageAbstractName + ".java", messageAbstract); + + for (EAction a : s.getActions()) + { + /*String messageIfName = name + "__" + a.peer + "_" + SessionApiGenerator.getOpClassName(a.mid) + a.payload.elems.stream().map(e -> "_" + e).collect(Collectors.joining()); + String messageInterface = ""; + messageInterface += "package " + pack + ".handlers.states." + this.self + ".messages.interfaces;\n"; + messageInterface += "\n"; + messageInterface += "public interface " + messageIfName + " {\n"; + messageInterface += "}\n"; + res.put(mprefix + "interfaces/" + messageIfName + ".java", messageInterface);*/ + + boolean isSig = main.getNonProtoDeclChildren().stream() + .anyMatch(npd -> (npd instanceof SigDecl) + && ((SigDecl) npd).getDeclName().toString() + .equals(a.mid.toString())); + SigDecl msnd = null; + if (isSig) + { + msnd = (SigDecl) main.getNonProtoDeclChildren().stream() + .filter(npd -> (npd instanceof SigDecl) + && ((SigDecl) npd).getDeclName().toString() + .equals(a.mid.toString())) + .iterator().next(); + } + + String messageName; + if (isSig) + { + messageName = name + "_" + SessionApiGenerator.getOpClassName(a.mid); + } + else + { + messageName = name + "_" + s.id + "_" + SessionApiGenerator.getOpClassName(a.mid); + } + String messageClass = ""; + messageClass += "package " + pack + ".handlers.states." + this.self + ".messages;\n"; + messageClass += "\n"; + // extends ScribMessage just for convenience of storing payload (peer/op pre-known) -- instances of this class never "directly" sent, cf., CBEndpoint + messageClass += "public class " + messageName + " extends org.scribble.runtime.message.ScribMessage implements " + messageAbstractName; //+ " implements " + pack + ".handlers.states." + this.self + ".messages.interfaces." + messageIfName; + if (isSig) + { + messageClass += ", org.scribble.runtime.handlers.ScribSigMessage"; + } + messageClass += " {\n"; + //messageClass += "public final java.util.List pay = new java.util.LinkedList<>();\n"; + messageClass += "private static final long serialVersionUID = 1L;\n"; + if (isSig) + { + messageClass += "private final " + msnd.getExtName() + " m;\n"; + } + messageClass += "\n"; + messageClass += "public " + messageName + "(" + SessionApiGenerator.getEndpointApiRootPackageName(this.proto) + ".roles." + a.peer + " peer"; + if (isSig) + { + messageClass += ", " + msnd.getExtName() + " m"; + } + else + { + int i = 1; + for (PayElemType pet : a.payload.elems) + { + DataDecl dtd = main.getTypeDeclChild((DataName) pet); + messageClass += ", " + dtd.getExtName() + " arg" + i++; + } + } + messageClass += ") {\n"; + /*for (int j = 1; j <= a.payload.elems.size(); j++) + { + messageClass += "this.pay.add(arg" + j + ");\n"; + }*/ + messageClass += "super(" + + SessionApiGenerator.getEndpointApiRootPackageName(this.proto) + ".ops." + SessionApiGenerator.getOpClassName(a.mid) + "." + SessionApiGenerator.getOpClassName(a.mid) + + IntStream.rangeClosed(1, a.payload.elems.size()).mapToObj(j -> ", arg" + j).collect(Collectors.joining("")) + ");\n"; + if (isSig) + { + messageClass += "this.m = m;\n"; + } + messageClass += "}\n"; + messageClass += "\n"; + messageClass += "@Override\n"; + messageClass += "public org.scribble.type.name.Role getPeer() {\n"; + messageClass += "return " + + SessionApiGenerator.getEndpointApiRootPackageName(this.proto) + + ".roles." + a.peer + "." + a.peer + ";\n"; + messageClass += "}\n"; + messageClass += "\n"; + messageClass += "@Override\n"; + messageClass += "public org.scribble.type.name.Op getOp() {\n"; + messageClass += "return " + + SessionApiGenerator.getEndpointApiRootPackageName(this.proto) + + ".ops." + SessionApiGenerator.getOpClassName(a.mid) + "." + + SessionApiGenerator.getOpClassName(a.mid) + ";\n"; + messageClass += "}\n"; + messageClass += "\n"; + messageClass += "@Override\n"; + messageClass += "public Object[] getPayload() {\n"; + messageClass += "return this.payload;\n"; + messageClass += "}\n"; + if (isSig) + { + messageClass += "\n"; + messageClass += "@Override\n"; + messageClass += "public org.scribble.runtime.message.ScribMessage getSig() {\n"; + messageClass += "return this.m;\n"; + messageClass += "}\n"; + } + messageClass += "}\n"; + res.put(mprefix + messageName + ".java", messageClass); + } + } + + // branches + if (s.getStateKind() == EStateKind.UNARY_RECEIVE || s.getStateKind() == EStateKind.POLY_RECIEVE) + { + String bprefix = SessionApiGenerator + .getEndpointApiRootPackageName(this.proto).replace('.', '/') + + "/handlers/" + this.self + "/"; + String branchName = name + "_" + s.id + "_Branch"; + String branchAbstract = ""; + branchAbstract += "package " + pack + ".handlers." + this.self + ";\n"; + branchAbstract += ""; + branchAbstract += "public abstract class " + branchName + + " implements org.scribble.runtime.handlers.ScribBranch"; + branchAbstract += s.getActions().stream() + .map(a -> ", " + pack + ".handlers." + this.self + ".interfaces." + + name + "__" + a.peer + "_" + + SessionApiGenerator.getOpClassName(a.mid) + + a.payload.elems.stream().map(e -> "_" + e) + .collect(Collectors.joining()) + + "") + .collect(Collectors.joining("")); + branchAbstract += " {\n"; + /*for (EAction a : s.getAllActions()) + { + // FIXME: factor out + boolean isSig = jc.getMainModule().getNonProtocolDecls().stream() + .anyMatch(npd -> (npd instanceof MessageSigNameDecl) && ((MessageSigNameDecl) npd).getDeclName().toString().equals(a.mid.toString())); + MessageSigNameDecl msnd = null; + if (isSig) + { + msnd = (MessageSigNameDecl) jc.getMainModule().getNonProtocolDecls().stream() + .filter(npd -> (npd instanceof MessageSigNameDecl) && ((MessageSigNameDecl) npd).getDeclName().toString().equals(a.mid.toString())).iterator().next(); + } + + branchInterface += "\npublic abstract void receive(D data, " + SessionApiGenerator.getEndpointApiRootPackageName(this.proto) + ".roles." + a.peer + " peer, "; + if (isSig) + { + branchInterface += msnd.extName + " m"; + } + else + { + branchInterface += SessionApiGenerator.getEndpointApiRootPackageName(this.proto) + ".ops." + SessionApiGenerator.getOpClassName(a.mid) + " op"; + int i = 1; + for (PayloadElemType pet : a.payload.elems) + { + DataTypeDecl dtd = jc.getMainModule().getDataTypeDecl((DataType) pet); + branchInterface += ", " + dtd.extName + " arg" + i++; + } + } + branchInterface += ");\n"; + }*/ + + branchAbstract += "\n"; + branchAbstract += "@Override\n"; + branchAbstract += "public void dispatch(D data, org.scribble.runtime.message.ScribMessage m) {\n"; + branchAbstract += "switch (m.op.toString()) {\n"; + for (EAction a : s.getActions()) + { + String receiveIfName = name + "__" + a.peer + "_" + + SessionApiGenerator.getOpClassName(a.mid) + a.payload.elems + .stream().map(e -> "_" + e).collect(Collectors.joining()); + String receiveInterface = ""; + receiveInterface += "package " + pack + ".handlers." + this.self + ".interfaces;\n"; + receiveInterface += "\n"; + receiveInterface += "public interface " + receiveIfName + " {\n"; + // FIXME: factor out + boolean isSig = main.getNonProtoDeclChildren().stream() + .anyMatch(npd -> (npd instanceof SigDecl) + && ((SigDecl) npd).getDeclName().toString() + .equals(a.mid.toString())); + SigDecl msnd = null; + if (isSig) + { + msnd = (SigDecl) main.getNonProtoDeclChildren().stream() + .filter(npd -> (npd instanceof SigDecl) + && ((SigDecl) npd).getDeclName().toString() + .equals(a.mid.toString())) + .iterator().next(); + } + + receiveInterface += "\npublic void receive(D data, " + + SessionApiGenerator.getEndpointApiRootPackageName(this.proto) + + ".roles." + a.peer + " peer, "; + if (isSig) + { + receiveInterface += msnd.getExtName() + " m"; + } + else + { + receiveInterface += SessionApiGenerator + .getEndpointApiRootPackageName(this.proto) + ".ops." + + SessionApiGenerator.getOpClassName(a.mid) + " op"; + int i = 1; + for (PayElemType pet : a.payload.elems) + { + DataDecl dtd = main.getTypeDeclChild((DataName) pet); + receiveInterface += ", " + dtd.getExtName() + + " arg" + i++; + } + } + receiveInterface += ");\n"; + receiveInterface += "}\n"; + res.put(bprefix + "interfaces/" + receiveIfName + ".java", receiveInterface); + + // FIXME: factor out + /*boolean isSig = jc.getMainModule().getNonProtocolDecls().stream() + .anyMatch(npd -> (npd instanceof MessageSigNameDecl) && ((MessageSigNameDecl) npd).getDeclName().toString().equals(a.mid.toString())); + MessageSigNameDecl msnd = null; + if (isSig) + { + msnd = (MessageSigNameDecl) jc.getMainModule().getNonProtocolDecls().stream() + .filter(npd -> (npd instanceof MessageSigNameDecl) && ((MessageSigNameDecl) npd).getDeclName().toString().equals(a.mid.toString())).iterator().next(); + }*/ + + branchAbstract += "case \"" + + SessionApiGenerator.getOpClassName(a.mid) + "\": receive(data, " + + SessionApiGenerator.getEndpointApiRootPackageName(this.proto) + + ".roles." + a.peer + "." + a.peer + ", "; + if (isSig) + { + branchAbstract += "(" + msnd.getExtName() + ") m"; + } + else + { + branchAbstract += "(" + + SessionApiGenerator.getEndpointApiRootPackageName(this.proto) + + ".ops." + SessionApiGenerator.getOpClassName(a.mid) + + ") m.op"; + } + int i = 0; + for (PayElemType pet : a.payload.elems) + { + DataDecl dtd = main.getTypeDeclChild((DataName) pet); + branchAbstract += ", (" + dtd.getExtName() + ") m.payload[" + i++ + "]"; + } + branchAbstract += "); break;\n"; + } + branchAbstract += "default: throw new RuntimeException(\"Shouldn't get in here: \" + m);\n"; + branchAbstract += "}\n"; + branchAbstract += "}\n"; + branchAbstract += "}\n"; + + res.put(bprefix + branchName + ".java", branchAbstract); + } + } + + /*// SessionApiGenerator#constructOpClasses + Module mod = this.job.getContext().getModule(this.proto.getPrefix()); + GProtocolName simpname = this.proto.getSimpleName(); + GProtocolDecl gpd = (GProtocolDecl) mod.getProtocolDecl(simpname); + MessageIdCollector coll = new MessageIdCollector(this.job, ((ModuleDel) mod.del()).getModuleContext()); + gpd.accept(coll); + for (MessageId mid : coll.getNames()) + { + String messageName = SessionApiGenerator.getOpClassName(mid); + String messageClass = ""; + messageClass += "package " + pack + ".handlers.messages;\n"; + messageClass += "\n"; + messageClass += "public class " + messageName + " {\n"; + messageClass += "public final java.util.List pay = new java.util.LinkedList<>();\n"; + messageClass += "public " + messageName + "(" + + ")"; + messageClass += "}\n"; + res.put(prefix + messageName + ".java", messageClass); + }*/ + + return res; + } + + /*// cf. StateChannelApiGenerator#newSocketClassName + public static String getEDStateEnum(GProtocolName gpn, Role self, EState s) + { + return gpn.getSimpleName() + "_" + self + "_" + s.id; + }*/ + + private String generateRegister(GProtoName gpn, Role self, EState s) + { + String prefix = SessionApiGenerator.getEndpointApiRootPackageName(this.proto) + ".handlers.states." + this.self + "." ; + String res = ""; + String name = gpn.getSimpleName() + "_" + self; + switch (s.getStateKind()) + { + case OUTPUT: + { + // FIXME: "untyped" (ScribEvent) -- need state-specific "enums" + res += "public " + name + " callback(" + prefix + name + "_" + s.id + + " sid, java.util.function.Function h) {\n"; // FIXME: factor out + /*res += "this.outputs.put(sid, h);\n"; + res += "return this;\n";*/ + res += "return icallback(sid, h);\n"; + res += "}\n"; + res += "\n"; + /*for (EAction a : s.getAllActions()) + { + String messageIfName = name + "__" + a.peer + "_" + SessionApiGenerator.getOpClassName(a.mid) + a.payload.elems.stream().map(e -> "_" + e).collect(Collectors.joining()); // FIXME: factor out; + res += "public " + name + " callback(" + prefix + name + "_" + s.id + + " sid, java.util.function.Function h) {\n"; + res += "this.outputs.put(sid, h);\n"; + res += "return this;\n"; + res += "}\n"; + res += "\n"; + }*/ + String messageIfName = name + + s.getDetActions().stream().map(a -> "__" + a.peer + "_" + SessionApiGenerator.getOpClassName(a.mid) + a.payload.elems.stream().map(e -> "_" + e).collect(Collectors.joining())).collect(Collectors.joining()); + res += "public\n" + + "\n" // FIXME: factor out + + name + " icallback(" + prefix + name + "_" + s.id + + " sid, java.util.function.Function h) {\n"; + res += "this.outputs.put(sid, h);\n"; + res += "return this;\n"; + res += "}\n"; + res += "\n"; + break; + } + case UNARY_RECEIVE: + case POLY_RECIEVE: + { + res += "public " + name + " callback(" + prefix + name + "_" + s.id + " sid"; + /*for (EAction a : s.getAllActions()) + { + res += ", org.scribble.util.function.Function2<" + SessionApiGenerator.getEndpointApiRootPackageName(this.proto) + ".ops." + SessionApiGenerator.getOpClassName(a.mid) + + ", Object" + + ", Void> h_" + a.mid; + } + res += "java.util.Map> tmp = this.inputs.get(sid);\n"; + res += "if (tmp == null) {\n"; + res += "tmp = new java.util.HashMap<>();\n"; + res += "this.inputs.put(sid, tmp);\n"; + for (EAction a : s.getAllActions()) + { + res += "tmp.put(" + SessionApiGenerator.getEndpointApiRootPackageName(this.proto) + ".ops." + SessionApiGenerator.getOpClassName(a.mid) + "." + SessionApiGenerator.getOpClassName(a.mid) + ", h_" + a.mid + ");\n"; + } + res += "}\n";*/ + res += ", " + SessionApiGenerator.getEndpointApiRootPackageName(this.proto) + ".handlers." + this.self + "." + name + "_" + s.id + "_Branch b"; + res += ") {\n"; + /*res += "this.inputs.put(sid, b);\n"; + res += "return this;\n";*/ + res += "return icallback(sid, b);\n"; + res += "}\n"; + res += "\n"; + String T = s.getActions().stream().map(a -> SessionApiGenerator.getEndpointApiRootPackageName(this.proto) + ".handlers." + this.self + ".interfaces." + name + "__" + a.peer + "_" + + SessionApiGenerator.getOpClassName(a.mid) + a.payload.elems.stream().map(e -> "_" + e).collect(Collectors.joining("")) + "").collect(Collectors.joining(" & ")) + + " & org.scribble.runtime.handlers.ScribBranch"; + res += "public " + "\n" + + name + " icallback(" + prefix + name + "_" + s.id + + " sid, T" + //+ SessionApiGenerator.getEndpointApiRootPackageName(this.proto) + ".handlers." + this.self + ".interfaces." + receiveIfName + " + + " b) {\n"; // FIXME: factor out + res += "this.inputs.put(sid, b);\n"; + res += "return this;\n"; + res += "}\n"; + res += "\n"; + break; + } + case TERMINAL: + { + break; + } + case ACCEPT: + case SERVER_WRAP: + { + throw new RuntimeException("[scrib] TODO: " + s); + } + default: + { + throw new RuntimeException("[scrib] Shouldn't get in here: " + s); + } + } + return res; + } + + /*public String generateRootPackageDecl() + { + return "package " + getRootPackage(); + } + + private String getRootPackage() // Derives only from proto name + { + //throw new RuntimeException("[param-core] TODO:"); + return this.proto.getSimpleName().toString(); + }*/ + + public String generateScribbleRuntimeImports() + { + return getScribbleRuntimeImports().stream().map(x -> "import \"" + x + "\"\n").collect(Collectors.joining()); + } + + private List getScribbleRuntimeImports() // FIXME: factor up + { + return Stream.of( + //EDApiGenConstants.GO_SCRIBBLERUNTIME_SESSION_PACKAGE + "" + ).collect(Collectors.toList()); + } +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/java/callbackapi/CBEndpointApiGenerator3.java b/scribble-codegen/src/main/java/org/scribble/codegen/java/callbackapi/CBEndpointApiGenerator3.java new file mode 100644 index 000000000..cbb17e586 --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/java/callbackapi/CBEndpointApiGenerator3.java @@ -0,0 +1,1027 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.java.callbackapi; + +import java.util.Comparator; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.IntStream; + +import org.scribble.ast.DataDecl; +import org.scribble.ast.Module; +import org.scribble.ast.SigDecl; +import org.scribble.codegen.java.sessionapi.SessionApiGenerator; +import org.scribble.codegen.java.util.ClassBuilder; +import org.scribble.codegen.java.util.ConstructorBuilder; +import org.scribble.codegen.java.util.FieldBuilder; +import org.scribble.codegen.java.util.InterfaceBuilder; +import org.scribble.codegen.java.util.MethodBuilder; +import org.scribble.core.job.Core; +import org.scribble.core.job.CoreArgs; +import org.scribble.core.job.CoreContext; +import org.scribble.core.model.endpoint.EState; +import org.scribble.core.model.endpoint.EStateKind; +import org.scribble.core.model.endpoint.actions.EAction; +import org.scribble.core.type.name.DataName; +import org.scribble.core.type.name.GProtoName; +import org.scribble.core.type.name.PayElemType; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.name.SigName; +import org.scribble.job.Job; +import org.scribble.job.JobContext; +import org.scribble.util.ScribException; + +// FIXME: integrate with JEndpointApiGenerator -- this class should correspond to StateChanApiGenerator (relying on the common SessionApiGenerator) +// FIXME: consider collecting up all interfaces as statics inside a container class -- also states? +// FIXME: integrate CB (branch) interfaces with old iointerfacs/callback API +// FIXME: consider also "expanding" nested message constructors by op first? -- and consider "partial constructors" along expansions, can they be parameterised typed? +public class CBEndpointApiGenerator3 +{ + public final Job job; + public final Core core; + public final GProtoName proto; + public final Role self; // FIXME: base endpoint API gen is role-oriented, while session API generator should be neutral + + protected final Map stateNames = new HashMap<>(); + + //private final boolean subtypes; // Generate full hierarchy (states -> states, not just indivdual state -> cases) -- cf. ioifaces + + public CBEndpointApiGenerator3(Job job, GProtoName fullname, Role self, + boolean subtypes) + { + this.job = job; + this.core = job.getCore(); + this.proto = fullname; + this.self = self; + + //this.subtypes = subtypes; + if (subtypes) + { + throw new RuntimeException("TODO: -subtypes"); + } + } + + public Map build() throws ScribException + { + this.stateNames.clear(); + Map res = new HashMap<>(); // filepath -> source + res.putAll(buildSessionApi()); + return res; + } + + // FIXME: factor out -- integrate with JEndpointApiGenerator + public Map buildSessionApi() throws ScribException + { + this.job.verbosePrintln("\n[param-core] Running " + CBEndpointApiGenerator3.class + " for " + this.proto + "@" + this.self); + + Map res = new HashMap<>(); + res.putAll(new SessionApiGenerator(this.job, this.proto).generateApi()); + res.putAll(buildEndpointClass()); + return res; + } + + public Map buildEndpointClass() throws ScribException + { + Module main = this.job.getContext().getMainModule(); + Map res = new HashMap<>(); + + CoreContext jobc2 = this.core.getContext(); + EState init = (this.core.config.args.get(CoreArgs.MIN_EFSM) + ? jobc2.getMinimisedEGraph(this.proto, this.self) + : jobc2.getEGraph(this.proto, this.self) + ).init; + // TODO: factor out with StateChannelApiGenerator constructor + Set states = new HashSet<>(); + states.add(init); + states.addAll(init.getReachableStates()); + + String endpointName = this.proto.getSimpleName() + "_" + this.self; + int i = 1; + for (EState s : states) + { + EStateKind kind = s.getStateKind(); + String stateName = (kind == EStateKind.TERMINAL) ? "End" : endpointName + "_" + i++; + this.stateNames.put(s.id, stateName); + } + + // frontend handler class + String rootPack = SessionApiGenerator.getEndpointApiRootPackageName(this.proto); + String sessClassName = rootPack + "." + this.proto.getSimpleName(); + String prefix = getHandlersSelfPackage().replace('.', '/') + "/"; // StateChannelApiGenerator#generateApi + + String epClass = generateEndpointClass(rootPack, endpointName, sessClassName, init, states); + res.put(prefix + endpointName + ".java", epClass); + + // output-choice message i/f's + Set outputCallbacks = new HashSet<>(); // e.g., Proto1_A__B__1_Int + Set outputChoices = new HashSet<>(); // e.g., Proto1_A__B__1_Int__C__2_Int__C__4_Str, i.e., { B__1_Int, C__2_Int, C__4_Str } + Map>> reg = new HashMap<>(); // e.g., Proto1_A__B__1_Int -> { Proto1_A__B__1_Int__C__2_Int__C__4_Str, ... } + for (EState s : (Iterable) states.stream().filter(x -> x.getStateKind() == EStateKind.OUTPUT)::iterator) + { + List as = s.getActions(); + Set set = as.stream().map(this.getCallbackSuffix).collect(Collectors.toSet()); + for (EAction a : as) + { + String callbackName = + //endpointName + "OCallback_" + this.self // FIXME: factor out // Cf. ICallback, has self (due to message expansion nesting) -- but ScribMessage values of this type don't record self? -- Select i/f's have self in name though + + "__" + this.getCallbackSuffix.apply(a); + outputCallbacks.add(callbackName); + if (set.size() > 1) + { + Set> tmp = reg.get(callbackName); + if (tmp == null) + { + tmp = new HashSet<>(); + reg.put(callbackName, tmp); + } + tmp.add(set); + } + } + if (as.size() > 1) + { + String outputChoiceName = + //endpointName + "Select_" + this.self // FIXME: factor out // Cf. original iointerfaces + + as.stream().sorted(Comparator.comparing(a -> a.toString())) + .map(a -> "__" + this.getCallbackSuffix.apply(a)).collect(Collectors.joining()); + outputChoices.add(outputChoiceName); + } + } + for (String name : outputChoices) // TODO: -subtypes -- full subtyping between outputChoice i/f's + { + InterfaceBuilder outputChoice = new InterfaceBuilder(name); + outputChoice.addModifiers("public"); + String pack = getHandlersSelfPackage() + ".outputs.choices"; // FIXME: factor out + outputChoice.setPackage(pack); + res.put(pack.replace('.', '/') + "/" + name + ".java", outputChoice.build()); + } + for (String name : outputCallbacks) + { + InterfaceBuilder outputCallback = new InterfaceBuilder(name); + outputCallback.addModifiers("public"); + if (reg.containsKey(name)) + { + reg.get(name).forEach(iface -> + outputCallback.addInterfaces(getHandlersSelfPackage() + ".outputs.choices." + //+ endpointName + + "Select_" + this.self // FIXME: factor out + + iface.stream().sorted().map(f -> "__" + f).collect(Collectors.joining())) + ); + } + String pack = getHandlersSelfPackage() + ".outputs"; // FIXME: factor out + outputCallback.setPackage(pack); + res.put(pack.replace('.', '/') + "/" + name + ".java", outputCallback.build()); + } + + // states + String sprefix = getStatesSelfPackage().replace('.', '/') + "/"; // StateChannelApiGenerator#generateApi + for (EState s : states) + { + EStateKind kind = s.getStateKind(); + String stateName = this.stateNames.get(s.id); + String stateClass = generateStateClass(s, rootPack, kind, stateName, endpointName); + res.put(sprefix + stateName + ".java", stateClass); + } + + /*// messages + for (EState s : states) + { + if (s.getStateKind() == EStateKind.OUTPUT) + { + String mprefix = getMessagesPackage(rootPack).replace('.', '/') + "/"; + String messageAbstractName = getMessageAbstractName(endpointName, s); + String messageAbstractClass = generateMessageAbstractClass(messageAbstractName, rootPack, mprefix); + res.put(mprefix + messageAbstractName + ".java", messageAbstractClass); + Map messageClasses = generateMessageClasses(endpointName, s, mprefix, rootPack); + messageClasses.values().forEach(c -> res.put(mprefix + c.getName() + ".java", c.build())); + } + }*/ + + // branches + JobContext jobc = this.job.getContext(); + for (EState s : states) + { + if (s.getStateKind() == EStateKind.UNARY_RECEIVE || s.getStateKind() == EStateKind.POLY_RECIEVE) + { + String bprefix = getHandlersSelfPackage().replace('.', '/') + "/"; + String branchName = this.stateNames.get(s.id) + "_Branch"; + + for (EAction a : s.getActions()) + { + // FIXME: factor out + boolean isSig = main.getNonProtoDeclChildren().stream() + .anyMatch(npd -> (npd instanceof SigDecl) + && ((SigDecl) npd).getDeclName().toString() + .equals(a.mid.toString())); + SigDecl msnd = null; + if (isSig) + { + msnd = (SigDecl) main.getNonProtoDeclChildren().stream() + .filter(npd -> (npd instanceof SigDecl) + && ((SigDecl) npd).getDeclName().toString() + .equals(a.mid.toString())) + .iterator().next(); + } + + String receiveIfName = + //endpointName + "__" + "ICallback__" // CHECKME: confusing against "icallback" + + a.peer + "_" + SessionApiGenerator.getOpClassName(a.mid) + + a.payload.elems.stream().map(e -> "_" + getExtName(e)).collect(Collectors.joining()); // FIXME: factor out + String receiveInterface = generateReceiveInterface(isSig, msnd, jobc, a, rootPack, receiveIfName); + res.put((getHandlersSelfPackage() + ".inputs.").replace('.', '/') + + receiveIfName + ".java", receiveInterface); + } + + String branchAbstract = generateBranch(bprefix, jobc, s, endpointName, + rootPack, branchName); + res.put(bprefix + branchName + ".java", branchAbstract); + } + } + + return res; + } + + protected String generateEndpointClass(String rootPack, String endpointName, String sessClassName, EState init, Set states) + { + String initStateName = getStatesSelfPackage() + "." + this.stateNames.get(init.id);//endpointName + "_" + init.id; // FIXME: factor out + + ClassBuilder endpointClass = new ClassBuilder(endpointName); + endpointClass.setPackage(getHandlersSelfPackage()); + endpointClass.addModifiers("public"); + endpointClass.addParameters("D"); + endpointClass.setSuperClass("org.scribble.runtime.session.CBEndpoint<" + sessClassName + ", " + getRolesPackage() + "." + this.self + ", D>"); + ConstructorBuilder cb = endpointClass.newConstructor(sessClassName + " sess", getRolesPackage() + "." + this.self + " self", "org.scribble.runtime.message.ScribMessageFormatter smf", "D data"); + cb.addModifiers("public"); + cb.addExceptions("java.io.IOException", "org.scribble.main.ScribRuntimeException"); + cb.addBodyLine("super(sess, self, smf, " + initStateName + ".id, data);"); + for (EState s : states) + { + //String tmp = (s.getStateKind() == EStateKind.TERMINAL) ? "End" : this.proto.getSimpleName() + "_" + this.self + "_" + s.id; + String tmp = this.stateNames.get(s.id); + cb.addBodyLine("this.states.put(\"" + tmp + "\", " + getStatesSelfPackage() + "." + tmp + ".id);"); + } + MethodBuilder mb = endpointClass.newMethod("run"); + mb.addModifiers("public"); + mb.setReturn("java.util.concurrent.Future"); + mb.addExceptions("org.scribble.main.ScribRuntimeException"); + mb.addAnnotations("@Override"); + mb.addBodyLine("java.util.Set states = java.util.stream.Stream.of(" + + states.stream().filter(s -> s.getStateKind() != EStateKind.TERMINAL) + .map(s -> getStatesSelfPackage() + "." + this.stateNames.get(s.id) + ".id") + .collect(Collectors.joining(", ")) + ").collect(java.util.stream.Collectors.toSet());\n"); + mb.addBodyLine("java.util.Set regd = new java.util.HashSet<>();"); + mb.addBodyLine("regd.addAll(this.inputs.keySet());"); + mb.addBodyLine("regd.addAll(this.outputs.keySet());"); + mb.addBodyLine("if (!states.equals(regd)) {"); + mb.addBodyLine("states.removeAll(regd);"); + mb.addBodyLine("throw new org.scribble.main.ScribRuntimeException(\"Missing state registrations: \" + states);"); + mb.addBodyLine("}"); + mb.addBodyLine("return super.run();"); + for (EState s : states) + { + if (s.getStateKind() != EStateKind.TERMINAL) + { + generateRegister(endpointClass, endpointName, rootPack, s); + } + } + return endpointClass.build(); + + /*String role = SessionApiGenerator.getRolesPackageName(this.proto) + "." + this.self; + String epClass = ""; + + epClass += "package " + rootPack + ".handlers." + this.self + ";\n"; + epClass += "\n"; + epClass += "\n"; + epClass += "public class " + endpointName + " extends org.scribble.runtime.session.CBEndpoint<" + sess + ", " + role + ", D> {\n"; + + epClass += "public " + endpointName + "(" + sess + " sess, " + role + + " self, org.scribble.runtime.message.ScribMessageFormatter smf, D data) throws java.io.IOException, org.scribble.main.ScribbleRuntimeException {\n"; + epClass += "super(sess, self, smf, " + rootPack + ".handlers.states." + this.self + "." + endpointName + "_" + init.id + ".id" + ", data);\n"; // FIXME: factor out + for (EState s : states) + { + String tmp = (s.getStateKind() == EStateKind.TERMINAL) ? "End" : this.proto.getSimpleName() + "_" + this.self + "_" + s.id; + epClass += "this.states.put(\"" + tmp + "\", " + SessionApiGenerator.getEndpointApiRootPackageName(this.proto) + ".handlers.states." + this.self + "." + tmp + ".id);\n"; + } + epClass += "}\n"; + epClass += "\n"; + + + epClass += states.stream().map(s -> generateRegister(this.proto, this.self, s)).collect(Collectors.joining("\n")); + + epClass += "@Override\n"; + epClass += "public java.util.concurrent.Future run() throws org.scribble.main.ScribbleRuntimeException {\n"; + epClass += "java.util.Set states = java.util.stream.Stream.of(" + states.stream().filter(s -> s.getStateKind() != EStateKind.TERMINAL).map(s -> + SessionApiGenerator.getEndpointApiRootPackageName(this.proto) + ".handlers.states." + this.self + "." + this.proto.getSimpleName() + "_" + this.self + "_" + s.id + ".id").collect(Collectors.joining(", ")) + ").collect(java.util.stream.Collectors.toSet());\n"; + epClass += "java.util.Set regd = new java.util.HashSet<>();\n"; + epClass += "regd.addAll(this.inputs.keySet());\n"; + epClass += "regd.addAll(this.outputs.keySet());\n"; + epClass += "if (!states.equals(regd)) {\n"; + epClass += "states.removeAll(regd);\n"; + epClass += "throw new org.scribble.main.ScribbleRuntimeException(\"Missing state registrations: \" + states);\n"; + epClass += "}\n"; + epClass += "return super.run();\n"; + epClass += "}\n"; + + epClass += "}\n"; + + return epClass;*/ + } + + //private String generateRegister(GProtocolName gpn, Role self, EState s) + protected void generateRegister(ClassBuilder endpointClass, String endpointName, String rootPack, EState s) + { + switch (s.getStateKind()) + { + case OUTPUT: + { + MethodBuilder callback = endpointClass.newMethod("callback"); + callback.addModifiers("public"); + callback.setReturn(endpointName + ""); + callback.addParameters(getStatesSelfPackage() + "." + this.stateNames.get(s.id) + " sid", // FIXME: factor out + "java.util.function.Function cb" + ); + /*callback.addBodyLine("this.outputs.put(sid, cb);"); + callback.addBodyLine("return this;");*/ + callback.addBodyLine("return icallback(sid, cb);"); + + MethodBuilder icallback = endpointClass.newMethod("icallback"); + icallback.addModifiers("public"); + icallback.setReturn(endpointName + ""); + String iface = getHandlersSelfPackage() + + ((s.getActions().size() > 1) ? ".outputs.choices.Select" : ".outputs.OCallback") // FIXME: factor out + //+ endpointName + + "_" + this.self + + s.getActions().stream().sorted(Comparator.comparing(a -> a.toString())) + .map(a -> "__" + this.getCallbackSuffix.apply(a)).collect(Collectors.joining()); // FIXME: factor out + icallback.addTypeParameters("T extends " + iface + " & org.scribble.runtime.handlers.ScribOutputEvent"); + icallback.addParameters(getStatesSelfPackage() + "." + this.stateNames.get(s.id) + " sid", // FIXME: factor out + "java.util.function.Function cb" + ); + icallback.addBodyLine("this.outputs.put(sid, cb);"); + icallback.addBodyLine("return this;"); + + break; + } + case UNARY_RECEIVE: + case POLY_RECIEVE: + { + MethodBuilder callback = endpointClass.newMethod("callback"); + callback.addModifiers("public"); + callback.setReturn(endpointName + ""); + callback.addParameters(getStatesSelfPackage() + "." + this.stateNames.get(s.id) + " sid", + getHandlersSelfPackage() + "." + this.stateNames.get(s.id) + "_Branch b" + ); // FIXME: factor out + /*callback.addBodyLine("this.inputs.put(sid, b);"); + callback.addBodyLine("return this;");*/ + callback.addBodyLine("return icallback(sid, b);"); + + MethodBuilder icallback = endpointClass.newMethod("icallback"); + icallback.addModifiers("public"); + icallback.setReturn(endpointName + ""); + String typepar = s.getActions().stream().map(a -> + getHandlersSelfPackage() + ".inputs." + //+ this.proto.getSimpleName() + "_" + this.self // i.e, endpointName + + "ICallback" // FIXME: factor out + + "__" + a.peer + "_" + SessionApiGenerator.getOpClassName(a.mid) + + a.payload.elems.stream().map(e -> "_" + getExtName(e)).collect(Collectors.joining("")) + "" + ).collect(Collectors.joining(" & ")); + icallback.addTypeParameters("T extends " + typepar + " & org.scribble.runtime.handlers.ScribBranch"); + icallback.addParameters(getStatesSelfPackage() + "." + this.stateNames.get(s.id) + " sid", "T b"); // FIXME: factor out + icallback.addBodyLine("this.inputs.put(sid, b);"); + icallback.addBodyLine("return this;"); + break; + } + case SERVER_WRAP: + case ACCEPT: + { + throw new RuntimeException("TODO: " + s.getStateKind()); + } + case TERMINAL: + default: + { + throw new RuntimeException("Shouldn't get in here: " + s.getStateKind()); + } + } + + /*String prefix = SessionApiGenerator.getEndpointApiRootPackageName(this.proto) + ".handlers.states." + this.self + "." ; + String res = ""; + String name = gpn.getSimpleName() + "_" + self; + switch (s.getStateKind()) + { + case OUTPUT: + { + // FIXME: "untyped" (ScribEvent) -- need state-specific "enums" + res += "public " + name + " callback(" + prefix + name + "_" + s.id + + " sid, java.util.function.Function h) {\n"; // FIXME: factor out + /*res += "this.outputs.put(sid, h);\n"; + res += "return this;\n";* / + res += "return icallback(sid, h);\n"; + res += "}\n"; + res += "\n"; + String messageIfName = name + + s.getActions().stream().map(a -> "__" + a.peer + "_" + SessionApiGenerator.getOpClassName(a.mid) + a.payload.elems.stream().map(e -> "_" + e).collect(Collectors.joining())).collect(Collectors.joining()); + res += "public\n" + + "\n" // FIXME: factor out + + name + " icallback(" + prefix + name + "_" + s.id + + " sid, java.util.function.Function h) {\n"; + res += "this.outputs.put(sid, h);\n"; + res += "return this;\n"; + res += "}\n"; + res += "\n"; + break; + } + case UNARY_INPUT: + case POLY_INPUT: + { + res += "public " + name + " callback(" + prefix + name + "_" + s.id + " sid"; + res += ", " + SessionApiGenerator.getEndpointApiRootPackageName(this.proto) + ".handlers." + this.self + "." + name + "_" + s.id + "_Branch b"; + res += ") {\n"; + res += "return icallback(sid, b);\n"; + res += "}\n"; + res += "\n"; + String T = s.getAllActions().stream().map(a -> SessionApiGenerator.getEndpointApiRootPackageName(this.proto) + ".handlers." + this.self + ".interfaces." + name + "__" + a.peer + "_" + + SessionApiGenerator.getOpClassName(a.mid) + a.payload.elems.stream().map(e -> "_" + e).collect(Collectors.joining("")) + "").collect(Collectors.joining(" & ")) + + " & org.scribble.runtime.handlers.ScribBranch"; + res += "public " + "\n" + + name + " icallback(" + prefix + name + "_" + s.id + + " sid, T" + //+ SessionApiGenerator.getEndpointApiRootPackageName(this.proto) + ".handlers." + this.self + ".interfaces." + receiveIfName + " + + " b) {\n"; // FIXME: factor out + res += "this.inputs.put(sid, b);\n"; + res += "return this;\n"; + res += "}\n"; + res += "\n"; + break; + } + case TERMINAL: + { + break; + } + case ACCEPT: + case WRAP_SERVER: + { + throw new RuntimeException("[scrib] TODO: " + s); + } + default: + { + throw new RuntimeException("[scrib] Shouldn't get in here: " + s); + } + } + return res;*/ + } + + protected String generateStateClass(EState s, String rootPack, EStateKind kind, String stateName, String endpointName) + { + Module main = this.job.getContext().getMainModule(); + + String stateKind; + switch (kind) + { + case OUTPUT: stateKind = "org.scribble.runtime.handlers.states.ScribOutputState"; break; + case UNARY_RECEIVE: + case POLY_RECIEVE: stateKind = "org.scribble.runtime.handlers.states.ScribInputState"; break; + case TERMINAL: stateKind = "org.scribble.runtime.handlers.states.ScribEndState"; break; + case ACCEPT: + case SERVER_WRAP: + throw new RuntimeException("TODO"); + default: + throw new RuntimeException("TODO"); + } + + ClassBuilder stateClass = new ClassBuilder(stateName); + stateClass.setPackage(getStatesSelfPackage()); + stateClass.setSuperClass(stateKind); + stateClass.addModifiers("public", "final"); + FieldBuilder id = stateClass.newField("id"); + id.addModifiers("public", "static", "final"); + id.setType(stateName); + id.setExpression("new " + stateName + "(" + //+ ((kind == EStateKind.UNARY_INPUT || kind == EStateKind.POLY_INPUT) ? getRolesPackage() + "." + this.self + "." + this.self : "") // FIXME: factor out + + ")"); + /*String[] params = (kind == EStateKind.UNARY_INPUT || kind == EStateKind.POLY_INPUT) + ? new String[] { "org.scribble.type.name.Role peer" } : new String[0];*/ + ConstructorBuilder stateCons = stateClass.newConstructor(); + stateCons.addModifiers("private"); + Role peer = (kind == EStateKind.UNARY_RECEIVE || kind == EStateKind.POLY_RECIEVE) ? s.getDetActions().iterator().next().peer : null; + stateCons.addBodyLine("super(\"" + stateName + "\"" + + ((kind == EStateKind.UNARY_RECEIVE || kind == EStateKind.POLY_RECIEVE) ? ", " + getRolesPackage() + "." + peer + "." + peer : "") // FIXME: factor out + + ");"); + for (EAction a : s.getActions()) + { + EState succ = s.getDetSuccessor(a); + stateCons.addBodyLine("this.succs.put(" + getOpsPackage() + "." + SessionApiGenerator.getOpClassName(a.mid) + "." + SessionApiGenerator.getOpClassName(a.mid) // FIXME: factor out + + ", \"" + /*+ ((succ.getStateKind() == EStateKind.TERMINAL) + ? "End" : this.proto.getSimpleName() + "_" + this.self + "_" + succ.id) // FIXME: factor out*/ + + this.stateNames.get(succ.id) + + "\");" + ); + } + + if (s.getStateKind() == EStateKind.OUTPUT) // FIXME: factor out + { + if (s.getDetActions().size() > 0) + { + InterfaceBuilder messageIf = stateClass.newMemberInterface("Message"); // FIXME: factor out + messageIf.addModifiers("public", "static"); + messageIf.addInterfaces("org.scribble.runtime.handlers.ScribOutputEvent"); + String iface = getHandlersSelfPackage() // FIXME: factor out with generateRegister + + ((s.getActions().size() > 1) ? ".outputs.choices.Select" : ".outputs.OCallback") // FIXME: factor out + //+ endpointName + + "_" + this.self + + s.getActions().stream().sorted(Comparator.comparing(a -> a.toString())) + .map(a -> "__" + this.getCallbackSuffix.apply(a)).collect(Collectors.joining()); // FIXME: factor out + messageIf.addInterfaces(iface); + } + s.getActions().stream().map(a -> a.peer).distinct().forEachOrdered(r -> + { + ClassBuilder roleClass = stateClass.newMemberClass(r.toString()); + roleClass.addModifiers("public", "static"); + ConstructorBuilder roleCons = roleClass.newConstructor(); + roleCons.addModifiers("private"); + s.getActions().stream().filter(a -> a.peer.equals(r)) + .forEachOrdered(a -> + { + String opName = SessionApiGenerator.getOpClassName(a.mid); + ClassBuilder opClass = roleClass.newMemberClass(opName); + opClass.addModifiers("public", "static"); + opClass.setSuperClass("org.scribble.runtime.message.ScribMessage"); + opClass.addInterfaces(stateName + ".Message"); // FIXME: factor out + opClass.addInterfaces(getHandlersSelfPackage() + ".outputs." // FIXME: factor out + //+ endpointName + + "OCallback_" + this.self // FIXME: factor out + + "__" + this.getCallbackSuffix.apply(a)); + FieldBuilder svu = opClass.newField("serialVersionUID"); + svu.addModifiers("private", "static", "final"); + svu.setType("long"); + svu.setExpression("1L"); + int[] i = { 0 }; + + // FIXME: factor out + boolean isSig = main.getNonProtoDeclChildren().stream() + .anyMatch(npd -> (npd instanceof SigDecl) && ((SigDecl) npd).getDeclName().toString().equals(a.mid.toString())); + SigDecl msnd = null; + if (isSig) + { + msnd = (SigDecl) main.getNonProtoDeclChildren().stream() + .filter(npd -> (npd instanceof SigDecl) && ((SigDecl) npd).getDeclName().toString().equals(a.mid.toString())).iterator().next(); + FieldBuilder m = opClass.newField("m"); + m.addModifiers("private", "final"); + m.setType(msnd.getExtName()); + } + + ConstructorBuilder opCons; + if (isSig) + { + opCons = opClass.newConstructor(msnd.getExtName() + " m"); + opClass.addInterfaces("org.scribble.runtime.handlers.ScribSigMessage"); + } + else + { + opCons = opClass.newConstructor(a.payload.elems.stream().map(e -> + main.getTypeDeclChild((DataName) e).getExtName() + " arg" + i[0]++ + ).collect(Collectors.joining(", "))); + } + opCons.addModifiers("public"); + opCons.addBodyLine("super(" + getOpsPackage() + "." + opName + "." + opName // CHECKME: different "op types" have same equals/hashCode -- OK? + + IntStream.range(0, a.payload.elems.size()).mapToObj(j -> ", arg" + j).collect(Collectors.joining("")) + + ");"); + if (isSig) + { + opCons.addBodyLine("this.m = m;"); + MethodBuilder getSig = opClass.newMethod("getSig"); + getSig.addModifiers("public"); + getSig.addAnnotations("@Override"); + getSig.setReturn("org.scribble.runtime.message.ScribMessage"); + getSig.addBodyLine("return this.m;"); + } + MethodBuilder getPeer = opClass.newMethod("getPeer"); + getPeer.addModifiers("public"); + getPeer.addAnnotations("@Override"); + getPeer.setReturn("org.scribble.core.type.name.Role"); + getPeer.addBodyLine("return " + getRolesPackage() + "." + a.peer + "." + a.peer + ";"); + MethodBuilder getOp = opClass.newMethod("getOp"); + getOp.addModifiers("public"); + getOp.addAnnotations("@Override"); + getOp.setReturn("org.scribble.core.type.name.Op"); + getOp.addBodyLine("return " + getOpsPackage() + "." + SessionApiGenerator.getOpClassName(a.mid) + "." + SessionApiGenerator.getOpClassName(a.mid) + ";"); + MethodBuilder getPayload = opClass.newMethod("getPayload"); + getPayload.addModifiers("public"); + getPayload.addAnnotations("@Override"); + getPayload.setReturn("Object[]"); + getPayload.addBodyLine("return this.payload;"); + }); + }); + } + + return stateClass.build(); + + /*String stateClass = ""; + stateClass += "package " + rootPack + ".handlers.states." + this.self + ";\n"; + stateClass += "\n"; + stateClass += "public final class " + stateName + " extends " + stateKind + " {\n"; + stateClass += "public static final " + stateName + " id = new " + stateName + "(" + + ((kind == EStateKind.UNARY_INPUT || kind == EStateKind.POLY_INPUT) ? SessionApiGenerator.getEndpointApiRootPackageName(this.proto) + ".roles." + s.getActions().get(0).peer + "." + s.getActions().get(0).peer : "") + + ");\n"; + stateClass += "private " + stateName + "(" + + ((kind == EStateKind.UNARY_INPUT || kind == EStateKind.POLY_INPUT) ? "org.scribble.type.name.Role peer" : "") + + ") {\n"; + stateClass += ((kind == EStateKind.UNARY_INPUT || kind == EStateKind.POLY_INPUT) ? "super(\"" + stateName + "\", peer);" : "super(\"" + stateName + "\");") + "\n"; + for (EAction a : s.getAllActions()) + { + stateClass += "this.succs.put(" + SessionApiGenerator.getEndpointApiRootPackageName(this.proto) + ".ops." + SessionApiGenerator.getOpClassName(a.mid) + "." + SessionApiGenerator.getOpClassName(a.mid) + + ", " + /*+ ((s.getSuccessor(a).id == s.id) + ? "this" + : ((s.getSuccessor(a).getStateKind() == EStateKind.TERMINAL) ? "End" : this.proto.getSimpleName() + "_" + this.self + "_" + s.getSuccessor(a).id) + ".id")* / + + "\"" + ((s.getSuccessor(a).getStateKind() == EStateKind.TERMINAL) ? "End" : this.proto.getSimpleName() + "_" + this.self + "_" + s.getSuccessor(a).id) + "\"" + + ");\n"; + } + stateClass += "}\n"; + stateClass += "}\n"; + + return stateClass;*/ + } + + // FIXME: refactor using TypeBuilder API + protected String generateBranch(String bprefix, JobContext jc, EState s, String endpointName, String rootPack, String branchName) + { + String branchAbstract = ""; + branchAbstract += "package " + getHandlersSelfPackage() + ";\n"; + branchAbstract += ""; + branchAbstract += "public abstract class " + branchName + " implements org.scribble.runtime.handlers.ScribBranch"; + branchAbstract += s.getActions().stream().map(a -> + ", " + getHandlersSelfPackage() + ".inputs." + //+ endpointName + + "ICallback" // FIXME: factor out + + "__" + a.peer + "_" + SessionApiGenerator.getOpClassName(a.mid) + + a.payload.elems.stream().map(e -> "_" + getExtName(e)).collect(Collectors.joining()) + "" // FIXME: factor out + ).collect(Collectors.joining("")); + branchAbstract += " {\n"; + + branchAbstract += "\n"; + branchAbstract += "@Override\n"; + branchAbstract += "public void dispatch(D data, org.scribble.runtime.message.ScribMessage m) {\n"; + branchAbstract += "switch (m.op.toString()) {\n"; + for (EAction a : s.getActions()) + { + // FIXME: factor out + boolean isSig = jc.getMainModule().getNonProtoDeclChildren().stream() + .anyMatch(npd -> (npd instanceof SigDecl) && ((SigDecl) npd).getDeclName().toString().equals(a.mid.toString())); + SigDecl msnd = null; + if (isSig) + { + msnd = (SigDecl) jc.getMainModule().getNonProtoDeclChildren().stream() + .filter(npd -> (npd instanceof SigDecl) && ((SigDecl) npd).getDeclName().toString().equals(a.mid.toString())).iterator().next(); + } + + branchAbstract += "case \"" + SessionApiGenerator.getOpClassName(a.mid) + "\": receive(data, " + SessionApiGenerator.getEndpointApiRootPackageName(this.proto) + ".roles." + a.peer + "." + a.peer + ", "; + if (isSig) + { + branchAbstract += "(" + msnd.getExtName() + ") m"; + } + else + { + branchAbstract += "(" + SessionApiGenerator.getEndpointApiRootPackageName(this.proto) + ".ops." + SessionApiGenerator.getOpClassName(a.mid) + ") m.op"; + } + int i = 0; + for (PayElemType pet : a.payload.elems) + { + DataDecl dtd = jc.getMainModule().getTypeDeclChild((DataName) pet); + branchAbstract += ", (" + dtd.getExtName() + ") m.payload[" + i++ + "]"; + } + branchAbstract += "); break;\n"; + } + branchAbstract += "default: throw new RuntimeException(\"Shouldn't get in here: \" + m);\n"; + branchAbstract += "}\n"; + branchAbstract += "}\n"; + branchAbstract += "}\n"; + + return branchAbstract; + } + + protected String generateReceiveInterface(boolean isSig, + SigDecl msnd, JobContext jc, EAction a, String rootPack, + String receiveIfName) + { + String receiveInterface = ""; + receiveInterface += "package " + getHandlersSelfPackage() + ".inputs;\n"; + receiveInterface += "\n"; + receiveInterface += "public interface " + receiveIfName + " {\n"; // Cf. original callback API, have extra parameter (o/w same) + + // Cf. output-callback i/f, only specifies peer and message (not self) + receiveInterface += "\nvoid receive(D data, " + + SessionApiGenerator.getEndpointApiRootPackageName(this.proto) + + ".roles." + a.peer + " peer, "; + if (isSig) + { + receiveInterface += msnd.getExtName() + " m"; + } + else + { + receiveInterface += SessionApiGenerator + .getEndpointApiRootPackageName(this.proto) + ".ops." + + SessionApiGenerator.getOpClassName(a.mid) + " op"; + int i = 1; + for (PayElemType pet : a.payload.elems) + { + DataDecl dtd = jc.getMainModule().getTypeDeclChild((DataName) pet); + receiveInterface += ", " + dtd.getExtName() + " arg" + i++; + } + } + receiveInterface += ");\n"; + receiveInterface += "}\n"; + + return receiveInterface; + } + + /*String generateMessageAbstractClass(String messageAbstractName, String rootPack, String mprefix) + { + InterfaceBuilder messageAbstract = new InterfaceBuilder( messageAbstractName); + messageAbstract.setPackage(getMessagesPackage(rootPack)); + messageAbstract.addModifiers("public"); + messageAbstract.addInterfaces("org.scribble.runtime.handlers.ScribOutputEvent"); + return messageAbstract.build(); + + /* //String messageIfName, String messageAbstractName, String endpointName, String rootPack, String mprefix) + String messageAbstract = ""; + messageAbstract += "package " + rootPack + ".handlers.states." + this.self + ".messages;\n"; + messageAbstract += "\n"; + messageAbstract += "public interface " + messageAbstractName + " extends org.scribble.runtime.handlers.ScribOutputEvent, " + rootPack + ".handlers.states." + this.self + ".messages.interfaces." + messageIfName + " {\n"; + messageAbstract += "}\n"; + + return messageAbstract;* / + } + + Map generateMessageClasses(String endpointName, EState s, String mprefix, String rootPack) + { + /*String messageIfName = endpointName + + s.getActions().stream().map(a -> "__" + a.peer + "_" + SessionApiGenerator.getOpClassName(a.mid) + a.payload.elems.stream().map(e -> "_" + e).collect(Collectors.joining())).collect(Collectors.joining()); + String messageInterface = generateMessageInterface(s, messageIfName, endpointName, rootPack, mprefix); + res.put(mprefix + "interfaces/" + messageIfName + ".java", messageInterface);* / + + String messageAbstractName = getMessageAbstractName(endpointName, s); // FIXME: is interface -- factor out + //String messageAbstract = generateMessageAbstract(messageIfName, messageAbstractName, endpointName, rootPack, mprefix); + + Module main = this.job.getContext().getMainModule(); + Map messageClasses = new HashMap<>(); // A class per Payload for this state + for (EAction a : s.getAllActions()) + { + /*boolean isSig = jc.getMainModule().getNonProtocolDecls().stream() // FIXME + .anyMatch(npd -> (npd instanceof MessageSigNameDecl) && ((MessageSigNameDecl) npd).getDeclName().toString().equals(a.mid.toString()));* / + + ClassBuilder messageClass; + if (!messageClasses.containsKey(a.payload)) + { + messageClass = generateMessageClass(//isSig, messageName, + s, a, endpointName, rootPack, messageAbstractName); + messageClasses.put(a.payload, messageClass); + } + else + { + messageClass = messageClasses.get(a.payload); + } + + /*String messageName = isSig + ? endpointName + "_" + SessionApiGenerator.getOpClassName(a.mid) + : endpointName + "_" + s.id + "_" + SessionApiGenerator.getOpClassName(a.mid); + String messageClass = generateMessageClass(isSig, messageName, s, a, messageIfName, rootPack, messageAbstractName); + res.put(mprefix + messageName + ".java", messageClass);* / + int[] i = { 2 }; + String[] args = new String[a.payload.elems.size() + 2]; + args[0] = getRolesPackage() + "." + a.peer + " peer"; + args[1] = getOpsPackage() + "." + SessionApiGenerator.getOpClassName(a.mid) + " op"; + a.payload.elems.forEach(e -> args[i[0]++] = main.getDataTypeDecl((DataType) e).getExtName() + " arg" + (i[0]-3)); + ConstructorBuilder ob = messageClass.newConstructor(args); + ob.addModifiers("public"); + ob.addBodyLine("super(op" + IntStream.range(0, a.payload.elems.size()).mapToObj(j -> ", arg" + j).collect(Collectors.joining()) + ");"); + } + return messageClasses; + } + + String generateMessageInterface(EState s, String messageIfName, String endpointName, String rootPack, String mprefix) + { + // FIXME: sort cases + // FIXME: generate lattice -- cf. original handler i/f's (with "subtyping") + String messageInterface = ""; + messageInterface += "package " + rootPack + ".handlers.states." + this.self + ".messages.interfaces;\n"; + messageInterface += "\n"; + messageInterface += "public interface " + messageIfName + " {\n"; + messageInterface += "}\n"; + return messageInterface; + } + + ClassBuilder generateMessageClass(//boolean isSig, String messageName, + EState s, EAction a, String endpointName, String rootPack, String messageAbstractName) + { + Module main = this.job.getContext().getMainModule(); + + ClassBuilder messageClass; + String name = //"Pay_" + + this.self + "_" + s.id + "_" // FIXME: factor out + + (a.payload.elems.isEmpty() + ? "Unit" + : a.payload.elems.stream().map(e -> + { + String extName = main.getDataTypeDecl((DataType) e).getExtName(); + return (extName.indexOf(".") != -1) + ? extName.substring(extName.lastIndexOf(".")+1, extName.length()) + : extName; + }).collect(Collectors.joining("_")) + ); // FIXME: extName sime // Not terminal + messageClass = new ClassBuilder(name); + //messageClasses.put(a.payload, messageClass); + messageClass.setPackage(getMessagesPackage(rootPack)); + messageClass.addModifiers("public"); + messageClass.setSuperClass("org.scribble.runtime.message.ScribMessage"); + messageClass.addInterfaces(messageAbstractName); + MethodBuilder getPeer = messageClass.newMethod("getPeer"); + getPeer.addModifiers("public"); + getPeer.addAnnotations("@Override"); + getPeer.setReturn("org.scribble.type.name.Role"); + getPeer.addBodyLine("return " + getRolesPackage() + "." + a.peer + "." + a.peer + ";"); + MethodBuilder getOp = messageClass.newMethod("getOp"); + getOp.addModifiers("public"); + getOp.addAnnotations("@Override"); + getOp.setReturn("org.scribble.type.name.Op"); + getOp.addBodyLine("return " + getOpsPackage() + "." + SessionApiGenerator.getOpClassName(a.mid) + "." + SessionApiGenerator.getOpClassName(a.mid) + ";"); + MethodBuilder getPayload = messageClass.newMethod("getPayload"); + getPayload.addModifiers("public"); + getPayload.addAnnotations("@Override"); + getPayload.setReturn("Object[]"); + getPayload.addBodyLine("return this.payload;"); + FieldBuilder fb = messageClass.newField("serialVersionUID"); + fb.addModifiers("private", "static", "final"); + fb.setType("long"); + fb.setExpression("1L"); + + return messageClass; + + /*MessageSigNameDecl msnd = null; + if (isSig) + { + msnd = getMessageSigNameDecl((MessageSigName) a.mid); + } + + String messageClass = ""; + messageClass += "package " + getMessagesPackage(rootPack) + ";\n"; + messageClass += "\n"; + // extends ScribMessage just for convenience of storing payload (peer/op pre-known) -- instances of this class never "directly" sent, cf., CBEndpoint + messageClass += "public class " + messageName + " extends org.scribble.runtime.message.ScribMessage implements " + messageAbstractName; + if (isSig) + { + messageClass += ", org.scribble.runtime.handlers.ScribSigMessage"; + } + messageClass += " {\n"; + messageClass += "private static final long serialVersionUID = 1L;\n"; + if (isSig) + { + messageClass += "private final " + msnd.getExtName() + " m;\n"; + } + messageClass += "\n"; + messageClass += "public " + messageName + "(" + SessionApiGenerator.getEndpointApiRootPackageName(this.proto) + ".roles." + a.peer + " peer"; + if (isSig) + { + messageClass += ", " + msnd.getExtName() + " m"; + } + else + { + int i = 1; + Module main = this.job.getContext().getMainModule(); + for (PayloadElemType pet : a.payload.elems) + { + DataTypeDecl dtd = main.getDataTypeDecl((DataType) pet); + messageClass += ", " + dtd.getExtName() + " arg" + i++; + } + } + messageClass += ") {\n"; + messageClass += "super(" + + SessionApiGenerator.getEndpointApiRootPackageName(this.proto) + ".ops." + SessionApiGenerator.getOpClassName(a.mid) + "." + SessionApiGenerator.getOpClassName(a.mid) + + IntStream.rangeClosed(1, a.payload.elems.size()).mapToObj(j -> ", arg" + j).collect(Collectors.joining("")) + ");\n"; + if (isSig) + { + messageClass += "this.m = m;\n"; + } + messageClass += "}\n"; + messageClass += "\n"; + messageClass += "@Override\n"; + messageClass += "public org.scribble.type.name.Role getPeer() {\n"; + messageClass += "return " + SessionApiGenerator.getEndpointApiRootPackageName(this.proto) + ".roles." + a.peer + "." + a.peer + ";\n"; + messageClass += "}\n"; + messageClass += "\n"; + messageClass += "@Override\n"; + messageClass += "public org.scribble.type.name.Op getOp() {\n"; + messageClass += "return " + SessionApiGenerator.getEndpointApiRootPackageName(this.proto) + ".ops." + SessionApiGenerator.getOpClassName(a.mid) + "." + SessionApiGenerator.getOpClassName(a.mid) + ";\n"; + messageClass += "}\n"; + messageClass += "\n"; + messageClass += "@Override\n"; + messageClass += "public Object[] getPayload() {\n"; + messageClass += "return this.payload;\n"; + messageClass += "}\n"; + if (isSig) + { + messageClass += "\n"; + messageClass += "@Override\n"; + messageClass += "public org.scribble.runtime.message.ScribMessage getSig() {\n"; + messageClass += "return this.m;\n"; + messageClass += "}\n"; + } + messageClass += "}\n"; + + return messageClass;* / + }*/ + + protected String getHandlersPackage() + { + return SessionApiGenerator.getEndpointApiRootPackageName(this.proto) + ".callbacks"; + } + + protected String getHandlersSelfPackage() + { + return getHandlersPackage() + "." + this.self; + } + + protected String getStatesSelfPackage() + { + return getHandlersPackage() + "." + this.self + ".states"; + } + + protected String getMessageAbstractName(String endpointName, EState s) + { + //return endpointName + "_" + s.id + "_Message"; + return "Pay_" + this.self + "_" + s.id; + } + + protected String getRolesPackage() + { + return SessionApiGenerator.getEndpointApiRootPackageName(this.proto) + ".roles"; + } + + protected String getOpsPackage() + { + return SessionApiGenerator.getEndpointApiRootPackageName(this.proto) + ".ops"; + } + + protected String getMessagesPackage(String rootPack) + { + return rootPack + ".handlers." + this.self + ".states.messages"; + } + + protected SigDecl getMessageSigNameDecl(SigName mid) + { + return (SigDecl) + this.job.getContext().getMainModule().getNonProtoDeclChildren().stream() // FIXME: main module? + .filter(npd -> (npd instanceof SigDecl) && ((SigDecl) npd).getDeclName().toString().equals(mid.toString())) + .iterator().next(); + } + + //protected final Function, String> getExtName = e -> + protected String getExtName(PayElemType e) + { + String extName = this.job.getContext().getMainModule().getTypeDeclChild((DataName) e).getExtName(); + return (extName.indexOf(".") != -1) + ? extName.substring(extName.lastIndexOf(".")+1, extName.length()) + : extName; + }; + + protected final Function getCallbackSuffix = a -> + a.peer + "_" + SessionApiGenerator.getOpClassName(a.mid) + + a.payload.elems.stream().map(e -> "_" + getExtName(e)).collect(Collectors.joining("")); // FIXME: factor out + + /*public String generateScribbleRuntimeImports() + { + return getScribbleRuntimeImports().stream().map(x -> "import \"" + x + "\"\n").collect(Collectors.joining()); + } + + private List getScribbleRuntimeImports() // FIXME: factor up + { + return Stream.of( + //EDApiGenConstants.GO_SCRIBBLERUNTIME_SESSION_PACKAGE + "" + ).collect(Collectors.toList()); + }*/ +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/java/sessionapi/SessionApiGenerator.java b/scribble-codegen/src/main/java/org/scribble/codegen/java/sessionapi/SessionApiGenerator.java new file mode 100644 index 000000000..3969e14d4 --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/java/sessionapi/SessionApiGenerator.java @@ -0,0 +1,296 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.java.sessionapi; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +import org.scribble.ast.Module; +import org.scribble.ast.global.GProtoDecl; +import org.scribble.codegen.java.ApiGen; +import org.scribble.codegen.java.util.ClassBuilder; +import org.scribble.codegen.java.util.ConstructorBuilder; +import org.scribble.codegen.java.util.FieldBuilder; +import org.scribble.codegen.java.util.JavaBuilder; +import org.scribble.codegen.java.util.MethodBuilder; +import org.scribble.core.lang.global.GProtocol; +import org.scribble.core.type.kind.Global; +import org.scribble.core.type.name.GProtoName; +import org.scribble.core.type.name.MsgId; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.global.GSeq; +import org.scribble.core.visit.gather.MessageIdGatherer; +import org.scribble.job.Job; +import org.scribble.util.ScribException; + +public class SessionApiGenerator extends ApiGen +{ + public static final String GPROTOCOLNAME_CLASS = "org.scribble.core.type.name.GProtoName"; + public static final String OP_CLASS = "org.scribble.core.type.name.Op"; + public static final String ROLE_CLASS = "org.scribble.core.type.name.Role"; + public static final String SESSION_CLASS = "org.scribble.runtime.session.Session"; + public static final String SESSIONTYPEFACTORY_CLASS = "org.scribble.core.type.session.STypeFactory"; + + private static final String IMPATH_FIELD = "IMPATH"; + private static final String SOURCE_FIELD = "SOURCE"; + private static final String PROTO_FIELD = "PROTO"; + + private final Set roles = new HashSet<>(); + private final Set> mids = new HashSet<>(); + + private final ClassBuilder cb = new ClassBuilder(); + private final Map classes = new HashMap<>(); // All classes in same package, for protected constructor access + + public SessionApiGenerator(Job job, GProtoName fullname) throws ScribException + { + super(job, fullname); + constructRoleClasses(); + constructOpClasses(); + constructSessionClass(); // Depends on the above two being done first + } + + @Override + public Map generateApi() + { + String simpname = getSessionClassName(this.gpn); + //String path = getPackageName(this.gpn).replace('.', '/') + "/" + simpname + ".java"; + String path = makePath(this.gpn, simpname); + StringBuilder sb = new StringBuilder(this.cb.build()); + //this.roles.values().forEach((cb) -> sb.append("\n\n").append(cb.generate()) ); + //this.mids.values().forEach((cb) -> sb.append("\n\n").append(cb.generate()) ); + Map map = new HashMap<>(); + map.put(path, sb.toString()); + + this.classes.keySet().stream() + .forEachOrdered(n -> map.put(n, this.classes.get(n).build())); + + return map; + } + + private static String makePath(GProtoName gpn, String simpname) + { + return getEndpointApiRootPackageName(gpn).replace('.', '/') + "/" + simpname + ".java"; + } + + /*public Map, String> getOpClasses() + { + return this.mids; + }*/ + + private void constructSessionClass() + { + String packname = getEndpointApiRootPackageName(this.gpn); + String simpname = getSessionClassName(this.gpn); + + this.cb.setName(simpname); + this.cb.setPackage(packname); + this.cb.addImports(/*"java.io.IOException", */"java.util.Arrays", "java.util.Collections", "java.util.LinkedList", "java.util.List"); + //this.cb.addImports("org.scribble.main.ScribbleRuntimeException", "org.scribble.net.session.SessionEndpoint", "org.scribble.net.ScribMessageFormatter"); + this.cb.addImports(ROLE_CLASS); + this.cb.addImports(getRolesPackageName(this.gpn) + ".*"); + if (!this.mids.isEmpty()) + { + this.cb.addImports(getOpsPackageName(this.gpn) + ".*"); + } + this.cb.addModifiers(JavaBuilder.PUBLIC, JavaBuilder.FINAL); + this.cb.setSuperClass(SessionApiGenerator.SESSION_CLASS); + + FieldBuilder fb1 = this.cb.newField(SessionApiGenerator.IMPATH_FIELD); + fb1.setType("List"); + fb1.addModifiers(JavaBuilder.PUBLIC, JavaBuilder.STATIC, JavaBuilder.FINAL); + fb1.setExpression("new LinkedList<>()"); + + FieldBuilder fb2 = this.cb.newField(SessionApiGenerator.SOURCE_FIELD); + fb2.setType("String"); + fb2.addModifiers(JavaBuilder.PUBLIC, JavaBuilder.STATIC, JavaBuilder.FINAL); + fb2.setExpression("\"getSource\""); + + FieldBuilder fb3 = this.cb.newField(SessionApiGenerator.PROTO_FIELD); + fb3.setType(SessionApiGenerator.GPROTOCOLNAME_CLASS); + fb3.addModifiers(JavaBuilder.PUBLIC, JavaBuilder.STATIC, JavaBuilder.FINAL); + fb3.setExpression(SessionApiGenerator.SESSIONTYPEFACTORY_CLASS + + ".parseGlobalProtocolName(\"" + gpn + "\")"); + + this.roles.forEach(r -> addRoleField(this.cb, r)); + this.mids.forEach(mid -> addOpField(this.cb, mid)); + + ConstructorBuilder ctor = this.cb.newConstructor(); + ctor.addModifiers(JavaBuilder.PUBLIC); + //ctor.setName(simpname); // ? + ctor.addBodyLine(JavaBuilder.SUPER + "(" + + simpname + "." + SessionApiGenerator.IMPATH_FIELD + ", " + + simpname + "." + SessionApiGenerator.SOURCE_FIELD + ", " + + simpname + "." + SessionApiGenerator.PROTO_FIELD + ");"); + + FieldBuilder fb4 = this.cb.newField("ROLES"); + fb4.setType("List"); + fb4.addModifiers(JavaBuilder.PUBLIC, JavaBuilder.STATIC, JavaBuilder.FINAL); + String roles = "Collections.unmodifiableList(Arrays.asList(new Role[] {"; + roles += this.roles.stream().map((r) -> r.toString()).collect(Collectors.joining(", ")); + roles += "}))"; + fb4.setExpression(roles); + + /*for (Role r : this.roles) + { + String role = getRoleClassName(r); + MethodBuilder mb = this.cb.newMethod("project"); // No: use new on SessionEndpoint directly for Eclipse resource leak warning + mb.addModifiers(ClassBuilder.PUBLIC); + mb.setReturn("SessionEndpoint<" + simpname + ", " + role + ">"); + mb.addParameters(role + " role", "ScribMessageFormatter smf"); + mb.addExceptions("ScribbleRuntimeException", "IOException"); + mb.addBodyLine(ClassBuilder.RETURN + " " + ClassBuilder.SUPER + ".project(role, smf);"); + }*/ + + MethodBuilder mb = this.cb.newMethod("getRoles"); + mb.addAnnotations("@Override"); + mb.addModifiers(JavaBuilder.PUBLIC); + mb.setReturn("List"); + mb.addParameters(); + mb.addBodyLine(JavaBuilder.RETURN + " " + simpname + ".ROLES;"); + } + + private void addRoleField(ClassBuilder cb, Role role) + { + addSingletonConstant(cb, "roles", getRoleClassName(role)); // FIXME: factor out + } + + private void addOpField(ClassBuilder cb, MsgId mid) + { + addSingletonConstant(cb, "ops", getOpClassName(mid)); // FIXME: factor out + } + + private void addSingletonConstant(ClassBuilder cb, String subpack, String type) + { + FieldBuilder fb = cb.newField(type); + fb.setType(type); + fb.addModifiers(JavaBuilder.PUBLIC, JavaBuilder.STATIC, JavaBuilder.FINAL); + //fb.setExpression(ClassBuilder.NEW + " " + type + "()"); + fb.setExpression(getEndpointApiRootPackageName(this.gpn) + "." + subpack + "." + type + "." + type); // Currently requires source Scribble to be in a package that is not the root -- can fix by generating to a subpackage based on Module and/or protocol + } + + private void constructOpClasses() throws ScribException + { + /*Module mod = this.lang.getContext().getModule(this.gpn.getPrefix()); + GProtocolName simpname = this.gpn.getSimpleName(); + GProtocolDecl gpd = (GProtocolDecl) mod.getProtocolDeclChild(simpname); + MessageIdCollector coll = new MessageIdCollector(this.lang, ((ModuleDel) mod.del()).getModuleContext()); + gpd.accept(coll); + for (MessageId mid : coll.getNames())*/ + GProtocol inlined = this.core.getContext().getInlined(this.gpn); + for (MsgId mid : inlined.def + .gather(new MessageIdGatherer()::visit) + .collect(Collectors.toList())) + { + //constructOpClass(this.cb.newClass(), mid); + //constructOpClass(new ClassBuilder(), getEndpointApiRootPackageName(this.gpn), mid); + constructOpClass(new ClassBuilder(), getOpsPackageName(this.gpn), mid); + this.mids.add(mid); + } + } + + private void constructRoleClasses() throws ScribException + { + Module mod = this.job.getContext().getModule(this.gpn.getPrefix()); + GProtoName simpname = this.gpn.getSimpleName(); + GProtoDecl gpd = (GProtoDecl) mod.getGProtocolDeclChild(simpname); + for (Role r : gpd.getRoles()) + { + //constructRoleClass(this.cb.newClass(), r); + //constructRoleClass(new ClassBuilder(), getEndpointApiRootPackageName(this.gpn), r); + constructRoleClass(new ClassBuilder(), getRolesPackageName(this.gpn), r); + this.roles.add(r); + } + } + + private ClassBuilder constructRoleClass(ClassBuilder cb, String pack, Role r) + { + return constructSingletonClass(cb, pack, SessionApiGenerator.ROLE_CLASS, getRoleClassName(r)); + } + + private ClassBuilder constructOpClass(ClassBuilder cb, String pack, MsgId mid) + { + return constructSingletonClass(cb, pack, SessionApiGenerator.OP_CLASS, getOpClassName(mid)); + } + + private ClassBuilder constructSingletonClass(ClassBuilder cb, String pack, String superc, String type) + { + cb.setName(type); + cb.addModifiers(JavaBuilder.PUBLIC, JavaBuilder.FINAL); + cb.setPackage(pack); + cb.setSuperClass(superc); + + FieldBuilder fb = cb.newField("serialVersionUID"); + fb.addModifiers(JavaBuilder.PRIVATE, JavaBuilder.STATIC, JavaBuilder.FINAL); + fb.setType("long"); + fb.setExpression("1L"); + + FieldBuilder fb2 = cb.newField(type); + fb2.addModifiers(JavaBuilder.PUBLIC, JavaBuilder.STATIC, JavaBuilder.FINAL); + fb2.setType(type); + fb2.setExpression(JavaBuilder.NEW + " " + type + "()"); + + ConstructorBuilder mb = cb.newConstructor(); + mb.addModifiers(JavaBuilder.PRIVATE); + mb.addBodyLine(JavaBuilder.SUPER + "(\"" + type + "\");"); + + this.classes.put(pack.replace('.', '/') + "/" + type + ".java", cb); + return cb; + } + + // Returns the simple Session Class name + public static String getSessionClassName(GProtoName gpn) + { + return gpn.getSimpleName().toString(); + } + + // Returns the Java output package: currently the Scribble package excluding the Module + public static String getEndpointApiRootPackageName(GProtoName gpn) + { + //return gpn.getPrefix().getPrefix().toString(); // Java output package name (not Scribble package) + // FIXME: factor out with StateChannelApiGenerator.generateClasses + //return gpn.getPrefix().getPrefix().toString() + "." + gpn.getSimpleName(); // Java output package name (not Scribble package) + return gpn.toString(); + } + + public static String getRolesPackageName(GProtoName gpn) + { + return getEndpointApiRootPackageName(gpn) + ".roles"; + } + + public static String getOpsPackageName(GProtoName gpn) + { + return getEndpointApiRootPackageName(gpn) + ".ops"; + } + + public static String getStateChannelPackageName(GProtoName gpn, Role self) + { + return getEndpointApiRootPackageName(gpn) + ".statechans." + self; + } + + // Returns the simple Role Class name + public static String getRoleClassName(Role r) + { + return r.toString(); + } + + // Returns the simple Op Class name: names starting with a digit are prefixed by '_' + public static String getOpClassName(MsgId mid) + { + String s = mid.toString(); + return (s.isEmpty() || s.charAt(0) < 65) ? "_" + s : s; // Hacky? + } +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/AcceptSockGen.java b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/AcceptSockGen.java new file mode 100644 index 000000000..b05af6f76 --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/AcceptSockGen.java @@ -0,0 +1,84 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.java.statechanapi; + +import java.util.List; + +import org.scribble.codegen.java.sessionapi.SessionApiGenerator; +import org.scribble.codegen.java.util.JavaBuilder; +import org.scribble.codegen.java.util.MethodBuilder; +import org.scribble.core.model.endpoint.EState; +import org.scribble.core.model.endpoint.actions.EAction; + +public class AcceptSockGen extends ScribSockGen +{ + public AcceptSockGen(StateChannelApiGenerator apigen, EState curr) + { + super(apigen, curr); + } + + @Override + protected String getSuperClassType() + { + return ACCEPTSOCKET_CLASS + "<" + getSessionClassName() + ", " + getSelfClassName() + ">"; + } + + @Override + protected void addImports() + { + super.addImports(); + //this.cb.addImports(getOpsPackageName() + ".*"); + } + + @Override + protected void addMethods() + { + //Set as = curr.getActions(); + List as = curr.getDetActions(); + if (as.size() > 1) + { + throw new RuntimeException("AcceptSocket generation not yet supported for accept-branches: " + as); + } + EAction a = as.iterator().next(); + EState succ = curr.getDetSuccessor(a); + makeAcceptMethod(a, succ); + } + + private void makeAcceptMethod(EAction a, EState succ) + { + MethodBuilder mb = makeAcceptHeader(a, succ); + mb.addBodyLine(JavaBuilder.SUPER + ".accept(ss, " + getSessionApiRoleConstant(a.obj) + ");"); + addReturnNextSocket(mb, succ); + } + + private MethodBuilder makeAcceptHeader(EAction a, EState succ) + { + MethodBuilder mb = this.cb.newMethod(); + setAcceptHeaderWithoutReturnType(this.apigen, a, mb); + setNextSocketReturnType(this.apigen, mb, succ); + return mb; + } + + // Doesn't include return type + //public static void makeReceiveHeader(StateChannelApiGenerator apigen, IOAction a, EndpointState succ, MethodBuilder mb) + public static void setAcceptHeaderWithoutReturnType(StateChannelApiGenerator apigen, EAction a, MethodBuilder mb) + { + final String ROLE_PARAM = "role"; + + mb.setName("accept"); + mb.addModifiers(JavaBuilder.PUBLIC); + mb.addExceptions(StateChannelApiGenerator.SCRIBBLERUNTIMEEXCEPTION_CLASS, "java.io.IOException"); + mb.addParameters(SessionApiGenerator.getRoleClassName(a.obj) + " " + ROLE_PARAM, SCRIBSERVERSOCKET_CLASS + " ss"); + } +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/AuxStateChanTypeGen.java b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/AuxStateChanTypeGen.java new file mode 100644 index 000000000..8cad5b6d5 --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/AuxStateChanTypeGen.java @@ -0,0 +1,28 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.java.statechanapi; + +import org.scribble.codegen.java.util.TypeBuilder; + +// An auxiliary class builder: supplemental to the class being built via the parent ClassBuilder +public abstract class AuxStateChanTypeGen extends StateChanTypeGen +{ + protected final TypeBuilder parent; + + public AuxStateChanTypeGen(StateChannelApiGenerator apigen, TypeBuilder parent) + { + super(apigen); + this.parent = parent; + } +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/BranchSockGen.java b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/BranchSockGen.java new file mode 100644 index 000000000..e5f5aa47b --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/BranchSockGen.java @@ -0,0 +1,405 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.java.statechanapi; + +import java.util.stream.Collectors; + +import org.scribble.ast.DataDecl; +import org.scribble.ast.SigDecl; +import org.scribble.ast.Module; +import org.scribble.codegen.java.sessionapi.SessionApiGenerator; +import org.scribble.codegen.java.statechanapi.ioifaces.BranchIfaceGen; +import org.scribble.codegen.java.statechanapi.ioifaces.HandleIfaceGen; +import org.scribble.codegen.java.statechanapi.ioifaces.IOStateIfaceGen; +import org.scribble.codegen.java.statechanapi.ioifaces.SuccessorIfaceGen; +import org.scribble.codegen.java.util.ClassBuilder; +import org.scribble.codegen.java.util.EnumBuilder; +import org.scribble.codegen.java.util.JavaBuilder; +import org.scribble.codegen.java.util.MethodBuilder; +import org.scribble.core.model.endpoint.EState; +import org.scribble.core.model.endpoint.actions.EAction; +import org.scribble.core.type.name.DataName; +import org.scribble.core.type.name.SigName; +import org.scribble.core.type.name.PayElemType; +import org.scribble.core.type.name.Role; +import org.scribble.util.ScribException; + +public class BranchSockGen extends ScribSockGen +{ + public BranchSockGen(StateChannelApiGenerator apigen, EState curr) + { + super(apigen, curr); + } + + @Override + protected String getSuperClassType() + { + return BRANCHSOCKET_CLASS + "<" + getSessionClassName() + ", " + getSelfClassName() + ">"; + } + + @Override + protected void addImports() + { + this.cb.addImports("java.io.IOException"); + super.addImports(); + } + + //private void addBranchMethod(ClassBuilder cb, EndpointState curr) + @Override + protected void addMethods() throws ScribException + { + final String ROLE_PARAM = "role"; + final String MESSAGE_VAR = "m"; + final String OPENUM_VAR = "openum"; + final String OP = MESSAGE_VAR + "." + StateChannelApiGenerator.SCRIBMESSAGE_OP_FIELD; + + Module main = this.apigen.getMainModule(); + + //String next = constructCaseClass(curr, main); + ClassBuilder caseclass = new CaseSockGen(this.apigen, this.curr).generateType(); + String next = caseclass.getName(); + String enumClass = getBranchEnumClassName(this.apigen, this.curr); + + //cb.addImports("java.util.concurrent.ExecutionException"); + + //boolean first; + Role peer = this.curr.getDetActions().iterator().next().obj; + + // Branch method + addBranchMethod(ROLE_PARAM, MESSAGE_VAR, OPENUM_VAR, OP, peer, next, enumClass); + + //if (IOInterfacesGenerator.skipIOInterfacesGeneration(apigen.getInitialState())) + if (this.apigen.skipIOInterfacesGeneration) + { + EnumBuilder eb = cb.newMemberEnum(enumClass); + eb.addModifiers(JavaBuilder.PUBLIC); + eb.addInterfaces(OPENUM_INTERFACE); + this.curr.getDetActions().forEach( + a -> eb.addValues(SessionApiGenerator.getOpClassName(a.mid))); + + addDirectBranchCallbackMethod(ROLE_PARAM, MESSAGE_VAR, OP, main, peer); // Hack: callback apigen while i/o i/f's not supported for connect/accept/etc + } + else + { + // Callback methods + String handleif = addBranchCallbackMethod(ROLE_PARAM, peer); + addHandleInterfaceCallbackMethod(ROLE_PARAM, MESSAGE_VAR, OP, main, peer, handleif); + addHandleMethod(ROLE_PARAM, MESSAGE_VAR, OP, main, peer); + } + + this.apigen.addTypeDecl(new HandlerIfaceGen(this.apigen, this.cb, this.curr).generateType()); + } + + private void addBranchMethod(final String ROLE_PARAM, final String MESSAGE_VAR, final String OPENUM_VAR, final String OP, + Role peer, String next, String enumClass) + { + MethodBuilder mb = cb.newMethod("branch"); + mb.setReturn(next); + mb.addParameters(SessionApiGenerator.getRoleClassName(curr.getDetActions().iterator().next().obj) + " " + ROLE_PARAM); + mb.addModifiers(JavaBuilder.PUBLIC); + mb.addExceptions(StateChannelApiGenerator.SCRIBBLERUNTIMEEXCEPTION_CLASS, "IOException", "ClassNotFoundException");//, "ExecutionException", "InterruptedException"); + if (!this.apigen.skipIOInterfacesGeneration) + { + mb.addAnnotations("@Override"); + } + + mb.addBodyLine(StateChannelApiGenerator.SCRIBMESSAGE_CLASS + " " + MESSAGE_VAR + " = " + + JavaBuilder.SUPER + ".readScribMessage(" + getSessionApiRoleConstant(peer) + ");"); + mb.addBodyLine(enumClass + " " + OPENUM_VAR + ";"); + boolean first = true; + for (EAction a : this.curr.getDetActions()) + { + mb.addBodyLine(((first) ? "" : "else ") + "if (" + OP + ".equals(" + getSessionApiOpConstant(a.mid) + ")) {"); + mb.addBodyLine(1, OPENUM_VAR + " = " + + enumClass + "." + SessionApiGenerator.getOpClassName(a.mid) + ";"); + mb.addBodyLine("}"); + first = false; + } + mb.addBodyLine("else {"); + mb.addBodyLine(1, "throw " + JavaBuilder.NEW + " RuntimeException(\"Won't get here: \" + " + OP + ");"); + mb.addBodyLine("}"); + mb.addBodyLine(JavaBuilder.RETURN + " " + + JavaBuilder.NEW + " " + next + "(" + SCRIBSOCKET_SE_FIELD + ", true, " + OPENUM_VAR + ", " + MESSAGE_VAR + ");"); // FIXME: dummy boolean not needed + } + + private String addBranchCallbackMethod(final String ROLE_PARAM, Role peer) + { + boolean first; + String handlerif = HandlerIfaceGen.getHandlerInterfaceName(this.cb.getName()); + String handleif = HandleIfaceGen.getHandleInterfaceName(this.apigen.getSelf(), this.curr); + MethodBuilder mb2 = this.cb.newMethod("branch"); + mb2.addParameters(SessionApiGenerator.getRoleClassName(peer) + " " + ROLE_PARAM); + //mb2.addParameters("java.util.concurrent.Callable<" + ifname + "> branch"); + mb2.addParameters(handlerif + " handler"); + mb2.setReturn(JavaBuilder.VOID); + mb2.addModifiers(JavaBuilder.PUBLIC); + mb2.addExceptions(StateChannelApiGenerator.SCRIBBLERUNTIMEEXCEPTION_CLASS, "IOException", "ClassNotFoundException");//, "ExecutionException", "InterruptedException"); + first = true; + handleif += "<"; + for (EAction a : this.curr.getDetActions().stream().sorted(IOStateIfaceGen.IOACTION_COMPARATOR).collect(Collectors.toList())) + { + if (first) + { + first = false; + } + else + { + handleif += ", "; + } + EState succ = this.curr.getDetSuccessor(a); + if (succ.isTerminal()) + { + handleif += ScribSockGen.GENERATED_ENDSOCKET_NAME; + } + else + { + handleif += this.apigen.getSocketClassName(succ); + } + } + handleif += ">"; + mb2.addBodyLine("branch(role, (" + handleif + ") handler);"); + return handleif; + } + + private void addHandleInterfaceCallbackMethod(final String ROLE_PARAM, + final String MESSAGE_VAR, final String OP, Module main, Role peer, + String handleif) + { + MethodBuilder mb3 = this.cb.newMethod("branch"); + mb3.addParameters(SessionApiGenerator.getRoleClassName(peer) + " " + ROLE_PARAM); + //mb2.addParameters("java.util.concurrent.Callable<" + ifname + "> branch"); + mb3.addParameters(handleif + " handler"); + mb3.setReturn(JavaBuilder.VOID); + mb3.addModifiers(JavaBuilder.PUBLIC); + mb3.addAnnotations("@Override"); + mb3.addExceptions(StateChannelApiGenerator.SCRIBBLERUNTIMEEXCEPTION_CLASS, "IOException", "ClassNotFoundException");//, "ExecutionException", "InterruptedException"); + + addCallbackCases(mb3, ROLE_PARAM, MESSAGE_VAR, OP, main, peer); + + /*boolean first; + mb3.addBodyLine(StateChannelApiGenerator.SCRIBMESSAGE_CLASS + " " + MESSAGE_VAR + " = " + + JavaBuilder.SUPER + ".readScribMessage(" + getSessionApiRoleConstant(peer) + ");"); + first = true; + for (EAction a : this.curr.getActions()) + { + EState succ = this.curr.getSuccessor(a); + if (first) + { + first = false; + } + else + { + mb3.addBodyLine("else"); + } + mb3.addBodyLine("if (" + MESSAGE_VAR + "." + StateChannelApiGenerator.SCRIBMESSAGE_OP_FIELD + ".equals(" + getSessionApiOpConstant(a.mid) + ")) {"); + if (succ.isTerminal()) + { + mb3.addBodyLine(1, SCRIBSOCKET_SE_FIELD + ".setCompleted();"); + } + String ln = "handler.receive("; + //if (!succ.isTerminal()) + { + //FIXME: factor out with addReturn? + ln += JavaBuilder.NEW + " " + (succ.isTerminal() ? ScribSocketGenerator.GENERATED_ENDSOCKET_NAME : this.apigen.getSocketClassName(succ)) + "(" + SCRIBSOCKET_SE_FIELD + ", true), "; + } + ln += getSessionApiOpConstant(a.mid); + + // Based on receive parameters + if (a.mid.isOp()) + { + if (!a.payload.isEmpty()) + { + String buffSuper = JavaBuilder.NEW + " " + BUF_CLASS + "<>("; + int i = 0; + for (PayloadType pt : a.payload.elems) + { + DataTypeDecl dtd = main.getDataTypeDecl((DataType) pt); // TODO: if not DataType + ln += ", " + buffSuper + "(" + dtd.extName + ") " + RECEIVE_MESSAGE_PARAM + "." + SCRIBMESSAGE_PAYLOAD_FIELD + "[" + i++ + "])"; + } + } + } + else + { + MessageSigNameDecl msd = main.getMessageSigDecl(((MessageSigName) a.mid).getSimpleName()); // FIXME: might not belong to main module + ln += ", " + JavaBuilder.NEW + " " + BUF_CLASS + "<>((" + msd.extName + ") " + RECEIVE_MESSAGE_PARAM + "." + SCRIBMESSAGE_PAYLOAD_FIELD + "[0])"; + } + + ln += ");"; + mb3.addBodyLine(1, ln); + mb3.addBodyLine("}"); + } + mb3.addBodyLine("else {"); + mb3.addBodyLine(1, "throw " + JavaBuilder.NEW + " RuntimeException(\"Won't get here: \" + " + OP + ");"); + mb3.addBodyLine("}");*/ + } + + // FIXME: factor out with others (addCallbackCases) + private void addHandleMethod(final String ROLE_PARAM, final String MESSAGE_VAR, final String OP, Module main, Role peer) + { + boolean first; + MethodBuilder mb4 = this.cb.newMethod("handle"); + mb4.addParameters(SessionApiGenerator.getRoleClassName(peer) + " " + ROLE_PARAM); + String tmp = HandleIfaceGen.getHandleInterfaceName(this.apigen.getSelf(), this.curr) + "<"; + tmp += this.curr.getDetActions().stream().sorted(IOStateIfaceGen.IOACTION_COMPARATOR) + .map((a) -> SuccessorIfaceGen.getSuccessorInterfaceName(a)).collect(Collectors.joining(", ")) + ">"; + mb4.addParameters(tmp + " handler"); + mb4.setReturn(JavaBuilder.VOID); + mb4.addModifiers(JavaBuilder.PUBLIC); + mb4.addExceptions(StateChannelApiGenerator.SCRIBBLERUNTIMEEXCEPTION_CLASS, "IOException", "ClassNotFoundException");//, "ExecutionException", "InterruptedException"); + mb4.addAnnotations("@Override"); + mb4.addBodyLine(StateChannelApiGenerator.SCRIBMESSAGE_CLASS + " " + MESSAGE_VAR + " = " + + JavaBuilder.SUPER + ".readScribMessage(" + getSessionApiRoleConstant(peer) + ");"); + first = true; + for (EAction a : this.curr.getDetActions()) + { + EState succ = this.curr.getDetSuccessor(a); + if (first) + { + first = false; + } + else + { + mb4.addBodyLine("else"); + } + mb4.addBodyLine("if (" + MESSAGE_VAR + "." + StateChannelApiGenerator.SCRIBMESSAGE_OP_FIELD + ".equals(" + getSessionApiOpConstant(a.mid) + ")) {"); + if (succ.isTerminal()) + { + mb4.addBodyLine(1, SCRIBSOCKET_SE_FIELD + ".setCompleted();"); + } + String ln = "handler.receive("; + //if (!succ.isTerminal()) + { + //FIXME: factor out with addReturn? + ln += JavaBuilder.NEW + " " + (succ.isTerminal() ? ScribSockGen.GENERATED_ENDSOCKET_NAME : this.apigen.getSocketClassName(succ)) + "(" + SCRIBSOCKET_SE_FIELD + ", true), "; + } + ln += getSessionApiOpConstant(a.mid); + + // Based on receive parameters + if (a.mid.isOp()) + { + if (!a.payload.isEmpty()) + { + String buffSuper = JavaBuilder.NEW + " " + BUF_CLASS + "<>("; + int i = 0; + for (PayElemType pt : a.payload.elems) + { + DataDecl dtd = main.getTypeDeclChild((DataName) pt); // TODO: if not DataType + ln += ", " + buffSuper + "(" + dtd.getExtName() + ") " + RECEIVE_MESSAGE_PARAM + "." + SCRIBMESSAGE_PAYLOAD_FIELD + "[" + i++ + "])"; + } + } + } + else + { + SigDecl msd = main.getSigDeclChild(((SigName) a.mid).getSimpleName()); // FIXME: might not belong to main module + ln += ", " + JavaBuilder.NEW + " " + BUF_CLASS + "<>((" + msd.getExtName() + ") " + RECEIVE_MESSAGE_PARAM + //+ "." + SCRIBMESSAGE_PAYLOAD_FIELD + "[0]" // CHECKME: betty16.lec2.smtp.SmtpC4 + + ")"; + } + + ln += ");"; + mb4.addBodyLine(1, ln); + mb4.addBodyLine("}"); + } + mb4.addBodyLine("else {"); + mb4.addBodyLine(1, "throw " + JavaBuilder.NEW + " RuntimeException(\"Won't get here: \" + " + OP + ");"); + mb4.addBodyLine("}"); + } + + protected static String getBranchEnumClassName(StateChannelApiGenerator apigen, EState curr) + { + //return BranchInterfaceGenerator.getBranchInterfaceEnumName(apigen.getSelf(), curr); + //return (IOInterfacesGenerator.skipIOInterfacesGeneration(apigen.getInitialState())) + return apigen.skipIOInterfacesGeneration + ? apigen.getSocketClassName(curr) + "_Enum" + : BranchIfaceGen.getBranchInterfaceEnumName(apigen.getSelf(), curr); + } + + // branch callback, that doesn't just call handle (cf. addBranchCallbackMethod) -- hack, callback apigen while i/o i/f's not supported for connect/accept/etc + private void addDirectBranchCallbackMethod(final String ROLE_PARAM, + final String MESSAGE_VAR, final String OP, Module main, Role peer) + { + String handlerif = HandlerIfaceGen.getHandlerInterfaceName(this.cb.getName()); + MethodBuilder mb2 = this.cb.newMethod("branch"); + mb2.addParameters(SessionApiGenerator.getRoleClassName(peer) + " " + ROLE_PARAM); + mb2.addParameters(handlerif + " handler"); + mb2.setReturn(JavaBuilder.VOID); + mb2.addModifiers(JavaBuilder.PUBLIC); + mb2.addExceptions(StateChannelApiGenerator.SCRIBBLERUNTIMEEXCEPTION_CLASS, "IOException", "ClassNotFoundException");//, "ExecutionException", "InterruptedException"); + //mb2.addBodyLine("branch(role, (" + handleif + ") handler);"); + + addCallbackCases(mb2, ROLE_PARAM, MESSAGE_VAR, OP, main, peer); + } + + private void addCallbackCases(MethodBuilder mb2, final String ROLE_PARAM, + final String MESSAGE_VAR, final String OP, Module main, Role peer) + { + boolean first; + mb2.addBodyLine(StateChannelApiGenerator.SCRIBMESSAGE_CLASS + " " + MESSAGE_VAR + " = " + + JavaBuilder.SUPER + ".readScribMessage(" + getSessionApiRoleConstant(peer) + ");"); + first = true; + for (EAction a : this.curr.getDetActions()) + { + EState succ = this.curr.getDetSuccessor(a); + if (first) + { + first = false; + } + else + { + mb2.addBodyLine("else"); + } + mb2.addBodyLine("if (" + MESSAGE_VAR + "." + StateChannelApiGenerator.SCRIBMESSAGE_OP_FIELD + ".equals(" + getSessionApiOpConstant(a.mid) + ")) {"); + if (succ.isTerminal()) + { + mb2.addBodyLine(1, SCRIBSOCKET_SE_FIELD + ".setCompleted();"); + } + String ln = "handler.receive("; + //if (!succ.isTerminal()) + { + //FIXME: factor out with addReturn? + ln += JavaBuilder.NEW + " " + (succ.isTerminal() ? ScribSockGen.GENERATED_ENDSOCKET_NAME : this.apigen.getSocketClassName(succ)) + "(" + SCRIBSOCKET_SE_FIELD + ", true), "; + } + ln += getSessionApiOpConstant(a.mid); + + // Based on receive parameters + if (a.mid.isOp()) + { + if (!a.payload.isEmpty()) + { + String buffSuper = JavaBuilder.NEW + " " + BUF_CLASS + "<>("; + int i = 0; + for (PayElemType pt : a.payload.elems) + { + DataDecl dtd = main.getTypeDeclChild((DataName) pt); // TODO: if not DataType + ln += ", " + buffSuper + "(" + dtd.getExtName() + ") " + RECEIVE_MESSAGE_PARAM + "." + SCRIBMESSAGE_PAYLOAD_FIELD + "[" + i++ + "])"; + } + } + } + else + { + SigDecl msd = main.getSigDeclChild(((SigName) a.mid).getSimpleName()); // FIXME: might not belong to main module + ln += ", " + JavaBuilder.NEW + " " + BUF_CLASS + "<>((" + msd.getExtName() + ") " + RECEIVE_MESSAGE_PARAM + //+ "." + SCRIBMESSAGE_PAYLOAD_FIELD + "[0]" // CHECKME: betty16.lec2.smtp.SmtpC4 + + ")"; + } + + ln += ");"; + mb2.addBodyLine(1, ln); + mb2.addBodyLine("}"); + } + mb2.addBodyLine("else {"); + mb2.addBodyLine(1, "throw " + JavaBuilder.NEW + " RuntimeException(\"Won't get here: \" + " + OP + ");"); + mb2.addBodyLine("}"); + } +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/CaseSockGen.java b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/CaseSockGen.java new file mode 100644 index 000000000..e64c90412 --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/CaseSockGen.java @@ -0,0 +1,251 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.java.statechanapi; + +import java.util.stream.Collectors; + +import org.scribble.ast.SigDecl; +import org.scribble.ast.Module; +import org.scribble.codegen.java.sessionapi.SessionApiGenerator; +import org.scribble.codegen.java.statechanapi.ioifaces.BranchIfaceGen; +import org.scribble.codegen.java.statechanapi.ioifaces.IOStateIfaceGen; +import org.scribble.codegen.java.util.ClassBuilder; +import org.scribble.codegen.java.util.FieldBuilder; +import org.scribble.codegen.java.util.JavaBuilder; +import org.scribble.codegen.java.util.MethodBuilder; +import org.scribble.core.model.endpoint.EState; +import org.scribble.core.model.endpoint.actions.EAction; +import org.scribble.core.type.name.DataName; +import org.scribble.core.type.name.SigName; +import org.scribble.core.type.name.Role; +import org.scribble.util.ScribException; + +public class CaseSockGen extends ScribSockGen +{ + public CaseSockGen(StateChannelApiGenerator apigen, EState curr) + { + super(apigen, curr); + } + + @Override + protected String getClassName() + { + return getCaseSocketName(super.getClassName()); + } + + @Override + protected String getSuperClassType() + { + return CASESOCKET_CLASS + "<" + getSessionClassName() + ", " + getSelfClassName() + ">"; + } + + @Override + protected void addImports() + { + super.addImports(); + this.cb.addImports(getOpsPackageName() + ".*"); + } + + @Override + protected void addInitialStateConstructor() + { + return; + } + + @Override + protected MethodBuilder addConstructor() + { + String branchName = this.apigen.getSocketClassName(curr); // Name of "parent" branch class (curr state is the branch state) + String enumClassName = branchName + "." + BranchSockGen.getBranchEnumClassName(this.apigen, this.curr); + + MethodBuilder ctor = super.addConstructor(); + ctor.addParameters(enumClassName + " " + CASE_OP_PARAM, StateChannelApiGenerator.SCRIBMESSAGE_CLASS + " " + CASE_MESSAGE_PARAM); + ctor.addBodyLine(JavaBuilder.THIS + "." + CASE_OP_FIELD + " = " + CASE_OP_PARAM + ";"); + ctor.addBodyLine(JavaBuilder.THIS + "." + CASE_MESSAGE_FIELD + " = " + CASE_MESSAGE_PARAM + ";"); + return ctor; + } + + //private String constructCaseClass(EndpointState curr, Module main) + @Override + protected void addMethods() throws ScribException + { + String branchName = this.apigen.getSocketClassName(curr); // Name of "parent" branch class (curr state is the branch state) + String enumClassName = branchName + "." + BranchSockGen.getBranchEnumClassName(this.apigen, this.curr); + //String className = newClassName(); // Name of branch-receive class + + FieldBuilder fb1 = this.cb.newField(CASE_OP_FIELD); // The op enum, for convenient switch/if/etc by user (correctly derived by code generation from the received ScribMessage) + fb1.addModifiers(JavaBuilder.PUBLIC, JavaBuilder.FINAL); + fb1.setType(enumClassName); + + FieldBuilder fb2 = this.cb.newField(CASE_MESSAGE_FIELD); // The received ScribMessage (branch-check checks the user-selected receive op against the ScribMessage op) + fb2.addModifiers(JavaBuilder.PRIVATE, JavaBuilder.FINAL); + fb2.setType(StateChannelApiGenerator.SCRIBMESSAGE_CLASS); + + for (EAction a : this.curr.getDetActions()) + { + EState succ = this.curr.getDetSuccessor(a); + addReceiveMethod(this.cb, a, succ); + addCaseReceiveMethod(this.cb, a, succ); + if (!a.payload.isEmpty() || a.mid.isSigName()) + { + addCaseReceiveDiscardMethod(this.cb, a, succ); + } + } + + if (!this.apigen.skipIOInterfacesGeneration) + { + Role self = this.apigen.getSelf(); + MethodBuilder mb = this.cb.newMethod("getOp"); + mb.addAnnotations("@Override"); + mb.addModifiers(JavaBuilder.PUBLIC); + mb.setReturn(IOStateIfaceGen.getIOStateInterfaceName(self, this.curr) + "." + BranchIfaceGen.getBranchInterfaceEnumName(self, this.curr)); + mb.addBodyLine(JavaBuilder.RETURN + " " + JavaBuilder.THIS + "." + CASE_OP_FIELD + ";"); + } + + this.apigen.addTypeDecl(this.cb); // CaseSocketBuilder used by BranchSocketBuilder, not EndpointApiGenerator + } + + // Same as in ReceiveSocketGenerator + private MethodBuilder makeReceiveHeader(ClassBuilder cb, EAction a, EState succ) throws ScribException + { + MethodBuilder mb = cb.newMethod(); + ReceiveSockGen.setReceiveHeaderWithoutReturnType(this.apigen, a, mb); + setNextSocketReturnType(this.apigen, mb, succ); + return mb; + } + + private void addReceiveMethod(ClassBuilder cb, EAction a, EState succ) throws ScribException + { + Module main = this.apigen.getMainModule(); + + MethodBuilder mb = makeReceiveHeader(cb, a, succ); + if (a.mid.isOp()) + { + mb.addBodyLine(JavaBuilder.SUPER + ".use();"); + addBranchCheck(getSessionApiOpConstant(a.mid), mb, CASE_MESSAGE_FIELD); + ReceiveSockGen.addPayloadBuffSetters(main, a, mb); + } + else //if (a.mid.isMessageSigName()) + { + SigDecl msd = main.getSigDeclChild(((SigName) a.mid).getSimpleName()); // FIXME: might not belong to main module + mb.addBodyLine(JavaBuilder.SUPER + ".use();"); + addBranchCheck(getSessionApiOpConstant(a.mid), mb, CASE_MESSAGE_FIELD); + mb.addBodyLine(CASE_ARG_PREFIX + "." + BUFF_VAL_FIELD + " = (" + msd.getExtName() + ") " + CASE_MESSAGE_FIELD + ";"); + } + addReturnNextSocket(mb, succ); + } + + private MethodBuilder makeCaseReceiveHeader(ClassBuilder cb, EAction a, EState succ) throws ScribException + { + MethodBuilder mb = cb.newMethod(); + setCaseReceiveHeaderWithoutReturnType(this.apigen, a, mb); + setNextSocketReturnType(this.apigen, mb, succ); + return mb; + } + + private void addCaseReceiveMethod(ClassBuilder cb, EAction a, EState succ) throws ScribException + { + MethodBuilder mb = makeCaseReceiveHeader(cb, a, succ); + String ln = JavaBuilder.RETURN + " " + "receive(" + getSessionApiRoleConstant(a.obj) + ", "; + //ln += mb.getParameters().stream().map((p) -> p.substring(p.indexOf(" ") + 1, p.length())).collect(Collectors.joining(", ")) + ");"; + boolean first = true; + for (String param : mb.getParameters()) + { + if (first) + { + first = false; + } + else + { + ln += ", "; + } + if (param.contains("<")) + { + param = param.substring(param.lastIndexOf('>') + 1, param.length()); + } + ln += param.substring(param.indexOf(" ") + 1, param.length()); + } + mb.addBodyLine(ln + ");"); + } + + private void addCaseReceiveDiscardMethod(ClassBuilder cb, EAction a, EState succ) + { + Module main = this.apigen.getMainModule(); + + MethodBuilder mb = cb.newMethod(); + setCaseReceiveDiscardHeaderWithoutReturnType(this.apigen, a, mb); + setNextSocketReturnType(this.apigen, mb, succ); + + mb.addAnnotations("@SuppressWarnings(\"unchecked\")"); + String ln = JavaBuilder.RETURN + " "; + ln += "receive(" + CASE_OP_PARAM + ", "; + if (a.mid.isOp()) + { + ln += a.payload.elems.stream() + .map((pt) -> getGarbageBuf(main.getTypeDeclChild(((DataName) pt)).getExtName())).collect(Collectors.joining(", ")) + ");"; + } + else + { + SigDecl msd = main.getSigDeclChild(((SigName) a.mid).getSimpleName()); // Factor out? (send/receive/branchreceive/...) + ln += getGarbageBuf(msd.getExtName()) + ");"; + } + mb.addBodyLine(ln); + } + + private static void addBranchCheck(String opClassName, MethodBuilder mb, String messageField) + { + String op = JavaBuilder.THIS + "." + messageField + "." + StateChannelApiGenerator.SCRIBMESSAGE_OP_FIELD; + mb.addBodyLine("if (!" + op + ".equals(" + opClassName + ")) {"); + mb.addBodyLine(1, "throw " + JavaBuilder.NEW + " " + StateChannelApiGenerator.SCRIBBLERUNTIMEEXCEPTION_CLASS + "(\"Wrong branch, received: \" + " + op + ");"); + mb.addBodyLine("}"); + } + + // As for ReceiveSocket, but without peer param + public static void setCaseReceiveHeaderWithoutReturnType(StateChannelApiGenerator apigen, EAction a, MethodBuilder mb) throws ScribException + { + //final String ROLE_PARAM = "role"; + Module main = apigen.getMainModule(); // FIXME: main not necessarily the right module? + String opClass = SessionApiGenerator.getOpClassName(a.mid); + + mb.setName("receive"); + mb.addModifiers(JavaBuilder.PUBLIC); + mb.addParameters(opClass + " " + StateChannelApiGenerator.RECEIVE_OP_PARAM); // More params may be added later (payload-arg/future Buffs) + mb.addExceptions(StateChannelApiGenerator.SCRIBBLERUNTIMEEXCEPTION_CLASS, "java.io.IOException", "ClassNotFoundException");//, "ExecutionException", "InterruptedException"); + if (a.mid.isOp()) + { + ReceiveSockGen.addReceiveOpParams(mb, main, a, true); + } + else //if (a.mid.isMessageSigName()) + { + SigDecl msd = main.getSigDeclChild(((SigName) a.mid).getSimpleName()); // FIXME: might not belong to main module + ReceiveSockGen.addReceiveMessageSigNameParams(mb, msd, true); + } + } + + public static void setCaseReceiveDiscardHeaderWithoutReturnType(StateChannelApiGenerator apigen, EAction a, MethodBuilder mb) + { + // Duplicated from makeCaseReceiveHeader, without parameters + final String opClass = SessionApiGenerator.getOpClassName(a.mid); + + mb.setName("receive"); + mb.addModifiers(JavaBuilder.PUBLIC); + mb.addParameters(opClass + " " + StateChannelApiGenerator.RECEIVE_OP_PARAM); // More params may be added later (payload-arg/future Buffs) + mb.addExceptions(StateChannelApiGenerator.SCRIBBLERUNTIMEEXCEPTION_CLASS, "java.io.IOException", "ClassNotFoundException");//, "ExecutionException", "InterruptedException"); + } + + public static String getCaseSocketName(String branchSocketName) + { + return branchSocketName + "_Cases"; + } +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/EndSockGen.java b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/EndSockGen.java new file mode 100644 index 000000000..31efe7e2c --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/EndSockGen.java @@ -0,0 +1,48 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.java.statechanapi; + +import org.scribble.core.model.endpoint.EState; + +public class EndSockGen extends ScribSockGen +{ + public EndSockGen(StateChannelApiGenerator apigen, EState curr) + { + super(apigen, curr); + } + + @Override + protected String getClassName() + { + return GENERATED_ENDSOCKET_NAME; + } + + @Override + protected String getSuperClassType() + { + return ENDSOCKET_CLASS + "<" + getSessionClassName() + ", " + getSelfClassName() + ">"; + } + + @Override + protected void addImports() + { + super.addImports(); + } + + @Override + protected void addMethods() + { + + } +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/HandlerIfaceGen.java b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/HandlerIfaceGen.java new file mode 100644 index 000000000..6407e0702 --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/HandlerIfaceGen.java @@ -0,0 +1,120 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.java.statechanapi; + +import org.scribble.ast.SigDecl; +import org.scribble.ast.Module; +import org.scribble.codegen.java.sessionapi.SessionApiGenerator; +import org.scribble.codegen.java.util.AbstractMethodBuilder; +import org.scribble.codegen.java.util.ClassBuilder; +import org.scribble.codegen.java.util.InterfaceBuilder; +import org.scribble.codegen.java.util.JavaBuilder; +import org.scribble.codegen.java.util.MethodBuilder; +import org.scribble.core.model.endpoint.EState; +import org.scribble.core.model.endpoint.actions.EAction; +import org.scribble.core.type.name.GProtoName; +import org.scribble.core.type.name.SigName; +import org.scribble.util.ScribException; + +// Factor out +public class HandlerIfaceGen extends AuxStateChanTypeGen +{ + private final EState curr; + + // Pre: cb is the BranchSocketBuilder + public HandlerIfaceGen(StateChannelApiGenerator apigen, ClassBuilder parent, EState curr) + { + super(apigen, parent); + this.curr = curr; + } + + @Override + public InterfaceBuilder generateType() throws ScribException + { + GProtoName gpn = this.apigen.getGProtocolName(); + + // Handler interface + InterfaceBuilder ib = new InterfaceBuilder(); + ib.setPackage(SessionApiGenerator.getStateChannelPackageName(gpn, this.apigen.getSelf())); // FIXME: factor out with ScribSocketBuilder + ib.addImports(SessionApiGenerator.getOpsPackageName(gpn) + ".*"); // FIXME: factor out with ScribSocketBuilder + //ib.setName(getHandlerInterfaceName(parent)); + ib.setName(getHandlerInterfaceName(this.parent.getName())); + ib.addModifiers(InterfaceBuilder.PUBLIC); + + for (EAction a : this.curr.getDetActions()) // Doesn't need to be sorted + { + EState succ = this.curr.getDetSuccessor(a); + String nextClass = this.apigen.getSocketClassName(succ); + + AbstractMethodBuilder mb3 = ib.newAbstractMethod(); + if (!this.apigen.skipIOInterfacesGeneration) + { + mb3.addAnnotations("@Override"); + } + setHandleMethodHeaderWithoutParamTypes(this.apigen, mb3); + if (succ.isTerminal()) + { + mb3.addParameters(ScribSockGen.GENERATED_ENDSOCKET_NAME + " schan"); // FIXME: factor out + } + else + { + mb3.addParameters(nextClass + " schan"); // FIXME: factor out + } + addHandleMethodOpAndPayloadParams(this.apigen, a, mb3); + + if (this.curr.getDetSuccessor(a).isTerminal()) + { + // FIXME: potentially repeated (but OK) + ib.addImports(SessionApiGenerator.getEndpointApiRootPackageName(gpn) + ".*"); // FIXME: factor out with ScribSocketBuilder + ib.addImports(SessionApiGenerator.getRolesPackageName(this.apigen.getGProtocolName()) + ".*"); + } + } + + return ib; + } + + // void return type -- have to deal with Succ as param + public static void setHandleMethodHeaderWithoutParamTypes(StateChannelApiGenerator apigen, MethodBuilder mb) + { + mb.setName("receive"); + mb.addModifiers(JavaBuilder.PUBLIC); + mb.setReturn(InterfaceBuilder.VOID); + mb.addExceptions(StateChannelApiGenerator.SCRIBBLERUNTIMEEXCEPTION_CLASS, "java.io.IOException", "ClassNotFoundException"); + } + + public static void addHandleMethodOpAndPayloadParams(StateChannelApiGenerator apigen, EAction a, MethodBuilder mb) throws ScribException + { + Module main = apigen.getMainModule(); + String opClass = SessionApiGenerator.getOpClassName(a.mid); + + mb.addParameters(opClass + " " + StateChannelApiGenerator.RECEIVE_OP_PARAM); // More params added below + + if (a.mid.isOp()) + { + ReceiveSockGen.addReceiveOpParams(mb, apigen.getMainModule(), a, false); + } + else //if (a.mid.isMessageSigName()) + { + SigDecl msd = main.getSigDeclChild(((SigName) a.mid).getSimpleName()); // FIXME: might not belong to main module + ReceiveSockGen.addReceiveMessageSigNameParams(mb, msd, false); + } + } + + // Pre: cb is the BranchSocketBuilder + //public static String getHandlerInterfaceName(TypeBuilder cb) + public static String getHandlerInterfaceName(String branchName) + { + return branchName + "_Handler"; + } +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/InputFutureGen.java b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/InputFutureGen.java new file mode 100644 index 000000000..222729a0b --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/InputFutureGen.java @@ -0,0 +1,141 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.java.statechanapi; + +import java.util.LinkedList; +import java.util.List; + +import org.scribble.ast.DataDecl; +import org.scribble.ast.SigDecl; +import org.scribble.ast.Module; +import org.scribble.codegen.java.sessionapi.SessionApiGenerator; +import org.scribble.codegen.java.util.ClassBuilder; +import org.scribble.codegen.java.util.ConstructorBuilder; +import org.scribble.codegen.java.util.FieldBuilder; +import org.scribble.codegen.java.util.InterfaceBuilder; +import org.scribble.codegen.java.util.JavaBuilder; +import org.scribble.codegen.java.util.MethodBuilder; +import org.scribble.core.model.endpoint.actions.EAction; +import org.scribble.core.type.name.DataName; +import org.scribble.core.type.name.GProtoName; +import org.scribble.core.type.name.SigName; +import org.scribble.core.type.name.PayElemType; +import org.scribble.util.ScribException; + +public class InputFutureGen extends AuxStateChanTypeGen +{ + protected static final String SCRIBFUTURE_CLASS = "org.scribble.runtime.util.ScribFuture"; + + private final EAction a; + + // Pre: cb is ReceiveSocketBuilder + public InputFutureGen(StateChannelApiGenerator apigen, ClassBuilder parent, EAction a) + { + super(apigen, parent); + this.a = a; + } + + @Override + public ClassBuilder generateType() throws ScribException + { + final String FUTURE_PARAM = "fut"; + Module main = this.apigen.getMainModule(); + GProtoName gpn = this.apigen.getGProtocolName(); + + String futureClass = getInputFutureName(this.parent.getName()); // Fresh enough? need only one future class per receive (unary receive) + + //cb.addImports("java.util.concurrent.CompletableFuture"); // "parent" cb, not the future class + //cb.addImports("java.util.concurrent.ExecutionException"); + + //ClassBuilder future = cb.newClass(); // FIXME: inner class + // Duplicated from BranchInterfaceBuilder -- FIXME: factor out + ClassBuilder future = new ClassBuilder(); + future.setPackage(SessionApiGenerator.getStateChannelPackageName(gpn, this.apigen.getSelf())); // FIXME: factor out with ScribSocketBuilder + future.addImports("java.io.IOException"); + future.addImports("java.util.concurrent.CompletableFuture"); // "parent" cb, not the future class + future.addModifiers(InterfaceBuilder.PUBLIC); + + future.setName(futureClass); + future.setSuperClass(SCRIBFUTURE_CLASS); + List types = new LinkedList<>(); + if (a.mid.isOp()) + { + if (!a.payload.isEmpty()) + { + int i = 1; + for (PayElemType pt : a.payload.elems) + { + if (!pt.isDataName()) + { + throw new ScribException("[TODO] API generation not supported for non- data type payloads: " + pt); + } + DataDecl dtd = main.getTypeDeclChild((DataName) pt); + ScribSockGen.checkJavaDataTypeDecl(dtd); + String type = dtd.getExtName(); + types.add(type); + FieldBuilder f = future.newField("pay" + i++); + f.setType(type); + f.addModifiers(JavaBuilder.PUBLIC); + } + } + } + else + { + SigDecl msd = main.getSigDeclChild(((SigName) a.mid).getSimpleName()); + ScribSockGen.checkMessageSigNameDecl(msd); + String type = msd.getExtName(); + types.add(type); + FieldBuilder f = future.newField("msg"); + f.setType(type); + f.addModifiers(JavaBuilder.PUBLIC); + } + + ConstructorBuilder cons = future.newConstructor("CompletableFuture<" + StateChannelApiGenerator.SCRIBMESSAGE_CLASS + "> " + FUTURE_PARAM); + cons.addModifiers(JavaBuilder.PROTECTED); + cons.addBodyLine(JavaBuilder.SUPER + "(" + FUTURE_PARAM + ");"); + + MethodBuilder sync = future.newMethod("sync"); + sync.addModifiers(JavaBuilder.PUBLIC); + sync.setReturn(futureClass); + //sync.addExceptions("ExecutionException", "InterruptedException"); + sync.addExceptions("IOException"); + String ln = (a.mid.isOp() && a.payload.isEmpty()) ? "" : StateChannelApiGenerator.SCRIBMESSAGE_CLASS + " m = "; + ln += JavaBuilder.SUPER + ".get();"; + sync.addBodyLine(ln); + if (a.mid.isOp()) + { + if (!a.payload.isEmpty()) + { + int i = 1; + for (String type : types) + { + sync.addBodyLine(JavaBuilder.THIS + "." + "pay" + i + " = (" + type + ") m.payload[" + (i - 1) + "];"); + i++; + } + } + } + else + { + sync.addBodyLine(JavaBuilder.THIS + "." + "msg" + " = (" + types.get(0) + ") m;"); + } + sync.addBodyLine(JavaBuilder.RETURN + " " + JavaBuilder.THIS + ";"); + + return future; + } + + public static String getInputFutureName(String parent) + { + return parent + "_Future"; // Fresh enough? need only one future class per receive (unary receive) + } +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/OutputSockGen.java b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/OutputSockGen.java new file mode 100644 index 000000000..ccd3af9cc --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/OutputSockGen.java @@ -0,0 +1,239 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.java.statechanapi; + +import java.util.Iterator; +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.IntStream; + +import org.scribble.ast.DataDecl; +import org.scribble.ast.SigDecl; +import org.scribble.ast.Module; +import org.scribble.codegen.java.sessionapi.SessionApiGenerator; +import org.scribble.codegen.java.util.JavaBuilder; +import org.scribble.codegen.java.util.MethodBuilder; +import org.scribble.core.model.endpoint.EState; +import org.scribble.core.model.endpoint.actions.EAction; +import org.scribble.core.type.name.DataName; +import org.scribble.core.type.name.SigName; +import org.scribble.core.type.name.PayElemType; +import org.scribble.util.ScribException; + +public class OutputSockGen extends ScribSockGen +{ + public OutputSockGen(StateChannelApiGenerator apigen, EState curr) + { + super(apigen, curr); + } + + @Override + protected String getSuperClassType() + { + return OUTPUTSOCKET_CLASS + "<" + getSessionClassName() + ", " + getSelfClassName() + ">"; + } + + @Override + protected void addImports() + { + this.cb.addImports("java.io.IOException"); + super.addImports(); + } + + // A method for each successor state + //private void addSendMethods(ClassBuilder cb, EndpointState curr) + @Override + protected void addMethods() throws ScribException + { + final String ROLE_PARAM = "role"; + + // Mixed sends and connects + boolean hasConnect = false; + boolean hasWrap = false; + for (EAction a : curr.getDetActions()) // (Scribble ensures all "a" are input or all are output) + { + EState succ = curr.getDetSuccessor(a); + + MethodBuilder mb = this.cb.newMethod(); + if (a.isSend()) + { + setSendHeaderWithoutReturnType(apigen, a, mb); + } + else if (a.isRequest()) + { + hasConnect = true; + setConnectHeaderWithoutReturnType(apigen, a, mb); + } + else if (a.isDisconnect()) + { + setDisconnectHeaderWithoutReturnType(apigen, a, mb); + } + else if (a.isClientWrap()) + { + hasWrap = true; + setWrapClientHeaderWithoutReturnType(apigen, a, mb); + } + else + { + throw new RuntimeException("[TODO] OutputSocket API generation for: " + a); + } + + setNextSocketReturnType(this.apigen, mb, succ); + if (a.mid.isOp()) + { + this.cb.addImports(getOpsPackageName() + ".*"); // FIXME: repeated + } + + if (a.isSend()) + { + if (a.mid.isOp()) + { + List args = getSendPayloadArgs(a); + String body = JavaBuilder.SUPER + ".writeScribMessage(" + ROLE_PARAM + ", " + getSessionApiOpConstant(a.mid); + if (!a.payload.isEmpty()) + { + body += ", " + args.stream().collect(Collectors.joining(", ")); + } + body += ");\n"; + mb.addBodyLine(body); + } + else //if (a.mid.isMessageSigName()) + { + final String MESSAGE_PARAM = "m"; // FIXME: factor out + + mb.addBodyLine(JavaBuilder.SUPER + ".writeScribMessage(" + ROLE_PARAM + ", " + MESSAGE_PARAM + ");"); + } + } + else if (a.isRequest()) + { + //throw new RuntimeException("Shouldn't get in here: " + a); + mb.addBodyLine(JavaBuilder.SUPER + ".connect(" + ROLE_PARAM + ", cons, host, port);\n"); + } + else if (a.isDisconnect()) + { + mb.addBodyLine(JavaBuilder.SUPER + ".disconnect(" + ROLE_PARAM + ");\n"); + } + else if (a.isClientWrap()) + { + mb.addBodyLine(JavaBuilder.SUPER + ".wrapClient(" + ROLE_PARAM + ", wrapper);\n"); + } + else + { + throw new RuntimeException("Shouldn't get in here: " + a); + } + + addReturnNextSocket(mb, succ); + } + + if (hasConnect) + { + this.cb.addImports("java.util.concurrent.Callable"); + this.cb.addImports("org.scribble.runtime.net.BinaryChannelEndpoint"); + } + if (hasWrap) + { + this.cb.addImports("java.util.concurrent.Callable"); + this.cb.addImports("org.scribble.runtime.net.BinaryChannelWrapper"); + } + } + + private static List getSendPayloadArgs(EAction a) + { + final String ARG_PREFIX = "arg"; + + return IntStream.range(0, a.payload.elems.size()).mapToObj((i) -> ARG_PREFIX + i++).collect(Collectors.toList()); // FIXME: factor out with params + } + + public static void setSendHeaderWithoutReturnType(StateChannelApiGenerator apigen, EAction a, MethodBuilder mb) throws ScribException + { + final String ROLE_PARAM = "role"; + Module main = apigen.getMainModule(); // FIXME: main not necessarily the right module? + + mb.setName("send"); + mb.addModifiers(JavaBuilder.PUBLIC); + mb.addExceptions(StateChannelApiGenerator.SCRIBBLERUNTIMEEXCEPTION_CLASS, "IOException"); + mb.addParameters(SessionApiGenerator.getRoleClassName(a.obj) + " " + ROLE_PARAM); // More params added below + if (a.mid.isOp()) + { + addSendOpParams(apigen, mb, main, a); + } + else //if (a.mid.isMessageSigName()) + { + SigDecl msd = main.getSigDeclChild(((SigName) a.mid).getSimpleName()); // FIXME: might not belong to main module + addSendMessageSigNameParams(mb, msd); + } + } + + public static void setConnectHeaderWithoutReturnType(StateChannelApiGenerator apigen, EAction a, MethodBuilder mb) + { + final String ROLE_PARAM = "role"; + + mb.setName("request"); + mb.addModifiers(JavaBuilder.PUBLIC); + mb.addExceptions(StateChannelApiGenerator.SCRIBBLERUNTIMEEXCEPTION_CLASS, "IOException"); + mb.addParameters(SessionApiGenerator.getRoleClassName(a.obj) + " " + ROLE_PARAM); // More params added below + mb.addParameters("Callable cons"); + mb.addParameters("String host"); + mb.addParameters("int port"); + } + + public static void setDisconnectHeaderWithoutReturnType(StateChannelApiGenerator apigen, EAction a, MethodBuilder mb) + { + final String ROLE_PARAM = "role"; + + mb.setName("disconnect"); + mb.addModifiers(JavaBuilder.PUBLIC); + mb.addExceptions(StateChannelApiGenerator.SCRIBBLERUNTIMEEXCEPTION_CLASS, "IOException"); + mb.addParameters(SessionApiGenerator.getRoleClassName(a.obj) + " " + ROLE_PARAM); + } + + public static void setWrapClientHeaderWithoutReturnType(StateChannelApiGenerator apigen, EAction a, MethodBuilder mb) + { + final String ROLE_PARAM = "role"; + + mb.setName("wrapClient"); + mb.addModifiers(JavaBuilder.PUBLIC); + mb.addExceptions(StateChannelApiGenerator.SCRIBBLERUNTIMEEXCEPTION_CLASS, "IOException"); + mb.addParameters(SessionApiGenerator.getRoleClassName(a.obj) + " " + ROLE_PARAM); + mb.addParameters("Callable wrapper"); + } + + protected static void addSendOpParams(StateChannelApiGenerator apigen, MethodBuilder mb, Module main, EAction a) throws ScribException + { + List args = getSendPayloadArgs(a); + mb.addParameters(SessionApiGenerator.getOpClassName(a.mid) + " op"); // opClass -- op param not actually used in body + if (!a.payload.isEmpty()) + { + Iterator as = args.iterator(); + for (PayElemType pt : a.payload.elems) + { + if (!pt.isDataName()) + { + throw new ScribException("[TODO] API generation not supported for non- data type payloads: " + pt); + } + DataDecl dtd = main.getTypeDeclChild((DataName) pt); // FIXME: might not belong to main module // TODO: if not DataType + ScribSockGen.checkJavaDataTypeDecl(dtd); + mb.addParameters(dtd.getExtName() + " " + as.next()); + } + } + } + + protected static void addSendMessageSigNameParams(MethodBuilder mb, SigDecl msd) throws ScribException + { + final String MESSAGE_PARAM = "m"; + + ScribSockGen.checkMessageSigNameDecl(msd); + mb.addParameters(msd.getExtName() + " " + MESSAGE_PARAM); + } +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/ReceiveSockGen.java b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/ReceiveSockGen.java new file mode 100644 index 000000000..19273b0ac --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/ReceiveSockGen.java @@ -0,0 +1,227 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.java.statechanapi; + +import org.scribble.ast.DataDecl; +import org.scribble.ast.SigDecl; +import org.scribble.ast.Module; +import org.scribble.codegen.java.sessionapi.SessionApiGenerator; +import org.scribble.codegen.java.util.ClassBuilder; +import org.scribble.codegen.java.util.JavaBuilder; +import org.scribble.codegen.java.util.MethodBuilder; +import org.scribble.core.model.endpoint.EState; +import org.scribble.core.model.endpoint.actions.EAction; +import org.scribble.core.type.name.DataName; +import org.scribble.core.type.name.SigName; +import org.scribble.core.type.name.PayElemType; +import org.scribble.util.ScribException; + +public class ReceiveSockGen extends ScribSockGen +{ + public ReceiveSockGen(StateChannelApiGenerator apigen, EState curr) + { + super(apigen, curr); + } + + @Override + protected String getSuperClassType() + { + return RECEIVESOCKET_CLASS + "<" + getSessionClassName() + ", " + getSelfClassName() + ">"; + } + + @Override + protected void addImports() + { + super.addImports(); + this.cb.addImports(getOpsPackageName() + ".*"); + } + + // Single receive (unary branch -- singleton next state) + // But generates a set of methods related to this input (regular receive, async with future, async with discard, arrived polling) -- TODO: call-back + // FIXME: most general async would also allow whole input-only compound statements (choice, recursion) to be bypassed + //private void addReceiveMethods(ClassBuilder cb, EndpointState curr) + @Override + protected void addMethods() throws ScribException + { + EAction a = curr.getDetActions().iterator().next(); + //String nextClass = this.apigen.getSocketClassName(curr.accept(a)); + EState succ = curr.getDetSuccessor(a); + ClassBuilder futureClass = new InputFutureGen(this.apigen, this.cb, a).generateType(); // Wraps all payload elements as fields (set by future completion) + // FIXME: problem if package and protocol have the same name -- still? + this.apigen.addTypeDecl(futureClass); + + makeReceiveMethod(a, succ); // [nextClass] receive([opClass] op, Buff arg, ...) + makeAsyncMethod(a, succ, futureClass.getName()); // [nextClass] async([opClass] op, Buff arg) + makeIsDoneMethod(a); // boolean isDone() + makeAsyncDiscardMethod(a, succ, futureClass.getName()); // [nextClass] async([opClass] op) + } + + // [nextClass] receive([opClass] op, Buf arg, ...) + //private void makeReceiveMethod(ClassBuilder cb, Module main, IOAction a, String nextClass, String opClass) + private void makeReceiveMethod(EAction a, EState succ) throws ScribException + { + Module main = this.apigen.getMainModule(); // FIXME: main not necessarily the right module? + + MethodBuilder mb = makeReceiveHeader(a, succ); + if (a.mid.isOp()) + { + //addReceiveOpParams(mb, main, a); + String ln = a.payload.isEmpty() ? "" : StateChannelApiGenerator.SCRIBMESSAGE_CLASS + " " + RECEIVE_MESSAGE_PARAM + " = "; + ln += JavaBuilder.SUPER + ".readScribMessage(" + getSessionApiRoleConstant(a.obj) + ");"; + mb.addBodyLine(ln); + addPayloadBuffSetters(main, a, mb); + } + else //if (a.mid.isMessageSigName()) + { + SigDecl msd = main.getSigDeclChild(((SigName) a.mid).getSimpleName()); // FIXME: might not belong to main module + //addReceiveMessageSigNameParams(mb, a, msd);*/ + mb.addBodyLine(StateChannelApiGenerator.SCRIBMESSAGE_CLASS + " " + RECEIVE_MESSAGE_PARAM + " = " + + JavaBuilder.SUPER + ".readScribMessage(" + getSessionApiRoleConstant(a.obj) + ");"); + mb.addBodyLine(RECEIVE_ARG_PREFIX + "." + BUFF_VAL_FIELD + " = (" + msd.getExtName() + ") " + RECEIVE_MESSAGE_PARAM + ";"); + } + addReturnNextSocket(mb, succ); + } + + // Payload parameters added later + private MethodBuilder makeReceiveHeader(EAction a, EState succ) throws ScribException + { + MethodBuilder mb = this.cb.newMethod(); + setReceiveHeaderWithoutReturnType(this.apigen, a, mb); + setNextSocketReturnType(this.apigen, mb, succ); + return mb; + } + + // [nextClass] async([opClass] op, Buf arg) + private void makeAsyncMethod(EAction a, EState succ, String futureClass) + { + final String ROLE_PARAM = "role"; + String opClass = SessionApiGenerator.getOpClassName(a.mid); + + MethodBuilder mb = this.cb.newMethod("async"); + // Blurb stuff similar to makeReceiveHeader + mb.addModifiers(JavaBuilder.PUBLIC);//, ClassBuilder.SYNCHRONIZED); + //setNextSocketReturnType(mb, succ); + setNextSocketReturnType(this.apigen, mb, succ); + mb.addExceptions(StateChannelApiGenerator.SCRIBBLERUNTIMEEXCEPTION_CLASS); + mb.addParameters(SessionApiGenerator.getRoleClassName(a.obj) + " " + ROLE_PARAM); + mb.addParameters(opClass + " " + StateChannelApiGenerator.RECEIVE_OP_PARAM); + mb.addParameters(BUF_CLASS + "<" + futureClass + "> " + RECEIVE_ARG_PREFIX); // Method for future-buf even if no payload, for sync action + //mb.addBodyLine(ClassBuilder.SUPER + ".use();"); + //mb2.addBodyLine(ARG_PREFIX + ".val = " + " " + ClassBuilder.SUPER + ".getFuture(" + getPrefixedRoleClassName(a.peer) + ");"); + mb.addBodyLine(RECEIVE_ARG_PREFIX + "." + BUFF_VAL_FIELD + " = " + + JavaBuilder.NEW + " " + futureClass + "(" + JavaBuilder.SUPER + ".getFuture(" + getSessionApiRoleConstant(a.obj) + "));"); + addReturnNextSocket(mb, succ); + } + + // [nextClass] async([opClass] op) -- wrapper for makeAsyncMethod + private void makeAsyncDiscardMethod(EAction a, EState succ, String futureClass) + { + MethodBuilder mb = makeAsyncDiscardHeader(a, succ, futureClass); + mb.addBodyLine(JavaBuilder.RETURN + " async(" + SessionApiGenerator.getSessionClassName(apigen.getGProtocolName()) + "." + a.obj + ", " + StateChannelApiGenerator.RECEIVE_OP_PARAM + ", " + getGarbageBuf(futureClass) + ");"); + mb.addAnnotations("@SuppressWarnings(\"unchecked\")"); // To cast the generic garbage buf + } + + private MethodBuilder makeAsyncDiscardHeader(EAction a, EState succ, String futureClass) + { + MethodBuilder mb = this.cb.newMethod(); + setAsyncDiscardHeaderWithoutReturnType(this.apigen, a, mb, futureClass); + setNextSocketReturnType(this.apigen, mb, succ); + return mb; + } + + // boolean isDone() + private void makeIsDoneMethod(EAction a) + { + MethodBuilder mb = cb.newMethod("isDone"); + mb.addModifiers(JavaBuilder.PUBLIC); + mb.setReturn("boolean"); + mb.addBodyLine(JavaBuilder.RETURN + " " + JavaBuilder.SUPER + ".isDone(" + getSessionApiRoleConstant(a.obj) + ");"); + } + + // Doesn't include return type + //public static void makeReceiveHeader(StateChannelApiGenerator apigen, IOAction a, EndpointState succ, MethodBuilder mb) + public static void setReceiveHeaderWithoutReturnType(StateChannelApiGenerator apigen, EAction a, MethodBuilder mb) throws ScribException + { + final String ROLE_PARAM = "role"; + Module main = apigen.getMainModule(); // FIXME: main not necessarily the right module? + String opClass = SessionApiGenerator.getOpClassName(a.mid); + + mb.setName("receive"); + mb.addModifiers(JavaBuilder.PUBLIC); + mb.addExceptions(StateChannelApiGenerator.SCRIBBLERUNTIMEEXCEPTION_CLASS, "java.io.IOException", "ClassNotFoundException"); + //, "ExecutionException", "InterruptedException"); + mb.addParameters(SessionApiGenerator.getRoleClassName(a.obj) + " " + ROLE_PARAM, opClass + " " + StateChannelApiGenerator.RECEIVE_OP_PARAM); + if (a.mid.isOp()) + { + addReceiveOpParams(mb, main, a, true); + } + else //if (a.mid.isMessageSigName()) + { + SigDecl msd = main.getSigDeclChild(((SigName) a.mid).getSimpleName()); // FIXME: might not belong to main module + addReceiveMessageSigNameParams(mb, msd, true); + } + } + + // FIXME: main may not be the right module + protected static void addReceiveOpParams(MethodBuilder mb, Module main, EAction a, boolean superr) throws ScribException + { + if (!a.payload.isEmpty()) + { + String buffSuper = BUF_CLASS + "<" + ((superr) ? "? " + JavaBuilder.SUPER + " " : ""); + int i = 1; + for (PayElemType pt : a.payload.elems) + { + if (!pt.isDataName()) + { + throw new ScribException("[TODO] API generation not supported for non- data type payloads: " + pt); + } + DataDecl dtd = main.getTypeDeclChild((DataName) pt); // TODO: if not DataType + ScribSockGen.checkJavaDataTypeDecl(dtd); + mb.addParameters(buffSuper + dtd.getExtName() + "> " + RECEIVE_ARG_PREFIX + i++); + } + } + } + + protected static void addPayloadBuffSetters(Module main, EAction a, MethodBuilder mb) + { + if (!a.payload.isEmpty()) + { + int i = 1; + for (PayElemType pt : a.payload.elems) // Could factor out this loop (arg names) with addReceiveOpParams (as for send) + { + DataDecl dtd = main.getTypeDeclChild((DataName) pt); // TODO: if not DataType + mb.addBodyLine(RECEIVE_ARG_PREFIX + i + "." + BUFF_VAL_FIELD + " = (" + dtd.getExtName() + ") " + + RECEIVE_MESSAGE_PARAM + "." + SCRIBMESSAGE_PAYLOAD_FIELD + "[" + (i++ - 1) +"];"); + } + } + } + + protected static void addReceiveMessageSigNameParams(MethodBuilder mb, SigDecl msd, boolean superr) throws ScribException + { + ScribSockGen.checkMessageSigNameDecl(msd); + mb.addParameters(BUF_CLASS + "<" + ((superr) ? "? " + JavaBuilder.SUPER + " " : "") + msd.getExtName() + "> " + RECEIVE_ARG_PREFIX); + } + + // Similar to setReceiveHeader + public static void setAsyncDiscardHeaderWithoutReturnType(StateChannelApiGenerator apigen, EAction a, MethodBuilder mb, String futureClass) + { + final String ROLE_PARAM = "role"; + final String opClass = SessionApiGenerator.getOpClassName(a.mid); + + mb.setName("async"); + mb.addModifiers(JavaBuilder.PUBLIC); + mb.addParameters(SessionApiGenerator.getRoleClassName(a.obj) + " " + ROLE_PARAM, opClass + " " + StateChannelApiGenerator.RECEIVE_OP_PARAM); + mb.addExceptions(StateChannelApiGenerator.SCRIBBLERUNTIMEEXCEPTION_CLASS); + } +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/ScribSockGen.java b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/ScribSockGen.java new file mode 100644 index 000000000..1321f20fd --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/ScribSockGen.java @@ -0,0 +1,316 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.java.statechanapi; + +import org.scribble.ast.DataDecl; +import org.scribble.ast.SigDecl; +import org.scribble.ast.NonProtoDecl; +import org.scribble.ast.global.GProtoDecl; +import org.scribble.codegen.java.sessionapi.SessionApiGenerator; +import org.scribble.codegen.java.util.ClassBuilder; +import org.scribble.codegen.java.util.ConstructorBuilder; +import org.scribble.codegen.java.util.FieldBuilder; +import org.scribble.codegen.java.util.JavaBuilder; +import org.scribble.codegen.java.util.MethodBuilder; +import org.scribble.core.model.endpoint.EState; +import org.scribble.core.type.name.GProtoName; +import org.scribble.core.type.name.MsgId; +import org.scribble.core.type.name.Role; +import org.scribble.util.ScribException; + +// Parameterize on output class type +public abstract class ScribSockGen extends StateChanTypeGen +{ + public static final String JAVA_SCHEMA = "java"; // FIXME: factor out + + public static final String SESSIONENDPOINT_CLASS = "org.scribble.runtime.session.SessionEndpoint"; + public static final String MPSTENDPOINT_CLASS = "org.scribble.runtime.session.MPSTEndpoint"; + public static final String EXPLICITENDPOINT_CLASS = "org.scribble.runtime.session.ExplicitEndpoint"; + public static final String OPENUM_INTERFACE = "org.scribble.runtime.session.OpEnum"; + + public static final String BUF_CLASS = "org.scribble.runtime.util.Buf"; + + //public static final String CONNECTSOCKET_CLASS = "org.scribble.statechans.ConnectSocket"; + public static final String ACCEPTSOCKET_CLASS = "org.scribble.runtime.statechans.AcceptSocket"; + //public static final String DISCONNECTSOCKET_CLASS = "org.scribble.statechans.DisconnectSocket"; + public static final String OUTPUTSOCKET_CLASS = "org.scribble.runtime.statechans.OutputSocket"; + public static final String RECEIVESOCKET_CLASS = "org.scribble.runtime.statechans.ReceiveSocket"; + public static final String BRANCHSOCKET_CLASS = "org.scribble.runtime.statechans.BranchSocket"; + public static final String CASESOCKET_CLASS = "org.scribble.runtime.statechans.CaseSocket"; + public static final String ENDSOCKET_CLASS = "org.scribble.runtime.statechans.EndSocket"; + + public static final String SCRIBSERVERSOCKET_CLASS = "org.scribble.runtime.net.ScribServerSocket"; + + public static final String GENERATED_ENDSOCKET_NAME = "EndSocket"; + + public static final String BUFF_VAL_FIELD = "val"; + public static final String SCRIBSOCKET_SE_FIELD = JavaBuilder.THIS + ".se"; + public static final String SCRIBMESSAGE_PAYLOAD_FIELD = "payload"; + + public static final String RECEIVE_MESSAGE_PARAM = "m"; + public static final String RECEIVE_ARG_PREFIX = "arg"; + + public static final String CASE_OP_FIELD = "op"; + public static final String CASE_OP_PARAM = CASE_OP_FIELD; + public static final String CASE_MESSAGE_FIELD = "m"; + public static final String CASE_MESSAGE_PARAM = CASE_MESSAGE_FIELD; + public static final String CASE_ARG_PREFIX = "arg"; + + protected final EState curr; + protected final String className; + + protected final ClassBuilder cb = new ClassBuilder(); + + public ScribSockGen(StateChannelApiGenerator apigen, EState curr) + { + super(apigen); + this.curr = curr; + this.className = getClassName(); + } + + protected String getClassName() + { + return this.apigen.getSocketClassName(this.curr); + } + + @Override + public ClassBuilder generateType() throws ScribException + { + constructClass(); // So className can be "overridden" in subclass constructor (CaseSocket) + return this.cb; + } + + protected void constructClass() throws ScribException + { + constructClassExceptMethods(); + addMethods(); + } + + protected void constructClassExceptMethods() + { + this.cb.setName(this.className); + //this.cb.setPackage(getSessionPackageName()); + this.cb.setPackage(getStateChannelPackageName()); + this.cb.addModifiers(JavaBuilder.PUBLIC, JavaBuilder.FINAL); + //cb.setSuperClass(superc + "<" + SessionApiGenerator.getSessionClassName(this.gpn) + ", " + SessionApiGenerator.getRoleClassName(this.self) + ">"); + this.cb.setSuperClass(getSuperClassType()); + addImports(); + addConstructor(); + + FieldBuilder cast = this.cb.newField("cast"); + cast.addModifiers(JavaBuilder.PUBLIC, JavaBuilder.STATIC, JavaBuilder.FINAL); + cast.setType(this.className); + cast.setExpression("null"); + } + + protected abstract String getSuperClassType(); + + protected void addImports() + { + //this.cb.addImports("java.io.IOException"); + //this.cb.addImports(getSessionPackageName() + "." + getSessionClassName()); + this.cb.addImports(getEndpointApiRootPackageName() + ".*"); + this.cb.addImports(getRolesPackageName() + ".*"); + } + + protected MethodBuilder addConstructor() + { + final String SESSIONENDPOINT_PARAM = "se"; + final String sess = getSessionClassName(); + final String role = getSelfClassName(); + + ConstructorBuilder ctor = cb.newConstructor(SESSIONENDPOINT_CLASS + "<" + sess + ", " + role + "> " + SESSIONENDPOINT_PARAM, "boolean dummy"); + ctor.addModifiers(JavaBuilder.PROTECTED); + ctor.addBodyLine(JavaBuilder.SUPER + "(" + SESSIONENDPOINT_PARAM + ");"); + if (this.curr.equals(this.apigen.getInitialState())) + { + addInitialStateConstructor(); + } + return ctor; + } + + protected void addInitialStateConstructor() + { + final String SESSIONENDPOINT_PARAM = "se"; + String sess = getSessionClassName(); + String role = getSelfClassName(); + /*MethodBuilder mb = cb.newMethod("init"); + mb.addModifiers(ClassBuilder.PUBLIC, ClassBuilder.STATIC); + mb.setReturn(this.root); + mb.addParameters(SESSIONENDPOINT_CLASS + "<" + role + "> " + SESSIONENDPOINT_PARAM); + mb.addExceptions(SCRIBBLERUNTIMEEXCEPTION_CLASS); + mb.addBodyLine(SESSIONENDPOINT_PARAM + ".init();"); + mb.addBodyLine(ClassBuilder.RETURN + " " + ClassBuilder.NEW + " " + this.root + "(" + SESSIONENDPOINT_PARAM + ");");*/ + + GProtoDecl gpd = (GProtoDecl) this.apigen.getJob().getContext() + .getModule(this.apigen.gpn.getPrefix()) + .getGProtocolDeclChild(this.apigen.gpn.getSimpleName()); + String epClass = gpd.isExplicit() ? EXPLICITENDPOINT_CLASS + : MPSTENDPOINT_CLASS; + ConstructorBuilder ctor2 = cb.newConstructor( + epClass + "<" + sess + ", " + role + "> " + SESSIONENDPOINT_PARAM); + + ctor2.addExceptions(StateChannelApiGenerator.SCRIBBLERUNTIMEEXCEPTION_CLASS); + ctor2.addModifiers(JavaBuilder.PUBLIC); + ctor2.addBodyLine(JavaBuilder.SUPER + "(" + SESSIONENDPOINT_PARAM + ");"); + ctor2.addBodyLine(SESSIONENDPOINT_PARAM + ".init();"); + } + + protected abstract void addMethods() throws ScribException; + + /*@Deprecated + protected void setNextSocketReturnType(MethodBuilder mb, EState succ) + { + setNextSocketReturnType(this.apigen, mb, succ); + }*/ + + //protected void addReturnNextSocket(MethodBuilder mb, String nextClass) + protected void addReturnNextSocket(MethodBuilder mb, EState s) + { + String nextClass; + //if (isTerminalClassName(nextClass)) + if (s.isTerminal()) + { + mb.addBodyLine(SCRIBSOCKET_SE_FIELD + ".setCompleted();"); // Do before the IO action? in case of exception? + nextClass = GENERATED_ENDSOCKET_NAME;// + "<>"; + } + else + { + nextClass = this.apigen.getSocketClassName(s); + } + mb.addBodyLine(JavaBuilder.RETURN + " " + JavaBuilder.NEW + " " + nextClass + "(" + SCRIBSOCKET_SE_FIELD + ", true);"); + } + + protected String getGarbageBuf(String futureClass) + { + //return ClassBuilder.NEW + " " + BUFF_CLASS + "<>()"; // Makes a trash Buff every time, but clean -- would be more efficient to generate the code to spawn the future without buff-ing it (partly duplicate of the normal receive generated code) + return "(" + BUF_CLASS + "<" + futureClass + ">) " + SCRIBSOCKET_SE_FIELD + ".gc"; // FIXME: generic cast warning (this.ep.gc is Buff) -- also retains unnecessary reference to the last created garbage future (but allows no-arg receive/async to be generated as simple wrapper call) + } + + // Not fully qualified, just Session API class prefix + // The constant singleton value of this type in the Session API (which is the same "name" as the class) + protected String getSessionApiRoleConstant(Role role) + { + return SessionApiGenerator.getSessionClassName(this.apigen.getGProtocolName()) + "." + role; + } + + // Not fully qualified, just Session API class prefix + // The constant singleton value of this type in the Session API (which is the same "name" as the class) + protected String getSessionApiOpConstant(MsgId mid) + { + return SessionApiGenerator.getSessionClassName(this.apigen.getGProtocolName()) + "." + SessionApiGenerator.getOpClassName(mid); + } + + // Wrappers for EndpointApiGenerator getters + protected String getSessionClassName() + { + return SessionApiGenerator.getSessionClassName(this.apigen.getGProtocolName()); + } + + protected String getSelfClassName() + { + return SessionApiGenerator.getRoleClassName(this.apigen.getSelf()); + } + + protected String getEndpointApiRootPackageName() + { + /*GProtocolName gpn = this.apigen.getGProtocolName(); + return SessionApiGenerator.getSessionApiPackageName(this.apigen.getGProtocolName()) + ".api" + gpn.getSimpleName();*/ + return SessionApiGenerator.getEndpointApiRootPackageName(this.apigen.getGProtocolName()); + } + + protected String getRolesPackageName() + { + return SessionApiGenerator.getRolesPackageName(this.apigen.getGProtocolName()); + } + + protected String getOpsPackageName() + { + return SessionApiGenerator.getOpsPackageName(this.apigen.getGProtocolName()); + } + + protected String getStateChannelPackageName() + { + //return getSessionPackageName() + ".channels." + this.apigen.getSelf(); + return SessionApiGenerator.getStateChannelPackageName(this.apigen.getGProtocolName(), this.apigen.getSelf()); + } + + public static void setNextSocketReturnType(StateChannelApiGenerator apigen, MethodBuilder mb, EState succ) + { + String ret; + if (succ.isTerminal()) + { + GProtoName gpn = apigen.getGProtocolName(); + Role self = apigen.getSelf(); + ret = SessionApiGenerator.getStateChannelPackageName(gpn, self) + "." + GENERATED_ENDSOCKET_NAME; + //+ "<" + SessionApiGenerator.getSessionClassName(gpn) + ", " + SessionApiGenerator.getRoleClassName(self) + ">"; + } + else + { + ret = apigen.getSocketClassName(succ); + } + mb.setReturn(ret); + } + + protected static void checkJavaDataTypeDecl(DataDecl dtd) throws ScribException + { + checkJavaSchema(dtd); + } + + protected static void checkMessageSigNameDecl(SigDecl msd) throws ScribException + { + checkJavaSchema(msd); + } + + protected static void checkJavaSchema(NonProtoDecl npd) throws ScribException + { + if (!npd.getSchema().equals(ScribSockGen.JAVA_SCHEMA)) // FIXME: factor out + { + throw new ScribException(npd.getSource(), "Unsupported data type schema: " + npd.getSchema()); + } + } + + /*private static boolean isTerminalClassName(String n) + { + //return n.equals(ClassBuilder.VOID); + return n.equals(EndpointApiGenerator.ENDSOCKET_CLASS); + }*/ + + /*// Pre: not a terminal state (i.e. className is not void) + private ClassBuilder constructInitClass(String className) + { + final String SESSIONENDPOINT_PARAM = "se"; + String role = SessionApiGenerator.getRoleClassName(this.self); + + ClassBuilder cb = new ClassBuilder(); + cb.setName(className); + cb.setPackage(getPackageName()); + cb.setSuperClass(INITSOCKET_CLASS + "<" + role + ">"); + cb.addModifiers(ClassBuilder.PUBLIC); + + MethodBuilder ctor = cb.newConstructor(SESSIONENDPOINT_CLASS + "<" + role + "> " + SESSIONENDPOINT_PARAM); + ctor.addModifiers(ClassBuilder.PUBLIC); + ctor.addBodyLine(ClassBuilder.SUPER + "(" + SESSIONENDPOINT_PARAM + ");"); + + MethodBuilder mb = cb.newMethod("init"); + mb.setReturn(this.root); + mb.addModifiers(ClassBuilder.PUBLIC); + mb.addExceptions(SCRIBBLERUNTIMEEXCEPTION_CLASS); + mb.addBodyLine(ClassBuilder.SUPER + ".use();"); // Factor out + //mb.addBodyLine(SCRIBSOCKET_SE_FIELD + ".init();"); // Factor out + addReturnNextSocket(mb, this.root); + + return cb; + }*/ +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/StateChanTypeGen.java b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/StateChanTypeGen.java new file mode 100644 index 000000000..1c6ac3777 --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/StateChanTypeGen.java @@ -0,0 +1,30 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.java.statechanapi; + +import org.scribble.codegen.java.util.TypeBuilder; +import org.scribble.util.ScribException; + +// Build a (top-level) type declaration for the API generation output +public abstract class StateChanTypeGen +{ + protected final StateChannelApiGenerator apigen; + + public StateChanTypeGen(StateChannelApiGenerator apigen) + { + this.apigen = apigen; + } + + public abstract TypeBuilder generateType() throws ScribException; // FIXME: APIGenerationException? +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/StateChannelApiGenerator.java b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/StateChannelApiGenerator.java new file mode 100644 index 000000000..abd041396 --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/StateChannelApiGenerator.java @@ -0,0 +1,231 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.java.statechanapi; + +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +import org.scribble.ast.Module; +import org.scribble.codegen.java.ApiGen; +import org.scribble.codegen.java.sessionapi.SessionApiGenerator; +import org.scribble.codegen.java.util.ClassBuilder; +import org.scribble.codegen.java.util.TypeBuilder; +import org.scribble.core.job.CoreArgs; +import org.scribble.core.job.CoreContext; +import org.scribble.core.model.endpoint.EState; +import org.scribble.core.model.endpoint.actions.EAction; +import org.scribble.core.type.name.GProtoName; +import org.scribble.core.type.name.LProtoName; +import org.scribble.core.type.name.Role; +import org.scribble.core.visit.global.InlinedProjector; +import org.scribble.job.Job; +import org.scribble.util.ScribException; + +// TODO: "wildcard" unary async: op doesn't matter -- for branch-receive op "still needed" to cast to correct branch state +// TODO: "functional state interfaces", e.g. for smtp ehlo and quit actions + +// FIXME: selector(?) hanging on runtimeexception (from message formatter) +// FIXME: consume futures before wrap/reconnect +public class StateChannelApiGenerator extends ApiGen +{ + public static final String SCRIBMESSAGE_CLASS = "org.scribble.runtime.message.ScribMessage"; + public static final String SCRIBBLERUNTIMEEXCEPTION_CLASS = "org.scribble.main.ScribRuntimeException"; + public static final String RECEIVE_OP_PARAM = "op"; + public static final String SCRIBMESSAGE_OP_FIELD = "op"; + + private final Role self; + private final LProtoName lpn; + private final EState init; + //private final String root; + + protected final boolean skipIOInterfacesGeneration; + + private int counter = 1; + private Map classNames = new HashMap<>(); // Doesn't include terminal states + + private Map types = new HashMap<>(); // class/iface name key + + public StateChannelApiGenerator(Job job, GProtoName fullname, Role self) + throws ScribException // CHECKME: APIGenerationException? + { + super(job, fullname); + + this.self = self; + this.lpn = InlinedProjector.getFullProjectionName(fullname, self); + //this.init = job.getContext().getEndpointGraph(fullname, self).init; + CoreContext corec = this.core.getContext(); + this.init = this.job.config.args.get(CoreArgs.MIN_EFSM) + ? corec.getMinimisedEGraph(fullname, self).init + : corec.getEGraph(fullname, self).init; + + this.skipIOInterfacesGeneration = skipIOInterfacesGeneration(this.init); + + generateClassNames(this.init); + //this.root = this.classNames.get(this.init); + constructClasses(this.init); + + //EndpointState term = EndpointState.findTerminalState(new HashSet<>(), this.init); + EState term = this.init.getTerminal(); + if (term != null) + { + ClassBuilder cb = new EndSockGen(this, term).generateType(); + this.types.put(cb.getName(), cb); + } + } + + // Cf. IOInterfacesGenerator constructor + private static boolean skipIOInterfacesGeneration(EState init) + { + Set as = init.getReachableActions(); + as.addAll(init.getActions()); + if (as.stream().anyMatch(a -> !a.isSend() && !a.isReceive())) // HACK FIXME (connect/disconnect) + { + return true; + } + return false; + } + + // Return: key (package and Java class file path) -> val (Java class source) + @Override + public Map generateApi() + { + Map map = new HashMap(); + // FIXME: factor out with ScribSocketBuilder.getPackageName + String prefix = SessionApiGenerator.getEndpointApiRootPackageName(this.gpn) + .replace('.', '/') + "/statechans/" + this.self + "/"; + for (String s : this.types.keySet()) + { + String path = prefix + s + ".java"; + map.put(path, this.types.get(s).build()); + } + return map; + } + + private void generateClassNames(EState ps) + { + if (this.classNames.containsKey(ps)) + { + return; + } + if (ps.isTerminal()) + { + //this.classNames.put(ps, ENDSOCKET_CLASS); // FIXME: add generic parameters? or don't record? + return; + } + this.classNames.put(ps, newSocketClassName()); + for (EState succ : ps.getSuccs()) + { + generateClassNames(succ); + } + } + + private String newSocketClassName() + { + return this.lpn.getSimpleName().toString() + "_" + this.counter++; + } + + private void constructClasses(EState curr) throws ScribException + { + if (curr.isTerminal()) + { + return; // Generic EndSocket for terminal states + } + String className = this.classNames.get(curr); + if (this.types.containsKey(className)) + { + return; + } + this.types.put(className, constructClass(curr)); + for (EState succ : curr.getSuccs()) + { + constructClasses(succ); + } + + // Depends on the above being done first (for this.root) + /*String init = this.lpn.getSimpleName().toString() + "_" + 0; // FIXME: factor out with newClassName + this.classes.put(init, constructInitClass(init));*/ + } + + // Pre: curr is not terminal state + private ClassBuilder constructClass(EState curr) throws ScribException // FIXME: APIGenerationException? + { + switch (curr.getStateKind()) + { + case OUTPUT: + { + /*Set as = curr.getTakeable(); + if (as.stream().allMatch((a) -> a.isSend()))*/ + { + return new OutputSockGen(this, curr).generateType(); + } + //throw new RuntimeException("TODO: " + curr.toLongString()); + } + case ACCEPT: + { + return new AcceptSockGen(this, curr).generateType(); + } + case UNARY_RECEIVE: + { + return new ReceiveSockGen(this, curr).generateType(); + } + case POLY_RECIEVE: + { + // Receive only + return new BranchSockGen(this, curr).generateType(); + } + default: + { + throw new RuntimeException( + "[TODO] State Channel API generation not supported for: " + + curr.getStateKind() + ", " + curr.toVerboseString()); + } + } + } + + public GProtoName getGProtocolName() + { + return this.gpn; + } + + public Role getSelf() + { + return this.self; + } + + protected EState getInitialState() + { + return this.init; + } + + protected Module getMainModule() + { + return this.job.getContext().getMainModule(); + } + + protected void addTypeDecl(TypeBuilder tb) + { + this.types.put(tb.getName(), tb); + } + + public String getSocketClassName(EState s) + { + return this.classNames.get(s); + } + + public TypeBuilder getType(String key) + { + return this.types.get(key); + } +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/ioifaces/ActionIfaceGen.java b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/ioifaces/ActionIfaceGen.java new file mode 100644 index 000000000..c256808a8 --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/ioifaces/ActionIfaceGen.java @@ -0,0 +1,140 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.java.statechanapi.ioifaces; + +import org.scribble.codegen.java.sessionapi.SessionApiGenerator; +import org.scribble.codegen.java.statechanapi.OutputSockGen; +import org.scribble.codegen.java.statechanapi.ReceiveSockGen; +import org.scribble.codegen.java.statechanapi.StateChannelApiGenerator; +import org.scribble.codegen.java.util.AbstractMethodBuilder; +import org.scribble.codegen.java.util.InterfaceBuilder; +import org.scribble.codegen.java.util.JavaBuilder; +import org.scribble.core.model.endpoint.EState; +import org.scribble.core.model.endpoint.actions.EAction; +import org.scribble.core.model.endpoint.actions.ERecv; +import org.scribble.core.type.name.GProtoName; +import org.scribble.core.type.name.PayElemType; +import org.scribble.util.ScribException; + +public class ActionIfaceGen extends IOIfaceGen +{ + private final EAction a; + private final InterfaceBuilder ib = new InterfaceBuilder(); + + public ActionIfaceGen(StateChannelApiGenerator apigen, EState curr, EAction a) + { + super(apigen, curr); + this.a = a; + } + + @Override + public InterfaceBuilder generateType() throws ScribException + { + GProtoName gpn = this.apigen.getGProtocolName(); + + this.ib.setName(getActionInterfaceName(this.a)); + this.ib.setPackage(IOInterfacesGenerator.getIOInterfacePackageName(this.apigen.getGProtocolName(), this.apigen.getSelf())); + this.ib.addImports("java.io.IOException"); + this.ib.addImports(SessionApiGenerator.getEndpointApiRootPackageName(gpn) + ".*"); // FIXME: factor out with ScribSocketGenerator + this.ib.addImports(SessionApiGenerator.getRolesPackageName(gpn) + ".*"); + this.ib.addImports(SessionApiGenerator.getOpsPackageName(gpn) + ".*"); + this.ib.addModifiers(JavaBuilder.PUBLIC); + this.ib.addParameters("__Succ extends " + SuccessorIfaceGen.getSuccessorInterfaceName(this.a)); + AbstractMethodBuilder mb = this.ib.newAbstractMethod(); // FIXME: factor out with ReceiveSocketBuilder + //AbstractMethodBuilder mb2 = null; + if (this.a instanceof ERecv) + { + /*if (this.curr.getAcceptable().size() > 1) + { + //CaseSocketGenerator.setCaseReceiveHeaderWithoutReturnType(this.apigen, this.a, mb); + } + //else*/ + { + ReceiveSockGen.setReceiveHeaderWithoutReturnType(this.apigen, this.a, mb); + /*if (this.curr.getAcceptable().size() == 1) // FIXME: action interface should not depend on curr state -- should generate this method in the IO State I/f, not here + { + mb2 = this.ib.newAbstractMethod(); + ReceiveSocketGenerator.setAsyncDiscardHeaderWithoutReturnType(this.apigen, this.a, mb2, + InputFutureGenerator.getInputFutureName(this.apigen.getSocketClassName(this.curr))); + } + /*else + { + CaseSocketGenerator.setCaseReceiveDiscardHeaderWithoutReturnType(this.apigen, this.a, mb2); + }*/ + } + } + else //if (this.a instanceof Send) + { + OutputSockGen.setSendHeaderWithoutReturnType(this.apigen, this.a, mb); + } + /*EndpointState succ = this.curr.accept(this.a); + if (succ.isTerminal()) + { + ScribSocketGenerator.setNextSocketReturnType(this.apigen, mb, succ); + /*if (this.a instanceof Receive) + { + ScribSocketGenerator.setNextSocketReturnType(this.apigen, mb2, succ); + }* / + } + else*/ + { + mb.setReturn("__Succ"); + //if (this.a instanceof Receive) + /*if (this.a instanceof Receive && this.curr.getAcceptable().size() == 1) + { + mb2.setReturn("__Succ"); + }*/ + } + return ib; + } + + // FIXME: curr unnecessary + public static String getActionInterfaceName(EAction a) + { + /*String name = (a instanceof Receive) + ? "In" + : "Out";*/ + String name; + //if (curr.getAcceptable().iterator().next() instanceof Receive) + if (a instanceof ERecv) + { + /*if (curr.getAcceptable().size() > 1) + { + name = "Case"; // FIXME: make subtype of In? + } + //else*/ + { + name = "In"; + } + } + else + { + name = "Out"; + } + name += "_" + getActionString(a); + return name; + } + + public static String getActionString(EAction a) // FIXME: peer not needed for inputs + { + //String name = a.peer + "$" + a.mid; + String name = a.obj + "_" + a.mid; + for (PayElemType pay : a.payload.elems) + { + //name += "$" + pay; + name += "_" + pay; + } + return name; + } +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/ioifaces/BranchIfaceGen.java b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/ioifaces/BranchIfaceGen.java new file mode 100644 index 000000000..90c0f47c9 --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/ioifaces/BranchIfaceGen.java @@ -0,0 +1,107 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.java.statechanapi.ioifaces; + +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import java.util.stream.IntStream; + +import org.scribble.codegen.java.sessionapi.SessionApiGenerator; +import org.scribble.codegen.java.statechanapi.ScribSockGen; +import org.scribble.codegen.java.statechanapi.StateChannelApiGenerator; +import org.scribble.codegen.java.util.AbstractMethodBuilder; +import org.scribble.codegen.java.util.EnumBuilder; +import org.scribble.codegen.java.util.InterfaceBuilder; +import org.scribble.codegen.java.util.JavaBuilder; +import org.scribble.core.model.endpoint.EState; +import org.scribble.core.model.endpoint.actions.EAction; +import org.scribble.core.type.name.Role; +import org.scribble.util.ScribException; + +public class BranchIfaceGen extends IOStateIfaceGen +{ + public BranchIfaceGen(StateChannelApiGenerator apigen, Map actions, EState curr) + { + super(apigen, actions, curr); + } + + @Override + protected void constructInterface() throws ScribException + { + super.constructInterface(); + addBranchEnum(); + addBranchMethods(); + } + + protected void addBranchMethods() + { + Role self = this.apigen.getSelf(); + //Set as = this.curr.getActions(); + List as = this.curr.getDetActions(); + + // FIXME: factor out with BranchSocketGenerator + AbstractMethodBuilder bra = this.ib.newAbstractMethod("branch"); + String ret = CaseIfaceGen.getCasesInterfaceName(self, this.curr) + + "<" + IntStream.range(1, as.size()+1).mapToObj((i) -> "__Succ" + i).collect(Collectors.joining(", ")) + ">"; // FIXME: factor out + bra.setReturn(ret); + bra.addParameters(SessionApiGenerator.getRoleClassName(as.iterator().next().obj) + " role"); + bra.addExceptions(StateChannelApiGenerator.SCRIBBLERUNTIMEEXCEPTION_CLASS, "java.io.IOException", "ClassNotFoundException"); + + AbstractMethodBuilder bra2 = this.ib.newAbstractMethod("branch"); + bra2.setReturn(JavaBuilder.VOID); + bra2.addParameters(SessionApiGenerator.getRoleClassName(as.iterator().next().obj) + " role"); + String next = HandleIfaceGen.getHandleInterfaceName(self, this.curr) + "<" + IntStream.range(1, as.size() + 1).mapToObj((i) -> "__Succ" + i).collect(Collectors.joining(", ")) + ">"; + bra2.addParameters(next + " handler"); + bra2.addExceptions(StateChannelApiGenerator.SCRIBBLERUNTIMEEXCEPTION_CLASS, "java.io.IOException", "ClassNotFoundException"); + + AbstractMethodBuilder bra3 = this.ib.newAbstractMethod("handle"); + bra3.setReturn(JavaBuilder.VOID); + bra3.addParameters(SessionApiGenerator.getRoleClassName(as.iterator().next().obj) + " role"); + String handle = HandleIfaceGen.getHandleInterfaceName(self, this.curr) + "<" + + as.stream().sorted(IOStateIfaceGen.IOACTION_COMPARATOR) + .map((a) -> SuccessorIfaceGen.getSuccessorInterfaceName(a)).collect(Collectors.joining(", ")) + ">"; + bra3.addParameters(handle + " handler"); + bra3.addExceptions(StateChannelApiGenerator.SCRIBBLERUNTIMEEXCEPTION_CLASS, "java.io.IOException", "ClassNotFoundException"); + } + + protected void addBranchEnum() + { + Role self = this.apigen.getSelf(); + + // Duplicated from BranchSocketGenerator + EnumBuilder eb = this.ib.newMemberEnum(getBranchInterfaceEnumName(self, this.curr)); + eb.addModifiers(JavaBuilder.PUBLIC); + eb.addInterfaces(ScribSockGen.OPENUM_INTERFACE); + this.curr.getDetActions() + .forEach(a -> eb.addValues(SessionApiGenerator.getOpClassName(a.mid))); + } + + // Don't add Action Interfaces (added to CaseInterface) + @Override + protected void addSuccessorParamsAndActionInterfaces() + { + int i = 1; + for (EAction a : this.curr.getDetActions().stream().sorted(IOACTION_COMPARATOR).collect(Collectors.toList())) + { + this.ib.addParameters("__Succ" + i + " extends " + SuccessorIfaceGen.getSuccessorInterfaceName(a)); + i++; + } + } + + public static String getBranchInterfaceEnumName(Role self, EState curr) + { + return getIOStateInterfaceName(self, curr) + "_Enum"; + } +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/ioifaces/CaseIfaceGen.java b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/ioifaces/CaseIfaceGen.java new file mode 100644 index 000000000..4d22aca14 --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/ioifaces/CaseIfaceGen.java @@ -0,0 +1,111 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.java.statechanapi.ioifaces; + +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import org.scribble.codegen.java.sessionapi.SessionApiGenerator; +import org.scribble.codegen.java.statechanapi.CaseSockGen; +import org.scribble.codegen.java.statechanapi.ScribSockGen; +import org.scribble.codegen.java.statechanapi.StateChannelApiGenerator; +import org.scribble.codegen.java.util.AbstractMethodBuilder; +import org.scribble.codegen.java.util.InterfaceBuilder; +import org.scribble.codegen.java.util.JavaBuilder; +import org.scribble.codegen.java.util.MethodBuilder; +import org.scribble.core.model.endpoint.EState; +import org.scribble.core.model.endpoint.actions.EAction; +import org.scribble.core.type.name.GProtoName; +import org.scribble.core.type.name.Role; +import org.scribble.util.ScribException; + +public class CaseIfaceGen extends IOStateIfaceGen +{ + public CaseIfaceGen(StateChannelApiGenerator apigen, Map actions, EState curr) + { + super(apigen, actions, curr); + } + + @Override + protected void constructInterface() throws ScribException + { + super.constructInterface(); + addBranchEnumField(); + addCaseReceiveDiscardMethods(); + } + + @Override + protected void addHeader() + { + GProtoName gpn = this.apigen.getGProtocolName(); + Role self = this.apigen.getSelf(); + String packname = IOInterfacesGenerator.getIOInterfacePackageName(gpn, self); + String ifname = getCasesInterfaceName(self, this.curr); + + this.ib.setName(ifname); + this.ib.setPackage(packname); + this.ib.addModifiers(JavaBuilder.PUBLIC); + } + + /*@Override + protected void addSuccessorInterfaces() + { + + }*/ + + protected void addBranchEnumField() + { + Role self = this.apigen.getSelf(); + String name = super.getIOStateInterfaceName(self, this.curr); + + AbstractMethodBuilder op = this.ib.newAbstractMethod("getOp"); + op.setReturn(name + "." + BranchIfaceGen.getBranchInterfaceEnumName(self, this.curr)); + } + + protected void addCaseReceiveDiscardMethods() + { + GProtoName gpn = this.apigen.getGProtocolName(); + //Set as = this.curr.getActions(); + List as = this.curr.getDetActions(); + + int i = 1; + this.ib.addImports(SessionApiGenerator.getOpsPackageName(gpn) + ".*"); + for (EAction a : as.stream().sorted(IOACTION_COMPARATOR).collect(Collectors.toList())) + { + MethodBuilder mb = this.ib.newAbstractMethod(); + CaseSockGen.setCaseReceiveDiscardHeaderWithoutReturnType(this.apigen, a, mb); + EState succ = this.curr.getDetSuccessor(a); + if (succ.isTerminal()) + { + ScribSockGen.setNextSocketReturnType(this.apigen, mb, succ); + } + else + { + mb.setReturn("__Succ" + i); // Hacky? // FIXME: factor out Succ + } + i++; + } + } + + //protected static String getCasesInterfaceName(String braif) + // Pre: s is a branch state + // Cf. IOStateInterfaceGenerator.getIOStateInterfaceName + protected static String getCasesInterfaceName(Role self, EState s) + { + //return "Case_" + braif.substring("Branch_".length(), braif.length()); + return "Case_" + self + "_" + s.getDetActions().stream().sorted(IOACTION_COMPARATOR) + .map((a) -> ActionIfaceGen.getActionString(a)).collect(Collectors.joining("__")); + } +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/ioifaces/HandleIfaceGen.java b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/ioifaces/HandleIfaceGen.java new file mode 100644 index 000000000..e84fb1266 --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/ioifaces/HandleIfaceGen.java @@ -0,0 +1,214 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.java.statechanapi.ioifaces; + +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import org.scribble.codegen.java.sessionapi.SessionApiGenerator; +import org.scribble.codegen.java.statechanapi.HandlerIfaceGen; +import org.scribble.codegen.java.statechanapi.ScribSockGen; +import org.scribble.codegen.java.util.InterfaceBuilder; +import org.scribble.codegen.java.util.JavaBuilder; +import org.scribble.codegen.java.util.MethodBuilder; +import org.scribble.core.model.endpoint.EState; +import org.scribble.core.model.endpoint.actions.EAction; +import org.scribble.core.type.name.GProtoName; +import org.scribble.core.type.name.Role; +import org.scribble.util.ScribException; + +// Cf. HandlerInterfaceGenerator +public class HandleIfaceGen extends IOStateIfaceGen +{ + //private final IOInterfacesGenerator iogen; + + private final Map caseActions; + + public HandleIfaceGen(IOInterfacesGenerator iogen, Map actions, EState curr, Map caseActions) + { + super(iogen.apigen, actions, curr); + //this.iogen = iogen; + + this.caseActions = caseActions; + } + + @Override + protected void constructInterface() throws ScribException + { + super.constructInterface(); + addHandleMethods(); + } + + @Override + protected void addHeader() + { + GProtoName gpn = this.apigen.getGProtocolName(); + Role self = this.apigen.getSelf(); + String packname = IOInterfacesGenerator.getIOInterfacePackageName(gpn, self); + String ifname = getHandleInterfaceName(self, this.curr); + + this.ib.setName(ifname); + this.ib.setPackage(packname); + this.ib.addModifiers(JavaBuilder.PUBLIC); + } + + @Override + protected void addCastField() + { + + } + + @Override + protected void addSuccessorParamsAndActionInterfaces() + { + //Role self = this.apigen.getSelf(); + + int i = 1; + //for (IOAction a : getHandleInterfaceIOActionParams(this.curr)) // Branch successor state successors, not the "direct" successors + // Duplicated from BranchInterfaceGenerator + for (EAction a : this.curr.getDetActions().stream().sorted(IOACTION_COMPARATOR).collect(Collectors.toList())) + { + this.ib.addParameters("__Succ" + i + " extends " + SuccessorIfaceGen.getSuccessorInterfaceName(a)); + this.ib.addInterfaces(this.caseActions.get(a).getName() + "<__Succ" + i + ">"); + i++; + } + /*for (InterfaceBuilder ib : this.succifs) // Already sorted + { + this.ib.addParameters("__Succ" + i + " extends " + ib.getName()); + i++; + }*/ + } + + /*// Pre: curr is a branch state + private static List getHandleInterfaceIOActionParams(EndpointState curr) + { + List as = new LinkedList<>(); + for (IOAction a : curr.getAcceptable().stream().sorted(IOACTION_COMPARATOR).collect(Collectors.toList())) + { + EndpointState succ = curr.accept(a); + /*InterfaceBuilder iostateif = this.iogen.getIOStateInterface(IOStateInterfaceGenerator.getIOStateInterfaceName(self, succ)); + for (String param : iostateif.getParameters()) + { + this.ib.addParameters("__Succ" + i + " extends " + SuccessorInterfaceGenerator.getSuccessorInterfaceName(this.curr, a)); + }* / + for (IOAction b : succ.getAcceptable().stream().sorted(IOACTION_COMPARATOR).collect(Collectors.toList())) + { + //if (!as.contains(b)) + { + as.add(b); + } + } + } + return as; + }*/ + + protected void addHandleMethods() throws ScribException + { + GProtoName gpn = this.apigen.getGProtocolName(); + //Role self = this.apigen.getSelf(); + //Set as = this.curr.getActions(); + List as = this.curr.getDetActions(); + + this.ib.addImports(SessionApiGenerator.getOpsPackageName(gpn) + ".*"); + int i = 1; + for (EAction a : as.stream().sorted(IOACTION_COMPARATOR).collect(Collectors.toList())) + { + /*EndpointState succ = this.curr.accept(a); + MethodBuilder mb = this.ib.newAbstractMethod(); + HandlerInterfaceGenerator.setHandleMethodHeaderWithoutParamTypes(this.apigen, mb); + i = setHandleMethodSuccessorParam(this.iogen, self, succ, mb, i); + HandlerInterfaceGenerator.addHandleMethodOpAndPayloadParams(this.apigen, a, mb);*/ + + MethodBuilder mb = this.ib.newAbstractMethod(); + HandlerIfaceGen.setHandleMethodHeaderWithoutParamTypes(this.apigen, mb); + //setHandleMethodSuccessorParam(this.iogen, self, succ, mb); + mb.addParameters("__Succ" + i++ + " schan"); + HandlerIfaceGen.addHandleMethodOpAndPayloadParams(this.apigen, a, mb); + } + } + + //protected static int setHandleMethodSuccessorParam(IOInterfacesGenerator iogen, Role self, EndpointState succ, MethodBuilder mb, int i) + protected static void setHandleMethodSuccessorParam(IOInterfacesGenerator iogen, Role self, EState succ, MethodBuilder mb, List as, Map count) + { + if (succ.isTerminal()) + { + mb.addParameters(ScribSockGen.ENDSOCKET_CLASS + " end"); + } + else + { + InterfaceBuilder next = iogen.getIOStateInterface(IOStateIfaceGen.getIOStateInterfaceName(self, succ)); // Select/Receive/Branch + String ret = next.getName() + "<"; + /*//ret += "<" + next.getParameters().stream().map((p) -> "__Succ" + i++).collect(Collectors.joining(", ")) + ">"; // FIXME: fragile? + boolean first = true; + for (String p : next.getParameters()) + { + if (first) + { + first = false; + } + else + { + ret += ", "; + } + ret += "__Succ" + i++; + } + ret += ">"; + mb.addParameters(ret + " schan"); + + // duplicates possible? -- can have repeat continuations, but the branch operation ops themselves will be distinct + } + return i;*/ + + //Map ount = new HashMap<>(); + boolean first = true; + for (EAction a : succ.getDetActions().stream().sorted(IOStateIfaceGen.IOACTION_COMPARATOR).collect(Collectors.toList())) + { + int offset; + if (!count.containsKey(a)) + { + offset = 0; + count.put(a, 0); + } + else + { + offset = count.get(a) + 1; + count.put(a, offset); + } + //if (count.keySet().size() > 1) + if (first) + { + first = false; + } + else + { + ret += ", "; + } + ret += "__Succ" + (as.indexOf(a) + 1 + offset); + } + ret += ">"; + mb.addParameters(ret + " schan"); + } + } + + // Pre: s is a branch state + public static String getHandleInterfaceName(Role self, EState s) + { + // FIXME: factor out (CaseInterfaceGenerator, IOStateInterfaceGenerator.getIOStateInterfaceName) + String name = "Handle_" + self + "_" + s.getDetActions().stream().sorted(IOACTION_COMPARATOR) + .map((a) -> ActionIfaceGen.getActionString(a)).collect(Collectors.joining("__")); + IOStateIfaceGen.checkIOStateInterfaceNameLength(name); + return name; + } +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/ioifaces/IOIfaceGen.java b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/ioifaces/IOIfaceGen.java new file mode 100644 index 000000000..b7692af9a --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/ioifaces/IOIfaceGen.java @@ -0,0 +1,29 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.java.statechanapi.ioifaces; + +import org.scribble.codegen.java.statechanapi.StateChanTypeGen; +import org.scribble.codegen.java.statechanapi.StateChannelApiGenerator; +import org.scribble.core.model.endpoint.EState; + +public abstract class IOIfaceGen extends StateChanTypeGen +{ + protected final EState curr; + + public IOIfaceGen(StateChannelApiGenerator apigen, EState curr) + { + super(apigen); + this.curr = curr; + } +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/ioifaces/IOInterfacesGenerator.java b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/ioifaces/IOInterfacesGenerator.java new file mode 100644 index 000000000..2aec10116 --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/ioifaces/IOInterfacesGenerator.java @@ -0,0 +1,1057 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.java.statechanapi.ioifaces; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedHashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.IntStream; + +import org.scribble.codegen.java.ApiGen; +import org.scribble.codegen.java.sessionapi.SessionApiGenerator; +import org.scribble.codegen.java.statechanapi.CaseSockGen; +import org.scribble.codegen.java.statechanapi.HandlerIfaceGen; +import org.scribble.codegen.java.statechanapi.ScribSockGen; +import org.scribble.codegen.java.statechanapi.StateChannelApiGenerator; +import org.scribble.codegen.java.util.AbstractMethodBuilder; +import org.scribble.codegen.java.util.ClassBuilder; +import org.scribble.codegen.java.util.FieldBuilder; +import org.scribble.codegen.java.util.InterfaceBuilder; +import org.scribble.codegen.java.util.JavaBuilder; +import org.scribble.codegen.java.util.MethodBuilder; +import org.scribble.codegen.java.util.TypeBuilder; +import org.scribble.core.job.CoreArgs; +import org.scribble.core.job.CoreContext; +import org.scribble.core.model.endpoint.EState; +import org.scribble.core.model.endpoint.EStateKind; +import org.scribble.core.model.endpoint.actions.EAction; +import org.scribble.core.type.name.GProtoName; +import org.scribble.core.type.name.Role; +import org.scribble.util.RuntimeScribException; +import org.scribble.util.ScribException; + +// Cf. StateChannelApiGenerator +// TODO: concrete state channel "to" casts for supertype i/f's (the info is there in the Java type hierachy though) +// Maybe record subtype hierarchy explicitly +// TODO: check if generated subtypes scalability issue is just Eclipse or also javac +// FIXME: try I/O i/f's with "message decomposition" approach (split op and each payload as separate messages) -- should make nominal interfaces more manageable -- cf. Sig messages +public class IOInterfacesGenerator extends ApiGen +{ + private final boolean SUBTYPES; + + protected StateChannelApiGenerator apigen; + + private final Map actions = new HashMap<>(); + private final Map succs = new HashMap<>(); + private final Map iostates = new HashMap<>(); // Key is interface simple name + + private final Map caseActions = new HashMap<>(); + + private final Map> preActions = new HashMap<>(); // Pre set: the actions that lead to each state + private final Map> preds = new HashMap<>(); + + private final Map> branchPostActions = new HashMap<>(); + //private final Map> branchSuccs = new HashMap<>(); + private final Map> branchSuccs = new HashMap<>(); // key: HandleInterface name // Sorted when collected + + public IOInterfacesGenerator(StateChannelApiGenerator apigen, + boolean subtypes) throws RuntimeScribException, ScribException + { + super(apigen.getJob(), apigen.getGProtocolName()); + this.apigen = apigen; + this.SUBTYPES = subtypes; + + GProtoName fullname = apigen.getGProtocolName(); + Role self = getSelf(); + //EndpointState init = this.job.getContext().getEndpointGraph(fullname, self).init; + CoreContext corec = this.core.getContext(); + EState init = this.job.config.args.get(CoreArgs.MIN_EFSM) + ? corec.getMinimisedEGraph(fullname, self).init + : corec.getEGraph(fullname, self).init; + //if (IOInterfacesGenerator.skipIOInterfacesGeneration(init)) + { + // FIXME: factor out with skipIOInterfacesGeneration + Set as = init.getReachableActions(); + if (as.stream().anyMatch(a -> !a.isSend() && !a.isReceive())) // HACK FIXME (connect/disconnect) + { + throw new RuntimeScribException( + "[TODO] I/O Interface generation not supported for: " + + as.stream().filter(a -> !a.isSend() && !a.isReceive()) + .collect(Collectors.toList())); + } + } + + generateActionAndSuccessorInterfacesAndCollectPreActions(new HashSet<>(), init); + generateIOStateInterfacesFirstPass(new HashSet<>(), init); + collectPreds(); + + //EndpointState term = EndpointState.findTerminalState(new HashSet<>(), init); + EState term = init.getTerminal(); + ClassBuilder endsock = null; + if (term != null) + { + endsock = (ClassBuilder) this.apigen.getType(ScribSockGen.GENERATED_ENDSOCKET_NAME); + for (InterfaceBuilder ib : this.preds.get(term)) + { + endsock.addInterfaces(ib.getName()); + + MethodBuilder mb2 = addToCastMethod(ib, "EndSocket"); + if (mb2 != null) + { + ib.addImports(SessionApiGenerator.getStateChannelPackageName(this.gpn, self) + ".EndSocket"); + } + } + endsock.addImports(getIOInterfacePackageName(this.gpn, self) + ".*"); + } + + generateIOStateInterfacesSecondPass(new HashSet<>(), init); + collectBranchSuccs(); + generateHandleInterfaces(new HashSet<>(), init); + generateHandleInterfacesSecondPass(new HashSet<>(), init); + addIOStateInterfacesToStateChannels(new HashSet<>(), init); // Except EndSocket + + if (this.SUBTYPES) + { + addSupertypeInterfaces(); + } + + // Successor I/f's for EndSocket + // FIXME: refactor EndSocket into main collection of generated types (this.apigen.getType) + //EndpointState term = EndpointState.findTerminalState(new HashSet<>(), init); + if (term != null) + { + //endsock = (ClassBuilder) this.apigen.getType(ScribSocketGenerator.GENERATED_ENDSOCKET_NAME); + //endsock.addImports(getIOInterfacePackageName(this.gpn, self) + ".*"); + for (InterfaceBuilder ib : this.preds.get(term)) + { + //endsock.addInterfaces(ib.getName()); + + // Duplicated from generateIOStateInterfacesSecondPass + for (MethodBuilder cast : ib.getDefaultMethods()) // cast is a default method (a to cast -- hacky) in pred + { + // Overriding every Successor I/f to methods in the I/O State I/f, even if unnecessary + if (!cast.getReturn().equals("EndSocket")) + { + MethodBuilder mb = addEndSocketToCastMethod(endsock, cast.getReturn(), "throw new RuntimeScribException(\"Invalid cast of EndSocket: \" + cast);"); + if (mb != null) + + { + mb.addModifiers(JavaBuilder.PUBLIC); + mb.addAnnotations("@Override"); + endsock.addImports("org.scribble.util.RuntimeScribException"); + } + } + } + } + + /*MethodBuilder mb2 = addToCastMethod(ib, "EndSocket"); + if (mb2 != null) + { + ib.addImports(SessionApiGenerator.getStateChannelPackageName(this.gpn, self) + ".EndSocket"); + }*/ + MethodBuilder mb3 = addEndSocketToCastMethod(endsock, "EndSocket", "return (EndSocket) this;"); + if (mb3 != null) + { + mb3.addModifiers(JavaBuilder.PUBLIC); + mb3.addAnnotations("@Override"); + } + } + } + + /*public static boolean skipIOInterfacesGeneration(EndpointState init) + { + Set as = EndpointState.getAllReachableActions(init); + if (as.stream().anyMatch((a) -> !a.isSend() && !a.isReceive())) // HACK FIXME (connect/disconnect) + { + return true; + } + return false; + }*/ + + @Override + public Map generateApi() + { + Map output = new HashMap<>(); + String prefix = getIOInterfacePackageName(this.gpn, getSelf()).replace('.', '/') + "/"; + this.actions.values() + .forEach(ib -> output.put(prefix + ib.getName() + ".java", ib.build())); + this.succs.values() + .forEach(ib -> output.put(prefix + ib.getName() + ".java", ib.build())); + this.iostates.values() + .forEach(tb -> output.put(prefix + tb.getName() + ".java", tb.build())); + + this.caseActions.values() + .forEach(ib -> output.put(prefix + ib.getName() + ".java", ib.build())); + + return output; + } + + // Factor out FSM visitor? + private void generateActionAndSuccessorInterfacesAndCollectPreActions(Set visited, EState s) throws ScribException + { + if (visited.contains(s) || s.isTerminal()) + { + return; + } + visited.add(s); + + //Set as = s.getActions(); + List as = s.getDetActions(); + for (EAction a : as.stream().sorted(IOStateIfaceGen.IOACTION_COMPARATOR).collect(Collectors.toList())) + { + if (!a.isSend() && !a.isReceive()) // TODO (connect/disconnect) + { + throw new RuntimeScribException("TODO: " + a); + } + + if (!this.actions.containsKey(a)) + { + this.actions.put(a, new ActionIfaceGen(this.apigen, s, a).generateType()); + this.succs.put(a, new SuccessorIfaceGen(this.apigen, s, a).generateType()); + + if (s.getStateKind() == EStateKind.POLY_RECIEVE) + { + // Duplicated from ActionInterfaceGenerator + InterfaceBuilder ib = new InterfaceBuilder(); + ib.setName("Callback_" + ActionIfaceGen.getActionString(a)); + ib.setPackage(IOInterfacesGenerator.getIOInterfacePackageName(this.apigen.getGProtocolName(), this.apigen.getSelf())); + ib.addImports("java.io.IOException"); + ib.addImports(SessionApiGenerator.getEndpointApiRootPackageName(this.gpn) + ".*"); + ib.addImports(SessionApiGenerator.getRolesPackageName(this.gpn) + ".*"); + ib.addImports(SessionApiGenerator.getOpsPackageName(this.gpn) + ".*"); + ib.addModifiers(JavaBuilder.PUBLIC); + ib.addParameters("__Succ extends " + SuccessorIfaceGen.getSuccessorInterfaceName(a)); + AbstractMethodBuilder mb = ib.newAbstractMethod(); + // Duplicated from HandleInterfaceGenerator + HandlerIfaceGen.setHandleMethodHeaderWithoutParamTypes(this.apigen, mb); + mb.addParameters("__Succ schan"); + HandlerIfaceGen.addHandleMethodOpAndPayloadParams(this.apigen, a, mb); + this.caseActions.put(a, ib); + } + } + + EState succ = s.getDetSuccessor(a); + putPreAction(succ, a); + + if (s.getStateKind() == EStateKind.POLY_RECIEVE) + { + /*for (IOAction b : s.accept(a).getAcceptable().stream().sorted(IOStateInterfaceGenerator.IOACTION_COMPARATOR).collect(Collectors.toList())) + { + putBranchPostAction(s, b); + }*/ + putBranchPostAction(s, a); + } + + generateActionAndSuccessorInterfacesAndCollectPreActions(visited, succ); + /*Set tmp = new HashSet<>(visited); + tmp.add(s); // merge paths visited multiple times + generateActionAndSuccessorInterfacesAndCollectPredecessors(tmp, succ);*/ + } + } + + // Generates partial IO State Interfaces + private void generateIOStateInterfacesFirstPass(Set visited, EState s) throws ScribException + { + if (visited.contains(s) || s.isTerminal()) + { + return; + } + + String key = IOStateIfaceGen.getIOStateInterfaceName(getSelf(), s); + if (!this.iostates.containsKey(key)) // Don't generate if one already exists (up to this pass, repeats will all be the same, i.e. name, Action Interfaces, and action-succ parameters) + { + // Make the partial I/O State Interface (Successor Interfaces and cast methods added later -- different states may share same State I/f) + IOStateIfaceGen ifgen = null; + switch (s.getStateKind()) + { + case OUTPUT: // Send, connect, disconnect + ifgen = new SelectIfaceGen(this.apigen, this.actions, s); + break; + case UNARY_RECEIVE: + ifgen = new ReceiveIfaceGen(this.apigen, this.actions, s); + break; + case POLY_RECIEVE: + InterfaceBuilder cases = new CaseIfaceGen(this.apigen, this.actions, s).generateType(); + this.iostates.put(cases.getName(), cases); + ifgen = new BranchIfaceGen(this.apigen, this.actions, s); + break; + case TERMINAL: + default: + throw new RuntimeException("(TODO) I/O interface generation: " + s.getStateKind()); + } + this.iostates.put(key, ifgen.generateType()); + } + + visited.add(s); + for (EAction a : s.getDetActions()) + { + generateIOStateInterfacesFirstPass(visited, s.getDetSuccessor(a)); + } + } + + // Adds Successor Interfaces and to-cast methods to IO State Interfaces + private void generateIOStateInterfacesSecondPass(Set visited, EState s) + { + if (visited.contains(s) || s.isTerminal()) + { + return; + } + + Set succifs = this.preds.get(s); // Successor interfaces to be implemented by IO State Interface of s + if (succifs != null) + { + InterfaceBuilder iostate = this.iostates.get(IOStateIfaceGen.getIOStateInterfaceName(getSelf(), s)); + if (this.SUBTYPES) // HACK moved here from addSupertypeInterfaces to ensure duplicate inherited to's get overridden + { + // Generate Succ I/f supertype "to" cast methods for supertype to's + String name = iostate.getName(); + if (name.startsWith("Select")) + { + List ifs = this.iostates.get(name).getInterfaces(); + List outs = ifs.stream().filter((i) -> i.startsWith("Out")) + .map((o) -> (o = o.substring(0, o.indexOf("<"))).substring(o.indexOf("_") + 1, o.length())) + .sorted((s1, s2) -> s1.compareTo(s2)) + .collect(Collectors.toList()); + addSupertypeInterfaceToMethods(s, outs, "Select", "Out"); + } + } + + for (InterfaceBuilder pred : succifs) // pred is a Successor Interface for the state s + { + // May already have "visited" this State I/f for a different state -- Interfaces recorded as a Set, to support repeated adds + iostate.addInterfaces(pred.getName()); // Adds Successor Interfaces to this I/O State Interface + String ret = iostate.getName() + "<" + + IntStream.range(0, iostate.getParameters().size()).mapToObj((i) -> "?").collect(Collectors.joining(", ")) + ">"; + addToCastMethod(pred, ret); + + for (MethodBuilder cast : pred.getDefaultMethods()) // cast is a default method (a to cast -- hacky) in pred + { + // Overriding every Successor I/f "to" method in the I/O State I/f, even if unnecessary + MethodBuilder mb = addToCastMethod(iostate, cast.getReturn()); + if (mb != null) + { + mb.addAnnotations("@Override"); + } + } + } + } + + visited.add(s); + for (EAction a : s.getDetActions()) + { + generateIOStateInterfacesSecondPass(visited, s.getDetSuccessor(a)); + } + } + + private void generateHandleInterfaces(Set visited, EState s) throws ScribException + { + if (visited.contains(s) || s.isTerminal()) + { + return; + } + + if (s.getStateKind() == EStateKind.POLY_RECIEVE) + { + //Set succifs = this.preds.get(s); + String key = HandleIfaceGen.getHandleInterfaceName(getSelf(), s); + if (!this.iostates.containsKey(key)) + { + IOStateIfaceGen ifgen = new HandleIfaceGen(this, this.actions, s, this.caseActions); + this.iostates.put(key, ifgen.generateType()); + } + } + + visited.add(s); + for (EAction a : s.getDetActions()) + { + generateHandleInterfaces(visited, s.getDetSuccessor(a)); + } + } + + private void generateHandleInterfacesSecondPass(Set visited, EState s) + { + if (visited.contains(s) || s.isTerminal()) + { + return; + } + + if (s.getStateKind() == EStateKind.POLY_RECIEVE) + { + //GProtocolName gpn = this.apigen.getGProtocolName(); + Role self = this.apigen.getSelf(); + + //String foo = HandlerInterfaceGenerator.getHandlerInterfaceName(IOStateInterfaceGenerator.getIOStateInterfaceName(self, s)); + String key = HandleIfaceGen.getHandleInterfaceName(self, s); + List succifs = this.branchSuccs.get(key); + if (succifs != null) + { + ////InterfaceBuilder handleif = this.iostates.get(HandleInterfaceGenerator.getHandleInterfaceName(self, s)); + //InterfaceBuilder handleif = this.iostates.get(key); + + /*if (handleif.getParameters().isEmpty()) // Hacky? + { + int i = 1; + for (IOAction b : succifs) // Already sorted + { + handleif.addParameters("__Succ" + i + " extends " + SuccessorInterfaceGenerator.getSuccessorInterfaceName(b));//this.succs.get(b).getName()); + i++; + } + + handleif.addImports(SessionApiGenerator.getOpsPackageName(gpn) + ".*"); + //int j = 1; + /*Iterator foo = s.getAcceptable().stream().sorted(IOStateInterfaceGenerator.IOACTION_COMPARATOR).iterator(); + EndpointState succ = s.accept(foo.next());* / + }*/ + + ////Map count = new HashMap<>(); + //List tmp = this.branchSuccs.get(key); + ////tmp.stream().forEach((a) -> count.put(a, (int) tmp.stream().filter((b) -> b.equals(a)).count())); + //Map count = new HashMap<>(); + /*for (IOAction a : this.branchPostActions.get(s).stream().sorted(IOStateInterfaceGenerator.IOACTION_COMPARATOR).collect(Collectors.toList())) + { + /*for (IOAction b : succifs) + { + if (!succ.isAcceptable(b)) + { + succ = s.accept(foo.next()); + }* / + EndpointState succ = s.accept(a); + MethodBuilder mb = handleif.newAbstractMethod(); + HandlerInterfaceGenerator.setHandleMethodHeaderWithoutParamTypes(this.apigen, mb); + //j = HandleInterfaceGenerator.setHandleMethodSuccessorParam(this, self, succ, mb, j); + HandleInterfaceGenerator.setHandleMethodSuccessorParam(this, self, succ, mb, tmp, count); + /*for (IOAction b : count.keySet()) + { + for (int j = 0; j < count.get(b); j++) + { + tmp.remove(b); + } + }* / + HandlerInterfaceGenerator.addHandleMethodOpAndPayloadParams(this.apigen, a, mb); + + handleif.checkDuplicateMethods(mb); // Hacky + //} + }*/ + } + } + + visited.add(s); + for (EAction a : s.getDetActions()) + { + generateHandleInterfacesSecondPass(visited, s.getDetSuccessor(a)); + } + } + + // Except EndSocket + private void addIOStateInterfacesToStateChannels(Set visited, EState s) + { + if (visited.contains(s) || s.isTerminal()) + { + return; + } + + Role self = getSelf(); + String scname = this.apigen.getSocketClassName(s); + String ioname = IOStateIfaceGen.getIOStateInterfaceName(self, s); + + TypeBuilder tb = this.apigen.getType(scname); + + // Add I/O State Interface to each ScribSocket (except CaseSocket) + // Do here (not inside I/O State Interface generators) because multiple states can share the same I/O State Interface + tb.addImports(getIOInterfacePackageName(this.gpn, self) + ".*"); + tb.addInterfaces(ioname + getConcreteSuccessorParameters(s)); + + InterfaceBuilder iostate = this.iostates.get(ioname); + MethodBuilder mb = addToCastMethod(iostate, scname); + if (mb != null) + { + iostate.addImports(SessionApiGenerator.getStateChannelPackageName(this.gpn, self) + ".*"); + } + + if (s.getStateKind() == EStateKind.POLY_RECIEVE) + { + // Add CaseInterface to each CaseSocket + TypeBuilder cases = this.apigen.getType(CaseSockGen.getCaseSocketName(this.apigen.getSocketClassName(s))); + cases.addImports(getIOInterfacePackageName(this.gpn, self) + ".*"); + cases.addInterfaces(CaseIfaceGen.getCasesInterfaceName(self, s) + getConcreteSuccessorParameters(s)); + + // Add HandleInterface to each HandlerInterface + InterfaceBuilder handler = (InterfaceBuilder) this.apigen.getType(HandlerIfaceGen.getHandlerInterfaceName(this.apigen.getSocketClassName(s))); + handler.addImports(getIOInterfacePackageName(this.gpn, self) + ".*"); + // FIXME: factor out with HandleInterfaceGenerator and getConcreteSuccessorParameters + String tmp = ""; + boolean first = true; + /*for (IOAction a : s.getAcceptable().stream().sorted(IOStateInterfaceGenerator.IOACTION_COMPARATOR).collect(Collectors.toList())) + { + EndpointState succ = s.accept(a); + for (IOAction b : succ.getAcceptable().stream().sorted(IOStateInterfaceGenerator.IOACTION_COMPARATOR).collect(Collectors.toList())) + { + if (first) + { + first = false; + } + else + { + tmp += ", "; + } + tmp += this.getSuccName.apply(succ.accept(b)); + } + }*/ + String handle = HandleIfaceGen.getHandleInterfaceName(self, s); + /*List foo1 = new LinkedList<>(); + List bar1 = new LinkedList<>(); + for (IOAction a : s.getAcceptable().stream().sorted(IOStateInterfaceGenerator.IOACTION_COMPARATOR).collect(Collectors.toList())) + { + EndpointState succ = s.accept(a); + for (IOAction b : succ.getAcceptable().stream().sorted(IOStateInterfaceGenerator.IOACTION_COMPARATOR).collect(Collectors.toList())) + { + foo1.add(b); + bar1.add(succ); + } + } + System.out.println("BBB: " + handle);*/ + //for (IOAction a : this.branchSuccs.get(handle)) + // FIXME: move back into HandlerInterfaceGenerator + for (EAction a : s.getDetActions().stream().sorted(IOStateIfaceGen.IOACTION_COMPARATOR).collect(Collectors.toList())) + { + if (first) + { + first = false; + } + else + { + tmp += ", "; + } + /*if (foo1.contains(a)) + { + EndpointState succ = bar1.get(foo1.indexOf(a)); + tmp += this.getSuccName.apply(succ.accept(a)); + foo1.remove(a); + bar1.remove(succ); + } + else + { + tmp += SuccessorInterfaceGenerator.getSuccessorInterfaceName(a); + }*/ + EState succ = s.getDetSuccessor(a); + if (succ.isTerminal()) + { + tmp += ScribSockGen.GENERATED_ENDSOCKET_NAME; + } + else + { + tmp += this.apigen.getSocketClassName(succ); + } + } + + handler.addInterfaces(handle + "<" + tmp + ">"); + + /*// Override abstract handle methods with default cast implementation + for (IOAction a : s.getAcceptable().stream().sorted(IOStateInterfaceGenerator.IOACTION_COMPARATOR).collect(Collectors.toList())) + { + EndpointState succ = s.accept(a); + this.iostates.get(HandleInterfaceGenerator.getHandleInterfaceName(self, succ)); + MethodBuilder override = handler.newDefaultMethod(); + //override.addModifiers(JavaBuilder.FINAL); // Default methods cannot be final + HandlerInterfaceGenerator.setHandleMethodHeaderWithoutParamTypes(this.apigen, override); + //HandleInterfaceGenerator.setHandleMethodSuccessorParam(this, self, succ, override); + // FIXME: factor out with HandleInterfaceGenerator.setHandleMethodSuccessorParam + String nextClass = this.apigen.getSocketClassName(succ); + if (succ.isTerminal()) + { + override.addParameters(ScribSocketGenerator.ENDSOCKET_CLASS + " end"); + } + else + { + InterfaceBuilder next = getIOStateInterface(IOStateInterfaceGenerator.getIOStateInterfaceName(self, succ)); // Select/Receive/Branch + String ret = next.getName() + "<"; + //ret += "<" + next.getParameters().stream().map((p) -> "__Succ" + i).collect(Collectors.joining(", ")) + ">"; // FIXME: fragile? + boolean bar = true; + for (IOAction b : succ.getAcceptable().stream().sorted(IOStateInterfaceGenerator.IOACTION_COMPARATOR).collect(Collectors.toList())) // FIXME: factor out with getHandleInterfaceIOActionParams + { + if (bar) + { + bar = false; + } + else + { + ret += ", "; + } + EndpointState foo = succ.accept(b); + if (foo.isTerminal()) + { + ret += ScribSocketGenerator.GENERATED_ENDSOCKET_NAME; + } + else + { + ret += this.apigen.getSocketClassName(foo); + } + } + ret += ">"; + override.addParameters(ret + " schan"); + } + HandlerInterfaceGenerator.addHandleMethodOpAndPayloadParams(this.apigen, a, override); + // FIXME: factor out + String ln = "receive(("; + if (succ.isTerminal()) // factor out + { + ln += "EndSocket) end"; + } + else + { + ln += nextClass + ") schan"; + } + ln += ", op"; + String args; + if (a.mid.isOp()) // factor out + { + args = IntStream.rangeClosed(1, a.payload.elems.size()).mapToObj((i) -> "arg" + i).collect(Collectors.joining(", ")); + if (!args.equals("")) + { + args = ", " + args; + } + } + else + { + args = ", arg"; + } + ln += args + ");"; + override.addBodyLine(ln); + override.addAnnotations("@Override"); + }*/ + } + + visited.add(s); + for (EAction a : s.getDetActions()) + { + addIOStateInterfacesToStateChannels(visited, s.getDetSuccessor(a)); + } + } + + private void addSupertypeInterfaces() + { + Map subtypeifs = new HashMap<>(); + for (InterfaceBuilder ib : this.iostates.values()) + { + String name = ib.getName(); + if (!subtypeifs.containsKey(name)) + { + if (name.startsWith("Select") || name.startsWith("Handle")) + { + subtypeifs.put(name, ib); + + Map res = new HashMap<>(); + if (name.startsWith("Select")) + { + List ifs = ib.getInterfaces(); // Could also use params to integrate with Handle + List outs = ifs.stream().filter((i) -> i.startsWith("Out")) + .map((o) -> (o = o.substring(0, o.indexOf("<"))).substring(o.indexOf("_") + 1, o.length())) + .sorted((s1, s2) -> s1.compareTo(s2)) + .collect(Collectors.toList()); + buildIOStateSuperInterfaces(res, outs, "Select", "Out", "Out"); + } + else //if (base.startsWith("Handle")) + { + List params = ib.getParameters(); + List ins = params.stream().map((i) -> i.substring(i.indexOf("Succ_In_") + "Succ_In_".length())) + .sorted((s1, s2) -> s1.compareTo(s2)) + .collect(Collectors.toList()); + //buildSuperHandleInterfaces(res, ins); + buildIOStateSuperInterfaces(res, ins, "Handle", "Callback", "In"); + //buildIOStateSuperInterfaces(res, ins, "Branch", "", "In"); // No: subtyping for branch interfaces unsafe -- that's the point of handle interfaces + /*Map tmp = new HashMap<>(); + buildIOStateSuperInterfaces(tmp, ins, "Branch", "", "In"); + for (InterfaceBuilder bra : tmp.values()) + { + addBranchSupertypeInterfaceMethods(ib, bra, ins, getSelf()); + } + res.putAll(tmp);*/ + } + res.values().forEach(r -> subtypeifs.put(r.getName(), r)); + } + } + } + subtypeifs.values().forEach((r) -> this.iostates.put(r.getName(), r)); + + for (InterfaceBuilder ib : this.iostates.values()) + { + String name = ib.getName(); + if (name.startsWith("Select")) + { + List ifs = ib.getInterfaces(); + List outs = ifs.stream().filter((i) -> i.startsWith("Out")) + .map((o) -> (o = o.substring(0, o.indexOf("<"))).substring(o.indexOf("_") + 1, o.length())) + .sorted((s1, s2) -> s1.compareTo(s2)) + .collect(Collectors.toList()); + addIOStateSuperInterfaces(ib, outs, "Select", "Out"); + } + else if (name.startsWith("Handle")) + { + List params = ib.getParameters(); + List ins = params.stream().map((i) -> i.substring(i.indexOf("Succ_In_") + "Succ_In_".length())) + .sorted((s1, s2) -> s1.compareTo(s2)) + .collect(Collectors.toList()); + addIOStateSuperInterfaces(ib, ins, "Handle", "In"); + } + /*else if (name.startsWith("Branch")) // No: subtyping for branch interfaces unsafe -- that's the point of handle interfaces + { + List params = ib.getParameters(); + List ins = params.stream().map((i) -> i.substring(i.indexOf("Succ_In_") + "Succ_In_".length())) + .sorted((s1, s2) -> s1.compareTo(s2)) + .collect(Collectors.toList()); + addIOStateSuperInterfaces(ib, ins, "Branch", "In"); + }*/ + } + + /*// Generate Succ I/f supertype "to" cast methods -- moved earlier, to be supported by to-overriding pass (i.e. when a direct I/O State I/f inherits duplicate to's from Succs) + Role self = getSelf(); + for (EndpointState s : this.preds.keySet()) + { + if (s.isTerminal()) + { + continue; + } + String name = IOStateInterfaceGenerator.getIOStateInterfaceName(self, s); + if (name.startsWith("Select")) + { + + System.out.println("AAA: " + name); + + List ifs = this.iostates.get(name).getInterfaces(); + List outs = ifs.stream().filter((i) -> i.startsWith("Out")) + .map((o) -> (o = o.substring(0, o.indexOf("<"))).substring(o.indexOf("_") + 1, o.length())) + .sorted((s1, s2) -> s1.compareTo(s2)) + .collect(Collectors.toList()); + addSupertypeInterfaceToMethods(s, outs, "Select", "Out"); + } + /*else if (name.startsWith("Branch")) + { + List params = this.iostates.get(name).getParameters(); + List ins = params.stream().map((i) -> i.substring(i.indexOf("Succ_In_") + "Succ_In_".length())) + .sorted((s1, s2) -> s1.compareTo(s2)) + .collect(Collectors.toList()); + addSupertypeInterfaceToMethods(s, ins, "Branch", "In"); + }* / + }*/ + } + + // a = e.g. C_1_Int + // Pre: as sorted + private void buildIOStateSuperInterfaces(Map res, List as, String superPref, String actPref, String succPref) + { + for (String exclude : as) + { + List foo = as.stream().filter((s) -> !s.equals(exclude)).collect(Collectors.toList()); + if (foo.size() > 0) + { + String tmp = foo.stream().collect(Collectors.joining("__")); + String superName = superPref + "_" + getSelf() + "_" + tmp; + + if (!this.iostates.containsKey(superName) && !res.containsKey(superName)) + { + InterfaceBuilder ib = new InterfaceBuilder(superName); + ib.setPackage(getIOInterfacePackageName(this.gpn, getSelf())); + ib.addModifiers(JavaBuilder.PUBLIC); + int i = 1; + for (String a : foo) + { + ib.addParameters("__Succ" + i + " extends " + "Succ_" + succPref + "_" + a); + if (!superPref.equals("Branch")) // Hacky + { + ib.addInterfaces(actPref + "_" + a + "<__Succ" + i + ">"); + } + i++; + } + FieldBuilder cast = ib.newField("cast"); // FIXME: factor out + cast.addModifiers(JavaBuilder.PUBLIC, JavaBuilder.STATIC, JavaBuilder.FINAL); + cast.setType(superName + "<" + IntStream.range(0, foo.size()).mapToObj((x) -> "?").collect(Collectors.joining(", ")) + ">"); + cast.setExpression("null"); + res.put(superName, ib); + buildIOStateSuperInterfaces(res, foo, superPref, actPref, succPref); + } + } + } + } + + /*//private void addBranchSupertypeInterfaceMethods(EndpointState s, InterfaceBuilder ib, Role self) + private void addBranchSupertypeInterfaceMethods(InterfaceBuilder root, InterfaceBuilder ib, List foo, Role self) + { + //Duplicated from BranchInterfaceGenerator + /*AbstractMethodBuilder bra = ib.newAbstractMethod("branch"); + String ret = CaseInterfaceGenerator.getCasesInterfaceName(self, s) + + "<" + IntStream.range(1, as.size()+1).mapToObj((x) -> "__Succ" + x).collect(Collectors.joining(", ")) + ">"; // FIXME: factor out + bra.setReturn(ret); + bra.addParameters(SessionApiGenerator.getRoleClassName(as.iterator().next().peer) + " role"); + bra.addExceptions(StateChannelApiGenerator.SCRIBBLERUNTIMEEXCEPTION_CLASS, "java.io.IOException", "ClassNotFoundException");* / + + List params = ib.getParameters(); + List ins = params.stream().map((i) -> i.substring(i.indexOf("Succ_In_") + "Succ_In_".length())) + .sorted((s1, s2) -> s1.compareTo(s2)) + .collect(Collectors.toList()); + + String handleName = "Handle" + ib.getName().substring("Branch".length(), ib.getName().length()); + System.out.println("AAA: " + ib.getName() + ", " + handleName); + //String peer = ib.getName().substring(ib.getName().indexOf("_") + 1, ib.getName().indexOf("_", ib.getName().indexOf("_") + 1)); + String peer = ins.get(0).substring(0, ins.get(0).indexOf("_")); + + AbstractMethodBuilder bra2 = ib.newAbstractMethod("branch"); + bra2.setReturn(JavaBuilder.VOID); + bra2.addParameters(peer + " role"); + String next = handleName + "<" + IntStream.range(1, ins.size() + 1).mapToObj((i) -> "__Succ" + i).collect(Collectors.joining(", ")) + ">"; + bra2.addParameters(next + " handler"); + bra2.addExceptions(StateChannelApiGenerator.SCRIBBLERUNTIMEEXCEPTION_CLASS, "java.io.IOException", "ClassNotFoundException"); + //bra2.addBodyLine("branch(role, (" + root.getName() + ") handler);"); + + AbstractMethodBuilder bra3 = ib.newAbstractMethod("handle"); + bra3.setReturn(JavaBuilder.VOID); + bra3.addParameters(peer + " role"); + String handle = handleName + "<" + ins.stream().map((in) -> "Succ_In_" + in).collect(Collectors.joining(", ")) + ">"; + bra3.addParameters(handle + " handler"); + bra3.addExceptions(StateChannelApiGenerator.SCRIBBLERUNTIMEEXCEPTION_CLASS, "java.io.IOException", "ClassNotFoundException"); + //bra3.addBodyLine("branch(role, (" + root.getName() + ") handler);"); + + ib.addImports(SessionApiGenerator.getRolesPackageName(this.gpn) + ".*"); + // No: generating "super" branch/handle methods for supertypes is not safe + }*/ + + // a = e.g. C_1_Int + // Pre: as sorted + private void addIOStateSuperInterfaces(InterfaceBuilder ib, List as, String superPref, String succPref) + { + for (String exclude : as) + { + List foo = as.stream().filter((s) -> !s.equals(exclude)).collect(Collectors.toList()); + if (foo.size() > 0) + { + List params = new LinkedList<>(); + for (String a : foo) + { + int i = 1; + for (String param : ib.getParameters()) + { + if (param.endsWith("Succ_" + succPref + "_" + a)) + { + break; + } + i++; + } + params.add("__Succ" + i); + } + + String tmp = foo.stream().collect(Collectors.joining("__")); + String select = superPref + "_" + getSelf() + "_" + tmp + "<" + params.stream().collect(Collectors.joining(", ")) + ">"; + ib.addInterfaces(select); + } + } + } + + // Pre: s has "preds", i.e. s implements a Successor I/f + private void addSupertypeInterfaceToMethods(EState s, List as, String superPref, String succPref) + { + for (String exclude : as) + { + List foo = as.stream().filter((x) -> !x.equals(exclude)).collect(Collectors.toList()); + if (foo.size() > 0) + { + String tmp = foo.stream().collect(Collectors.joining("__")); + String superName = superPref + "_" + getSelf() + "_" + tmp; + for (InterfaceBuilder succif : this.preds.get(s)) + { + addToCastMethod(succif, superName + "<" + IntStream.range(0, foo.size()).mapToObj((f) -> "?").collect(Collectors.joining(", ")) +">"); + } + + if (!this.iostates.containsKey(superName)) + { + addSupertypeInterfaceToMethods(s, foo, superPref, succPref); + } + } + } + } + + // Pre: ib is a Successor I/f for the cast IO State I/f + // Returns MethodBuilder, or null if none built + private static MethodBuilder addToCastMethod(InterfaceBuilder ib, String ret) + { + if (ib.getDefaultMethods().stream().filter((def) -> def.getReturn().equals(ret)).count() > 0) + { + // Merge states entered from multiple paths, don't want to add cast multiple times -- still true for this case? + // But duplicate cast check cast still needed anyway? + return null; + } + MethodBuilder mb = ib.newDefaultMethod("to"); + mb.setReturn(ret); + mb.addParameters(ret + " cast"); + if (!ret.equals("EndSocket") || ib.getName().startsWith("Succ")) // HACK + { + mb.addBodyLine(JavaBuilder.RETURN + " (" + ret + ") this;"); + } + else + { + ib.addImports("org.scribble.util.RuntimeScribException"); + mb.addBodyLine("throw new RuntimeScribException(\"Invalid cast to EndSocket: \" + cast);"); + } + return mb; + } + + private static MethodBuilder addEndSocketToCastMethod(ClassBuilder cb, String ret, String body) + { + //if (ib.getMethods().stream().filter((def) -> def.getReturn().equals(ret)).count() > 0) + if (cb.hasMethodSignature(ret, ret + " ")) // Hacky + { + // Merge states entered from multiple paths, don't want to add cast multiple times -- still true for this case? + // But duplicate cast check cast still needed anyway? + return null; + } + MethodBuilder mb = cb.newMethod("to"); + mb.setReturn(ret); + mb.addParameters(ret + " cast"); + //mb.addBodyLine("throw new RuntimeScribbleException(\"Invalid cast of EndSocket: \" + cast);"); + mb.addBodyLine(body); + return mb; + } + + private final + Function getSuccName = (succ) -> + (succ.isTerminal()) + ? ScribSockGen.GENERATED_ENDSOCKET_NAME + : this.apigen.getSocketClassName(succ); + + private String getConcreteSuccessorParameters(EState s) + { + return "<" + + s.getDetActions().stream().sorted(IOStateIfaceGen.IOACTION_COMPARATOR) + .map((a) -> this.getSuccName.apply(s.getDetSuccessor(a))).collect(Collectors.joining(", ")) + + ">"; + } + + private void putPreAction(EState s, EAction a) + { + putMapSet(this.preActions, s, a); + } + + private void putBranchPostAction(EState s, EAction a) + { + putMapSet(this.branchPostActions, s, a); + } + + private static void putMapSet(Map> map, K k, V v) + { + Set tmp = map.get(k); + if (tmp == null) + { + tmp = new LinkedHashSet<>(); + map.put(k, tmp); + } + tmp.add(v); + } + + // Successor I/f's to be implemented by each I/O State I/f + private void collectPreds() + { + for (EState s : this.preActions.keySet()) + { + Set tmp = new HashSet<>(); + for (EAction a : this.preActions.get(s)) // sort? + { + if (!a.isSend() && !a.isReceive()) // TODO (connect/disconnect) + { + throw new RuntimeException("TODO: " + a); + } + tmp.add(this.succs.get(a)); + } + this.preds.put(s, tmp); + } + } + + private void collectBranchSuccs() + { + Role self = getSelf(); + for (EState s : this.branchPostActions.keySet()) + { + //String key = HandlerInterfaceGenerator.getHandlerInterfaceName(IOStateInterfaceGenerator.getIOStateInterfaceName(self, s)); + String key = HandleIfaceGen.getHandleInterfaceName(self, s); // HandleInterface name + + List curr1 = new LinkedList<>(); + this.branchPostActions.get(s).forEach((a) -> curr1.addAll(s.getDetSuccessor(a).getDetActions())); // TODO: flatmap + //List curr2 = curr1.stream().sorted(IOStateInterfaceGenerator.IOACTION_COMPARATOR).collect(Collectors.toList()); + + List tmp = this.branchSuccs.get(key); + if (tmp == null) + { + tmp = new LinkedList<>(); + //this.branchSuccs.put(key, tmp); + tmp.addAll(curr1); + } + else + { + for (EAction a : curr1) + { + long n = curr1.stream().filter((x) -> x.equals(a)).count(); + long m = tmp.stream().filter((x) -> x.equals(a)).count(); + //System.out.println("EEE: " + curr1 + ",,, " + tmp); + if (n > m) + { + for (int i = 0; i < n-m; i++) + { + tmp.add(a); + } + } + } + } + + this.branchSuccs.put(key, tmp.stream().sorted(IOStateIfaceGen.IOACTION_COMPARATOR).collect(Collectors.toList())); + //System.out.println("AAA: " + this.branchSuccs.get(key)); + + /*List tmp = this.branchSuccs.get(key); + if (tmp == null) + { + tmp = new LinkedList<>(); + this.branchSuccs.put(key, tmp); + } + //this.branchPostActions.get(s).stream()//.sorted(IOStateInterfaceGenerator.IOACTION_COMPARATOR) + //.forEach((a) -> { tmp.add(this.succs.get(a)); }); + for (IOAction a : this.branchPostActions.get(s)) // Already sorted -- guaranteed pairwise distinct (branch actions) //.sorted(IOStateInterfaceGenerator.IOACTION_COMPARATOR) + { + // Not necessarily distinct (actions of the branch successor state) + for (IOAction b : s.accept(a).getAcceptable().stream().sorted(IOStateInterfaceGenerator.IOACTION_COMPARATOR).collect(Collectors.toList())) + { + //tmp.add(this.succs.get(b)); + tmp.add(b); + } + } + tmp = tmp.stream().so*/ + } + } + + protected Role getSelf() + { + return this.apigen.getSelf(); + } + + protected static String getIOInterfacePackageName(GProtoName gpn, Role self) + { + return SessionApiGenerator.getStateChannelPackageName(gpn, self) + ".ioifaces"; + } + + protected InterfaceBuilder getIOStateInterface(String name) + { + return this.iostates.get(name); + } +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/ioifaces/IOStateIfaceGen.java b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/ioifaces/IOStateIfaceGen.java new file mode 100644 index 000000000..5f48b4e65 --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/ioifaces/IOStateIfaceGen.java @@ -0,0 +1,154 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.java.statechanapi.ioifaces; + +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import java.util.stream.IntStream; + +import org.scribble.codegen.java.sessionapi.SessionApiGenerator; +import org.scribble.codegen.java.statechanapi.StateChannelApiGenerator; +import org.scribble.codegen.java.util.FieldBuilder; +import org.scribble.codegen.java.util.InterfaceBuilder; +import org.scribble.codegen.java.util.JavaBuilder; +import org.scribble.codegen.java.util.TypeBuilder; +import org.scribble.core.model.endpoint.EState; +import org.scribble.core.model.endpoint.actions.EAction; +import org.scribble.core.type.name.GProtoName; +import org.scribble.core.type.name.Role; +import org.scribble.util.RuntimeScribException; +import org.scribble.util.ScribException; + +// Cf. ScribSocketGenerator +// Partial I/O State I/f generator -- Successor Interfaces and cast methods added later +public abstract class IOStateIfaceGen extends IOIfaceGen +{ + public static final Comparator IOACTION_COMPARATOR = new Comparator() + { + @Override + public int compare(EAction a1, EAction a2) + { + return ActionIfaceGen.getActionInterfaceName(a1).compareTo(ActionIfaceGen.getActionInterfaceName(a2)); + } + }; + + protected final Map actions; + + protected final InterfaceBuilder ib = new InterfaceBuilder(); + + // Preds can be null + public IOStateIfaceGen(StateChannelApiGenerator apigen, Map actions, EState curr) + { + super(apigen, curr); + this.actions = Collections.unmodifiableMap(actions); + } + + @Override + public InterfaceBuilder generateType() throws ScribException + { + constructInterface(); + return this.ib; + } + + protected void constructInterface() throws ScribException + { + addHeader(); + addSuccessorParamsAndActionInterfaces(); + //addSuccessorInterfaces(); // Do later (different states may share the same IO State I/f, don't know all successors for this I/f yet (only this state) + addCastField(); + } + + protected void addHeader() + { + GProtoName gpn = this.apigen.getGProtocolName(); + Role self = this.apigen.getSelf(); + String packname = IOInterfacesGenerator.getIOInterfacePackageName(gpn, self); + String ifname = getIOStateInterfaceName(self, this.curr); + + this.ib.setName(ifname); + this.ib.setPackage(packname); + this.ib.addImports(SessionApiGenerator.getRolesPackageName(gpn) + ".*"); + this.ib.addModifiers(JavaBuilder.PUBLIC); + } + + protected void addCastField() + { + String ifname = getIOStateInterfaceName(this.apigen.getSelf(), this.curr); + //Set as = this.curr.getActions(); + List as = this.curr.getDetActions(); + + FieldBuilder cast = this.ib.newField("cast"); + cast.addModifiers(TypeBuilder.PUBLIC, TypeBuilder.STATIC, TypeBuilder.FINAL); + cast.setType(ifname + "<" + IntStream.range(1, as.size()+1).mapToObj((i) -> "?").collect(Collectors.joining(", ")) + ">"); // FIXME: factor out + cast.setExpression("null"); + } + + protected void addSuccessorParamsAndActionInterfaces() + { + int i = 1; + for (EAction a : this.curr.getDetActions().stream().sorted(IOACTION_COMPARATOR).collect(Collectors.toList())) + { + if (a.isSend() || a.isReceive()) // HACK FIXME + { + String actif = this.actions.get(a).getName(); + this.ib.addParameters("__Succ" + i + " extends " + SuccessorIfaceGen.getSuccessorInterfaceName(a)); + this.ib.addInterfaces(actif + "<__Succ" + i + ">"); + i++; + } + } + } + + /*protected void addSuccessorInterfaces() + { + if (this.preds != null) + { + System.out.println("AA: " + this.ib.getName() + ", " + this.preds.stream().map((p) -> p.getName()).collect(Collectors.toList())); + + for (InterfaceBuilder pred : this.preds) + { + this.ib.addInterfaces(pred.getName()); // Adds Successor Interfaces to this I/O State Interface + } + } + }*/ + + // Pre: s non-terminal + public static String getIOStateInterfaceName(Role self, EState s) + { + String name = null; + switch (s.getStateKind()) + { + case OUTPUT: name = "Select"; break; + case UNARY_RECEIVE: name = "Receive"; break; + case POLY_RECIEVE: name = "Branch"; break; + case TERMINAL: throw new RuntimeScribException("Shouldn't get in here: " + s); + default: throw new RuntimeException("(TODO) I/O interface generation: " + s.getStateKind()); + } + name = name + "_" + self + "_" + s.getDetActions().stream().sorted(IOACTION_COMPARATOR) + .map((a) -> ActionIfaceGen.getActionString(a)).collect(Collectors.joining("__")); + checkIOStateInterfaceNameLength(name); + return name; + } + + // 255 is Linux, Windows, etc max file name length (Java is 65535) + public static void checkIOStateInterfaceNameLength(String name) throws RuntimeScribException + { + if (name.length() > 250) // .java + { + throw new RuntimeScribException("I/O Interface name too long (max 255): " + name); + } + } +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/ioifaces/ReceiveIfaceGen.java b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/ioifaces/ReceiveIfaceGen.java new file mode 100644 index 000000000..c08d16f67 --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/ioifaces/ReceiveIfaceGen.java @@ -0,0 +1,73 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.java.statechanapi.ioifaces; + +import java.util.Map; + +import org.scribble.codegen.java.sessionapi.SessionApiGenerator; +import org.scribble.codegen.java.statechanapi.InputFutureGen; +import org.scribble.codegen.java.statechanapi.ReceiveSockGen; +import org.scribble.codegen.java.statechanapi.ScribSockGen; +import org.scribble.codegen.java.statechanapi.StateChannelApiGenerator; +import org.scribble.codegen.java.util.InterfaceBuilder; +import org.scribble.codegen.java.util.MethodBuilder; +import org.scribble.core.model.endpoint.EState; +import org.scribble.core.model.endpoint.actions.EAction; +import org.scribble.core.type.name.GProtoName; +import org.scribble.util.ScribException; + +public class ReceiveIfaceGen extends IOStateIfaceGen +{ + public ReceiveIfaceGen(StateChannelApiGenerator apigen, Map actions, EState curr) + { + super(apigen, actions, curr); + } + + @Override + public InterfaceBuilder generateType() throws ScribException + { + if (this.curr.getActions().stream().anyMatch((a) -> !a.isReceive())) // TODO (connect/disconnect) + { + //return null; + throw new RuntimeException("TODO: " + this.curr); + } + return super.generateType(); + } + + @Override + protected void constructInterface() throws ScribException + { + super.constructInterface(); + addAsyncDiscardMethod(); + } + + protected void addAsyncDiscardMethod() + { + GProtoName gpn = this.apigen.getGProtocolName(); + EAction first = this.curr.getDetActions().iterator().next(); + + MethodBuilder mb = this.ib.newAbstractMethod(); + ReceiveSockGen.setAsyncDiscardHeaderWithoutReturnType(this.apigen, first, mb, InputFutureGen.getInputFutureName(this.apigen.getSocketClassName(this.curr))); + this.ib.addImports(SessionApiGenerator.getOpsPackageName(gpn) + ".*"); + EState succ = this.curr.getDetSuccessor(first); + if (succ.isTerminal()) + { + ScribSockGen.setNextSocketReturnType(this.apigen, mb, succ); + } + else + { + mb.setReturn("__Succ1"); // Hacky? // FIXME: factor out Succ + } + } +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/ioifaces/SelectIfaceGen.java b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/ioifaces/SelectIfaceGen.java new file mode 100644 index 000000000..28f9ff2ae --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/ioifaces/SelectIfaceGen.java @@ -0,0 +1,41 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.java.statechanapi.ioifaces; + +import java.util.Map; + +import org.scribble.codegen.java.statechanapi.StateChannelApiGenerator; +import org.scribble.codegen.java.util.InterfaceBuilder; +import org.scribble.core.model.endpoint.EState; +import org.scribble.core.model.endpoint.actions.EAction; +import org.scribble.util.ScribException; + +public class SelectIfaceGen extends IOStateIfaceGen +{ + public SelectIfaceGen(StateChannelApiGenerator apigen, Map actions, EState curr) + { + super(apigen, actions, curr); + } + + @Override + public InterfaceBuilder generateType() throws ScribException + { + if (this.curr.getActions().stream().anyMatch((a) -> !a.isSend())) // TODO (connect/disconnect) + { + //return null; + throw new RuntimeException("TODO: " + this.curr); + } + return super.generateType(); + } +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/ioifaces/SuccessorIfaceGen.java b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/ioifaces/SuccessorIfaceGen.java new file mode 100644 index 000000000..fd448bfa3 --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/java/statechanapi/ioifaces/SuccessorIfaceGen.java @@ -0,0 +1,47 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.java.statechanapi.ioifaces; + +import org.scribble.codegen.java.statechanapi.StateChannelApiGenerator; +import org.scribble.codegen.java.util.InterfaceBuilder; +import org.scribble.codegen.java.util.JavaBuilder; +import org.scribble.core.model.endpoint.EState; +import org.scribble.core.model.endpoint.actions.EAction; + +public class SuccessorIfaceGen extends IOIfaceGen +{ + private final EAction a; + private final InterfaceBuilder ib = new InterfaceBuilder(); + + public SuccessorIfaceGen(StateChannelApiGenerator apigen, EState curr, EAction a) + { + super(apigen, curr); + this.a = a; + } + + @Override + public InterfaceBuilder generateType() + { + this.ib.setName(getSuccessorInterfaceName(this.a)); + this.ib.setPackage(IOInterfacesGenerator.getIOInterfacePackageName(this.apigen.getGProtocolName(), this.apigen.getSelf())); + this.ib.addModifiers(JavaBuilder.PUBLIC); + //this.ib.addInterfaces(ifaces);(...State...); + return ib; + } + + public static String getSuccessorInterfaceName(EAction a) + { + return "Succ_" + ActionIfaceGen.getActionInterfaceName(a); + } +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/java/util/AbstractMethodBuilder.java b/scribble-codegen/src/main/java/org/scribble/codegen/java/util/AbstractMethodBuilder.java new file mode 100644 index 000000000..3d7784615 --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/java/util/AbstractMethodBuilder.java @@ -0,0 +1,34 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.java.util; + +public class AbstractMethodBuilder extends MethodBuilder +{ + protected AbstractMethodBuilder() + { + addModifiers(JavaBuilder.ABSTRACT); // Redundant for interfaces, but OK + } + + @Override + public void addBodyLine(String ln) + { + throw new RuntimeException("Invalid for abstract method: " + ln); + } + + @Override + protected String buildBody(String meth) + { + return meth + ";"; + } +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/java/util/ClassBuilder.java b/scribble-codegen/src/main/java/org/scribble/codegen/java/util/ClassBuilder.java new file mode 100644 index 000000000..22a8193c7 --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/java/util/ClassBuilder.java @@ -0,0 +1,173 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.java.util; + +import java.util.Arrays; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.stream.Collectors; + +public class ClassBuilder extends TypeBuilder +{ + protected String superclass; // null if none explicit + + protected final List ctors = new LinkedList<>(); + + // No name par because so far useful to start constructing before setting the name + public ClassBuilder() + { + + } + + public ClassBuilder(String name) + { + super(name); + } + + public void setSuperClass(String superc) + { + setterCheck(this.superclass); + this.superclass = superc; + } + + // Each par is the String: type + " " + name -- cf. MethodBuilder + public ConstructorBuilder newConstructor(String... pars) // FIXME: ConstructorBuilder + { + ConstructorBuilder mb = new ConstructorBuilder(this.name); + mb.addParameters(pars); + this.ctors.add(mb); + return mb; + } + + public MethodBuilder newMethod() + { + MethodBuilder mb = new MethodBuilder(); + this.methods.add(mb); + return mb; + } + + public final MethodBuilder newMethod(String name) + { + MethodBuilder mb = newMethod(); + mb.setName(name); + return mb; + } + + public final boolean hasMethodSignature(String ret, String... params) + { + for (MethodBuilder mb : this.methods) + { + if (mb.getReturn().equals(ret) && equalParamSigs(Arrays.asList(params), mb.getParameters())) + { + return true; + } + } + return false; + } + + // FIXME: factor out with TypeBuilder + //private static boolean equalParamSigs(MethodBuilder mb1, MethodBuilder mb2) + private static boolean equalParamSigs(List mb1, List mb2) + { + if (mb1.size() == 0) + { + if (mb2.size() != 0) + { + return false; + } + } + else + { + Iterator params2 = mb2.iterator(); + for (String param1 : mb1) + { + if (!params2.hasNext()) + { + return false; + } + String param2 = params2.next(); + + if (param2.contains("<")) + { + param2 = param2.substring(0, param2.indexOf("<")); + } + else + { + param2 = param2.substring(0, param2.indexOf(" ")); + } + if (param1.contains("<")) + { + param1 = param1.substring(0, param1.indexOf("<")); + } + else + { + param1 = param1.substring(0, param1.indexOf(" ")); + } + if (!param1.equals(param2)) + { + return false; + } + } + } + return true; + } + + @Override + protected String buildSignature(String clazz) + { + if (!this.mods.isEmpty()) + { + clazz += this.mods.stream().collect(Collectors.joining(" ")); + clazz += " "; + } + clazz += "class " + this.name; + if (!this.params.isEmpty()) + { + clazz += "<" + this.params.stream().collect(Collectors.joining(", ")) + ">"; + } + if (this.superclass != null) + { + clazz += " extends " + this.superclass; + } + if (!this.ifaces.isEmpty()) + { + clazz += " implements "; + clazz += this.ifaces.stream().collect(Collectors.joining(", ")); + } + return clazz; + } + + @Override + public String buildBody(String clazz) + { + clazz += " {"; + clazz = buildFields(clazz); + clazz = buildConstructors(clazz); + clazz = buildMethods(clazz); + clazz = buildMemberTypes(clazz); + clazz += "\n}"; + return clazz; + } + + protected String buildConstructors(String clazz) + { + if (!this.ctors.isEmpty()) + { + clazz += "\n\n"; + clazz += this.ctors.stream().map((mb) -> mb.build()).collect(Collectors.joining("\n\n")); + } + return clazz; + } +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/java/util/ConstructorBuilder.java b/scribble-codegen/src/main/java/org/scribble/codegen/java/util/ConstructorBuilder.java new file mode 100644 index 000000000..19f5bc382 --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/java/util/ConstructorBuilder.java @@ -0,0 +1,36 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.java.util; + +import org.scribble.util.RuntimeScribException; + +public class ConstructorBuilder extends MethodBuilder +{ + protected ConstructorBuilder(String name) + { + super(name); + } + + @Override + public void setName(String name) + { + throw new RuntimeScribException("Invalid for constructor"); + } + + @Override + public void setReturn(String ret) + { + throw new RuntimeScribException("Invalid for constructor"); + } +} \ No newline at end of file diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/java/util/EnumBuilder.java b/scribble-codegen/src/main/java/org/scribble/codegen/java/util/EnumBuilder.java new file mode 100644 index 000000000..600237d1d --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/java/util/EnumBuilder.java @@ -0,0 +1,119 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.java.util; + +import java.util.Arrays; +import java.util.LinkedList; +import java.util.List; +import java.util.stream.Collectors; + +import org.scribble.util.RuntimeScribException; + +public class EnumBuilder extends TypeBuilder +{ + private final List vals = new LinkedList(); + + protected EnumBuilder() + { + + } + + protected EnumBuilder(String name) + { + super(name); + } + + public void addValues(String... vals) + { + this.vals.addAll(Arrays.asList(vals)); + } + + @Override + public String build() + { + String enun = ""; + enun = buildSignature(enun); + enun += " {\n"; + enun += "\t" + this.vals.stream().collect(Collectors.joining(", ")); + enun += "\n}"; + return enun; + } + + @Override + protected String buildSignature(String enun) + { + if (!this.mods.isEmpty()) + { + enun += this.mods.stream().collect(Collectors.joining(" ")); + enun += " "; + } + enun += "enum " + this.name; + if (!this.ifaces.isEmpty()) + { + enun += " implements "; + enun += this.ifaces.stream().collect(Collectors.joining(", ")); + } + return enun; + } + + // Following not necessarily invalid for Java, just for this tool set + + @Override + public void setPackage(String packname) + { + throw new RuntimeScribException("Invalid for enums"); + } + + @Override + public void addImports(String... imports) + { + throw new RuntimeScribException("Invalid for enums"); + } + + @Override + public FieldBuilder newField(String name) + { + throw new RuntimeScribException("Invalid for enums"); + } + + @Override + public AbstractMethodBuilder newAbstractMethod() + { + throw new RuntimeScribException("Invalid for enums"); + } + + @Override + public ClassBuilder newTopLevelClass() + { + throw new RuntimeScribException("Invalid for enums"); + } + + @Override + protected String buildFields(String clazz) + { + throw new RuntimeScribException("Invalid for enums"); + } + + @Override + protected String buildMethods(String clazz) + { + throw new RuntimeScribException("Invalid for enums"); + } + + @Override + protected String buildMemberTypes(String clazz) + { + throw new RuntimeScribException("Invalid for enums"); + } +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/java/util/FieldBuilder.java b/scribble-codegen/src/main/java/org/scribble/codegen/java/util/FieldBuilder.java new file mode 100644 index 000000000..720f5dfbf --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/java/util/FieldBuilder.java @@ -0,0 +1,72 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.java.util; + +import java.util.Arrays; +import java.util.LinkedList; +import java.util.List; +import java.util.stream.Collectors; + +public class FieldBuilder extends JavaBuilder +{ + private List mods = new LinkedList<>(); + private String type; + private String expr; // null if none + + public FieldBuilder() + { + + } + + public FieldBuilder(String name) + { + super(name); + } + + public void addModifiers(String... mods) + { + this.mods.addAll(Arrays.asList(mods)); + } + + public void setType(String type) + { + setterCheck(this.type); + this.type = type; + } + + public void setExpression(String val) + { + setterCheck(this.expr); + this.expr = val; + } + + @Override + public String build() + { + String field = ""; + field += "\t"; + if (!this.mods.isEmpty()) + { + field += this.mods.stream().collect(Collectors.joining(" ")); + field += " "; + } + field += this.type + " " + this.name; + if (this.expr != null) + { + field += " = " + this.expr; + } + field += ";"; + return field; + } +} \ No newline at end of file diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/java/util/InterfaceBuilder.java b/scribble-codegen/src/main/java/org/scribble/codegen/java/util/InterfaceBuilder.java new file mode 100644 index 000000000..80b3d7e1e --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/java/util/InterfaceBuilder.java @@ -0,0 +1,86 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.java.util; + +import java.util.LinkedList; +import java.util.List; +import java.util.stream.Collectors; + +public class InterfaceBuilder extends TypeBuilder +{ + private List defaults = new LinkedList<>(); + + public InterfaceBuilder() + { + + } + + public InterfaceBuilder(String name) + { + super(name); + } + + public MethodBuilder newDefaultMethod() + { + MethodBuilder mb = new MethodBuilder(); + mb.addModifiers(JavaBuilder.DEFAULT); + this.defaults.add(mb); + return mb; + } + + public final MethodBuilder newDefaultMethod(String name) + { + MethodBuilder mb = newDefaultMethod(); + mb.setName(name); + return mb; + } + + public final List getDefaultMethods() + { + return this.defaults; + } + + @Override + protected String buildSignature(String clazz) + { + if (!this.mods.isEmpty()) + { + clazz += this.mods.stream().collect(Collectors.joining(" ")); + clazz += " "; + } + clazz += "interface " + this.name; + if (!this.params.isEmpty()) + { + clazz += "<" + this.params.stream().collect(Collectors.joining(", ")) + ">"; + } + if (!this.ifaces.isEmpty()) + { + clazz += " extends "; + clazz += this.ifaces.stream().collect(Collectors.joining(", ")); + } + return clazz; + } + + @Override + protected String buildMethods(String clazz) + { + clazz = super.buildMethods(clazz); + if (!this.defaults.isEmpty()) + { + clazz += "\n\n"; + clazz += this.defaults.stream().map((mb) -> mb.build()).collect(Collectors.joining("\n\n")); + } + return clazz; + } +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/java/util/JavaBuilder.java b/scribble-codegen/src/main/java/org/scribble/codegen/java/util/JavaBuilder.java new file mode 100644 index 000000000..103958199 --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/java/util/JavaBuilder.java @@ -0,0 +1,64 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.java.util; + +public abstract class JavaBuilder +{ + public static final String ABSTRACT = "abstract"; + public static final String DEFAULT = "default"; + public static final String VOID = "void"; + public static final String THIS = "this"; + public static final String SYNCHRONIZED = "synchronized"; + public static final String SUPER = "super"; + public static final String STATIC = "static"; + public static final String RETURN = "return"; + public static final String PUBLIC = "public"; + public static final String PROTECTED = "protected"; + public static final String PRIVATE = "private"; + public static final String NEW = "new"; + public static final String FINAL = "final"; + + protected String name; + + public JavaBuilder() + { + + } + + public JavaBuilder(String name) + { + this.name = name; + } + + public abstract String build(); + + public String getName() + { + return this.name; + } + + public void setName(String name) + { + setterCheck(this.name); + this.name = name; + } + + protected void setterCheck(String s) + { + if (s != null) + { + throw new RuntimeException("Value already set: " + s); + } + } +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/java/util/MethodBuilder.java b/scribble-codegen/src/main/java/org/scribble/codegen/java/util/MethodBuilder.java new file mode 100644 index 000000000..a8e9e02b9 --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/java/util/MethodBuilder.java @@ -0,0 +1,153 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.java.util; + +import java.util.Arrays; +import java.util.LinkedList; +import java.util.List; +import java.util.stream.Collectors; + +public class MethodBuilder extends JavaBuilder +{ + private final List annots = new LinkedList<>(); + private final List mods = new LinkedList<>(); + private String ret; // null for constructor -- void must be set explicitly + private final List pars = new LinkedList<>(); + private final List exceptions = new LinkedList<>(); + private final List body = new LinkedList<>(); + private final List typepars = new LinkedList<>(); // generic parameters + + protected MethodBuilder() + { + + } + + protected MethodBuilder(String name) + { + super(name); + } + + public void addAnnotations(String... mods) + { + this.annots.addAll(Arrays.asList(mods)); + } + + public void addModifiers(String... mods) + { + this.mods.addAll(Arrays.asList(mods)); + } + + public void setReturn(String ret) + { + setterCheck(this.ret); + this.ret = ret; + } + + public String getReturn() + { + return this.ret; + } + + // Each par is the String: type + " " + name + public void addParameters(String... par) + { + this.pars.addAll(Arrays.asList(par)); + } + + public List getParameters() + { + return this.pars; + } + + public void addTypeParameters(String... par) + { + this.typepars.addAll(Arrays.asList(par)); + } + + public List getTypeParameters() + { + return this.typepars; + } + + public void addExceptions(String... exceptions) + { + this.exceptions.addAll(Arrays.asList(exceptions)); + } + + public void addBodyLine(String ln) + { + this.body.add(ln); + } + + public final void addBodyLine(int i, String ln) + { + for (int j = 0; j < i; j++) + { + ln = "\t" + ln; + } + addBodyLine(ln); + } + + @Override + public String build() + { + String meth = ""; + meth = buildSignature(meth); + meth = buildBody(meth); + return meth; + } + + protected String buildSignature(String meth) + { + if (!this.annots.isEmpty()) + { + meth += "\t"; + meth += this.annots.stream().collect(Collectors.joining("\n\t")) + "\n"; + } + meth += "\t"; + if (!this.mods.isEmpty()) + { + meth += this.mods.stream().collect(Collectors.joining(" ")); + meth += " "; + } + if (!this.typepars.isEmpty()) + { + meth += "<" + this.typepars.stream().collect(Collectors.joining(", ")) + "> "; + } + if (this.ret != null) + { + meth += this.ret + " "; + } + meth += name + "("; + meth += this.pars.stream().collect(Collectors.joining(", ")); + meth += ")"; + if (!this.exceptions.isEmpty()) + { + meth += " throws " + this.exceptions.stream().collect(Collectors.joining(", ")); + } + return meth; + } + + protected String buildBody(String meth) + { + meth += " {\n"; + if (!this.body.isEmpty()) + { + meth += "\t\t"; + meth += this.body.stream().collect(Collectors.joining("\n\t\t")); + } + meth += "\n\t}"; + return meth; + } +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/java/util/TypeBuilder.java b/scribble-codegen/src/main/java/org/scribble/codegen/java/util/TypeBuilder.java new file mode 100644 index 000000000..a2029706a --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/java/util/TypeBuilder.java @@ -0,0 +1,275 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.java.util; + +import java.util.Arrays; +import java.util.Iterator; +import java.util.LinkedHashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.stream.Collectors; + +// An abstract type declaration builder +public abstract class TypeBuilder extends JavaBuilder +{ + protected String packname; // null for non- top-level type declaration + protected final LinkedHashSet imports = new LinkedHashSet<>(); + + protected final LinkedHashSet mods = new LinkedHashSet<>(); + protected final LinkedHashSet ifaces = new LinkedHashSet<>(); + protected final List params = new LinkedList<>(); + + protected final List fields = new LinkedList<>(); + protected final List methods = new LinkedList<>(); + + protected final List topLevelTypes = new LinkedList<>(); + protected final List memberTypes = new LinkedList<>(); + + // No name par because so far useful to start constructing before setting the name + public TypeBuilder() + { + + } + + public TypeBuilder(String name) + { + super(name); + } + + public void setPackage(String packname) + { + setterCheck(this.packname); + this.packname = packname; + } + + public void addImports(String... imports) + { + this.imports.addAll(Arrays.asList(imports)); + } + + public void addModifiers(String... mods) + { + this.mods.addAll(Arrays.asList(mods)); + } + + public void addInterfaces(String... ifaces) + { + this.ifaces.addAll(Arrays.asList(ifaces)); + } + + public List getInterfaces() + { + return new LinkedList<>(this.ifaces); + } + + public void addParameters(String... params) + { + this.params.addAll(Arrays.asList(params)); + } + + public List getParameters() + { + return this.params; + } + + public FieldBuilder newField(String name) + { + FieldBuilder fb = new FieldBuilder(); + fb.setName(name); + this.fields.add(fb); + return fb; + } + + public AbstractMethodBuilder newAbstractMethod() + { + AbstractMethodBuilder mb = new AbstractMethodBuilder(); + this.methods.add(mb); + return mb; + } + + public final AbstractMethodBuilder newAbstractMethod(String name) + { + AbstractMethodBuilder mb = newAbstractMethod(); + mb.setName(name); + return mb; + } + + // HACK: up to generic erasure + public final void checkDuplicateMethods(MethodBuilder mb) + { + List toRemove = new LinkedList<>(); + X: for (MethodBuilder tmp : this.methods) + { + if (!tmp.equals(mb) && tmp.getReturn().equals(mb.getReturn())) + { + if (tmp.getParameters().size() == 0) + { + if (mb.getParameters().size() != 0) + { + continue X; + } + } + else + { + Iterator mbparams = mb.getParameters().iterator(); + for (String tmpparam : tmp.getParameters()) + { + if (!mbparams.hasNext()) + { + continue X; + } + String mbparam = mbparams.next(); + + if (mbparam.contains("<")) + { + mbparam = mbparam.substring(0, mbparam.indexOf("<")); + } + else + { + mbparam = mbparam.substring(0, mbparam.indexOf(" ")); + } + if (tmpparam.contains("<")) + { + tmpparam = tmpparam.substring(0, tmpparam.indexOf("<")); + } + else + { + tmpparam = tmpparam.substring(0, tmpparam.indexOf(" ")); + } + if (!tmpparam.equals(mbparam)) + { + continue X; + } + } + } + toRemove.add(mb); + } + } + this.methods.removeAll(toRemove); + } + + public EnumBuilder newMemberEnum(String name) + { + EnumBuilder eb = new EnumBuilder(); + eb.setName(name); + this.memberTypes.add(eb); + return eb; + } + + // Name may not be suitable -- inner? + public ClassBuilder newMemberClass(String name) + { + ClassBuilder cb = new ClassBuilder(name); + this.memberTypes.add(cb); + return cb; + } + + // Name may not be suitable -- inner? + public InterfaceBuilder newMemberInterface(String name) + { + InterfaceBuilder ib = new InterfaceBuilder(name); + this.memberTypes.add(ib); + return ib; + } + + public ClassBuilder newTopLevelClass() + { + ClassBuilder cb = new ClassBuilder(); + this.topLevelTypes.add(cb); + return cb; + } + + // No validation here: javac is for that + @Override + public String build() + { + String clazz = ""; + clazz = buildHeader(clazz); + clazz = buildSignature(clazz); + clazz = buildBody(clazz); + clazz = buildTopLevelTypes(clazz); + return clazz; + } + + protected String buildBody(String clazz) + { + clazz += " {"; + clazz = buildFields(clazz); + clazz = buildMethods(clazz); + clazz = buildMemberTypes(clazz); + clazz += "\n}"; + return clazz; + } + + protected String buildHeader(String clazz) + { + if (this.packname != null) + { + clazz += "package " + packname + ";"; + } + if (!this.imports.isEmpty()) + { + clazz += "\n\nimport "; + clazz += this.imports.stream().collect(Collectors.joining(";\nimport ")); + clazz += ";"; + } + if (this.packname != null || !this.imports.isEmpty()) + { + clazz += "\n\n"; + } + return clazz; + } + + protected abstract String buildSignature(String clazz); + + protected String buildFields(String clazz) + { + if (!this.fields.isEmpty()) + { + clazz += "\n"; + clazz += this.fields.stream().map(fb -> fb.build()).collect(Collectors.joining("\n")); + } + return clazz; + } + + protected String buildMethods(String clazz) + { + if (!this.methods.isEmpty()) + { + clazz += "\n\n"; + clazz += this.methods.stream().map(mb -> mb.build()).collect(Collectors.joining("\n\n")); + } + return clazz; + } + + protected String buildMemberTypes(String clazz) + { + if (!this.memberTypes.isEmpty()) + { + clazz += "\n\n"; + clazz += this.memberTypes.stream().map(tb -> tb.build()).collect(Collectors.joining("\n\n")); + } + return clazz; + } + + protected String buildTopLevelTypes(String clazz) + { + if (!this.topLevelTypes.isEmpty()) + { + clazz += "\n\n"; + clazz += this.topLevelTypes.stream().map(tb -> tb.build()).collect(Collectors.joining("\n\n")); + } + return clazz; + } +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/statetype/STActionBuilder.java b/scribble-codegen/src/main/java/org/scribble/codegen/statetype/STActionBuilder.java new file mode 100644 index 000000000..15107eb99 --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/statetype/STActionBuilder.java @@ -0,0 +1,44 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.statetype; + +import org.scribble.core.model.endpoint.EState; +import org.scribble.core.model.endpoint.actions.EAction; + +public abstract class STActionBuilder +{ + public abstract String getActionName(STStateChanAPIBuilder api, EAction a); + public abstract String buildArgs(EAction a); + public abstract String buildBody(STStateChanAPIBuilder api, EState curr, EAction a, EState succ); + + public String getReturnType(STStateChanAPIBuilder api, EState curr, EState succ) + { + return api.getStateChanName(succ); + } + + public String buildReturn(STStateChanAPIBuilder api, EState curr, EState succ) + { + return api.buildActionReturn(this, curr, succ); + } + + public String build(STStateChanAPIBuilder api, EState curr, EAction a) + { + return api.buildAction(this, curr, a); // Because action builder hierarchy not suitable (extended by action kinds, not by target language) + } + + public String getStateChanType(STStateChanAPIBuilder api, EState curr, EAction a) + { + return api.getStateChanName(curr); + } +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/statetype/STBranchActionBuilder.java b/scribble-codegen/src/main/java/org/scribble/codegen/statetype/STBranchActionBuilder.java new file mode 100644 index 000000000..6640af262 --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/statetype/STBranchActionBuilder.java @@ -0,0 +1,19 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.statetype; + +public abstract class STBranchActionBuilder extends STActionBuilder +{ + +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/statetype/STBranchStateBuilder.java b/scribble-codegen/src/main/java/org/scribble/codegen/statetype/STBranchStateBuilder.java new file mode 100644 index 000000000..a60e2a424 --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/statetype/STBranchStateBuilder.java @@ -0,0 +1,37 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.statetype; + +import org.scribble.core.model.endpoint.EState; + +public abstract class STBranchStateBuilder extends STStateChanBuilder +{ + protected final STBranchActionBuilder bb; + + public STBranchStateBuilder(STBranchActionBuilder bb) + { + this.bb = bb; + } + + @Override + public String build(STStateChanAPIBuilder api, EState s) + { + String out = getPreamble(api, s); + + out += "\n\n"; + out += this.bb.build(api, s, s.getDetActions().get(1)); // Getting 1 checks non-unary + + return out; + } +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/statetype/STCaseActionBuilder.java b/scribble-codegen/src/main/java/org/scribble/codegen/statetype/STCaseActionBuilder.java new file mode 100644 index 000000000..e9030d608 --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/statetype/STCaseActionBuilder.java @@ -0,0 +1,19 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.statetype; + +public abstract class STCaseActionBuilder extends STActionBuilder +{ + +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/statetype/STCaseBuilder.java b/scribble-codegen/src/main/java/org/scribble/codegen/statetype/STCaseBuilder.java new file mode 100644 index 000000000..76de329b9 --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/statetype/STCaseBuilder.java @@ -0,0 +1,51 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.statetype; + +import org.scribble.core.model.endpoint.EState; +import org.scribble.core.model.endpoint.actions.EAction; +import org.scribble.core.model.endpoint.actions.ERecv; + +public abstract class STCaseBuilder extends STStateChanBuilder // Is a distinct type but not a state -- OK for now +{ + protected final STCaseActionBuilder cb; + + public STCaseBuilder(STCaseActionBuilder cb) + { + this.cb = cb; + } + + @Override + public String build(STStateChanAPIBuilder api, EState s) + { + String out = getPreamble(api, s); + + for (EAction a : s.getDetActions()) + { + out += "\n\n"; + if (a instanceof ERecv) // FIXME: factor out action kind + { + out += this.cb.build(api, s, a); + } + else + { + throw new RuntimeException("Shouldn't get in here: " + a); + } + } + + return out; + } + + public abstract String getCaseStateChanName(STStateChanAPIBuilder api, EState s); +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/statetype/STEndStateBuilder.java b/scribble-codegen/src/main/java/org/scribble/codegen/statetype/STEndStateBuilder.java new file mode 100644 index 000000000..89abfb1c8 --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/statetype/STEndStateBuilder.java @@ -0,0 +1,30 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.statetype; + +import org.scribble.core.model.endpoint.EState; + +public abstract class STEndStateBuilder extends STStateChanBuilder +{ + public STEndStateBuilder() + { + + } + + @Override + public String build(STStateChanAPIBuilder api, EState s) + { + return getPreamble(api, s); + } +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/statetype/STOutputStateBuilder.java b/scribble-codegen/src/main/java/org/scribble/codegen/statetype/STOutputStateBuilder.java new file mode 100644 index 000000000..1f4a62ca2 --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/statetype/STOutputStateBuilder.java @@ -0,0 +1,62 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.statetype; + +import org.scribble.core.model.endpoint.EState; +import org.scribble.core.model.endpoint.actions.EAction; +import org.scribble.core.model.endpoint.actions.EDisconnect; +import org.scribble.core.model.endpoint.actions.EReq; +import org.scribble.core.model.endpoint.actions.ESend; + +public abstract class STOutputStateBuilder extends STStateChanBuilder +{ + protected final STSendActionBuilder sb; + + public STOutputStateBuilder(STSendActionBuilder sb) + { + this.sb = sb; + } + + @Override + public String build(STStateChanAPIBuilder api, EState s) + { + String out = getPreamble(api, s); + /*"package " + getPackage(gpn) + + "\n" + + "type " + getSTStateName(gpn, role, s) + " struct{}";*/ + + for (EAction a : s.getDetActions()) + { + out += "\n\n"; + if (a instanceof ESend) // FIXME: factor out action kind + { + out += this.sb.build(api, s, a); + } + else if (a instanceof EReq) + { + throw new RuntimeException("TODO: " + a); + } + else if (a instanceof EDisconnect) + { + throw new RuntimeException("TODO: " + a); + } + else + { + throw new RuntimeException("Shouldn't get in here: " + a); + } + } + + return out; + } +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/statetype/STReceiveActionBuilder.java b/scribble-codegen/src/main/java/org/scribble/codegen/statetype/STReceiveActionBuilder.java new file mode 100644 index 000000000..10d930ab3 --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/statetype/STReceiveActionBuilder.java @@ -0,0 +1,19 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.statetype; + +public abstract class STReceiveActionBuilder extends STActionBuilder +{ + +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/statetype/STReceiveStateBuilder.java b/scribble-codegen/src/main/java/org/scribble/codegen/statetype/STReceiveStateBuilder.java new file mode 100644 index 000000000..d18309954 --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/statetype/STReceiveStateBuilder.java @@ -0,0 +1,45 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.statetype; + +import java.util.List; + +import org.scribble.core.model.endpoint.EState; +import org.scribble.core.model.endpoint.actions.EAction; + +public abstract class STReceiveStateBuilder extends STStateChanBuilder +{ + protected final STReceiveActionBuilder rb; + + public STReceiveStateBuilder(STReceiveActionBuilder rb) + { + this.rb = rb; + } + + @Override + public String build(STStateChanAPIBuilder api, EState s) + { + String out = getPreamble(api, s); + + List as = s.getDetActions(); + if (as.size() > 1) + { + throw new RuntimeException("Shouldn't get in here: " + as); + } + out += "\n\n"; + out += this.rb.build(api, s, as.get(0)); + + return out; + } +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/statetype/STSendActionBuilder.java b/scribble-codegen/src/main/java/org/scribble/codegen/statetype/STSendActionBuilder.java new file mode 100644 index 000000000..39ccf481b --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/statetype/STSendActionBuilder.java @@ -0,0 +1,19 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.statetype; + +public abstract class STSendActionBuilder extends STActionBuilder +{ + +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/statetype/STStateChanAPIBuilder.java b/scribble-codegen/src/main/java/org/scribble/codegen/statetype/STStateChanAPIBuilder.java new file mode 100644 index 000000000..493429f30 --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/statetype/STStateChanAPIBuilder.java @@ -0,0 +1,118 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.statetype; + +import java.util.HashMap; +import java.util.LinkedHashSet; +import java.util.Map; +import java.util.Set; + +import org.scribble.core.model.endpoint.EGraph; +import org.scribble.core.model.endpoint.EState; +import org.scribble.core.model.endpoint.actions.EAction; +import org.scribble.core.type.name.GProtoName; +import org.scribble.core.type.name.Role; +import org.scribble.job.Job; + +public abstract class STStateChanAPIBuilder +{ + public final Job job; + + public final GProtoName gpn; + public final Role role; + public final EGraph graph; + + public final STOutputStateBuilder ob; + public final STReceiveStateBuilder rb; + public final STBranchStateBuilder bb; + public final STCaseBuilder cb; + public final STEndStateBuilder eb; + + private Map names = new HashMap<>(); + + protected STStateChanAPIBuilder(Job job, GProtoName gpn, Role role, + EGraph graph, STOutputStateBuilder ob, STReceiveStateBuilder rb, + STBranchStateBuilder bb, STCaseBuilder cb, STEndStateBuilder eb) + { + this.job = job; + + this.gpn = gpn; + this.role = role; + this.graph = graph; + + this.ob = ob; + this.rb = rb; + this.bb = bb; + this.cb = cb; + this.eb = eb; + } + + public abstract Map buildSessionAPI(); // filepath -> source // FIXME: factor out + + public Map build() // filepath -> source + { + Map api = new HashMap<>(); + Set states = new LinkedHashSet<>(); + states.add(this.graph.init); + states.addAll(this.graph.init.getReachableStates()); + for (EState s : states) + { + switch (s.getStateKind()) + { + case ACCEPT: throw new RuntimeException("TODO"); + case OUTPUT: api.put(getFilePath(getStateChanName(s)), this.ob.build(this, s)); break; + case POLY_RECIEVE: + { + api.put(getFilePath(getStateChanName(s)), this.bb.build(this, s)); + api.put(getFilePath(this.cb.getCaseStateChanName(this, s)), this.cb.build(this, s)); // FIXME: factor out + break; + } + case TERMINAL: api.put(getFilePath(getStateChanName(s)), this.eb.build(this, s)); break; // FIXME: without subpackages, all roles share same EndSocket + case UNARY_RECEIVE: + { + api.put(getFilePath(getStateChanName(s)), this.rb.build(this, s)); + //api.put(getFilePath(getStateChanName(s) + "_Cases"), this.cb.build(this, s)); // FIXME: factor out + break; + } + case SERVER_WRAP: throw new RuntimeException("TODO"); + default: throw new RuntimeException("Shouldn't get in here: " + s); + } + } + return api; + } + + public abstract String getFilePath(String name); + + public abstract String getPackage(); + + public String getStateChanName(EState s) + { + String name = this.names.get(s.id); + if (name == null) + { + name = makeSTStateName(s); + this.names.put(s.id, name); + } + return name; + } + + // Should only be called from getSTStateName + protected abstract String makeSTStateName(EState s); + + public abstract String buildAction(STActionBuilder ab, EState curr, EAction a); + + public abstract String getChannelName(STStateChanAPIBuilder api, EAction a); + + public abstract String buildActionReturn(STActionBuilder ab, EState curr, EState succ); // FIXME: refactor action builders as interfaces and use generic parameter for kind +} diff --git a/scribble-codegen/src/main/java/org/scribble/codegen/statetype/STStateChanBuilder.java b/scribble-codegen/src/main/java/org/scribble/codegen/statetype/STStateChanBuilder.java new file mode 100644 index 000000000..aeca376a1 --- /dev/null +++ b/scribble-codegen/src/main/java/org/scribble/codegen/statetype/STStateChanBuilder.java @@ -0,0 +1,22 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.codegen.statetype; + +import org.scribble.core.model.endpoint.EState; + +public abstract class STStateChanBuilder +{ + public abstract String getPreamble(STStateChanAPIBuilder api, EState s); + public abstract String build(STStateChanAPIBuilder api, EState s); +} diff --git a/modules/core/LICENSE.txt b/scribble-core/LICENSE.txt similarity index 100% rename from modules/core/LICENSE.txt rename to scribble-core/LICENSE.txt diff --git a/scribble-core/pom.xml b/scribble-core/pom.xml new file mode 100644 index 000000000..8ca744096 --- /dev/null +++ b/scribble-core/pom.xml @@ -0,0 +1,26 @@ + + 4.0.0 + + + scribble-core + jar + + + + org.antlr + antlr-runtime + + + + + org.scribble + parent + 0.5.1-SNAPSHOT + ../pom.xml + + + + scribble-core + + diff --git a/scribble-core/src/main/java/org/scribble/core/job/Core.java b/scribble-core/src/main/java/org/scribble/core/job/Core.java new file mode 100644 index 000000000..33e3493ac --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/job/Core.java @@ -0,0 +1,726 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.job; + +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +import org.scribble.core.lang.global.GProtocol; +import org.scribble.core.lang.local.LProjection; +import org.scribble.core.model.ModelFactory; +import org.scribble.core.model.endpoint.EGraph; +import org.scribble.core.model.endpoint.EModelFactoryImpl; +import org.scribble.core.model.endpoint.EState; +import org.scribble.core.model.global.SGraph; +import org.scribble.core.model.global.SModelFactoryImpl; +import org.scribble.core.model.visit.local.NonDetPayChecker; +import org.scribble.core.type.kind.Global; +import org.scribble.core.type.kind.Local; +import org.scribble.core.type.name.ModuleName; +import org.scribble.core.type.name.ProtoName; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.STypeFactory; +import org.scribble.core.type.session.global.GSeq; +import org.scribble.core.type.session.local.LSeq; +import org.scribble.core.visit.STypeVisitorFactory; +import org.scribble.core.visit.STypeVisitorFactoryImpl; +import org.scribble.core.visit.gather.ProtoDepsCollector; +import org.scribble.core.visit.gather.RoleGatherer; +import org.scribble.core.visit.global.GTypeVisitorFactoryImpl; +import org.scribble.core.visit.local.LDoPruner; +import org.scribble.core.visit.local.LRoleDeclAndDoArgPruner; +import org.scribble.core.visit.local.LTypeVisitorFactoryImpl; +import org.scribble.core.visit.local.SubprotoExtChoiceSubjFixer; +import org.scribble.util.ScribException; + + +// A "compiler job" front-end that supports operations comprising visitor passes over the AST and/or local/global models +public class Core +{ + public final CoreConfig config; // Immutable + + private final CoreContext context; // Mutable (Visitor passes replace modules) + + public Core(ModuleName mainFullname, Map args, + //Map modcs, + Set imeds, STypeFactory tf) + { + this.config = newCoreConfig(mainFullname, args, tf); + this.context = newCoreContext(//modcs, + imeds); // Single instance per Core and should never be shared + } + + protected STypeVisitorFactory newSTypeVisitorFactory() + { + return new STypeVisitorFactoryImpl(new GTypeVisitorFactoryImpl(), + new LTypeVisitorFactoryImpl()); + } + + protected ModelFactory newModelFactory() + { + return new ModelFactory(EModelFactoryImpl::new, + SModelFactoryImpl::new); + } + + // A Scribble extension should override newCoreConfig/Context/etc as appropriate + protected CoreConfig newCoreConfig(ModuleName mainFullname, + Map args, STypeFactory tf) + { + STypeVisitorFactory vf = newSTypeVisitorFactory(); + ModelFactory mf = newModelFactory(); + return new CoreConfig(mainFullname, args, tf, vf, mf); + // CHECKME: combine E/SModelFactory? + } + + // A Scribble extension should override newCoreConfig/Context/etc as appropriate + protected CoreContext newCoreContext(//Map modcs, + Set imeds) + { + return new CoreContext(this, //modcs, + imeds); + } + + public void runPasses() throws ScribException + { + // Passes populate JobContext on-demand by each individual getter + runSyntaxTransformPasses(); + runGlobalSyntaxWfPasses(); + runProjectionPasses(); // CHECKME: can try before validation (i.e., including syntactic WF), to promote greater tool feedback? (cf. CommandLine output "barrier") + runProjectionSyntaxWfPasses(); + runEfsmBuildingPasses(); // Currently, unfair-transform graph building must come after syntactic WF --- TODO fix graph building to prevent crash ? + runLocalModelCheckingPasses(); + runGlobalModelCheckingPasses(); + } + + // Populates JobContext -- although patten is to do on-demand via (first) getter, so (partially) OK to delay population + protected void runSyntaxTransformPasses() // No ScribException, no errors expected + { + verbosePrintPass("Inlining subprotocols for all globals..."); + for (ProtoName fullname : this.context.getParsedFullnames()) + { + GProtocol inlined = this.context.getInlined(fullname); + verbosePrintPass( + "Inlined subprotocols: " + fullname + "\n" + inlined); + } + + verbosePrintPass( + "Unfolding all recursions once for all inlined globals..."); + for (ProtoName fullname : this.context.getParsedFullnames()) + { + // TODO: currently, unfolded not actually stored by Context -- unfoldAllOnce repeated manually when needed, e.g., runSyntaxWfPasses + GProtocol unf = this.context.getOnceUnfolded(fullname); // CHECKME: twice unfolding? instead of "unguarded"-unfolding? + verbosePrintPass( + "Unfolded all recursions once: " + unf.fullname + "\n" + unf); + } + } + + protected void runGlobalSyntaxWfPasses() throws ScribException + { + verbosePrintPass( + "Checking for unused role decls on all inlined globals..."); + for (ProtoName fullname : this.context.getParsedFullnames()) + { + // CHECKME: relegate to "warning" ? -- some downsteam operations may depend on this though (e.g., graph building?) + Set used = this.context.getInlined(fullname).def + .gather(new RoleGatherer()::visit) + .collect(Collectors.toSet()); + Set unused = this.context.getIntermediate(fullname).roles + // imeds have original role decls (inlined's are pruned) + .stream().filter(x -> !used.contains(x)).collect(Collectors.toSet()); + if (!unused.isEmpty()) + { + throw new ScribException( + "Unused roles in " + fullname + ": " + unused); + } + } + + verbosePrintPass("Checking role enabling on all inlined globals..."); + for (ProtoName fullname : this.context.getParsedFullnames()) + { + GProtocol unf = this.context.getOnceUnfolded(fullname); + if (unf.isAux()) + { + continue; + } + unf.checkRoleEnabling(this); + //e.g., C->D captured under an A->B choice after unfolding, cf. bad.wfchoice.enabling.twoparty.Test01b; + // TODO: get unfolded from Context + } + + verbosePrintPass( + "Checking consistent external choice subjects on all inlined globals..."); + for (ProtoName fullname : this.context.getParsedFullnames()) + { + GProtocol inlined = this.context.getInlined(fullname); + if (inlined.isAux()) + { + continue; + } + inlined.checkExtChoiceConsistency(this); + } + + verbosePrintPass( + "Checking connectedness on all inlined globals..."); + for (ProtoName fullname : this.context.getParsedFullnames()) + { + GProtocol unf = this.context.getOnceUnfolded(fullname); + if (unf.isAux()) + { + continue; + } + unf.checkConnectedness(this, !unf.isExplicit()); + //e.g., rec X { connect A to B; continue X; } + } + } + + // Due to Projector not being a subprotocol visitor, so "external" subprotocols may not be visible in ModuleContext building for the projections of the current root Module + // SubprotocolVisitor it doesn't visit the target Module/ProtocolDecls -- that's why the old Projector maintained its own dependencies and created the projection modules after leaving a Do separately from SubprotocolVisiting + // So Projection should not be an "inlining" SubprotocolVisitor, it would need to be more a "DependencyVisitor" + protected void runProjectionPasses() // No ScribException, no errors expected + { + verbosePrintPass("Projecting all inlined globals..."); + for (ProtoName fullname : this.context.getParsedFullnames()) + { + GProtocol inlined = this.context.getInlined(fullname); + for (Role self : inlined.roles) + { + // pruneRecs already done (see runContextBuildingPasses) + // CHECKME: projection and inling commutative? + LProjection iproj = this.context.getProjectedInlined(inlined.fullname, + self); + verbosePrintPass("Projected inlined onto " + self + ": " + + inlined.fullname + "\n" + iproj); + } + } + + // Pre: inlined already projected -- used for Do projection + // N.B. no "fixing" passes done within here -- need breadth-first passes to be sequentialised for subproto visiting (see below) + verbosePrintPass("Projecting all intermediate globals..."); + for (ProtoName fullname : this.context.getParsedFullnames()) + { + GProtocol imed = this.context.getIntermediate(fullname); + for (Role self : imed.roles) + { + LProjection proj = this.context.getProjection(fullname, self); + verbosePrintPass("Projected intermediate onto " + self + ": " + + imed.fullname + "\n" + proj); + } + } + + verbosePrintPass("Pruning do-args on all projected intermediates..."); + LRoleDeclAndDoArgPruner v1 = this.config.vf.local.LDoArgPruner(this); // Reusable + List done1 = new LinkedList<>(); + for (ProtoName fullname : this.context.getParsedFullnames()) + { + GProtocol imed = this.context.getIntermediate(fullname); + for (Role self : imed.roles) + { + LProjection proj = this.context.getProjection(fullname, self); + LProjection fixed = (LProjection) proj.pruneRoleDeclsAndDoArgs(v1); // TODO: refactor as LProjection/LProto meth, cf. GProto + done1.add(fixed); // N.B. replaces existing projection + verbosePrintPass( + "Pruned do-args on projected intermediate: " + + fixed.fullname + ":\n" + fixed); + } + } + done1.forEach(x -> this.getContext().setProjection(x)); + // Update after all visited, to prevent visiting an already pruned projdecl from breaking the pruning of a subsequent one (e.g., mutually recursive proto refs) + + verbosePrintPass("Do-pruning all projected intermediates..."); + LDoPruner v2 = this.config.vf.local.LDoPruner(this); // Reusable + List done2 = new LinkedList<>(); + for (ProtoName fullname : this.context.getParsedFullnames()) + { + GProtocol imed = this.context.getIntermediate(fullname); + for (Role self : imed.roles) + { + LProjection proj = this.context.getProjection(fullname, self); + LProjection fixed = (LProjection) proj.pruneDos(v2); // TODO: refactor as LProjection/LProto meth, cf. GProto + done2.add(fixed); // N.B. replaces existing projection + verbosePrintPass( + "Do-pruned projected intermediate: " + + fixed.fullname + ":\n" + fixed); + } + } + done2.forEach(x -> this.getContext().setProjection(x)); + // Update after all visited, to prevent visiting an already pruned projdecl from breaking the pruning of a subsequent one (e.g., mutually recursive proto refs) + + verbosePrintPass( + "Fixing external choice subjects for all projected intermediates..."); + SubprotoExtChoiceSubjFixer v3 = this.config.vf.local + .SubprotoExtChoiceSubjFixer(this); // Reusable (via top-level visitProtocol) + for (ProtoName fullname : this.context.getParsedFullnames()) + { + GProtocol imed = this.context.getIntermediate(fullname); + for (Role self : imed.roles) + { + LProjection proj = this.context.getProjection(fullname, self); + LProjection fixed = (LProjection) proj.fixExtChoiceSubjs(v3); + this.context.setProjection(fixed); // N.B. replaces existing projection + verbosePrintPass( + "Fixed external choice subjects for projected intermediate: " + + fixed.fullname + ":\n" + fixed); + } + } + } + + // Pre: runGlobalSyntaxWfPasses + protected void runProjectionSyntaxWfPasses() throws ScribException + { + verbosePrintPass("Checking reachability on all projected inlineds..."); + for (ProtoName fullname : this.context.getParsedFullnames()) + { + GProtocol inlined = this.context.getInlined(fullname); + if (inlined.isAux()) // CHECKME: also check for aux? e.g., bad.reach.globals.gdo.Test01b + { + continue; + } + for (Role self : inlined.roles) + { + LProjection iproj = this.context.getProjectedInlined(fullname, self); + iproj.checkReachability(this); + } + } + } + + // Pre: runGlobalSyntaxWfPasses -- unfair EFSM building depends on WF (role enabling, e.g., bad.wfchoice.enabling.threeparty.Test02) for building algorithm to work... + // ...or patch unfair-transform graph building to not crash? + protected void runEfsmBuildingPasses() + { + verbosePrintPass("Building EFSMs for all projected inlineds..."); + for (ProtoName fullname : this.context.getParsedFullnames()) + { + GProtocol inlined = this.context.getInlined(fullname); + for (Role self : inlined.roles) + { + // Seems to be OK even if runSyntaxWfPasses does not succeed (cf. unfair transform) + EGraph graph = this.context.getEGraph(fullname, self); + verbosePrintPass("Built EFSM: " + inlined.fullname + "@" + self + + "\n" + graph.toDot()); + } + } + + if (!this.config.args.get(CoreArgs.FAIR)) + { + verbosePrintPass( + "Building \"unfair\" EFSMs for all projected inlineds..."); + for (ProtoName fullname : this.context.getParsedFullnames()) + { + GProtocol inlined = this.context.getInlined(fullname); + for (Role self : inlined.roles) + { + // Pre: runGlobalSyntaxWfPasses -- e.g., bad.wfchoice.enabling.threeparty.Test02 + EGraph graph = this.context.getUnfairEGraph(inlined.fullname, self); + verbosePrintPass("Built \"unfair\" EFSM: " + inlined.fullname + + "@" + self + ":\n" + graph.toDot()); + } + } + } + } + + protected void runLocalModelCheckingPasses() throws ScribException + { + verbosePrintPass("Checking non-deterministic messaging action payloads..."); + for (ProtoName fullname : this.context.getParsedFullnames()) + { + GProtocol inlined = this.context.getInlined(fullname); + if (inlined.isAux()) // CHECKME: also check for aux? e.g., bad.reach.globals.gdo.Test01b + { + continue; + } + for (Role self : inlined.roles) + { + EState init = this.context.getEGraph(fullname, self).init; + init.traverse(new NonDetPayChecker()); + } + } + } + + protected void runGlobalModelCheckingPasses() throws ScribException + { + verbosePrintPass("Building and checking global models from projected inlineds..."); // CHECKME: separate and move model building earlier? + // CHECKME: refactor more/whole validation into lang.GProtocol ? + for (ProtoName fullname : this.context.getParsedFullnames()) + { + if (this.context.getIntermediate(fullname).isAux()) + { + continue; + } + validateByScribble(fullname, true); + if (!this.config.args.get(CoreArgs.FAIR)) + { + //verbosePrintPass("Validating by Scribble with \"unfair\" output choices: " + fullname); + validateByScribble(fullname, false); // TODO: only need to check progress, not "full" validation + } + } + } + + protected void validateByScribble(ProtoName fullname, boolean fair) + throws ScribException + { + SGraph graph = fair + ? this.context.getSGraph(fullname) + : this.context.getUnfairSGraph(fullname); + if (this.config.args.containsKey(CoreArgs.VERBOSE)) + { + String dot = graph.init.toDot(); + String[] lines = dot.split("\\R"); + verbosePrintPass( + //"(" + fullname + ") Built global model...\n" + graph.init.toDot() + "\n(" + fullname + ") ..." + graph.states.size() + " states"); + "Built " + (!fair ? "\"unfair\" " : "") + "global model (" + + graph.states.size() + " states): " + fullname + "\n" + + ((lines.length > 50) // CHECKME: factor out constant? + ? "...[snip]... (model text over 50 lines, try -[u]model[png])" + : dot)); + } + + verbosePrintPass("Checking " + (!fair ? "\"unfair\" " : "") + + "global model: " + fullname); + this.config.mf.global.SModel(graph).validate(this); + } + + // Pre: checkWellFormedness + // TODO: refactor projection, choice-subj fixing, do-pruning, do-arg fixing, etc. fully to Job (and drop this.projs from here) + public Map, LProjection> getProjections( + ProtoName fullname, Role self) throws ScribException + { + Map, LProjection> res = new HashMap<>(); + //Set> nonprotos = new LinkedHashSet<>(); + LProjection root = this.context.getProjection(fullname, self); + + List> todo = new LinkedList<>(); + todo.add(root.fullname); + while (!todo.isEmpty()) + { + ProtoName pfullname = todo.remove(0); + LProjection proj = this.context.getProjection(pfullname); + res.put(pfullname, proj); + proj.def.gather(new ProtoDepsCollector()::visit).distinct() + .filter(x -> !res.containsKey(x) && !todo.contains(x)) + .forEachOrdered(x -> todo.add(x)); + /*proj.def.gather(new NonProtoDepsGatherer()::visit) + .forEachOrdered(x -> nonprotos.add(x));*/ + } + + /*if (!nonprotos.isEmpty()) + // CHECKME: best way to handle mixtured of proto and nonproto dependencies? + // nonprotos should refer to source global module? i.e., projection modules should import globals? maybe consistent with "projects" clause + { + throw new RuntimeException( + "[TODO] Non-proto dependencies: " + nonprotos + "\n\t" + root); + }*/ + return res; + } + + public CoreContext getContext() + { + return this.context; + } + + public boolean isVerbose() + { + return this.config.args.get(CoreArgs.VERBOSE); + } + + public void verbosePrintln(String s) + { + if (isVerbose()) + { + System.out.println(s); + } + } + + private void verbosePrintPass(String s) + { + verbosePrintln("\n[Core] " + s); + } + + public void warningPrintln(String s) + { + System.err.println("[Warning] " + s); + } +} + + + + + + + + + + + + + + + + + + + /*// TODO: deprecate, caller should go through config + // A Scribble extension should override newCoreConfig/Context/etc as appropriate + public SGraphBuilderUtil newSGraphBuilderUtil() + { + return this.config.mf.newSGraphBuilderUtil(); + }*/ + + /*// TODO: deprecate, caller should go through config // CHECKME: refactor more uniformly with mf.newSGraphBuilderUtil ? + // A Scribble extension should override newCoreConfig/Context/etc as appropriate + public EGraphBuilderUtil newEGraphBuilderUtil() + { + return new EGraphBuilderUtil(this.config.mf); + }*/ + + /*public Map generateSessionApi(GProtocolName fullname) throws ScribbleException + { + debugPrintPass("Running " + SessionApiGenerator.class + " for " + fullname); + SessionApiGenerator sg = new SessionApiGenerator(this, fullname); + Map map = sg.generateApi(); // filepath -> class source + return map; + } + + // FIXME: refactor an EndpointApiGenerator -- ? + public Map generateStateChannelApi(GProtocolName fullname, Role self, boolean subtypes) throws ScribbleException + { + /*if (this.jcontext.getEndpointGraph(fullname, self) == null) + { + buildGraph(fullname, self); + }* / + debugPrintPass("Running " + StateChannelApiGenerator.class + " for " + fullname + "@" + self); + StateChannelApiGenerator apigen = new StateChannelApiGenerator(this, fullname, self); + IOInterfacesGenerator iogen = null; + try + { + iogen = new IOInterfacesGenerator(apigen, subtypes); + } + catch (RuntimeScribbleException e) // FIXME: use IOInterfacesGenerator.skipIOInterfacesGeneration + { + //System.err.println("[Warning] Skipping I/O Interface generation for protocol featuring: " + fullname); + warningPrintln("Skipping I/O Interface generation for: " + fullname + "\n Cause: " + e.getMessage()); + } + // Construct the Generators first, to build all the types -- then call generate to "compile" all Builders to text (further building changes will not be output) + Map api = new HashMap<>(); // filepath -> class source // Store results? + api.putAll(apigen.generateApi()); + if (iogen != null) + { + api.putAll(iogen.generateApi()); + } + return api; + } + //*/ + + /* // TODO FIXME: refactor following methods (e.g., non-static?) + public static void validateBySpin(Core core, GProtoName fullname) + throws ScribException + { + CoreContext corec = core.getContext(); + GProtocol gpd = corec.getInlined(fullname); + + List rs = gpd.roles.stream() + .sorted(Comparator.comparing(Role::toString)) + .collect(Collectors.toList()); + + Set> mids = gpd.def.//getMessageIds(); + gather(new MessageIdGatherer()::visit) + .collect(Collectors.toSet()); + + //..........FIXME: get mids from SType, instead of old AST Collector + + String pml = ""; + pml += "mtype {" + mids.stream().map(mid -> mid.toString()) + .collect(Collectors.joining(", ")) + "};\n"; + + // TODO CHECKME: explicit ? + + pml += "\n"; + List pairs = new LinkedList<>(); + for (Role r1 : rs) + { + for (Role r2 : rs) + { + if (!r1.equals(r2)) + { + pairs.add(new Role[] {r1, r2}); + } + } + } + //for (Role[] p : (Iterable) () -> pairs.stream().sorted().iterator()) + for (Role[] p : pairs) + { + pml += "chan s_" + p[0] + "_" + p[1] + " = [1] of { mtype };\n" + + "chan r_" + p[0] + "_" + p[1] + " = [1] of { mtype };\n" + + "bool empty_" + p[0] + "_" + p[1] + " = true;\n" + + "active proctype chan_" + p[0] + "_" + p[1] + "() {\n" + + "mtype m;\n" + + "end_chan_" + p[0] + "_" + p[1] + ":\n" + + "do\n" + + "::\n" + + "atomic { s_" + p[0] + "_" + p[1] + "?m; empty_" + p[0] + "_" + p[1] + + " = false }\n" + + "atomic { r_" + p[0] + "_" + p[1] + "!m; empty_" + p[0] + "_" + p[1] + + " = true }\n" + + "od\n" + + "}\n"; + } + + for (Role r : rs) + { + pml += "\n\n" + corec.getEGraph(fullname, r).toPml(r); + } + if (core.config.args.get(CoreArgs.VERBOSE)) + { + System.out.println("[-spin]: Promela processes\n" + pml + "\n"); + } + + List clauses = new LinkedList<>(); + for (Role r : rs) + { + Set tmp = new HashSet<>(); + EGraph g = corec.getEGraph(fullname, r); + tmp.add(g.init); + tmp.addAll(g.init.getReachableStates()); + if (g.term != null) + { + tmp.remove(g.term); + } + tmp.forEach( // Throws exception, cannot use flatMap + s -> clauses.add("!<>[]" + r + "@label" + r + s.id) // FIXME: factor out + ); + } + // * / + /*String roleProgress = ""; // This way is not faster + for (Role r : rs) + { + Set tmp = new HashSet<>(); + EGraph g = jc.getEGraph(fullname, r); + tmp.add(g.init); + tmp.addAll(MState.getReachableStates(g.init)); + if (g.term != null) + { + tmp.remove(g.term); + } + roleProgress += (((roleProgress.isEmpty()) ? "" : " || ") + + tmp.stream().map(s -> r + "@label" + r + s.id).collect(Collectors.joining(" || "))); + } + roleProgress = "!<>[](" + roleProgress + ")"; + clauses.add(roleProgress);* / + String eventualStability = ""; + for (Role[] p : pairs) + { + //eventualStability += (((eventualStability.isEmpty()) ? "" : " && ") + "empty_" + p[0] + "_" + p[1]); + eventualStability += (((eventualStability.isEmpty()) ? "" : " && ") + "<>empty_" + p[0] + "_" + p[1]); + } + //eventualStability = "[]<>(" + eventualStability + ")"; + eventualStability = "[](" + eventualStability + ")"; // FIXME: current "eventual reception", not eventual stability + clauses.add(eventualStability); + + //int batchSize = 10; // FIXME: factor out + int batchSize = 6; // FIXME: factor out // FIXME: dynamic batch sizing based on previous batch duration? + for (int i = 0; i < clauses.size(); ) + { + int j = (i+batchSize < clauses.size()) ? i+batchSize : clauses.size(); + String batch = clauses.subList(i, j).stream().collect(Collectors.joining(" && ")); + String ltl = "ltl {\n" + batch + "\n" + "}"; + if (core.config.args.get(CoreArgs.VERBOSE)) + { + System.out.println("[-spin] Batched ltl:\n" + ltl + "\n"); + } + if (!GProtocol.runSpin(fullname.toString(), pml + "\n\n" + ltl)) + { + throw new ScribException("Protocol not valid:\n" + gpd); + } + i += batchSize; + } + } + + // TODO:: relocate (also Context.runAut) + public static boolean runSpin(String prefix, String pml) //throws ScribbleException + { + File tmp; + try + { + tmp = File.createTempFile(prefix, ".pml.tmp"); + try + { + String tmpName = tmp.getAbsolutePath(); + ScribUtil.writeToFile(tmpName, pml); + String[] res = ScribUtil.runProcess("spin", "-a", tmpName); + res[0] = res[0].replaceAll("(?m)^ltl.*$", ""); + res[1] = res[1].replace( + "'gcc-4' is not recognized as an internal or external command,\noperable program or batch file.", + ""); + res[1] = res[1].replace( + "'gcc-3' is not recognized as an internal or external command,\noperable program or batch file.", + ""); + res[0] = res[0].trim(); + res[1] = res[1].trim(); + if (!res[0].trim().isEmpty() || !res[1].trim().isEmpty()) + { + //throw new RuntimeException("[scrib] : " + Arrays.toString(res[0].getBytes()) + "\n" + Arrays.toString(res[1].getBytes())); + throw new RuntimeException("[-spin] [spin]: " + res[0] + "\n" + res[1]); + } + int procs = 0; + for (int i = 0; i < pml.length(); procs++) + { + i = pml.indexOf("proctype", i); + if (i == -1) + { + break; + } + i++; + } + int dnfair = (procs <= 6) ? 2 : 3; // FIXME + res = ScribUtil.runProcess("gcc", "-o", "pan", "pan.c", "-DNFAIR=" + dnfair); + res[0] = res[0].trim(); + res[1] = res[1].trim(); + if (!res[0].isEmpty() || !res[1].isEmpty()) + { + throw new RuntimeException("[-spin] [gcc]: " + res[0] + "\n" + res[1]); + } + res = ScribUtil.runProcess("pan", "-a", "-f"); + res[1] = res[1].replace("warning: no accept labels are defined, so option -a has no effect (ignored)", ""); + res[0] = res[0].trim(); + res[1] = res[1].trim(); + if (res[0].contains("error,") || !res[1].isEmpty()) + { + throw new RuntimeException("[-spin] [pan]: " + res[0] + "\n" + res[1]); + } + int err = res[0].indexOf("errors: "); + boolean valid = (res[0].charAt(err + 8) == '0'); + if (!valid) + { + System.err.println("[-spin] [pan] " + res[0] + "\n" + res[1]); + } + return valid; + } + catch (ScribException e) + { + throw new RuntimeException(e); + } + finally + { + tmp.delete(); + } + } + catch (IOException e) + { + throw new RuntimeException(e); + } + } + //*/ \ No newline at end of file diff --git a/scribble-core/src/main/java/org/scribble/core/job/CoreArgs.java b/scribble-core/src/main/java/org/scribble/core/job/CoreArgs.java new file mode 100644 index 000000000..562ab28cb --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/job/CoreArgs.java @@ -0,0 +1,54 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.job; + +public enum CoreArgs +{ + VERBOSE, + FAIR, + SPIN, + NO_VALIDATION, + NO_PROGRESS, // TODO: deprecate + MIN_EFSM, // Currently only affects EFSM output (i.e. -fsm, -dot) and API gen -- doesn't affect model checking + + OLD_WF, // TODO: deprecate + NO_LCHOICE_SUBJ_CHECK, // For debugging only? + NO_ACC_CORRELATION_CHECK, // Currently unused + ; + + /*public final boolean debug; + public final boolean useOldWf; + public final boolean noProgress; // TODO: deprecate + public final boolean minEfsm; // Currently only affects EFSM output (i.e. -fsm, -dot) and API gen -- doesn't affect model checking + public final boolean fair; + public final boolean noLocalChoiceSubjectCheck; + public final boolean noAcceptCorrelationCheck; // Currently unused + public final boolean noValidation; + public final boolean spin; + +//boolean debug, boolean useOldWF, boolean noLiveness, boolean minEfsm, boolean fair, boolean noLocalChoiceSubjectCheck, boolean noAcceptCorrelationCheck, boolean noValidation, boolean spin + public LangArgs(Set args) + { + this.debug = debug; + this.useOldWf = useOldWf; + this.noProgress = noLiveness; + this.minEfsm = minEfsm; + this.fair = fair; + this.noLocalChoiceSubjectCheck = noLocalChoiceSubjectCheck; + this.noAcceptCorrelationCheck = noAcceptCorrelationCheck; + this.noValidation = noValidation; + this.spin = spin; + }*/ + +} diff --git a/scribble-core/src/main/java/org/scribble/core/job/CoreConfig.java b/scribble-core/src/main/java/org/scribble/core/job/CoreConfig.java new file mode 100644 index 000000000..4551274cd --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/job/CoreConfig.java @@ -0,0 +1,44 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.job; + +import java.util.Collections; +import java.util.Map; + +import org.scribble.core.model.ModelFactory; +import org.scribble.core.type.name.ModuleName; +import org.scribble.core.type.session.STypeFactory; +import org.scribble.core.visit.STypeVisitorFactory; + +// The "static" (constant) info for Jobs -- cf. JobContext "dynamic" state +public class CoreConfig +{ + public final ModuleName main; // Full name + public final Map args; // CHECKME: verbose/debug printing parameter ? + + public final STypeFactory tf; + public final STypeVisitorFactory vf; + public final ModelFactory mf; + + // N.B. MainContext is in a different non-visible (by Maven) package + public CoreConfig(ModuleName main, Map args, + STypeFactory tf, STypeVisitorFactory vf, ModelFactory mf) + { + this.main = main; + this.args = Collections.unmodifiableMap(args); + this.tf = tf; + this.vf = vf; + this.mf = mf; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/job/CoreContext.java b/scribble-core/src/main/java/org/scribble/core/job/CoreContext.java new file mode 100644 index 000000000..596b32af4 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/job/CoreContext.java @@ -0,0 +1,386 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.job; + +import java.io.File; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +import org.scribble.core.lang.global.GProtocol; +import org.scribble.core.lang.local.LProjection; +import org.scribble.core.model.endpoint.AutGraphParser; +import org.scribble.core.model.endpoint.EGraph; +import org.scribble.core.model.endpoint.EState; +import org.scribble.core.model.global.SGraph; +import org.scribble.core.model.global.SGraphBuilder; +import org.scribble.core.type.kind.Global; +import org.scribble.core.type.kind.Local; +import org.scribble.core.type.name.GProtoName; +import org.scribble.core.type.name.LProtoName; +import org.scribble.core.type.name.ProtoName; +import org.scribble.core.type.name.Role; +import org.scribble.core.visit.global.GTypeInliner; +import org.scribble.core.visit.global.GTypeUnfolder; +import org.scribble.core.visit.global.InlinedProjector; +import org.scribble.util.Pair; +import org.scribble.util.ScribException; +import org.scribble.util.ScribUtil; + +// Global "static" context information for a Job -- single instance per Job, should not be shared between Jobs +// Mutable: projections, graphs, etc are added mutably later -- replaceModule also mutable setter -- "users" get this from the Job and expect to setter mutate "in place" +public class CoreContext +{ + private final Core core; + + // Keys are full names + // CHECKME: not currently used by core? -- core fully independent of modules, etc., because full disamb already done? (by imed translation) + //private final Map modcs; + + // "Directly" translated global protos, i.e., separate proto decls without any inlining/unfolding/etc + // Protos retain original decl role list (and args) + // Keys are full names (though GProtocol already includes full name) -- parameterised name mainly tracks back to Do.proto not being "specialised" + private final Map, GProtocol> imeds; + + // N.B. protos have pruned role decls -- CHECKME: prune args? + // Mods are preserved + // Keys are full names + private final Map, GProtocol> inlined = new HashMap<>(); + private final Map, GProtocol> unfs = new HashMap<>(); + + // CHECKME: rename projis? + private final Map, LProjection> iprojs = new HashMap<>(); // Projected from inlined; keys are full names + + // CHECKME: refactor to Job ? + // Projected from intermediates + // N.B. unlike iprojs, initial projections not pruned/fixed at all -- do-arg pruning, do-pruning, ext-choice-subj fixing all done incrementally + // LProtocolName is the full local protocol name (module name is the prefix) // LProtocolName key is LProtocol value fullname (i.e., redundant) + private final Map, LProjection> projs = new HashMap<>(); + // FIXME: choice-subj fixing, do-pruning -- factor out to Job and do there via AstVisitor? -- make testing compare the two sides + // TODO: refactor projection, choice-subj fixing, do-pruning, do-arg fixing, etc. fully to Job (and drop this.projs from here) + + // Built from projected inlined + private final Map, EGraph> fEGraphs = new HashMap<>(); + private final Map, EGraph> uEGraphs = new HashMap<>(); + private final Map, EGraph> mEGraphs = new HashMap<>(); + // Toolchain currently depends on single instance of each graph (state id equality), e.g. cannot re-build or re-minimise, would not be the same graph instance + // FIXME: currently only minimising "fair" graph, need to consider minimisation orthogonally to fairness -- NO: minimising (of fair) is for API gen only, unfair-transform does not use minimisation (regardless of user flag) for WF + + private final Map, SGraph> fSGraphs = new HashMap<>(); + private final Map, SGraph> uSGraphs = new HashMap<>(); + + protected CoreContext(Core core, //Map modcs, + Set imeds) + { + this.core = core; + //this.modcs = Collections.unmodifiableMap(modcs); + this.imeds = imeds.stream() + .collect(Collectors.toMap(x -> x.fullname, x -> x)); + } + + // Used by Core for pass running + // Safer to return names and require user to get the target value by name, to make sure the value is created + public Set> getParsedFullnames() + { + return this.imeds.keySet().stream().collect(Collectors.toSet()); + } + + /*// Pre: getProjectedInlined done for all... -- or directly derive these from the global names? + // N.B. uses this.*i*projs (more "important" than this.projs?) + public Set getProjectedFullnames() + { + return this.iprojs.keySet().stream().collect(Collectors.toSet()); + }*/ + + public GProtocol getIntermediate(ProtoName fullname) + { + return this.imeds.get(fullname); + } + + /*// OK for prevoius CoreContext with more basic getters/setters -- now values created on-demand by individual getters, so a collective getter is less suitable + public Set getIntermediates() + { + return this.imeds.values().stream().collect(Collectors.toSet()); + }*/ + + public GProtocol getInlined(ProtoName fullname) + { + GProtocol inlined = this.inlined.get(fullname); + if (inlined == null) + { + GTypeInliner v = this.core.config.vf.global.GTypeInliner(this.core); // Factor out? + inlined = this.imeds.get(fullname).getInlined(v); // Protocol.getInlined does pruneRecs + addInlined(fullname, inlined); + } + return inlined; + } + + protected void addInlined(ProtoName fullname, GProtocol g) + { + this.inlined.put(fullname, g); + } + + /*// OK for prevoius CoreContext with more basic getters/setters -- now values created on-demand by individual getters, so a collective getter is less suitable + public Set getInlineds() + { + return this.inlined.values().stream().collect(Collectors.toSet()); + }*/ + + public GProtocol getOnceUnfolded(ProtoName fullname) + { + GProtocol unf = this.unfs.get(fullname); + if (unf == null) + { + GTypeUnfolder v = this.core.config.vf.global.GTypeUnfolder(this.core); + unf = this.inlined.get(fullname).unfoldAllOnce(v); // Protocol.getInlined does pruneRecs + addOnceUnfolded(fullname, unf); + } + return unf; + } + + protected void addOnceUnfolded(ProtoName fullname, GProtocol g) + { + this.unfs.put(fullname, g); + } + + // Projected from inlined + public LProjection getProjectedInlined(ProtoName fullname, Role self) + { + LProtoName projFullname = InlinedProjector.getFullProjectionName(fullname, + self); + LProjection iproj = this.iprojs.get(projFullname); + if (iproj == null) + { + iproj = getInlined(fullname).projectInlined(this.core, self); + addProjectedInlined(iproj); + } + return iproj; + } + + /*public LProjection getProjectedInlined(LProtoName fullname) + { + LProjection iproj = this.iprojs.get(fullname); + if (iproj == null) + { + // FIXME: need global inlined to build (reverse derive from fullname?) + throw new RuntimeException("[TODO]: " + fullname); + } + return iproj; + }*/ + + /*// OK for prevoius CoreContext with more basic getters/setters -- now values created on-demand by individual getters, so a collective getter is less suitable + public Map getProjectedInlineds() + { + return Collections.unmodifiableMap(this.iprojs); + } + //*/ + + protected void addProjectedInlined(LProjection iproj) + { + this.iprojs.put(iproj.fullname, iproj); + } + + // Projected from intermediate + // Core gives LProjection -- projection Modules should be by Job + public LProjection getProjection(ProtoName fullname, Role self) + { + LProtoName projFullname = InlinedProjector.getFullProjectionName(fullname, + self); + LProjection proj = this.projs.get(projFullname); + if (proj == null) + { + proj = getIntermediate(fullname).project(this.core, self); + addProjection(proj); + } + return proj; + } + + // Pre: addProjectedInlined (i.e., getProjection(ProtoName, Role)) + public LProjection getProjection(ProtoName fullname) + { + LProjection proj = this.projs.get(fullname); + if (proj == null) + { + // FIXME: need global imed to build (reverse derive from fullname?) + throw new RuntimeException("[TODO]: " + fullname); + } + return proj; + } + + protected void addProjection(LProjection proj) + { + this.projs.put(proj.fullname, proj); + } + + // N.B. mutates this.projected -- used by "fixing" passes + // TODO refactor (overall, into Job) + public void setProjection(LProjection proj) + { + this.projs.put(proj.fullname, proj); + } + + // N.B. graphs built from inlined (not unfolded) + public EGraph getEGraph(ProtoName fullname, Role self) + { + LProtoName projFullname = InlinedProjector.getFullProjectionName(fullname, self); + EGraph graph = this.fEGraphs.get(projFullname); + if (graph == null) + { + LProjection inlined = getProjectedInlined(fullname, self); + graph = inlined.toEGraph(this.core); + addEGraph(inlined.fullname, graph); // inlined.fullname.equals(projFullname) + } + return graph; + } + + protected void addEGraph(ProtoName fullname, EGraph graph) + { + this.fEGraphs.put(fullname, graph); + } + + // Pre: Core.runSyntacticWfPasses + public EGraph getUnfairEGraph(ProtoName fullname, Role role) + { + return getUnfairEGraph( + InlinedProjector.getFullProjectionName(fullname, role)); + } + + // Pre: Core.runSyntacticWfPasses + // Pre: getEGraph(Global, Role) -- currently (CHECKME: revise ?) + public EGraph getUnfairEGraph(ProtoName fullname) + { + EGraph unfair = this.uEGraphs.get(fullname); + if (unfair == null) + { + EGraph fair = this.fEGraphs.get(fullname); // Getting fair EGraph directly by projected fullname (cf. getEGraph(GProtoName, Role)) + if (fair == null) + { + throw new RuntimeException( + "Call getEGraph(Global, Role) before getUnfairEGraph: " + fullname); + // CHECKME: refactor ? + } + Pair p = fair.init.unfairTransform(this.core.config.mf); //.toGraph(); + unfair = new EGraph(p.left, p.right); + addUnfairEGraph(fullname, unfair); + } + return unfair; + } + + protected void addUnfairEGraph(ProtoName fullname, EGraph graph) + { + this.uEGraphs.put(fullname, graph); + } + + public SGraph getSGraph(ProtoName fullname) throws ScribException + { + SGraph graph = this.fSGraphs.get(fullname); + if (graph == null) + { + Map egraphs = getEGraphsForSGraphBuilding(fullname, true); + boolean explicit = this.imeds.get(fullname).isExplicit(); + GProtoName cast = (GProtoName) fullname; // Could also reconstruct if really needed + graph = new SGraphBuilder(this.core).build(egraphs, explicit, cast); + addSGraph(fullname, graph); + } + return graph; + } + + private Map getEGraphsForSGraphBuilding( + ProtoName fullname, boolean fair) throws ScribException + { + Map egraphs = new HashMap<>(); + for (Role self : this.imeds.get(fullname).roles) + { + egraphs.put(self, fair + ? getEGraph(fullname, self) + : getUnfairEGraph(fullname, self)); + } + return egraphs; + } + + protected void addSGraph(ProtoName fullname, SGraph graph) + { + this.fSGraphs.put(fullname, graph); + } + + public SGraph getUnfairSGraph(ProtoName fullname) throws ScribException + { + SGraph graph = this.uSGraphs.get(fullname); + if (graph == null) + { + Map egraphs = getEGraphsForSGraphBuilding(fullname, false); + boolean explicit = this.imeds.get(fullname).isExplicit(); + GProtoName cast = (GProtoName) fullname; // Could also reconstruct if really needed + graph = new SGraphBuilder(this.core).build(egraphs, explicit, cast); + addUnfairSGraph(fullname, graph); + } + return graph; + } + + protected void addUnfairSGraph(ProtoName fullname, SGraph graph) + { + this.uSGraphs.put(fullname, graph); + } + + public EGraph getMinimisedEGraph(ProtoName fullname, Role role) + throws ScribException + { + LProtoName fulllpn = InlinedProjector.getFullProjectionName(fullname, role); + + EGraph minimised = this.mEGraphs.get(fulllpn); + if (minimised == null) + { + String aut = runAut(getEGraph(fullname, role).init.toAut(), + fulllpn + ".aut"); + minimised = new AutGraphParser(this.core).parse(aut); + addMinimisedEGraph(fulllpn, minimised); + } + return minimised; + } + + protected void addMinimisedEGraph(ProtoName fullname, EGraph graph) + { + this.mEGraphs.put(fullname, graph); + } + + // TODO: relocate + // Duplicated from CommandLine.runDot -- TODO: update to use createTmpFile (cf. runDot) + // Minimises the FSM up to bisimulation + // N.B. ltsconvert will typically re-number the states + private static String runAut(String fsm, String aut) throws ScribException + { + String tmpName = aut + ".tmp"; + File tmp = new File(tmpName); + if (tmp.exists()) // Factor out with CommandLine.runDot (file exists check) + { + throw new RuntimeException("Cannot overwrite: " + tmpName); + } + try + { + ScribUtil.writeToFile(tmpName, fsm); + String[] res = ScribUtil.runProcess("ltsconvert", "-ebisim", "-iaut", + "-oaut", tmpName); + if (!res[1].isEmpty()) + { + throw new RuntimeException(res[1]); + } + return res[0]; + } + finally + { + tmp.delete(); + } + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/job/Todo.java b/scribble-core/src/main/java/org/scribble/core/job/Todo.java new file mode 100644 index 000000000..54f105e3d --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/job/Todo.java @@ -0,0 +1,181 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.job; + + +// FIXME: project modifiers? + + +// Generally: need framework to correlate source AST nodes to canonical/inlined/unfolded representations, so that analyses can do done on representations and corresponding transformations applied on the AST +// e.g. keep a point to the corresponding original AST node in the cloned AST being visited +// via del may be good -- ASTs are always cloned, but same del can be inherited + + +//.. consider a "less expressive" version of subprotocol declaration that does not allow same rec labels for "non-compatible" states after inlining/unfolding (not sure how to compute though) +// -- i.e. limit subprotocols to corresponds to standard rec-continue structure +// -- this is a limitation of relying on protocol name + role arg config as ("unique") state identifiers +// -- No? recursive subprotocols should inherently be same as standard rec-continue? -- maybe non-unfiorm rec naming scheme is fine (use inner most?), and just graph building is wrong? +// -- FIXED: was a graph building problem + + +//.. Global model WF +// +//.. analyse inlined unfolded for max buffer size -- no: one-slot buffer seems sufficient, given located choice +//.. add term branches for infinite loops (termination hack), for checking mixed finite and infinite role behaviours (see Test.scr **TERM) +//.. don't need termination hack, just need to cut off state building on bad states -- no: it's needed (buffered message may be blocked now but valid later), or a terminal set analysis +//.. choice subject enabling needed for non-mixed states (inherently relevant to deadlock) -- although for one-slot asynchrony to work, it's just the A->B constructor: there's always syntactically at least one receiver, and any potential deadlock between parallel senders due to bounded buffer will be caught as the counterpart paralel receiver deadlock +//.. check role-based starvation/liveness (loop hack) -- no: terminal set analysis +//.. refactor orphans as generalised message liveness? though orphans are more natural as a termination/deadlock property? +//.. reconsider liveness loop hack (subsumes safety?) +//.. +//.. "introduces" should just work (dynamically add/remove buffer structures) -- no: that's connectedness, introduces on top? (should still be a finite state space extension) +//.. +//.. multicast: generalise model actions -- but how about asynchrony? introduce output buffers? -- output/input buffer intuition for "single-step" asynchrony +//.. +//.. model checked assertion annotations -- and API gen +// +//.. global model actions +//.. error state traces (and error process system) +//.. check junit harness and unit tests, add new tests +//.. CL ouput even if ScribbleException +//.. option to return all errors or just the first +// +//.. integrate reachability check and graph building? or move reachability earlier? EFSM building now done before reachability pass +// +//.. move connectedness checks into model checking, rather than syntactic + + +// FIXME: ambiguous choice subject (i.e. > 1 candidate) is checked subsequently by ProjectedChoiceSubjectFixer -- should be better integrated (e.g. reuse ChoiceUnguardedSubprotocolChecker, rather than adhoc LInteractionNode.inferLocalChoiceSubject) -- NOTE: but cannot do all pruning and fixing in one pass, as fixing the subject roles here will interfere with the pruning algorithm (currently it looks for dummy role choices) +//.. "semantic" test suite: e.g. looking for duplicate tests by global model +//.. subcategorise tests by number of roles + + +/* +.. disallow self comm +.. check role decl used +.. test mvn install +.. fix script +.. individual test ignores (cf. whole directory) -- good for package testing + +.. unguarded choice-rec in conjunction with unguarded continue needs to be ruled out in WF or fixed in FSM generation +*/ + + // FIXME: refactor EnvVisitors merge/compose routines -- check enter/leave merging isn't duplicating parent info (e.g. path visiting, recursion has to clear Env so child paths don't start with parent prefixes) + + // default G/LNode getKind methods won't work properly until Eclipse updated with fix, cf. G/LInteractionSeq + + // FIXME: protocoldecl header to check used roles (so projection roledecl filtering doesn't give empty roledecllist -- relax to check only that at least 1 or 2 roles are used?) -- should be checked wrt. role occurrences obtained from subprotocol visiting + // FIXME: parameter checking along with roles? + // FIXME: check do-call argument kinding (sig/type args/params), arity, etc + // bound qualified sig/type names (disambiguation check of qualified names, not just ambiguous) + // duplicate protocol/role decls etc + //.. do call type checking as well as basic name binding + // name collisions? e.g. message sig names and ops (M1 and M1() -- maybe ok) -- is rec var shadowing ok? (currently inconsistent to disallow due to shadowed recs in subprotocols and NameDisambiguator is not an inlined or subprotocol visitor) + + //.. guarded recursive subprotocols -- guarded recursion vars not needed? handled by projection -- subprotocols need unused roledecl check + //.. generalise dependencies for duplicate-role projection + //.. do projection should filter unused subprotocol role params -- also non role params? -- but scoped subprotocols may need extra name mangling + + // pointer equality for testing if AST subtrees already visited in e.g. InlinedWFChoiceChecker (and thus UnfoldingVisitor) maybe not good + // move roledecllist etc projection to dels + // could parameterise recvar to be global/local + + // self comm (wf, projection) + // multicast (enforce sending same value -- can "compile" to assertions for separate ops) + // TODO: deadlock analysis: for parallel, and even just choice if one process will play multiple roles (e.g. choice at A { A->B; A->C } or { A->C; A->B }) -- separate par from unordered + // FIXME: api generation for parallel/interruptible -- branch needs to report on op and role (depending on input queue semantics) + // api gen: explicit end for implicit skipping tail inputs but without failing the sender due to closing the transport -- actually, disable async for term-leading states? -- or perhaps implicit in using-close + //.. FIXME: singleton constants in subpackages, constant references from session class -- work out scrib package/module correspondence with java package/classes + + //.. fix projection env to take projection output type as Parameter + // dels should be kinded as well? -- maybe by node type? or too restrictive + + // some import/package name issues aren't tested in test suite because never in root package (issues when full and simple name coincide) + // roldedecl used validation only checked for global; projection runs roledecl fixing after role collection (although check should be redundant after projection roledecl fixing?) -- maybe separate roledecl validation to follow after context building + + // Inconsistencies? some visitOverride methods override base visit (i.e. including enter/exit) while others just override the visitChildren part + // also: sometimes super.visit is used, other times child.accept(this), etc + + //.. factor out main module resource loading in front end from main context -- front end should take main argument, check existence, and pass MainContext the abstract resource identifier to load the main + //.. ^^ alternatively keep ResourceLocator specific to file systems -- "DirectoryResourceLocator" just uses the import paths + +// Done +//.. gchoice use Collections.disjoint (not retain) +//.. add headerparamdecllist and rolearglist disamb tests +//.. public reconstructs; copy del assignment; remove unnecessary wildcard bounds (and sort out mixed collections under wildcards? -- where it runtime type checking gets involved) -- done: but chosen no to copy del assignment +//.. refactor inlined/unfolding visitor and del names +//.. make headerparamdecl into paramdecl directly, i.e. and then role is a specialised param kind -- headerparamdecl is super of role and nonrole decls +//.. get simple/compound name node and name classes into shape -- done: factored out base classes uniform with ast hierarchy, and using default methods for shared simple/compound behaviours +//.. fix del parameterized return type (take class as arg) -- maybe also copy -- done: generic node casts after visiting, generic env push/pop, protected shallow copy pattern +//.. remove scoped subprotocols for now +//.. consider refactoring all uses of AbstractProtocolDecl to be able to get global/local directly (would need global/local as a generic parameter) -- e.g. Do.getTargetProtocolDecl -- partly: using global/local kinds, don't need extra interface along with abstract protocoldecl class +// - streamline visitor pattern calls (e.g. accept) -- done: using total/partial (enter/leave) visit override patterns to customise e.g. subprotocol and projection visiting +// - visitor pattern, delegates, envs (root, creating and assigning, merging, super calls), subprotocol visiting -- done: sorted visitor hierarchy, added inlined/unfolded visiting, swapped env/subprotocol visitor positions, factored out offsetsubprotocolvisitor +// - streamline vistitor/del env references -- and del enter/leave env setter on visitors -- done: sorted out del immutability except for envs, visitor env generic parameter, and env generic parameter +//.. fix ReachabilityEnv merge; do enter/leave reachability check for recursion/continue/parallel/etc; check reachability pass visits all projected modules -- reachability checking now done on unfolded inlined protocols +//.. fix modelfactory simple name node parameterization (take class instead of enum) +//.. fix global/local do delegate context build loop -- use lambda +//.. AntlrNonRoleParamDeclList -- generic typing error -- generally fix nonroleparam decl/list/... -- fixed: cast justified by immutable ast nodes -- related generic typing (mixed colection types under a wildcard) +//.. fix parameterdecllist generics (not fixed to one kind) -- done: using base non-role parameter kind as the "concrete kind" (see above) +//.. both projector and graphbuilder are env visitors but not subprotocol visitors now, so swap visitor hierarchy? +//.. added unfolded visitor -- for: wf-c should in some cases attempt an unfolding on reaching a continue if not satisfied yet -- or do by "recording" cache for recs, as for subprotocolsigs +//.. added unfolded visitor -- for: changed fsmbuilder from offsetsubprot visitor to inlined visitor to reduce state label accumulation to rec only -- but this introduces a problem in wfc-checking for "unguarded" recursive-do-as-continue in choice blocks -- current offset visitor is also hacked to follow up just "1 level" +//.. projection as subprotocol visitor (or maybe by some other hack, e.g. check each gdo for special cases) to handle repeat role args e.g. do(A, B, A) -- done: by factoring out role occurrences into context info and adding another projection pass +//.. need public deep clone methods to support syntax manipulations e.g. unfolding (if using pointer equality for ast nodes in the same syntactic position, not just same text value) +//.. public reconstructs -- was previously using public-ified reconstruct of just interactionseq and recursion to do cloning for unfolding -- not a deep clone though, e.g. interaction seq reuses original block -- need to make sure dels/envs being treated properly +//.. factor out global/local inlining/unfolding better +//.. factor out some global/local del routines from compound/simple classes using default interface methods +//.. relax strictclasscheck visits -- partly: in just the places where nodes are currently expected to change (ambiguousnamenode, interactionseq, continue for unfolding) -- visitchildren shouldn't use check class on visited nodes so strictly, e.g. name disambiguation changes ambignodes to other nodes +//.. make all protected ast node fields private? make all field accesses by getters? -- partly: made all the mutable collection fields private +//.. tidy up inlinedwfchoice check in gchoicedel +//.. fix ldodel projection role fix gproto name hack -- Lprojectiondecl subclass records source gprotocol (and self role) +//.. role filtering for protocoldecl/do-projection in 2nd projection pass +//.. refactor global/local simple/compound dels +//.. refactor jobs (inlining/unfolding) +//.. offset/subprotocol visitor factoring +// - separate protocol names into global/local -- use generic parameter for name kinds rather than subclasses +// - wf-choice: a role should be enabled by the same role in all blocks +// - get rid of argument instantiation -- renamed, but otherwise structurally the same (unlike name/param decls, arg nodes are not kinded) +// - refactor simple/compound names to just names; and simple name nodes to be subtypes of compound -- simple/compound distinction only relevant to name nodes (i.e. syntax); type names are all uniform (compound) +// - generalise dependency building to support local protocols -- though only global dependencies used so far, for projection +// - make module/protocol delegate state (module context, protocol dependencies) setting uniform -- related to (non-)immutablity of delegates (where to store "context" state) +// - remove job/module contexts from Envs (refer from visitor -- can be updated during visitor pass and reassigned to root module on leave) +// - enter doesn't need to return visitor, not using visitor immutability? (or visitor replacement flexibility) +// - use Path API (though path separators not taken from nio api) +// - import path should be a CL parameter, not MainContext + +// ? - fix projected choice subj fixing for (single?) continue-only block +// ? - generalise recursion projection filtering +// ? - check projection/merge of role-subset recursion paths, and projection of non-relevant choice blocks + + +// Not done +//.. maybe make an UnkindedName superclass of Name, use for e.g. parameters or ambiguous -- parameters and ambiguous have their own kinds +// - perhaps refactor to have choice/recursion/etc as packages with global/local/del/etc in each -- no: going with kind generic parameter factoring instead +// - ArgumentNode is not kinded -- argument interface is about not knowing what kind of argument it is; e.g. AmbiguousNameNode has both DataType and Sig kind interfaces +// - FIXME: factor out a project method (like a reconstruct) to GlobalModelNode (and use the below for recording/assembling the projections) -- no, leave in delegate +// - change InteractionNode interface to a base class -- no, better for interaction nodes to extend simple/compound as base +// - make a createDelegate method in ModelNode -- no, leave association of delegates to model nodes in factory -- then replacing a delegate requires changing the factory only +// - substitute to delegate? -- no, better to have as a simple node operation that uses the protected reconstruct pattern directly (a del operation is more indirect with no advantages) +// - fix instanceof in projector and reachability checker -- only partly: moved main code to delegates but the "root" instanceof needs to stay inside the visitors to "override" the base subprotocol visitInSubprotocols pattern +// - override del in each ModelNode to cast -- no: leave as base del for most flexibility in case of replacement +// - Job takes MainContext as argument -- no: recursive maven dependencies between cli-core-parser + +public class Todo +{ + public Todo() + { + + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/lang/Constants.java b/scribble-core/src/main/java/org/scribble/core/lang/Constants.java new file mode 100644 index 000000000..59494288f --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/lang/Constants.java @@ -0,0 +1,25 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.lang; + +@Deprecated +public class Constants +{ + + public Constants() + { + // TODO Auto-generated constructor stub + } + +} diff --git a/scribble-core/src/main/java/org/scribble/core/lang/ProtoMod.java b/scribble-core/src/main/java/org/scribble/core/lang/ProtoMod.java new file mode 100644 index 000000000..ac251d7fe --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/lang/ProtoMod.java @@ -0,0 +1,55 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.lang; + +public enum ProtoMod +{ + AUX, + EXPLICIT; + + @Override + public String toString() + { + switch (this) + { + case AUX: return "aux"; + case EXPLICIT: return "explicit"; + default: throw new RuntimeException("Unknown modifier: " + this); + } + } +} + + + + + + + + + + + + + + + /*// TODO: refactor to scrib-lang -- param should be ProtocolMod, not CommonTree + public static ProtocolMod fromAst(CommonTree ast)//org.scribble.ast.ProtocolMod ast) + { + switch (ast.toString()) + { + case "aux": return AUX; + case "explicit": return EXPLICIT; + default: throw new RuntimeException("Unknown modifier: " + ast); + } + }*/ \ No newline at end of file diff --git a/scribble-core/src/main/java/org/scribble/core/lang/Protocol.java b/scribble-core/src/main/java/org/scribble/core/lang/Protocol.java new file mode 100644 index 000000000..a35db0824 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/lang/Protocol.java @@ -0,0 +1,163 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.lang; + +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +import org.antlr.runtime.tree.CommonTree; +import org.scribble.core.type.kind.NonRoleParamKind; +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.core.type.name.DataName; +import org.scribble.core.type.name.MemberName; +import org.scribble.core.type.name.ProtoName; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.name.SigName; +import org.scribble.core.type.session.Seq; +import org.scribble.core.visit.STypeInliner; +import org.scribble.core.visit.STypeUnfolder; +import org.scribble.util.Constants; + +public abstract class Protocol + , B extends Seq> + implements SNode +{ + private final CommonTree source; // CHECKME: factor out with SType(Base) ? + + public final List mods; + public final N fullname; + public final List roles; // Ordered role params; pre: size >= 2 + public final List> params; + // N.B. there is no Data/SigParamName // CHECKME: always simple names? + // NonRoleParamKind, not NonRoleArgKind, because latter includes AmbigKind due to parsing requirements + // CHECKME: make a ParamName? or at least SimpleName? + public final B def; + + public Protocol(CommonTree source, List mods, N fullname, + List roles, List> params, + B def) + { + this.source = source; // CHECKME: factor out with SType(Base) ? + this.mods = Collections.unmodifiableList(mods); + this.fullname = fullname; + this.roles = Collections.unmodifiableList(roles); + this.params = Collections.unmodifiableList(params); + this.def = def; + } + + // N.B. LProtocol has an additional "self" field, reconstruct pattern not perfect + public abstract Protocol reconstruct(CommonTree source, + List mods, N fullname, List roles, + List> params, B def); + + public boolean isAux() + { + return this.mods.contains(ProtoMod.AUX); + } + + public boolean isExplicit() + { + return this.mods.contains(ProtoMod.EXPLICIT); + } + + public abstract Protocol getInlined(STypeInliner v); + public abstract Protocol unfoldAllOnce(STypeUnfolder v); + + public boolean hasSource() // i.e., was parsed + { + return this.source != null; + } + + // CHECKME: factor out with SType(Base) ? + public CommonTree getSource() // Pre: hasSource + { + return this.source; + } + + @Override + public String toString() + { + return "protocol " + this.fullname.getSimpleName() + + paramsToString() + + rolesToString() + + " {\n" + this.def + "\n}"; + } + + protected String rolesToString() + { + return "(" + + this.roles.stream().map(x -> Constants.ROLE_KW + " " + x.toString()) + .collect(Collectors.joining(", ")) + + ")"; + } + + protected String paramsToString() + { + return "<" + this.params.stream() // CHECKME: drop empty "<>" ? + .map(x -> + { + String k; + if (x instanceof DataName) // CHECKME: refactor? + { + k = Constants.TYPE_KW; + } + else if (x instanceof SigName) + { + k = Constants.SIG_KW; + } + else + { + throw new RuntimeException(); + } + return k + x; + }) + .collect(Collectors.joining(", ")) + + ">"; + } + + // CHECKME: only should/need to use fullname? + @Override + public int hashCode() + { + int hash = 7; + hash = 31 * hash + super.hashCode(); + hash = 31 * hash + this.mods.hashCode(); + hash = 31 * hash + this.fullname.hashCode(); + hash = 31 * hash + this.roles.hashCode(); + hash = 31 * hash + this.params.hashCode(); + hash = 31 * hash + this.def.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof Protocol)) + { + return false; + } + Protocol them = (Protocol) o; + return them.canEquals(this) + && this.mods.equals(them.mods) && this.fullname.equals(them.fullname) + && this.roles.equals(them.roles) && this.params.equals(them.params) + && this.def.equals(them.def); + } + + public abstract boolean canEquals(Object o); +} diff --git a/scribble-core/src/main/java/org/scribble/core/lang/SNode.java b/scribble-core/src/main/java/org/scribble/core/lang/SNode.java new file mode 100644 index 000000000..d0c5cfdec --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/lang/SNode.java @@ -0,0 +1,23 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.lang; + +import org.antlr.runtime.tree.CommonTree; +import org.scribble.core.type.kind.ProtoKind; + +public interface SNode +{ + boolean hasSource(); // i.e., was parsed + CommonTree getSource(); // Pre: hasSource +} diff --git a/scribble-core/src/main/java/org/scribble/core/lang/SubprotoSig.java b/scribble-core/src/main/java/org/scribble/core/lang/SubprotoSig.java new file mode 100644 index 000000000..742920bc0 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/lang/SubprotoSig.java @@ -0,0 +1,127 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.lang; + +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +import org.scribble.core.lang.global.GProtocol; +import org.scribble.core.lang.local.LProtocol; +import org.scribble.core.type.kind.NonRoleParamKind; +import org.scribble.core.type.name.DataName; +import org.scribble.core.type.name.MemberName; +import org.scribble.core.type.name.ProtoName; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.name.SigName; +import org.scribble.core.type.session.Arg; + +// CHECKME: relocate? +// Immutable +public class SubprotoSig +{ + public final ProtoName fullname; + public final List roles; // i.e., roles (and args) are ordered + public final List> args; + // NonRoleParamKind, not NonRoleArgKind, because latter includes AmbigKind due to parsing requirements + // Arg, not MemberName, because need to include MessageSigs (sig literals) + + // CHECKME: refactor as factory methods on Protocol/Do ? + public SubprotoSig(ProtoName fullname, + List roles, List> args) + { + this.fullname = fullname; + this.roles = Collections.unmodifiableList(roles); + this.args = Collections.unmodifiableList(args); + } + + public SubprotoSig(GProtocol n) + { + this(n.fullname, n.roles, paramsToArgs(n.params)); + } + + public SubprotoSig(LProtocol n) + { + this(n.fullname, n.roles.stream().map(x -> x.equals(n.self) ? Role.SELF : x) + // N.B. role decls (cf. do-args) don't feature self (cf. LSelfDecl), even after pruning/fixing + // FIXME: (implicit) self role mess + .collect(Collectors.toList()), paramsToArgs(n.params)); + } + + private static List> paramsToArgs( + List> params) + { + // Convert MemberName params to Args -- cf. NonRoleArgList::getParamKindArgs + return params.stream().map(x -> paramToArg(x)).collect(Collectors.toList()); + } + + // TODO: refactor, into params? + public static Arg paramToArg( + MemberName n) // Omit " extends NonRoleParamKind" on param, more flexible without major harm + { + if (n instanceof DataName) + { + return (DataName) n; + } + else if (n instanceof SigName) + { + return (SigName) n; + } + else + { + throw new RuntimeException("[TODO] : " + n.getClass() + "\n\t" + n); + } + } + + @Override + public int hashCode() + { + int hash = 1093; + hash = 31 * hash + this.fullname.hashCode(); + hash = 31 * hash + this.roles.hashCode(); + hash = 31 * hash + this.args.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof SubprotoSig)) + { + return false; + } + SubprotoSig subsig = (SubprotoSig) o; + return this.fullname.equals(subsig.fullname) + && this.roles.equals(subsig.roles) && this.args.equals(subsig.args); + } + + @Override + public String toString() + { + return + this.fullname + + "<" + + this.args.stream().map(x -> x.toString()) + .collect(Collectors.joining(", ")) + + ">" + + "(" + + this.roles.stream().map(x -> x.toString()) + .collect(Collectors.joining(", ")) + + ")"; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/lang/context/ModuleContext.java b/scribble-core/src/main/java/org/scribble/core/lang/context/ModuleContext.java new file mode 100644 index 000000000..7aa3db298 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/lang/context/ModuleContext.java @@ -0,0 +1,140 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.lang.context; + +import java.util.Map; + +import org.scribble.core.type.kind.Global; +import org.scribble.core.type.kind.Kind; +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.core.type.kind.SigKind; +import org.scribble.core.type.name.DataName; +import org.scribble.core.type.name.GProtoName; +import org.scribble.core.type.name.LProtoName; +import org.scribble.core.type.name.SigName; +import org.scribble.core.type.name.ModuleName; +import org.scribble.core.type.name.Name; +import org.scribble.core.type.name.ProtoName; +import org.scribble.util.ScribException; + +// Context information specific to each module as a root (wrt. to visitor passes) +// CHECKME: currently unused within core -- refactor out to lang package? +public class ModuleContext +{ + public final ModuleName root; // full name // The root Module for this ModuleContext -- cf. separate to the "main" module + + // All transitive name dependencies of this module: all names fully qualified + // The ScribNames maps are basically just used as sets (identity map) + // Cf. ProtocolDeclContext protocol dependencies from protocoldecl as root + private final ScribNames deps; + + // The modules and member names that are visible from this Module -- mapped to "cannonical" (fully qualified) names + // visible names -> fully qualified names + // Directly visible names from this module + private final ScribNames visible; + + // Made by ModuleContextBuilder + // ModuleContext is the root context + public ModuleContext(ModuleName root, ScribNames deps, ScribNames visible) + throws ScribException + { + this.root = root; + this.deps = deps; + this.visible = visible; + } + + /*public boolean isDataTypeDependency(DataType typename) + { + return this.deps.data.keySet().contains(typename); + } + + public boolean isMessageSigNameDependency(Name signame) + { + return this.deps.sigs.containsKey(signame); + }*/ + + // TODO: deprecate -- now redundant: proto should already be full name by namedisamb (and this.deps only stores full names) + // Refactored as a "check" for now (although still redundant, not actually checking anything) + public ProtoName checkProtocolDeclDependencyFullName( + ProtoName proto) + { + return getProtocolDeclFullName(this.deps, proto); + } + + public boolean isDataTypeVisible(DataName typename) + { + return this.visible.data.keySet().contains(typename); + } + + public boolean isMessageSigNameVisible(Name signame) + { + return this.visible.sigs.containsKey(signame); + } + + public DataName getVisibleDataTypeFullName(DataName visname) + { + return getFullName(this.visible.data, visname); + } + + public boolean isVisibleDataType(DataName visname) + { + return this.visible.isVisibleDataType(visname); + } + + public SigName getVisibleMessageSigNameFullName(SigName visname) + { + return getFullName(this.visible.sigs, visname); + } + + public ProtoName getVisibleProtocolDeclFullName( + ProtoName visname) + { + return getProtocolDeclFullName(this.visible, visname); + } + + public boolean isVisibleProtocolDeclName( + ProtoName visname) + { + return this.visible.isVisibleProtocolDeclName(visname); + } + + public static ProtoName getProtocolDeclFullName( + ScribNames names, ProtoName proto) + { + ProtoName pn = (proto.getKind() + .equals(Global.KIND)) + ? getFullName(names.globals, (GProtoName) proto) + : getFullName(names.locals, (LProtoName) proto); + @SuppressWarnings("unchecked") + ProtoName tmp = (ProtoName) pn; + return tmp; + } + + private static , K extends Kind> T getFullName( + Map map, T visname) + { + if (!map.containsKey(visname)) + { + // FIXME: runtime exception bad -- make a guard method + throw new RuntimeException("Unknown name: " + visname); + } + return map.get(visname); + } + + @Override + public String toString() + { + return "[deps=" + this.deps + ", visible=" + this.visible + "]"; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/lang/context/ScribNames.java b/scribble-core/src/main/java/org/scribble/core/lang/context/ScribNames.java new file mode 100644 index 000000000..247cacfd2 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/lang/context/ScribNames.java @@ -0,0 +1,56 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.lang.context; + +import java.util.HashMap; +import java.util.Map; + +import org.scribble.core.type.name.DataName; +import org.scribble.core.type.name.GProtoName; +import org.scribble.core.type.name.LProtoName; +import org.scribble.core.type.name.SigName; +import org.scribble.core.type.name.ModuleName; +import org.scribble.core.type.name.ProtoName; + +// TODO: fix mutable public collection fields -- currently hacked for ModuleContext(Collector) internal use +// TODO: rename better +public class ScribNames +{ + // names -> fully qualified names + public final Map modules = new HashMap<>(); + public final Map data = new HashMap<>(); + public final Map sigs = new HashMap<>(); + public final Map globals = new HashMap<>(); + public final Map locals = new HashMap<>(); + + @Override + public String toString() + { + return "(modules=" + + this.modules + ", types=" + this.data + ", sigs=" + this.sigs + + ", globals=" + this.globals + ", locals=" + this.locals + + ")"; + } + + public boolean isVisibleProtocolDeclName(ProtoName visname) + { + return this.globals.containsKey(visname) + || this.locals.containsKey(visname); + } + + public boolean isVisibleDataType(DataName visname) + { + return this.data.containsKey(visname); + } +} \ No newline at end of file diff --git a/scribble-core/src/main/java/org/scribble/core/lang/global/GNode.java b/scribble-core/src/main/java/org/scribble/core/lang/global/GNode.java new file mode 100644 index 000000000..06ff9a5eb --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/lang/global/GNode.java @@ -0,0 +1,23 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.lang.global; + +import org.scribble.core.lang.SNode; +import org.scribble.core.type.kind.Global; + +// Mainly for GDel.translate return (to include GProtocol) +public interface GNode extends SNode +{ + +} diff --git a/scribble-core/src/main/java/org/scribble/core/lang/global/GProtocol.java b/scribble-core/src/main/java/org/scribble/core/lang/global/GProtocol.java new file mode 100644 index 000000000..38ba23faf --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/lang/global/GProtocol.java @@ -0,0 +1,205 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.lang.global; + +import java.util.Arrays; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +import org.antlr.runtime.tree.CommonTree; +import org.scribble.core.job.Core; +import org.scribble.core.lang.Protocol; +import org.scribble.core.lang.ProtoMod; +import org.scribble.core.lang.SubprotoSig; +import org.scribble.core.lang.local.LProjection; +import org.scribble.core.type.kind.Global; +import org.scribble.core.type.kind.Local; +import org.scribble.core.type.kind.NonRoleParamKind; +import org.scribble.core.type.name.GProtoName; +import org.scribble.core.type.name.LProtoName; +import org.scribble.core.type.name.MemberName; +import org.scribble.core.type.name.RecVar; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.global.GRecursion; +import org.scribble.core.type.session.global.GSeq; +import org.scribble.core.type.session.local.LSeq; +import org.scribble.core.visit.STypeInliner; +import org.scribble.core.visit.STypeUnfolder; +import org.scribble.core.visit.Substitutor; +import org.scribble.core.visit.gather.RoleGatherer; +import org.scribble.core.visit.global.ConnectionChecker; +import org.scribble.core.visit.global.ExtChoiceConsistencyChecker; +import org.scribble.core.visit.global.InlinedProjector; +import org.scribble.core.visit.global.RoleEnablingChecker; +import org.scribble.util.ScribException; + +public class GProtocol extends Protocol + implements GNode // Mainly for GDel.translate return (to include GProtocol) +{ + public GProtocol(CommonTree source, List mods, + GProtoName fullname, List roles, + List> params, GSeq def) + { + super(source, mods, fullname, roles, params, def); + } + + @Override + public GProtocol reconstruct(CommonTree source, + List mods, GProtoName fullname, List roles, + List> params, GSeq def) + { + return new GProtocol(source, mods, fullname, roles, params, def); + } + + // Cf. (e.g.) checkRoleEnabling, that takes Core + // CHECKME: drop from Protocol (after removing Protocol from SType?) + // Pre: stack.peek is the sig for the calling Do (or top-level entry), i.e., it gives the roles/args at the call-site + @Override + public GProtocol getInlined(STypeInliner v) + { + SubprotoSig sig = new SubprotoSig(this); + v.pushSig(sig); + + Substitutor subs = v.core.config.vf.Substitutor(this.roles, sig.roles, + this.params, sig.args); + GSeq inlined = v.visitSeq(subs.visitSeq(this.def)); + RecVar rv = v.getInlinedRecVar(sig); + GRecursion rec = v.core.config.tf.global.GRecursion(null, rv, inlined); // CHECKME: or protodecl source? + GSeq seq = v.core.config.tf.global.GSeq(null, Arrays.asList(rec)); + GSeq def = v.core.config.vf.RecPruner().visitSeq(seq); + Set used = def.gather(new RoleGatherer()::visit) + .collect(Collectors.toSet()); + List rs = this.roles.stream().filter(x -> used.contains(x)) // Prune role decls -- CHECKME: what is an example? was this from before unused role checking? + .collect(Collectors.toList()); + return //new GProtocol + reconstruct(getSource(), this.mods, this.fullname, rs, + this.params, def); + } + + @Override + public GProtocol unfoldAllOnce(STypeUnfolder v) + { + GSeq unf = v.visitSeq(this.def); + return reconstruct(getSource(), this.mods, this.fullname, this.roles, + this.params, unf); + } + + // Cf. (e.g.) getInlined, that takes the Visitor (not Core) + public void checkRoleEnabling(Core core) throws ScribException + { + Set rs = this.roles.stream().collect(Collectors.toSet()); + RoleEnablingChecker v = core.config.vf.global.RoleEnablingChecker(rs); + this.def.visitWith(v); + } + + public void checkExtChoiceConsistency(Core core) throws ScribException + { + Map rs = this.roles.stream() + .collect(Collectors.toMap(x -> x, x -> x)); + ExtChoiceConsistencyChecker v = core.config.vf.global + .ExtChoiceConsistencyChecker(rs); + this.def.visitWith(v); + } + + public void checkConnectedness(Core core, boolean implicit) + throws ScribException + { + Set rs = this.roles.stream().collect(Collectors.toSet()); + ConnectionChecker v = core.config.vf.global.ConnectionChecker(rs, implicit); + this.def.visitWith(v); + } + + // Currently assuming inlining (or at least "disjoint" protodecl projection, without role fixing) + public LProjection projectInlined(Core core, Role self) + { + LSeq def = core.config.vf.global.InlinedProjector(core, self) + .visitSeq(this.def); + LSeq fixed = core.config.vf.local.InlinedExtChoiceSubjFixer().visitSeq(def); + return projectAux(core, self, this.roles, fixed); + } + + // Does rec and role pruning + private LProjection projectAux(Core core, Role self, List decls, + LSeq def) + { + LSeq pruned = core.config.vf.RecPruner().visitSeq(def); + LProtoName fullname = InlinedProjector + .getFullProjectionName(this.fullname, self); + Set used = pruned.gather(new RoleGatherer()::visit) + .collect(Collectors.toSet()); + List roles = decls.stream() + .filter(x -> x.equals(self) || used.contains(x)) + .collect(Collectors.toList()); + List> params = + new LinkedList<>(this.params); // CHECKME: filter params by usage? + return new LProjection(this.mods, fullname, roles, self, params, + this.fullname, pruned); // CHECKME: add/do via tf? + } + + // N.B. no "fixing" passes done here -- need breadth-first passes to be sequentialised for subproto visiting + public LProjection project(Core core, Role self) + { + LSeq def = core.config.vf.global.Projector(core, self).visitSeq(this.def); + // N.B. not using projectAux, because don't want to prune role decls using RoleGatherer: it doesn't follow subprotos, so can over-prune roledecls (e.g., bad.efsm.grecursion.unfair.Test06, C) + // Instead, retain full global role decls for now -- and prune later, via LDoArgPruner + LSeq pruned = core.config.vf.RecPruner().visitSeq(def); + LProtoName fullname = InlinedProjector + .getFullProjectionName(this.fullname, self); + List> params = + new LinkedList<>(this.params); // CHECKME: filter params by usage? + // N.B. also not using PreRoleCollector here for role decl pruning (cf. LRoleDeclAndDoArgPruner), "initial" projection pass not complete yet, so cannot traverse all needed subprotos + LProjection proj = new LProjection(this.mods, fullname, this.roles, self, + params, this.fullname, pruned); + // TODO: fully refactor ext choice subj fixing, do pruning, etc to Job and use AstVisitor? + return proj; + } + + @Override + public String toString() + { + return this.mods.stream().map(x -> x.toString() + " ") + .collect(Collectors.joining()) + "global " + super.toString(); + } + + @Override + public int hashCode() + { + int hash = 11; + hash = 31 * hash + super.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof GProtocol)) + { + return false; + } + return super.equals(o); // Does canEquals + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof GProtocol; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/lang/local/LNode.java b/scribble-core/src/main/java/org/scribble/core/lang/local/LNode.java new file mode 100644 index 000000000..33164fe2f --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/lang/local/LNode.java @@ -0,0 +1,22 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.lang.local; + +import org.scribble.core.lang.SNode; +import org.scribble.core.type.kind.Local; + +public interface LNode extends SNode +{ + +} diff --git a/scribble-core/src/main/java/org/scribble/core/lang/local/LProjection.java b/scribble-core/src/main/java/org/scribble/core/lang/local/LProjection.java new file mode 100644 index 000000000..18c5c5122 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/lang/local/LProjection.java @@ -0,0 +1,115 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.lang.local; + +import java.util.List; +import java.util.stream.Collectors; + +import org.antlr.runtime.tree.CommonTree; +import org.scribble.core.lang.ProtoMod; +import org.scribble.core.type.kind.Local; +import org.scribble.core.type.kind.NonRoleParamKind; +import org.scribble.core.type.name.GProtoName; +import org.scribble.core.type.name.LProtoName; +import org.scribble.core.type.name.MemberName; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.local.LSeq; +import org.scribble.core.visit.STypeInliner; + +public class LProjection extends LProtocol +{ + public final GProtoName global; + + public LProjection(List mods, LProtoName fullname, + List roles, Role self, + List> params, GProtoName global, + LSeq body) + { + super(null, mods, fullname, roles, self, params, body); + this.global = global; + } + + @Override + public LProjection reconstruct(CommonTree source, + List mods, LProtoName fullname, List roles, + Role self, List> params, LSeq body) + { + return new LProjection(mods, fullname, roles, this.self, params, + this.global, body); + } + + /*@Override + public LType substitute(Substitutions subs) + { + *List roles = this.roles.stream().map(x -> subs.subsRole(x)) + .collect(Collectors.toList()); + return reconstruct(getSource(), this.mods, this.fullname, roles, + this.def.substitute(subs)); + }*/ + + // Pre: stack.peek is the sig for the calling Do (or top-level entry) + // i.e., it gives the roles/args at the call-site + @Override + public LProjection getInlined(STypeInliner v) + { + throw new RuntimeException("[TODO]: " + this); + } + + /*@Override + public LProtocolDecl getSource() + { + return (LProtocolDecl) super.getSource(); + }*/ + + @Override + public String toString() + { + return this.mods.stream().map(x -> x.toString() + " ") + .collect(Collectors.joining()) + + "local protocol " + this.fullname.getSimpleName() + + paramsToString() + + rolesToString() + + " projects " + this.global + + " {\n" + this.def + "\n}"; + } + + @Override + public int hashCode() + { + int hash = 3167; + hash = 31 * hash + super.hashCode(); + hash = 31 * hash + this.global.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof LProjection)) + { + return false; + } + return super.equals(o); // Does canEquals + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof LProjection; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/lang/local/LProtocol.java b/scribble-core/src/main/java/org/scribble/core/lang/local/LProtocol.java new file mode 100644 index 000000000..d0c0d2872 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/lang/local/LProtocol.java @@ -0,0 +1,189 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.lang.local; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +import org.antlr.runtime.tree.CommonTree; +import org.scribble.core.job.Core; +import org.scribble.core.lang.Protocol; +import org.scribble.core.lang.ProtoMod; +import org.scribble.core.lang.SubprotoSig; +import org.scribble.core.model.endpoint.EGraph; +import org.scribble.core.model.endpoint.EState; +import org.scribble.core.type.kind.Local; +import org.scribble.core.type.kind.NonRoleParamKind; +import org.scribble.core.type.name.LProtoName; +import org.scribble.core.type.name.MemberName; +import org.scribble.core.type.name.RecVar; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.local.LRecursion; +import org.scribble.core.type.session.local.LSeq; +import org.scribble.core.visit.STypeInliner; +import org.scribble.core.visit.STypeUnfolder; +import org.scribble.core.visit.Substitutor; +import org.scribble.core.visit.local.EGraphBuilder; +import org.scribble.core.visit.local.LDoPruner; +import org.scribble.core.visit.local.LRoleDeclAndDoArgPruner; +import org.scribble.core.visit.local.SubprotoExtChoiceSubjFixer; +import org.scribble.util.Constants; +import org.scribble.util.ScribException; + +public class LProtocol extends Protocol + implements LNode +{ + public final Role self; + + public LProtocol(CommonTree source, List mods, + LProtoName fullname, List roles, Role self, + List> params, LSeq def) + { + super(source, mods, fullname, roles, params, def); + this.self = self; + } + + @Override + public LProtocol reconstruct(CommonTree source, + List mods, LProtoName fullname, List roles, + //Role self, // CHECKME: reconstruct pattern not working here? + List> params, LSeq def) + { + return reconstruct(source, mods, fullname, roles, this.self, params, def); // N.B. this.self + } + + public LProtocol reconstruct(CommonTree source, + List mods, LProtoName fullname, List roles, + Role self, List> params, LSeq def) + { + return new LProtocol(source, mods, fullname, roles, self, params, def); + } + + // CHECKME: drop from Protocol (after removing Protocol from SType?) + // Pre: stack.peek is the sig for the calling Do (or top-level entry) + // i.e., it gives the roles/args at the call-site + @Override + public LProtocol getInlined(STypeInliner v) + { + SubprotoSig sig = new SubprotoSig(this); + v.pushSig(sig); + + Substitutor subs = v.core.config.vf.Substitutor(this.roles, sig.roles, + this.params, sig.args); + LSeq inlined = v.visitSeq(subs.visitSeq(this.def)); + RecVar rv = v.getInlinedRecVar(sig); + LRecursion rec = v.core.config.tf.local.LRecursion(null, rv, inlined); // CHECKME: or protodecl source? + LSeq seq = v.core.config.tf.local.LSeq(null, Arrays.asList(rec)); + LSeq def = v.core.config.vf.RecPruner().visitSeq(seq); + /*//CHECKME: necessary for LProtocol/Projection? cf. global + Set used = def.gather(new RoleGatherer()::visit) + .collect(Collectors.toSet()); + List rs = this.roles.stream().filter(x -> used.contains(x)) // Prune role decls + .collect(Collectors.toList());*/ + return reconstruct(getSource(), this.mods, this.fullname, this.roles, + this.self, this.params, def); // CHECKME: or null source? + } + + @Override + public LProtocol unfoldAllOnce(STypeUnfolder v) + { + LSeq unf = v.visitSeq(this.def); + return reconstruct(getSource(), this.mods, this.fullname, this.roles, + this.self, this.params, unf); + } + + public void checkReachability(Core core) throws ScribException + { + this.def.visitWith(core.config.vf.local.ReachabilityChecker()); + } + + // Implicitly means Subproto visitor + public LProtocol pruneRoleDeclsAndDoArgs(LRoleDeclAndDoArgPruner v) + { + return v.visitLProtocol(this); + } + + // Implicitly means Subproto visitor + public LProtocol pruneDos(LDoPruner v) + { + return v.visitLProtocol(this); + } + + public LProtocol fixExtChoiceSubjs(SubprotoExtChoiceSubjFixer v) + { + return (LProtocol) v.visitProtocol(this); + } + + public EGraph toEGraph(Core core) + { + if (this.def.isEmpty()) // Empty Seq special case for top-level -- in general, Seq must be non-empty, cf. LSeq::buildGraph entry/exit + { + EState s = core.config.mf.local.EState(Collections.emptySet()); + return new EGraph(s, s); // TODO: refactor constructor inside mf + } + EGraphBuilder b = core.config.vf.local.EGraphBuilder(core); + this.def.visitWithNoThrow(b); + return b.finalise(); + } + + @Override + public String toString() + { + return this.mods.stream().map(x -> x.toString() + " ") + .collect(Collectors.joining(" ")) + "local " + super.toString(); + } + + @Override + protected String rolesToString() + { + return "(" + + this.roles.stream() + .map(x -> (x.equals(this.self) + ? Constants.SELF_KW + : Constants.ROLE_KW) + " " + x) + .collect(Collectors.joining(", ")) + + ")"; + } + + @Override + public int hashCode() + { + int hash = 11; + hash = 31 * hash + super.hashCode(); + hash = 31 * hash + this.self.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof LProtocol)) + { + return false; + } + return super.equals(o); // Does canEquals + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof LProtocol; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/model/GraphBuilderUtil.java b/scribble-core/src/main/java/org/scribble/core/model/GraphBuilderUtil.java new file mode 100644 index 000000000..e15128d39 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/GraphBuilderUtil.java @@ -0,0 +1,57 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model; + +import org.scribble.core.type.kind.ProtoKind; + +// Helper class for (Endpoint)GraphBuilder -- can access the protected setters of S +public abstract class GraphBuilderUtil + , // Action type: labels on edges + S extends MState, // State type + K extends ProtoKind> // Global/local actions/states -- Need to quantify K explicitly +{ + public final ModelFactory mf; // N.B. new states should be made by this.newState, not this.ef.newEState + + // Doesn't call reset + protected GraphBuilderUtil(ModelFactory mf) + { + this.mf = mf; + } + + protected abstract void reset(); + + //public abstract S newState(L labs); // Doesn't factor out well with SState, doesn't use L and takes an SConfig + + protected void addEntryLabAux(S s, L lab) + { + s.addLabel(lab); + } + + public void addEdge(S s, A a, S succ) + { + addEdgeAux(s, a, succ); + } + + // Just a visibility workaround helper -- cf. addEdge: public method that may be overridden + protected final void addEdgeAux(S s, A a, S succ) + { + s.addEdge(a, succ); + } + + protected void removeEdgeAux(S s, A a, S succ) //throws ScribException // Exception necessary? + { + s.removeEdge(a, succ); + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/model/MAction.java b/scribble-core/src/main/java/org/scribble/core/model/MAction.java new file mode 100644 index 000000000..333829144 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/MAction.java @@ -0,0 +1,82 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model; + +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.core.type.name.MsgId; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Payload; + +public abstract class MAction +{ + /*private static int count = 0; + + public final int id; // Was using for trace enumeration, but breaks isAcceptable -- but would be better for non-det models?*/ + + public final Role obj; + public final MsgId mid; + public final Payload payload; // Payload.EMPTY_PAYLOAD for SigName mid + + protected MAction(Role obj, MsgId mid, Payload payload) + { + //this.id = ModelAction.count++; + + this.obj = obj; + this.mid = mid; + this.payload = payload; + } + + @Override + public String toString() + { + return this.obj + getCommSymbol() + this.mid + this.payload; + } + + // Used by toAut + public String toStringWithMsgIdHack() + { + String m = this.mid.isSigName() ? "^" + this.mid : this.mid.toString(); // HACK + return this.obj + getCommSymbol() + m + this.payload; + } + + protected abstract String getCommSymbol(); + + @Override + public int hashCode() + { + int hash = 919; + hash = 31 * hash + this.obj.hashCode(); + hash = 31 * hash + this.mid.hashCode(); + hash = 31 * hash + this.payload.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof MAction)) + { + return false; + } + MAction them = (MAction) o; // Refactor as "compatible" + return them.canEquals(this) && this.obj.equals(them.obj) + && this.mid.equals(them.mid) && this.payload.equals(them.payload); + } + + public abstract boolean canEquals(Object o); +} diff --git a/scribble-core/src/main/java/org/scribble/core/model/MPrettyPrint.java b/scribble-core/src/main/java/org/scribble/core/model/MPrettyPrint.java new file mode 100644 index 000000000..d15a1aae1 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/MPrettyPrint.java @@ -0,0 +1,20 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model; + +public interface MPrettyPrint +{ + String toDot(); + String toAut(); // FIXME: should not be a pretty print method? +} diff --git a/scribble-core/src/main/java/org/scribble/core/model/MPrettyState.java b/scribble-core/src/main/java/org/scribble/core/model/MPrettyState.java new file mode 100644 index 000000000..0afe951d5 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/MPrettyState.java @@ -0,0 +1,157 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model; + +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; +import java.util.stream.Collectors; + +import org.scribble.core.type.kind.ProtoKind; + +public abstract class MPrettyState + , S extends MPrettyState, K extends ProtoKind> + extends MState + implements MPrettyPrint +{ + public MPrettyState(Set labs) // Immutable singleton node + { + super(labs); + } + + public String toVerboseString() + { + String s = "\"" + this.id + "\":["; + Iterator ss = this.succs.iterator(); + s += this.actions.stream().map(x -> x + "=\"" + ss.next().id + "\"") + .collect(Collectors.joining(", ")); + return s + "]"; + } + + // Move up to MState? + @Override + public final String toDot() + { + StringBuilder b = new StringBuilder(); + b.append("digraph G {\n"); // rankdir=LR;\n + b.append("compound = true;\n"); + b.append(toStateDot() + "\n"); + Set ss = getReachableStates(); + ss.remove(this); // Avoids generic cast of alternative, ss.add((S) this) -- or else do Set> + ss.forEach(x -> b.append(x.toStateDot() + "\n")); + b.append("}"); + return b.toString(); + } + + protected final String toStateDot() + { + StringBuilder b = new StringBuilder(); + b.append(toNodeDot()); + Iterator as = getActions().iterator(); + Iterator ss = getSuccs().iterator(); + while (as.hasNext()) + { + A na = as.next(); + S ns = ss.next(); + b.append("\n" + toEdgeDot(na, ns)); + } + return b.toString(); + } + + // dot node declaration + // Override to change drawing declaration of "this" node + protected String toNodeDot() + { + return getDotNodeId() + " [ " + getNodeLabel() + " ];"; + } + + protected String getDotNodeId() + { + return "\"" + this.id + "\""; + } + + protected String getNodeLabel() + { + String labs = this.labs.toString(); + return "label=\"" + this.id + ": " + labs.substring(1, labs.length() - 1) + + "\""; + // TODO: revise ? + } + + // Override to change edge drawing from "this" as src + protected String toEdgeDot(A msg, S next) + { + return toEdgeDot(getDotNodeId(), next.getDotNodeId(), + next.getEdgeLabel(msg)); // CHECKME: next.getEdgeLabel or this.? + } + + // "this" is the dest node of the edge + // Override to change edge drawing to "this" as dest + protected String getEdgeLabel(A msg) + { + return "label=\"" + msg + "\""; + } + + protected String toEdgeDot(String src, String dest, String lab) + { + return src + " -> " + dest + " [ " + lab + " ];"; + } + + // Move up to MState? + @Override + public final String toAut() + { + Set> all = new HashSet<>(); + all.add(this); + all.addAll(getReachableStates()); // The only way to avoid generic cast? not ideal though + String aut = ""; + int edges = 0; + for (MPrettyState s : all) + { + Iterator as = s.getActions().iterator(); + Iterator succs = s.getSuccs().iterator(); + for (; as.hasNext(); edges++) + { + A a = as.next(); + S succ = succs.next(); + String msg = a.toStringWithMsgIdHack(); // HACK + aut += "\n(" + s.id + ",\"" + msg + "\"," + succ.id + ")"; + } + } + return "des (" + this.id + "," + edges + "," + all.size() + ")" + + aut + "\n"; + } + + @Override + public int hashCode() + { + int hash = 71; + hash = 31 * hash + super.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof MPrettyState)) + { + return false; + } + return super.equals(o); // Checks canEquals + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/model/MState.java b/scribble-core/src/main/java/org/scribble/core/model/MState.java new file mode 100644 index 000000000..d44d0d3c7 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/MState.java @@ -0,0 +1,362 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model; + +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.stream.Collectors; + +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.util.RuntimeScribException; + +public abstract class MState +< + L, // Node label type (cosmetic) + A extends MAction, // Edge type + S extends MState, // State type + K extends ProtoKind // Global/Local -- CHECKME: useful? +> +{ + private static int count = 1; // A shared index counter for every single MState (and subclass) instance + + public final int id; + + // Labels and edges are mutable (via protected methods) + protected final Set labs; // Was RecVar and SubprotocolSigs, now using inlined protocol for FSM building so just RecVar + protected final List actions; + protected final List succs; + + public MState(Set labs) + { + this.id = MState.count++; + this.labs = new HashSet<>(labs); + this.actions = new LinkedList<>(); + this.succs = new LinkedList<>(); + } + + // Mutating setter + protected final void addLabel(L lab) + { + this.labs.add(lab); + } + + public final Set getLabels() + { + return Collections.unmodifiableSet(this.labs); + } + + // Mutating setter (can also overwrite edges) + protected void addEdge(A a, S s) + { + /*if (this.equals(s)) + { + // CHECKME: refactor unfair transform to eliminate this special case -- or better to have? generalise to all "identical" non-det paths?... + // ...special case was previously for all non-det "this-a->s" for the same "s", but also works when specialised to recursive such cases, i.e., this.equals(s) (because only recursion is relevant to unfair transform) + // + // Needed? -- seems so, for the unfair transform (specifically for recursive non-det paths of length 1, see good.efsm.gchoice.Test09) + // Cf. EState.unfairTransform... ? -- if (curr.getStateKind() == EStateKind.OUTPUT && curr.getActions().size() > 1) // >1 is what makes this algorithm terminating + // ...because of unfairClone, na.equals(a) && ns.equals(succ) -- a pair of non-det (a, s) edges will *both* be added in the unfair-clone, instead of pruned down to one output-case, so above >1 termination condition never reached + Iterator as = this.actions.iterator(); + Iterator ss = this.succs.iterator(); + while (as.hasNext()) // Duplicate edges preemptively pruned here, but could leave to later minimisation + { + A na = as.next(); // N.B. cannot "inline" into below if-condition, due to short circuiting + S ns = ss.next(); + if (na.equals(a) && ns.equals(s)) + { + return; + } + } + }*/ + this.actions.add(a); + this.succs.add(s); + } + + // Pre: (this, a, s) is a current edge -- mutating setter + protected final void removeEdge(A a, S s) + //throws ScribException // CHECKME: used? -- cf., Hack? EFSM building on bad-reachability protocols now done before actual reachability check + { + Iterator as = this.actions.iterator(); + Iterator ss = this.succs.iterator(); + while (as.hasNext()) + { + A na = as.next(); // N.B. cannot "inline" into below if-condition, due to short circuiting + S ns = ss.next(); + if (na.equals(a) && ns.equals(s)) + { + as.remove(); // Must follow next + ss.remove(); + return; + } + } + throw new RuntimeException("No such transition: " + a + "->" + s); + } + + public final List getActions() + { + return Collections.unmodifiableList(this.actions); + } + + public final boolean hasAction(A a) + { + return this.actions.contains(a); + } + + public final List getSuccs() + { + return Collections.unmodifiableList(this.succs); + } + + public final List getSuccs(A a) + { + Iterator as = this.actions.iterator(); + Iterator ss = this.succs.iterator(); + List res = new LinkedList<>(); + while (as.hasNext()) + { + A na = as.next(); + S ns = ss.next(); + if (na.equals(a)) + { + res.add(ns); + } + } + return res; + } + + // Variant of getActions with implicit run-time check on determinism -- currently used by codegen utils (that have that assumption) + // (Pre: actions are deterministic) + public final List getDetActions() + { + Set as = new HashSet<>(this.actions); + if (as.size() != this.actions.size()) + { + throw new RuntimeScribException("[TODO] Non-deterministic state: " + + this.actions + " (Try -minlts if available)"); + // This getter checks for determinism -- mainly affects API generation + } + return getActions(); + } + + // Variant with implicit run-time check on determinism + // (Pre: actions are deterministic) + public S getDetSuccessor(A a) + { + Set as = new HashSet<>(this.actions); + if (as.size() != this.actions.size()) + { + throw new RuntimeException("[FIXME] : " + this.actions); + } + return getSuccs(a).get(0); + } + + public final boolean isTerminal() + { + return this.actions.isEmpty(); + } + + public S getTerminal() + { + //getReachableStates().stream().filter(x -> x.isTerminal()).findFirst(); + Set terms = getReachableStates().stream() + .filter(s -> s.isTerminal()).collect(Collectors.toSet()); + if (terms.size() > 1) + { + throw new RuntimeException("Shouldn't get in here: " + terms); + } + return terms.isEmpty() //.isPresent() + ? null : terms.iterator().next(); // CHECKME: return empty Set instead of null? null used by EState.toGraph + } + + // CHECKME: add "caching" versions to, e.g., Graphs? + // N.B. doesn't implicitly include start (only if start is reachable from start by at least one transition) + // Concrete subclass implementation should call, e.g., getReachableStatesAux(this) -- for S param, putting "this" into Map + public abstract Set getReachableStates(); + + // N.B. doesn't implicitly include start (only if start is explicitly reachable from start by at least one transition) + protected Set getReachableStatesAux(S start) + { + Map all = new HashMap<>(); + Map todo = new LinkedHashMap<>(); // Linked unnecessary, but to follow the iteration pattern + todo.put(this.id, start); // Suppressed: assumes ModelState subclass correctly instantiates S parameter + while (!todo.isEmpty()) + { + Iterator> i = todo.entrySet().iterator(); + Entry next = i.next(); + i.remove(); // Must follow next + for (S s : next.getValue().getSuccs()) + { + if (!all.containsKey(s.id)) + { + all.put(s.id, s); + todo.put(s.id, s); + } + } + } + return new HashSet<>(all.values()); // Often will want to add this + } + + public Set getReachableActions() + { + return getReachableStates().stream().flatMap(x -> x.getActions().stream()) + .collect(Collectors.toSet()); + } + + public boolean canReach(MState s) + { + return getReachableStates().contains(s); + } + + @Override + public String toString() + { + return Integer.toString(this.id); // CHECKME: ? + } + + @Override + public int hashCode() + { + int hash = 73; + hash = 31 * hash + this.id; // N.B. using state ID only + return hash; + } + + // N.B. Based only on state ID + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof MState)) + { + return false; + } + MState them = (MState) o; + return them.canEquals(this) && this.id == them.id; + // Convenient to use id, due to edge mutability + } + + protected abstract boolean canEquals(MState s); +} + + + + + + + + + + + + + + /* + public final List getDetSuccessors() + { + Set as = new HashSet<>(this.actions); + if (as.size() != this.actions.size()) + { + throw new RuntimeScribException("[TODO] Non-deterministic state: " + + this.actions + " (Try -minlts if available)"); + // This getter checks for determinism -- affects e.g. API generation + } + return getSuccessors(); + } + + // TODO: make protected + public static , S extends MState, K extends ProtoKind> + S getTerminal(S start) + { + if (start.isTerminal()) + { + return start; + } + Set terms = start.getReachableStates().stream() + .filter(s -> s.isTerminal()).collect(Collectors.toSet()); + if (terms.size() > 1) + { + throw new RuntimeException("Shouldn't get in here: " + terms); + } + return (terms.isEmpty()) ? null : terms.iterator().next(); // FIXME: return empty Set instead of null? + } + + // Note: doesn't implicitly include start (only if start is explicitly reachable from start, of course) + /*public static , S extends ModelState, K extends ProtocolKind> + Set getAllReachable(S start)* / + // TODO: make protected + // CHECKME: cache results? + @SuppressWarnings("unchecked") + public static , S extends MState, K extends ProtoKind> + Set getReachableStates(MState start) + { + Map all = new HashMap<>(); + Map todo = new LinkedHashMap<>(); + todo.put(start.id, (S) start); // Suppressed: assumes ModelState subclass correctly instantiates S parameter + while (!todo.isEmpty()) + { + Iterator i = todo.values().iterator(); + S next = i.next(); + todo.remove(next.id); + /*if (all.containsKey(next.id)) + { + continue; + } + all.put(next.id, next);* / + for (S s : next.getAllSuccessors()) + { + /*if (!all.containsKey(s.id) && !todo.containsKey(s.id)) + { + todo.put(s.id, s); + }* / + if (!all.containsKey(s.id)) + { + all.put(s.id, s); + //if (!todo.containsKey(s.id)) // Redundant + { + todo.put(s.id, s); + } + } + } + } + return new HashSet<>(all.values()); + } + + @SuppressWarnings("unchecked") + // TODO: make protected + // CHECKME: cache results? + public static , S extends MState, K extends ProtoKind> + //Set getAllReachableActions(S start) + Set getReachableActions(MState start) + { + Set all = new HashSet<>(); + all.add((S) start); // Suppressed: assumes ModelState subclass correctly instantiates S parameter + all.addAll(MState.getReachableStates(start)); + Set as = new HashSet<>(); + for (S s : all) + { + as.addAll(s.getAllActions()); + } + return as; + }*/ \ No newline at end of file diff --git a/scribble-core/src/main/java/org/scribble/core/model/ModelFactory.java b/scribble-core/src/main/java/org/scribble/core/model/ModelFactory.java new file mode 100644 index 000000000..d39c6ab6a --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/ModelFactory.java @@ -0,0 +1,34 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model; + +import java.util.function.Function; + +import org.scribble.core.model.endpoint.EModelFactory; +import org.scribble.core.model.global.SModelFactory; + +public class ModelFactory +{ + public final EModelFactory local; + public final SModelFactory global; + + // Args should be constructor refs that that ModelFactory single arg + // (Workaround to set mutually referential ModelFactory and E/SModelFactory final fields) + public ModelFactory(Function ef, + Function sf) + { + this.local = ef.apply(this); + this.global = sf.apply(this); + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/model/ModelFactoryBase.java b/scribble-core/src/main/java/org/scribble/core/model/ModelFactoryBase.java new file mode 100644 index 000000000..ee8adf6dd --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/ModelFactoryBase.java @@ -0,0 +1,26 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model; + +// Base class for all *E/SModelFactoryImpl* +// N.B. this class does *not* itself implement the top-level ModelFactory wrapper (nor vice versa) +public abstract class ModelFactoryBase +{ + protected ModelFactory mf = null; + + public ModelFactoryBase(ModelFactory mf) + { + this.mf = mf; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/model/endpoint/AutGraphParser.java b/scribble-core/src/main/java/org/scribble/core/model/endpoint/AutGraphParser.java new file mode 100644 index 000000000..a840d9ca9 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/endpoint/AutGraphParser.java @@ -0,0 +1,306 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model.endpoint; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.StringReader; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +import org.scribble.core.job.Core; +import org.scribble.core.model.ModelFactory; +import org.scribble.core.model.endpoint.actions.EAction; +import org.scribble.core.type.name.DataName; +import org.scribble.core.type.name.MsgId; +import org.scribble.core.type.name.SigName; +import org.scribble.core.type.name.Op; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Payload; + +// Relocate to util? +public class AutGraphParser +{ + private final Core core; + + public AutGraphParser(Core core) + { + this.core = core; + } + + public EGraph parse(String aut) + { + ModelFactory ef = this.core.config.mf; + + //Map> edges = new HashMap<>(); + Map> as = new HashMap<>(); + Map> succs = new HashMap<>(); + int init = -1; + try + { + BufferedReader br = new BufferedReader(new StringReader(aut)); + String line = br.readLine(); + if (line == null || !line.startsWith("des (") || !line.endsWith(")")) + { + throw new RuntimeException("Unexpected first line: " + line); + } + String[] first = line.substring("des (".length(), line.length() - 1).split(","); + if (first.length != 3) + { + throw new RuntimeException("Unexpected first line: " + line); + } + init = Integer.parseInt(first[0]); + //int trans = Integer.parseInt(first[1]); + //int states = Integer.parseInt(first[2]); + while ((line = br.readLine()) != null) + { + if (!line.startsWith("(") || !line.endsWith(")")) + { + throw new RuntimeException("Unexpected line: " + line); + } + //String[] read = line.substring(1, line.length()-1).split(","); + String[] read = new String[] { + line.substring(1, line.indexOf(',')), + line.substring(line.indexOf(',')+1, line.lastIndexOf(',')), + line.substring(line.lastIndexOf(',')+1, line.length()-1) + }; + int s = Integer.parseInt(read[0]); + String a = read[1].substring(1, read[1].length()-1); + int succ = Integer.parseInt(read[2]); + //Map tmp = edges.get(s); + List tmp1 = as.get(s); + List tmp2 = succs.get(s); + if (tmp1 == null) + { + //tmp = new HashMap<>(); + //edges.put(s, tmp); + tmp1 = new LinkedList<>(); + as.put(s, tmp1); + tmp2 = new LinkedList<>(); + succs.put(s, tmp2); + } + //tmp.put(a, succ); + tmp1.add(a); + tmp2.add(succ); + } + } + catch (IOException e) + { + throw new RuntimeException(e); + } + //Set allSuccs = edges.values().stream().flatMap((j) -> j.values().stream()).collect(Collectors.toSet()); + Set allSuccs = succs.values().stream().flatMap((j) -> j.stream()).collect(Collectors.toSet()); + int term = -1; + //Set terms = allSuccs.stream().filter((j) -> !edges.containsKey(j)).collect(Collectors.toSet()); + Set terms = allSuccs.stream().filter((j) -> !succs.containsKey(j)).collect(Collectors.toSet()); + if (terms.size() > 0) + { + term = terms.iterator().next(); + } + //EGraphBuilderUtil util = new EGraphBuilderUtil(ef); + //EGraphBuilderUtil util = this.job2.newEGraphBuilderUtil2(); + EGraphBuilderUtil util = this.core.config.mf.local.EGraphBuilderUtil(); + //util.init(null); // FIXME: arg is deprecated + Map map = new HashMap<>(); + map.put(init, util.getEntry()); + if (term != -1) + { + map.put(term, util.getExit()); + } + map.put(init, util.getEntry()); + //for (int i : edges.keySet()) + for (int i : as.keySet()) + { + if (i != init && i != term) + { + map.put(i, util.mf.local.EState(Collections.emptySet())); + } + } + //for (int i : succs) + for (int i : succs.keySet()) + { + if (!map.containsKey(i) && i != init && i != term) + { + map.put(i, util.mf.local.EState(Collections.emptySet())); + } + } + //for (int i : edges.keySet()) + for (int i : as.keySet()) + { + EState s = map.get(i); + //Map tmp = edges.get(i); + List tmp1 = as.get(i); + List tmp2 = succs.get(i); + //if (tmp != null) + if (tmp1 != null) + { + //for (String a : tmp.keySet()) + Iterator is = tmp2.iterator(); + for (String a : tmp1) + { + int succ = is.next(); + //builder.addEdge(s, parseIOAction(a), map.get(tmp.get(a))); + util.addEdge(s, parseIOAction(ef, a), map.get(succ)); + } + } + } + return util.finalise(); // Redundant, except that it creates the EGraph + //return new EGraph(util.getEntry(), util.getExit()); + } + + // Cf. getCommSymbol of IOActions + // FIXME: simply do a match for getCommSymbol? + private static EAction parseIOAction(ModelFactory ef, String a) + { + String peer; + String action; + String msg; // Could be an Op or a MessageSigName (affects API generation) + String[] paySplit = null; + + /*int i = a.indexOf("!"); + i = (i == -1) ? a.indexOf("?") : i; + int j = i+1; + String tmp = a.substring(j, j+1); + if (tmp.equals("!") || tmp.equals("?")) + { + j++; + } + action = a.substring(i, j);*/ + int i, j; + if ((i = a.indexOf("!")) != -1) + { + j = i+1; + if (a.charAt(j) == '!') + { + j++; + if (a.charAt(i-1) == '(') + { + if (a.charAt(j+1) != ')') + { + throw new RuntimeException("Shouldn't get in here: " + a); + } + i--; + j++; + } + } + } + else if ((i = a.indexOf("?")) != -1) + { + j = i+1; + if (a.charAt(j) == '?') + { + j++; + if (a.charAt(i-1) == '(') + { + if (a.charAt(j+1) != ')') + { + throw new RuntimeException("Shouldn't get in here: " + a); + } + i--; + j++; + } + } + } + else if ((i = a.indexOf('/')) != -1) + { + if (a.charAt(i-1) != '-' || a.charAt(i+1) != '-') + { + throw new RuntimeException("Shouldn't get in here: " + a); + } + j = i+2; + i--; + } + else + { + throw new RuntimeException("[TODO] aut parsing not supported for: " + a); + } + action = a.substring(i, j); + + peer = a.substring(0, i); + int k = a.indexOf("("); + msg = a.substring(j, k); + String p = a.substring(k+1, a.length()-1); + if (!p.isEmpty()) + { + paySplit = p.split(","); + } + switch (action) + { + case "!": + { + Payload pay = (paySplit != null) + ? new Payload(Arrays.asList(paySplit).stream() + .map((pe) -> new DataName(pe)).collect(Collectors.toList())) + : Payload.EMPTY_PAYLOAD; + return ef.local.ESend(new Role(peer), getMessageIdHack(msg), pay); // FIXME: how about MessageSigNames? -- currently OK, treated as empty payload (cf. ModelAction) + } + case "?": + { + Payload pay = (paySplit != null) + ? new Payload(Arrays.asList(paySplit).stream() + .map((pe) -> new DataName(pe)).collect(Collectors.toList())) + : Payload.EMPTY_PAYLOAD; + return ef.local.ERecv(new Role(peer), getMessageIdHack(msg), pay); // FIXME: how about MessageSigNames?) + } + case "!!": + { + //return new Connect(new Role(peer)); + Payload pay = (paySplit != null) + ? new Payload(Arrays.asList(paySplit).stream() + .map((pe) -> new DataName(pe)).collect(Collectors.toList())) + : Payload.EMPTY_PAYLOAD; + return ef.local.EReq(new Role(peer), getMessageIdHack(msg), pay); + } + case "??": + { + //return new Accept(new Role(peer)); + Payload pay = (paySplit != null) + ? new Payload(Arrays.asList(paySplit).stream() + .map((pe) -> new DataName(pe)).collect(Collectors.toList())) + : Payload.EMPTY_PAYLOAD; + return ef.local.EAcc(new Role(peer), getMessageIdHack(msg), pay); + } + case "(!!)": + { + return ef.local.EClientWrap(new Role(peer)); + } + case "(??)": + { + return ef.local.EServerWrap(new Role(peer)); + } + case "-/-": + { + return ef.local.EDisconnect(new Role(peer)); + } + default: + { + throw new RuntimeException( + "[TODO] aut parsing not supported for: " + msg); + } + } + } + + // Cf. ModelState.toAut, ModelAction.toStringWithMessageIdHack + private static MsgId getMessageIdHack(String msg) + { + return (msg.startsWith("^")) ? new SigName(msg.substring(1)) : new Op(msg); + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/model/endpoint/EFsm.java b/scribble-core/src/main/java/org/scribble/core/model/endpoint/EFsm.java new file mode 100644 index 000000000..288521005 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/endpoint/EFsm.java @@ -0,0 +1,121 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model.endpoint; + +import java.util.List; +import java.util.stream.Collectors; + +import org.scribble.core.model.endpoint.actions.EAction; + +// Factor out with SModel? +public class EFsm +{ + public final EGraph graph; + public final EState curr; + + protected EFsm(EGraph graph) + { + this(graph, graph.init); + } + + protected EFsm(EGraph graph, EState curr) + { + this.graph = graph; + this.curr = curr; + } + + // CHECKME: Set? List is for non-det actions, but is that relevant to EFsm's? + // N.B. this just means "follow an edge", it is agnostic to an "actual semantics" (e.g., queues, queue sizes, etc.), cf. "fire" + public List getSuccs(EAction a) + { + return this.curr.getSuccs(a).stream().map(x -> new EFsm(this.graph, x)) + .collect(Collectors.toList()); + } + + // CHECKME: check if unfolded initial accept is possible, and if it breaks anything + public boolean isInitial() + { + return this.curr.equals(this.graph.init); // i.e., "literally" in the initial state (not "semantically") + } + + @Override + public final int hashCode() + { + int hash = 1049; + hash = 31 * hash + this.graph.init.hashCode(); + hash = 31 * hash + this.curr.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof EFsm)) + { + return false; + } + EFsm them = (EFsm) o; + return this.graph.equals(them.graph) && this.curr.equals(them.curr); + } + + @Override + public String toString() + { + return Integer.toString(this.curr.id); + } +} + + + + + + + + + + + + + + + + + /*public boolean isTerminated() + { + return this.curr.isTerminal(); + } + + public EStateKind getStateKind() + { + return this.curr.getStateKind(); + } + + public List getActions() + { + return this.curr.getActions(); + } + + public boolean hasAction(EAction a) + { + return this.curr.hasAction(a); + } + + public boolean isRequesttOrClientWrapOnly() + { + return this.curr.isRequestOrClientWrapOnly(); + }*/ diff --git a/scribble-core/src/main/java/org/scribble/core/model/endpoint/EGraph.java b/scribble-core/src/main/java/org/scribble/core/model/endpoint/EGraph.java new file mode 100644 index 000000000..0aacf17a6 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/endpoint/EGraph.java @@ -0,0 +1,76 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model.endpoint; + +import org.scribble.core.model.MPrettyPrint; + +public class EGraph implements MPrettyPrint +{ + public final EState init; + public final EState term; + + //protected EGraph(EState init, EState term) // Use factory? + public EGraph(EState init, EState term) + { + this.init = init; + this.term = term; + } + + public EFsm toFsm() // CHECKME: refactor to mf? + { + return new EFsm(this); + } + + @Override + public String toDot() + { + return this.init.toDot(); + } + + @Override + public String toAut() + { + return this.init.toAut(); + } + + @Override + public String toString() + { + return this.init.toString(); + } + + @Override + public final int hashCode() + { + int hash = 1051; + hash = 31 * hash + this.init.hashCode(); // Use init state only, OK since state IDs globally unique + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof EGraph)) + { + return false; + } + EGraph them = (EGraph) o; + return this.init.equals(them.init); + // && this.term.equals(them.term); // N.B. EState.equals checks state ID only, but OK because EStates have globally unique IDs -- any need to do a proper graph equality? + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/model/endpoint/EGraphBuilderUtil.java b/scribble-core/src/main/java/org/scribble/core/model/endpoint/EGraphBuilderUtil.java new file mode 100644 index 000000000..a413541a1 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/endpoint/EGraphBuilderUtil.java @@ -0,0 +1,353 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model.endpoint; + +import java.util.Collections; +import java.util.Deque; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +import org.scribble.core.model.GraphBuilderUtil; +import org.scribble.core.model.ModelFactory; +import org.scribble.core.model.endpoint.actions.EAction; +import org.scribble.core.type.kind.Local; +import org.scribble.core.type.name.RecVar; + +// EGraphBuilderUtil usage contract (1): all states must be made via newState +// EGraphBuilderUtil usage contract (2): this.entry on leaving a node is the same as on entering +// Tailored to support graph building from syntactic local protocol choice and recursion +public class EGraphBuilderUtil + extends GraphBuilderUtil +{ + protected EState entry; // GraphBuilderUtil usage contract: entry on leaving a node is the same as on entering -- cf., EGraphBuilderUtil.visitSeq restores the original entry on leaving + protected EState exit; // Tracking exit is convenient for merges (otherwise have to generate dummy merge nodes) + + // N.B. new states should be made by this.newState, not this.mf.newEState + private final Set states = new HashSet<>(); + + // Entry state for each recursion + private final Map> recEntries = new HashMap<>(); // CHECKME: Deque is for shadowing? + + // Record enacting per-recvar, since a state could have multi-recvars -- CHECKME: caters for shadowing? (cf. recording only per unique recvar) + // CHECKME: for a given state, the enacting list is the same for each recvar? + private final Map> enacting = new HashMap<>(); + + // Temporary storage of enacting while collecting in progress + // First action(s) inside a rec scope ("enacting" means how to enact an unguarded choice-continue) + // These are collected by: + // - On each recursion entry, push a new list for its entry state -- list pushing/popping mainly for handling choices (see below) + // - (N.B. only need to do per state, not per rec(var) -- all recvars of a given state equivalently identify that state) + // - General idea: via addEdge, record the first action encountered for all "*open*" rec states, i.e., add the action to all current lists that are *still empty* + // - For choice: + // -- On choice entry, first push a new list for *all* rec states for recording the choice cases (all, including "non-open", because inconvenient to distinguish open/non-open from nested contexts) + // -- On block entry, push another new list for *all* rec states for recording the current block + // -- (Record, via addEdge, the first action of the current block for all open rec states) + // -- On block exit, pop the block list into the parent choice list for *all* rec states + // - On choice exit, pop the choice list into the parent (recursion/choice-block) list for all *open* rec states, i.e., if the parent list is *still empty* + // - On recursion exit, pop the list into the enacting map for the rec entry state + private final Map>> collecting = new HashMap<>(); + + protected EGraphBuilderUtil(ModelFactory mf) + { + super(mf); + reset(); + } + + // N.B. called before every "new visit", including first (so util is reusable) -- called by constructor and finalise + @Override + protected void reset() + { + //clear(); + this.entry = newState(Collections.emptySet()); + this.exit = newState(Collections.emptySet()); + } + + /*protected void clear() // CHECKME: redundant? -- ideally builder should be implemented so that it is redundant? + { + this.states.clear(); + this.recEntries.clear(); + this.enacting.clear(); + this.collecting.clear(); + }*/ + + // For the util to additionally record states -- use this, don't use this.mf.newEState + public EState newState(Set labs) + { + EState s = this.mf.local.EState(labs); + this.states.add(s); + return s; + } + + // Records 's' as predecessor state, and 'a' as previous action and the "enacting action" for "fresh" recursion scopes + @Override + public void addEdge(EState s, EAction a, EState succ) + { + super.addEdge(s, a, succ); + for (Deque> ens : this.collecting.values()) + { + List tmp = ens.peek(); // enterRecursion always adds an initial List to the Deque + if (tmp.isEmpty()) + { + tmp.add(a); + } + } + } + + /* + * Dealing with Choice contexts + */ + public void enterChoice() + { + for (EState entry : this.collecting.keySet()) + { + Deque> deq = this.collecting.get(entry); + deq.push(new LinkedList<>()); // Initially empty to record nested enablings in choice blocks + } + } + + public void leaveChoice() + { + for (EState entry : this.collecting.keySet()) + { + List pop = this.collecting.get(entry).pop(); + List peek = this.collecting.get(entry).peek(); + if (peek.isEmpty()) // Cf. addEdge + { + peek.addAll(pop); + } + } + } + + public void enterChoiceBlock() + { + for (EState entry : this.collecting.keySet()) + { + Deque> deq = this.collecting.get(entry); + deq.push(new LinkedList<>()); + } + } + + public void leaveChoiceBlock() + { + for (EState entry : this.collecting.keySet()) + { + List block = this.collecting.get(entry).pop(); + List blocks = this.collecting.get(entry).peek(); // Parent choice List + blocks.addAll(block); + } + } + + /* + * Dealing with Recursion contexts + */ + public void enterRecursion(RecVar rv, EState entry) + { + // Update this.recEntries + Deque recdeq = this.recEntries.get(rv); + if (recdeq == null) + { + recdeq = new LinkedList<>(); + this.recEntries.put(rv, recdeq); + } + recdeq.push(entry); // Same as this.entry + + // Udpate this.collecting, if necessary + if (this.collecting.containsKey(entry) || this.enacting.containsKey(entry)) + // Already doing/done this rec state for another of its recvar + // Does checking this.enacting do anything? + { + return; + } + Deque> coldeq = new LinkedList<>(); // New Deque for this recvar + this.collecting.put(entry, coldeq); // !this.collecting.containsKey(entry), leaveRecursion does remove -- necessary for addEdge/Choice to correctly add to this.collecting + coldeq.push(new LinkedList<>()); // Push new List onto deq + } + + public void leaveRecursion(RecVar rv) + { + // Update this.recEntries + EState entry = this.recEntries.get(rv).pop(); // Pop the entry of this rec + // Same as this.entry + // Because contract for GraphBuilderUtil is entry on leaving a node is the same as on entry, cf., EGraphBuilder.visitSeq restores original entry on leaving + // (And visitRecursion just does visitSeq for the recursion body, with the current entry/exit) + if (this.recEntries.get(rv).isEmpty()) + { + this.recEntries.remove(rv); // To keep util clean, e.g., for reuse + } + + // Udpate this.collecting, if necessary + if (!this.collecting.containsKey(entry)) + { + // This state already done -- i.e., already popped another recvar for this same state, e.g., good.efsm.gcontinue.choiceunguarded.Test05b + // (For a given state, the enacting for all associated recvars is the same (the recvars are "equivalently" identify the state) -- so only need to record per state) + return; + } + List coll = this.collecting.get(entry).pop(); + if (this.collecting.get(entry).isEmpty()) // All Lists popped from the stack of this recvar -- could just clear instead + { + this.collecting.remove(entry); + // N.B. we pushed on entry of *outermost rec*, but above popped on exit of *innermost* rec (due to checking entry in this.collecting) + // This remove is necessary to prevent above containsKey check also succeeding when leaving the outer rec, e.g., good.efsm.gcontinue.choiceunguarded.Test05b + // Also necessary to prevent continued updating of this.collecting after leaving a rec (because this.collecting still has entry), e.g., good.efsm.gchoice.Test10 + } + this.enacting.put(entry, coll); + // !this.enacting.containsKey(entry) -- if it did contain (remove enacting check from enterRecursion), this.enacting.get(entry).equals(coll) + } + + /* + * Edge construction for Continues + */ + public void fixContinueEdge(EState pred, EAction a, EState curr, RecVar rv) + { + removeEdgeAux(pred, a, curr); // N.B. "a" could be an enacting, that's fine (removeEdgeAux doesn't change that) + EState entry = getRecursionEntry(rv); + addEdge(pred, a, entry); + } + + // Choice-unguarded continues -- fixed in finalise pass + public void addUnguardedContinueEdge(EState s, RecVar rv) // Intermed continue edge makes its own dummy action + { + EState entry = getRecursionEntry(rv); + addEdgeAux(s, new UnguardedContinueEdge(this.mf, rv), entry); + } + + /*// CHECKME: update enacting? (cf. this.addEdge) + public void removeEdge(EState s, EAction a, EState succ) + throws ScribException + { + removeEdgeAux(s, a, succ); + }*/ + + public EState getRecursionEntry(RecVar recvar) + { + return this.recEntries.get(recvar).peek(); + } + + // Returns List (not Set), cf. getSuccs/Actions + public List getPreds(EState s) + { + // Easier to recompute than "cache" (this.preds), due to removeEdge(Aux)? Cf. addEdge (Or due to maintaining this.collecting/enacting) + // (Only currently used by visitContinue, so cost OK) + return this.states.stream().filter(x -> x.getSuccs().contains(s)) + .collect(Collectors.toList()); + } + + /* + * Finalise graph by treating IntermediateContinueEdges. + * Calls reset() on completion. + */ + public EGraph finalise() + { + EState entryClone = this.entry.cloneNode(this.mf, this.entry.getLabels()); + EState exitClone = this.exit.cloneNode(this.mf, this.exit.getLabels()); + Map clones = new HashMap<>(); // Will be mostly populated by fixUnguardedContinueEdges + clones.put(this.entry, entryClone); + clones.put(this.exit, exitClone); + Set seenOrig = new HashSet<>(); + fixUnguardedContinueEdges(seenOrig, clones, this.entry, entryClone); + if (!seenOrig.contains(this.exit)) + { + exitClone = null; + } + reset(); + return new EGraph(entryClone, exitClone); + } + + protected void fixUnguardedContinueEdges(Set seenOrig, + Map clones, EState currOrig, EState currClone) + { + if (seenOrig.contains(currOrig)) + { + return; + } + seenOrig.add(currOrig); + Iterator as = currOrig.getActions().iterator(); // Actions are immutable (no orig/clone) + Iterator succsOrig = currOrig.getSuccs().iterator(); + while (as.hasNext()) + { + EAction a = as.next(); + EState succOrig = succsOrig.next(); + if (!(a instanceof UnguardedContinueEdge)) + { + EState succClone = getClone(clones, succOrig); + addEdgeAux(currClone, a, succClone); + fixUnguardedContinueEdges(seenOrig, clones, succOrig, succClone); + } + else // Choice--unguardedcontedge-->succOrig, i.e., curr is a Choice, succOrig is a rec entry state + { + EState recEntry = succOrig; + for (EAction e : this.enacting.get(recEntry)) // recEntry--enacting-->succEntry + { + for (EState succEntry : recEntry.getSuccs(e)) + { + EState succEntryClone = getClone(clones, succEntry); // succEntryClone is a (cloned) successor of recEntry + addEdgeAux(currClone, e, succEntryClone); + // Choice--enacting-->succSuccClone, where succSuccClone is succ(rec-entry, enacting) (rec-entry is SuccOrig) + // i.e., skip recEntry + fixUnguardedContinueEdges(seenOrig, clones, recEntry, // Carry on from recEntry, that's where this edge was going "morally" + getClone(clones, recEntry)); + + // CHECKME: "transitive" (nested?) unguarded-continue-edge rewriting possible? supported? + // ...CHECKME: incomplete -- won't fully correctly handle situations involving, e.g., transitive continue-edge fixing? + + } + } + } + } + } + + private EState getClone(Map clones, EState orig) + { + if (clones.containsKey(orig)) + { + return clones.get(orig); + } + EState res = orig.cloneNode(this.mf, orig.getLabels()); + clones.put(orig, res); + return res; + } + + public void addEntryLabel(RecVar lab) + { + addEntryLabAux(this.entry, lab); + } + + public EState getEntry() + { + return this.entry; + } + + public void setEntry(EState entry) + { + this.entry = entry; + } + + public EState getExit() + { + return this.exit; + } + + public void setExit(EState exit) + { + this.exit = exit; + } +} + + diff --git a/scribble-core/src/main/java/org/scribble/core/model/endpoint/EModelFactory.java b/scribble-core/src/main/java/org/scribble/core/model/endpoint/EModelFactory.java new file mode 100644 index 000000000..1bd023d0c --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/endpoint/EModelFactory.java @@ -0,0 +1,46 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model.endpoint; + +import java.util.Set; + +import org.scribble.core.model.endpoint.actions.EAcc; +import org.scribble.core.model.endpoint.actions.EClientWrap; +import org.scribble.core.model.endpoint.actions.EDisconnect; +import org.scribble.core.model.endpoint.actions.ERecv; +import org.scribble.core.model.endpoint.actions.EReq; +import org.scribble.core.model.endpoint.actions.ESend; +import org.scribble.core.model.endpoint.actions.EServerWrap; +import org.scribble.core.type.name.MsgId; +import org.scribble.core.type.name.RecVar; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Payload; + +public interface EModelFactory +{ + EGraphBuilderUtil EGraphBuilderUtil(); + + // protected constructors (MState mutable) + EState EState(Set labs); + //EFsm new EFsm(...) + + // public constructors (subpackage, immutable) + ESend ESend(Role peer, MsgId mid, Payload pay); + ERecv ERecv(Role peer, MsgId mid, Payload pay); + EReq EReq(Role peer, MsgId mid, Payload pay); + EAcc EAcc(Role peer, MsgId mid, Payload pay); + EDisconnect EDisconnect(Role peer); + EClientWrap EClientWrap(Role peer); + EServerWrap EServerWrap(Role peer); +} diff --git a/scribble-core/src/main/java/org/scribble/core/model/endpoint/EModelFactoryImpl.java b/scribble-core/src/main/java/org/scribble/core/model/endpoint/EModelFactoryImpl.java new file mode 100644 index 000000000..552b5facd --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/endpoint/EModelFactoryImpl.java @@ -0,0 +1,94 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model.endpoint; + +import java.util.Set; + +import org.scribble.core.model.ModelFactory; +import org.scribble.core.model.ModelFactoryBase; +import org.scribble.core.model.endpoint.actions.EAcc; +import org.scribble.core.model.endpoint.actions.EClientWrap; +import org.scribble.core.model.endpoint.actions.EDisconnect; +import org.scribble.core.model.endpoint.actions.ERecv; +import org.scribble.core.model.endpoint.actions.EReq; +import org.scribble.core.model.endpoint.actions.ESend; +import org.scribble.core.model.endpoint.actions.EServerWrap; +import org.scribble.core.type.name.MsgId; +import org.scribble.core.type.name.RecVar; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Payload; + +// Separate E/SModelFactories fits protected E/SState constructor pattern +public class EModelFactoryImpl extends ModelFactoryBase implements EModelFactory +{ + + public EModelFactoryImpl(ModelFactory mf) + { + super(mf); + } + + @Override + public EGraphBuilderUtil EGraphBuilderUtil() + { + return new EGraphBuilderUtil(this.mf); + } + + @Override + public EState EState(Set labs) + { + return new EState(labs); + } + + @Override + public ESend ESend(Role peer, MsgId mid, Payload pay) + { + return new ESend(this.mf, peer, mid, pay); + } + + @Override + public ERecv ERecv(Role peer, MsgId mid, Payload pay) + { + return new ERecv(this.mf, peer, mid, pay); + } + + @Override + public EReq EReq(Role peer, MsgId mid, Payload pay) + { + return new EReq(this.mf, peer, mid, pay); + } + + @Override + public EAcc EAcc(Role peer, MsgId mid, Payload pay) + { + return new EAcc(this.mf, peer, mid, pay); + } + + @Override + public EDisconnect EDisconnect(Role peer) + { + return new EDisconnect(this.mf, peer); + } + + @Override + public EClientWrap EClientWrap(Role peer) + { + return new EClientWrap(this.mf, peer); + } + + @Override + public EServerWrap EServerWrap(Role peer) + { + return new EServerWrap(this.mf, peer); + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/model/endpoint/EState.java b/scribble-core/src/main/java/org/scribble/core/model/endpoint/EState.java new file mode 100644 index 000000000..e08a3162c --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/endpoint/EState.java @@ -0,0 +1,362 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model.endpoint; + +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedHashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.function.Function; + +import org.scribble.core.model.MPrettyState; +import org.scribble.core.model.MState; +import org.scribble.core.model.ModelFactory; +import org.scribble.core.model.endpoint.actions.EAction; +import org.scribble.core.model.visit.local.EStateVisitor; +import org.scribble.core.type.kind.Local; +import org.scribble.core.type.name.RecVar; +import org.scribble.util.Pair; +import org.scribble.util.ScribException; + +// Label types used to be both RecVar and SubprotocolSigs; now using inlined protocol for FSM building so just RecVar +public class EState extends MPrettyState +{ + protected EState(Set labs) + { + super(labs); + } + + // To be overridden by subclasses, to obtain the subclass nodes + // CHECKME: remove labs arg, and modify the underlying Set if needed ? + protected EState cloneNode(ModelFactory mf, Set labs) + { + //return ef.newEState(this.labs); + return mf.local.EState(labs); + } + + // Fully clones the reachable graph (i.e. the "general" graph -- cf., EGraph, the specific Scribble concept of an endpoint protocol graph) + // N.B. cloning means the states, actions are immutable + protected EState clone(ModelFactory mf) + { + Map clones = new HashMap<>(); // Original s.id -> clone + Function getClone = x -> + { + EState clone = clones.get(x.id); // "clones" is effectively final + if (clone == null) + { + clone = x.cloneNode(mf, x.labs); + clones.put(x.id, clone); + } + return clone; + }; + Set all = getReachableStates(); + all.add(this); + for (EState s : all) // Quadratic after getReachableStates, but simpler code for now + { + Iterator as = s.getActions().iterator(); + Iterator succs = s.getSuccs().iterator(); + EState clone = getClone.apply(s); + while (as.hasNext()) + { + clone.addEdge(as.next(), getClone.apply(succs.next())); + } + } + return clones.get(this.id); + } + + // Pre: succ is the root of the subgraph, and succ is a successor of *"this"* (which is inside the subgraph) + // i.e., this-a->succ ("a" is possibly non-det) + // Returns the clone of the subgraph rooted at succ, with all non- "this-a->succ" actions pruned from the clone of "this" state + // i.e., we took "a" from "this" to get to succ (the subgraph root); if we enter "this" again (inside the subgraph), then always take "a" again + // N.B. cloning means the states, actions are immutable + // Consider gproto annotations to specify which states to unfair-clone, i.e., choice-specific fairness + private EState unfairCloneSubgraph(ModelFactory mf, EState term, EAction a, EState succ) // Need succ param for non-det + { + Map clones = new HashMap<>(); // Original s.id -> clone + Function getClone = x -> + { + EState clone = clones.get(x.id); // "clones" is effectively final + if (clone == null) + { + clone = (term != null && x.id == term.id) + ? term + // Special case: term not cloned, otherwise a mixture of exapanded (and non-expanded) cases may lead to the term being cloned... + // ...potentially multiple times and potentially while the original still remains + : x.cloneNode(mf, Collections.emptySet()); + // CHECKME: remove labs arg from cloneNode and just clear the lab set here ? + // Cf. clone, keeps x.labs + clones.put(x.id, clone); + } + return clone; + }; + Set all = succ.getReachableStates(); + all.add(succ); + for (EState s : all) // Quadratic after getReachableStates, but simpler code for now + { + Iterator as = s.getActions().iterator(); + Iterator succs = s.getSuccs().iterator(); + EState clone = getClone.apply(s); + boolean done = false; + // Restricts adding of *at most* one "this-a->succ" edge out of potentially multiple non-det "a" + // i.e., unfair expansion prunes non-det "a" ("determinizes" entry) from "this" into the cloned subgraph + // Cf. MState.addEdge(A, S), previously implicitly pruned all non-det "this-a->s" for the same "s" + while (as.hasNext()) + { + EAction na = as.next(); + EState ns = succs.next(); + if (s.id != this.id) + { + clone.addEdge(na, getClone.apply(ns)); + } + else if (na.equals(a) && ns.equals(succ) && !done) + // Non-det (to different succ) also pruned from clone of this -- but OK? non-det still preserved on original state, so any safety violations due to non-det will still come out?... + // ...this is like non-fairness extended to defeat even non-determinism ? + { + // s.id == this.id, so "clone" is the clone of "this" + clone.addEdge(na, getClone.apply(ns)); + done = true; + } + } + } + return clones.get(succ.id); + } + + + /* Returns Pair<>(init, term) + * + .. use getallreachable to get subgraph, make a graph clone method + .. for each poly output, clone a (non-det) edge to clone of the reachable subgraph with the clone of the current node pruned to this single choice + .. be careful of original non-det edges, need to do each separately + .. do recursively on the subgraphs, will end up with a normal form with subgraphs without output choices + .. is it equiv to requiring all roles to see every choice path? except initial accepting roles -- yes + .. easier to implement as a direct check on the standard global model, rather than model hacking -- i.e. liveness is not just about terminal sets, but about "branching condition", c.f. julien? + .. the issue is connect/accept -- makes direct check a bit more complicated, maybe value in doing it by model hacking to rely on standard liveness checking? + .. should be fine, check set of roles on each path is equal, except for accept-guarded initial roles + */ + public Pair unfairTransform(ModelFactory mf) + { + EState init = clone(mf); // All state refs from here on are clones, original Graph unmodified + EState term = init.getTerminal(); + Set seen = new HashSet<>(); + Set todo = new LinkedHashSet<>(); // Linked unnecessary, but to follow the iteration pattern + todo.add(init); + while (!todo.isEmpty()) + { + Iterator i = todo.iterator(); + EState curr = i.next(); + i.remove(); + if (seen.contains(curr)) + // Convenient to check here (even though may get curr multiple times) to avoid doing the check before every todo.add + // N.B. todo is also aliased from expandUnfairCases + { + continue; + } + seen.add(curr); + + if (curr.getStateKind() == EStateKind.OUTPUT + && curr.getActions().size() > 1) // >1 makes this algorithm terminating -- in the expanded subgraph, the clone of curr will have all other edges pruned + { + expandUnfairCases(mf, term, todo, curr); + } + else + { + todo.addAll(curr.getSuccs()); + } + } + return new Pair<>(init, term); + } + + // N.B. todo alias from unfairTransform -- refactor as return? (slower) + // Pre: curr.getStateKind() == EStateKind.OUTPUT && curr.getActions().size() > 1 + // All involved states are already clones + private void expandUnfairCases(ModelFactory mf, EState term, Set todo, + EState curr) + { + Iterator as = curr.getActions().iterator(); + Iterator succs = curr.getSuccs().iterator(); + List aclones = new LinkedList<>(); // Actions involved in clones (not actually cloned themselves, immutable) + List succClones = new LinkedList<>(); + Map> toRemove = new HashMap<>(); // Original succ -> actions "a" where "curr-a->succ" + // List needed to handle removing multiple edges to the same state: e.g. mu X.(A->B:1 + A->B:2).X + + while (as.hasNext()) + { + EAction a = as.next(); + EState succ = succs.next(); + if (!succ.canReach(curr)) // Do unfairCloneSubgraph for each (potentially) "recursive" action + { + todo.add(succ); + continue; + } + EState succClone = curr.unfairCloneSubgraph(mf, term, a, succ); // succ is a successor of curr + aclones.add(a); + succClones.add(succClone); + List tmp = toRemove.get(succ); + if (tmp == null) + { + tmp = new LinkedList<>(); + toRemove.put(succ, tmp); + } + tmp.add(a); // To replace original edge with new edge into unfair-cloned subgraph + } + + if (!aclones.isEmpty()) // Redundant (toRemove would also be empty), but more clear + { + for (EState succ : toRemove.keySet()) + { + for (EAction a1 : toRemove.get(succ)) + { + curr.removeEdge(a1, succ); // First, remove original edge to original succ + } + } + Iterator iaclones = aclones.iterator(); + Iterator isuccClones = succClones.iterator(); + while (iaclones.hasNext()) + { + EAction a = iaclones.next(); // Same actions involved in toRemove loop above + EState succClone = isuccClones.next(); // Clones of the succs involved in toRemove loop above + curr.addEdge(a, succClone); // Second, add edge to cloned succ (entry to the unfair-cloned subgraph) + todo.add(succClone); // This will cause unfairTransform to "recursively" visit the nodes of the unfair-cloned subgraph + // Doesn't work if non-det preserved by the "unfairClone" aux (recursively, edges always >1 -- termination condition never met) + // Idea is to bypass succ clone (for non-det, edges>1) but in general this will be cloned again before returning to it, so bypass doesn't work -- to solve this more generally probably need to keep a record of all clones to bypass future clones + } + } + } + + // CHECKME: make an isSync in IOAction ? + // This state is a *necessarily* "blocking" output sync-client (request, clientwrap) state + public boolean isSyncClientOnly() + { + return getStateKind() == EStateKind.OUTPUT + && getActions().stream() + .allMatch(x -> x.isRequest() || x.isClientWrap()); + } + + // CHECKME: return + public void traverse(EStateVisitor v) throws ScribException + { + visitState(v); // "visitNode" + + // "visitChildren" + Iterator as = this.actions.iterator(); + Iterator succs = this.succs.iterator(); + while (as.hasNext()) + { + EAction a = as.next(); + EState succ = succs.next(); + if (!v.hasSeen(succ)) // cf. EdgeVisitor + { + succ.traverse(v.enter(this, a, succ)); + } + } + } + + protected void visitState(EStateVisitor v) throws ScribException + { + // "visitNode" + EStateKind kind = getStateKind(); // CHECKME: explicitly cache kind in EState? this lookup is slow? + switch (kind) + { + case ACCEPT: v.visitAccept(this); break; + case OUTPUT: v.visitOutput(this); break; + case POLY_RECIEVE: v.visitPolyInput(this); break; + case SERVER_WRAP: v.visitServerWrap(this); break; + case TERMINAL: v.visitTerminal(this); break; + case UNARY_RECEIVE: v.visitUnaryInput(this); break; + default: throw new RuntimeException("Unknown state kind: " + kind); + } + } + + public EStateKind getStateKind() + { + List as = this.getActions(); + if (as.size() == 0) + { + return EStateKind.TERMINAL; + } + else + { + if (as.stream() + .allMatch(a -> a.isSend() || a.isRequest() || a.isClientWrap())) // ClientWrap should be unary? + { + return EStateKind.OUTPUT; + } + else if (as.stream().allMatch(EAction::isReceive)) + { + return (as.size() == 1) ? EStateKind.UNARY_RECEIVE : EStateKind.POLY_RECIEVE; + } + else if (as.stream().allMatch(EAction::isAccept)) + { + return EStateKind.ACCEPT; // Distinguish unary for API gen? cf. receive + } + else if (as.size() == 1 && as.get(0).isDisconnect()) + { + return EStateKind.OUTPUT; + } + else if (as.size() == 1 && as.get(0).isServerWrap()) + { + return EStateKind.SERVER_WRAP; + } + else + { + throw new RuntimeException("Shouldn't get in here: " + as); + } + } + } + + /*// Helper factory method for deriving an EGraph from an arbitary EState (but not the primary way to construct EGraphs; cf., EGraphBuilderUtil) + public EGraph toGraph() + { + return new EGraph(this, getTerminal()); // Throws exception if >1 terminal; null if no terminal + }*/ + + @Override + public Set getReachableStates() // CHECKME: consider a "lazy" version? Maybe as an Iterator or Stream + { + return getReachableStatesAux(this); + } + + @Override + public int hashCode() + { + int hash = 83; + hash = 31 * hash + super.hashCode(); // N.B. ultimately uses state ID only + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof EState)) + { + return false; + } + return super.equals(o); // Checks canEquals + } + + @Override + protected boolean canEquals(MState s) + { + return s instanceof EState; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/model/endpoint/EStateKind.java b/scribble-core/src/main/java/org/scribble/core/model/endpoint/EStateKind.java new file mode 100644 index 000000000..1144bc836 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/endpoint/EStateKind.java @@ -0,0 +1,25 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model.endpoint; + +// CHECKME: consider that enums cannot be "extended", for Scribble extensions +public enum EStateKind +{ + TERMINAL, + OUTPUT, // SEND, REQUEST and CLIENT_WRAP + UNARY_RECEIVE, + POLY_RECIEVE, + ACCEPT, // CHECKME: distinguish unary/multi accept? + SERVER_WRAP, +} diff --git a/scribble-core/src/main/java/org/scribble/core/model/endpoint/UnguardedContinueEdge.java b/scribble-core/src/main/java/org/scribble/core/model/endpoint/UnguardedContinueEdge.java new file mode 100644 index 000000000..4244bfdd4 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/endpoint/UnguardedContinueEdge.java @@ -0,0 +1,76 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model.endpoint; + +import org.scribble.core.model.ModelFactory; +import org.scribble.core.model.endpoint.actions.EAction; +import org.scribble.core.model.global.actions.SAction; +import org.scribble.core.type.name.Op; +import org.scribble.core.type.name.RecVar; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Payload; + +class UnguardedContinueEdge extends EAction +{ + public UnguardedContinueEdge(ModelFactory mf, RecVar rv) + { + super(mf, Role.EMPTY_ROLE, new Op(rv.toString()), Payload.EMPTY_PAYLOAD); // HACK + } + + @Override + public EAction toDual(Role self) + { + throw new RuntimeException("Shouldn't get in here: " + this); + } + + @Override + public SAction toGlobal(Role self) + { + throw new RuntimeException("Shouldn't get in here: " + this); + } + + @Override + protected String getCommSymbol() + { + return "#"; + } + + @Override + public int hashCode() + { + int hash = 1021; + hash = 31 * hash + super.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof UnguardedContinueEdge)) + { + return false; + } + return super.equals(o); // Checks canEquals + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof UnguardedContinueEdge; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/model/endpoint/actions/EAcc.java b/scribble-core/src/main/java/org/scribble/core/model/endpoint/actions/EAcc.java new file mode 100644 index 000000000..48be5be4d --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/endpoint/actions/EAcc.java @@ -0,0 +1,79 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model.endpoint.actions; + +import org.scribble.core.model.ModelFactory; +import org.scribble.core.model.global.actions.SAcc; +import org.scribble.core.type.name.MsgId; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Payload; + +public class EAcc extends EAction +{ + public EAcc(ModelFactory mf, Role peer, MsgId mid, Payload pay) + { + super(mf, peer, mid, pay); + } + + @Override + public EReq toDual(Role self) + { + return this.mf.local.EReq(self, this.mid, this.payload); + } + + @Override + public SAcc toGlobal(Role self) + { + return this.mf.global.SAcc(self, this.peer, this.mid, this.payload); + } + + @Override + public int hashCode() + { + int hash = 937; + hash = 31 * hash + super.hashCode(); + return hash; + } + + @Override + public boolean isAccept() + { + return true; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof EAcc)) + { + return false; + } + return super.equals(o); // Does canEquals + } + + public boolean canEquals(Object o) + { + return o instanceof EAcc; + } + + @Override + protected String getCommSymbol() + { + return "??"; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/model/endpoint/actions/EAction.java b/scribble-core/src/main/java/org/scribble/core/model/endpoint/actions/EAction.java new file mode 100644 index 000000000..f6fdbaa33 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/endpoint/actions/EAction.java @@ -0,0 +1,122 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model.endpoint.actions; + +import org.scribble.core.model.MAction; +import org.scribble.core.model.ModelFactory; +import org.scribble.core.model.global.actions.SAction; +import org.scribble.core.type.kind.Local; +import org.scribble.core.type.name.MsgId; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Payload; + +public abstract class EAction extends MAction +{ + public final Role peer; + + protected final ModelFactory mf; // Internalising better ensures all constructions points (in a Scrib extension) consistently use the same ef/sf + + protected EAction(ModelFactory mf, Role peer, MsgId mid, Payload pay) + { + super(peer, mid, pay); + this.peer = peer; + this.mf = mf; + } + + // "self" means self of "this" (self of dual is this.peer) + public abstract EAction toDual(Role self); + public abstract SAction toGlobal(Role self); + + public boolean isSend() + { + return false; + } + + public boolean isReceive() + { + return false; + } + + public boolean isRequest() + { + return false; + } + + public boolean isDisconnect() + { + return false; + } + + public boolean isAccept() + { + return false; + } + + public boolean isClientWrap() + { + return false; + } + + public boolean isServerWrap() + { + return false; + } +} + + + + + + + + + + + + + + /*@Override + public String toString() + { + return this.peer + getCommSymbol() + this.mid + this.payload; + } + + protected abstract String getCommSymbol();*/ + + /*@Override + public int hashCode() + { + int hash = 919; + hash = 31 * hash + super.hashCode(); + hash = 31 * hash + this.peer.hashCode(); // No: peer is this.obj + return hash; + }*/ + + /*@Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof IOAction)) + { + return false; + } + IOAction a = (IOAction) o; + return a.canEqual(this) && + this.peer.equals(a.peer) && this.mid.equals(a.mid) && this.payload.equals(a.payload); + } + + public abstract boolean canEqual(Object o);*/ diff --git a/scribble-core/src/main/java/org/scribble/core/model/endpoint/actions/EClientWrap.java b/scribble-core/src/main/java/org/scribble/core/model/endpoint/actions/EClientWrap.java new file mode 100644 index 000000000..a72ac7545 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/endpoint/actions/EClientWrap.java @@ -0,0 +1,82 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model.endpoint.actions; + +import org.scribble.core.model.ModelFactory; +import org.scribble.core.model.global.actions.SClientWrap; +import org.scribble.core.type.name.Op; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Payload; + +// Wrap at the client side +// Duplicated from Disconnect +public class EClientWrap extends EAction +{ + public EClientWrap(ModelFactory ef, Role peer) + { + super(ef, peer, Op.EMPTY_OP, Payload.EMPTY_PAYLOAD); // Must correspond with GWrap.UNIT_MESSAGE_SIG_NODE + } + + @Override + public EServerWrap toDual(Role self) + { + return this.mf.local.EServerWrap(self); + } + + @Override + public SClientWrap toGlobal(Role self) + { + return this.mf.global.SClientWrap(self, this.peer); + } + + @Override + public int hashCode() + { + int hash = 1061; + hash = 31 * hash + super.hashCode(); + return hash; + } + + @Override + public boolean isClientWrap() + { + return true; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof EClientWrap)) + { + return false; + } + return super.equals(o); // Does canEquals + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof EClientWrap; + } + + @Override + protected String getCommSymbol() + { + return "(!!)"; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/model/endpoint/actions/EDisconnect.java b/scribble-core/src/main/java/org/scribble/core/model/endpoint/actions/EDisconnect.java new file mode 100644 index 000000000..e22b334d2 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/endpoint/actions/EDisconnect.java @@ -0,0 +1,81 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model.endpoint.actions; + +import org.scribble.core.model.ModelFactory; +import org.scribble.core.model.global.actions.SDisconnect; +import org.scribble.core.type.name.Op; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Payload; + +public class EDisconnect extends EAction +{ + public EDisconnect(ModelFactory ef, Role peer) + { + super(ef, peer, Op.EMPTY_OP, Payload.EMPTY_PAYLOAD); // Must correspond with GDisconnect.UNIT_MESSAGE_SIG_NODE + } + + @Override + public EDisconnect toDual(Role self) + { + return this; + } + + @Override + public SDisconnect toGlobal(Role self) + { + return this.mf.global.SDisconnect(self, this.peer); + } + + @Override + public boolean isDisconnect() + { + return true; + } + + @Override + public int hashCode() + { + int hash = 1009; + hash = 31 * hash + super.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof EDisconnect)) + { + return false; + } + return super.equals(o); // Does canEquals + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof EDisconnect; + } + + @Override + protected String getCommSymbol() + { + //return "\u00A1\u00A1"; + return "-/-"; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/model/endpoint/actions/ERecv.java b/scribble-core/src/main/java/org/scribble/core/model/endpoint/actions/ERecv.java new file mode 100644 index 000000000..48d8311c9 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/endpoint/actions/ERecv.java @@ -0,0 +1,82 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model.endpoint.actions; + +import org.scribble.core.model.ModelFactory; +import org.scribble.core.model.global.actions.SRecv; +import org.scribble.core.type.name.MsgId; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Payload; + +public class ERecv extends EAction +{ + + public ERecv(ModelFactory ef, Role peer, MsgId mid, Payload pay) + { + super(ef, peer, mid, pay); + } + + @Override + public ESend toDual(Role self) + { + return this.mf.local.ESend(self, this.mid, this.payload); + } + + @Override + public SRecv toGlobal(Role self) + { + return this.mf.global.SRecv(self, this.peer, this.mid, this.payload); + + } + + @Override + public int hashCode() + { + int hash = 947; + hash = 31 * hash + super.hashCode(); + return hash; + } + + @Override + public boolean isReceive() + { + return true; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof ERecv)) + { + return false; + } + return super.equals(o); // Does canEquals + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof ERecv; + } + + @Override + protected String getCommSymbol() + { + return "?"; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/model/endpoint/actions/EReq.java b/scribble-core/src/main/java/org/scribble/core/model/endpoint/actions/EReq.java new file mode 100644 index 000000000..65dfe0af9 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/endpoint/actions/EReq.java @@ -0,0 +1,80 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model.endpoint.actions; + +import org.scribble.core.model.ModelFactory; +import org.scribble.core.model.global.actions.SReq; +import org.scribble.core.type.name.MsgId; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Payload; + +public class EReq extends EAction +{ + public EReq(ModelFactory ef, Role peer, MsgId mid, Payload pay) + { + super(ef, peer, mid, pay); + } + + @Override + public EAcc toDual(Role self) + { + return this.mf.local.EAcc(self, this.mid, this.payload); + } + + @Override + public SReq toGlobal(Role self) + { + return this.mf.global.SReq(self, this.peer, this.mid, this.payload); + } + + @Override + public int hashCode() + { + int hash = 929; + hash = 31 * hash + super.hashCode(); + return hash; + } + + @Override + public boolean isRequest() + { + return true; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof EReq)) + { + return false; + } + return super.equals(o); // Does canEquals + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof EReq; + } + + @Override + protected String getCommSymbol() + { + return "!!"; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/model/endpoint/actions/ESend.java b/scribble-core/src/main/java/org/scribble/core/model/endpoint/actions/ESend.java new file mode 100644 index 000000000..127081efb --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/endpoint/actions/ESend.java @@ -0,0 +1,81 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model.endpoint.actions; + +import org.scribble.core.model.ModelFactory; +import org.scribble.core.model.global.actions.SSend; +import org.scribble.core.type.name.MsgId; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Payload; + +public class ESend extends EAction +{ + + public ESend(ModelFactory ef, Role peer, MsgId mid, Payload pay) + { + super(ef, peer, mid, pay); + } + + @Override + public ERecv toDual(Role self) + { + return this.mf.local.ERecv(self, this.mid, this.payload); + } + + @Override + public SSend toGlobal(Role self) + { + return this.mf.global.SSend(self, this.peer, this.mid, this.payload); + } + + @Override + public int hashCode() + { + int hash = 953; + hash = 31 * hash + super.hashCode(); + return hash; + } + + @Override + public boolean isSend() + { + return true; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof ESend)) + { + return false; + } + return super.equals(o); // Does canEquals + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof ESend; + } + + @Override + protected String getCommSymbol() + { + return "!"; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/model/endpoint/actions/EServerWrap.java b/scribble-core/src/main/java/org/scribble/core/model/endpoint/actions/EServerWrap.java new file mode 100644 index 000000000..3d2258042 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/endpoint/actions/EServerWrap.java @@ -0,0 +1,82 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model.endpoint.actions; + +import org.scribble.core.model.ModelFactory; +import org.scribble.core.model.global.actions.SServerWrap; +import org.scribble.core.type.name.Op; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Payload; + +// Wrap at the server side +// Duplicated from Disconnect +public class EServerWrap extends EAction +{ + public EServerWrap(ModelFactory ef, Role peer) + { + super(ef, peer, Op.EMPTY_OP, Payload.EMPTY_PAYLOAD); // Must correspond with GWrap.UNIT_MESSAGE_SIG_NODE + } + + @Override + public EClientWrap toDual(Role self) + { + return this.mf.local.EClientWrap(self); + } + + @Override + public SServerWrap toGlobal(Role self) + { + return this.mf.global.SServerWrap(self, this.peer); + } + + @Override + public int hashCode() + { + int hash = 1063; + hash = 31 * hash + super.hashCode(); + return hash; + } + + @Override + public boolean isServerWrap() + { + return true; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof EServerWrap)) + { + return false; + } + return super.equals(o); // Does canEquals + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof EServerWrap; + } + + @Override + protected String getCommSymbol() + { + return "(??)"; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/model/global/SConfig.java b/scribble-core/src/main/java/org/scribble/core/model/global/SConfig.java new file mode 100644 index 000000000..3391b5d4e --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/global/SConfig.java @@ -0,0 +1,455 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model.global; + +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedHashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.scribble.core.model.ModelFactory; +import org.scribble.core.model.endpoint.EFsm; +import org.scribble.core.model.endpoint.EState; +import org.scribble.core.model.endpoint.EStateKind; +import org.scribble.core.model.endpoint.actions.EAcc; +import org.scribble.core.model.endpoint.actions.EAction; +import org.scribble.core.model.endpoint.actions.EDisconnect; +import org.scribble.core.model.endpoint.actions.ERecv; +import org.scribble.core.model.endpoint.actions.EReq; +import org.scribble.core.model.endpoint.actions.ESend; +import org.scribble.core.model.endpoint.actions.EClientWrap; +import org.scribble.core.model.endpoint.actions.EServerWrap; +import org.scribble.core.type.name.Role; + +// Immutable -- async/sync (i.e, "fire") return updated copies (in the general case, they must return List anyway due to non-det) +public class SConfig +{ + protected final ModelFactory mf; + + public final Map efsms; + public final SingleBuffers queues; // N.B. currently hardcoded to capacity one + + protected SConfig(ModelFactory mf, Map state, SingleBuffers queues) + { + this.mf = mf; + this.efsms = Collections.unmodifiableMap(state); + this.queues = queues; + } + + // N.B. Set (not List> getFireable() + { + Map> res = new HashMap<>(); + for (Role self : this.efsms.keySet()) + { + EFsm fsm = this.efsms.get(self); + Set as = new LinkedHashSet<>(); + switch (fsm.curr.getStateKind()) // Choice subject enabling needed for non-mixed states (mixed states would be needed for async. permutations though) + { + // Currently not convenient to delegate to states, as state types not distinguished + case TERMINAL: break; + case OUTPUT: as.addAll(getOutputFireable(self, fsm)); break; + case UNARY_RECEIVE: + case POLY_RECIEVE: + as.addAll(getReceiveFireable(self, fsm)); // addAll for generic typing + break; + case ACCEPT: as.addAll(getAcceptFireable(self, fsm)); break; + case SERVER_WRAP: as.addAll(getServerWrapFireable(self, fsm)); break; + default: throw new RuntimeException("Unknown state kind: " + fsm); + } + if (!as.isEmpty()) // Guards against res.put for empty "as", but perhaps unnecessary? + { + res.put(self, as); + } + } + return res; + } + + // Pre: fsm.curr.getStateKind() == EStateKind.OUTPUT + // fsm is self's Efsm + // (N.B. return Set, not List -- see getFireable) + protected Set getOutputFireable(Role self, EFsm fsm) // "output" and "client" actions + { + Set res = new LinkedHashSet<>(); + for (EAction a : fsm.curr.getActions()) // Actions may be a mixture of the following cases + { + // Async + if (a.isSend() || a.isDisconnect()) // For disconnect, only one "a" + { + if ((a.isSend() && this.queues.canSend(self, (ESend) a)) + || (a.isDisconnect() + && this.queues.canDisconnect(self, (EDisconnect) a))) + { + res.add(a); + } + } + // Sync + else if (a.isRequest() || a.isClientWrap()) + { + if ((a.isRequest() && this.queues.canRequest(self, (EReq) a)) + || (a.isClientWrap() + && this.queues.canClientWrap(self, (EClientWrap) a))) + { + if (this.efsms.get(a.peer).curr.getActions().stream() + .anyMatch(x -> a.toDual(self).equals(x))) // anyMatch (i.e., add "a" at most once), cf. getAcceptable + { + res.add(a); + } + } + } + else + { + throw new RuntimeException("Unknown output action kind: " + a); + } + } + return res; + } + + // Pre: fsm.curr.getStateKind() == EStateKind.UNARY_RECEIVE or POLY_RECIEVE + // Unary or poly receive + // (N.B. return Set, not List -- see getFireable) + protected Set getReceiveFireable(Role self, EFsm fsm) + { + return fsm.curr.getActions().stream().map(x -> (ERecv) x) + .filter(x -> this.queues.canReceive(self, x)) + .collect(Collectors.toSet()); + } + + // Pre: fsm.curr.getStateKind() == EStateKind.ACCEPT + // (N.B. return Set, not List -- see getFireable) + protected Set getAcceptFireable(Role self, EFsm fsm) + { + List as = fsm.curr.getActions(); + Role peer = as.get(0).peer; // All peer's the same + List peeras = this.efsms.get(peer).curr.getActions(); + return fsm.curr.getActions().stream().map(x -> (EAcc) x) + .filter(x -> this.queues.canAccept(self, x) + && peeras.stream().anyMatch(y -> y.toDual(peer).equals(x))) + .collect(Collectors.toSet()); + } + + // Pre: fsm.curr.getStateKind() == EStateKind.SERVER_WRAP + // (N.B. return Set, not List -- see getFireable) + // Duplicated from getAcceptFireable + protected Set getServerWrapFireable(Role self, EFsm fsm) + { + List as = fsm.curr.getActions(); // Actually for ServerWrap, size() == 1 + Role peer = as.get(0).peer; // All peer's the same + List peeras = this.efsms.get(peer).curr.getActions(); + return fsm.curr.getActions().stream().map(x -> (EServerWrap) x) + .filter(x -> this.queues.canServerWrap(self, x) + && peeras.stream().anyMatch(y -> y.toDual(peer).equals(x))) + .collect(Collectors.toSet()); + } + + // Pre: getFireable().get(self).contains(a) + // Here, produce a List that distinguishes non-det to identical configs -- CHECKME: shouldn't? (Set would be sufficient for non-det to different configs) + // (Actual global model building (e.g., SGraphBuilderUtil.getSuccs) will collapse identical configs) + public List async(Role self, EAction a) + { + List res = new LinkedList<>(); + List succs = this.efsms.get(self).getSuccs(a); + for (EFsm succ : succs) + { + Map efsms = new HashMap<>(this.efsms); + efsms.put(self, succ); + SingleBuffers queues = // N.B. queue updates are insensitive to non-det "a" + a.isSend() ? this.queues.send(self, (ESend) a) + : a.isReceive() ? this.queues.receive(self, (ERecv) a) + : a.isDisconnect() ? this.queues.disconnect(self, (EDisconnect) a) + : null; + if (queues == null) + { + throw new RuntimeException("Shouldn't get in here: " + a); + } + res.add(this.mf.global.SConfig(efsms, queues)); + } + return res; + } + + // "Synchronous version" of fire + // Pre: getFireable().get(r1).contains(a1) && getFireable().get(r2).contains(a2), where a1 and a2 are a "sync" pair (e.g., matching message) + // Here, produce a List that distinguishes non-det to identical configs -- CHECKME: shouldn't? (Set would be sufficient for non-det to different configs) + // (Actual global model building (e.g., SGraphBuilderUtil.getSuccs) will collapse identical configs) + public List sync(Role r1, EAction a1, Role r2, EAction a2) + { + List res = new LinkedList<>(); + List succs1 = this.efsms.get(r1).getSuccs(a1); + List succs2 = this.efsms.get(r2).getSuccs(a2); + for (EFsm succ1 : succs1) + { + for (EFsm succ2 : succs2) + { + Map efsms = new HashMap<>(this.efsms); + // a1 and a2 are a "sync" pair, add all combinations of succ1 and succ2 that may arise + efsms.put(r1, succ1); // Overwrite existing r1/r2 entries + efsms.put(r2, succ2); + SingleBuffers queues; + // a1 and a2 definitely "sync", now just determine whether it is a connect or wrap + if (((a1.isRequest() && a2.isAccept()) + || (a1.isAccept() && a2.isRequest()))) + { + queues = this.queues.connect(r1, r2); // N.B. queue updates are insensitive to non-det "a" + } + else if (((a1.isClientWrap() && a2.isServerWrap()) + || (a1.isServerWrap() && a2.isClientWrap()))) + { + // Doesn't affect queue state + queues = this.queues; // OK, immutable? + } + else + { + throw new RuntimeException("Shouldn't get in here: " + a1 + ", " + a2); + } + res.add(this.mf.global.SConfig(efsms, queues)); + } + } + return res; + } + + /*// CHECKME: rename -- not just termination, could be unconnected/uninitiated + public boolean isSafeTermination() + { + return this.efsms.keySet().stream().allMatch(x -> canSafelyTerminate(x)); + }*/ + + // Should work both with and without accept-correlation? + public boolean canSafelyTerminate(Role r) + { + EFsm fsm = this.efsms.get(r); + boolean safe = this.queues.isEmpty(r) && (fsm.curr.isTerminal() || + (fsm.curr.getStateKind().equals(EStateKind.ACCEPT) && fsm.isInitial())); // Specifically the initial state + + // CHECKME: incorrectly allows stuck accepts? if inactive not initial, should be clone of initial? + //|| (s.getStateKind().equals(Kind.ACCEPT) && this.states.keySet().stream().noneMatch((rr) -> !r.equals(rr) && this.queues.isConnected(r, rr))) + return safe; + } + + // Stuck due to non-consumable messages (reception errors) + public Map getStuckMessages() + { + Map res = new HashMap<>(); + for (Role self : this.efsms.keySet()) + { + EFsm s = this.efsms.get(self); + EStateKind k = s.curr.getStateKind(); + if (k == EStateKind.UNARY_RECEIVE || k == EStateKind.POLY_RECIEVE) + { + Role peer = s.curr.getActions().get(0).peer; // Pre: consistent ext choice subj + ESend send = this.queues.getQueue(self).get(peer); + if (send != null) + { + ERecv recv = send.toDual(peer); + if (!s.curr.hasAction(recv)) + { + res.put(self, recv); + } + } + } + /*else if (k == Kind.ACCEPT) // CHECKME: ..and request (Client/ServerWrap? -- factor out "blocking"? async. blocking vs. sync? n.b. outputs blocking on queue space) + { + // CHECKME: issue is, unlike regular input states, blocked connect/accept may become unblocked later, so queued messages may not actually be stuck + // (if message is queued on the actual blocked connection, it should be orphan message) + // so, message is stuck only if connect/accept is genuinely deadlocked, which will be detected as that + }*/ + } + return res; + } + + // Doesn't include locally terminated (single term state does not induce a deadlock cycle) + public Set> getWaitForCycles() + { + Set> res = new HashSet<>(); + List todo = new LinkedList<>(this.efsms.keySet()); + while (!todo.isEmpty()) // CHECKME: maybe better to do directly on states, rather than via roles -- ? + { + Role r = todo.remove(0); + if (this.efsms.get(r).curr.isTerminal()) + { + continue; + } + Set cycle = isWaitForCycle(r); + if (cycle != null) + { + res.add(cycle); + todo.removeAll(cycle); + } + } + return res; + } + + // Return: null if no cycle -- terminated peer means no cycle (cf. getUnfinishedRoles) + // Includes connect dependencies + // N.B. if this.states.get(init).isTerminal() then orig is returned as "singleton deadlock" -- CHECKME + protected Set isWaitForCycle(Role init) + { + Set cycle = new LinkedHashSet<>(); + Set todo = new LinkedHashSet<>(Arrays.asList(init)); + while (!todo.isEmpty()) + { + Role r = todo.iterator().next(); + todo.remove(r); + cycle.add(r); + Set waitingFor = getWaitingFor(r); + if (waitingFor == null) // "r" is not necessarily waiting for anyone, so report no cycle + { + return null; + } + waitingFor.stream().filter(x -> !cycle.contains(x)) // Only more than one when client-sync cases + .forEachOrdered(x -> todo.add(x)); // todo is a Set, so re-add existing doesn't matter + } + return cycle; + } + + // Return: set of roles that "r" *must* wait for one of them in order to proceed;.. + // ..or null if "r" is not *necessarily* blocked waiting for *another role* + // Wait-for blocking includes sync-client (request, clientWrap) roles + protected Set getWaitingFor(Role r) + { + EFsm fsm = this.efsms.get(r); + EStateKind k = fsm.curr.getStateKind(); + if (k == EStateKind.TERMINAL) + { + return null; + } + + if (k == EStateKind.UNARY_RECEIVE || k == EStateKind.POLY_RECIEVE) + { + ERecv a = (ERecv) fsm.curr.getActions().get(0); // Pre: consistent ext choice subject -- CHECKME: generalise? + if (this.queues.getQueue(r).get(a.peer) != null) // Here, only looking for any message (not a.toDual, nor dual of any action, cf. stuck error) + { + return null; + } + return Stream.of(a.peer).collect(Collectors.toSet()); + } + else if (k == EStateKind.ACCEPT) + { + if (fsm.isInitial()) // TODO CHECKME: if analysing ACCEPTs, check if "s" is initial (not "deadlock blocked" if initial) -- no: instead, analysing requests + { + return null; + } + List as = fsm.curr.getActions(); // All accept + Role peer = as.get(0).peer; // Pre: consistent ext choice subject -- CHECKME: generalise? + if (this.efsms.get(peer).curr.getActions().stream() + .anyMatch(x -> as.contains(x.toDual(peer)))) + { + return null; + } + return Stream.of(peer).collect(Collectors.toSet()); + } + else if (k == EStateKind.OUTPUT) //|| k == Kind.ACCEPT .. // CHECKME: check requests if no available sends -- ? + { + if (!fsm.curr.isSyncClientOnly()) // Request, ClientWrap + { + return null; + } + List as = fsm.curr.getActions(); + Set res = new HashSet(); + for (EAction a : as) + { + if (this.efsms.get(a.peer).curr.getActions().contains(a.toDual(r))) + { + return null; + } + res.add(a.peer); + } + return res; // Non-empty, because as.size() > 0 and didn't already return + } + // TODO FIXME: ServerWrap + throw new RuntimeException("[TODO] " + k); + } + + // Includes "unconnected" messages -- CHECKME: should unconnected messages be considered as "stuck" instead? + public Map> getOrphanMessages() + { + Map> res = new HashMap<>(); + for (Role r : this.efsms.keySet()) + { + Set orphs = new HashSet<>(); + EFsm fsm = this.efsms.get(r); + if (fsm.curr.isTerminal()) // Local termination of r, i.e. not necessarily "full deadlock cycle" + { + orphs.addAll(this.queues.getQueue(r).values().stream() + .filter(v -> v != null).collect(Collectors.toSet())); + } + else + { + this.efsms.keySet().stream() + .filter(x -> !r.equals(x) && !this.queues.isConnected(r, x)) // !isConnected(r, x), means r considers its side closed + .map(x -> this.queues.getQueue(r).get(x)).filter(x -> x != null) // r's side is closed, but remaining message(s) in r's buff + .forEachOrdered(x -> orphs.add(x)); + } + if (!orphs.isEmpty()) + { + res.put(r, orphs); + } + } + return res; + } + + // Not just "unfinished", but also "non-initiated" (accept guarded) -- though could be non-initiated after some previous completions + // Maybe not needed? previously not used (even without accept-correlation check) + public Map getUnfinishedRoles() + { + if (!getFireable().isEmpty()) + // Once no fireable, then finished (no further fireable will be produced) + // N.B. must check getFireable -- cf. terminal state kind is only when no actions, does not include when actions are stuck + { + return Collections.emptyMap(); + } + return this.efsms.entrySet().stream() + .filter(x -> !canSafelyTerminate(x.getKey())) + .collect(Collectors.toMap(Entry::getKey, x -> x.getValue().curr)); + } + + @Override + public String toString() + { + return "(" + this.efsms + ", " + this.queues + ")"; + } + + @Override + public int hashCode() + { + int hash = 71; + hash = 31 * hash + this.efsms.hashCode(); + hash = 31 * hash + this.queues.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof SConfig)) + { + return false; + } + SConfig c = (SConfig) o; + return this.efsms.equals(c.efsms) && this.queues.equals(c.queues); + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/model/global/SGraph.java b/scribble-core/src/main/java/org/scribble/core/model/global/SGraph.java new file mode 100644 index 000000000..837965cd3 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/global/SGraph.java @@ -0,0 +1,407 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model.global; + +import java.util.Collections; +import java.util.Deque; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.scribble.core.model.MPrettyPrint; +import org.scribble.core.model.global.actions.SAction; +import org.scribble.core.type.name.GProtoName; +import org.scribble.util.Pair; + +public class SGraph implements MPrettyPrint +{ + public final GProtoName proto; // For debugging only? deprecate? + + public final SState init; + public final Map states; // s.id -> s + + private final Set> termSets; + + // Unlike EState, SGraph is not just a "simple wrapper" for an existing graph of nodes -- it is a computed structure, so no lightweight "toGraph" wrapper method; cf., EState + protected SGraph(GProtoName proto, Map states, SState init) + { + this.proto = proto; + this.init = init; + this.states = Collections.unmodifiableMap(states); // s.id -> s + //this.reach = getReachabilityMap(); + + // TODO: refactor + tarjan(); + Set> termSets = new HashSet<>(); + for (Set scc : this.sscs) + { + if (scc.size() == 1 && scc.iterator().next().isTerminal() + || scc.stream().anyMatch( + y -> y.getSuccs().stream().anyMatch(x -> !scc.contains(x)))) + { + continue; + } + //termSets.add(scc.stream().map(x -> x.id).collect(Collectors.toSet())); + termSets.add(Collections.unmodifiableSet(scc)); + } + this.termSets = Collections.unmodifiableSet(termSets); + } + + public Set> getTermSets() + { + return this.termSets; // Already unmodifiable + } + + // Returns null if end cannot be reached + public List getTraceFromInit(SState end) + { + Map> traces = bfsFromInit(end); + LinkedList trace = new LinkedList<>(); + for (int id = end.id; id != init.id; ) // Skipped if init.id == end.id (e.g., error in init state, such as a bad connect) + { + Pair p = traces.get(id); + trace.push(p.left); + id = p.right; + } + return trace; + } + + // Returns null if end cannot be reached + private Map> bfsFromInit(SState end) // (cf., Dijkstra's with all weights 1) + { + // SState.id faster as keys than full SConfig + Set seen = new HashSet<>(); + List todo = new LinkedList<>(); + seen.add(this.init.id); + todo.add(this.init.id); + Map> traces = new HashMap<>(); + while (!todo.isEmpty()) + { + Iterator i = todo.iterator(); + Integer currid = i.next(); + i.remove(); + if (currid == end.id) + { + return traces; + } + SState curr = this.states.get(currid); + Iterator as = curr.getActions().iterator(); // CHECKME: how about non-det actions? (cf. below, todo.contains(succ.id)? e.g., bad.liveness.messagelive.Test01) + for (SState succ : curr.getSuccs()) + { + SAction a = as.next(); + if (seen.contains(succ.id) || todo.contains(succ.id)) + { + continue; + } + seen.add(succ.id); + traces.put(succ.id, new Pair<>(a, currid)); + todo.add(succ.id); + } + } + return null; + } + + @Override + public String toDot() + { + return this.init.toDot(); + } + + @Override + public String toAut() + { + return this.init.toAut(); + } + + @Override + public String toString() + { + return this.init.toString(); + } + + // Following are "one-time" usage, on instance construction + // SState.id faster as keys than full SConfig + private int counter = 0; + private Map indices = new HashMap<>(); // s.id -> index + private Map lowlinks = new HashMap<>(); // s.id -> lowlink + private Deque stack = new LinkedList<>(); + private Set onStack = new HashSet<>(); + private Set> sscs = new HashSet<>(); + + private void tarjan() + { + for (SState v : this.states.values()) + { + if (!indices.containsKey(v.id)) + { + strongConnect(v); + } + } + } + + private void strongConnect(SState v) + { + // Set the depth index for v to the smallest unused index + int index = this.counter++; + this.indices.put(v.id, index); + this.lowlinks.put(v.id, index); + this.stack.push(v); + this.onStack.add(v.id); + + // Consider successors of v + for (SState w : v.getSuccs()) + { + if (!this.indices.containsKey(w.id)) + { + // Successor w has not yet been visited; recurse on it + strongConnect(w); + int vlowlink = this.lowlinks.get(v.id); + int wlowlink = this.lowlinks.get(w.id); + this.lowlinks.put(v.id, (vlowlink <= wlowlink ? vlowlink : wlowlink)); + } + else if (this.onStack.contains(w.id)) + { + // Successor w is in stack S and hence in the current SCC + // If w is not on stack, then (v, w) is a cross-edge in the DFS tree and must be ignored + // Note: The next line may look odd - but is correct. + // It says w.index not w.lowlink; that is deliberate and from the original paper + int vlowlink = this.lowlinks.get(v.id); + int windex = this.indices.get(w.id); + this.lowlinks.put(v.id, (vlowlink <= windex ? vlowlink : windex)); + } + } + + // If v is a root node, pop the stack and generate an SCC + if (this.lowlinks.get(v.id) == this.indices.get(v.id)) + { + Set ssc = new HashSet<>(); + SState w; + do + { + w = this.stack.pop(); + this.onStack.remove(w.id); + ssc.add(w); + } + while (w.id != v.id); + this.sscs.add(ssc); + } + } + + + + + + + + + + + + + + /* + private Map> reach; // State ID -> reachable states (not reflexive) + + public Set> getTerminalSets() + { + if (this.termSets != null) + { + return this.termSets; + } + + Set> termSets = new HashSet<>(); + Set> checked = new HashSet<>(); + for (Integer i : reach.keySet()) + { + SState s = this.states.get(i); + Set rs = this.reach.get(s.id); + if (!checked.contains(rs) && rs.contains(s.id)) + { + checked.add(rs); + if (isTerminalSetMember(s)) + { + termSets.add(rs); + } + } + } + this.termSets = Collections.unmodifiableSet(termSets); + return this.termSets; + } + + private boolean isTerminalSetMember(SState s) + { + Set rs = this.reach.get(s.id); // Pre: rs.contains(s.id) + Set tmp = new HashSet<>(rs); + tmp.remove(s.id); // Unnecessary to remove, but this.reach.get(r).equals(rs) check below trivially holds by def + for (Integer r : tmp) + { + if (!this.reach.containsKey(r) || !this.reach.get(r).equals(rs)) + { + return false; + } + } + return true; + } + + // Not reflexive + public Map> getReachabilityMap() + { + if (this.reach != null) + { + return this.reach; + } + + Map idToIndex = new HashMap<>(); // state ID -> array index + Map indexToId = new HashMap<>(); // array index -> state ID + int i = 0; + for (SState s : this.states.values()) + { + idToIndex.put(s.id, i); + indexToId.put(i, s.id); + i++; + } + this.reach = getReachabilityAux(idToIndex, indexToId); + + return this.reach; + } + + private Map> getReachabilityAux( + Map idToIndex, Map indexToId) + { + int size = idToIndex.keySet().size(); + boolean[][] reach = new boolean[size][size]; + + for (Integer s1id : idToIndex.keySet()) + { + for (SState s2 : this.states.get(s1id).getSuccs()) + { + reach[idToIndex.get(s1id)][idToIndex.get(s2.id)] = true; + } + } + + for (boolean again = true; again; ) + { + again = false; + for (int i = 0; i < size; i++) + { + for (int j = 0; j < size; j++) + { + if (reach[i][j]) + { + for (int k = 0; k < size; k++) + { + if (reach[j][k] && !reach[i][k]) + { + reach[i][k] = true; + again = true; + } + } + } + } + } + } + + Map> res = new HashMap<>(); + for (int i = 0; i < size; i++) + { + Set tmp = res.get(indexToId.get(i)); + for (int j = 0; j < size; j++) + { + if (reach[i][j]) + { + if (tmp == null) + { + tmp = new HashSet<>(); + res.put(indexToId.get(i), tmp); + } + tmp.add(indexToId.get(j)); + } + } + } + + return Collections.unmodifiableMap(res); + } + + public List getTrace(SState start, SState end) + { + SortedMap> candidates = new TreeMap<>(); + Set dis0 = new LinkedHashSet(); + dis0.add(start.id); + candidates.put(0, dis0); + + Set seen = new HashSet<>(); + seen.add(start.id); + + return getTraceAux(new LinkedList<>(), seen, candidates, end); + } + + // Djikstra's + private List getTraceAux(List trace, Set seen, + SortedMap> candidates, SState end) + { + Integer dis = candidates.keySet().iterator().next(); + Set cs = candidates.get(dis); + Iterator it = cs.iterator(); + Integer currid = it.next(); + it.remove(); + if (cs.isEmpty()) + { + candidates.remove(dis); + } + + SState curr = this.states.get(currid); + Iterator as = curr.getActions().iterator(); + Iterator succs = curr.getSuccs().iterator(); + while (as.hasNext()) + { + SAction a = as.next(); + SState succ = succs.next(); + if (succ.id == end.id) + { + trace.add(a); + return trace; + } + + if (!seen.contains(succ.id)) + //&& this.reach.containsKey(s.id) && this.reach.get(s.id).contains(end.id)) + { + seen.add(succ.id); + if (succ.isTerminal()) // Unnecesary, visiting succ will do "while (as.hasNext())" + { + continue; + } + Set tmp1 = candidates.get(dis+1); + if (tmp1 == null) + { + tmp1 = new HashSet<>(); + candidates.put(dis+1, tmp1); + } + tmp1.add(succ.id); + List tmp2 = new LinkedList<>(trace); + tmp2.add(a); + List res = getTraceAux(tmp2, seen, candidates, end); // FIXME: replace by a loop + if (res != null) + { + return res; + } + } + } + return null; + } + //*/ +} \ No newline at end of file diff --git a/scribble-core/src/main/java/org/scribble/core/model/global/SGraphBuilder.java b/scribble-core/src/main/java/org/scribble/core/model/global/SGraphBuilder.java new file mode 100644 index 000000000..25f33a7e6 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/global/SGraphBuilder.java @@ -0,0 +1,126 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model.global; + +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedHashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.stream.Collectors; + +import org.scribble.core.job.Core; +import org.scribble.core.model.endpoint.EFsm; +import org.scribble.core.model.endpoint.EGraph; +import org.scribble.core.model.endpoint.actions.EAction; +import org.scribble.core.model.global.actions.SAction; +import org.scribble.core.type.name.GProtoName; +import org.scribble.core.type.name.Role; +import org.scribble.util.ScribException; + +public class SGraphBuilder +{ + public final Core core; + + private final SGraphBuilderUtil util; + + public SGraphBuilder(Core core) + { + this.core = core; + this.util = this.core.config.mf.global.SGraphBuilderUtil(); + } + + // Do as an initial state rather than config? + protected SConfig createInitConfig(Map egraphs, + boolean explicit) + { + Map efsms = egraphs.entrySet().stream() + .collect(Collectors.toMap(Entry::getKey, e -> e.getValue().toFsm())); + SingleBuffers b0 = new SingleBuffers(efsms.keySet(), !explicit); + return this.core.config.mf.global.SConfig(efsms, b0); + } + + // Factory method: not fully integrated with SGraph constructor because of Job arg (debug printing) + // Also checks for non-deterministic payloads + // Maybe refactor into an SGraph builder util; cf., EGraphBuilderUtil -- but not Visitor-based building (cf. EndpointGraphBuilder), this isn't an AST algorithm + public SGraph build(Map egraphs, boolean explicit, + GProtoName fullname) throws ScribException + { + this.util.reset(); + + SConfig c0 = createInitConfig(egraphs, explicit); + SState init = this.util.newState(c0); + Set todo = new LinkedHashSet<>(); // Consider Map, faster than full SConfig hash ? + todo.add(init); + for (//int debugCount = 1 + ; !todo.isEmpty(); ) // Compute configs and use util to construct graph, until no more new configs + { + Iterator i = todo.iterator(); + SState curr = i.next(); + i.remove(); + /*if (this.core.config.args.get(CoreArgs.VERBOSE)) + { + if (debugCount++ % 50 == 0) + { + this.core.verbosePrintln( + "(" + fullname + ") Building global states: " + debugCount); + } + }*/ + + // Based on config semantics, not "static" graph edges (cf., super.getActions) -- used to build global model graph + Map> fireable = curr.config.getFireable(); + for (Role r : fireable.keySet()) + { + for (EAction a : fireable.get(r)) + { + // Asynchronous (input/output) actions + if (a.isSend() || a.isReceive() || a.isDisconnect()) + { + Set next = new HashSet<>(curr.config.async(r, a)); + // SConfig.a/sync currently produces a List, but here collapse identical configs for global model (represent non-det "by edges", not "by model states") + Set succs = this.util.getSuccs(curr, a.toGlobal(r), next); // util.getSuccs constructs the edges + todo.addAll(succs); + } + // Synchronous (client/server) actions + else if (a.isAccept() || a.isRequest() || a.isClientWrap() + || a.isServerWrap()) + { + Set as = fireable.get(a.peer); + EAction abar = a.toDual(r); + if (as != null && as.contains(abar)) + { + as.remove(abar); // Removes one occurrence + SAction aglobal = (a.isRequest() || a.isClientWrap()) // "client" side action + ? a.toGlobal(r) + : abar.toGlobal(a.peer); + // CHECKME: edge will be drawn as the connect, but should be read as the sync. of both -- something like "r1, r2: sync" may be more consistent (or take a set of actions as the edge label?) + Set next = new HashSet<>(curr.config.sync(r, a, a.peer, abar)); + // SConfig.a/sync currently produces a List, but here collapse identical configs for global model (represent non-det "by edges", not "by model states") + Set succs = this.util.getSuccs(curr, aglobal, next); // util.getSuccs constructs the edges + todo.addAll(succs); + } + } + else + { + throw new RuntimeException("Unknown action kind: " + a); + } + } + } + } + + return this.core.config.mf.global.SGraph(fullname, this.util.getStates(), + init); + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/model/global/SGraphBuilderUtil.java b/scribble-core/src/main/java/org/scribble/core/model/global/SGraphBuilderUtil.java new file mode 100644 index 000000000..7a20160df --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/global/SGraphBuilderUtil.java @@ -0,0 +1,78 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model.global; + +import java.util.HashMap; +import java.util.LinkedHashSet; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +import org.scribble.core.model.GraphBuilderUtil; +import org.scribble.core.model.ModelFactory; +import org.scribble.core.model.global.actions.SAction; +import org.scribble.core.type.kind.Global; + +public class SGraphBuilderUtil + extends GraphBuilderUtil +{ + private Map states = new HashMap<>(); + + protected SGraphBuilderUtil(ModelFactory mf) + { + super(mf); + reset(); + } + + @Override + protected void reset() + { + this.states.clear(); + } + + public SState newState(SConfig c) + { + SState s = this.mf.global.SState(c); + this.states.put(c, s); + return s; + } + + // Pre: this.states.containsKey(curr.config) + public Set getSuccs(SState curr, SAction a, //List succs) + Set succs) + // SConfig.a/sync currently produces a List, but here collapse identical configs for global model (represent non-det "by edges", not "by model states") + { + Set res = new LinkedHashSet<>(); // Takes care of duplicates (o/w should also do "|| res.containsKey(c)" below) + for (SConfig c : succs) + { + boolean seen = this.states.containsKey(c); + SState next = seen + ? this.states.get(c) + : newState(c); + curr.addEdge(a, next); + if (!seen) // Must use cached test, newState changes adds the key + { + res.add(next); + } + } + return res; + } + + // s.id -> s + public Map getStates() + { + return this.states.values().stream() + .collect(Collectors.toMap(x -> x.id, x -> x)); + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/model/global/SModel.java b/scribble-core/src/main/java/org/scribble/core/model/global/SModel.java new file mode 100644 index 000000000..0cee2dd2c --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/global/SModel.java @@ -0,0 +1,198 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model.global; + +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.SortedMap; +import java.util.TreeMap; +import java.util.stream.Collectors; + +import org.scribble.core.job.Core; +import org.scribble.core.job.CoreArgs; +import org.scribble.core.model.endpoint.actions.ESend; +import org.scribble.core.type.name.Role; +import org.scribble.util.Pair; +import org.scribble.util.ScribException; + + +// For doing validation operations on an SGraph (cf. EFsm, use Graph as an FSM) +public class SModel +{ + private Core core; // CHECKME: refactor? but avoiding in constructor to keep mf more independent/uniform + + public final SGraph graph; + + protected SModel(SGraph graph) + { + this.graph = graph; + } + + // CHECKME: let Core call check safety/progress directly? (to avoid passing core) + public void validate(Core core) throws ScribException + { + this.core = core; + + SortedMap sErrs = getSafetyErrors(); + Map, Pair, Map>>> pErrors + = Collections.emptyMap(); + if (!core.config.args.get(CoreArgs.NO_PROGRESS)) + { + pErrors = getProgressErrors(); + } + + if (!sErrs.isEmpty() || !pErrors.isEmpty()) + { + String msg = ""; + if (!sErrs.isEmpty()) + { + msg += getSafetyErrors().values().stream() + .map(x -> x.toErrorMessage(this.graph)) + .collect(Collectors.joining("")); + } + if (!pErrors.isEmpty()) + { + for (Entry, Pair, Map>>> e : + pErrors.entrySet()) + { + msg += getProgressErrorMessages(e.getKey(), e.getValue()); + } + } + throw new ScribException(msg); + } + } + + protected SortedMap getSafetyErrors() // s.id key lighter than full SConfig + { + SortedMap res = new TreeMap<>(); + for (int id : this.graph.states.keySet()) + { + SStateErrors errs = this.graph.states.get(id).getErrors(); + if (!errs.isEmpty()) + { + res.put(id, errs); + } + } + return res; + } + + // These are checked only on termsets (cf. safety checked on all), and "overlap" with safety errors within there + // Could "skip" safety checks for termsets (probably better than coercing "progress" outside of termsets, as it would probably just amount to safety anyway) + // CHECKME: factor out a TermSet class? + protected Map, Pair, Map>>> + getProgressErrors() + { + Map, Pair, Map>>> res + = new HashMap<>(); + for (Set termset: this.graph.getTermSets()) + { + Set starved = checkRoleProgress(termset); + Map> ignored = checkEventualReception(termset); + if (!starved.isEmpty() || !ignored.isEmpty()) + { + res.put(termset, new Pair<>(starved, ignored)); + } + } + return res; + } + + // Could subsume terminal state check, if terminal sets included size 1 with reflexive reachability (but not a good approach) + protected Set checkRoleProgress(Set termset) + { + SState s = termset.iterator().next(); // Pick any state to check canSafelyTerminate (later, if needed), if non progressing equivalent for all + Set todo = new HashSet<>(s.config.efsms.keySet()); + for (Iterator i = termset.iterator(); + i.hasNext() && !todo.isEmpty(); ) + { + i.next().getActions().stream().map(x -> x.subj).distinct() + .forEachOrdered(x -> todo.remove(x)); + // cf. a.containsRole(r) -- implies obj will be subj for the counterpart action somewhere in the termset? + } + + // todo is now all roles that are not the subj of any action in the termset + return todo.stream() + .filter(x -> !s.config.canSafelyTerminate(x) + && s.config.queues.getQueue(x).values().stream() + .allMatch(y -> y == null)) // Check empty queues for starved -- o/w, is a stuck-message + .collect(Collectors.toSet()); + } + + // cf. eventual stability (could also check within termsets) + protected Map> checkEventualReception(Set termset) + { + SState s0 = termset.iterator().next(); + Set roles = s0.config.efsms.keySet(); + Map> q0 = s0.config.queues.getQueues(); // dest -> src -> msg -- dest.equals(msg.peer), msg is ESend to the dst + for (Role r1 : roles) + { + Map q0_r1 = q0.get(r1); + for (Role r2 : roles) + { + if (!r1.equals(r2) && q0_r1.get(r2) != null && + termset.stream() + .anyMatch(x -> x.config.queues.getQueue(r1).get(r2) == null)) + { + q0_r1.put(r2, null); + } + } + } + + // q0 now shows which buffers are never null at any state in the termset + Map> ignored = new HashMap<>(); + for (Role r : roles) + { + Set msgs = q0.values().stream() + .flatMap(x -> x.entrySet().stream()) // For all input buffs at every role... + .filter(x -> x.getKey().equals(r) && x.getValue() != null) // ...s.t. the buff is from "r" and is non-empty + .map(x -> x.getValue()).collect(Collectors.toSet()); + if (!msgs.isEmpty()) + { + ignored.put(r, msgs); + } + } + return ignored; + } + + // Cf. SStateErrors // TODO: refactor to Core, if not to its own class? + protected String getProgressErrorMessages(Set termset, + Pair, Map>> perrors) + { + String msg = ""; + if (!perrors.left.isEmpty()) // starved + { + msg += "\nRole progress violation for " + perrors.left + + " in session state terminal set:\n " + termSetToString(termset); + } + if (!perrors.right.isEmpty()) // ignored + { + msg += "\nEventual reception violation for " + perrors.right + + " in session state terminal set:\n " + termSetToString(termset); + } + return msg; + } + + protected String termSetToString(Set termset) + { + return this.core.config.args.get(CoreArgs.VERBOSE) + ? termset.stream().map(x -> x.toString()) + .collect(Collectors.joining(",")) + : termset.stream().map(x -> Integer.toString(x.id)) + .collect(Collectors.joining(",")); + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/model/global/SModelFactory.java b/scribble-core/src/main/java/org/scribble/core/model/global/SModelFactory.java new file mode 100644 index 000000000..2f81abc90 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/global/SModelFactory.java @@ -0,0 +1,50 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model.global; + +import java.util.Map; + +import org.scribble.core.model.endpoint.EFsm; +import org.scribble.core.model.global.actions.SAcc; +import org.scribble.core.model.global.actions.SClientWrap; +import org.scribble.core.model.global.actions.SDisconnect; +import org.scribble.core.model.global.actions.SRecv; +import org.scribble.core.model.global.actions.SReq; +import org.scribble.core.model.global.actions.SSend; +import org.scribble.core.model.global.actions.SServerWrap; +import org.scribble.core.type.name.GProtoName; +import org.scribble.core.type.name.MsgId; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Payload; + +public interface SModelFactory +{ + SGraphBuilderUtil SGraphBuilderUtil(); + + // protected constructors (MState mutable) + SState SState(SConfig config); + SConfig SConfig(Map state, SingleBuffers buffs); + SGraph SGraph(GProtoName proto, Map states, + SState init); // states: s.id -> s + SModel SModel(SGraph g); + + // public constructors (subpackage, immutable) + SSend SSend(Role subj, Role obj, MsgId mid, Payload pay); + SRecv SRecv(Role subj, Role obj, MsgId mid, Payload pay); + SReq SReq(Role subj, Role obj, MsgId mid, Payload pay); + SAcc SAcc(Role subj, Role obj, MsgId mid, Payload pay); + SDisconnect SDisconnect(Role subj, Role obj); + SClientWrap SClientWrap(Role subj, Role obj); + SServerWrap SServerWrap(Role subj, Role obj); +} diff --git a/scribble-core/src/main/java/org/scribble/core/model/global/SModelFactoryImpl.java b/scribble-core/src/main/java/org/scribble/core/model/global/SModelFactoryImpl.java new file mode 100644 index 000000000..135da4586 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/global/SModelFactoryImpl.java @@ -0,0 +1,115 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model.global; + +import java.util.Map; + +import org.scribble.core.model.ModelFactory; +import org.scribble.core.model.ModelFactoryBase; +import org.scribble.core.model.endpoint.EFsm; +import org.scribble.core.model.global.actions.SAcc; +import org.scribble.core.model.global.actions.SClientWrap; +import org.scribble.core.model.global.actions.SDisconnect; +import org.scribble.core.model.global.actions.SRecv; +import org.scribble.core.model.global.actions.SReq; +import org.scribble.core.model.global.actions.SSend; +import org.scribble.core.model.global.actions.SServerWrap; +import org.scribble.core.type.name.GProtoName; +import org.scribble.core.type.name.MsgId; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Payload; + +// Separate E/SModelFactories fits protected E/SState constructor pattern +public class SModelFactoryImpl extends ModelFactoryBase implements SModelFactory +{ + + public SModelFactoryImpl(ModelFactory mf) + { + super(mf); + } + + @Override + public SGraphBuilderUtil SGraphBuilderUtil() + { + return new SGraphBuilderUtil(this.mf); + } + + @Override + public SState SState(SConfig config) + { + return new SState(config); + } + + // states: s.id -> s + @Override + public SGraph SGraph(GProtoName proto, Map states, + SState init) + { + return new SGraph(proto, states, init); + } + + @Override + public SConfig SConfig(Map state, SingleBuffers buffs) + { + return new SConfig(this.mf, state, buffs); + } + + @Override + public SModel SModel(SGraph g) + { + return new SModel(g); + } + + @Override + public SSend SSend(Role subj, Role obj, MsgId mid, Payload pay) + { + return new SSend(subj, obj, mid, pay); + } + + @Override + public SRecv SRecv(Role subj, Role obj, MsgId mid, Payload pay) + { + return new SRecv(subj, obj, mid, pay); + } + + @Override + public SReq SReq(Role subj, Role obj, MsgId mid, Payload pay) + { + return new SReq(subj, obj, mid, pay); + } + + @Override + public SAcc SAcc(Role subj, Role obj, MsgId mid, Payload pay) + { + return new SAcc(subj, obj, mid, pay); + } + + @Override + public SDisconnect SDisconnect(Role subj, Role obj) + { + return new SDisconnect(subj, obj); + } + + @Override + public SClientWrap SClientWrap(Role subj, Role obj) + { + return new SClientWrap(subj, obj); + } + + @Override + public SServerWrap SServerWrap(Role subj, Role obj) + { + return new SServerWrap(subj, obj); + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/model/global/SState.java b/scribble-core/src/main/java/org/scribble/core/model/global/SState.java new file mode 100644 index 000000000..45acc2211 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/global/SState.java @@ -0,0 +1,128 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model.global; + +import java.util.Collections; +import java.util.Set; + +import org.scribble.core.model.MPrettyState; +import org.scribble.core.model.MState; +import org.scribble.core.model.global.actions.SAction; +import org.scribble.core.type.kind.Global; + +// CHECKME: make a WFModel front-end class? (cf. EGraph) +// N.B. only uses MState.id cosmetically, cf. MState equals/hashCode -- overrides equals/hashCode based on this.config (maybe extending MState is a bit misleading) +public class SState extends MPrettyState +{ + public final SConfig config; + + protected SState(SConfig config) // CHECKME? now publically mutable (for mf imple), same for EState + { + super(Collections.emptySet()); + this.config = config; + } + + // For access from SGraphBuilderUtil + @Override + protected void addEdge(SAction a, SState s) + { + super.addEdge(a, s); + } + + public SStateErrors getErrors() // Means safety (i.e., individual state) errors + { + return new SStateErrors(this); + } + + @Override + protected String getNodeLabel() + { + String labs = this.config.toString(); + return "label=\"" + this.id + ":" + labs.substring(1, labs.length() - 1) + + "\""; + } + + @Override + public Set getReachableStates() + { + return getReachableStatesAux(this); + } + + @Override + public String toString() + { + return this.id + ":" + this.config.toString(); + } + + // N.B. does not use super.hashCode, need "semantic" equality of configs for model construction + @Override + public int hashCode() + { + int hash = 79; + hash = 31 * hash + this.config.hashCode(); + return hash; + } + + // FIXME? doesn't use this.id, cf. super.equals + // Not using id, cf. ModelState -- FIXME? use a factory pattern that associates unique states and ids? -- use id for hash, and make a separate "semantic equals" + // Care is needed if hashing, since mutable (OK to use immutable config -- cf., ModelState.id) + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof SState)) + { + return false; + } + SState them = (SState) o; + return them.canEquals(this) && this.config.equals(them.config); // N.B. does not do super.equals (cf. hashCode) + } + + @Override + protected boolean canEquals(MState s) + { + return s instanceof SState; + } +} + + + + + + + + + + + + + /*// Based on config semantics, not "static" graph edges (cf., super.getAllActions) -- used to build global model graph + public Map> getFireable() + { + return this.config.getFireable(); + } + + public List fire(Role r, EAction a) + { + return this.config.fire(r, a); + } + + // "Synchronous version" of fire + public List sync(Role r1, EAction a1, Role r2, EAction a2) + { + return this.config.sync(r1, a1, r2, a2); + }*/ \ No newline at end of file diff --git a/scribble-core/src/main/java/org/scribble/core/model/global/SStateErrors.java b/scribble-core/src/main/java/org/scribble/core/model/global/SStateErrors.java new file mode 100644 index 000000000..be0c98456 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/global/SStateErrors.java @@ -0,0 +1,95 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model.global; + +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.scribble.core.model.endpoint.EState; +import org.scribble.core.model.endpoint.actions.ERecv; +import org.scribble.core.model.endpoint.actions.ESend; +import org.scribble.core.model.global.actions.SAction; +import org.scribble.core.type.name.Role; + +public class SStateErrors +{ + public final SState state; + + // FIXME: factor out explicit error classes -- for error message formatting + // FIXME: could also check for roles stuck on unconnected sends here (probably better, than current syntax check) + public final Map stuck; // Reception errors + public final Set> waitFor; // Deadlock cycles + public final Map> orphans; // Orphan messages + public final Map unfinished; // Unfinished roles + + public SStateErrors(SState state) + { + this.state = state; + this.stuck = state.config.getStuckMessages(); + this.waitFor = state.config.getWaitForCycles(); + this.orphans = state.config.getOrphanMessages(); + this.unfinished = state.config.getUnfinishedRoles(); + } + + public boolean isEmpty() + { + return this.stuck.isEmpty() && this.waitFor.isEmpty() + && this.orphans.isEmpty() && this.unfinished.isEmpty(); + } + + @Override + public String toString() + { + return "stuck=" + this.stuck + ", watiFor=" + this.waitFor + ", orphans=" + + this.orphans + ", unfinished=" + this.unfinished; + } + + public String toErrorMessage(SGraph graph) + { + String msg = ""; // Return empty when no error? + if (!isEmpty()) + { + // CHECKME: getTrace can get stuck when local choice subjects are disabled ? (has since been rewritten) + List trace = graph.getTraceFromInit(this.state); // CHECKME: getTrace broken on non-det self loops? + msg += "\nSafety violation(s) at session state " + this.state.id + + ":\n Trace=" + trace + + appendErrors(); // Does leading "\n" + } + return msg; + } + + // TODO: snip if too long? -- maybe not, let user pipe to file + protected String appendErrors() + { + String res = ""; + if (!this.stuck.isEmpty()) + { + res += "\n Stuck messages: " + this.stuck; // Deadlock from reception error + } + if (!this.waitFor.isEmpty()) + { + res += "\n Wait-for cycles: " + this.waitFor; // Deadlock from input-blocked cycles -- not from terminated dependencies, cf. unfinished roles + } + if (!this.orphans.isEmpty()) + { + res += "\n Orphan messages: " + this.orphans; // TODO: add sender of orphan to error message + } + if (!this.unfinished.isEmpty()) + { + res += "\n Unfinished roles: " + this.unfinished; + } + return res; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/model/global/SingleBuffers.java b/scribble-core/src/main/java/org/scribble/core/model/global/SingleBuffers.java new file mode 100644 index 000000000..17ff20fa8 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/global/SingleBuffers.java @@ -0,0 +1,214 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model.global; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.stream.Collectors; + +import org.scribble.core.model.endpoint.actions.EAcc; +import org.scribble.core.model.endpoint.actions.EClientWrap; +import org.scribble.core.model.endpoint.actions.EDisconnect; +import org.scribble.core.model.endpoint.actions.ERecv; +import org.scribble.core.model.endpoint.actions.EReq; +import org.scribble.core.model.endpoint.actions.ESend; +import org.scribble.core.model.endpoint.actions.EServerWrap; +import org.scribble.core.type.name.Role; + +// Immutable -- send/receive/etc return updated copies +public class SingleBuffers +{ + private final Map> connected = new HashMap<>(); // local -> peer -> does-local-consider-connected (symmetric) + // CHECKME: refactor as Map> ? cf. ConnectionChecker + + private final Map> buffs = new HashMap<>(); // dest -> src -> msg -- N.B. connected.get(A).get(B) => can send into buffs.get(B).get(A) ("reversed") + // N.B. hardcoded to capacity one -- SQueues would be the generalisation + // null ESend for empty queue + + public SingleBuffers(Set roles, boolean implicit) + { + for(Role r1 : roles) + { + HashMap connected = new HashMap<>(); + HashMap queues = new HashMap<>(); + for (Role r2 : roles) + { + if (!r1.equals(r2)) + { + connected.put(r2, implicit); + queues.put(r2, null); // null for empty queue + } + } + this.connected.put(r1, connected); + this.buffs.put(r1, queues); + } + } + + protected SingleBuffers(SingleBuffers queues) + { + for (Role r : queues.buffs.keySet()) + { + this.connected.put(r, new HashMap<>(queues.connected.get(r))); + this.buffs.put(r, new HashMap<>(queues.buffs.get(r))); + } + } + + public boolean canSend(Role self, ESend a) + { + return isConnected(self, a.peer) //&& isConnected(a.peer, self) // CHECKME: only consider local side? + && this.buffs.get(a.peer).get(self) == null; + } + + public boolean canReceive(Role self, ERecv a) + { + ESend send = this.buffs.get(self).get(a.peer); + return isConnected(self, a.peer) // Other direction doesn't matter, local can still receive after peer disconnected + && send != null && send.toDual(a.peer).equals(a); + } + + // N.B. "sync" action but only considers the self side, i.e., to actually fire, must also explicitly check canAccept + public boolean canRequest(Role self, EReq c) + { + return !isConnected(self, c.peer); + } + + // N.B. "sync" action but only considers the self side, i.e., to actually fire, must also explicitly check canRequest + public boolean canAccept(Role self, EAcc a) + { + return !isConnected(self, a.peer); + } + + public boolean canDisconnect(Role self, EDisconnect d) + { + return isConnected(self, d.peer); + } + + // N.B. "sync" action but only considers the self side, i.e., to actually fire, must also explicitly check canServerWrap + // N.B. doesn't actually change any state + public boolean canClientWrap(Role self, EClientWrap cw) + { + return isConnected(self, cw.peer); + } + + // N.B. "sync" action but only considers the self side, i.e., to actually fire, must also explicitly check canClientWrap + // N.B. doesn't actually change queues state + public boolean canServerWrap(Role self, EServerWrap sw) + { + return isConnected(self, sw.peer); + } + + // Pre: canSend, e.g., via via SConfig.getFireable + // Return an updated copy + public SingleBuffers send(Role self, ESend a) + { + SingleBuffers copy = new SingleBuffers(this); + copy.buffs.get(a.peer).put(self, a); + return copy; + } + + // Pre: canReceive, e.g., via SConfig.getFireable + // Return an updated copy + public SingleBuffers receive(Role self, ERecv a) + { + SingleBuffers copy = new SingleBuffers(this); + copy.buffs.get(self).put(a.peer, null); + return copy; + } + + // Sync action + // Pre: canRequest(r1, [[r2]]) and canAccept(r2, [[r1]]), where [[r]] is a matching action with peer r -- e.g., via via SConfig.getFireable + // Return an updated copy + public SingleBuffers connect(Role r1, Role r2) // Role sides and message don't matter + { + SingleBuffers copy = new SingleBuffers(this); + copy.connected.get(r1).put(r2, true); + copy.connected.get(r2).put(r1, true); + return copy; + } + + // Pre: canDisconnect(self, d), e.g., via SConfig.via getFireable + // Return an updated copy + public SingleBuffers disconnect(Role self, EDisconnect d) + { + SingleBuffers copy = new SingleBuffers(this); + copy.connected.get(self).put(d.peer, false); // Didn't update buffs (cf. SConfig.getOrphanMessages) + return copy; + } + + // N.B. direction sensitive (viz., after some disconnect) + public boolean isConnected(Role self, Role peer) + { + return this.connected.get(self).get(peer); + } + + public boolean isEmpty(Role r) // this.connected doesn't matter + { + return this.buffs.get(r).values().stream().allMatch(v -> v == null); + } + + // Return a (deep) copy -- currently, checkEventualReception expects a modifiable return + // N.B. hardcoded to capacity one + public Map> getQueues() + { + return this.buffs.entrySet().stream().collect(Collectors.toMap( + Entry::getKey, + x -> new HashMap<>(x.getValue()))); // Collections.unmodifiableMap(x.getValue()) + } + + // N.B. hardcoded to capacity one + public Map getQueue(Role r) + { + return Collections.unmodifiableMap(this.buffs.get(r)); + } + + @Override + public final int hashCode() + { + int hash = 131; + hash = 31 * hash + this.connected.hashCode(); + hash = 31 * hash + this.buffs.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof SingleBuffers)) + { + return false; + } + SingleBuffers b = (SingleBuffers) o; + return this.connected.equals(b.connected) && this.buffs.equals(b.buffs); + } + + @Override + public String toString() + { + return this.buffs.entrySet().stream() + .filter(e -> e.getValue().values().stream().anyMatch(v -> v != null)) + .collect(Collectors.toMap( + e -> e.getKey(), + e -> e.getValue().entrySet().stream() + .filter(f -> f.getValue() != null) + .collect(Collectors.toMap(f -> f.getKey(), f -> f.getValue())) + )).toString(); + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/model/global/actions/SAcc.java b/scribble-core/src/main/java/org/scribble/core/model/global/actions/SAcc.java new file mode 100644 index 000000000..e2049680e --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/global/actions/SAcc.java @@ -0,0 +1,66 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model.global.actions; + +import org.scribble.core.type.name.MsgId; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Payload; + +public class SAcc extends SAction +{ + public SAcc(Role subj, Role obj, MsgId mid, Payload pay) + { + super(subj, obj, mid, pay); + } + + @Override + public boolean isAccept() + { + return true; + } + + @Override + public int hashCode() + { + int hash = 967; + hash = 31 * hash + super.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof SAcc)) + { + return false; + } + return super.equals(o); // Does canEquals + } + + public boolean canEquals(Object o) + { + return o instanceof SAcc; + } + + @Override + protected String getCommSymbol() + { + //return "??"; + return "<<-"; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/model/global/actions/SAction.java b/scribble-core/src/main/java/org/scribble/core/model/global/actions/SAction.java new file mode 100644 index 000000000..209df9618 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/global/actions/SAction.java @@ -0,0 +1,162 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model.global.actions; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +import org.scribble.core.model.MAction; +import org.scribble.core.type.kind.Global; +import org.scribble.core.type.name.MsgId; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Payload; + +// N.B. these are not exactly global type constructors -- they are "endpoint-oriented" like locals, but record both subj/obj roles (so more like locals with self) +public abstract class SAction extends MAction +{ + public final Role subj; + + public SAction(Role subj, Role obj, MsgId mid, Payload pay) + { + super(obj, mid, pay); + this.subj = subj; + } + + public boolean isSend() + { + return false; + } + + public boolean isReceive() + { + return false; + } + + public boolean isRequest() + { + return false; + } + + public boolean isAccept() + { + return false; + } + + public boolean isDisconnect() + { + return false; + } + + public boolean isClientWrap() + { + return false; + } + + public boolean isServerWrap() + { + return false; + } + + public Set getRoles() + { + return new HashSet<>(Arrays.asList(this.subj, this.obj)); + } + + /*public boolean containsRole(Role role) + { + return this.subj.equals(role) || this.obj.equals(role); + }*/ + + @Override + public String toString() + { + return this.subj + getCommSymbol() + this.obj + ":" + this.mid + + this.payload; + } + + @Override + public int hashCode() + { + int hash = 149; + hash = 31 * hash + super.hashCode(); + hash = 31 * hash + this.subj.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof SAction)) + { + return false; + } + SAction them = (SAction) o; + return super.equals(o) // Checks canEquals + && this.subj.equals(them.subj); + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof SAction; + } +} + + + + + + + + + + + + + + + + + + /*public IOAction project(Role self) + { + if (this.subj.equals(self)) + { + if (this.obj.equals(self)) + { + throw new RuntimeException("TODO: " + this); + } + else + { + return new Send(this.obj, this.mid, this.payload); + } + } + else + { + if (this.obj.equals(self)) + { + return new Receive(this.subj, this.mid, this.payload); + //return Receive.get(this.subj, this.mid, this.payload); + } + else + { + return null; // FIXME? + } + } + }*/ \ No newline at end of file diff --git a/scribble-core/src/main/java/org/scribble/core/model/global/actions/SClientWrap.java b/scribble-core/src/main/java/org/scribble/core/model/global/actions/SClientWrap.java new file mode 100644 index 000000000..88d84a880 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/global/actions/SClientWrap.java @@ -0,0 +1,67 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model.global.actions; + +import org.scribble.core.type.name.Op; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Payload; + +// Wrap at the client side +public class SClientWrap extends SAction +{ + public SClientWrap(Role subj, Role obj) + { + super(subj, obj, Op.EMPTY_OP, Payload.EMPTY_PAYLOAD); + } + + @Override + public boolean isClientWrap() + { + return true; + } + + @Override + public int hashCode() + { + int hash = 1069; + hash = 31 * hash + super.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof SClientWrap)) + { + return false; + } + return super.equals(o); // Does canEquals + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof SClientWrap; + } + + @Override + protected String getCommSymbol() + { + return "(->>)"; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/model/global/actions/SDisconnect.java b/scribble-core/src/main/java/org/scribble/core/model/global/actions/SDisconnect.java new file mode 100644 index 000000000..7a41d62d6 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/global/actions/SDisconnect.java @@ -0,0 +1,67 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model.global.actions; + +import org.scribble.core.type.name.Op; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Payload; + +public class SDisconnect extends SAction +{ + public SDisconnect(Role subj, Role obj) + { + super(subj, obj, Op.EMPTY_OP, Payload.EMPTY_PAYLOAD); + } + + @Override + public boolean isRequest() + { + return true; + } + + @Override + public int hashCode() + { + int hash = 1013; + hash = 31 * hash + super.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof SDisconnect)) + { + return false; + } + return super.equals(o); // Does canEquals + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof SDisconnect; + } + + @Override + protected String getCommSymbol() + { + //return "\u00A1\u00A1abc"; + return "-/-"; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/model/global/actions/SRecv.java b/scribble-core/src/main/java/org/scribble/core/model/global/actions/SRecv.java new file mode 100644 index 000000000..32f637624 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/global/actions/SRecv.java @@ -0,0 +1,65 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model.global.actions; + +import org.scribble.core.type.name.MsgId; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Payload; + +public class SRecv extends SAction +{ + public SRecv(Role subj, Role obj, MsgId mid, Payload pay) + { + super(subj, obj, mid, pay); + } + + @Override + public boolean isReceive() + { + return true; + } + + @Override + public int hashCode() + { + int hash = 977; + hash = 31 * hash + super.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof SRecv)) + { + return false; + } + return super.equals(o); // Does canEquals + } + + public boolean canEquals(Object o) + { + return o instanceof SRecv; + } + + @Override + protected String getCommSymbol() + { + return "?"; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/model/global/actions/SReq.java b/scribble-core/src/main/java/org/scribble/core/model/global/actions/SReq.java new file mode 100644 index 000000000..06534bb45 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/global/actions/SReq.java @@ -0,0 +1,66 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model.global.actions; + +import org.scribble.core.type.name.MsgId; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Payload; + +public class SReq extends SAction +{ + public SReq(Role subj, Role obj, MsgId mid, Payload pay) + { + super(subj, obj, mid, pay); + } + + @Override + public boolean isRequest() + { + return true; + } + + @Override + public int hashCode() + { + int hash = 971; + hash = 31 * hash + super.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof SReq)) + { + return false; + } + return super.equals(o); // Does canEquals + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof SReq; + } + + @Override + protected String getCommSymbol() + { + return "->>"; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/model/global/actions/SRequest.java b/scribble-core/src/main/java/org/scribble/core/model/global/actions/SRequest.java new file mode 100644 index 000000000..0fdcc6def --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/global/actions/SRequest.java @@ -0,0 +1,67 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model.global.actions; + +import org.scribble.core.type.name.MsgId; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Payload; + +public class SRequest extends SAction +{ + public SRequest(Role subj, Role obj, MsgId mid, Payload pay) + { + super(subj, obj, mid, pay); + } + + @Override + public boolean isRequest() + { + return true; + } + + @Override + public int hashCode() + { + int hash = 971; + hash = 31 * hash + super.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof SRequest)) + { + return false; + } + return super.equals(o); // Does canEquals + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof SRequest; + } + + @Override + protected String getCommSymbol() + { + //return "!!"; + return "->>"; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/model/global/actions/SSend.java b/scribble-core/src/main/java/org/scribble/core/model/global/actions/SSend.java new file mode 100644 index 000000000..67117293f --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/global/actions/SSend.java @@ -0,0 +1,66 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model.global.actions; + +import org.scribble.core.type.name.MsgId; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Payload; + +public class SSend extends SAction +{ + public SSend(Role subj, Role obj, MsgId mid, Payload pay) + { + super(subj, obj, mid, pay); + } + + @Override + public boolean isSend() + { + return true; + } + + @Override + public int hashCode() + { + int hash = 977; + hash = 31 * hash + super.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof SSend)) + { + return false; + } + return super.equals(o); // Does canEquals + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof SSend; + } + + @Override + protected String getCommSymbol() + { + return "!"; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/model/global/actions/SServerWrap.java b/scribble-core/src/main/java/org/scribble/core/model/global/actions/SServerWrap.java new file mode 100644 index 000000000..02ecbd1ed --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/global/actions/SServerWrap.java @@ -0,0 +1,67 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model.global.actions; + +import org.scribble.core.type.name.Op; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Payload; + +// Wrap at the server side +public class SServerWrap extends SAction +{ + public SServerWrap(Role subj, Role obj) + { + super(subj, obj, Op.EMPTY_OP, Payload.EMPTY_PAYLOAD); + } + + @Override + public boolean isServerWrap() + { + return true; + } + + @Override + public int hashCode() + { + int hash = 1087; + hash = 31 * hash + super.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof SServerWrap)) + { + return false; + } + return super.equals(o); // Does canEquals + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof SServerWrap; + } + + @Override + protected String getCommSymbol() + { + return "(<<-)"; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/model/visit/EdgeVisitor.java b/scribble-core/src/main/java/org/scribble/core/model/visit/EdgeVisitor.java new file mode 100644 index 000000000..b4f15b910 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/visit/EdgeVisitor.java @@ -0,0 +1,66 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model.visit; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +import org.scribble.core.model.MAction; +import org.scribble.core.model.MState; +import org.scribble.core.type.kind.ProtoKind; + +public abstract class EdgeVisitor +< + L, + A extends MAction, + S extends MState, + K extends ProtoKind +> +{ + // "One-time" traveral (visitor no for reuse) + private final Map>> seen = new HashMap<>(); + + public boolean hasSeen(S s, A a, S succ) + { + if (!this.seen.containsKey(s)) + { + return false; + } + Map> tmp = this.seen.get(s); + return tmp.containsKey(a) && tmp.get(a).contains(succ); + } + + protected void setSeen(S s, A a, S succ) + { + Map> tmp1 = this.seen.get(s); + if (tmp1 == null) + { + tmp1 = new HashMap<>(); + this.seen.put(s, tmp1); + } + Set tmp2 = tmp1.get(a); + if (tmp2 == null) + { + tmp2 = new HashSet<>(); + tmp1.put(a, tmp2); + } + if (!tmp2.contains(succ)) // Worth? Or just do add + { + tmp2.add(succ); + } + } +} + \ No newline at end of file diff --git a/scribble-core/src/main/java/org/scribble/core/model/visit/StateVisitor.java b/scribble-core/src/main/java/org/scribble/core/model/visit/StateVisitor.java new file mode 100644 index 000000000..8763ba076 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/visit/StateVisitor.java @@ -0,0 +1,47 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model.visit; + +import java.util.HashSet; +import java.util.Set; + +import org.scribble.core.model.MAction; +import org.scribble.core.model.MState; +import org.scribble.core.type.kind.ProtoKind; + +public abstract class StateVisitor +< + L, + A extends MAction, + S extends MState, + K extends ProtoKind +> +{ + // "One-time" traveral (visitor no for reuse) + private final Set seen = new HashSet<>(); + + public boolean hasSeen(S s) + { + return this.seen.contains(s); + } + + protected void setSeen(S s) + { + //if (!this.seen.contains(s)) // Worth? Or just do add + { + this.seen.add(s); + } + } +} + \ No newline at end of file diff --git a/scribble-core/src/main/java/org/scribble/core/model/visit/local/EStateVisitor.java b/scribble-core/src/main/java/org/scribble/core/model/visit/local/EStateVisitor.java new file mode 100644 index 000000000..43aa8501d --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/visit/local/EStateVisitor.java @@ -0,0 +1,65 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model.visit.local; + +import org.scribble.core.model.endpoint.EState; +import org.scribble.core.model.endpoint.actions.EAction; +import org.scribble.core.model.visit.StateVisitor; +import org.scribble.core.type.kind.Local; +import org.scribble.core.type.name.RecVar; +import org.scribble.util.ScribException; + +public abstract class EStateVisitor + extends StateVisitor +{ + + // Allows to visit branch succs with fresh visitors, but limited usefulness? because pattern doesn't support merge... + // (...but could try too? e.g., by using EGraph to join visitors? -- issue is recursion, may need to precompute/integrate traversal paths and join points, e.f., b/dfs) + // CHECKME: take "self" generic param, use as return? or just override + public EStateVisitor enter(EState s, EAction a, EState succ) + { + return this; + } + + public void visitAccept(EState s) throws ScribException + { + setSeen(s); + } + + public void visitOutput(EState s) throws ScribException + { + setSeen(s); + } + + public void visitPolyInput(EState s) throws ScribException + { + setSeen(s); + } + + public void visitServerWrap(EState s) throws ScribException + { + setSeen(s); + } + + public void visitTerminal(EState s) throws ScribException + { + setSeen(s); + } + + public void visitUnaryInput(EState s) throws ScribException + { + setSeen(s); + } +} + \ No newline at end of file diff --git a/scribble-core/src/main/java/org/scribble/core/model/visit/local/NonDetPayChecker.java b/scribble-core/src/main/java/org/scribble/core/model/visit/local/NonDetPayChecker.java new file mode 100644 index 000000000..dcca36997 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/model/visit/local/NonDetPayChecker.java @@ -0,0 +1,71 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.model.visit.local; + +import java.util.List; + +import org.scribble.core.model.endpoint.EState; +import org.scribble.core.model.endpoint.actions.EAction; +import org.scribble.util.ScribException; + +// CHECKME: should make via factory method? cf. VisitorFactory +public class NonDetPayChecker extends EStateVisitor +{ + + protected void checkNonDetPays(EState s) throws ScribException + { + List as = s.getActions(); + if (as.size() <= 1) + { + return; + } + for (EAction a : as) + { + if (as.stream().anyMatch(x -> x.peer.equals(a.peer) && x.mid.equals(a.mid) + && !x.payload.equals(a.payload))) + { + throw new ScribException( + "Bad non-deterministic action payloads: " + as); + } + } + } + + @Override + public void visitAccept(EState s) throws ScribException + { + super.visitOutput(s); // Does setSeen + checkNonDetPays(s); + } + + @Override + public void visitOutput(EState s) throws ScribException + { + super.visitOutput(s); // Does setSeen + checkNonDetPays(s); + } + + @Override + public void visitPolyInput(EState s) throws ScribException + { + super.visitOutput(s); // Does setSeen + checkNonDetPays(s); + } + + @Override + public void visitServerWrap(EState s) throws ScribException + { + super.visitOutput(s); // Does setSeen + checkNonDetPays(s); + } +} \ No newline at end of file diff --git a/scribble-core/src/main/java/org/scribble/core/type/kind/AbstractKind.java b/scribble-core/src/main/java/org/scribble/core/type/kind/AbstractKind.java new file mode 100644 index 000000000..c7700af67 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/kind/AbstractKind.java @@ -0,0 +1,50 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.kind; + +public abstract class AbstractKind implements Kind +{ + protected String kind; // Not final for easier serialiazation (OpKind) + + // For serialization + protected AbstractKind() + { + + } + + public AbstractKind(String kind) + { + this.kind = kind; + } + + @Override + public int hashCode() + { + int hash = 7901; + hash = 31 * hash + this.kind.hashCode(); + return hash; + } + + @Override + public abstract boolean equals(Object o); + + public abstract boolean canEqual(Object o); // Not really needed due to singleton pattern + + @Override + public String toString() + { + String s = this.getClass().toString(); + return s.substring("class org.sribble.type.kind.".length() + 1, s.length()); // FIXME: factor out by reflection (in initialiser) + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/kind/AmbigKind.java b/scribble-core/src/main/java/org/scribble/core/type/kind/AmbigKind.java new file mode 100644 index 000000000..0c3b7c6b8 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/kind/AmbigKind.java @@ -0,0 +1,45 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.kind; + + +public class AmbigKind extends AbstractKind implements NonRoleArgKind//, PayloadTypeKind +{ + public static final AmbigKind KIND = new AmbigKind(); + + protected AmbigKind() + { + super("Ambig"); + } + + @Override + public boolean equals(Object o) + { + if (o == this) + { + return true; + } + if (!(o instanceof AmbigKind)) + { + return false; + } + return ((AmbigKind) o).canEqual(this); + } + + @Override + public boolean canEqual(Object o) + { + return o instanceof AmbigKind; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/kind/DataKind.java b/scribble-core/src/main/java/org/scribble/core/type/kind/DataKind.java new file mode 100644 index 000000000..ef9d60230 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/kind/DataKind.java @@ -0,0 +1,44 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.kind; + +public class DataKind extends AbstractKind implements PayElemKind, ImportKind, ModuleMemberKind +{ + public static final DataKind KIND = new DataKind(); + + protected DataKind() + { + super("DataType"); + } + + @Override + public boolean equals(Object o) + { + if (o == this) + { + return true; + } + if (!(o instanceof DataKind)) + { + return false; + } + return ((DataKind) o).canEqual(this); + } + + @Override + public boolean canEqual(Object o) + { + return o instanceof DataKind; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/kind/Global.java b/scribble-core/src/main/java/org/scribble/core/type/kind/Global.java new file mode 100644 index 000000000..c7c6a1d8b --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/kind/Global.java @@ -0,0 +1,44 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.kind; + +public class Global extends AbstractKind implements ProtoKind +{ + public static final Global KIND = new Global(); + + protected Global() + { + super("Global"); + } + + @Override + public boolean equals(Object o) + { + if (o == this) + { + return true; + } + if (!(o instanceof Global)) + { + return false; + } + return ((Global) o).canEqual(this); + } + + @Override + public boolean canEqual(Object o) + { + return o instanceof Global; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/kind/IdKind.java b/scribble-core/src/main/java/org/scribble/core/type/kind/IdKind.java new file mode 100644 index 000000000..2f91d9211 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/kind/IdKind.java @@ -0,0 +1,46 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.kind; + + +// IdKind can be disregarded, the "true" kind (for qualified names) recorded by the IdNode parent +public class IdKind extends AbstractKind +{ + public static final IdKind KIND = new IdKind(); + + protected IdKind() + { + super("Id"); + } + + @Override + public boolean equals(Object o) + { + if (o == this) + { + return true; + } + if (!(o instanceof IdKind)) + { + return false; + } + return ((IdKind) o).canEqual(this); + } + + @Override + public boolean canEqual(Object o) + { + return o instanceof IdKind; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/kind/ImportKind.java b/scribble-core/src/main/java/org/scribble/core/type/kind/ImportKind.java new file mode 100644 index 000000000..6e2eb0d76 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/kind/ImportKind.java @@ -0,0 +1,20 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.kind; + + +public interface ImportKind extends Kind +{ + +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/kind/Kind.java b/scribble-core/src/main/java/org/scribble/core/type/kind/Kind.java new file mode 100644 index 000000000..134b07bb3 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/kind/Kind.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.kind; + +import org.scribble.core.type.name.Name; + +public interface Kind +{ + public static Name castName(K kind, Name name) + { + kind.getClass().cast(name.getKind()); + @SuppressWarnings("unchecked") + Name tmp = (Name) name; + return tmp; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/kind/Local.java b/scribble-core/src/main/java/org/scribble/core/type/kind/Local.java new file mode 100644 index 000000000..790c09ca6 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/kind/Local.java @@ -0,0 +1,44 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.kind; + +public class Local extends AbstractKind implements ProtoKind, PayElemKind +{ + public static final Local KIND = new Local(); + + protected Local() + { + super("Local"); + } + + @Override + public boolean equals(Object o) + { + if (o == this) + { + return true; + } + if (!(o instanceof Local)) + { + return false; + } + return ((Local) o).canEqual(this); + } + + @Override + public boolean canEqual(Object o) + { + return o instanceof Local; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/kind/ModuleKind.java b/scribble-core/src/main/java/org/scribble/core/type/kind/ModuleKind.java new file mode 100644 index 000000000..65a392347 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/kind/ModuleKind.java @@ -0,0 +1,44 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.kind; + +public class ModuleKind extends AbstractKind implements ImportKind +{ + public static final ModuleKind KIND = new ModuleKind(); + + protected ModuleKind() + { + super("Module"); + } + + @Override + public boolean equals(Object o) + { + if (o == this) + { + return true; + } + if (!(o instanceof ModuleKind)) + { + return false; + } + return ((ModuleKind) o).canEqual(this); + } + + @Override + public boolean canEqual(Object o) + { + return o instanceof ModuleKind; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/kind/ModuleMemberKind.java b/scribble-core/src/main/java/org/scribble/core/type/kind/ModuleMemberKind.java new file mode 100644 index 000000000..c180acb15 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/kind/ModuleMemberKind.java @@ -0,0 +1,20 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.kind; + + +public interface ModuleMemberKind extends Kind +{ + +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/kind/MsgIdKind.java b/scribble-core/src/main/java/org/scribble/core/type/kind/MsgIdKind.java new file mode 100644 index 000000000..9ecbff345 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/kind/MsgIdKind.java @@ -0,0 +1,20 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.kind; + + +public interface MsgIdKind extends Kind +{ + +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/kind/NonProtoKind.java b/scribble-core/src/main/java/org/scribble/core/type/kind/NonProtoKind.java new file mode 100644 index 000000000..c40231b48 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/kind/NonProtoKind.java @@ -0,0 +1,20 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.kind; + + +public interface NonProtoKind extends Kind +{ + +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/kind/NonRoleArgKind.java b/scribble-core/src/main/java/org/scribble/core/type/kind/NonRoleArgKind.java new file mode 100644 index 000000000..fc9d53735 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/kind/NonRoleArgKind.java @@ -0,0 +1,22 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.kind; + + +// Following sesstype.Arg hierarchy +// Non-role args -- includes NonRoleParamKind, and AmbigKind +public interface NonRoleArgKind extends NonProtoKind +{ + +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/kind/NonRoleParamKind.java b/scribble-core/src/main/java/org/scribble/core/type/kind/NonRoleParamKind.java new file mode 100644 index 000000000..9eb8768e2 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/kind/NonRoleParamKind.java @@ -0,0 +1,21 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.kind; + + +// Non-role params +public interface NonRoleParamKind extends NonRoleArgKind, ParamKind +{ + +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/kind/OpKind.java b/scribble-core/src/main/java/org/scribble/core/type/kind/OpKind.java new file mode 100644 index 000000000..16d8527d1 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/kind/OpKind.java @@ -0,0 +1,59 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.kind; + +import java.io.IOException; +import java.io.Serializable; + +public class OpKind extends AbstractKind implements MsgIdKind, Serializable +{ + private static final long serialVersionUID = 1L; + + public static final OpKind KIND = new OpKind(); + + public OpKind() + { + super("Op"); + } + + private void writeObject(java.io.ObjectOutputStream stream) throws IOException + { + stream.writeObject(this.kind); + } + + private void readObject(java.io.ObjectInputStream stream) throws IOException, ClassNotFoundException + { + this.kind = (String) stream.readObject(); // i.e. "Op" + } + + @Override + public boolean equals(Object o) + { + if (o == this) + { + return true; + } + if (!(o instanceof OpKind)) + { + return false; + } + return ((OpKind) o).canEqual(this); + } + + @Override + public boolean canEqual(Object o) + { + return o instanceof OpKind; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/kind/PackageKind.java b/scribble-core/src/main/java/org/scribble/core/type/kind/PackageKind.java new file mode 100644 index 000000000..ff060c378 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/kind/PackageKind.java @@ -0,0 +1,44 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.kind; + +public class PackageKind extends AbstractKind +{ + public static final PackageKind KIND = new PackageKind(); + + protected PackageKind() + { + super("Package"); + } + + @Override + public boolean equals(Object o) + { + if (o == this) + { + return true; + } + if (!(o instanceof PackageKind)) + { + return false; + } + return ((PackageKind) o).canEqual(this); + } + + @Override + public boolean canEqual(Object o) + { + return o instanceof PackageKind; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/kind/ParamKind.java b/scribble-core/src/main/java/org/scribble/core/type/kind/ParamKind.java new file mode 100644 index 000000000..1d99e9172 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/kind/ParamKind.java @@ -0,0 +1,20 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.kind; + + +public interface ParamKind extends Kind +{ + +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/kind/PayElemKind.java b/scribble-core/src/main/java/org/scribble/core/type/kind/PayElemKind.java new file mode 100644 index 000000000..288253725 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/kind/PayElemKind.java @@ -0,0 +1,21 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.kind; + + +// Following sesstype.Arg hierarchy +public interface PayElemKind extends NonRoleParamKind //ArgKind +{ + +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/kind/ProtoKind.java b/scribble-core/src/main/java/org/scribble/core/type/kind/ProtoKind.java new file mode 100644 index 000000000..dded85fd5 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/kind/ProtoKind.java @@ -0,0 +1,19 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.kind; + +public interface ProtoKind extends ModuleMemberKind +{ + +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/kind/RecVarKind.java b/scribble-core/src/main/java/org/scribble/core/type/kind/RecVarKind.java new file mode 100644 index 000000000..073498914 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/kind/RecVarKind.java @@ -0,0 +1,44 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.kind; + +public class RecVarKind extends AbstractKind +{ + public static final RecVarKind KIND = new RecVarKind(); + + protected RecVarKind() + { + super("RecVar"); + } + + @Override + public boolean equals(Object o) + { + if (o == this) + { + return true; + } + if (!(o instanceof RecVarKind)) + { + return false; + } + return ((RecVarKind) o).canEqual(this); + } + + @Override + public boolean canEqual(Object o) + { + return o instanceof RecVarKind; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/kind/RoleKind.java b/scribble-core/src/main/java/org/scribble/core/type/kind/RoleKind.java new file mode 100644 index 000000000..8fd3d4e96 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/kind/RoleKind.java @@ -0,0 +1,44 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.kind; + +public class RoleKind extends AbstractKind implements ParamKind +{ + public static final RoleKind KIND = new RoleKind(); + + protected RoleKind() + { + super("Role"); + } + + @Override + public boolean equals(Object o) + { + if (o == this) + { + return true; + } + if (!(o instanceof RoleKind)) + { + return false; + } + return ((RoleKind) o).canEqual(this); + } + + @Override + public boolean canEqual(Object o) + { + return o instanceof RoleKind; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/kind/SigKind.java b/scribble-core/src/main/java/org/scribble/core/type/kind/SigKind.java new file mode 100644 index 000000000..02545144e --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/kind/SigKind.java @@ -0,0 +1,47 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.kind; + + +// Following sesstype.Arg hierarchy +public class SigKind extends AbstractKind implements NonRoleParamKind, MsgIdKind, //ArgKind + ModuleMemberKind +{ + public static final SigKind KIND = new SigKind(); + + protected SigKind() + { + super("Sig"); + } + + @Override + public boolean equals(Object o) + { + if (o == this) + { + return true; + } + if (!(o instanceof SigKind)) + { + return false; + } + return ((SigKind) o).canEqual(this); + } + + @Override + public boolean canEqual(Object o) + { + return o instanceof SigKind; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/name/AbstractName.java b/scribble-core/src/main/java/org/scribble/core/type/name/AbstractName.java new file mode 100644 index 000000000..91964724d --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/name/AbstractName.java @@ -0,0 +1,122 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.name; + +import java.io.IOException; +import java.util.Arrays; + +import org.scribble.core.type.kind.Kind; + +public abstract class AbstractName implements Name +{ + private static final long serialVersionUID = 1L; + + protected K kind; // non-final for serialization + + protected String[] elems; + + protected AbstractName(K kind, String... elems) + { + this.kind = kind; + this.elems = elems; + } + + @Override + public K getKind() + { + return this.kind; + } + + @Override + public int getElementCount() + { + return this.elems.length; + } + + @Override + public boolean isEmpty() + { + return this.elems.length == 0; + } + + @Override + public String[] getElements() + { + return Arrays.copyOf(this.elems, this.elems.length); + } + + // Not SimpleName so that e.g. ModuleName can return a simple ModuleName + @Override + public String getLastElement() + { + return this.elems[this.elems.length - 1]; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof AbstractName)) + { + return false; + } + AbstractName them = (AbstractName) o; + return them.canEquals(this) && this.kind.equals(them.kind) + && Arrays.equals(this.elems, them.elems); + } + + public abstract boolean canEquals(Object o); + + @Override + public int hashCode() + { + int hash = 2749; + hash = 31 * hash + this.kind.hashCode(); + hash = 31 * hash + Arrays.hashCode(this.elems); + return hash; + } + + @Override + public String toString() + { + if (isEmpty()) + { + return ""; + } + String name = this.elems[0]; + for (int i = 1; i < this.elems.length; i++) + { + name += "." + this.elems[i]; + } + return name; + } + + private void writeObject(java.io.ObjectOutputStream out) throws IOException + { + out.writeObject(this.kind); + out.writeObject(this.elems); + } + + private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException + { + @SuppressWarnings("unchecked") + K k = (K) in.readObject(); + this.kind = k; + //this.kind = readKind(); // TODO: protected abstract -- will this work? + this.elems = (String[]) in.readObject(); + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/name/AmbigName.java b/scribble-core/src/main/java/org/scribble/core/type/name/AmbigName.java new file mode 100644 index 000000000..e8c0f8274 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/name/AmbigName.java @@ -0,0 +1,64 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.name; + +import org.scribble.core.type.kind.AmbigKind; + +public class AmbigName extends AbstractName +{ + private static final long serialVersionUID = 1L; + + public AmbigName(String text) + { + super(AmbigKind.KIND, text); + } + + public SigName toSigName() + { + return new SigName(getLastElement()); + } + + public DataName toDataName() + { + return new DataName(getLastElement()); + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof AmbigName)) + { + return false; + } + AmbigName n = (AmbigName) o; + return n.canEquals(this) && super.equals(o); + } + + public boolean canEquals(Object o) + { + return o instanceof AmbigName; + } + + @Override + public int hashCode() + { + int hash = 4073; + hash = 31 * super.hashCode(); + return hash; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/name/DataName.java b/scribble-core/src/main/java/org/scribble/core/type/name/DataName.java new file mode 100644 index 000000000..b48cad2ea --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/name/DataName.java @@ -0,0 +1,80 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.name; + +import org.scribble.core.type.kind.DataKind; + + +// Potentially qualified/canonical payload type name; not the AST primitive identifier +// FIXME: record "external type name" from DataTypeDecl (for API gen)? cf. OutputSockGen#addSendOpParams +public class DataName extends MemberName + implements PayElemType +{ + private static final long serialVersionUID = 1L; + + public DataName(ModuleName modname, DataName membname) + { + super(DataKind.KIND, modname, membname); + } + + public DataName(String simplename) + { + super(DataKind.KIND, simplename); + } + + public boolean isDataName() + { + return true; + } + + @Override + public DataKind getKind() + { + return DataKind.KIND; + } + + @Override + public DataName getSimpleName() + { + return new DataName(getLastElement()); + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof DataName)) + { + return false; + } + DataName n = (DataName) o; + return n.canEquals(this) && super.equals(o); + } + + public boolean canEquals(Object o) + { + return o instanceof DataName; + } + + @Override + public int hashCode() + { + int hash = 2767; + hash = 31 * super.hashCode(); + return hash; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/name/GDelegType.java b/scribble-core/src/main/java/org/scribble/core/type/name/GDelegType.java new file mode 100644 index 000000000..d8881dab3 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/name/GDelegType.java @@ -0,0 +1,104 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.name; + +import java.io.IOException; +import java.io.Serializable; + +import org.scribble.core.type.kind.Local; + +// CHECKME: factor out of name package? (and then PayloadType also needs to be moved out of name?) +public class GDelegType implements PayElemType, Serializable +{ + private static final long serialVersionUID = 1L; + + private GProtoName proto; // Cannot be final, for Serializable + private Role role; + + public GDelegType(GProtoName proto, Role role) + { + this.proto = proto; + this.role = role; + } + + @Override + public boolean isGDelegationType() + { + return true; + } + + public GProtoName getGlobalProtocol() + { + return this.proto; + } + + public Role getRole() + { + return this.role; + } + + @Override + public Local getKind() + { + return Local.KIND; + } + + @Override + public String toString() + { + return this.proto + "@" + this.role; + } + + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof GDelegType)) + { + return false; + } + GDelegType them = (GDelegType) o; + return them.canEqual(this) && this.proto.equals(them.proto) && this.role.equals(them.role); + } + + public boolean canEqual(Object o) + { + return o instanceof GDelegType; + } + + @Override + public int hashCode() + { + int hash = 1381; + hash = 31 * this.proto.hashCode(); + hash = 31 * this.role.hashCode(); + return hash; + } + + private void writeObject(java.io.ObjectOutputStream out) throws IOException + { + out.writeObject(this.proto); + out.writeObject(this.role); + } + + private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException + { + this.proto = (GProtoName) in.readObject(); + this.role = (Role) in.readObject(); + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/name/GProtoName.java b/scribble-core/src/main/java/org/scribble/core/type/name/GProtoName.java new file mode 100644 index 000000000..231efc3f3 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/name/GProtoName.java @@ -0,0 +1,66 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.name; + +import org.scribble.core.type.kind.Global; + + +public class GProtoName extends ProtoName +{ + private static final long serialVersionUID = 1L; + + public GProtoName(ModuleName modname, ProtoName membname) + { + super(Global.KIND, modname, membname); + } + + public GProtoName(String simpname) + { + super(Global.KIND, simpname); + } + + @Override + public GProtoName getSimpleName() + { + return new GProtoName(getLastElement()); + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof GProtoName)) + { + return false; + } + GProtoName n = (GProtoName) o; + return n.canEquals(this) && super.equals(o); + } + + public boolean canEquals(Object o) + { + return o instanceof GProtoName; + } + + @Override + public int hashCode() + { + int hash = 2777; + hash = 31 * super.hashCode(); + return hash; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/name/Id.java b/scribble-core/src/main/java/org/scribble/core/type/name/Id.java new file mode 100644 index 000000000..8d33e64ab --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/name/Id.java @@ -0,0 +1,54 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.name; + +import org.scribble.core.type.kind.IdKind; + +public class Id extends AbstractName +{ + private static final long serialVersionUID = 1L; + + public Id(String text) + { + super(IdKind.KIND, text); + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof Id)) + { + return false; + } + Id n = (Id) o; + return n.canEquals(this) && super.equals(o); + } + + public boolean canEquals(Object o) + { + return o instanceof Id; + } + + @Override + public int hashCode() + { + int hash = 2753; + hash = 31 * super.hashCode(); + return hash; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/name/LProtoName.java b/scribble-core/src/main/java/org/scribble/core/type/name/LProtoName.java new file mode 100644 index 000000000..c666b300a --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/name/LProtoName.java @@ -0,0 +1,73 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.name; + +import org.scribble.core.type.kind.Local; + + +public class LProtoName extends ProtoName + implements PayElemType // @Deprecated -- not used, deleg elems currently have to be (Global@Role) +{ + private static final long serialVersionUID = 1L; + + public LProtoName(ModuleName modname, ProtoName membname) + { + super(Local.KIND, modname, membname); + } + + public LProtoName(String simpname) + { + super(Local.KIND, simpname); + } + + /*@Override + public boolean isLDelegationType() + { + return true; + }*/ + + @Override + public LProtoName getSimpleName() + { + return new LProtoName(getLastElement()); + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof LProtoName)) + { + return false; + } + LProtoName n = (LProtoName) o; + return n.canEquals(this) && super.equals(o); + } + + public boolean canEquals(Object o) + { + return o instanceof LProtoName; + } + + @Override + public int hashCode() + { + int hash = 2789; + hash = 31 * super.hashCode(); + return hash; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/name/MemberName.java b/scribble-core/src/main/java/org/scribble/core/type/name/MemberName.java new file mode 100644 index 000000000..4b2c240f9 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/name/MemberName.java @@ -0,0 +1,45 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.name; + +import org.scribble.core.type.kind.Kind; + + +// Simple name or qualified name +public abstract class MemberName extends QualName +{ + private static final long serialVersionUID = 1L; + + public MemberName(K kind, ModuleName modname, Name membname) + { + super(kind, compileMemberName(modname, membname)); + } + + public MemberName(K kind, String simplename) + { + super(kind, Name.compileElements(ModuleName.EMPTY_MODULENAME.getElements(), simplename)); + } + + @Override + public ModuleName getPrefix() + { + return new ModuleName(getPrefixElements()); + } + + // Similar in ModuleName + private static String[] compileMemberName(ModuleName modname, Name membname) + { + return Name.compileElements(modname.getElements(), membname.getLastElement()); + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/name/ModuleName.java b/scribble-core/src/main/java/org/scribble/core/type/name/ModuleName.java new file mode 100644 index 000000000..4511bde8d --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/name/ModuleName.java @@ -0,0 +1,108 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.name; + +import java.nio.file.Path; +import java.nio.file.Paths; + +import org.scribble.core.type.kind.ModuleKind; +import org.scribble.util.Constants; + +// General name: simple or full (a central class for value comparison) +public class ModuleName extends QualName +{ + private static final long serialVersionUID = 1L; + + protected static final ModuleName EMPTY_MODULENAME = new ModuleName(); + + protected ModuleName(String... elems) + { + super(ModuleKind.KIND, elems); + } + + public ModuleName(PackageName packname, ModuleName modname) + { + super(ModuleKind.KIND, compileModuleName(packname, modname)); + } + + public ModuleName(String modname) + { + super(ModuleKind.KIND, Name.compileElements(PackageName.EMPTY_PACKAGENAME.getElements(), modname)); + } + + public Path toPath() + { + String[] elems = getElements(); + String file = elems[0]; + for (int i = 1; i < elems.length; i++) + { + file += "/" + elems[i]; + } + return Paths.get(file + "." + Constants.SCRIBBLE_FILE_EXTENSION); + } + + public boolean isSimpleName() + { + return !isPrefixed(); + } + + @Override + public ModuleName getSimpleName() + { + return new ModuleName(getLastElement()); + } + + public PackageName getPrefix() + { + return new PackageName(getPrefixElements()); + } + + public PackageName getPackageName() + { + return getPrefix(); + } + + private static String[] compileModuleName(PackageName packname, ModuleName modname) + { + return Name.compileElements(packname.getElements(), modname.getLastElement()); + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof ModuleName)) + { + return false; + } + ModuleName n = (ModuleName) o; + return n.canEquals(this) && super.equals(o); + } + + public boolean canEquals(Object o) + { + return o instanceof ModuleName; + } + + @Override + public int hashCode() + { + int hash = 2797; + hash = 31 * super.hashCode(); + return hash; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/name/MsgId.java b/scribble-core/src/main/java/org/scribble/core/type/name/MsgId.java new file mode 100644 index 000000000..f95ad2b30 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/name/MsgId.java @@ -0,0 +1,30 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.name; + +import org.scribble.core.type.kind.MsgIdKind; + + +public interface MsgId extends Name +{ + default boolean isOp() + { + return false; + } + + default boolean isSigName() + { + return false; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/name/Name.java b/scribble-core/src/main/java/org/scribble/core/type/name/Name.java new file mode 100644 index 000000000..2c103444a --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/name/Name.java @@ -0,0 +1,43 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.name; + +import java.io.Serializable; +import java.util.Arrays; + +import org.scribble.core.type.kind.Kind; + + +public interface Name extends Serializable +{ + K getKind(); + + String[] getElements(); + int getElementCount(); + boolean isEmpty(); + String getLastElement(); + //boolean isPrefixed(); + //String[] getPrefixElements(); + + static String[] compileElements(String[] cn, String n) + { + if (cn.length == 0) + { + return new String[] { n }; + } + String[] elems = Arrays.copyOf(cn, cn.length + 1); + elems[elems.length - 1] = n; + return elems; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/name/Named.java b/scribble-core/src/main/java/org/scribble/core/type/name/Named.java new file mode 100644 index 000000000..9d5043321 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/name/Named.java @@ -0,0 +1,22 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.name; + +import org.scribble.core.type.kind.Kind; + + +public interface Named +{ + Name toName(); +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/name/Op.java b/scribble-core/src/main/java/org/scribble/core/type/name/Op.java new file mode 100644 index 000000000..27bab91db --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/name/Op.java @@ -0,0 +1,67 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.name; + +import org.scribble.core.type.kind.OpKind; + +public class Op extends AbstractName implements MsgId +{ + private static final long serialVersionUID = 1L; + + public static final Op EMPTY_OP = new Op(); + + protected Op() + { + super(OpKind.KIND); + } + + public Op(String text) + { + super(OpKind.KIND, text); + } + + @Override + public boolean isOp() + { + return true; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof Op)) + { + return false; + } + Op n = (Op) o; + return n.canEquals(this) && super.equals(o); + } + + public boolean canEquals(Object o) + { + return o instanceof Op; + } + + @Override + public int hashCode() + { + int hash = 2801; + hash = 31 * super.hashCode(); + return hash; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/name/PackageName.java b/scribble-core/src/main/java/org/scribble/core/type/name/PackageName.java new file mode 100644 index 000000000..96bc5a77d --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/name/PackageName.java @@ -0,0 +1,68 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.name; + +import org.scribble.core.type.kind.PackageKind; + +public class PackageName extends QualName +{ + private static final long serialVersionUID = 1L; + + public static final PackageName EMPTY_PACKAGENAME = new PackageName(); + + public PackageName(String... elems) + { + super(PackageKind.KIND, elems); + } + + @Override + public PackageName getPrefix() + { + return new PackageName(getPrefixElements()); + } + + @Override + public PackageName getSimpleName() + { + return new PackageName(getLastElement()); + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof PackageName)) + { + return false; + } + PackageName n = (PackageName) o; + return n.canEquals(this) && super.equals(o); + } + + public boolean canEquals(Object o) + { + return o instanceof PackageName; + } + + @Override + public int hashCode() + { + int hash = 2803; + hash = 31 * super.hashCode(); + return hash; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/name/PayElemType.java b/scribble-core/src/main/java/org/scribble/core/type/name/PayElemType.java new file mode 100644 index 000000000..dbd0987ad --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/name/PayElemType.java @@ -0,0 +1,36 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.name; + +import org.scribble.core.type.kind.PayElemKind; +import org.scribble.core.type.session.Arg; + + +public interface PayElemType extends Arg +{ + default boolean isDataName() + { + return false; + } + + default boolean isGDelegationType() + { + return false; + } + + /*public boolean isLDelegationType() // Not currently used + { + return true; + }*/ +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/name/ProtoName.java b/scribble-core/src/main/java/org/scribble/core/type/name/ProtoName.java new file mode 100644 index 000000000..bab4a8151 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/name/ProtoName.java @@ -0,0 +1,36 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.name; + +import org.scribble.core.type.kind.ProtoKind; + + +// Potentially qualified/canonical protocol name; not the AST primitive identifier +public abstract class ProtoName extends MemberName +{ + private static final long serialVersionUID = 1L; + + public ProtoName(K kind, ModuleName modname, ProtoName membname) + { + super(kind, modname, membname); + } + + public ProtoName(K kind, String simpname) + { + super(kind, simpname); + } + + @Override + public abstract ProtoName getSimpleName(); +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/name/QualName.java b/scribble-core/src/main/java/org/scribble/core/type/name/QualName.java new file mode 100644 index 000000000..e071d7c35 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/name/QualName.java @@ -0,0 +1,46 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.name; + +import java.util.Arrays; + +import org.scribble.core.type.kind.Kind; + + +// A (potenitally" qualified name -- a compound name +public abstract class QualName extends AbstractName +{ + private static final long serialVersionUID = 1L; + + public QualName(K kind, String... elems) + { + super(kind, elems); + } + + //@Override + public boolean isPrefixed() + { + return this.elems.length > 1; + } + + //@Override + public String[] getPrefixElements() + { + return Arrays.copyOfRange(this.elems, 0, this.elems.length - 1); + } + + // Also done by Scope + public abstract Name getPrefix(); + public abstract Name getSimpleName(); +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/name/RecVar.java b/scribble-core/src/main/java/org/scribble/core/type/name/RecVar.java new file mode 100644 index 000000000..7cdbc56ce --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/name/RecVar.java @@ -0,0 +1,60 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.name; + +import org.scribble.core.type.kind.RecVarKind; + +// CHECKME: RecVar inconsistent with, e.g., G/LProtocolName? +public class RecVar extends AbstractName //implements PathElement +{ + private static final long serialVersionUID = 1L; + + protected RecVar() + { + super(RecVarKind.KIND); + } + + public RecVar(String text) + { + super(RecVarKind.KIND, text); + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof RecVar)) + { + return false; + } + RecVar n = (RecVar) o; + return n.canEquals(this) && super.equals(o); + } + + public boolean canEquals(Object o) + { + return o instanceof RecVar; + } + + @Override + public int hashCode() + { + int hash = 2819; + hash = 31 * super.hashCode(); + return hash; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/name/Role.java b/scribble-core/src/main/java/org/scribble/core/type/name/Role.java new file mode 100644 index 000000000..fb0e96349 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/name/Role.java @@ -0,0 +1,63 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.name; + +import org.scribble.core.type.kind.RoleKind; + + +public class Role extends AbstractName // CHECKME: type.name package has no SimpleName +{ + public static final Role EMPTY_ROLE = new Role(); + public static final Role SELF = new Role("self"); // TODO Factor out constant + + private static final long serialVersionUID = 1L; + + protected Role() + { + super(RoleKind.KIND); + } + + public Role(String text) + { + super(RoleKind.KIND, text); + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof Role)) + { + return false; + } + Role n = (Role) o; + return n.canEquals(this) && super.equals(o); + } + + public boolean canEquals(Object o) + { + return o instanceof Role; + } + + @Override + public int hashCode() + { + int hash = 2741; + hash = 31 * super.hashCode(); + return hash; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/name/SigName.java b/scribble-core/src/main/java/org/scribble/core/type/name/SigName.java new file mode 100644 index 000000000..53b806993 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/name/SigName.java @@ -0,0 +1,86 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.name; + +import org.scribble.core.type.kind.SigKind; +import org.scribble.core.type.session.Msg; + + +// The name of a declared (imported) message signature member +public class SigName extends MemberName implements Msg, MsgId +{ + private static final long serialVersionUID = 1L; + + public SigName(ModuleName modname, SigName simplename) + { + super(SigKind.KIND, modname, simplename); + } + + public SigName(String simplename) + { + super(SigKind.KIND, simplename); + } + + @Override + public SigKind getKind() + { + return SigKind.KIND; // Same as this.kind + } + + @Override + public SigName getSimpleName() + { + return new SigName(getLastElement()); + } + + @Override + public MsgId getId() + { + return this; // FIXME: should be resolved to a canonical name + } + + @Override + public boolean isSigName() + { + return true; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof SigName)) + { + return false; + } + SigName n = (SigName) o; + return n.canEquals(this) && super.equals(o); + } + + public boolean canEquals(Object o) + { + return o instanceof SigName; + } + + @Override + public int hashCode() + { + int hash = 2791; + hash = 31 * super.hashCode(); + return hash; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/name/Substitutions.java b/scribble-core/src/main/java/org/scribble/core/type/name/Substitutions.java new file mode 100644 index 000000000..b04baf91b --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/name/Substitutions.java @@ -0,0 +1,135 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.name; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +import org.scribble.core.lang.SubprotoSig; +import org.scribble.core.type.kind.NonRoleParamKind; +import org.scribble.core.type.session.Arg; + +// CHECKME: move to util? +public class Substitutions +{ + // Old name -> new name + private final Map rsubs = new HashMap<>(); + private final Map, Arg> + asubs = new HashMap<>(); + // Keys are actually simple names (params) + // args are MessageSigName or DataType (but not MessageSig) -- N.B. substitution may replace sig name with a sig + // NonRoleParamKind, not NonRoleArgKind, because latter includes AmbigKind due to parsing requirements + // Better (CHECKME: necessary?) to separate roles and args -- but MessageSigName and DataType need to be distinct (so can group up, cf. NonRoleArgList) + + public Substitutions(List rold, List rnew, + List> aold, + List> anew) + { + if (rold.size() != rnew.size()) + { + throw new RuntimeException( + "Role list arity mismatch: " + rold + " ; " + rnew); + } + if (aold.size() != anew.size()) + { + throw new RuntimeException( + "Arg list arity mismatch: " + aold + " ; " + anew); + } + Iterator i = rnew.iterator(); + rold.forEach(x -> this.rsubs.put(x, i.next())); + Iterator> j = anew.iterator(); + aold.forEach(x -> this.asubs.put(x, j.next())); + } + + /*public void put(N old, N neu) + { + this.subs.put(old, neu); + }*/ + + public Role subsRole(Role old) + { + return subsRole(old, false); + } + + public Role subsRole(Role old, boolean passive) + { + if (!this.rsubs.containsKey(old)) + { + if (!passive) + { + throw new RuntimeException("Unknown role: " + old); + } + return old; + } + return this.rsubs.get(old); + } + + public Arg subsArg(MemberName old) + { + return subsArg(old, false); + } + + public // + Arg subsArg(MemberName old, boolean passive) + // ? param more convenient for accepting DataType/MessageSigName params + { + if (!this.asubs.containsKey(old)) + { + if (!passive) + { + throw new RuntimeException("Unknown param/arg: " + old); + } + return SubprotoSig.paramToArg(old); + } + return this.asubs.get(old); + } + + public boolean hasArg(MemberName old) + // ? param more convenient for accepting DataType/MessageSigName params + { + return this.asubs.containsKey(old); + } + + @Override + public String toString() + { + return this.rsubs + "; " + this.asubs; + } + + @Override + public int hashCode() + { + int hash = 1889; + hash = 31 * hash + this.rsubs.hashCode(); + hash = 31 * hash + this.asubs.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof Substitutions)) + { + return false; + } + Substitutions them = (Substitutions) o; + return this.rsubs.equals(them.rsubs) && this.asubs.equals(them.asubs); + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/session/Arg.java b/scribble-core/src/main/java/org/scribble/core/type/session/Arg.java new file mode 100644 index 000000000..74b2999bd --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/session/Arg.java @@ -0,0 +1,22 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.session; + +import org.scribble.core.type.kind.NonRoleArgKind; + +// A subprotocol argument (DoArgNode): SigKind or PayloadTypeKind +public interface Arg +{ + NonRoleArgKind getKind(); +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/session/BasicInteraction.java b/scribble-core/src/main/java/org/scribble/core/type/session/BasicInteraction.java new file mode 100644 index 000000000..2006b9edd --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/session/BasicInteraction.java @@ -0,0 +1,74 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.session; + +import org.antlr.runtime.tree.CommonTree; +import org.scribble.core.type.kind.ProtoKind; + +public abstract class BasicInteraction> + extends STypeBase implements SType +{ + public BasicInteraction(CommonTree source) + { + super(source); + } + + @Override + public CommonTree getSource() + { + return (CommonTree) super.getSource(); + } + + + + + + + + + + + + + /*@Override + public Set getRecVars() + { + return Collections.emptySet(); + } + + @Override + public BasicInteraction getInlined(STypeInliner v) + { + return this; + } + + @Override + public BasicInteraction unfoldAllOnce(STypeUnfolder u) + { + return this; + } + + @Override + public List> getProtoDependencies() + { + return Collections.emptyList(); + } + + @Override + public BasicInteraction pruneRecs() + { + return this; + } + */ +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/session/Choice.java b/scribble-core/src/main/java/org/scribble/core/type/session/Choice.java new file mode 100644 index 000000000..6e8956e09 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/session/Choice.java @@ -0,0 +1,201 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.session; + +import java.util.Collections; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.antlr.runtime.tree.CommonTree; +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.core.type.name.Role; +import org.scribble.core.visit.STypeAgg; +import org.scribble.core.visit.STypeAggNoThrow; +import org.scribble.util.ScribException; + +public abstract class Choice> + extends STypeBase implements SType +{ + public final Role subj; + public final List blocks; // Pre: size > 0 + // CHECKME: rename? + + public Choice(CommonTree source, Role subj, + List blocks) + { + super(source); + this.subj = subj; + this.blocks = Collections.unmodifiableList(blocks); + } + + public abstract Choice reconstruct(CommonTree source, Role subj, + List blocks); + //List> blocks); + + @Override + public T visitWith(STypeAgg v) throws ScribException + { + return v.visitChoice(this); + } + + @Override + public T visitWithNoThrow(STypeAggNoThrow v) + { + return v.visitChoice(this); + } + + @Override + public Stream gather(Function, Stream> f) + { + return Stream.concat(f.apply(this), + this.blocks.stream().flatMap(x -> x.gather(f))); + } + + @Override + public String toString() + { + return "choice at " + this.subj + " " + + this.blocks.stream().map(x -> "{\n" + x.toString() + "\n}") + .collect(Collectors.joining(" or ")); + } + + @Override + public int hashCode() + { + int hash = 1487; + hash = 31 * hash + super.hashCode(); + hash = 31 * hash + this.subj.hashCode(); + hash = 31 * hash + this.blocks.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof Choice)) + { + return false; + } + Choice them = (Choice) o; + return super.equals(this) // Does canEquals + && this.subj.equals(them.subj) && this.blocks.equals(them.blocks); + } + + + + + + + + + + + + + + + + + /* + + @Override + public SType visitWith(STypeVisitor v) throws ScribException + { + return v.visitChoice(this); + } + + @Override + public SType visitWithNoEx(STypeVisitorNoEx v) + { + return v.visitChoice(this); + } + + @Override + public Set getRoles() + { + Set res = Stream.of(this.subj).collect(Collectors.toSet()); + this.blocks.forEach(x -> res.addAll(x.getRoles())); + return res; + } + + @Override + public Set> getMessageIds() + { + return this.blocks.stream().flatMap(x -> x.getMessageIds().stream()) + .collect(Collectors.toSet()); + } + + @Override + public Set getRecVars() + { + return this.blocks.stream().flatMap(x -> x.getRecVars().stream()) + .collect(Collectors.toSet()); + } + + @Override + public Choice getInlined(STypeInliner v) + { + CommonTree source = getSource(); // CHECKME: or empty source? + List blocks = this.blocks.stream().map(x -> x.getInlined(v)) + .collect(Collectors.toList()); + return reconstruct(source, this.subj, blocks); + } + + @Override + public Choice unfoldAllOnce(STypeUnfolder u) + { + CommonTree source = getSource(); // CHECKME: or empty source? + List blocks = this.blocks.stream().map(x -> x.unfoldAllOnce(u)) + .collect(Collectors.toList()); + return reconstruct(source, this.subj, blocks); + } + + @Override + public List> getProtoDependencies() + { + return this.blocks.stream().flatMap(x -> x.getProtoDependencies().stream()) + .distinct().collect(Collectors.toList()); + } + + @Override + public List> getNonProtoDependencies() + { + return this.blocks.stream() + .flatMap(x -> x.getNonProtoDependencies().stream()).distinct() + .collect(Collectors.toList()); + } + + @Override + public Choice substitute(Substitutions subs) + { + List blocks = this.blocks.stream().map(x -> x.substitute(subs)) + .collect(Collectors.toList()); + return reconstruct(getSource(), subs.subsRole(this.subj), blocks); + } + + @Override + public Choice pruneRecs() + { + List blocks = this.blocks.stream().map(x -> x.pruneRecs()) + .collect(Collectors.toList()); + return reconstruct(getSource(), this.subj, blocks); + } + */ +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/session/ConnectAction.java b/scribble-core/src/main/java/org/scribble/core/type/session/ConnectAction.java new file mode 100644 index 000000000..b7bdfa26b --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/session/ConnectAction.java @@ -0,0 +1,77 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.session; + +import org.antlr.runtime.tree.CommonTree; +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.core.type.name.Role; + +public abstract class ConnectAction> + extends DirectedInteraction +{ + public ConnectAction(CommonTree source, // BaseInteractionNode not ideal + Msg msg, Role src, Role dst) + { + super(source, msg, src, dst); + } + + + + + + + + + + + + + + + + + + + + + /*@Override + public List> getNonProtoDependencies() + { + List> res = new LinkedList<>(); + if (this.msg.isMessageSigName()) + { + res.add((MessageSigName) this.msg); + } + else //if (this.msg.isMessageSig) + { + Payload pay = ((MessageSig) this.msg).payload; + for (PayloadElemType p : pay.elems) + { + if (p.isDataType()) + { + res.add((DataType) p); + } + else if (p.isGDelegationType()) + { + throw new RuntimeException("Shouldn't get in here: " + this); + } + else + { + throw new RuntimeException("[TODO]: " + this); + } + } + } + return res; + }*/ +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/session/Continue.java b/scribble-core/src/main/java/org/scribble/core/type/session/Continue.java new file mode 100644 index 000000000..ebfc1aec3 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/session/Continue.java @@ -0,0 +1,165 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.session; + +import java.util.function.Function; +import java.util.stream.Stream; + +import org.antlr.runtime.tree.CommonTree; +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.core.type.name.RecVar; +import org.scribble.core.visit.STypeAgg; +import org.scribble.core.visit.STypeAggNoThrow; +import org.scribble.util.ScribException; + +public abstract class Continue> + extends STypeBase +{ + public final RecVar recvar; + + public Continue(//org.scribble.ast.Continue source, + CommonTree source, // Due to inlining, do -> continue + RecVar recvar) + { + super(source); + this.recvar = recvar; + } + + public abstract Continue reconstruct( + CommonTree source, RecVar recvar); + + @Override + public T visitWith(STypeAgg v) throws ScribException + { + return v.visitContinue(this); + } + + @Override + public T visitWithNoThrow(STypeAggNoThrow v) + { + return v.visitContinue(this); + } + + @Override + public Stream gather(Function, Stream> f) + { + return f.apply(this); + } + + @Override + public String toString() + { + return "continue " + this.recvar + ";"; + } + + @Override + public int hashCode() + { + int hash = 3217; + hash = 31 * hash + super.hashCode(); + hash = 31 * hash + this.recvar.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof Continue)) + { + return false; + } + Continue them = (Continue) o; + return super.equals(this) // Does canEquals + && this.recvar.equals(them.recvar); + } + + + + + + + + + + + /* + + @Override + public SType visitWith(STypeVisitor v) throws ScribException + { + return v.visitContinue(this); + } + + @Override + public SType visitWithNoEx(STypeVisitorNoEx v) + { + return v.visitContinue(this); + } + + @Override + public Set getRoles() + { + return Collections.emptySet(); + } + + @Override + public Set> getMessageIds() + { + return Collections.emptySet(); + } + + @Override + public Set getRecVars() + { + return Stream.of(this.recvar).collect(Collectors.toSet()); + } + + @Override + public Continue getInlined(STypeInliner v) + { + RecVar rv = v.getInlinedRecVar(this.recvar); + return reconstruct(getSource(), rv); + } + + @Override + public List> getProtoDependencies() + { + return Collections.emptyList(); + } + + @Override + public List> getNonProtoDependencies() + { + return Collections.emptyList(); + } + + @Override + public Continue substitute(Substitutions subs) + { + //return reconstruct(getSource(), this.recvar); + return this; + } + + @Override + public Continue pruneRecs() + { + //return reconstruct(getSource(), this.recvar); + return this; + } + */ +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/session/DirectedInteraction.java b/scribble-core/src/main/java/org/scribble/core/type/session/DirectedInteraction.java new file mode 100644 index 000000000..c7c805bd5 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/session/DirectedInteraction.java @@ -0,0 +1,155 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.session; + +import java.util.function.Function; +import java.util.stream.Stream; + +import org.antlr.runtime.tree.CommonTree; +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.core.type.name.Role; +import org.scribble.core.visit.STypeAgg; +import org.scribble.core.visit.STypeAggNoThrow; +import org.scribble.util.ScribException; + +// Besides directed-ness, also features a Message +public abstract class DirectedInteraction> + extends BasicInteraction +{ + // Following ast children order + public final Msg msg; + public final Role src; + public final Role dst; + + public DirectedInteraction(CommonTree source, + Msg msg, Role src, Role dst) + { + super(source); + this.msg = msg; + this.src = src; + this.dst = dst; + } + + public abstract DirectedInteraction reconstruct( + CommonTree source, Msg msg, Role src, + Role dst); + + @Override + public T visitWith(STypeAgg v) throws ScribException + { + return v.visitDirectedInteraction(this); + } + + @Override + public T visitWithNoThrow(STypeAggNoThrow v) + { + return v.visitDirectedInteraction(this); + } + + @Override + public Stream gather(Function, Stream> f) + { + return f.apply(this); + } + + @Override + public CommonTree getSource() + { + return (CommonTree) super.getSource(); + } + + @Override + public int hashCode() + { + int hash = 10631; + hash = 31 * hash + super.hashCode(); + hash = 31 * hash + this.msg.hashCode(); + hash = 31 * hash + this.src.hashCode(); + hash = 31 * hash + this.dst.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof DirectedInteraction)) + { + return false; + } + DirectedInteraction them = (DirectedInteraction) o; + return super.equals(this) // Does canEquals + && this.msg.equals(them.msg) && this.src.equals(them.src) + && this.dst.equals(them.dst); + } + + + + + + + + + + + + + + /* + + @Override + public SType visitWith(STypeVisitor v) throws ScribException + { + return v.visitDirectedInteraction(this); + } + + @Override + public SType visitWithNoEx(STypeVisitorNoEx v) + { + return v.visitDirectedInteraction(this); + } + + @Override + public Set getRoles() + { + // Includes self + return Stream.of(this.src, this.dst).collect(Collectors.toSet()); + } + + @Override + public Set> getMessageIds() + { + return Stream.of(this.msg.getId()).collect(Collectors.toSet()); + } + + @Override + public DirectedInteraction substitute(Substitutions subs) + { + Message msg = this.msg; + if (msg instanceof MemberName) + { + MemberName n = (MemberName) msg; + if (subs.hasArg(n)) + { + msg = (Message) subs.subsArg(n); + } + } + return reconstruct(getSource(), msg, subs.subsRole(this.src), + subs.subsRole(this.dst)); + } + */ +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/session/DisconnectAction.java b/scribble-core/src/main/java/org/scribble/core/type/session/DisconnectAction.java new file mode 100644 index 000000000..d7d44e78d --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/session/DisconnectAction.java @@ -0,0 +1,145 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.session; + +import java.util.function.Function; +import java.util.stream.Stream; + +import org.antlr.runtime.tree.CommonTree; +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.core.type.name.Role; +import org.scribble.core.visit.STypeAgg; +import org.scribble.core.visit.STypeAggNoThrow; +import org.scribble.util.ScribException; + +// Base class would be "SymmetricInteraction" (cf., DirectedInteraction) +public abstract class DisconnectAction> + extends BasicInteraction +{ + public final Role left; + public final Role right; + + public DisconnectAction(CommonTree source, + Role left, Role right) + { + super(source); + this.left = left; + this.right = right; + } + + public abstract DisconnectAction reconstruct( + CommonTree source, Role src, Role dst); + + @Override + public T visitWith(STypeAgg v) throws ScribException + { + return v.visitDisconnect(this); + } + + @Override + public T visitWithNoThrow(STypeAggNoThrow v) + { + return v.visitDisconnect(this); + } + + @Override + public Stream gather(Function, Stream> f) + { + return f.apply(this); + } + + @Override + public int hashCode() + { + int hash = 10663; + hash = 31 * hash + super.hashCode(); + hash = 31 * hash + this.left.hashCode(); + hash = 31 * hash + this.right.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof DisconnectAction)) + { + return false; + } + DisconnectAction them = (DisconnectAction) o; + return super.equals(this) // Does canEquals + && this.left.equals(them.left) && this.right.equals(them.right); + } + + + + + + + + + + + + + + + + + + + /* + + @Override + public SType visitWith(STypeVisitor v) throws ScribException + { + return v.visitDisconnect(this); + } + + @Override + public SType visitWithNoEx(STypeVisitorNoEx v) + { + return v.visitDisconnect(this); + } + + @Override + public Set getRoles() + { + // Includes self + return Stream.of(this.left, this.right).collect(Collectors.toSet()); + } + + @Override + public Set> getMessageIds() + { + return Collections.emptySet(); + } + + @Override + public List> getNonProtoDependencies() + { + return Collections.emptyList(); + } + + @Override + public DisconnectAction substitute(Substitutions subs) + { + return reconstruct(getSource(), subs.subsRole(this.left), + subs.subsRole(this.right)); + } + */ +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/session/Do.java b/scribble-core/src/main/java/org/scribble/core/type/session/Do.java new file mode 100644 index 000000000..839cde50c --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/session/Do.java @@ -0,0 +1,219 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.session; + +import java.util.Collections; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.antlr.runtime.tree.CommonTree; +import org.scribble.core.job.Core; +import org.scribble.core.lang.Protocol; +import org.scribble.core.type.kind.NonRoleParamKind; +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.core.type.name.ProtoName; +import org.scribble.core.type.name.Role; +import org.scribble.core.visit.STypeAgg; +import org.scribble.core.visit.STypeAggNoThrow; +import org.scribble.util.ScribException; + +public abstract class Do> + extends STypeBase +{ + public final ProtoName proto; // Currently disamb'd to fullname by GTypeTranslator (see GDoDel::translate) + public final List roles; // Ordered role args; pre: size > 2 + public final List> args; + // NonRoleParamKind, not NonRoleArgKind, because latter includes AmbigKind due to parsing requirements + + public Do(CommonTree source, ProtoName proto, + List roles, List> args) + { + super(source); + this.proto = proto; + this.roles = Collections.unmodifiableList(roles); + this.args = Collections.unmodifiableList(args); + } + + /*// Not that useful: calling on Do doesn't give the overridden return + public abstract ProtoName getProto(); // Override with concrete return*/ + + public abstract Protocol getTarget(Core core); // CHECKME: "?" + + public abstract Do reconstruct(CommonTree source, + ProtoName proto, List roles, List> args); + + @Override + public T visitWith(STypeAgg v) throws ScribException + { + return v.visitDo(this); + } + + @Override + public T visitWithNoThrow(STypeAggNoThrow v) + { + return v.visitDo(this); + } + + @Override + public Stream gather(Function, Stream> f) + { + return f.apply(this); + } + + @Override + public String toString() + { + return "do " + this.proto + + "<" + + this.args.stream().map(x -> x.toString()) + .collect(Collectors.joining(", ")) + + ">" + + "(" + this.roles.stream().map(x -> x.toString()) + .collect(Collectors.joining(", ")) + + ");"; + } + + @Override + public int hashCode() + { + int hash = 193; + hash = 31 * hash + super.hashCode(); + hash = 31 * hash + this.proto.hashCode(); + hash = 31 * hash + this.roles.hashCode(); + hash = 31 * hash + this.args.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof Do)) + { + return false; + } + Do them = (Do) o; + return super.equals(this) // Does canEquals + && this.proto.equals(them.proto) && this.roles.equals(them.roles) + && this.args.equals(them.args); + } + + + + + + + + + + + + + + + /* + @Override + public SType visitWith(STypeVisitor v) throws ScribException + { + return v.visitDo(this); + } + + @Override + public SType visitWithNoEx(STypeVisitorNoEx v) + { + return v.visitDo(this); + } + + @Override + public Set getRoles() + { + return this.roles.stream().collect(Collectors.toSet()); + } + + @Override + public Set> getMessageIds() + { + Set> mids = new HashSet<>(); + for (Arg a : this.args) + { + if (a instanceof Message) + { + mids.add(((Message) a).getId()); + } + } + return mids; + } + + @Override + public Set getRecVars() + { + return Collections.emptySet(); + } + + @Override + public SType unfoldAllOnce(STypeUnfolder u) + { + throw new RuntimeException("Unsupported for Do: " + this); + } + + @Override + public List> getProtoDependencies() + { + return Stream.of(this.proto).collect(Collectors.toList()); + } + + @Override + public List> getNonProtoDependencies() + { + return this.args.stream() + .filter(x -> (x instanceof MessageSig) || (x instanceof DataType)) // CHECKME: refactor? + .map(x -> (MemberName) x).collect(Collectors.toList()); + } + + @Override + public Do pruneRecs() + { + return this; + } + + @Override + public Do substitute(Substitutions subs) + { + List roles = this.roles.stream().map(x -> subs.subsRole(x)) + .collect(Collectors.toList()); + List> args = new LinkedList<>(); + for (Arg a : this.args) + { + if (a instanceof MemberName && subs.hasArg((MemberName) a)) + { + if (a instanceof DataType) + { + a = subs.subsArg((DataType) a); + } + else if (a instanceof MessageSigName) + { + a = subs.subsArg((MessageSigName) a); + } + } + args.add(a); + } + return reconstruct(getSource(), this.proto, roles, args); + } + */ +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/session/Msg.java b/scribble-core/src/main/java/org/scribble/core/type/session/Msg.java new file mode 100644 index 000000000..f5a852ef5 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/session/Msg.java @@ -0,0 +1,36 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.session; + +import org.scribble.core.type.kind.MsgIdKind; +import org.scribble.core.type.kind.SigKind; +import org.scribble.core.type.name.MsgId; + + + +// A sig kind name: MessageSignature value (or parameter) +public interface Msg extends Arg +{ + MsgId getId(); + + default boolean isSigLit() + { + return false; + } + + default boolean isSigName() + { + return false; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/session/MsgTransfer.java b/scribble-core/src/main/java/org/scribble/core/type/session/MsgTransfer.java new file mode 100644 index 000000000..664095387 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/session/MsgTransfer.java @@ -0,0 +1,76 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.session; + +import org.antlr.runtime.tree.CommonTree; +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.core.type.name.Role; + +public abstract class MsgTransfer> + extends DirectedInteraction +{ + public MsgTransfer(CommonTree source, + Msg msg, Role src, Role dst) + { + super(source, msg, src, dst); + } + + + + + + + + + + + + + + + + + + + /* + @Override + public List> getNonProtoDependencies() + { + List> res = new LinkedList<>(); + if (this.msg.isMessageSigName()) + { + res.add((MessageSigName) this.msg); + } + else //if (this.msg.isMessageSig) + { + Payload pay = ((MessageSig) this.msg).payload; + for (PayloadElemType p : pay.elems) + { + if (p.isDataType()) + { + res.add((DataType) p); + } + else if (p.isGDelegationType()) // TODO FIXME: should be projected to local name + { + res.add(((GDelegationType) p).getGlobalProtocol()); + } + else + { + throw new RuntimeException("[TODO]: " + this); + } + } + } + return res; + }*/ +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/session/Payload.java b/scribble-core/src/main/java/org/scribble/core/type/session/Payload.java new file mode 100644 index 000000000..95a64d84c --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/session/Payload.java @@ -0,0 +1,74 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.session; + +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +import org.scribble.core.type.kind.PayElemKind; +import org.scribble.core.type.name.PayElemType; + +public class Payload +{ + public static final Payload EMPTY_PAYLOAD = new Payload( + Collections.emptyList()); + + public final List> elems; + + public Payload(List> elems) + { + this.elems = Collections.unmodifiableList(elems); + } + + public boolean isEmpty() + { + return this.elems.isEmpty(); + } + + @Override + public int hashCode() + { + int hash = 577; + hash = 31 * hash + this.elems.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof Payload)) + { + return false; + } + return this.elems.equals(((Payload) o).elems); + } + + @Override + public String toString() + { + return "(" + this.elems.stream().map(x -> x.toString()) + .collect(Collectors.joining(", ")) + ")"; + } + + /*@Override + public boolean isParameter() + { + return false; + }*/ +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/session/Recursion.java b/scribble-core/src/main/java/org/scribble/core/type/session/Recursion.java new file mode 100644 index 000000000..33b362ee5 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/session/Recursion.java @@ -0,0 +1,180 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.session; + +import java.util.function.Function; +import java.util.stream.Stream; + +import org.antlr.runtime.tree.CommonTree; +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.core.type.name.RecVar; +import org.scribble.core.visit.STypeAgg; +import org.scribble.core.visit.STypeAggNoThrow; +import org.scribble.util.ScribException; + +public abstract class Recursion> + extends STypeBase +{ + public final RecVar recvar; + public final B body; + + public Recursion(//org.scribble.ast.Recursion source, + CommonTree source, // Due to inlining, protodecl -> rec + RecVar recvar, B body) + { + super(source); + this.recvar = recvar; + this.body = body; + } + + public abstract Recursion reconstruct( + CommonTree source, RecVar recvar, B body); + + @Override + public T visitWith(STypeAgg v) throws ScribException + { + return v.visitRecursion(this); + } + + @Override + public T visitWithNoThrow(STypeAggNoThrow v) + { + return v.visitRecursion(this); + } + + @Override + public Stream gather(Function, Stream> f) + { + return Stream.concat(f.apply(this), this.body.gather(f)); + } + + @Override + public String toString() + { + return "rec " + this.recvar + " {\n" + this.body + "\n}"; + } + + @Override + public int hashCode() + { + int hash = 1487; + hash = 31 * hash + super.hashCode(); + hash = 31 * hash + this.recvar.hashCode(); + hash = 31 * hash + this.body.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof Recursion)) + { + return false; + } + Recursion them = (Recursion) o; + return super.equals(this) // Does canEquals + && this.recvar.equals(them.recvar) && this.body.equals(them.body); + } + + + + + + + + + + + + /* + @Override + public SType visitWith(STypeVisitor v) throws ScribException + { + return v.visitRecursion(this); + } + + @Override + public SType visitWithNoEx(STypeVisitorNoEx v) + { + return v.visitRecursion(this); + } + + + @Override + public Set getRoles() + { + return this.body.getRoles(); + } + + @Override + public Set> getMessageIds() + { + return this.body.getMessageIds(); + } + + @Override + public Set getRecVars() + { + return this.body.getRecVars(); + } + + + @Override + public SType unfoldAllOnce(STypeUnfolder u) + { + if (!u.hasRec(this.recvar)) // N.B. doesn't work if recvars shadowed + { + u.pushRec(this.recvar, this.body); + SType unf = this.body.unfoldAllOnce(u); + u.popRec(this.recvar); + // Needed for, e.g., repeat do's in separate choice cases -- cf. stack.pop in GDo::getInlined, must pop sig there for Seqs + return unf; + } + return this; + } + + @Override + public List> getProtoDependencies() + { + return this.body.getProtoDependencies(); + } + + @Override + public List> getNonProtoDependencies() + { + return this.body.getNonProtoDependencies(); + } + + @Override + public Recursion substitute(Substitutions subs) + { + return reconstruct(getSource(), this.recvar, this.body.substitute(subs)); + } + + @Override + public SType pruneRecs() + { + // Assumes no shadowing (e.g., use after SType#getInlined recvar disamb) + Set rvs = this.body.gather(new RecVarCollector()::visit) + .collect(Collectors.toSet()); + return rvs.contains(this.recvar) + ? this + : this.body; // i.e., return a Seq, to be "inlined" by Seq.pruneRecs -- N.B. must handle empty Seq case + } + */ +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/session/SType.java b/scribble-core/src/main/java/org/scribble/core/type/session/SType.java new file mode 100644 index 000000000..54a29ef0d --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/session/SType.java @@ -0,0 +1,81 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.session; + +import java.util.function.Function; +import java.util.stream.Stream; + +import org.scribble.core.lang.SNode; +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.core.visit.STypeAgg; +import org.scribble.core.visit.STypeAggNoThrow; +import org.scribble.util.ScribException; + + +// B used (needed?) to factor up several methods from G/L compounds to bases, e.g., getInlined and unfoldAllOnce +// Generic param works to "specialise" G/L subclasses (and works with immutable pattern) -- cf. not supported by contravariant method parameter subtyping for getters/setters +// N.B. Taking G/LSeq as the B param "limits" the "cast-freeness" of this hierarchy at this point -- i.e., potential G/LSeq subclasses would be beyond that point +// However, the framework is mainly intended to be extended "horizontally" w.r.t. node types (additional types), and "vertically" (subclasses) for behaviour only via Visitors +// In case of "vertical" extension of node types (e.g., additional node fields), still consider that extension of Seq is less often necessary +public interface SType> + extends SNode +{ + // N.B. visitWith should be considered a "top-level" entry point only, i.e., do not assume visitWith is called (or not) again during the recursive traversal + // (visitWith may be called enroute to each visitNode, except for Seq, which is "entered directly" via visitSeq due to its generic typing) + // (However, visitWith is used by Seq to visit its elems -- main point of visitWith is to be agnostic to node type) + T visitWith(STypeAgg v) throws ScribException; + T visitWithNoThrow(STypeAggNoThrow v); + + // Pass in an STypeGatherer::visit, e.g., n.(new RoleGatherer()::visit) + Stream gather(Function, Stream> f); + + // subclass equals should call this by: them.canEquals(this) + boolean canEquals(Object o); + + + + + + + + + + + + + + + + + /*Set getRoles(); + Set> getMessageIds(); + Set getRecVars(); // Gets Continue RecVars (not Recursion) + + // CHECKME: OK to (re-)use GTypeTranslator for inlining? + SType getInlined(STypeInliner i); + + // Unsupported for Do + // CHECKME: repeat recvar names OK? including non-shadowing (e.g., choice cases) + SType unfoldAllOnce(STypeUnfolder u); + + // Resulting Lists should not contain duplicates (i.e., Choice/Seq use distinct) + // Result does not necessarily contain root proto (protodecl is not an SType), but may do so via dependencies + List> getProtoDependencies(); + List> getNonProtoDependencies(); // N.B. delegation payloads currently here, not getProtoDependencies (CHECKME: refactor?) + + SType substitute(Substitutions subs); + + SType pruneRecs(); // Assumes no shadowing (e.g., use after inlining recvar disamb) + */ +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/session/STypeBase.java b/scribble-core/src/main/java/org/scribble/core/type/session/STypeBase.java new file mode 100644 index 000000000..9e2da1ef1 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/session/STypeBase.java @@ -0,0 +1,70 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.session; + +import org.antlr.runtime.tree.CommonTree; +import org.scribble.core.type.kind.ProtoKind; + +// SessTypeBase is to SessType as ScribNodeBase is to ScribNode +public abstract class STypeBase> + implements SType +{ + private final CommonTree source; // Currently null for "generated" terms (cf. hasSource) + + public STypeBase(CommonTree source) + { + /*CommonTree clone = (source == null) + ? null + : CommonTree.clone(); // clone not visibile*/ + // CHECKME: ScribNodes are technically mutable -- though should be treated immutable (defensive copies) post disamb, i.e., in core passes + this.source = source; + } + + @Override + public boolean hasSource() + { + return this.source != null; + } + + // Pre: hasSource + @Override + public CommonTree getSource() + { + return this.source; + } + + // Does *not* include this.source -- equals/hashCode is for "surface-level" syntactic equality of SessType only + @Override + public int hashCode() + { + int hash = 1871; + hash = 31 * hash + super.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof STypeBase)) + { + return false; + } + STypeBase them = (STypeBase) o; + return them.canEquals(this); + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/session/STypeFactory.java b/scribble-core/src/main/java/org/scribble/core/type/session/STypeFactory.java new file mode 100644 index 000000000..c1d88c90d --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/session/STypeFactory.java @@ -0,0 +1,66 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.session; + +import java.util.Arrays; + +import org.scribble.core.type.name.GProtoName; +import org.scribble.core.type.name.ModuleName; +import org.scribble.core.type.name.PackageName; +import org.scribble.core.type.session.global.GTypeFactory; +import org.scribble.core.type.session.local.LTypeFactory; + +public class STypeFactory +{ + public final GTypeFactory global; + public final LTypeFactory local; + + public STypeFactory(GTypeFactory global, LTypeFactory local) + { + this.global = global; + this.local = local; + } + + // N.B. targetted by generated Session API + // From fullname + public static GProtoName parseGlobalProtocolName(String name) + { + String[] elems = name.split("\\."); + if (elems.length < 2) + { + throw new RuntimeException("Bad protocol full name: " + name); + } + String membname = elems[elems.length - 1]; + ModuleName modname = new ModuleName(elems[elems.length - 2]); + if (elems.length > 2) + { + PackageName packname = new PackageName(Arrays.copyOfRange(elems, 0, elems.length - 2)); + modname = new ModuleName(packname, modname); + } + GProtoName gpn = new GProtoName(membname); + return new GProtoName(modname, gpn); + } + + + + + + + + /*public static ModuleName parseModuleName(String name) + { + String[] elems = name.split("\\."); + return new ModuleName(elems); + }*/ +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/session/Seq.java b/scribble-core/src/main/java/org/scribble/core/type/session/Seq.java new file mode 100644 index 000000000..12714f118 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/session/Seq.java @@ -0,0 +1,238 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.session; + +import java.util.Collections; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.antlr.runtime.tree.CommonTree; +import org.scribble.core.type.kind.ProtoKind; + +public abstract class Seq> + extends STypeBase +{ + // GType or LType -- could make SType subclasses take themself as another param, but not worth it + public final List> elems; + + public Seq(CommonTree source, List> elems) + { + super(source); + this.elems = Collections.unmodifiableList(elems); + } + + public abstract B reconstruct(CommonTree source, + List> elems); + + @Override + public Stream gather(Function, Stream> f) + { + return this.elems.stream().flatMap(x -> x.gather(f)); + } + + // Re. return type, could make SType subclasses take themself as another param, but not worth it + public abstract List> getElements(); + + public boolean isEmpty() + { + return this.elems.isEmpty(); + } + + @Override + public String toString() + { + return this.elems.stream().map(x -> x.toString()) + .collect(Collectors.joining("\n")); + } + + @Override + public int hashCode() + { + int hash = 1483; + hash = 31 * hash + super.hashCode(); + hash = 31 * hash + this.elems.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof Seq)) + { + return false; + } + Seq them = (Seq) o; + return super.equals(this) // Does canEquals + && this.elems.equals(them.elems); + } + + + + + + + + + + + + + + + /*@Override + public Set getRoles() + { + return this.elems.stream().flatMap(x -> x.getRoles().stream()) + .collect(Collectors.toSet()); + } + + @Override + public Set> getMessageIds() + { + return this.elems.stream().flatMap(x -> x.getMessageIds().stream()) + .collect(Collectors.toSet()); + } + + @Override + public Set getRecVars() + { + return this.elems.stream().flatMap(x -> x.getRecVars().stream()) + .collect(Collectors.toSet()); + } + + @Override + public B getInlined(STypeInliner v) + { + CommonTree source = getSource(); // CHECKME: or empty source? + List> elems = new LinkedList<>(); + for (SType e : this.elems) + { + SType e1 = e.getInlined(v); + if (e1 instanceof Seq) + { + elems.addAll(((Seq) e1).elems); // Inline Seq's returned by Do.getInlined + } + else + { + elems.add(e1); + } + } + return reconstruct(source, elems); + } + + @Override + public B unfoldAllOnce(STypeUnfolder u) + { + CommonTree source = getSource(); + List> elems = new LinkedList<>(); + for (SType e : this.elems) + { + SType e1 = e.unfoldAllOnce(u); + if (e1 instanceof Seq) + { + elems.addAll(((Seq) e1).elems); + } + else + { + elems.add(e1); + } + } + return reconstruct(source, elems); + } + + @Override + public List> getProtoDependencies() + { + return this.elems.stream().flatMap(x -> x.getProtoDependencies().stream()) + .distinct().collect(Collectors.toList()); + } + + @Override + public List> getNonProtoDependencies() + { + return this.elems.stream() + .flatMap(x -> x.getNonProtoDependencies().stream()).distinct() + .collect(Collectors.toList()); + } + + @Override + public B substitute(Substitutions subs) + { + List> elems = this.elems.stream() + .map(x -> x.substitute(subs)).collect(Collectors.toList()); + return reconstruct(getSource(), elems); + } + + @Override + public B pruneRecs() + { + List> elems = new LinkedList<>(); + for (SType e : this.elems) + { + SType e1 = (SType) e.pruneRecs(); + if (e1 instanceof Seq) // cf. Recursion::pruneRecs + { + elems.addAll(((Seq) e1).getElements()); // Handles empty Seq case + } + else + { + elems.add(e1); + } + } + return reconstruct(getSource(), elems); + } + */ + + /*@Override + public T aggregate(STypeAgg v) throws ScribException + { + @SuppressWarnings("unchecked") + B cast = (B) this; + return v.visitSeq(cast); + } + + @Override + public T aggregateNoEx(STypeAggNoEx v) + { + @SuppressWarnings("unchecked") + B cast = (B) this; + return v.visitSeq(cast); + } + + // Override STypeBase.visitWith for B return + // Alternatively: call v.visitSeq directly, bypasses generic cast + @Override + public B visitWith(STypeVisitor v) throws ScribException + { + @SuppressWarnings("unchecked") + B cast = (B) this; // CHECKME: OK as long as G/LSeq specify themselves as B param + return v.visitSeq(cast); + } + + // Override STypeBase.visitWithNoEx for B return + @Override + public B visitWithNoEx(STypeVisitorNoEx v) + { + @SuppressWarnings("unchecked") + B cast = (B) this; + return v.visitSeq(cast); + } + */ +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/session/SigLit.java b/scribble-core/src/main/java/org/scribble/core/type/session/SigLit.java new file mode 100644 index 000000000..4e833089a --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/session/SigLit.java @@ -0,0 +1,79 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.session; + +import org.scribble.core.type.kind.OpKind; +import org.scribble.core.type.kind.SigKind; +import org.scribble.core.type.name.MsgId; +import org.scribble.core.type.name.Op; + +public class SigLit implements Msg +{ + public final Op op; + public final Payload payload; + + public SigLit(Op op, Payload payload) + { + this.op = op; + this.payload = payload; + } + + @Override + public boolean isSigLit() + { + return true; + } + + @Override + public SigKind getKind() + { + return SigKind.KIND; + } + + @Override + public MsgId getId() + { + return this.op; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof SigLit)) + { + return false; + } + SigLit sig = (SigLit) o; + return this.op.equals(sig.op) && this.payload.equals(sig.payload); + } + + @Override + public int hashCode() + { + int hash = 3187; + hash = 31 * hash + this.op.hashCode(); + hash = 31 * hash + this.payload.hashCode(); + return hash; + } + + @Override + public String toString() + { + return this.op.toString() + this.payload.toString(); + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/session/global/GChoice.java b/scribble-core/src/main/java/org/scribble/core/type/session/global/GChoice.java new file mode 100644 index 000000000..4a0849002 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/session/global/GChoice.java @@ -0,0 +1,165 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.session.global; + +import java.util.List; + +import org.antlr.runtime.tree.CommonTree; +import org.scribble.core.type.kind.Global; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Choice; + +public class GChoice extends Choice implements GType +{ + protected GChoice(CommonTree source, Role subj, + List blocks) + { + super(source, subj, blocks); + } + + @Override + public GChoice reconstruct(CommonTree source, Role subj, + List blocks) + //List> blocks) + { + return new GChoice(source, subj, blocks); + } + + @Override + public int hashCode() + { + int hash = 3067; + hash = 31 * hash + super.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof GChoice)) + { + return false; + } + return super.equals(o); + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof GChoice; + } +} + + + + + + + + + + + + + + + + +/* + @Override + public Set checkRoleEnabling(Set enabled) throws ScribException + { + if (!enabled.contains(this.subj)) + { + throw new ScribException("Subject not enabled: " + this.subj); + } + Set subj = Stream.of(this.subj).collect(Collectors.toSet()); + List> blocks = new LinkedList<>(); + for (GSeq block : this.blocks) + { + blocks.add(block.checkRoleEnabling(subj)); + } + Set res = new HashSet<>(enabled); + Set tmp = blocks.stream().flatMap(x -> x.stream()) + .filter(x -> blocks.stream().allMatch(y -> y.contains(x))) + .collect(Collectors.toSet()); + res.addAll(tmp); + return Collections.unmodifiableSet(res); + } + + @Override + public Map checkExtChoiceConsistency(Map enablers) + throws ScribException + { + Map subj = Stream.of(this.subj) + .collect(Collectors.toMap(x -> x, x -> x)); + List> blocks = new LinkedList<>(); + for (GSeq block : this.blocks) + { + blocks.add(block.checkExtChoiceConsistency(subj)); + } + Map res = new HashMap<>(enablers); + Set> all = blocks.stream() + .flatMap(x -> x.entrySet().stream()).collect(Collectors.toSet()); + for (Entry e : all) + { + Role enabled = e.getKey(); + Role enabler = e.getValue(); + if (all.stream().anyMatch( + x -> x.getKey().equals(enabled) && !x.getValue().equals(enabler))) + { + throw new ScribException( + "Inconsistent external choice subjects for " + enabled + ": " + + all.stream().filter(x -> x.getKey().equals(enabled)) + .collect(Collectors.toList())); + } + if (!res.containsKey(enabled)) + { + res.put(enabled, enabler); + } + } + return Collections.unmodifiableMap(res); + } + + @Override + public LType projectInlined(Role self) + { + return projectAux(self, + this.blocks.stream().map(x -> x.projectInlined(self))); + } + + private LType projectAux(Role self, Stream blocks) + { + Role subj = this.subj.equals(self) ? Role.SELF : this.subj; + // CHECKME: "self" also explcitily used for Do, but implicitly for MessageTransfer, inconsistent? + List tmp = blocks + .filter(x -> !x.isEmpty()) + .collect(Collectors.toList()); + if (tmp.isEmpty()) + { + return LSkip.SKIP; // CHECKME: OK, or "empty" choice at subj still important? + } + return new LChoice(null, subj, tmp); + } + + @Override + public LType project(ProjEnv v) + { + return projectAux(v.self, this.blocks.stream().map(x -> x.project(v))); + } +*/ \ No newline at end of file diff --git a/scribble-core/src/main/java/org/scribble/core/type/session/global/GConnect.java b/scribble-core/src/main/java/org/scribble/core/type/session/global/GConnect.java new file mode 100644 index 000000000..eb557751f --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/session/global/GConnect.java @@ -0,0 +1,142 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.session.global; + +import org.antlr.runtime.tree.CommonTree; +import org.scribble.core.type.kind.Global; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.ConnectAction; +import org.scribble.core.type.session.Msg; + +public class GConnect extends ConnectAction + implements GType +{ + + protected GConnect(CommonTree source, // DirectedInteraction not ideal (imprecise) + Role src, Msg msg, Role dst) + { + super(source, msg, src, dst); + } + + @Override + public GConnect reconstruct(CommonTree source, Msg msg, Role src, Role dst) + { + return new GConnect(source, src, msg, dst); + } + + @Override + public String toString() + { + return this.msg + " connect " + this.src + " to " + this.dst + ";"; + } + + @Override + public int hashCode() + { + int hash = 10639; + hash = 31 * hash + super.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof GConnect)) + { + return false; + } + return super.equals(o); // Does canEquals + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof GConnect; + } +} + + + + + + + + + + + + + + +/* + @Override + public Set checkRoleEnabling(Set enabled) throws ScribException + { + if (!enabled.contains(this.src)) + { + throw new ScribException("Source role not enabled: " + this.src); + } + if (enabled.contains(this.dst)) + { + return enabled; + } + Set tmp = new HashSet<>(enabled); + tmp.add(this.dst); + return Collections.unmodifiableSet(tmp); + } + + @Override + public Map checkExtChoiceConsistency(Map enablers) + throws ScribException + { + if (enablers.containsKey(this.dst)) + { + return enablers; + } + Map tmp = new HashMap<>(enablers); + tmp.put(this.dst, this.src); + return Collections.unmodifiableMap(tmp); + } + + @Override + public LType projectInlined(Role self) + { + if (this.src.equals(self)) + { + /*if (this.dst.equals(self)) + { + // CHECKME: already checked? + }* / + return new LReq(null, this.msg, this.dst); + } + else if (this.dst.equals(self)) + { + return new LAcc(null, this.src, this.msg); + } + else + { + return LSkip.SKIP; + } + } + + @Override + public LType project(ProjEnv v) + { + return projectInlined(v.self); // No need for "aux", no recursive call + } + */ diff --git a/scribble-core/src/main/java/org/scribble/core/type/session/global/GContinue.java b/scribble-core/src/main/java/org/scribble/core/type/session/global/GContinue.java new file mode 100644 index 000000000..4d2a904e4 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/session/global/GContinue.java @@ -0,0 +1,118 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.session.global; + +import org.antlr.runtime.tree.CommonTree; +import org.scribble.core.type.kind.Global; +import org.scribble.core.type.name.RecVar; +import org.scribble.core.type.session.Continue; + +public class GContinue extends Continue implements GType +{ + protected GContinue(CommonTree source, // Due to inlining, do -> continue + RecVar recvar) + { + super(source, recvar); + } + + @Override + public GContinue reconstruct(CommonTree source, + RecVar recvar) + { + return new GContinue(source, recvar); + } + + @Override + public int hashCode() + { + int hash = 3457; + hash = 31 * hash + super.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof GContinue)) + { + return false; + } + return super.equals(o); + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof GContinue; + } + +} + + + + + + + + + + + + /*@Override + public GRecursion unfoldAllOnce(STypeUnfolder u) + { + return new GRecursion(getSource(), this.recvar, + (GSeq) u.getRec(this.recvar)); + // CHECKME: Continue (not Recursion) as the source of the unfolding ? + } + + @Override + public Set checkRoleEnabling(Set enabled) throws ScribException + { + return enabled; + } + + @Override + public Map checkExtChoiceConsistency(Map enablers) + throws ScribException + { + return enablers; + } + + @Override + public LContinue projectInlined(Role self) + { + return new LContinue(null, this.recvar); + } + + @Override + public LContinue project(ProjEnv v) + { + return projectInlined(v.self); // No need for "aux", no recursive call + } + + */ + + + + + + + + + diff --git a/scribble-core/src/main/java/org/scribble/core/type/session/global/GDisconnect.java b/scribble-core/src/main/java/org/scribble/core/type/session/global/GDisconnect.java new file mode 100644 index 000000000..3d6ef69f9 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/session/global/GDisconnect.java @@ -0,0 +1,136 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.session.global; + +import org.antlr.runtime.tree.CommonTree; +import org.scribble.core.type.kind.Global; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.DisconnectAction; + +public class GDisconnect extends DisconnectAction + implements GType +{ + + protected GDisconnect(CommonTree source, + Role left, Role right) + { + super(source, left, right); + } + + @Override + public GDisconnect reconstruct( + CommonTree source, Role left, Role right) + { + return new GDisconnect(source, left, right); + } + + @Override + public String toString() + { + return "disconnect " + this.left + " and " + this.right + ";"; + } + + @Override + public int hashCode() + { + int hash = 8747; + hash = 31 * hash + super.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof GDisconnect)) + { + return false; + } + return super.equals(o); // Does canEquals + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof GDisconnect; + } +} + + + + + + + + + + + + + + + + +/* + @Override + public Set checkRoleEnabling(Set enabled) throws ScribException + { + if (!enabled.contains(this.left)) + { + throw new ScribException("Role not enabled: " + this.left); + } + if (!enabled.contains(this.right)) + { + throw new ScribException("Role not enabled: " + this.right); + } + return enabled; + } + + @Override + public Map checkExtChoiceConsistency(Map enablers) + throws ScribException + { + return enablers; + } + + @Override + public LType projectInlined(Role self) + { + if (this.left.equals(self)) + { + /*if (this.dst.equals(self)) + { + // CHECKME: already checked? + }* / + return new LDisconnect(null, this.right); + } + else if (this.right.equals(self)) + { + return new LDisconnect(null, this.left); + } + else + { + return LSkip.SKIP; + } + } + + @Override + public LType project(ProjEnv v) + { + return projectInlined(v.self); // No need for "aux", no recursive call + } +*/ \ No newline at end of file diff --git a/scribble-core/src/main/java/org/scribble/core/type/session/global/GDo.java b/scribble-core/src/main/java/org/scribble/core/type/session/global/GDo.java new file mode 100644 index 000000000..0b6dbf1a1 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/session/global/GDo.java @@ -0,0 +1,185 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.session.global; + +import java.util.List; + +import org.antlr.runtime.tree.CommonTree; +import org.scribble.core.job.Core; +import org.scribble.core.lang.global.GProtocol; +import org.scribble.core.type.kind.Global; +import org.scribble.core.type.kind.NonRoleParamKind; +import org.scribble.core.type.name.ProtoName; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Arg; +import org.scribble.core.type.session.Do; + +public class GDo extends Do implements GType +{ + protected GDo(CommonTree source, ProtoName proto, + List roles, List> args) + { + super(source, proto, roles, args); + } + + @Override + public GProtocol getTarget(Core core) + { + return core.getContext().getIntermediate(this.proto); // Subproto visiting hardcoded to intermediate (i.e., parsed) + } + + @Override + public GDo reconstruct(CommonTree source, + ProtoName proto, List roles, + List> args) + { + return new GDo(source, proto, roles, args); + } + + @Override + public int hashCode() + { + int hash = 1303; + hash = 31 * hash + super.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof GDo)) + { + return false; + } + return super.equals(o); // Does canEquals + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof GDo; + } + +} + + + + + + + + + + + + + + + + + + + /* + @Override + public GProtoName getProto() + { + return (GProtoName) this.proto; + } + + // CHECKME: factor up to base? + @Override + public GType getInlined(STypeInliner v) + { + GProtocolName fullname = this.proto; + SubprotoSig sig = new SubprotoSig(fullname, this.roles, this.args); + RecVar rv = v.getInlinedRecVar(sig); + if (v.hasSig(sig)) + { + return new GContinue(getSource(), rv); + } + v.pushSig(sig); + GProtocol g = v.job.getContext().getIntermediate(fullname); + Substitutions subs = + new Substitutions(g.roles, this.roles, g.params, this.args); + GSeq inlined = g.def.substitute(subs).getInlined(v); + // i.e. returning a GSeq -- rely on parent GSeq to inline + v.popSig(); + return new GRecursion(null, rv, inlined); + } + + @Override + public Set checkRoleEnabling(Set enabled) throws ScribException + { + throw new RuntimeException("Unsupported for Do: " + this); + } + + @Override + public Map checkExtChoiceConsistency(Map enablers) + throws ScribException + { + throw new RuntimeException("Unsupported for Do: " + this); + } + + @Override + public LType projectInlined(Role self) + { + throw new RuntimeException("Unsupported for Do: " + this); + } + + @Override + public LType project(ProjEnv v) + { + if (!this.roles.contains(v.self)) + { + return LSkip.SKIP; + } + + JobContext jobc = v.job.getContext(); + //GProtocolDecl gpd = jobc.getParsed(this.proto); + GProtocol gpd = jobc.getIntermediate(this.proto); + Role targSelf = gpd.roles.get(this.roles.indexOf(v.self)); + + GProtocol imed = jobc.getIntermediate(this.proto); + if (!imed.roles.contains(targSelf)) // CHECKME: because roles already pruned for intermed decl? + { + return LSkip.SKIP; + } + + LProtocolName fullname = ProjEnv.projectFullProtocolName(this.proto, + targSelf); + Substitutions subs = new Substitutions(imed.roles, this.roles, + Collections.emptyList(), Collections.emptyList()); + List used = jobc.getInlined(this.proto).roles.stream() + .map(x -> subs.subsRole(x)).collect(Collectors.toList()); + List rs = this.roles.stream().filter(x -> used.contains(x)) + .map(x -> x.equals(v.self) ? Role.SELF : x) + // CHECKME: "self" also explcitily used for Choice, but implicitly for MessageTransfer, inconsistent? + .collect(Collectors.toList()); + return new LDo(null, fullname, rs, this.args); // TODO CHECKME: prune args? + } + */ + + + + + + + + + + diff --git a/scribble-core/src/main/java/org/scribble/core/type/session/global/GMessageTransfer.java b/scribble-core/src/main/java/org/scribble/core/type/session/global/GMessageTransfer.java new file mode 100644 index 000000000..d9f3b3d98 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/session/global/GMessageTransfer.java @@ -0,0 +1,143 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.session.global; + +import org.antlr.runtime.tree.CommonTree; +import org.scribble.core.type.kind.Global; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Msg; +import org.scribble.core.type.session.MsgTransfer; + +public class GMessageTransfer extends MsgTransfer + implements GType +{ + + protected GMessageTransfer(CommonTree source, Role src, Msg msg, Role dst) + { + super(source, msg, src, dst); + } + + @Override + public GMessageTransfer reconstruct(CommonTree source, Msg msg, Role src, + Role dst) + { + return new GMessageTransfer(source, src, msg, dst); + } + + @Override + public String toString() + { + return this.msg + " from " + this.src + " to " + this.dst + ";"; + } + + @Override + public int hashCode() + { + int hash = 1481; + hash = 31 * hash + super.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof GMessageTransfer)) + { + return false; + } + return super.equals(o); // Does canEquals + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof GMessageTransfer; + } +} + + + + + + + + + + + + + + + +/* + @Override + public Set checkRoleEnabling(Set enabled) throws ScribException + { + if (!enabled.contains(this.src)) + { + throw new ScribException("Source role not enabled: " + this.src); + } + if (enabled.contains(this.dst)) + { + return enabled; + } + Set tmp = new HashSet<>(enabled); + tmp.add(this.dst); + return Collections.unmodifiableSet(tmp); + } + + @Override + public Map checkExtChoiceConsistency(Map enablers) + throws ScribException + { + if (enablers.containsKey(this.dst)) + { + return enablers; + } + Map tmp = new HashMap<>(enablers); + tmp.put(this.dst, this.src); + return Collections.unmodifiableMap(tmp); + } + + @Override + public LType projectInlined(Role self) + { + if (this.src.equals(self)) + { + /*if (this.dst.equals(self)) + { + // CHECKME: already checked? + }* / + return new LSend(null, this.msg, this.dst); + } + else if (this.dst.equals(self)) + { + return new LRcv(null, this.src, this.msg); + } + else + { + return LSkip.SKIP; + } + } + + @Override + public LType project(ProjEnv v) + { + return projectInlined(v.self); // No need for "aux", no recursive call + } +*/ diff --git a/scribble-core/src/main/java/org/scribble/core/type/session/global/GRecursion.java b/scribble-core/src/main/java/org/scribble/core/type/session/global/GRecursion.java new file mode 100644 index 000000000..52c151bb5 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/session/global/GRecursion.java @@ -0,0 +1,128 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.session.global; + +import org.antlr.runtime.tree.CommonTree; +import org.scribble.core.type.kind.Global; +import org.scribble.core.type.name.RecVar; +import org.scribble.core.type.session.Recursion; + +public class GRecursion extends Recursion implements GType +{ + protected GRecursion(CommonTree source, // Due to inlining, protocoldecl -> rec + RecVar recvar, GSeq body) + { + super(source, recvar, body); + } + + @Override + public GRecursion reconstruct(CommonTree source, RecVar recvar, GSeq block) + { + return new GRecursion(source, recvar, block); + } + + @Override + public int hashCode() + { + int hash = 2309; + hash = 31 * hash + super.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof GRecursion)) + { + return false; + } + return super.equals(o); + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof GRecursion; + } +} + + + + + + + + + + + + + + + + +/* + @Override + public Set checkRoleEnabling(Set enabled) throws ScribException + { + return this.body.checkRoleEnabling(enabled); + } + + @Override + public Map checkExtChoiceConsistency(Map enablers) + throws ScribException + { + return this.body.checkExtChoiceConsistency(enablers); + } + + @Override + public LType projectInlined(Role self) + { + LSeq body = this.body.projectInlined(self); + return projectAux(body); + } + + private LType projectAux(LSeq body) + { + if (body.isEmpty()) // N.B. projection is doing empty-rec pruning + { + return LSkip.SKIP; + } + /*RecVar rv = body.isSingleCont(); // CHECKME: should do more "compressing" of "single continue" (subset) choice cases? or should not do "single continue" checking for choice at all? + if (rv != null) + { + return this.recvar.equals(rv) + ? LSkip.SKIP + : new LContinue(null, rv); // CHECKME: source + }* / + Set rvs = new HashSet<>(); + rvs.add(this.recvar); + if (body.aggregateNoEx(new SingleContinueChecker(rvs))) + { + return LSkip.SKIP; + } + return new LRecursion(null, this.recvar, body); + } + + @Override + public LType project(ProjEnv v) + { + LSeq body = this.body.project(v); + return projectAux(body); + } +*/ \ No newline at end of file diff --git a/scribble-core/src/main/java/org/scribble/core/type/session/global/GSeq.java b/scribble-core/src/main/java/org/scribble/core/type/session/global/GSeq.java new file mode 100644 index 000000000..22aa131fe --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/session/global/GSeq.java @@ -0,0 +1,158 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.session.global; + +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.antlr.runtime.tree.CommonTree; +import org.scribble.core.type.kind.Global; +import org.scribble.core.type.session.SType; +import org.scribble.core.type.session.Seq; +import org.scribble.core.visit.STypeAgg; +import org.scribble.core.visit.STypeAggNoThrow; +import org.scribble.util.ScribException; + +public class GSeq extends Seq implements GType +{ + protected GSeq(CommonTree source, List elems) + { + super(source, elems); + } + + @Override + public GSeq reconstruct(CommonTree source, + List> elems) + { + return new GSeq(source, + castElems(elems.stream()).collect(Collectors.toList())); + } + + protected static Stream castElems( + Stream> elems) + { + return elems.map(x -> (GType) x); + } + + @Override + public T visitWith(STypeAgg v) throws ScribException + { + return v.visitSeq(this); + } + + @Override + public T visitWithNoThrow(STypeAggNoThrow v) + { + return v.visitSeq(this); + } + + @Override + public List getElements() + { + return castElems(this.elems.stream()).collect(Collectors.toList()); + } + + @Override + public int hashCode() + { + int hash = 29; + hash = 31 * hash + super.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof GSeq)) + { + return false; + } + return super.equals(o); // Does canEquals + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof GSeq; + } +} + + + + + + + + + + + + + + + + + + + +/* @Override + public Set checkRoleEnabling(Set enabled) throws ScribException + { + for (GType elem : getElements()) + { + enabled = elem.checkRoleEnabling(enabled); + } + return enabled; + } + + @Override + public Map checkExtChoiceConsistency(Map enablers) + throws ScribException + { + for (GType elem : getElements()) + { + enablers = elem.checkExtChoiceConsistency(enablers); + } + return enablers; + + @Override + public LSeq projectInlined(Role self) + { + return projectAux(this.elems.stream() + .map(x -> ((GType) x).projectInlined(self))); + } + + private LSeq projectAux(Stream elems) + { + List tmp = elems.filter(x -> !x.equals(LSkip.SKIP)) + .collect(Collectors.toList()); + return new LSeq(null, tmp); + // Empty seqs converted to LSkip by GChoice/Recursion projection + // And a WF top-level protocol cannot produce empty LSeq + // So a projection never contains an empty LSeq -- i.e., "empty choice/rec" pruning unnecessary + } + + @Override + public LSeq project(ProjEnv v) + { + return projectAux(this.elems.stream() + .map(x -> ((GType) x).project(v))); + } + } +*/ \ No newline at end of file diff --git a/scribble-core/src/main/java/org/scribble/core/type/session/global/GType.java b/scribble-core/src/main/java/org/scribble/core/type/session/global/GType.java new file mode 100644 index 000000000..25d1cbef2 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/session/global/GType.java @@ -0,0 +1,75 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.session.global; + +import org.scribble.core.lang.global.GNode; +import org.scribble.core.type.kind.Global; +import org.scribble.core.type.session.SType; + +public interface GType extends SType, GNode +{ + +} + + + + + + + + + + + + + + + + + + /*// Pre: use on inlined or later (unsupported for Do, also Protocol) + // enabled treated immutably + // Returns enabled post visiting + // Cf. SType visitors, here we only throw ScribbleException or return nothing, so can use return this way + Set checkRoleEnabling(Set enabled) throws ScribException; + + // Pre: use on inlined or later (unsupported for Do, also Protocol) + // Pre: checkRoleEnabling + // enablers: enabled -> enabler -- treated immutably + // Returns enablers post visiting + Map checkExtChoiceConsistency(Map enablers) + throws ScribException; + + // Pre: conns is reflexive + // Also does correlation warnings + //Map checkConnections(Map conns) throws ScribbleException; + // Check on model instead: could possibly do syntactically on once-unfolding, but still need separate checks for dup-conn, unconnected and bad-dconn (may vs. must) + */ + + /*@Override + GType substitute(Substitutions subs);*/ // Otherwise causes return type inconsistency with base abstract classes + + /*// GType returns cause "conflicts" in implementing subclasses -- SType would need itself as another generic param, but not worth it + @Override + GType getInlined(STypeInliner i);//, Deque stack); + + @Override + SType unfoldAllOnce(STypeUnfolder u); // Not GType return, o/w need to override again in GDo + + LType + projectInlined(Role self); // Use on inlined (i.e., Do inlined, roles pruned) + + LType project(ProjEnv v); // Use on parsed (intermed) + */ + diff --git a/scribble-core/src/main/java/org/scribble/core/type/session/global/GTypeFactory.java b/scribble-core/src/main/java/org/scribble/core/type/session/global/GTypeFactory.java new file mode 100644 index 000000000..9065e58b1 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/session/global/GTypeFactory.java @@ -0,0 +1,48 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.session.global; + +import java.util.List; + +import org.antlr.runtime.tree.CommonTree; +import org.scribble.core.type.kind.Global; +import org.scribble.core.type.kind.NonRoleParamKind; +import org.scribble.core.type.name.ProtoName; +import org.scribble.core.type.name.RecVar; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Arg; +import org.scribble.core.type.session.Msg; + +public interface GTypeFactory +{ + + GChoice GChoice(CommonTree source, Role subj, List blocks); + + GConnect GConnect(CommonTree source, Role src, Msg msg, Role dst); + + GContinue GContinue(CommonTree source, RecVar recvar); + + GDisconnect GDisconnect(CommonTree source, Role left, Role right); + + GDo GDo(CommonTree source, ProtoName proto, List roles, + List> args); + + GMessageTransfer GMessageTransfer(CommonTree source, Role src, Msg msg, + Role dst); + + GRecursion GRecursion(CommonTree source, RecVar recvar, GSeq body); + + GSeq GSeq(CommonTree source, List elems); + +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/session/global/GTypeFactoryImpl.java b/scribble-core/src/main/java/org/scribble/core/type/session/global/GTypeFactoryImpl.java new file mode 100644 index 000000000..de4d309d5 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/session/global/GTypeFactoryImpl.java @@ -0,0 +1,79 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.session.global; + +import java.util.List; + +import org.antlr.runtime.tree.CommonTree; +import org.scribble.core.type.kind.Global; +import org.scribble.core.type.kind.NonRoleParamKind; +import org.scribble.core.type.name.ProtoName; +import org.scribble.core.type.name.RecVar; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Arg; +import org.scribble.core.type.session.Msg; + +public class GTypeFactoryImpl implements GTypeFactory +{ + + @Override + public GChoice GChoice(CommonTree source, Role subj, List blocks) + { + return new GChoice(source, subj, blocks); + } + + @Override + public GConnect GConnect(CommonTree source, Role src, Msg msg, Role dst) + { + return new GConnect(source, src, msg, dst); + } + + @Override + public GContinue GContinue(CommonTree source, RecVar recvar) + { + return new GContinue(source, recvar); + } + + @Override + public GDisconnect GDisconnect(CommonTree source, Role left, Role right) + { + return new GDisconnect(source, left, right); + } + + @Override + public GDo GDo(CommonTree source, ProtoName proto, List roles, + List> args) + { + return new GDo(source, proto, roles, args); + } + + @Override + public GMessageTransfer GMessageTransfer(CommonTree source, Role src, Msg msg, + Role dst) + { + return new GMessageTransfer(source, src, msg, dst); + } + + @Override + public GRecursion GRecursion(CommonTree source, RecVar recvar, GSeq body) + { + return new GRecursion(source, recvar, body); + } + + @Override + public GSeq GSeq(CommonTree source, List elems) + { + return new GSeq(source, elems); + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/session/local/LAcc.java b/scribble-core/src/main/java/org/scribble/core/type/session/local/LAcc.java new file mode 100644 index 000000000..e333348af --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/session/local/LAcc.java @@ -0,0 +1,112 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.session.local; + +import org.antlr.runtime.tree.CommonTree; +import org.scribble.core.type.kind.Local; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.ConnectAction; +import org.scribble.core.type.session.Msg; + +// CHECKME: factor out LConnect? +public class LAcc extends ConnectAction implements LType +{ + + // this.dst == Role.SELF + protected LAcc(CommonTree source, + Role src, Msg msg) + { + super(source, msg, src, Role.SELF); + } + + // FIXME: unnecessary dst + @Override + public LAcc reconstruct( + CommonTree source, Msg msg, Role src, + Role dst) + { + return new LAcc(source, src, msg); + } + + @Override + public String toString() + { + return this.msg + " accept " + this.src + ";"; + } + + @Override + public int hashCode() + { + int hash = 10601; + hash = 31 * hash + super.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof LAcc)) + { + return false; + } + return super.equals(o); // Does canEquals + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof LAcc; + } + +} + + + + + + + + + + + +/* + @Override + public boolean isSingleConts(Set rvs) + { + return false; + } + + @Override + public ReachabilityEnv checkReachability(ReachabilityEnv env) + throws ScribException + { + return env; + } + + @Override + public void buildGraph(EGraphBuilderUtil2 b) + { + Role peer = this.src; + MessageId mid = this.msg.getId(); + Payload payload = this.msg.isMessageSig() // CHECKME: generalise? (e.g., hasPayload) + ? ((MessageSig) msg).payload + : Payload.EMPTY_PAYLOAD; + b.addEdge(b.getEntry(), b.ef.newEAccept(peer, mid, payload), b.getExit()); + } +*/ \ No newline at end of file diff --git a/scribble-core/src/main/java/org/scribble/core/type/session/local/LChoice.java b/scribble-core/src/main/java/org/scribble/core/type/session/local/LChoice.java new file mode 100644 index 000000000..88bf055db --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/session/local/LChoice.java @@ -0,0 +1,183 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.session.local; + +import java.util.List; + +import org.antlr.runtime.tree.CommonTree; +import org.scribble.core.type.kind.Local; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Choice; + +public class LChoice extends Choice implements LType +{ + protected LChoice(CommonTree source, Role subj, + List blocks) + { + super(source, subj, blocks); + } + + @Override + public LChoice reconstruct(CommonTree source, Role subj, + List blocks) + { + return new LChoice(source, subj, blocks); + } + + /*@Override + public List getBlocks() + { + return this.blocks; + }*/ + + @Override + public int hashCode() + { + int hash = 3067; + hash = 31 * hash + super.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof LChoice)) + { + return false; + } + return super.equals(o); + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof LChoice; + } +} + + + + + + + + + + + + + + + + + +/* + + @Override + public boolean isSingleConts(Set rvs) + { + return this.blocks.stream().allMatch(x -> x.isSingleConts(rvs)); + } + + @Override + public ReachabilityEnv checkReachability(ReachabilityEnv env) + throws ScribException + { + List blocks = new LinkedList<>(); + for (LSeq block : this.blocks) + { + blocks.add(block.checkReachability(env)); + } + boolean postcont = blocks.stream().allMatch(x -> x.postcont); // i.e., no exits + Set recvars = blocks.stream().flatMap(x -> x.recvars.stream()) + .collect(Collectors.toSet()); + return new ReachabilityEnv(postcont, recvars); + } + + @Override + public void buildGraph(EGraphBuilderUtil2 b) + { + b.enterChoice(); + for (LSeq block : this.blocks) + { + List elems = block.getElements(); + LType first = elems.get(0); + if (first instanceof LRecursion) // CHECKME: do this here? refactor into builderutil? + { + //EGraphBuilderUtil2 b1 = new EGraphBuilderUtil2(b); + // "Inherits" b.recvars, for continue edge building (to "outer" recs) + //EGraph nested; + EState entry = b.getEntry(); + EState exit = b.getExit(); + + EState nestedEntry = b.newState(Collections.emptySet()); + b.setEntry(nestedEntry); + if (elems.size() == 1) + { + /*b1.setExit(b.getExit()); + first.buildGraph(b1); + nested = b1.finalise();* / + first.buildGraph(b); + } + else + { + /*first.buildGraph(b1); + nested = b1.finalise();* / + // Reuse existing b, to directly add continue-edges back to the "outer" graph + EState nestedExit = b.newState(Collections.emptySet()); + b.setExit(nestedExit); + first.buildGraph(b); + + b.setEntry(nestedExit); // Must be non null + b.setExit(exit); + LSeq tail = new LSeq(null, elems.subList(1, elems.size())); + tail.buildGraph(b); + } + //EState init = nested.init; + EState init = nestedEntry; + ////for (EAction a : first.getEnabling()) + for (EAction a : (Iterable) + init.getAllActions().stream().distinct()::iterator) + // Enabling actions + { + for (EState s : init.getSuccessors(a)) + { + b.addEdge(entry, a, s); + } + } + + b.setEntry(entry); + b.setExit(exit); + } + else if (first instanceof LContinue) + { + // Cannot treat choice-unguarded-continue in "a single pass" because may not have built all recursion enacting edges yet + // (Single-pass building would be sensitive to order of choice block visiting) + LContinue cont = (LContinue) first; // First and only element + b.addContinueEdge(b.getEntry(), cont.recvar); + } + else + { + b.pushChoiceBlock(); // CHECKME: still needed? LContinue doesn't check isUnguardedInChoice any more + block.buildGraph(b); + b.popChoiceBlock(); + } + } + b.leaveChoice(); + } + */ diff --git a/scribble-core/src/main/java/org/scribble/core/type/session/local/LContinue.java b/scribble-core/src/main/java/org/scribble/core/type/session/local/LContinue.java new file mode 100644 index 000000000..55bf25282 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/session/local/LContinue.java @@ -0,0 +1,131 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.session.local; + +import org.antlr.runtime.tree.CommonTree; +import org.scribble.core.type.kind.Local; +import org.scribble.core.type.name.RecVar; +import org.scribble.core.type.session.Continue; + +public class LContinue extends Continue implements LType +{ + // N.B. source changes from do to continue after inlining + protected LContinue(CommonTree source, RecVar recvar) + { + super(source, recvar); + } + + @Override + public LContinue reconstruct(CommonTree source, + RecVar recvar) + { + return new LContinue(source, recvar); + } + + @Override + public int hashCode() + { + int hash = 3457; + hash = 31 * hash + super.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof LContinue)) + { + return false; + } + return super.equals(o); + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof LContinue; + } + + + + + + + + + + + + + + /*@Override + public LRecursion unfoldAllOnce(STypeUnfolder u) + { + return new LRecursion(getSource(), this.recvar, // CHECKME: Continue (not Recursion) as the source of the unfolding + (LSeq) u.getRec(this.recvar)); + } + + @Override + public boolean isSingleConts(Set rvs) + { + return rvs.contains(this.recvar); + } + + @Override + public ReachabilityEnv checkReachability(ReachabilityEnv env) + throws ScribException + { + Set tmp = new HashSet<>(env.recvars); + tmp.add(this.recvar); + return new ReachabilityEnv(true, tmp); + } + + @Override + public void buildGraph(EGraphBuilderUtil2 b) + { + // CHECKME: identical edges, i.e. same pred/prev/succ (e.g. rec X { choice at A { A->B:1 } or { A->B:1 } continue X; }) + // Choice-guarded continue -- choice-unguarded continue detected and handled in LChoice + EState curr = b.getEntry(); + for (EState pred : b.getAllPredecessors(curr)) // Does getAllSuccessors + { + for (EAction a : new LinkedList<>(pred.getAllActions())) + { + // Following is because pred.getSuccessor doesn't support non-det edges + // FIXME: refactor actions/successor Lists in MState to list of edges? + for (EState succ : pred.getSuccessors(a)) + { + if (succ.equals(curr)) + { + try + { + b.removeEdge(pred, a, curr); //b.removeEdgeFromPredecessor(pred, prev); + //b.addEdge(pred, a, entry); //b.addRecursionEdge(pred, prev, b.getRecursionEntry(this.recvar)); + b.addRecursionEdge(pred, a, this.recvar); + } + catch (ScribException e) // CHECKME: necessary for removeEdge to have throws? + { + throw new RuntimeException(e); + } + } + } + } + } + } + */ +} + diff --git a/scribble-core/src/main/java/org/scribble/core/type/session/local/LDisconnect.java b/scribble-core/src/main/java/org/scribble/core/type/session/local/LDisconnect.java new file mode 100644 index 000000000..9f7a75eb4 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/session/local/LDisconnect.java @@ -0,0 +1,118 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.session.local; + +import org.antlr.runtime.tree.CommonTree; +import org.scribble.core.type.kind.Local; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.DisconnectAction; + +public class LDisconnect extends DisconnectAction + implements LType +{ + + // this.src == Role.SELF + protected LDisconnect(CommonTree source, + Role peer) + { + super(source, Role.SELF, peer); + } + + public Role getSelf() + { + return this.left; + } + + public Role getPeer() + { + return this.right; + } + + // CHECKME: remove unnecessary self ? + @Override + public LDisconnect reconstruct( + CommonTree source, Role self, Role peer) + { + return new LDisconnect(source, peer); + } + + @Override + public String toString() + { + return "disconnect " + getPeer() + ";"; + } + + @Override + public int hashCode() + { + int hash = 8753; + hash = 31 * hash + super.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof LDisconnect)) + { + return false; + } + return super.equals(o); // Does canEquals + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof LDisconnect; + } +} + + + + + + + + + + + + +/* + + @Override + public boolean isSingleConts(Set rvs) + { + return false; + } + + @Override + public ReachabilityEnv checkReachability(ReachabilityEnv env) + throws ScribException + { + return env; + } + + @Override + public void buildGraph(EGraphBuilderUtil2 b) + { + Role peer = getPeer(); + // TODO: add toAction method to base Interaction + b.addEdge(b.getEntry(), b.ef.newEDisconnect(peer), b.getExit()); + } + */ diff --git a/scribble-core/src/main/java/org/scribble/core/type/session/local/LDo.java b/scribble-core/src/main/java/org/scribble/core/type/session/local/LDo.java new file mode 100644 index 000000000..5a2e61782 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/session/local/LDo.java @@ -0,0 +1,137 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.session.local; + +import java.util.List; + +import org.antlr.runtime.tree.CommonTree; +import org.scribble.core.job.Core; +import org.scribble.core.lang.local.LProtocol; +import org.scribble.core.type.kind.Local; +import org.scribble.core.type.kind.NonRoleParamKind; +import org.scribble.core.type.name.ProtoName; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Arg; +import org.scribble.core.type.session.Do; + +public class LDo extends Do implements LType +{ + protected LDo(CommonTree source, ProtoName proto, + List roles, List> args) + { + super(source, proto, roles, args); + } + + @Override + public LProtocol getTarget(Core core) + { + return core.getContext().getProjection(this.proto); // CHECKME: hardcoded to projections -- factor out "getLocal" (parsed or projected) + } + + @Override + public LDo reconstruct(CommonTree source, + ProtoName proto, List roles, + List> args) + { + return new LDo(source, proto, roles, args); + } + + @Override + public int hashCode() + { + int hash = 1303; + hash = 31 * hash + super.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof LDo)) + { + return false; + } + return super.equals(o); // Does canEquals + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof LDo; + } + + + + + + + + + + + + /* + @Override + public LProtoName getProto() + { + return (LProtoName) this.proto; + } + + // CHECKME: factor up to base? + @Override + public LType getInlined(STypeInliner v) + { + LProtocolName fullname = this.proto; + SubprotoSig sig = new SubprotoSig(fullname, this.roles, this.args); + RecVar rv = v.getInlinedRecVar(sig); + if (v.hasSig(sig)) + { + return new LContinue(getSource(), rv); + } + v.pushSig(sig); + LProtocol p = v.job.getContext().getProjection(fullname); // This line differs from GDo version + Substitutions subs = + new Substitutions(p.roles, this.roles, p.params, this.args); + LSeq inlined = p.def.substitute(subs).getInlined(v);//, stack); + // i.e. returning a Seq -- rely on parent Seq to inline + v.popSig(); + return new LRecursion(null, rv, inlined); + } + + @Override + public boolean isSingleConts(Set rvs) + { + throw new RuntimeException("Unsupported for LDo: " + this); + } + + @Override + public ReachabilityEnv checkReachability(ReachabilityEnv env) + throws ScribException + { + throw new RuntimeException("Unsupported for LDo: " + this); + } + + @Override + public void buildGraph(EGraphBuilderUtil2 b) + { + throw new RuntimeException("Unsupported for LDo: " + this); + } + */ +} + + diff --git a/scribble-core/src/main/java/org/scribble/core/type/session/local/LRecursion.java b/scribble-core/src/main/java/org/scribble/core/type/session/local/LRecursion.java new file mode 100644 index 000000000..d0894788e --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/session/local/LRecursion.java @@ -0,0 +1,112 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.session.local; + +import org.antlr.runtime.tree.CommonTree; +import org.scribble.core.type.kind.Local; +import org.scribble.core.type.name.RecVar; +import org.scribble.core.type.session.Recursion; + +public class LRecursion extends Recursion implements LType +{ + protected LRecursion(//org.scribble.ast.Recursion source, + CommonTree source, // Due to inlining, protocoldecl -> rec + RecVar recvar, LSeq body) + { + super(source, recvar, body); + } + + @Override + public LRecursion reconstruct(CommonTree source, + RecVar recvar, LSeq block) + { + return new LRecursion(source, recvar, block); + } + + @Override + public int hashCode() + { + int hash = 2309; + hash = 31 * hash + super.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof LRecursion)) + { + return false; + } + return super.equals(o); + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof LRecursion; + } +} + + + + + + + + + + + + + + + + +/* + @Override + public boolean isSingleConts(Set rvs) + { + Set tmp = new HashSet<>(rvs); + tmp.add(this.recvar); + return this.body.isSingleConts(tmp); + } + + @Override + public ReachabilityEnv checkReachability(ReachabilityEnv env) + throws ScribException + { + env = this.body.checkReachability(env); + if (env.recvars.contains(this.recvar)) + { + Set tmp = new HashSet<>(env.recvars); + tmp.remove(this.recvar); + env = new ReachabilityEnv(env.postcont, tmp); + } + return env; + } + + @Override + public void buildGraph(EGraphBuilderUtil2 b) + { + b.addEntryLabel(this.recvar); + b.pushRecursionEntry(this.recvar, b.getEntry()); + this.body.buildGraph(b); + b.popRecursionEntry(this.recvar); + } + */ diff --git a/scribble-core/src/main/java/org/scribble/core/type/session/local/LRecv.java b/scribble-core/src/main/java/org/scribble/core/type/session/local/LRecv.java new file mode 100644 index 000000000..9b9587350 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/session/local/LRecv.java @@ -0,0 +1,119 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.session.local; + +import org.antlr.runtime.tree.CommonTree; +import org.scribble.core.type.kind.Local; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Msg; +import org.scribble.core.type.session.MsgTransfer; + +public class LRecv extends MsgTransfer + implements LType +{ + + // this.dst == Role.SELF + protected LRecv(CommonTree source, + Role src, Msg msg) + { + super(source, msg, src, Role.SELF); + } + + // FIXME: unnecessary dst + @Override + public LRecv reconstruct( + CommonTree source, Msg msg, Role src, + Role dst) + { + return new LRecv(source, src, msg); + } + + @Override + public String toString() + { + return this.msg + " from " + this.src + ";"; + } + + @Override + public int hashCode() + { + int hash = 1481; + hash = 31 * hash + super.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof LRecv)) + { + return false; + } + return super.equals(o); // Does canEquals + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof LRecv; + } + +} + + + + + + + + + + + + + + + + + + +/* + @Override + public boolean isSingleConts(Set rvs) + { + return false; + } + + @Override + public ReachabilityEnv checkReachability(ReachabilityEnv env) + throws ScribException + { + return env; + } + + @Override + public void buildGraph(EGraphBuilderUtil2 b) + { + Role peer = this.src; + MessageId mid = this.msg.getId(); + Payload payload = this.msg.isMessageSig() // CHECKME: generalise? (e.g., hasPayload) + ? ((MessageSig) msg).payload + : Payload.EMPTY_PAYLOAD; + b.addEdge(b.getEntry(), b.ef.newEReceive(peer, mid, payload), b.getExit()); + } + */ diff --git a/scribble-core/src/main/java/org/scribble/core/type/session/local/LReq.java b/scribble-core/src/main/java/org/scribble/core/type/session/local/LReq.java new file mode 100644 index 000000000..9be292488 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/session/local/LReq.java @@ -0,0 +1,121 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.session.local; + +import org.antlr.runtime.tree.CommonTree; +import org.scribble.core.type.kind.Local; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.ConnectAction; +import org.scribble.core.type.session.Msg; + +// CHECKME: factor out LConnect? +public class LReq extends ConnectAction implements LType +{ + + // this.src == Role.SELF + protected LReq(CommonTree source, + Msg msg, Role dst) + { + super(source, msg, Role.SELF, dst); + } + + // CHECKME: remove unnecessary src ? + @Override + public LReq reconstruct( + CommonTree source, Msg msg, Role src, + Role dst) + { + return new LReq(source, msg, dst); + } + + @Override + public String toString() + { + return this.msg + " request " + this.dst + ";"; + } + + @Override + public int hashCode() + { + int hash = 10597; + hash = 31 * hash + super.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof LReq)) + { + return false; + } + return super.equals(o); // Does canEquals + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof LReq; + } + +} + + + + + + + + + + + + + + + + + + +/* + + @Override + public boolean isSingleConts(Set rvs) + { + return false; + } + + @Override + public ReachabilityEnv checkReachability(ReachabilityEnv env) + throws ScribException + { + return env; + } + + @Override + public void buildGraph(EGraphBuilderUtil2 b) + { + Role peer = this.dst; + MessageId mid = this.msg.getId(); + Payload payload = this.msg.isMessageSig() // CHECKME: generalise? (e.g., hasPayload) + ? ((MessageSig) msg).payload + : Payload.EMPTY_PAYLOAD; + // TODO: add toAction method to base Interaction + b.addEdge(b.getEntry(), b.ef.newERequest(peer, mid, payload), b.getExit()); + } +*/ \ No newline at end of file diff --git a/scribble-core/src/main/java/org/scribble/core/type/session/local/LSend.java b/scribble-core/src/main/java/org/scribble/core/type/session/local/LSend.java new file mode 100644 index 000000000..fd2646197 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/session/local/LSend.java @@ -0,0 +1,122 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.session.local; + +import org.antlr.runtime.tree.CommonTree; +import org.scribble.core.type.kind.Local; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Msg; +import org.scribble.core.type.session.MsgTransfer; + +public class LSend extends MsgTransfer + implements LType +{ + + // this.src == Role.SELF + protected LSend(CommonTree source, + Msg msg, Role dst) + { + super(source, msg, Role.SELF, dst); + } + + // CHECKME: remove unnecessary src ? + @Override + public LSend reconstruct( + CommonTree source, Msg msg, Role src, + Role dst) + { + return new LSend(source, msg, dst); + } + + @Override + public String toString() + { + return this.msg + " to " + this.dst + ";"; + } + + @Override + public int hashCode() + { + int hash = 1481; + hash = 31 * hash + super.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof LSend)) + { + return false; + } + return super.equals(o); // Does canEquals + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof LSend; + } + +} + + + + + + + + + + + + + + + + + + + + +/* + @Override + public boolean isSingleConts(Set rvs) + { + return false; + } + + @Override + public ReachabilityEnv checkReachability(ReachabilityEnv env) + throws ScribException + { + return env; + } + + @Override + public void buildGraph(EGraphBuilderUtil2 b) + { + Role peer = this.dst; + MessageId mid = this.msg.getId(); + Payload payload = this.msg.isMessageSig() // CHECKME: generalise? (e.g., hasPayload) + ? ((MessageSig) msg).payload + : Payload.EMPTY_PAYLOAD; + // TODO: add toAction method to base Interaction + b.addEdge(b.getEntry(), b.ef.newESend(peer, mid, payload), b.getExit()); + } +*/ \ No newline at end of file diff --git a/scribble-core/src/main/java/org/scribble/core/type/session/local/LSeq.java b/scribble-core/src/main/java/org/scribble/core/type/session/local/LSeq.java new file mode 100644 index 000000000..1fb2eaf99 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/session/local/LSeq.java @@ -0,0 +1,176 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.session.local; + +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.antlr.runtime.tree.CommonTree; +import org.scribble.core.type.kind.Local; +import org.scribble.core.type.session.SType; +import org.scribble.core.type.session.Seq; +import org.scribble.core.visit.STypeAgg; +import org.scribble.core.visit.STypeAggNoThrow; +import org.scribble.util.ScribException; + +public class LSeq extends Seq implements LType +{ + // GInteractionSeq or GBlock better as source? + //protected LSeq(CommonTree source, List> elems) + protected LSeq(CommonTree source, List elems) + { + super(source, elems); + } + + @Override + public LSeq reconstruct(CommonTree source, + List> elems) + { + return new LSeq(source, + castElems(elems.stream()).collect(Collectors.toList())); + } + + protected static Stream castElems( + Stream> elems) + { + return elems.map(x -> (LType) x); + } + + @Override + public T visitWith(STypeAgg v) throws ScribException + { + return v.visitSeq(this); + } + + @Override + public T visitWithNoThrow(STypeAggNoThrow v) + { + return v.visitSeq(this); + } + + @Override + public List getElements() + { + return castElems(this.elems.stream()).collect(Collectors.toList()); + } + + @Override + public int hashCode() + { + int hash = 29; + hash = 31 * hash + super.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof LSeq)) + { + return false; + } + return super.equals(o); // Does canEquals + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof LSeq; + } +} + + + + + + + + + + + + + + + + + + + + + + +/* + @Override + public boolean isSingleConts(Set rvs) + { + return this.elems.size() == 1 + && ((LType) this.elems.get(0)).isSingleConts(rvs); + } + + @Override + public ReachabilityEnv checkReachability(ReachabilityEnv env) + throws ScribException + { + LType prev = null; + LType next = null; + for (Iterator i = getElements().iterator(); i.hasNext(); ) + { + prev = next; + next = i.next(); + if (!env.isSeqable()) + { + throw new ScribException( + "Illegal sequence: " + (prev == null ? "" : prev + "\n") + next); + } + env = next.checkReachability(env); + } + return env; + } + + @Override + public void buildGraph(EGraphBuilderUtil2 b) + { + EState entry = b.getEntry(); + EState exit = b.getExit(); + List elems = getElements(); + if (elems.isEmpty()) + { + throw new RuntimeException("Shouldn't get here: " + this); + } + for (Iterator i = getElements().iterator(); i.hasNext(); ) + { + LType next = i.next(); + if (!i.hasNext()) + { + b.setExit(exit); + next.buildGraph(b); + } + else + { + EState tmp = b.newState(Collections.emptySet()); + b.setExit(tmp); + next.buildGraph(b); + b.setEntry(b.getExit()); + // CHECKME: exit may not be tmp, entry/exit can be modified, e.g. continue + } + } + b.setEntry(entry); + } +*/ \ No newline at end of file diff --git a/scribble-core/src/main/java/org/scribble/core/type/session/local/LSkip.java b/scribble-core/src/main/java/org/scribble/core/type/session/local/LSkip.java new file mode 100644 index 000000000..ef45b05f0 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/session/local/LSkip.java @@ -0,0 +1,174 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.session.local; + +import java.util.function.Function; +import java.util.stream.Stream; + +import org.scribble.core.type.kind.Local; +import org.scribble.core.type.session.SType; +import org.scribble.core.type.session.STypeBase; +import org.scribble.core.visit.STypeAgg; +import org.scribble.core.visit.STypeAggNoThrow; + +// Used only *during* projection -- filtered out by GSeq::projection +// CHECKME: can use empty Seq, and do "seq injection" in visitSeq overrides? (cf. RecPruner) +public class LSkip extends STypeBase implements LType +{ + public static final LSkip SKIP = new LSkip(); + + private LSkip() + { + super(null); + } + + @Override + public T visitWith(STypeAgg v) + { + throw new RuntimeException("Unsupported for Skip: " + this); + } + + @Override + public T visitWithNoThrow(STypeAggNoThrow v) + { + throw new RuntimeException("Unsupported for Skip: " + this); + } + + @Override + public Stream gather(Function, Stream> f) + { + throw new RuntimeException("Unsupported for Skip: " + this); + } + + @Override + public String toString() + { + return "[skip];"; + } + + @Override + public int hashCode() + { + int hash = 2833; + hash = 31 * hash + super.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof LSkip)) + { + return false; + } + return ((LSkip) o).canEquals(this); + } + + @Override + public boolean canEquals(Object o) + { + return o instanceof LSkip; + } + + + + + + + + + + + + + /*@Override + public Set getRoles() + { + throw new RuntimeException("Unsupported for Skip: " + this); + } + + @Override + public Set> getMessageIds() + { + throw new RuntimeException("Unsupported for Skip: " + this); + } + + @Override + public Set getRecVars() + { + throw new RuntimeException("Unsupported for Skip: " + this); + } + + @Override + public LSkip getInlined(STypeInliner i) + { + return this; + } + + @Override + public LType unfoldAllOnce(STypeUnfolder u) + { + throw new RuntimeException("Unsupported for Skip: " + this); + } + + @Override + public List> getProtoDependencies() + { + throw new RuntimeException("Unsupported for Skip: " + this); + } + + @Override + public List> getNonProtoDependencies() + { + throw new RuntimeException("Unsupported for Skip: " + this); + } + + @Override + public LSkip pruneRecs() + { + throw new RuntimeException("Unsupported for Skip: " + this); + } + + @Override + public LSkip substitute(Substitutions subs) + { + return this; + } + + @Override + public boolean isSingleConts(Set rvs) + { + throw new RuntimeException("Unsupported for Skip:\n" + this); + } + + @Override + public ReachabilityEnv checkReachability(ReachabilityEnv env) + throws ScribException + { + throw new RuntimeException("Unsupported for: " + this); + } + + @Override + public void buildGraph(EGraphBuilderUtil2 b) + { + throw new RuntimeException("Unsupported for: " + this); + } + */ +} + + diff --git a/scribble-core/src/main/java/org/scribble/core/type/session/local/LType.java b/scribble-core/src/main/java/org/scribble/core/type/session/local/LType.java new file mode 100644 index 000000000..534a6f4c6 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/session/local/LType.java @@ -0,0 +1,64 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.session.local; + +import org.scribble.core.lang.local.LNode; +import org.scribble.core.type.kind.Local; +import org.scribble.core.type.session.SType; + +public interface LType extends SType, LNode +{ + //Role getSelf(); // CHECKME: useful? maybe only specifically for interactions + + //void buildGraph(EGraphBuilderUtil2 b); +} + + + + + + + + + + + + + + + + + + + + + + /*@Override + LType substitute(Substitutions subs);*/ // Otherwise causes return type inconsistency with base abstract classes + + /*// LType returns cause "conflicts" in implementing subclasses -- SType would need itself as another generic param, but not worth it + @Override + SType getInlined(STypeInliner v); + + @Override + SType unfoldAllOnce(STypeUnfolder u); + + // Return true iff this LType is "equivalent" to a single "continue X", where X is in rvs + boolean isSingleConts(Set rvs); + + // Return: (new) env post visiting + // cf. GType "visitor" methods: same pattern, just env as a bespoke data type wrapper + ReachabilityEnv checkReachability(ReachabilityEnv env) + throws ScribException; + */ diff --git a/scribble-core/src/main/java/org/scribble/core/type/session/local/LTypeFactory.java b/scribble-core/src/main/java/org/scribble/core/type/session/local/LTypeFactory.java new file mode 100644 index 000000000..ced6d8ba2 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/session/local/LTypeFactory.java @@ -0,0 +1,50 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.session.local; + +import java.util.List; + +import org.antlr.runtime.tree.CommonTree; +import org.scribble.core.type.kind.Local; +import org.scribble.core.type.kind.NonRoleParamKind; +import org.scribble.core.type.name.ProtoName; +import org.scribble.core.type.name.RecVar; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Arg; +import org.scribble.core.type.session.Msg; + +public interface LTypeFactory +{ + + LAcc LAcc(CommonTree source, Role src, Msg msg); + + LChoice LChoice(CommonTree source, Role subj, List blocks); + + LContinue LContinue(CommonTree source, RecVar recvar); + + LDisconnect LDisconnect(CommonTree source, Role peer); + + LDo LDo(CommonTree source, ProtoName proto, List roles, + List> args); + + LRecursion LRecursion(CommonTree source, RecVar recvar, LSeq body); + + LRecv LRecv(CommonTree source, Role src, Msg msg); + + LReq LReq(CommonTree source, Msg msg, Role dst); + + LSend LSend(CommonTree source, Msg msg, Role dst); + + LSeq LSeq(CommonTree source, List elems); +} diff --git a/scribble-core/src/main/java/org/scribble/core/type/session/local/LTypeFactoryImpl.java b/scribble-core/src/main/java/org/scribble/core/type/session/local/LTypeFactoryImpl.java new file mode 100644 index 000000000..2f3e244f0 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/type/session/local/LTypeFactoryImpl.java @@ -0,0 +1,91 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.type.session.local; + +import java.util.List; + +import org.antlr.runtime.tree.CommonTree; +import org.scribble.core.type.kind.Local; +import org.scribble.core.type.kind.NonRoleParamKind; +import org.scribble.core.type.name.ProtoName; +import org.scribble.core.type.name.RecVar; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Arg; +import org.scribble.core.type.session.Msg; + +public class LTypeFactoryImpl implements LTypeFactory +{ + + @Override + public LAcc LAcc(CommonTree source, Role src, Msg msg) + { + return new LAcc(source, src, msg); + } + + @Override + public LChoice LChoice(CommonTree source, Role subj, List blocks) + { + return new LChoice(source, subj, blocks); + } + + @Override + public LContinue LContinue(CommonTree source, RecVar recvar) + { + return new LContinue(source, recvar); + } + + @Override + public LDisconnect LDisconnect(CommonTree source, Role peer) + { + return new LDisconnect(source, peer); + } + + @Override + public LDo LDo(CommonTree source, ProtoName proto, List roles, + List> args) + { + return new LDo(source, proto, roles, args); + } + + @Override + public LRecursion LRecursion(CommonTree source, RecVar recvar, LSeq body) + { + return new LRecursion(source, recvar, body); + } + + @Override + public LRecv LRecv(CommonTree source, Role src, Msg msg) + { + return new LRecv(source, src, msg); + } + + @Override + public LReq LReq(CommonTree source, Msg msg, Role dst) + { + return new LReq(source, msg, dst); + } + + @Override + public LSend LSend(CommonTree source, Msg msg, + Role dst) + { + return new LSend(source, msg, dst); + } + + @Override + public LSeq LSeq(CommonTree source, List elems) + { + return new LSeq(source, elems); + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/visit/RecPruner.java b/scribble-core/src/main/java/org/scribble/core/visit/RecPruner.java new file mode 100644 index 000000000..aca2f5352 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/visit/RecPruner.java @@ -0,0 +1,79 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.visit; + +import java.util.LinkedList; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.core.type.name.RecVar; +import org.scribble.core.type.session.Choice; +import org.scribble.core.type.session.Recursion; +import org.scribble.core.type.session.SType; +import org.scribble.core.type.session.Seq; +import org.scribble.core.visit.gather.RecVarGatherer; + +// Assumes no shadowing, e.g., use after inlining recvar disamb (also used after projection) +public class RecPruner> + extends STypeVisitorNoThrow +{ + protected RecPruner() + { + + } + + @Override + public SType visitChoice(Choice n) + { + List blocks = n.blocks.stream().map(x -> visitSeq(x)) + .filter(x -> !x.isEmpty()).collect(Collectors.toList()); + if (blocks.isEmpty()) + { + return n.blocks.get(0).reconstruct(null, blocks); // N.B. returning a Seq -- handled by visitSeq (similar to LSkip for locals) + } + return n.reconstruct(n.getSource(), n.subj, blocks); + } + + @Override + public SType visitRecursion(Recursion n) + { + // Assumes no shadowing (e.g., use after SType#getInlined recvar disamb) + Set rvs = n.body.gather(new RecVarGatherer()::visit) + .collect(Collectors.toSet()); + return rvs.contains(n.recvar) + ? n.reconstruct(n.getSource(), n.recvar, visitSeq(n.body)) + : n.body; // i.e., return a Seq, to be "inlined" by Seq.pruneRecs -- N.B. must handle empty Seq case + } + + @Override + public B visitSeq(B n) + { + List> elems = new LinkedList<>(); + for (SType e : n.elems) + { + SType e1 = (SType) e.visitWithNoThrow(this); + if (e1 instanceof Seq) // cf. visitRecursion (also cf. LSkip) + { + elems.addAll(((Seq) e1).elems);//getElements()); // Handles empty Seq case + } + else + { + elems.add(e1); + } + } + return n.reconstruct(n.getSource(), elems); + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/visit/STypeAgg.java b/scribble-core/src/main/java/org/scribble/core/visit/STypeAgg.java new file mode 100644 index 000000000..27fe1e1bf --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/visit/STypeAgg.java @@ -0,0 +1,114 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.visit; + +import java.util.LinkedList; +import java.util.List; +import java.util.stream.Stream; + +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.core.type.session.Choice; +import org.scribble.core.type.session.Continue; +import org.scribble.core.type.session.DirectedInteraction; +import org.scribble.core.type.session.DisconnectAction; +import org.scribble.core.type.session.Do; +import org.scribble.core.type.session.Recursion; +import org.scribble.core.type.session.SType; +import org.scribble.core.type.session.Seq; +import org.scribble.util.ScribException; + +public abstract class STypeAgg, T> +{ + // Internal use + // Pre: agg(Stream.of(unit())) = unit() + protected abstract T unit(SType n) throws ScribException; + + // Internal use -- by default, agg is applied to the "compound" cases (choice, recursion, seq) + // Pre: agg(Stream.of(unit())) = unit() + protected abstract T agg(SType n, Stream ts) throws ScribException; // Cf. generic varargs, heap pollution issue + + public T visitChoice(Choice n) throws ScribException + { + List blocks = new LinkedList<>(); + for (B b : n.blocks) + { + //blocks.add(b.visitWith(this)); + blocks.add(visitSeq(b)); + } + return agg(n, blocks.stream()); + } + + public T visitContinue(Continue n) throws ScribException + { + return unit(n); + } + + public T visitDirectedInteraction(DirectedInteraction n) + throws ScribException + { + return unit(n); + } + + public T visitDisconnect(DisconnectAction n) throws ScribException + { + return unit(n); + } + + public T visitDo(Do n) throws ScribException + { + return unit(n); + } + + public T visitRecursion(Recursion n) throws ScribException + { + //return agg(n, Stream.of(n.body.visitWith(this))); + return agg(n, Stream.of(visitSeq(n.body))); + } + + // Param "hardcoded" to B (cf. Seq, or SType return) -- this visitor pattern depends on B for Choice/Recursion/etc reconstruction + public T visitSeq(B n) throws ScribException + { + List elems = new LinkedList<>(); + for (SType e : n.elems) + { + elems.add(e.visitWith(this)); + } + return agg(n, elems.stream()); + } +} + + + + + + + + + + + + + + + + + + + + +/*@FunctionalInterface +interface STypeVisitorFunction, R extends Stream> +{ + R f(SType n, STypeVisitor v); +}*/ diff --git a/scribble-core/src/main/java/org/scribble/core/visit/STypeAggNoThrow.java b/scribble-core/src/main/java/org/scribble/core/visit/STypeAggNoThrow.java new file mode 100644 index 000000000..2b3ab1216 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/visit/STypeAggNoThrow.java @@ -0,0 +1,100 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.visit; + +import java.util.stream.Stream; + +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.core.type.session.Choice; +import org.scribble.core.type.session.Continue; +import org.scribble.core.type.session.DirectedInteraction; +import org.scribble.core.type.session.DisconnectAction; +import org.scribble.core.type.session.Do; +import org.scribble.core.type.session.Recursion; +import org.scribble.core.type.session.SType; +import org.scribble.core.type.session.Seq; + +// Worth it to maintain alongside STypeAgg? -- does touch a lot of places +public abstract class STypeAggNoThrow, T> + //extends STypeAgg // Not worth it, ex/no-ex method variants easily confused +{ + // Internal use + // Pre: agg(Stream.of(unit())) = unit() + protected abstract T unit(SType n); + + // Internal use -- by default, agg is applied to the "compound" cases (choice, recursion, seq) + // Pre: agg(Stream.of(unit())) = unit() + protected abstract T agg(SType n, Stream ts); // Cf. generic varargs, heap pollution issue + + public T visitContinue(Continue n) + { + return unit(n); + } + + public T visitChoice(Choice n) + { + return agg(n, n.blocks.stream().map(x -> visitSeq(x))); + } + + public T visitDirectedInteraction(DirectedInteraction n) + { + return unit(n); + } + + public T visitDisconnect(DisconnectAction n) + { + return unit(n); + } + + public T visitDo(Do n) + { + return unit(n); + } + + public T visitRecursion(Recursion n) + { + return agg(n, Stream.of(visitSeq(n.body))); + } + + // Param "hardcoded" to B (cf. Seq, or SType return) -- this visitor pattern depends on B for Choice/Recursion/etc reconstruction + public T visitSeq(B n) + { + return agg(n, n.elems.stream().map(x -> x.visitWithNoThrow(this))); + } +} + + + + + + + + + + + + + + + + + + + + +/*@FunctionalInterface +interface STypeVisitorFunction, R extends Stream> +{ + R f(SType n, STypeVisitor v); +}*/ diff --git a/scribble-core/src/main/java/org/scribble/core/visit/STypeInliner.java b/scribble-core/src/main/java/org/scribble/core/visit/STypeInliner.java new file mode 100644 index 000000000..fdc034485 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/visit/STypeInliner.java @@ -0,0 +1,183 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.visit; + +import java.util.Deque; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import org.antlr.runtime.tree.CommonTree; +import org.scribble.core.job.Core; +import org.scribble.core.lang.SubprotoSig; +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.core.type.name.RecVar; +import org.scribble.core.type.session.Continue; +import org.scribble.core.type.session.Recursion; +import org.scribble.core.type.session.SType; +import org.scribble.core.type.session.Seq; + +public abstract class STypeInliner> + extends STypeVisitorNoThrow +{ + public final Core core; + + // Basically, "SubprotocolVisitor" -- factor out? + private final Deque stack = new LinkedList<>(); + + // To handle recvar shadowing in nested recs + private Map> recvars = new HashMap<>(); + private Map counter = new HashMap<>(); + + private final Map> recs = new HashMap<>(); + + public STypeInliner(Core core) + { + this.core = core; + } + + @Override + public SType visitContinue(Continue n) + { + RecVar rv = getInlinedRecVar(n.recvar); + return n.reconstruct(n.getSource(), rv); + } + + @Override + public SType visitRecursion(Recursion n) + { + CommonTree source = n.getSource(); // CHECKME: or empty source? + RecVar rv = enterRec(n.recvar); // FIXME: make GTypeInliner, and record recvars to check freshness (e.g., rec X in two choice cases) + //B body = n.body.visitWithNoEx(this); + B body = visitSeq(n.body);//.visitWithNoEx(this); + Recursion res = n.reconstruct(source, rv, body); + exitRec(n.recvar); + return res; + } + + @Override + public B visitSeq(B n) + { + List> elems = new LinkedList<>(); + for (SType e : n.elems) + { + SType e1 = e.visitWithNoThrow(this); + if (e1 instanceof Seq) + { + elems.addAll(((Seq) e1).elems); + } + else + { + elems.add(e1); + } + } + return n.reconstruct(n.getSource(), elems); + } + + protected void pushRec(RecVar rv, Seq body) + { + if (this.recs.containsKey(rv)) + { + throw new RuntimeException("Shouldn't get here: " + rv); + } + this.recs.put(rv, body); + } + + protected boolean hasRec(RecVar rv) + { + return this.recs.containsKey(rv); + } + + protected Seq getRec(RecVar rv) + { + return this.recs.get(rv); + } + + protected void popRec(RecVar rv) + { + this.recs.remove(rv); + } + + public void pushSig(SubprotoSig sig) + { + if (this.stack.contains(sig)) + { + throw new RuntimeException("Shouldn't get here: " + sig); + } + this.stack.push(sig); + } + + protected SubprotoSig peek() + { + return this.stack.peek(); + } + + protected boolean hasSig(SubprotoSig sig) + { + return this.stack.contains(sig); + } + + protected void popSig() + { + this.stack.pop(); + } + + // For Protocol/Do -- sig is for the current innermost proto (but not implicitly peek() for G/LDo convenience) + public RecVar getInlinedRecVar(SubprotoSig sig) + { + String lab = "__" + sig.fullname.toString().replaceAll("\\.", "_") + "__" + + sig.roles.stream().map(x -> x.toString()) + .collect(Collectors.joining("_")) + + "__" + sig.args.stream().map(x -> x.toString()) + .collect(Collectors.joining("_")); + return new RecVar(lab); + } + + protected RecVar enterRec(RecVar rv) + { + String text = getInlinedRecVar(this.stack.peek()) + "__" + rv; + if (this.counter.containsKey(rv)) + { + int i = this.counter.get(rv) + 1; + text += "_" + i; + this.counter.put(rv, i); + } + else + { + this.counter.put(rv, 0); + } + RecVar res = new RecVar(text); + Deque tmp = this.recvars.get(rv); + if (tmp == null) + { + tmp = new LinkedList<>(); + this.recvars.put(rv, tmp); + } + tmp.push(res); + return res; + } + + // For Continue + protected RecVar getInlinedRecVar(RecVar rv) + { + return this.recvars.get(rv).peek(); + } + + protected void exitRec(RecVar rv) + { + this.recvars.get(rv).pop(); + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/visit/STypeUnfolder.java b/scribble-core/src/main/java/org/scribble/core/visit/STypeUnfolder.java new file mode 100644 index 000000000..58ec79901 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/visit/STypeUnfolder.java @@ -0,0 +1,104 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.visit; + +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +import org.scribble.core.job.Core; +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.core.type.name.RecVar; +import org.scribble.core.type.session.Do; +import org.scribble.core.type.session.Recursion; +import org.scribble.core.type.session.SType; +import org.scribble.core.type.session.Seq; + +// Pre: use on inlined -- not supported for Do +public abstract class STypeUnfolder> + extends STypeVisitorNoThrow +{ + public final Core core; + + private final Map> recs = new HashMap<>(); + + public STypeUnfolder(Core core) + { + this.core = core; + } + + @Override + public final SType visitDo(Do n) + { + throw new RuntimeException(this.getClass() + " unsupported for Do: " + n); + } + + @Override + public SType visitRecursion(Recursion n) + { + if (!hasRec(n.recvar)) // N.B. doesn't work if recvars shadowed + { + pushRec(n.recvar, n.body); + SType unf = visitSeq(n.body);//n.body.visitWithNoEx(this); + popRec(n.recvar); + // Needed for, e.g., repeat do's in separate choice cases -- cf. stack.pop in GDo::getInlined, must pop sig there for Seqs + return unf; + } + return n; + } + + @Override + public B visitSeq(B n) + { + List> elems = new LinkedList<>(); + for (SType e : n.elems) + { + SType e1 = e.visitWithNoThrow(this); + if (e1 instanceof Seq) + { + elems.addAll(((Seq) e1).elems); + } + else + { + elems.add(e1); + } + } + return n.reconstruct(n.getSource(), elems); + } + + protected void pushRec(RecVar rv, Seq body) + { + if (this.recs.containsKey(rv)) + { + throw new RuntimeException("Shouldn't get here: " + rv); + } + this.recs.put(rv, body); + } + + protected boolean hasRec(RecVar rv) + { + return this.recs.containsKey(rv); + } + + protected Seq getRec(RecVar rv) + { + return this.recs.get(rv); + } + + protected void popRec(RecVar rv) + { + this.recs.remove(rv); + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/visit/STypeVisitor.java b/scribble-core/src/main/java/org/scribble/core/visit/STypeVisitor.java new file mode 100644 index 000000000..df6862237 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/visit/STypeVisitor.java @@ -0,0 +1,191 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.visit; + +import java.util.LinkedList; +import java.util.List; +import java.util.stream.Stream; + +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.core.type.session.Choice; +import org.scribble.core.type.session.Recursion; +import org.scribble.core.type.session.SType; +import org.scribble.core.type.session.Seq; +import org.scribble.util.ScribException; + +// "Instantiates" STypeAgg by implicitly treating Stream as always a singleton Stream of the *reconstructed* node. +// The main benefit is to reuse the SType.visitWith(STypeAgg) methods for STypeVisitors. +// +// Alternative characterisations of STypeVisitor as STypeAgg? +// T = SType, unit = empty, agg = reconstruct, ns = "structural" (i.e, B) children -- issues with generic cast to B inside agg +// T = SType, unit = n.getChildren(), agg = reconstruct, ns = all children -- all children require dynamic casts +// T = B ... ? Considering Stream like a Seq, and elems as singleton Seqs -- cf. Stream, for Choice/etc reconstruct +// The sticking issue is that the "compound" nodes are not quite uniform w.r.t. agg: Choice/Recursion have Seq children, Seq has SType (but not Seq) children +public abstract class STypeVisitor> + extends STypeAgg> // T = SType gives more flexibile/extensibile reconstruction patterns +{ + @Override + protected final SType unit(SType n) throws ScribException + { + return n; + } + + // Should disregard agg for STypeVisitors -- the STypeVisitor pattern is instead to manually reconstruct within each visit[Node] + @Override + protected final SType agg(SType n, Stream> ns) + throws ScribException + { + throw new RuntimeException("Disregarded for STypeVisitor: " + n + " ,, " + ns); + } + + @Override + public SType visitChoice(Choice n) throws ScribException + { + List blocks = new LinkedList<>(); + for (B b : n.blocks) + { + blocks.add(visitSeq(b)); + + } + return n.reconstruct(n.getSource(), n.subj, blocks); // Disregarding agg (reconstruction done here) + } + + @Override + public SType visitRecursion(Recursion n) throws ScribException + { + B body = visitSeq(n.body); + return n.reconstruct(n.getSource(), n.recvar, body); // Disregarding agg (reconstruction done here) + } + + // "Hardcoded" to B (cf. Seq, or SType return) -- this visitor pattern depends on B for Choice/Recursion/etc reconstruction + // This means a Visitor that needs to restructure a Seq should handle this within visitSeq + // E.g., Seq "injection" by inlining and unfolding (i.e., when a visited elem is a Seq) + // For this purpose, visited children passed "directly" instead of via a reconstruction (cf. above methods) -- ? + @Override + public B visitSeq(B n) throws ScribException + { + List> elems = new LinkedList<>(); + for (SType e : n.elems) + { + elems.add(e.visitWith(this)); + } + return n.reconstruct(n.getSource(), elems); // Disregarding agg (reconstruction done here) + } +} + + + + + + + + + + + + + + + + + + + + + + + /*// Should generally disregard agg for STypeVisitors -- pattern is now to manually do reconstruct within visit dispatches + @Override + protected final SType agg(SType n, Stream> ns) + throws ScribException + { + return ns.iterator().next(); + + // agg = reconstruct, ns = "structural" (i.e, B) children -- problem with generic casts + if (n instanceof Continue || n instanceof DirectedInteraction + || n instanceof DisconnectAction || n instanceof Do) + { + return ns.iterator().next(); + } + else if (n instanceof Choice) + { + Choice c = (Choice) n; + return c.reconstruct(c.getSource(), c.subj, + ns.map(x -> (B) x).collect(Collectors.toList())); + } + else if (n instanceof Recursion) + { + Recursion r = (Recursion) n; + return r.reconstruct(r.getSource(), r.recvar, (B) ns.iterator().next()); + } + else + { + throw new RuntimeException("Shouldn't get in here: " + n + " ,, " + ns); + // agg should only be called from internal visit dispatch methods, so n's type has already been cased + } + }*/ + + +/* + // SType return for extensibility/flexibility + public SType visitContinue(Continue n) throws ScribException + { + //return n.reconstruct(n.getSource(), n.recvar); + return n; + } + + public SType visitChoice(Choice n) throws ScribException + { + List blocks = new LinkedList<>(); + for (B b : n.blocks) + { + blocks.add(b.visitWith(this)); + } + return n.reconstruct(n.getSource(), n.subj, blocks); + } + + public SType visitDirectedInteraction(DirectedInteraction n) + throws ScribException + { + //return n.reconstruct(n.getSource(), n.msg, n.src, n.dst); + return n; + } + + public SType visitDisconnect(DisconnectAction n) + throws ScribException + { + //return n.reconstruct(n.getSource(), n.left, n.right); + return n; + } + + public > SType visitDo(Do n) + throws ScribException + { + //return n.reconstruct(n.getSource(), n.proto, n.roles, n.args); + return n; + } + + public SType visitRecursion(Recursion n) throws ScribException + { + B body = n.body.visitWith(this); + return n.reconstruct(n.getSource(), n.recvar, body); + } +*/ + + +/*@FunctionalInterface +interface STypeVisitorFunction, R extends Stream> +{ + R f(SType n, STypeVisitor v); +}*/ diff --git a/scribble-core/src/main/java/org/scribble/core/visit/STypeVisitorFactory.java b/scribble-core/src/main/java/org/scribble/core/visit/STypeVisitorFactory.java new file mode 100644 index 000000000..34d78b1c8 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/visit/STypeVisitorFactory.java @@ -0,0 +1,56 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.visit; + +import java.util.List; + +import org.scribble.core.type.kind.NonRoleParamKind; +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.core.type.name.MemberName; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Arg; +import org.scribble.core.type.session.Seq; +import org.scribble.core.visit.global.GTypeVisitorFactory; +import org.scribble.core.visit.local.LTypeVisitorFactory; + +// Not an interface due to fields +public abstract class STypeVisitorFactory +{ + public final GTypeVisitorFactory global; + public final LTypeVisitorFactory local; + + public STypeVisitorFactory(GTypeVisitorFactory global, + LTypeVisitorFactory local) + { + this.global = global; + this.local = local; + } + + public > Substitutor + Substitutor(List rold, List rnew, + List> aold, + List> anew) + { + return Substitutor(rold, rnew, aold, anew, false); + } + + public abstract > Substitutor + Substitutor(List rold, List rnew, + List> aold, + List> anew, boolean passive); + + public abstract > RecPruner + RecPruner(); + +} diff --git a/scribble-core/src/main/java/org/scribble/core/visit/STypeVisitorFactoryImpl.java b/scribble-core/src/main/java/org/scribble/core/visit/STypeVisitorFactoryImpl.java new file mode 100644 index 000000000..691719c32 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/visit/STypeVisitorFactoryImpl.java @@ -0,0 +1,51 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.visit; + +import java.util.List; + +import org.scribble.core.type.kind.NonRoleParamKind; +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.core.type.name.MemberName; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Arg; +import org.scribble.core.type.session.Seq; +import org.scribble.core.visit.global.GTypeVisitorFactory; +import org.scribble.core.visit.local.LTypeVisitorFactory; + +// No interface due to fields -- CHECKME: factor out "neutral" factory field for RecPruner etc. +public class STypeVisitorFactoryImpl extends STypeVisitorFactory +{ + public STypeVisitorFactoryImpl(GTypeVisitorFactory global, + LTypeVisitorFactory local) + { + super(global, local); + } + + @Override + public > Substitutor + Substitutor(List rold, List rnew, + List> aold, + List> anew, boolean passive) + { + return new Substitutor<>(rold, rnew, aold, anew, passive); + } + + @Override + public > RecPruner + RecPruner() + { + return new RecPruner<>(); + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/visit/STypeVisitorNoThrow.java b/scribble-core/src/main/java/org/scribble/core/visit/STypeVisitorNoThrow.java new file mode 100644 index 000000000..fadce814c --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/visit/STypeVisitorNoThrow.java @@ -0,0 +1,138 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.visit; + +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.core.type.session.Choice; +import org.scribble.core.type.session.Recursion; +import org.scribble.core.type.session.SType; +import org.scribble.core.type.session.Seq; + +// For comments, see STypeVisitor +public abstract class STypeVisitorNoThrow> + extends STypeAggNoThrow> +{ + @Override + protected final SType unit(SType n) + { + return n; + } + + // Should disregard agg for STypeVisitors -- the STypeVisitor pattern is instead to manually reconstruct within each visit[Node] + @Override + protected final SType agg(SType n, Stream> ns) + { + throw new RuntimeException("Disregarded for STypeVisitorNoEx: " + n + " ,, " + ns); + } + + @Override + public SType visitChoice(Choice n) + { + List blocks = n.blocks.stream().map(x -> visitSeq(x)) + .collect(Collectors.toList()); + return n.reconstruct(n.getSource(), n.subj, blocks); // Disregarding agg (reconstruction done here) + } + + @Override + public SType visitRecursion(Recursion n) + { + B body = visitSeq(n.body); + return n.reconstruct(n.getSource(), n.recvar, body); // Disregarding agg (reconstruction done here) + } + + @Override + public B visitSeq(B n) + { + List> elems = n.elems.stream().map(x -> x.visitWithNoThrow(this)) + .collect(Collectors.toList()); + return n.reconstruct(n.getSource(), elems); // Disregarding agg (reconstruction done here) + } + +} + + + + + + + + + + + + + + + + + + + /* + public SType visitContinue(Continue n) + { + return n; + } + + public SType visitChoice(Choice n) + { + List blocks = n.blocks.stream().map(x -> x.visitWithNoEx(this)) + .collect(Collectors.toList()); + return n.reconstruct(n.getSource(), n.subj, blocks); + } + + public SType visitDirectedInteraction(DirectedInteraction n) + { + //return n.reconstruct(n.getSource(), n.msg, n.src, n.dst); + return n; + } + + public SType visitDisconnect(DisconnectAction n) + { + //return n.reconstruct(n.getSource(), n.left, n.right); + return n; + } + + public > SType visitDo(Do n) + { + //return n.reconstruct(n.getSource(), n.proto, n.roles, n.args); + return n; + } + + public SType visitRecursion(Recursion n) + { + B body = n.body.visitWithNoEx(this); + return n.reconstruct(n.getSource(), n.recvar, body); + } + + // "Hardcoded" to B (cf. Seq, or SType return) -- this visitor pattern depends on B for Choice/Recursion/etc reconstruction + // This means a Visitor that needs to restructure a Seq should handle this within visitSeq + // E.g., Seq "injection" by inlining and unfolding + // For this purpose, visited children passed "directly" instead of via a reconstruction (cf. above methods) + public B visitSeq(B n) + { + List> elems = n.elems.stream().map(x -> x.visitWithNoEx(this)) + .collect(Collectors.toList()); + return n.reconstruct(n.getSource(), elems); + }*/ + + +/*@FunctionalInterface +interface STypeVisitorFunction, R extends Stream> +{ + R f(SType n, STypeVisitor v); +}*/ diff --git a/scribble-core/src/main/java/org/scribble/core/visit/Substitutor.java b/scribble-core/src/main/java/org/scribble/core/visit/Substitutor.java new file mode 100644 index 000000000..b5259d7b4 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/visit/Substitutor.java @@ -0,0 +1,108 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.visit; + +import java.util.LinkedList; +import java.util.List; +import java.util.stream.Collectors; + +import org.scribble.core.type.kind.NonRoleParamKind; +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.core.type.name.DataName; +import org.scribble.core.type.name.MemberName; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.name.SigName; +import org.scribble.core.type.name.Substitutions; +import org.scribble.core.type.session.Arg; +import org.scribble.core.type.session.Choice; +import org.scribble.core.type.session.DirectedInteraction; +import org.scribble.core.type.session.DisconnectAction; +import org.scribble.core.type.session.Do; +import org.scribble.core.type.session.Msg; +import org.scribble.core.type.session.SType; +import org.scribble.core.type.session.Seq; + +public class Substitutor> + extends STypeVisitorNoThrow +{ + private Substitutions subs; + private boolean passive; + + protected Substitutor(List rold, List rnew, + List> aold, + List> anew, boolean passive) + { + this.subs = new Substitutions(rold, rnew, aold, anew); + this.passive = passive; + } + + @Override + public SType visitChoice(Choice n) + { + List blocks = n.blocks.stream().map(x -> visitSeq(x)) + .collect(Collectors.toList()); + return n.reconstruct(n.getSource(), + this.subs.subsRole(n.subj, this.passive), blocks); + } + + @Override + public SType visitDirectedInteraction(DirectedInteraction n) + { + Msg msg = n.msg; + if (msg instanceof MemberName) + { + MemberName name = (MemberName) msg; + if (this.subs.hasArg(name)) + { + msg = (Msg) this.subs.subsArg(name, this.passive); + } + } + return n.reconstruct(n.getSource(), msg, + this.subs.subsRole(n.src, this.passive), + this.subs.subsRole(n.dst, this.passive)); + } + + @Override + public SType visitDisconnect(DisconnectAction n) + { + return n.reconstruct(n.getSource(), + this.subs.subsRole(n.left, this.passive), + this.subs.subsRole(n.right, this.passive)); + } + + @Override + public SType visitDo(Do n) + { + List roles = n.roles.stream() + .map(x -> this.subs.subsRole(x, this.passive)) + .collect(Collectors.toList()); + List> args = new LinkedList<>(); + for (Arg a : n.args) + { + if (a instanceof MemberName && this.subs.hasArg((MemberName) a)) + { + if (a instanceof DataName) + { + a = this.subs.subsArg((DataName) a, this.passive); + } + else if (a instanceof SigName) + { + a = this.subs.subsArg((SigName) a, this.passive); + } + } + args.add(a); + } + return n.reconstruct(n.getSource(), n.proto, roles, args); + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/visit/gather/MessageIdGatherer.java b/scribble-core/src/main/java/org/scribble/core/visit/gather/MessageIdGatherer.java new file mode 100644 index 000000000..09639baee --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/visit/gather/MessageIdGatherer.java @@ -0,0 +1,33 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.visit.gather; + +import java.util.stream.Stream; + +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.core.type.name.MsgId; +import org.scribble.core.type.session.DirectedInteraction; +import org.scribble.core.type.session.Seq; + +public class MessageIdGatherer> + extends STypeGatherer> +{ + + @Override + public Stream> visitDirectedInteraction( + DirectedInteraction n) + { + return Stream.of(n.msg.getId()); + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/visit/gather/NonProtoDepsGatherer.java b/scribble-core/src/main/java/org/scribble/core/visit/gather/NonProtoDepsGatherer.java new file mode 100644 index 000000000..362fe80d5 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/visit/gather/NonProtoDepsGatherer.java @@ -0,0 +1,96 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.visit.gather; + +import java.util.LinkedList; +import java.util.List; +import java.util.stream.Stream; + +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.core.type.name.DataName; +import org.scribble.core.type.name.GDelegType; +import org.scribble.core.type.name.MemberName; +import org.scribble.core.type.name.PayElemType; +import org.scribble.core.type.name.SigName; +import org.scribble.core.type.session.Choice; +import org.scribble.core.type.session.ConnectAction; +import org.scribble.core.type.session.DirectedInteraction; +import org.scribble.core.type.session.Do; +import org.scribble.core.type.session.Payload; +import org.scribble.core.type.session.Seq; +import org.scribble.core.type.session.SigLit; + + +// Result should not contain duplicates (i.e., due to Choice/Seq) +// Result does not necessarily contain root proto (protodecl is not an SType), but may do so via dependencies +// N.B. delegation payloads currently gathered here, not by getProtoDependencies -- CHECKME: refactor? +public class NonProtoDepsGatherer> + extends STypeGatherer> +{ + @Override + public Stream> visitChoice(Choice n) + { + return super.visitChoice(n).distinct(); + } + + @Override + public Stream> visitSeq(Seq n) + { + return super.visitSeq(n).distinct(); + } + + @Override + public Stream> visitDirectedInteraction(DirectedInteraction n) + { + { + List> res = new LinkedList<>(); + if (n.msg.isSigName()) + { + res.add((SigName) n.msg); + } + else //if (this.msg.isMessageSig) + { + Payload pay = ((SigLit) n.msg).payload; + for (PayElemType p : pay.elems) + { + if (p.isDataName()) + { + res.add((DataName) p); + } + else if (p.isGDelegationType()) // TODO FIXME: should be projected to local name + { + if (n instanceof ConnectAction) + { + throw new RuntimeException("Shouldn't get in here: " + n); + } + res.add(((GDelegType) p).getGlobalProtocol()); + } + else + { + throw new RuntimeException("[TODO]: " + this); + } + } + } + return res.stream(); + } + } + + @Override + public Stream> visitDo(Do n) + { + return n.args.stream() + .filter(x -> (x instanceof SigLit) || (x instanceof DataName)) // CHECKME: refactor? + .map(x -> (MemberName) x); + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/visit/gather/ProtoDepsCollector.java b/scribble-core/src/main/java/org/scribble/core/visit/gather/ProtoDepsCollector.java new file mode 100644 index 000000000..cf5fcc334 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/visit/gather/ProtoDepsCollector.java @@ -0,0 +1,47 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.visit.gather; + +import java.util.stream.Stream; + +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.core.type.name.ProtoName; +import org.scribble.core.type.session.Choice; +import org.scribble.core.type.session.Do; +import org.scribble.core.type.session.Seq; + +// Result should not contain duplicates (i.e., due to Choice/Seq) +// Result does not necessarily contain root proto (protodecl is not an SType), but may do so via dependencies +public class ProtoDepsCollector> + extends STypeGatherer> +{ + + @Override + public Stream> visitChoice(Choice n) + { + return super.visitChoice(n).distinct(); + } + + @Override + public Stream> visitSeq(Seq n) + { + return super.visitSeq(n).distinct(); + } + + @Override + public Stream> visitDo(Do n) + { + return Stream.of(n.proto); // Should be full names + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/visit/gather/RecVarGatherer.java b/scribble-core/src/main/java/org/scribble/core/visit/gather/RecVarGatherer.java new file mode 100644 index 000000000..644713613 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/visit/gather/RecVarGatherer.java @@ -0,0 +1,31 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.visit.gather; + +import java.util.stream.Stream; + +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.core.type.name.RecVar; +import org.scribble.core.type.session.Continue; +import org.scribble.core.type.session.Seq; + +public class RecVarGatherer> + extends STypeGatherer +{ + @Override + public Stream visitContinue(Continue n) + { + return Stream.of(n.recvar); + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/visit/gather/RoleGatherer.java b/scribble-core/src/main/java/org/scribble/core/visit/gather/RoleGatherer.java new file mode 100644 index 000000000..bd84ecb58 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/visit/gather/RoleGatherer.java @@ -0,0 +1,47 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.visit.gather; + +import java.util.stream.Stream; + +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Choice; +import org.scribble.core.type.session.DirectedInteraction; +import org.scribble.core.type.session.DisconnectAction; +import org.scribble.core.type.session.Seq; + +// N.B. does *not* gather do-args, nor follow subprotos +public class RoleGatherer> + extends STypeGatherer +{ + + @Override + public Stream visitChoice(Choice n) + { + return Stream.of(n.subj); + } + + @Override + public Stream visitDirectedInteraction(DirectedInteraction n) + { + return Stream.of(n.src, n.dst); + } + + @Override + public Stream visitDisconnect(DisconnectAction n) + { + return Stream.of(n.left, n.right); + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/visit/gather/STypeGatherer.java b/scribble-core/src/main/java/org/scribble/core/visit/gather/STypeGatherer.java new file mode 100644 index 000000000..57f90ec37 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/visit/gather/STypeGatherer.java @@ -0,0 +1,97 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.visit.gather; + +import java.util.Optional; +import java.util.stream.Stream; + +import org.scribble.core.type.kind.ProtoKind; +import org.scribble.core.type.session.Choice; +import org.scribble.core.type.session.Continue; +import org.scribble.core.type.session.DirectedInteraction; +import org.scribble.core.type.session.DisconnectAction; +import org.scribble.core.type.session.Do; +import org.scribble.core.type.session.Recursion; +import org.scribble.core.type.session.SType; +import org.scribble.core.type.session.Seq; + +// Refactor as special case of Agg? +public abstract class STypeGatherer, T> +{ + // Pass this to SType.gather, e.g., n.gather(new RoleGatherer()::visit) + public Stream visit(SType n) + { + return typeSwitch(n).get(); + } + + // Can override by adding new cases when super call returns empty + protected Optional> typeSwitch(SType n) + { + return (n instanceof DirectedInteraction) + ? Optional.of(visitDirectedInteraction((DirectedInteraction) n)) + : (n instanceof DisconnectAction) + ? Optional.of(visitDisconnect((DisconnectAction) n)) + : (n instanceof Choice) + ? Optional.of(visitChoice((Choice) n)) + : (n instanceof Seq) + ? Optional.of(visitSeq((Seq) n)) + : (n instanceof Continue) + ? Optional.of(visitContinue((Continue) n)) + : (n instanceof Recursion) + ? Optional.of(visitRecursion((Recursion) n)) + : (n instanceof Do) + ? Optional.of(this.visitDo((Do) n)) + : Optional.empty(); + // Better for extensibility than "manually" throwing Exception (e.g., for overriding) + // N.B. currently causes exception on get in visit + } + + public Stream visitContinue(Continue n) + { + return Stream.of(); + } + + public Stream visitChoice(Choice n) + { + return Stream.of(); + } + + // CHECKME: split into ConnectionAction and MessageTransfer? cf. NonProtoDepsCollector -- and how about locals? + // This is the "level" of reconstruct, though + // Or offer all, with ConnectionAction and MessageTransfer delegating to DirectedInteraction by default? (must order correctly in typeSwitch) + public Stream visitDirectedInteraction(DirectedInteraction n) + { + return Stream.of(); + } + + public Stream visitDisconnect(DisconnectAction n) + { + return Stream.of(); + } + + public Stream visitDo(Do n) + { + return Stream.of(); + } + + public Stream visitRecursion(Recursion n) + { + return Stream.of(); + } + + public Stream visitSeq(Seq n) + { + return Stream.of(); + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/visit/global/ConnectionChecker.java b/scribble-core/src/main/java/org/scribble/core/visit/global/ConnectionChecker.java new file mode 100644 index 000000000..b0776d67b --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/visit/global/ConnectionChecker.java @@ -0,0 +1,134 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.visit.global; + +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.scribble.core.type.kind.Global; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Choice; +import org.scribble.core.type.session.ConnectAction; +import org.scribble.core.type.session.DirectedInteraction; +import org.scribble.core.type.session.DisconnectAction; +import org.scribble.core.type.session.Do; +import org.scribble.core.type.session.SType; +import org.scribble.core.type.session.global.GSeq; +import org.scribble.core.visit.STypeVisitor; +import org.scribble.util.ScribException; + +// Pre: use on inlined or later (unsupported for Do, also Protocol) +// CHECKME: connection check at global vs. local level? +public class ConnectionChecker extends STypeVisitor +{ + protected enum Status { CONN, DIS, AMBIG } + + public final Set roles; + public final boolean implicit; + + protected final Map, Status> conns; + + protected ConnectionChecker(Set roles, boolean implicit) + { + this.roles = Collections.unmodifiableSet(roles); + this.implicit = implicit; + this.conns = roles.stream() + .flatMap(x -> roles.stream().filter(y -> !y.equals(x)) + .map(y -> Stream.of(x, y).collect(Collectors.toSet()))) + .distinct() + .collect( + Collectors.toMap(x -> x, x -> implicit ? Status.CONN : Status.DIS)); + } + + // Copy constructor + protected ConnectionChecker(ConnectionChecker v) + { + this.roles = v.roles; + this.implicit = v.implicit; + this.conns = new HashMap<>(v.conns); + } + + @Override + public SType visitChoice(Choice n) + throws ScribException + { + List, Status>> blocks = new LinkedList<>(); + for (GSeq block : n.blocks) + { + ConnectionChecker nested = new ConnectionChecker(this); + block.visitWith(nested); + blocks.add(nested.conns); + } + blocks.stream() + .reduce((x, y) -> x.keySet().stream() + .collect(Collectors.toMap(k -> k, + k -> x.get(k).equals(y.get(k)) ? x.get(k) : Status.AMBIG))) + .get().entrySet() + .forEach(x -> this.conns.put(x.getKey(), x.getValue())); + return n; // super would do reconstruct + } + + @Override + public SType visitDirectedInteraction( + DirectedInteraction n) throws ScribException + { + Set rs = Stream.of(n.src, n.dst).collect(Collectors.toSet()); + if (n instanceof ConnectAction) + { + switch (this.conns.get(rs)) + { + case AMBIG: throw new ScribException("Roles may already be connected: " + n); + case CONN: throw new ScribException("Roles already connected: " + n); + default: this.conns.put(rs, Status.CONN); + } + } + else + { + switch (this.conns.get(rs)) + { + case AMBIG: throw new ScribException("Roles may be disconnected: " + n); + case DIS: throw new ScribException("Roles disconnected: " + n); + default: + } + } + return super.visitDirectedInteraction(n); + } + + @Override + public SType visitDisconnect(DisconnectAction n) + throws ScribException + { + Set rs = Stream.of(n.left, n.right).collect(Collectors.toSet()); + switch (this.conns.get(rs)) + { + case AMBIG: throw new ScribException("Roles may already be disconnected: " + n); + case DIS: throw new ScribException("Roles already disconnected: " + n); + default: this.conns.put(rs, Status.DIS); + } + return super.visitDisconnect(n); + } + + @Override + public final SType visitDo(Do n) throws ScribException + { + throw new RuntimeException(this.getClass() + " unsupported for Do: " + n); + } + +} diff --git a/scribble-core/src/main/java/org/scribble/core/visit/global/ExtChoiceConsistencyChecker.java b/scribble-core/src/main/java/org/scribble/core/visit/global/ExtChoiceConsistencyChecker.java new file mode 100644 index 000000000..143f4bf1a --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/visit/global/ExtChoiceConsistencyChecker.java @@ -0,0 +1,116 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.visit.global; + +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.scribble.core.type.kind.Global; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Choice; +import org.scribble.core.type.session.DirectedInteraction; +import org.scribble.core.type.session.Do; +import org.scribble.core.type.session.SType; +import org.scribble.core.type.session.global.GSeq; +import org.scribble.core.visit.STypeVisitor; +import org.scribble.util.ScribException; + +// Pre: use on inlined or later (unsupported for Do, also Protocol) +public class ExtChoiceConsistencyChecker extends STypeVisitor +{ + private Map enablers; // Invariant: unmodifiable + + protected ExtChoiceConsistencyChecker(Map enabled) + { + setEnablers(enabled); + } + + public SType visitChoice(Choice n) + throws ScribException + { + Map subj = Stream.of(n.subj) + .collect(Collectors.toMap(x -> x, x -> x)); + List> blocks = new LinkedList<>(); + ExtChoiceConsistencyChecker nested = new ExtChoiceConsistencyChecker(subj); + // Arg redundant, but better to keep a single constructor, for factory pattern + for (GSeq block : n.blocks) + { + nested.setEnablers(subj); + nested.visitSeq(block); + blocks.add(nested.getEnablers()); + } + Map res = new HashMap<>(getEnablers()); + Set> all = blocks.stream() + .flatMap(x -> x.entrySet().stream()).collect(Collectors.toSet()); + for (Entry e : all) + { + Role enabled = e.getKey(); + Role enabler = e.getValue(); + if (all.stream().anyMatch( + x -> x.getKey().equals(enabled) && !x.getValue().equals(enabler))) + { + throw new ScribException( + "Inconsistent external choice subjects for " + enabled + ": " + + all.stream().filter(x -> x.getKey().equals(enabled)) + .collect(Collectors.toList())); + } + if (!res.containsKey(enabled)) + { + res.put(enabled, enabler); + } + } + setEnablers(res); + return n; + } + + @Override + public SType visitDirectedInteraction( + DirectedInteraction n) throws ScribException + { + Map enablers = getEnablers(); + if (enablers.containsKey(n.dst)) + + { + return n; + } + Map res = new HashMap<>(enablers); + res.put(n.dst, n.src); + setEnablers(res); + return n; + } + + @Override + public final SType visitDo(Do n) throws ScribException + { + throw new RuntimeException(this.getClass() + " unsupported for Do: " + n); + } + + protected Map getEnablers() + { + return this.enablers; + } + + // Guards this.enablers unmodifiable + protected void setEnablers(Map enabled) + { + this.enablers = Collections.unmodifiableMap(enabled); + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/visit/global/GTypeInliner.java b/scribble-core/src/main/java/org/scribble/core/visit/global/GTypeInliner.java new file mode 100644 index 000000000..7085e5df5 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/visit/global/GTypeInliner.java @@ -0,0 +1,55 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.visit.global; + +import org.scribble.core.job.Core; +import org.scribble.core.lang.SubprotoSig; +import org.scribble.core.lang.global.GProtocol; +import org.scribble.core.type.kind.Global; +import org.scribble.core.type.name.ProtoName; +import org.scribble.core.type.name.RecVar; +import org.scribble.core.type.session.Do; +import org.scribble.core.type.session.SType; +import org.scribble.core.type.session.global.GSeq; +import org.scribble.core.visit.STypeInliner; +import org.scribble.core.visit.Substitutor; + +public class GTypeInliner extends STypeInliner +{ + protected GTypeInliner(Core core) + { + super(core); + } + + @Override + public SType visitDo(Do n) + { + ProtoName fullname = n.proto; + SubprotoSig sig = new SubprotoSig(fullname, n.roles, n.args); + RecVar rv = getInlinedRecVar(sig); + if (hasSig(sig)) + { + return this.core.config.tf.global.GContinue(n.getSource(), rv); + } + pushSig(sig); + GProtocol g = this.core.getContext().getIntermediate(fullname); + Substitutor subs = this.core.config.vf.Substitutor(g.roles, + n.roles, g.params, n.args); + //GSeq inlined = (GSeq) g.def.visitWithNoEx(subs).visitWithNoEx(this); + GSeq inlined = visitSeq(subs.visitSeq(g.def)); + // i.e. returning a GSeq -- rely on parent GSeq to inline + popSig(); + return this.core.config.tf.global.GRecursion(null, rv, inlined); + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/visit/global/GTypeUnfolder.java b/scribble-core/src/main/java/org/scribble/core/visit/global/GTypeUnfolder.java new file mode 100644 index 000000000..b6a33d057 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/visit/global/GTypeUnfolder.java @@ -0,0 +1,37 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.visit.global; + +import org.scribble.core.job.Core; +import org.scribble.core.type.kind.Global; +import org.scribble.core.type.session.Continue; +import org.scribble.core.type.session.global.GSeq; +import org.scribble.core.type.session.global.GType; +import org.scribble.core.visit.STypeUnfolder; + +public class GTypeUnfolder extends STypeUnfolder +{ + + protected GTypeUnfolder(Core core) + { + super(core); + } + + @Override + public GType visitContinue(Continue n) + { + return this.core.config.tf.global.GRecursion(n.getSource(), n.recvar, + (GSeq) getRec(n.recvar)); + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/visit/global/GTypeVisitorFactory.java b/scribble-core/src/main/java/org/scribble/core/visit/global/GTypeVisitorFactory.java new file mode 100644 index 000000000..585539d7b --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/visit/global/GTypeVisitorFactory.java @@ -0,0 +1,40 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.visit.global; + +import java.util.Map; +import java.util.Set; + +import org.scribble.core.job.Core; +import org.scribble.core.type.name.Role; + +public interface GTypeVisitorFactory +{ + GTypeInliner GTypeInliner(Core core); + + GTypeUnfolder GTypeUnfolder(Core core); + + RoleEnablingChecker RoleEnablingChecker(Set rs); + + ExtChoiceConsistencyChecker ExtChoiceConsistencyChecker( + Map enabled); + + ConnectionChecker ConnectionChecker(Set rs, boolean implicit); + + InlinedProjector InlinedProjector(Core core, Role self); + + // CHECKME: deprecate? + SubprotoProjector Projector(Core core, Role self); + +} diff --git a/scribble-core/src/main/java/org/scribble/core/visit/global/GTypeVisitorFactoryImpl.java b/scribble-core/src/main/java/org/scribble/core/visit/global/GTypeVisitorFactoryImpl.java new file mode 100644 index 000000000..5d481ab5e --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/visit/global/GTypeVisitorFactoryImpl.java @@ -0,0 +1,69 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.visit.global; + +import java.util.Map; +import java.util.Set; + +import org.scribble.core.job.Core; +import org.scribble.core.type.name.Role; + +public class GTypeVisitorFactoryImpl implements GTypeVisitorFactory +{ + + @Override + public GTypeInliner GTypeInliner(Core core) + { + return new GTypeInliner(core); + } + + @Override + public GTypeUnfolder GTypeUnfolder(Core core) + { + return new GTypeUnfolder(core); + } + + @Override + public RoleEnablingChecker RoleEnablingChecker(Set rs) + { + return new RoleEnablingChecker(rs); + } + + @Override + public ExtChoiceConsistencyChecker ExtChoiceConsistencyChecker( + Map enabled) + { + return new ExtChoiceConsistencyChecker(enabled); + } + + @Override + public ConnectionChecker ConnectionChecker(Set roles, boolean implicit) + { + return new ConnectionChecker(roles, implicit); + } + + @Override + public InlinedProjector InlinedProjector(Core core, Role self) + { + return new InlinedProjector(core, self); + } + + // CHECKME: deprecate? + @Override + public SubprotoProjector Projector(Core core, Role self) + { + return new SubprotoProjector(core, self); + } + +} diff --git a/scribble-core/src/main/java/org/scribble/core/visit/global/InlinedProjector.java b/scribble-core/src/main/java/org/scribble/core/visit/global/InlinedProjector.java new file mode 100644 index 000000000..51a82d531 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/visit/global/InlinedProjector.java @@ -0,0 +1,246 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.visit.global; + +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.scribble.core.job.Core; +import org.scribble.core.type.kind.Global; +import org.scribble.core.type.kind.Local; +import org.scribble.core.type.name.LProtoName; +import org.scribble.core.type.name.ModuleName; +import org.scribble.core.type.name.ProtoName; +import org.scribble.core.type.name.RecVar; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Choice; +import org.scribble.core.type.session.Continue; +import org.scribble.core.type.session.DirectedInteraction; +import org.scribble.core.type.session.DisconnectAction; +import org.scribble.core.type.session.Do; +import org.scribble.core.type.session.Recursion; +import org.scribble.core.type.session.SType; +import org.scribble.core.type.session.global.GConnect; +import org.scribble.core.type.session.global.GSeq; +import org.scribble.core.type.session.local.LContinue; +import org.scribble.core.type.session.local.LSeq; +import org.scribble.core.type.session.local.LSkip; +import org.scribble.core.type.session.local.LType; +import org.scribble.core.type.session.local.LTypeFactory; +import org.scribble.core.visit.STypeAggNoThrow; + +// Pre: use on inlined (i.e., "do" inlined, roles pruned) +public class InlinedProjector extends STypeAggNoThrow +{ + //protected final Set unguarded; + protected final Set unguarded; + // Projection "prunes" unguarded continues from choice cases, e.g., mu X.(A->B:1.X + A->B:2.A->C:2) for C, i.e., travel agent + // ...this can be followed by RecPruner to remove recs that are "orphaned" by continue pruning + // N.B. projection does not "merge" choice cases in , e.g., rec X { 1() from A; choice at A { continue X; } or { continue X; } }... + // ...that is a non-det branch, same as rec X { choice at A { 1() from A; } or { 1() from A; } } + + public final Core core; + public final Role self; + + protected InlinedProjector(Core core, Role self) + { + this.core = core; + this.self = self; + this.unguarded = new HashSet<>(); + } + + // Copy constructor for dup + protected InlinedProjector(InlinedProjector v) + { + this.core = v.core; + this.self = v.self; + this.unguarded = new HashSet<>(v.unguarded); + } + + // Use to visit a node with a copy of the current context (this.unguarded), e.g., for "nested" context visiting (Choice) + // N.B. subclasses should override + protected InlinedProjector dup() + { + return new InlinedProjector(this); + } + + @Override + public LType visitChoice(Choice n) + { + List blocks = n.blocks.stream() + .map(x -> dup().visitSeq(x)) + .filter(x -> !x.isEmpty() && !isUnguardedSingleContinue(x)) + .collect(Collectors.toList()); + if (blocks.isEmpty()) + { + return LSkip.SKIP; // CHECKME: OK, or "empty" choice at subj still important? + } + this.unguarded.clear(); // At least one block is non-empty, consider continues guarded -- must clear here, blocks visited using dup's + + //InlinedEnablerInferer v = new InlinedEnablerInferer(this.unguarded); + Role subj = n.subj.equals(this.self) + ? Role.SELF // i.e., internal choice + : n.subj;//v.visitSeq(blocks.get(0)).get(); // CHECKME: consistent ext choice means can infer from any one seq? + // CHECKME: "self" also explcitily used for Do, but implicitly for MessageTransfer, inconsistent? + return this.core.config.tf.local.LChoice(null, subj, blocks); + } + + // N.B. won't prune unguarded continues that have a bad sequence, will be caught later by reachability checking (e.g., bad.reach.globals.gdo.Test04) + private boolean isUnguardedSingleContinue(LSeq block) + { + if (block.elems.size() != 1) + { + return false; + } + SType e = block.elems.get(0); + return (e instanceof LContinue) + && this.unguarded.contains(((LContinue) e).recvar); // Bound recvars already checked + } + + @Override + public LType visitContinue(Continue n) + { + return this.core.config.tf.local.LContinue(null, n.recvar); + } + + @Override + public LType visitDirectedInteraction(DirectedInteraction n) + { + /*if (n.src.equals(self) && n.dst.equals(self)) + { + // CHECKME: already checked? + }*/ + LTypeFactory lf = this.core.config.tf.local; + if (n instanceof GConnect) // FIXME + { + return n.src.equals(self) ? lf.LReq(null, n.msg, n.dst) + : n.dst.equals(self) ? lf.LAcc(null, n.src, n.msg) + : LSkip.SKIP; + } + else //if (n instanceof GMessageTransfer) + { + return n.src.equals(self) ? lf.LSend(null, n.msg, n.dst) + : n.dst.equals(self) ? lf.LRecv(null, n.src, n.msg) + : LSkip.SKIP; + } + } + + @Override + public LType visitDisconnect(DisconnectAction n) + { + /*if (n.src.equals(self) && n.dst.equals(self)) + { + // CHECKME: already checked? + }*/ + LTypeFactory lf = this.core.config.tf.local; + return n.left.equals(self) ? lf.LDisconnect(null, n.right) + : n.right.equals(self) ? lf.LDisconnect(null, n.left) + : LSkip.SKIP; + } + + @Override + public LType visitDo(Do n) + { + throw new RuntimeException("Unsupported for Do: " + n + " ,, " + this.getClass()); + } + + @Override + public LType visitRecursion(Recursion n) + { + this.unguarded.add(n.recvar); + LSeq body = visitSeq(n.body); // Single "nested" Seq, don't need to copy visitor + if (body.isEmpty()) // A simple special case of empty-rec pruning -- leave it to "official" rec pruning? + { + return LSkip.SKIP; + } + Set rvs = new HashSet<>(); + rvs.add(n.recvar); + //if (body.visitWithNoThrow(new SingleContinueChecker(rvs))) + // "Generalised" single-continue checked now unnecessary, single-continues pruned in choice visiting above + if (body.elems.size() == 1) + { + SType e = body.elems.get(0); + if(e instanceof LContinue && ((LContinue) e).recvar.equals(n.recvar)) + { + return LSkip.SKIP; + } + } + this.unguarded.remove(n.recvar); + return this.core.config.tf.local.LRecursion(null, n.recvar, body); + } + + // Param "hardcoded" to B (cf. Seq, or SType return) -- this visitor pattern depends on B for Choice/Recursion/etc reconstruction + @Override + public LSeq visitSeq(GSeq n) + { + List elems = new LinkedList<>(); + for (SType e : n.elems) + { + LType e1 = e.visitWithNoThrow(this); + if (!(e1 instanceof LSkip)) + { + elems.add(e1); + this.unguarded.clear(); + } + } + return this.core.config.tf.local.LSeq(null, elems); + // Empty seqs converted to LSkip by GChoice/Recursion projection + // And a WF top-level protocol cannot produce empty LSeq + // So a projection never contains an empty LSeq -- i.e., "empty choice/rec" pruning unnecessary + } + + // CHECKME: relocate? + public static LProtoName getSimpledProjectionName(ProtoName simpname, + Role role) + { + return new LProtoName(simpname.toString() + "_" + role.toString()); + } + + // Role is the target subprotocol parameter (not the current projector self -- actually the self just popped) -- ? + public static LProtoName getFullProjectionName(ProtoName fullname, + Role role) + { + ProtoName simplename = InlinedProjector.getSimpledProjectionName( + fullname.getSimpleName(), role); + ModuleName modname = getProjectionModuleName(fullname.getPrefix(), + simplename); + return new LProtoName(modname, simplename); + } + + // fullname is the un-projected name; localname is the already projected simple name + public static ModuleName getProjectionModuleName(ModuleName fullname, + ProtoName localname) + { + ModuleName simpname = new ModuleName( + fullname.getSimpleName().toString() + "_" + localname.toString()); + return new ModuleName(fullname.getPrefix(), simpname); // Supports unary fullname + } + + @Override + protected LType unit(SType n) + { + throw new RuntimeException("Unsupported for InlinedProjector: " + n); + } + + @Override + protected LType agg(SType n, Stream ts) + { + throw new RuntimeException( + "Unsupported for InlinedProjector: " + n + " ,, " + ts); + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/visit/global/RoleEnablingChecker.java b/scribble-core/src/main/java/org/scribble/core/visit/global/RoleEnablingChecker.java new file mode 100644 index 000000000..b63c2ce97 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/visit/global/RoleEnablingChecker.java @@ -0,0 +1,123 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.visit.global; + +import java.util.Collections; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.scribble.core.type.kind.Global; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Choice; +import org.scribble.core.type.session.DirectedInteraction; +import org.scribble.core.type.session.DisconnectAction; +import org.scribble.core.type.session.Do; +import org.scribble.core.type.session.SType; +import org.scribble.core.type.session.global.GSeq; +import org.scribble.core.visit.STypeVisitor; +import org.scribble.util.ScribException; + +// Pre: use on inlined or later (unsupported for Do, also Protocol) +public class RoleEnablingChecker extends STypeVisitor +{ + private Set enabled; // Invariant: unmodifiable + + protected RoleEnablingChecker(Set enabled) + { + setEnabled(enabled); + } + + public SType visitChoice(Choice n) + throws ScribException + { + Set enabled = getEnabled(); + if (!enabled.contains(n.subj)) + { + throw new ScribException("Subject not enabled: " + n.subj); + } + Set subj = Stream.of(n.subj).collect(Collectors.toSet()); + RoleEnablingChecker nested = new RoleEnablingChecker(subj); + // Arg redundant, but better to keep a single constructor, for factory pattern + List> blocks = new LinkedList<>(); + for (GSeq block : n.blocks) + { + nested.setEnabled(subj); // Copies defensively + nested.visitSeq(block); + blocks.add(nested.getEnabled()); + } + Set res = new HashSet<>(enabled); + Set tmp = blocks.stream().flatMap(x -> x.stream()) + .filter(x -> blocks.stream().allMatch(y -> y.contains(x))) + .collect(Collectors.toSet()); + res.addAll(tmp); + setEnabled(res); + return n; + } + + @Override + public SType visitDirectedInteraction( + DirectedInteraction n) throws ScribException + { + Set enabled = getEnabled(); + if (!enabled.contains(n.src)) + { + throw new ScribException("Source role not enabled: " + n.src); + } + if (enabled.contains(n.dst)) + { + return n; + } + Set res = new HashSet<>(enabled); + res.add(n.dst); + setEnabled(res); + return n; + } + + @Override + public final SType visitDo(Do n) throws ScribException + { + throw new RuntimeException(this.getClass() + " unsupported for Do: " + n); + } + + @Override + public SType visitDisconnect( + DisconnectAction n) throws ScribException + { + Set enabled = getEnabled(); + if (!enabled.contains(n.left)) + { + throw new ScribException("Role not enabled: " + n.left); + } + if (!enabled.contains(n.right)) + { + throw new ScribException("Role not enabled: " + n.right); + } + return n; + } + + public Set getEnabled() + { + return this.enabled; + } + + // Guards this.enabled unmodifiable + protected void setEnabled(Set enabled) + { + this.enabled = Collections.unmodifiableSet(enabled); + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/visit/global/SubprotoProjector.java b/scribble-core/src/main/java/org/scribble/core/visit/global/SubprotoProjector.java new file mode 100644 index 000000000..fcbf06e4f --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/visit/global/SubprotoProjector.java @@ -0,0 +1,83 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.visit.global; + +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +import org.scribble.core.job.Core; +import org.scribble.core.job.CoreContext; +import org.scribble.core.lang.global.GProtocol; +import org.scribble.core.type.kind.Global; +import org.scribble.core.type.name.LProtoName; +import org.scribble.core.type.name.ProtoName; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.name.Substitutions; +import org.scribble.core.type.session.Do; +import org.scribble.core.type.session.global.GSeq; +import org.scribble.core.type.session.local.LSkip; +import org.scribble.core.type.session.local.LType; + +// Supports Do -- can use on parsed (intermed) +public class SubprotoProjector extends InlinedProjector // CHECKME: this way, or the other way round? +{ + protected SubprotoProjector(Core core, Role self) + { + super(core, self); + } + + // Copy constructor for dup + protected SubprotoProjector(SubprotoProjector v) + { + super(v); + } + + @Override + protected SubprotoProjector dup() + { + return new SubprotoProjector(this); + } + + @Override + public LType visitDo(Do n) + { + if (!n.roles.contains(this.self)) + { + return LSkip.SKIP; + } + + CoreContext corec = this.core.getContext(); + ProtoName proto = n.proto; + GProtocol imed = corec.getIntermediate(proto); + Role targSelf = imed.roles.get(n.roles.indexOf(this.self)); + if (!imed.roles.contains(targSelf)) // CHECKME: because roles already pruned for intermed decl? + { + return LSkip.SKIP; + } + + LProtoName fullname = InlinedProjector.getFullProjectionName(proto, + targSelf); + Substitutions subs = new Substitutions(imed.roles, n.roles, + Collections.emptyList(), Collections.emptyList()); + List used = corec.getInlined(proto).roles.stream() // N.B. global (inlined) roles -- still need to prune roles w.r.t. localised projection + .map(x -> subs.subsRole(x)).collect(Collectors.toList()); + List rs = n.roles.stream().filter(x -> used.contains(x)) + .map(x -> x.equals(this.self) ? Role.SELF : x) + // CHECKME: syntax: "self" explictly used for Choice subject, but implicitly for MessageTransfer, inconsistent? + .collect(Collectors.toList()); + return this.core.config.tf.local.LDo(null, fullname, rs, n.args); // TODO CHECKME: prune args? + } +} + diff --git a/scribble-core/src/main/java/org/scribble/core/visit/local/EGraphBuilder.java b/scribble-core/src/main/java/org/scribble/core/visit/local/EGraphBuilder.java new file mode 100644 index 000000000..416fb2cf5 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/visit/local/EGraphBuilder.java @@ -0,0 +1,243 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.visit.local; + +import java.util.Collections; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +import org.scribble.core.job.Core; +import org.scribble.core.model.endpoint.EGraph; +import org.scribble.core.model.endpoint.EGraphBuilderUtil; +import org.scribble.core.model.endpoint.EState; +import org.scribble.core.model.endpoint.actions.EAction; +import org.scribble.core.type.kind.Local; +import org.scribble.core.type.name.MsgId; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Choice; +import org.scribble.core.type.session.Continue; +import org.scribble.core.type.session.DirectedInteraction; +import org.scribble.core.type.session.DisconnectAction; +import org.scribble.core.type.session.Do; +import org.scribble.core.type.session.Payload; +import org.scribble.core.type.session.Recursion; +import org.scribble.core.type.session.SType; +import org.scribble.core.type.session.SigLit; +import org.scribble.core.type.session.local.LAcc; +import org.scribble.core.type.session.local.LContinue; +import org.scribble.core.type.session.local.LDisconnect; +import org.scribble.core.type.session.local.LRecursion; +import org.scribble.core.type.session.local.LRecv; +import org.scribble.core.type.session.local.LReq; +import org.scribble.core.type.session.local.LSend; +import org.scribble.core.type.session.local.LSeq; +import org.scribble.core.type.session.local.LType; +import org.scribble.core.visit.STypeVisitorNoThrow; + +// Pre: use on inlined or later (unsupported for Do, also Protocol) +// Uses EGraphBuilderUtil2 to build graph "progressively" (working graph is mutable) +// Must use build as top-level call (does EGraphBuilderUtil2.finalise -- "resets" the util) +public class EGraphBuilder extends STypeVisitorNoThrow +{ + public final Core core; + + private EGraphBuilderUtil util; + + protected EGraphBuilder(Core core) + { + this.core = core; + this.util = core.config.mf.local.EGraphBuilderUtil(); + } + + public EGraph finalise() + { + return this.util.finalise(); + } + + @Override + public SType visitChoice(Choice n) + { + EGraphBuilderUtil util = this.util; + util.enterChoice(); + for (LSeq block : n.blocks) + { + List elems = block.getElements(); + LType first = elems.get(0); + if (first instanceof LContinue) + { + // Cannot treat choice-unguarded-continue in "a single pass", because may not have built all recursion enacting edges yet + // (Single-pass building would be sensitive to order of choice block visiting) + LContinue cont = (LContinue) first; // First and only element + util.addUnguardedContinueEdge(util.getEntry(), cont.recvar); + } + else if (first instanceof LRecursion) // CHECKME: do this here? refactor into builderutil? + { + buildUnguardedRecursion(util, elems); + } + else + { + util.enterChoiceBlock(); + block.visitWithNoThrow(this); + util.leaveChoiceBlock(); + } + } + util.leaveChoice(); + return n; + } + + // Recursion is first element of choice case + private void buildUnguardedRecursion(EGraphBuilderUtil util, + List elems) + { + LRecursion first = (LRecursion) elems.get(0); + EState entry = util.getEntry(); + + EState nestedEntry = util.newState(Collections.emptySet()); + util.setEntry(nestedEntry); + if (elems.size() == 1) // Cf. visitSeq last element or not + { + first.visitWithNoThrow(this); + } + else + { + EState exit = util.getExit(); + EState nestedExit = util.newState(Collections.emptySet()); + util.setExit(nestedExit); + first.visitWithNoThrow(this); // entry to nestedExit -- reuse existing builder, to directly add continue-edges back to the "outer" graph + + util.setEntry(nestedExit); // Must be non null + util.setExit(exit); + LSeq tail = this.core.config.tf.local.LSeq(null, + elems.subList(1, elems.size())); + tail.visitWithNoThrow(this); // nestedExit to exit + } + + Iterator as = nestedEntry.getActions().iterator(); // "Enacting" actions + Iterator succs = nestedEntry.getSuccs().iterator(); + while (as.hasNext()) + { + EAction a = as.next(); + EState succ = succs.next(); + util.addEdge(entry, a, succ); // Add edges from original entry into "nested" graph, offset by enacting to nestedEntry succs + } + + util.setEntry(entry); // EGraphBuilderUtil contract, entry on leaving a node should be the same as on entering + } + + @Override + public SType visitContinue(Continue n) + { + // Choice-guarded continue -- choice-unguarded continue detected and handled above in visitChoice + EState curr = this.util.getEntry(); + for (EState pred : this.util.getPreds(curr)) // Does getSuccs (i.e., gets all), e.g., choice sequenced to continue + { + // CHECKME: identical edges? i.e. same pred/prev/succ (e.g. rec X { choice at A { A->B:1 } or { A->B:1 } continue X; }) + for (EAction a : new LinkedList<>(pred.getActions())) + { + // Following caters for non-det edges (to different succs) + for (EState succ : pred.getSuccs(a)) + { + if (succ.equals(curr)) + { + this.util.fixContinueEdge(pred, a, curr, n.recvar); + } + } + } + } + return n; + } + + @Override + public SType visitDirectedInteraction( + DirectedInteraction n) + { + Role peer = ((n instanceof LSend) || (n instanceof LReq)) ? n.dst // CHECKME: refactor LType getSelf/Peer? cf. ast + : ((n instanceof LRecv) || (n instanceof LAcc)) ? n.src + : null; + if (peer == null) + { + throw new RuntimeException("Unknown action type: " + n); + } + MsgId mid = n.msg.getId(); + Payload pay = n.msg.isSigLit() // CHECKME: generalise? (e.g., hasPayload) + ? ((SigLit) n.msg).payload + : Payload.EMPTY_PAYLOAD; + // TODO: add toAction method to BasicInteraction (cf. toName methods of NameNodes) + EAction a = (n instanceof LSend) ? this.util.mf.local.ESend(peer, mid, pay) + : (n instanceof LRecv) ? this.util.mf.local.ERecv(peer, mid, pay) + : (n instanceof LReq) ? this.util.mf.local.EReq(peer, mid, pay) + : //(n instanceof LAcc) ? + this.util.mf.local.EAcc(peer, mid, pay); // Action type already checked above + this.util.addEdge(this.util.getEntry(), a, this.util.getExit()); + return n; + } + + @Override + public SType visitDisconnect(DisconnectAction n) + { + Role peer = ((LDisconnect) n).getPeer(); // CHECKME -- ? + EAction a = this.util.mf.local.EDisconnect(peer); // TODO: add toAction method to BasicInteraction + this.util.addEdge(this.util.getEntry(), a, this.util.getExit()); + return n; + } + + @Override + public final SType visitDo(Do n) + { + throw new RuntimeException(this.getClass() + " unsupported for Do: " + n); + } + + @Override + public SType visitRecursion(Recursion n) + { + this.util.addEntryLabel(n.recvar); + this.util.enterRecursion(n.recvar, this.util.getEntry()); + n.body.visitWithNoThrow(this); + this.util.leaveRecursion(n.recvar); + return n; + } + + @Override + public LSeq visitSeq(LSeq n) + { + EGraphBuilderUtil util = this.util; + EState entry = util.getEntry(); + EState exit = util.getExit(); + List elems = n.getElements(); + if (elems.isEmpty()) + { + throw new RuntimeException("Shouldn't get here: " + this); + } + for (Iterator i = n.getElements().iterator(); i.hasNext(); ) + { + LType next = i.next(); + if (!i.hasNext()) + { + util.setExit(exit); + next.visitWithNoThrow(this); + } + else + { + EState tmp = util.newState(Collections.emptySet()); + util.setExit(tmp); + next.visitWithNoThrow(this); + util.setEntry(util.getExit()); + // CHECKME: exit may not be tmp, entry/exit can be modified, e.g. continue + } + } + util.setEntry(entry); // EGraphBuilderUtil contract, entry on leaving a node should be the same as on entering + return n; + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/visit/local/InlinedExtChoiceSubjFixer.java b/scribble-core/src/main/java/org/scribble/core/visit/local/InlinedExtChoiceSubjFixer.java new file mode 100644 index 000000000..ac476256e --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/visit/local/InlinedExtChoiceSubjFixer.java @@ -0,0 +1,171 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.visit.local; + +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.scribble.core.type.kind.Local; +import org.scribble.core.type.name.RecVar; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Choice; +import org.scribble.core.type.session.Continue; +import org.scribble.core.type.session.DirectedInteraction; +import org.scribble.core.type.session.Do; +import org.scribble.core.type.session.Recursion; +import org.scribble.core.type.session.SType; +import org.scribble.core.type.session.local.LSeq; +import org.scribble.core.visit.STypeAggNoThrow; +import org.scribble.core.visit.STypeVisitorNoThrow; + +// Easier to separate from InlinedProjector (i.e., finish projection first, then fix) +// (Doing "at the time" during projection requires, e.g., recursion body projections for "inference" on recursion entry, but the body can't really be projected yet without that upfront "inference") +public class InlinedExtChoiceSubjFixer extends STypeVisitorNoThrow +{ + protected final Map> recs = new HashMap<>(); + // Record on entering rec states, to give to InlinedEnablerInferer on nested choice states (for unguarded continues) + // CHECKME: Optional necessary? InlinedEnablerInferer may not succeed due to empty/bad contexts, but should that be reflected here? + + protected InlinedExtChoiceSubjFixer() + { + + } + + // To override for handling subproto + // Takes "this" (cf. this.recs), better pattern for extensibility + protected InlinedEnablerInferer getInferer(InlinedExtChoiceSubjFixer v)//Map> recs) + { + return new InlinedEnablerInferer(this); + } + + @Override + public Choice visitChoice(Choice n) + { + InlinedEnablerInferer v = getInferer(this); + Role subj = n.visitWithNoThrow(v).get(); // WF ensures result + return n.reconstruct(n.getSource(), subj, n.blocks); + } + + @Override + public SType visitDo(Do n) + { + throw new RuntimeException("Unsupported for Do: " + n); + } + + @Override + public Recursion visitRecursion(Recursion n) + { + InlinedEnablerInferer v = getInferer(this); // Pattern: Inferer to access (and copy) this.recs directly + Optional res = v.visitSeq(n.body); // Can be empty or OK + this.recs.put(n.recvar, res); + LSeq body = visitSeq(n.body); + return n.reconstruct(n.getSource(), n.recvar, body); + } +} + +class InlinedEnablerInferer extends STypeAggNoThrow> + // Optional.empty signifies "inference" did not succeed, either an outright bad (should be caught by WF somewhere) or an "empty" context +{ + private final Map> recs; + + public InlinedEnablerInferer(InlinedExtChoiceSubjFixer v)//Map> recs) + { + this.recs = Collections.unmodifiableMap(v.recs); + } + + @Override + public Optional visitChoice(Choice n) + { + // If inference does not succeed, keep the original + // Such bad cases due, e.g., any inconsistency, will be caught as bad WF somewhere else (e.g., reachability) + // Otherwise, should be "empty" cases, so keep original as a default + List> enablers = n.blocks.stream().map(x -> visitSeq(x)) + .collect(Collectors.toList()); // Each elem is null, empty or isPresent + if (enablers.stream().anyMatch(x -> !x.isPresent())) + { + //return Optional.empty(); + return Optional.of(n.subj); + // CHECKME: can enablers be empty? i.e., choice was "empty" somehow? + // Yes, when not assuming, e.g., empty block filtering by InlinedProject + } + Set rs = enablers.stream().map(x -> x.get()) + .collect(Collectors.toSet()); + return Optional.of(rs.size() > 1 ? n.subj : rs.iterator().next()); + } + + @Override + public Optional visitContinue(Continue n) + { + return this.recs.containsKey(n.recvar) + ? this.recs.get(n.recvar) + : Optional.empty(); + // Empty corner case, e.g., bad sequence after unguarded continue (will be caught be reachability, e.g., bad.reach.globals.gdo.Test04) + // Empty allows (bad) Seq to continue to next element + } + + @Override + public Optional visitDirectedInteraction( + DirectedInteraction n) + { + return Optional.of(n.src); + } + + @Override + public Optional visitDo(Do n) + { + throw new RuntimeException("Unsupported for Do: " + n); + } + + @Override + public Optional visitSeq(LSeq n) + { + for (SType e : n.elems) + { + Optional res = e.visitWithNoThrow(this); + if (res.isPresent()) + { + return res; + } + } + return Optional.empty(); + } + + @Override + protected Optional unit(SType n) + { + return Optional.empty(); + } + + // Currently only used by Recursion, Choice/Seq overrides don't use + @Override + protected Optional agg(SType n, Stream> ts) + { + List> enabs = ts.collect(Collectors.toList()); + if (enabs.stream().anyMatch(x -> !x.isPresent())) + { + return Optional.empty(); + // CHECKME: can enablers be empty? i.e., choice was "empty" somehow? + // Yes, when not assuming, e.g., empty block filtering by InlinedProject + } + Set rs = enabs.stream().map(x -> x.get()) + .collect(Collectors.toSet()); + return rs.size() > 1 ? Optional.empty() : Optional.of(rs.iterator().next()); + } +} \ No newline at end of file diff --git a/scribble-core/src/main/java/org/scribble/core/visit/local/LDoPruner.java b/scribble-core/src/main/java/org/scribble/core/visit/local/LDoPruner.java new file mode 100644 index 000000000..ebc1f717a --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/visit/local/LDoPruner.java @@ -0,0 +1,141 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.visit.local; + +import java.util.Deque; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +import org.scribble.core.job.Core; +import org.scribble.core.lang.SubprotoSig; +import org.scribble.core.lang.local.LProtocol; +import org.scribble.core.type.kind.Local; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Choice; +import org.scribble.core.type.session.Do; +import org.scribble.core.type.session.Recursion; +import org.scribble.core.type.session.SType; +import org.scribble.core.type.session.local.LSeq; +import org.scribble.core.type.session.local.LSkip; +import org.scribble.core.type.session.local.LType; +import org.scribble.core.visit.STypeVisitorNoThrow; + + + +// Pre: LRoleDeclAndDoArgFixer (for LSubprotoVisitorNoThrow visiting pattern) +// Cf. RecPruner +public class LDoPruner //extends DoPruner + extends STypeVisitorNoThrow + implements LSubprotoVisitorNoThrow> +{ + protected final Core core; + + private Role self; + + protected final Deque stack; + + protected final Set unguarded; // Cf. InlinedProjector (unguarded-continue pruning) + + protected LDoPruner(Core core) + { + this.core = core; + this.stack = new LinkedList<>(); + this.unguarded = new HashSet<>(); + } + + protected LDoPruner(LDoPruner v) + { + this.core = v.core; + this.self = v.self; + this.stack = new LinkedList<>(v.stack); + this.unguarded = new HashSet<>(v.unguarded); + } + + // Top-level entry, different to the other visit methods + public LProtocol visitLProtocol(LProtocol n) + { + this.self = n.self; + this.stack.clear(); + this.unguarded.clear(); + + SubprotoSig sig = new SubprotoSig(n); // N.B. overloaded constructor, param type important + this.stack.push(sig); + this.unguarded.add(sig); + LSeq def = visitSeq(n.def); + return n.reconstruct(n.getSource(), n.mods, n.fullname, n.roles, n.self, + n.params, def); + } + + @Override + public SType visitChoice(Choice n) + { + // Duplicated from InlinedProjector.visitChoice + List blocks = n.blocks.stream() + .map(x -> new LDoPruner(this).visitSeq(x)).filter(x -> !x.isEmpty()) + .collect(Collectors.toList()); + if (blocks.isEmpty()) + { + return LSkip.SKIP; // N.B. returning a Seq -- handled by visitSeq (similar to LSkip for locals) + } + this.unguarded.remove(this.stack.peek()); + return n.reconstruct(n.getSource(), n.subj, blocks); + } + + @Override + public SType visitDo(Do n) + { + SubprotoSig sig = new SubprotoSig(n.proto, n.roles, n.args); + if (this.stack.contains(sig)) + { + return this.unguarded.contains(sig) ? LSkip.SKIP : n; + } + + // Duplicated from SubprotoRoleCollector + this.stack.push(sig); + LSeq def = visitSeq(prepareSubprotoForVisit(this.core, n, true)); + // true (passive) to ignore non-fixed ext-choice subjs (e.g., good.efsm.gdo.Test11) + // Changes ultimately discarded: "nested" entries only do "info collection", actual AST modifications only recoded for the top-level Projection (cf. visitProjection) + this.stack.pop(); + return def.isEmpty() ? LSkip.SKIP : n; // Cf. unit(n) + } + + @Override + public SType visitRecursion(Recursion n) + { + LSeq body = visitSeq(n.body); + return body.isEmpty() + ? LSkip.SKIP + : n.reconstruct(n.getSource(), n.recvar, body); + } + + @Override + public LSeq visitSeq(LSeq n) + { + // Duplicated from InlinedProjector.visitSeq + List elems = new LinkedList<>(); + for (LType e : n.getElements()) + { + LType e1 = (LType) e.visitWithNoThrow(this); + if (!(e1 instanceof LSkip)) + { + elems.add(e1); + this.unguarded.clear(); + } + } + return this.core.config.tf.local.LSeq(null, elems); + } +} \ No newline at end of file diff --git a/scribble-core/src/main/java/org/scribble/core/visit/local/LRoleDeclAndDoArgPruner.java b/scribble-core/src/main/java/org/scribble/core/visit/local/LRoleDeclAndDoArgPruner.java new file mode 100644 index 000000000..5dd2a9fd2 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/visit/local/LRoleDeclAndDoArgPruner.java @@ -0,0 +1,171 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.visit.local; + +import java.util.Collections; +import java.util.Deque; +import java.util.LinkedList; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.scribble.core.job.Core; +import org.scribble.core.lang.SubprotoSig; +import org.scribble.core.lang.local.LProjection; +import org.scribble.core.lang.local.LProtocol; +import org.scribble.core.type.kind.Local; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.DirectedInteraction; +import org.scribble.core.type.session.DisconnectAction; +import org.scribble.core.type.session.Do; +import org.scribble.core.type.session.SType; +import org.scribble.core.type.session.local.LSeq; +import org.scribble.core.visit.STypeAggNoThrow; +import org.scribble.core.visit.STypeVisitorNoThrow; +import org.scribble.core.visit.Substitutor; + +// Pre: SubprotoProjector -- "self" fixed for interactions, choice-subjs and do role-args +// Prunes LProto/Proj role decls and do role-args +public class LRoleDeclAndDoArgPruner extends STypeVisitorNoThrow +{ + private final Core core; + + protected LRoleDeclAndDoArgPruner(Core core) + { + this.core = core; + } + + // CHECKME: vf? + protected PreSubprotoRoleCollector newPreRoleCollector() // N.B. "Pre" role collector + { + return new PreSubprotoRoleCollector(this.core); + } + + public LProtocol visitLProtocol(LProtocol n) + { + // N.B. must use PreRoleCollector (on orig), standard subproto traversal not possible yet because target proto role decls not yet fixed (being done now) + Set used = n.def.visitWithNoThrow(newPreRoleCollector()); // CHECKME: vf? + List rs = n.roles.stream() + .filter(x -> used.contains(x) || x.equals(n.self)) // FIXME: self roledecl not actually being a self role is a mess + .collect(Collectors.toList()); + // N.B. *role decls* (cf. do-args) don't feature "self" (cf. LSelfDecl) + LSeq pruned = visitSeq(n.def); + return n.reconstruct(n.getSource(), n.mods, n.fullname, rs, n.self, + n.params, pruned); // CHECKME: prune params? + } + + public Do visitDo(Do n) + { + List fixed = new LinkedList<>(); + Set rs = n.visitWithNoThrow(newPreRoleCollector()); // N.B. does subproto visiting, unlike RoleGatherer + fixed = n.roles.stream() + /*.filter(x -> rs.contains(x) || x.equals(this.self)) + .map(x -> x.equals(this.self) ? Role.SELF : x) // FIXME: self roledecl not actually being a self role is a mess*/ + .filter(x -> rs.contains(x) || x.equals(Role.SELF)) + .collect(Collectors.toList()); + return n.reconstruct(n.getSource(), n.proto, fixed, n.args); // CHECKME: prune args? + } +} + + +// Role collector for pre do-arg pruning (i.e., only for use by LDoArgPruner): +// do-arg arity doesn't yet match target, and "self" not done in do-args (see InlinedProjector.visitDo) +class PreSubprotoRoleCollector extends SubprotoRoleCollector +{ + public PreSubprotoRoleCollector(Core core) + { + super(core); + } + + @Override + public Set visitDo(Do n) + { + SubprotoSig sig = new SubprotoSig(n.proto, n.roles, n.args); + if (this.stack.contains(sig)) + { + return unit(n); // empty set + } + + this.stack.push(sig); + LProjection target = (LProjection) n.getTarget(this.core); + List tmp = this.core.getContext().getInlined(target.global).roles + // Currently, do-args arity matches that of inlined, i.e., not necessarily the arity of the actual local target (cf. InlinedProjector.visitDo) + .stream()//.map(x -> x.equals(target.self) ? Role.SELF : x) + // "self" for do-args not done yet (cf., SubprotoProjector.visitDo), now being fixed by LDoArgPruner + // Cf., LSubprotoVisitorNoThrow.prepareSubprotoForVisit + .collect(Collectors.toList()); + Substitutor subs = this.core.config.vf + .Substitutor(tmp, n.roles, target.params, n.args, true); // true (passive) to ignore "self" // CHECKME: prune args? + Set res = target.def.visitWithNoThrow(subs).visitWithNoThrow(this); + this.stack.pop(); + return res; + } +} + + +// CHECKME: simply integrate into one with PreSubprotoRoleCollector? Or maybe still separately useful? +class SubprotoRoleCollector extends STypeAggNoThrow> + implements LSubprotoVisitorNoThrow> +{ + protected final Core core; + + protected Deque stack = new LinkedList<>(); + + public SubprotoRoleCollector(Core core) + { + this.core = core; + } + + @Override + public Set visitDirectedInteraction(DirectedInteraction n) + { + return Stream.of(n.src, n.dst).collect(Collectors.toSet()); + } + + @Override + public Set visitDisconnect(DisconnectAction n) + { + return Stream.of(n.left, n.right).collect(Collectors.toSet()); + } + + @Override + public Set visitDo(Do n) + { + SubprotoSig sig = new SubprotoSig(n.proto, n.roles, n.args); + if (this.stack.contains(sig)) + { + return unit(n); // empty set + } + + // Cf. LDoPruner.visitDo + this.stack.push(sig); + Set res = prepareSubprotoForVisit(this.core, n) // Non-passive, cf. PreSubprotoRoleCollector + .visitWithNoThrow(this); + this.stack.pop(); + return res; + } + + @Override + protected Set unit(SType n) + { + return Collections.emptySet(); + } + + @Override + protected Set agg(SType n, Stream> ts) + { + return ts.flatMap(x -> x.stream()).collect(Collectors.toSet()); + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/visit/local/LSubprotoVisitorNoThrow.java b/scribble-core/src/main/java/org/scribble/core/visit/local/LSubprotoVisitorNoThrow.java new file mode 100644 index 000000000..f0ea92a1e --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/visit/local/LSubprotoVisitorNoThrow.java @@ -0,0 +1,51 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.visit.local; + +import java.util.List; +import java.util.stream.Collectors; + +import org.scribble.core.job.Core; +import org.scribble.core.lang.local.LProtocol; +import org.scribble.core.type.kind.Local; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Do; +import org.scribble.core.type.session.local.LSeq; +import org.scribble.core.visit.Substitutor; + + +// Pre: LRoleDeclAndDoArgFixer (for imed LProjections) +public interface LSubprotoVisitorNoThrow // T should be SType for STypeVisitor +{ + + // Subclasses of "Inlined" visitors should re-override using prepareSubprotoForVisit -- cf. LSubprotoVisitorNoThrow.super.visitDo(n) + T visitDo(Do n); + + default LSeq prepareSubprotoForVisit(Core core, Do n) + { + return prepareSubprotoForVisit(core, n, false); + } + + default LSeq prepareSubprotoForVisit(Core core, Do n, + boolean passive) + { + LProtocol target = (LProtocol) n.getTarget(core); + List tmp = target.roles.stream() + .map(x -> x.equals(target.self) ? Role.SELF : x) // FIXME: self roledecl not actually being a self role is a mess + .collect(Collectors.toList()); + Substitutor subs = core.config.vf + .Substitutor(tmp, n.roles, target.params, n.args, passive); + return subs.visitSeq(target.def); + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/visit/local/LTypeInliner.java b/scribble-core/src/main/java/org/scribble/core/visit/local/LTypeInliner.java new file mode 100644 index 000000000..edc9b5d68 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/visit/local/LTypeInliner.java @@ -0,0 +1,55 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.visit.local; + +import org.scribble.core.job.Core; +import org.scribble.core.lang.SubprotoSig; +import org.scribble.core.lang.local.LProtocol; +import org.scribble.core.type.kind.Local; +import org.scribble.core.type.name.ProtoName; +import org.scribble.core.type.name.RecVar; +import org.scribble.core.type.session.Do; +import org.scribble.core.type.session.local.LSeq; +import org.scribble.core.type.session.local.LType; +import org.scribble.core.visit.STypeInliner; +import org.scribble.core.visit.Substitutor; + +public class LTypeInliner extends STypeInliner +{ + protected LTypeInliner(Core core) + { + super(core); + } + + @Override + public LType visitDo(Do n) + { + ProtoName fullname = n.proto; + SubprotoSig sig = new SubprotoSig(fullname, n.roles, n.args); + RecVar rv = getInlinedRecVar(sig); + if (hasSig(sig)) + { + return this.core.config.tf.local.LContinue(n.getSource(), rv); + } + pushSig(sig); + LProtocol p = this.core.getContext().getProjection(fullname); // This line differs from GDo version + Substitutor subs = this.core.config.vf.Substitutor(p.roles, + n.roles, p.params, n.args); + //LSeq inlined = (LSeq) p.def.visitWithNoThrow(subs).visitWithNoThrow(this); + LSeq inlined = visitSeq(subs.visitSeq(p.def)); + // i.e. returning a Seq -- rely on parent Seq to inline + popSig(); + return this.core.config.tf.local.LRecursion(null, rv, inlined); + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/visit/local/LTypeUnfolder.java b/scribble-core/src/main/java/org/scribble/core/visit/local/LTypeUnfolder.java new file mode 100644 index 000000000..63fdaa466 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/visit/local/LTypeUnfolder.java @@ -0,0 +1,37 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.visit.local; + +import org.scribble.core.job.Core; +import org.scribble.core.type.kind.Local; +import org.scribble.core.type.session.Continue; +import org.scribble.core.type.session.local.LSeq; +import org.scribble.core.type.session.local.LType; +import org.scribble.core.visit.STypeUnfolder; + +public class LTypeUnfolder extends STypeUnfolder +{ + + protected LTypeUnfolder(Core core) + { + super(core); + } + + @Override + public LType visitContinue(Continue n) + { + return this.core.config.tf.local.LRecursion(n.getSource(), n.recvar, + (LSeq) getRec(n.recvar)); + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/visit/local/LTypeVisitorFactory.java b/scribble-core/src/main/java/org/scribble/core/visit/local/LTypeVisitorFactory.java new file mode 100644 index 000000000..c525340b6 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/visit/local/LTypeVisitorFactory.java @@ -0,0 +1,32 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.visit.local; + +import org.scribble.core.job.Core; + +public interface LTypeVisitorFactory +{ + + InlinedExtChoiceSubjFixer InlinedExtChoiceSubjFixer(); + + ReachabilityChecker ReachabilityChecker(); + + EGraphBuilder EGraphBuilder(Core core); + + LRoleDeclAndDoArgPruner LDoArgPruner(Core core); + + LDoPruner LDoPruner(Core core); + + SubprotoExtChoiceSubjFixer SubprotoExtChoiceSubjFixer(Core core); +} diff --git a/scribble-core/src/main/java/org/scribble/core/visit/local/LTypeVisitorFactoryImpl.java b/scribble-core/src/main/java/org/scribble/core/visit/local/LTypeVisitorFactoryImpl.java new file mode 100644 index 000000000..c39307d12 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/visit/local/LTypeVisitorFactoryImpl.java @@ -0,0 +1,56 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.visit.local; + +import org.scribble.core.job.Core; + +public class LTypeVisitorFactoryImpl implements LTypeVisitorFactory +{ + + @Override + public InlinedExtChoiceSubjFixer InlinedExtChoiceSubjFixer() + { + return new InlinedExtChoiceSubjFixer(); + } + + @Override + public ReachabilityChecker ReachabilityChecker() + { + return new ReachabilityChecker(); + } + + @Override + public EGraphBuilder EGraphBuilder(Core core) + { + return new EGraphBuilder(core); + } + + @Override + public LRoleDeclAndDoArgPruner LDoArgPruner(Core core) + { + return new LRoleDeclAndDoArgPruner(core); + } + + @Override + public LDoPruner LDoPruner(Core core) + { + return new LDoPruner(core); + } + + @Override + public SubprotoExtChoiceSubjFixer SubprotoExtChoiceSubjFixer(Core core) + { + return new SubprotoExtChoiceSubjFixer(core); + } +} diff --git a/scribble-core/src/main/java/org/scribble/core/visit/local/ReachabilityChecker.java b/scribble-core/src/main/java/org/scribble/core/visit/local/ReachabilityChecker.java new file mode 100644 index 000000000..55711faf6 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/visit/local/ReachabilityChecker.java @@ -0,0 +1,148 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.visit.local; + +import java.util.Collections; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +import org.scribble.core.type.kind.Local; +import org.scribble.core.type.name.RecVar; +import org.scribble.core.type.session.Choice; +import org.scribble.core.type.session.Continue; +import org.scribble.core.type.session.Do; +import org.scribble.core.type.session.Recursion; +import org.scribble.core.type.session.SType; +import org.scribble.core.type.session.local.LSeq; +import org.scribble.core.type.session.local.LType; +import org.scribble.core.visit.STypeVisitor; +import org.scribble.util.ScribException; + +// Pre: use on inlined or later (unsupported for Do, also Protocol) +public class ReachabilityChecker extends STypeVisitor +{ + private ReachabilityEnv env; // Immutable + + protected ReachabilityChecker() + { + this.env = new ReachabilityEnv(false, Collections.emptySet()); + } + + @Override + public SType visitChoice(Choice n) + throws ScribException + { + ReachabilityEnv entry = getEnv(); + List blocks = new LinkedList<>(); + ReachabilityChecker nested = new ReachabilityChecker(); + for (LSeq block : n.blocks) + { + nested.setEnv(entry); + nested.visitSeq(block);//block.visitWith(nested); + blocks.add(nested.getEnv()); + } + boolean postcont = blocks.stream().allMatch(x -> x.postcont); // i.e., no exits + Set recvars = blocks.stream().flatMap(x -> x.recvars.stream()) + .collect(Collectors.toSet()); + setEnv(new ReachabilityEnv(postcont, recvars)); + return n; + } + + public SType visitContinue(Continue n) throws ScribException + { + ReachabilityEnv env = getEnv(); + Set tmp = new HashSet<>(env.recvars); + tmp.add(n.recvar); + setEnv(new ReachabilityEnv(true, tmp)); + return n; + } + + @Override + public final SType visitDo(Do n) throws ScribException + { + throw new RuntimeException(this.getClass() + " unsupported for Do: " + n); + } + + @Override + public SType visitRecursion(Recursion n) + throws ScribException + { + n.body.visitWith(this); + ReachabilityEnv env = getEnv(); + if (env.recvars.contains(n.recvar)) + { + Set tmp = new HashSet<>(env.recvars); + tmp.remove(n.recvar); + setEnv(new ReachabilityEnv(env.postcont, tmp)); + } + return n; + } + + @Override + public LSeq visitSeq(LSeq n) + throws ScribException + { + LType prev = null; + LType next = null; + for (Iterator i = n.getElements().iterator(); i.hasNext(); ) + { + prev = next; + next = i.next(); + ReachabilityEnv env = getEnv(); + if (!env.isSeqable()) + { + throw new ScribException( + "Illegal sequence: " + (prev == null ? "" : prev + "\n") + next); + } + next.visitWith(this); + } + return n; + } + + protected ReachabilityEnv getEnv() + { + return this.env; + } + + protected void setEnv(ReachabilityEnv env) + { + this.env = env; + } +} + + +// Immutable +class ReachabilityEnv +{ + // For checking bad sequencing of unreachable code: false after a continue; true if choice has an exit (false inherited for all other constructs) + public final boolean postcont; + + // For checking "reachable code" also satisfies tail recursion (e.g., after choice-with-exit) + public final Set recvars; + + public ReachabilityEnv(boolean postcont, Set recvars) + { + this.postcont = postcont; + this.recvars = Collections.unmodifiableSet(recvars); + } + + public boolean isSeqable() + { + return !this.postcont && this.recvars.isEmpty(); + } +} \ No newline at end of file diff --git a/scribble-core/src/main/java/org/scribble/core/visit/local/SubprotoExtChoiceSubjFixer.java b/scribble-core/src/main/java/org/scribble/core/visit/local/SubprotoExtChoiceSubjFixer.java new file mode 100644 index 000000000..70f546172 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/core/visit/local/SubprotoExtChoiceSubjFixer.java @@ -0,0 +1,101 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.core.visit.local; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; + +import org.scribble.core.job.Core; +import org.scribble.core.lang.Protocol; +import org.scribble.core.type.kind.Local; +import org.scribble.core.type.name.LProtoName; +import org.scribble.core.type.name.Role; +import org.scribble.core.type.session.Do; +import org.scribble.core.type.session.SType; +import org.scribble.core.type.session.local.LSeq; + +// Pre: LRoleDeclAndDoArgFixer (for LSubprotoVisitorNoThrow visiting pattern), LDoPruner (to avoid infinite looping when "stackless" subproto visiting) +// super takes care of rec/continue, here just additionally handle "do" +// A "stackless" subproto visitor, c.f. LDoPruner +public class SubprotoExtChoiceSubjFixer extends InlinedExtChoiceSubjFixer +{ + protected final Core core; + + protected final Map> protos = new HashMap<>(); + + protected SubprotoExtChoiceSubjFixer(Core core) + { + this.core = core; + } + + // To visit top-level proto, reconstruct for fixed subjs -- nested visting (by Inferer) only does passive inference (no reconstruct) + // Must enter here, for initial this.protos entry + public Protocol visitProtocol( + Protocol n) + { + this.protos.clear(); // Reusable + + // Cf. InlinedExtChoiceSubjFixer.visitRecursion + InlinedEnablerInferer v = getInferer(this); + Optional res = v.visitSeq(n.def); + this.protos.put(n.fullname, res); + LSeq def = visitSeq(n.def); + return n.reconstruct(n.getSource(), n.mods, n.fullname, n.roles, n.params, + def); + // N.B. this reconstruct implicitly retains n.self + } + + @Override + protected SubprotoEnablerInferer getInferer(InlinedExtChoiceSubjFixer v) + { + return new SubprotoEnablerInferer(v); + } + + @Override + public SType visitDo(Do n) + { + return unit(n); // From STypeAggNoThrow + } +} + +class SubprotoEnablerInferer extends InlinedEnablerInferer // super takes care of rec/continue + implements LSubprotoVisitorNoThrow> +{ + private final Core core; + + private final Map> protos; + + public SubprotoEnablerInferer(InlinedExtChoiceSubjFixer v) + { + super(v); + SubprotoExtChoiceSubjFixer cast = (SubprotoExtChoiceSubjFixer) v; + this.core = cast.core; + this.protos = Collections.unmodifiableMap(cast.protos); + } + + @Override + public Optional visitDo(Do n) + { + if (this.protos.containsKey(n.proto)) + { + return this.protos.get(n.proto); + } + + // Cf. LDoPruner.visitDo + return visitSeq(prepareSubprotoForVisit(this.core, n, true)); + // true (passive) for fixing ext-choice subjs (e.g., bad.liveness.roleprog.unfair.Test06) + } +} diff --git a/scribble-core/src/main/java/org/scribble/util/AntlrSourceException.java b/scribble-core/src/main/java/org/scribble/util/AntlrSourceException.java new file mode 100644 index 000000000..4ab03191b --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/util/AntlrSourceException.java @@ -0,0 +1,81 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.util; + +import java.util.stream.Collectors; +import java.util.stream.IntStream; + +import org.antlr.runtime.tree.CommonTree; + +public class AntlrSourceException extends Exception +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public AntlrSourceException() + { + // TODO Auto-generated constructor stub + } + + public AntlrSourceException(CommonTree blame, String arg0) + { + // char position indexes are obscure because only certain (child) nodes/tokens are actually recorded, e.g., name nodes (the keyword nodes, e.g., global, have been discarded) + // ...although even taking the above into account, indexes still seem off? -- may be due to tabs (counted as single chars) + super(getRootModuleName(blame) + "(line " + blame.getLine() + ":" + + (blame.getCharPositionInLine()) + "): " + arg0); + // Cf., getTokenStartIndex/getTokenStopIndex ? blame.token.getCharPositionInLine()? + } + + // Cf., AntlrModule/AntlrModuleDecl -- but can't access parser classes from core (Maven dependencies) + protected static String getRootModuleName(CommonTree blame) // Means root of this CommonTree (not the Scribble job root, i.e. main) + { + CommonTree root = blame; + while (root.parent != null) + { + root = root.parent; + } + CommonTree moddecl = (CommonTree) root.getChild(0).getChild(0); + int count = moddecl.getChildCount(); + return IntStream.range(0, count) + .mapToObj(i -> moddecl.getChild(i).getText()) + .collect(Collectors.joining(".")); + } + + public AntlrSourceException(String arg0) + { + super(arg0); + // TODO Auto-generated constructor stub + } + + public AntlrSourceException(Throwable arg0) + { + super(arg0); + // TODO Auto-generated constructor stub + } + + public AntlrSourceException(String arg0, Throwable arg1) + { + super(arg0, arg1); + // TODO Auto-generated constructor stub + } + + public AntlrSourceException(String arg0, Throwable arg1, boolean arg2, + boolean arg3) + { + super(arg0, arg1, arg2, arg3); + // TODO Auto-generated constructor stub + } +} diff --git a/scribble-core/src/main/java/org/scribble/util/Caller.java b/scribble-core/src/main/java/org/scribble/util/Caller.java new file mode 100644 index 000000000..a15dd64c8 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/util/Caller.java @@ -0,0 +1,35 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.util; + +import java.util.concurrent.Callable; + +public class Caller +{ + public T call(Callable c) + { + try + { + return c.call(); + } + catch (Exception e) + { + if (e instanceof RuntimeException) + { + throw ((RuntimeException) e); + } + throw new RuntimeException(e); + } + } +} \ No newline at end of file diff --git a/scribble-core/src/main/java/org/scribble/util/ConnectedMap.java b/scribble-core/src/main/java/org/scribble/util/ConnectedMap.java new file mode 100644 index 000000000..2273b5942 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/util/ConnectedMap.java @@ -0,0 +1,232 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.util; + +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +import org.scribble.core.type.name.Role; + +// FIXME: factor out with MessageIdMap +// FIXME: cf, WFBuffers.connected +// Mutable +public class ConnectedMap +{ + public static enum ConnectedStatus { TRUE, FALSE, AMBIG, } + + // dest -> (src -> isConnected) + private Map> map = new HashMap<>(); + + private static ConnectedStatus convertStatus(boolean b) + { + return b ? ConnectedStatus.TRUE : ConnectedStatus.FALSE; + } + + public ConnectedMap(Set roles, boolean implicit) + { + roles.forEach((k) -> + { + HashMap tmp = new HashMap<>(); + this.map.put(k, tmp); + roles.forEach((k2) -> + { + if (!k.equals(k2)) + { + tmp.put(k2, convertStatus(implicit)); + } + }); + }); + } + + public ConnectedMap(ConnectedMap map) + { + for (Role dest : map.getDestinations()) + { + for (Role src : map.map.get(dest).keySet()) + { + setConnected(dest, src, map.isConnected(dest, src)); + } + } + } + + // FIXME: refactor + public ConnectedMap merge(ConnectedMap them) + { + Map> ours = this.map; + Map> theirs = them.map; + ConnectedMap res = new ConnectedMap(Collections.emptySet(), false); + Set rs = new HashSet<>(ours.keySet()); // keySet should be sufficient + rs.addAll(theirs.keySet()); + for (Role r1 : rs) + { + for (Role r2 : rs) + { + if (this.containsRolePair(r1, r2)) + { + ConnectedStatus c1 = ours.get(r1).get(r2); + if (them.containsRolePair(r1, r2)) + { + ConnectedStatus c2 = theirs.get(r1).get(r2); + ConnectedStatus c = (c1 == c2) ? c1 : ConnectedStatus.AMBIG; + res.setConnected(r1, r2, c); + } + else + { + res.setConnected(r1, r2, c1); + } + } + else if (them.containsRolePair(r1, r2)) + { + ConnectedStatus c2 = theirs.get(r1).get(r2); + res.setConnected(r1, r2, c2); + } + } + } + /*/ + ConnectedMap res = new ConnectedMap(this); + for (Role r1 : them.getDestinations()) + { + for (Role r2 : them.getSources(r1)) + { + ConnectedStatus c2 = them.map.get(r1).get(r2); + if (this.containsRolePair(r1, r2)) + { + ConnectedStatus c1 = res.map.get(r1).get(r2); + ConnectedStatus c = (c1 == c2) ? c1 : ConnectedStatus.AMBIG; + res.setConnected(r1, r2, c); + } + else + { + res.setConnected(r1, r2, c2); + } + } + } + //*/ + return res; + } + + public void connect(Role dest, Role src) + { + setConnected(dest, src, true); + } + + public void disconnect(Role dest, Role src) + { + setConnected(dest, src, false); + } + + protected void setConnected(Role dest, Role src, ConnectedStatus status) + { + addRolePair(dest, src); + //this.map.get(dest).put(src, isConnected); + ConnectedStatus b = status; + this.map.get(dest).put(src, b); + addRolePair(src, dest); + this.map.get(src).put(dest, b); + } + + public void setConnected(Role dest, Role src, boolean isConnected) + { + setConnected(dest, src, convertStatus(isConnected)); + } + + public Set getDestinations() + { + return this.map.keySet(); + } + + public boolean containsDestination(Role dest) + { + return this.map.containsKey(dest); + } + + public Set getSources(Role dest) + { + return this.map.containsKey(dest) ? this.map.get(dest).keySet() : Collections.emptySet(); + } + + // FIXME: null guards not needed any more + public boolean isConnected(Role dest, Role src) + { + //Map tmp = this.map.get(dest); + Map tmp = this.map.get(dest); + if (tmp != null) + { + /*Boolean b = tmp.get(src); + return b != null && b;*/ + ConnectedStatus b = tmp.get(src); + return b == ConnectedStatus.TRUE; + } + return false; + } + + public boolean containsRolePair(Role dest, Role src) + { + return this.map.keySet().contains(dest) && this.map.get(dest).containsKey(src); + } + + public void clear() + { + this.map.clear(); + } + + private void addRolePair(Role dest, Role src) + { + if (!this.map.containsKey(dest)) + { + //Map map = new HashMap<>(); + Map map = new HashMap<>(); + this.map.put(dest, map); + //map.put(src, false); + map.put(src, ConnectedStatus.FALSE); + } + else if (!this.map.get(dest).containsKey(src)) + { + //this.map.get(dest).put(src, false); + //this.map.get(dest).put(src, false); + this.map.get(dest).put(src, ConnectedStatus.FALSE); + } + } + + @Override + public String toString() + { + return this.map.toString(); + } + + @Override + public int hashCode() + { + int hash = 1033; + hash = 31 * hash + super.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (o == null) + { + return false; + } + if (!(o instanceof ConnectedMap)) + { + return false; + } + return this.map.equals(((ConnectedMap) o).map); + } +} diff --git a/scribble-core/src/main/java/org/scribble/util/Constants.java b/scribble-core/src/main/java/org/scribble/util/Constants.java new file mode 100644 index 000000000..610243763 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/util/Constants.java @@ -0,0 +1,60 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.util; + + +// FIXME: cannot use Antlr constants from org.scribble.parser (e.g., ScribbleParser) due to Maven dependency restrictions +public class Constants +{ + public static final String SCRIBBLE_FILE_EXTENSION = "scr"; // Used within core to obtain path from ModuleName for imports + + // Duplicated from AntlrConstants due to Maven dependency restrictions + public static final String MODULE_KW = "module"; + public static final String IMPORT_KW = "import"; + public static final String DATA_KW = "data"; + public static final String TYPE_KW = "type"; // CHECKME: deprecate ? + public static final String PROTOCOL_KW = "protocol"; + public static final String GLOBAL_KW = "global"; + public static final String LOCAL_KW = "local"; + public static final String ROLE_KW = "role"; + public static final String ACCEPT_KW = "accept"; + public static final String SELF_KW = "self"; + public static final String SIG_KW = "sig"; + public static final String INSTANTIATES_KW = "instantiates"; + public static final String AS_KW = "as"; + + public static final String CONNECT_KW = "connect"; + public static final String DISCONNECT_KW = "disconnect"; + public static final String WRAP_KW = "wrap"; + public static final String FROM_KW = "from"; + public static final String TO_KW = "to"; + public static final String CHOICE_KW = "choice"; + public static final String AT_KW = "at"; + public static final String OR_KW = "or"; + public static final String REC_KW = "rec"; + public static final String CONTINUE_KW = "continue"; + //public static final String PAR_KW = "par"; + public static final String AND_KW = "and"; + /*public static final String INTERRUPTIBLE_KW = "interruptible"; + public static final String WITH_KW = "with"; + public static final String BY_KW = "by"; + public static final String THROWS_KW = "throws"; + public static final String CATCHES_KW = "catches";*/ + public static final String DO_KW = "do"; + //public static final String SPAWN_KW = "spawn"; + + public static final String REQUEST_KW = "request"; + public static final String CLIENTWRAP_KW = "cwrap"; + public static final String SERVERWRAP_KW = "swrap"; +} diff --git a/scribble-core/src/main/java/org/scribble/util/MessageIdMap.java b/scribble-core/src/main/java/org/scribble/util/MessageIdMap.java new file mode 100644 index 000000000..6f8e95dc6 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/util/MessageIdMap.java @@ -0,0 +1,157 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.util; + +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +import org.scribble.core.type.name.MsgId; +import org.scribble.core.type.name.Role; + +// Mutable +public class MessageIdMap +{ + // dest -> (src -> mids) + private Map>>> map = new HashMap<>(); + + public MessageIdMap() + { + + } + + public MessageIdMap(MessageIdMap map) + { + for (Role dest : map.getDestinations()) + { + for (Role src : map.map.get(dest).keySet()) + { + putMessages(dest, src, map.getMessages(dest, src)); + } + } + } + + /*public void merge(MessageIdMap map) + { + for (Role dest : map.getDestinations()) + { + for (Role src : map.getSources(dest)) + { + putMessages(dest, src, map.getMessages(dest, src)); + } + } + }*/ + + public void putMessage(Role dest, Role src, MsgId msg) + { + addRolePair(dest, src); + this.map.get(dest).get(src).add(msg); + } + + /*public void removeMessage(Role dest, Role src, MessageId msg) + { + addRolePair(dest, src); + this.map.get(dest).get(src).remove(msg); + }*/ + /*public void removeMessages(Role dest) + { + Map>> tmp = this.map.get(dest); + for (Role r : tmp.keySet()) + { + tmp.remove(r); + } + }*/ + + public void putMessages(Role dest, Role src, Set> msgs) + { + addRolePair(dest, src); + this.map.get(dest).get(src).addAll(msgs); + } + + public Set getDestinations() + { + return this.map.keySet(); + } + + public boolean containsDestination(Role dest) + { + return this.map.containsKey(dest); + } + + /*public boolean containsSource(Role src) + { + return getAllSources().contains(src); + }*/ + + public Set getSources(Role dest) + { + return this.map.containsKey(dest) ? this.map.get(dest).keySet() : Collections.emptySet(); + } + + /*public Set getAllSources() + { + Set srcs = new HashSet<>(); + this.map.keySet().forEach((dest) -> srcs.addAll(this.map.get(dest).keySet())); + return srcs; + }*/ + + public Set> getMessages(Role dest, Role src) + { + return this.map.get(dest).get(src); + } + + public Set> getMessages(Role dest) + { + Set> tmp = new HashSet<>(); + getSources(dest).forEach((src) -> tmp.addAll(getMessages(dest, src))); + return tmp; + } + + public boolean containsRolePair(Role dest, Role src) + { + return this.map.keySet().contains(dest) && this.map.get(dest).containsKey(src); + } + + /*public boolean containsMessageSignature(Role dest, Role src, Message msg) + { + return containsRolePair(dest, src) && getMessages(dest, src).contains(msg); + }*/ + + public void clear() + { + this.map.clear(); + } + + private void addRolePair(Role dest, Role src) + { + if (!this.map.containsKey(dest)) + { + Map>> map = new HashMap<>(); + this.map.put(dest, map); + map.put(src, new HashSet<>()); + } + else if (!this.map.get(dest).containsKey(src)) + { + this.map.get(dest).put(src, new HashSet<>()); + } + } + + @Override + public String toString() + { + return this.map.toString(); + } +} diff --git a/scribble-core/src/main/java/org/scribble/util/Pair.java b/scribble-core/src/main/java/org/scribble/util/Pair.java new file mode 100644 index 000000000..249590cb1 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/util/Pair.java @@ -0,0 +1,50 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.util; + +public class Pair +{ + public final T1 left; + public final T2 right; + + public Pair(T1 t1, T2 t2) + { + this.left = t1; + this.right = t2; + } + + @Override + public int hashCode() + { + int hash = 11; + hash = 31 * hash + this.left.hashCode(); + hash = 31 * hash + this.right.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof Pair)) + { + return false; + } + Pair them = (Pair) o; + return this.left.equals(them.left) && this.right.equals(them.right); + } +} diff --git a/scribble-core/src/main/java/org/scribble/util/RuntimeScribException.java b/scribble-core/src/main/java/org/scribble/util/RuntimeScribException.java new file mode 100644 index 000000000..a67e31bda --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/util/RuntimeScribException.java @@ -0,0 +1,62 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.util; + +import org.antlr.runtime.tree.CommonTree; + +public class RuntimeScribException extends RuntimeException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public RuntimeScribException(CommonTree blame, String arg0) + { + // Duplicated from AntlrSourceException + super(AntlrSourceException.getRootModuleName(blame) + "(line " + + blame.getLine() + ":" + (blame.getCharPositionInLine()) + "): " + + arg0); + } + + public RuntimeScribException() + { + // TODO Auto-generated constructor stub + } + + public RuntimeScribException(String arg0) + { + super(arg0); + // TODO Auto-generated constructor stub + } + + public RuntimeScribException(Throwable arg0) + { + super(arg0); + // TODO Auto-generated constructor stub + } + + public RuntimeScribException(String arg0, Throwable arg1) + { + super(arg0, arg1); + // TODO Auto-generated constructor stub + } + + public RuntimeScribException(String arg0, Throwable arg1, boolean arg2, + boolean arg3) + { + super(arg0, arg1, arg2, arg3); + // TODO Auto-generated constructor stub + } +} diff --git a/scribble-core/src/main/java/org/scribble/util/ScribException.java b/scribble-core/src/main/java/org/scribble/util/ScribException.java new file mode 100644 index 000000000..4ff805c57 --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/util/ScribException.java @@ -0,0 +1,59 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.util; + +import org.antlr.runtime.tree.CommonTree; + +public class ScribException extends AntlrSourceException +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public ScribException(CommonTree blame, String arg0) + { + super(blame, arg0); + } + + public ScribException() + { + // TODO Auto-generated constructor stub + } + + public ScribException(String arg0) + { + super(arg0); + // TODO Auto-generated constructor stub + } + + public ScribException(Throwable arg0) + { + super(arg0); + // TODO Auto-generated constructor stub + } + + public ScribException(String arg0, Throwable arg1) + { + super(arg0, arg1); + // TODO Auto-generated constructor stub + } + + public ScribException(String arg0, Throwable arg1, boolean arg2, + boolean arg3) + { + super(arg0, arg1, arg2, arg3); + // TODO Auto-generated constructor stub + } +} diff --git a/scribble-core/src/main/java/org/scribble/util/ScribParserException.java b/scribble-core/src/main/java/org/scribble/util/ScribParserException.java new file mode 100644 index 000000000..662d23f5d --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/util/ScribParserException.java @@ -0,0 +1,53 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.util; + +// CHECKME: should be in parser module? -- maybe make a ModuleLoadingException wrapper? +public class ScribParserException extends Exception +{ + /** + * + */ + private static final long serialVersionUID = 1L; + + public ScribParserException() + { + // TODO Auto-generated constructor stub + } + + public ScribParserException(String arg0) + { + super(arg0); + // TODO Auto-generated constructor stub + } + + public ScribParserException(Throwable arg0) + { + super(arg0); + // TODO Auto-generated constructor stub + } + + public ScribParserException(String arg0, Throwable arg1) + { + super(arg0, arg1); + // TODO Auto-generated constructor stub + } + + public ScribParserException(String arg0, Throwable arg1, boolean arg2, + boolean arg3) + { + super(arg0, arg1, arg2, arg3); + // TODO Auto-generated constructor stub + } +} diff --git a/scribble-core/src/main/java/org/scribble/util/ScribUtil.java b/scribble-core/src/main/java/org/scribble/util/ScribUtil.java new file mode 100644 index 000000000..94002fd7f --- /dev/null +++ b/scribble-core/src/main/java/org/scribble/util/ScribUtil.java @@ -0,0 +1,91 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.util; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.concurrent.Callable; + +public class ScribUtil +{ + public static T handleLambdaScribbleException(Callable c) + { + try + { + return c.call(); + } + catch (Exception se) + { + throw new RuntimeScribException(se); + // Maybe this hack is not worth it? Better to throw directly as ScribbleException from a regular foreach + } + } + + // Returns [ stdout, stderr ] + public static String[] runProcess(String... cmdAndArgs) + throws ScribException + { + try + { + ProcessBuilder pb = new ProcessBuilder(cmdAndArgs); + Process p = pb.start(); + p.waitFor(); + + InputStream is = p.getInputStream(), eis = p.getErrorStream(); + InputStreamReader isr = new InputStreamReader(is); + InputStreamReader eisr = new InputStreamReader(eis); + BufferedReader br = new BufferedReader(isr); + BufferedReader ebr = new BufferedReader(eisr); + String stdout = "", stderr = "", line; + while ((line = br.readLine()) != null) + { + stdout += line + "\n"; + } + while ((line = ebr.readLine()) != null) + { + stderr += line + "\n"; + } + return new String[] { stdout, stderr }; + } + catch (IOException | InterruptedException e) + { + throw new ScribException(e); + } + } + + // Warning: doesn't check if file exists + public static void writeToFile(String path, String text) + throws ScribException + { + File file = new File(path); + File parent = file.getParentFile(); + if (parent != null) + { + parent.mkdirs(); + } + //try (Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), "utf-8"))) // Doesn't create missing directories + try (FileWriter writer = new FileWriter(file)) + { + writer.write(text); + } + catch (IOException e) + { + throw new ScribException(e); + } + } +} diff --git a/scribble-core/src/main/resources/org/scribble/protocol/Messages.properties b/scribble-core/src/main/resources/org/scribble/protocol/Messages.properties new file mode 100644 index 000000000..b291d4c92 --- /dev/null +++ b/scribble-core/src/main/resources/org/scribble/protocol/Messages.properties @@ -0,0 +1,32 @@ +# +# Copyright 2008 The Scribble Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except +# in compliance with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License +# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +# or implied. See the License for the specific language governing permissions and limitations under +# the License. +# + +# Export messages +_EXPORT_FAILED=Export failed due to: {0} + +# Validation rule messages +_AMBIGUOUS_CHOICE=Choice is ambiguous, multiple paths have a common interaction(s) ''{0}'' +_CANNOT_USE_RESERVED_WORD= Name ''{0}'' is a reserved word +_EXISTING_DECLARATION=Declaration already exists for name ''{0}'' +_NO_ENCLOSING_RECUR=No enclosing block found with label ''{0}'' +_NO_TYPE_IMPORT=Import statement does not exist for type ''{0}'' +_NOT_FOUND_BOUND_DECLARATION=Bound declaration ''{0}'' not found in definition ''{1}'' +_NOT_FOUND_REFERENCE=Definition ''{0}'' of type ''{1}'' could not be found +_INTERACTION_ROLE=Interaction needs to define a ''{0}'' role +_NAME_ALREADY_DEFINED=Name ''{0}'' has already been declared +_RAISED_TYPE_NOT_CAUGHT=Raised type ''{0}'' is not caught within the enclosing definition +_UNKNOWN_ROLE=Unknown role ''{0}'' +_UNCONNECTED_ROLE=Activity at role ''{0}'' is not connected to preceding activities +_UNPROJECTABLE_ROLES=Role(s) ''{0}'' cannot be projected +_UNRELATED_TO_LOCATED_ROLE=Unrelated to located role ''{0}'' diff --git a/scribble-demos/pom.xml b/scribble-demos/pom.xml new file mode 100644 index 000000000..7e15c327b --- /dev/null +++ b/scribble-demos/pom.xml @@ -0,0 +1,61 @@ + + + 4.0.0 + + + scribble-demos + jar + + + + org.scribble + scribble-core + + + org.scribble + scribble-parser + + + org.scribble + scribble-runtime + + + + + org.scribble + parent + 0.5.1-SNAPSHOT + ../pom.xml + + + + + + + + com.mycila + license-maven-plugin + + + **/*.scr + **/*.java + **/*.policy + **/*.xml + **/*.html + **/stylesheet.css + **/script.js + **/package-list + **/*.versionsBackup + **/Makefile.copyme + **/Makefile + + + + + + + + scribble-demos + + diff --git a/scribble-demos/scrib/Makefile.copyme b/scribble-demos/scrib/Makefile.copyme new file mode 100644 index 000000000..a2dd28a38 --- /dev/null +++ b/scribble-demos/scrib/Makefile.copyme @@ -0,0 +1,300 @@ +# +# Copyright 2008 The Scribble Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except +# in compliance with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License +# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +# or implied. See the License for the specific language governing permissions and limitations under +# the License. +# + +SCRIBBLE_HOME ?= ../.. +SCRIBBLEC ?= $(SCRIBBLE_HOME)/scribblec.sh +JAVAC = javac + +.PHONY: help +help: + @echo "Set \$$SCRIBBLE_HOME (as for scribblec.sh), and \$$SCRIBBLEC to scribblec.sh." + @echo "Example usages:" + @echo " make tutorial" + @echo " make clean-tutorial" + @echo " make all" + @echo " make clean-all" + +.PHONY: all +all: betty16 bettybook coco fase16 fib game http loan nego rpc smtp threebuyer travel tutorial twobuyer fase17 supplierinfo highlow + +.PHONY: clean-all +clean-all: clean-betty16 clean-bettybook clean-coco clean-fase16 clean-fib clean-http clean-loan clean-smtp clean-travel clean-tutorial clean-fase17 clean-highlow + +.PHONY: betty16 +betty16: + @$(call scribc_apigen2,betty16/src,betty16/lec1/httplong/HttpLong.scr,Http,C,S) + @$(call javac,betty16/src,betty16/lec1/httplong/HttpLongC.java) + @$(call javac,betty16/src,betty16/lec1/httplong/HttpLongS.java) + @$(call scribc_apigen2,betty16/src,betty16/lec1/httpshort/HttpShort.scr,Http,C,S) + @$(call javac,betty16/src,betty16/lec1/httpshort/HttpShortC.java) + @$(call javac,betty16/src,betty16/lec1/httpshort/HttpShortS.java) + @$(call scribc_ko,betty16/src/betty16/lec1/misc/Choice1.scr) + @$(call scribc_ok,betty16/src/betty16/lec1/misc/Choice2.scr) + @$(call scribc_ko,betty16/src/betty16/lec1/misc/Choice3.scr) + @$(call scribc_ko,betty16/src/betty16/lec1/misc/Choice4.scr) + @$(call scribc_ok,betty16/src/betty16/lec1/misc/LocatedChoice.scr) + @$(call scribc_ok,betty16/src/betty16/lec1/misc/LocatedChoice2.scr) + @$(call scribc_ok,betty16/src/betty16/lec1/misc/Messaging.scr) + @$(call scribc_ok,betty16/src/betty16/lec1/misc/Protocol1a.scr) + @$(call scribc_ko,betty16/src/betty16/lec1/misc/Protocol1b.scr) + @$(call scribc_ko,betty16/src/betty16/lec1/misc/Protocol1c.scr) + @$(call scribc_ko,betty16/src/betty16/lec1/misc/Protocol2.scr) + @$(call scribc_ko,betty16/src/betty16/lec1/misc/Recursion1.scr) + @$(call scribc_ko,betty16/src/betty16/lec1/misc/Recursion2.scr) + @$(call scribc_ok,betty16/src/betty16/lec1/misc/Recursion3.scr) + @$(call scribc_ko,betty16/src/betty16/lec1/misc/RoleEnabling.scr) + @$(call scribc_ok,betty16/src/betty16/lec1/nego/Negotiate.scr) + +.PHONY: clean-betty16 +clean-betty16: + @$(call rm_apigen,betty16/src,betty16/lec1/httplong/HttpLong,Http) + @$(call rm_apigen,betty16/src,betty16/lec1/httpshort/HttpShort,Http) + +.PHONY: bettybook +bettybook: + @$(call scribc_apigen2,bettybook/src,bettybook/http/longv/HttpLong.scr,Http,C,S) + @$(call javac,bettybook/src,bettybook/http/longv/HttpLongC.java) + @$(call javac,bettybook/src,bettybook/http/longv/HttpLongS.java) + @$(call scribc_apigen2,bettybook/src,bettybook/http/shortv/HttpShort.scr,Http,C,S) + @$(call javac,bettybook/src,bettybook/http/shortv/HttpShortC.java) + @$(call javac,bettybook/src,bettybook/http/shortv/HttpShortS.java) + @$(call scribc_apigen2,bettybook/src,bettybook/math/scrib/Math.scr,MathService,C,S) + @$(call javac,bettybook/src,bettybook/math/scrib/MathC.java) + @$(call javac,bettybook/src,bettybook/math/scrib/MathS1.java) + @$(call javac,bettybook/src,bettybook/math/scrib/MathS2.java) + +.PHONY: clean-bettybook +clean-bettybook: + @$(call rm_apigen,bettybook/src,bettybook/http/longv/HttpLong,Http) + @$(call rm_apigen,bettybook/src,bettybook/http/shortv/HttpShort,Http) + @$(call rm_apigen,bettybook/src,bettybook/math/scrib/Math,MathService) + +.PHONY: coco +coco: + @$(call scribc_apigen2,coco/src,coco/fibo/Fibo.scr,Fibonacci,A,B) + @$(call javac,coco/src,coco/fibo/FiboMain.java) + @$(call scribc_apigen2,coco/src,coco/smtp/Smtp.scr,Smtp,C,S) + @$(call javac,coco/src,coco/smtp/SmtpC1.java) + @$(call javac,coco/src,coco/smtp/SmtpC2.java) + @$(call javac,coco/src,coco/smtp/SmtpC3.java) + +.PHONY: clean-coco +clean-coco: + @$(call rm_apigen,coco/src,coco/fibo/Fibo,Fibonacci) + @$(call rm_apigen,coco/src,coco/smtp/Smtp,Smtp) + +.PHONY: fase16 +fase16: + @$(call scribc_apigen2,fase16/src,fase16/adder/Adder.scr,Adder,C,S) + @$(call javac,fase16/src,fase16/adder/AdderC.java) + @$(call javac,fase16/src,fase16/adder/AdderS.java) + @$(call scribc_apigen2,fase16/src,fase16/smtp/Smtp.scr,Smtp,C,S) + @$(call javac,fase16/src,fase16/smtp/SmtpC.java) + +.PHONY: clean-fase16 +clean-fase16: + @$(call rm_apigen,fase16/src,fase16/adder/Adder,Adder) + @$(call rm_apigen,fase16/src,fase16/smtp/Smtp,Smtp) + +.PHONY: fib +fib: + @$(call scribc_apigen2,fib/src,fib/Fib.scr,Adder,C,S) + @$(call javac,fib/src,fib/AdderClient.java) + @$(call javac,fib/src,fib/AdderServer.java) + @$(call javac,fib/src,fib/FibClient.java) + @$(call scribc_apigen2,fib/src,fib/Fib.scr,Fibonacci,A,B) + @$(call javac,fib/src,fib/Fibo.java) + +.PHONY: clean-fib +clean-fib: +#$(call rm_apigen,fib/src,fib/Fib,Adder) + @rm -rf fib/src/fib/Fib/Adder # HACK + @$(call rm_apigen,fib/src,fib/Fib,Fibonacci) + +.PHONY: game +game: + @$(call scribc_ok,game/src/game/Game1.scr) + @$(call scribc_ok,game/src/game/Game2.scr) + +.PHONY: http +http: + @$(call scribc_apigen2,http/src,http/longvers/HttpLong.scr,Http,C,S) + @$(call javac,http/src,http/longvers/HttpLongC.java) + @$(call javac,http/src,http/longvers/HttpLongS.java) + @$(call scribc_apigen2,http/src,http/shortvers/HttpShort.scr,Http,C,S) + @$(call javac,http/src,http/shortvers/HttpShortC.java) + @$(call javac,http/src,http/shortvers/HttpShortS.java) + +.PHONY: clean-http +clean-http: + @$(call rm_apigen,http/src,http/longvers/HttpLong,Http) + @$(call rm_apigen,http/src,http/shortvers/HttpShort,Http) + +.PHONY: loan +loan: + @$(call scribc_apigen4,loan/src,loan/LoanApplication.scr,BuyerBrokerSupplier,Applicant,ApplicationPortal,ProcessingDept,FinanceDept) + @$(call javac,loan/src,loan/LoanApplicant.java) + @$(call javac,loan/src,loan/LoanApplicationPortal.java) + @$(call javac,loan/src,loan/LoanFinanceDept.java) + @$(call javac,loan/src,loan/LoanProcessingDept.java) + +.PHONY: clean-loan +clean-loan: + @$(call rm_apigen,loan/src,loan/LoanApplication,BuyerBrokerSupplier) + +.PHONY: nego +nego: + @$(call scribc_ok,nego/src/nego/Nego1.scr) + @$(call scribc_ok,nego/src/nego/Nego2.scr) + @$(call scribc_ok,nego/src/nego/Nego3.scr) + +.PHONY: rpc +rpc: + @$(call scribc_ok,rpc/src/rpc/RPC.scr) + +.PHONY: smtp +smtp: + @$(call scribc_apigen2,smtp/src,smtp/Smtp.scr,Smtp,C,S,-subtypes) + @$(call javac,smtp/src,smtp/SimpleSmtpC.java) + @$(call javac,smtp/src,smtp/SmtpC.java) + +.PHONY: clean-smtp +clean-smtp: + @$(call rm_apigen,smtp/src,smtp/Smtp,Smtp) + +.PHONY: threebuyer +threebuyer: + @$(call scribc_ok,threebuyer/src/threebuyer/ThreeBuyer.scr) + @$(call scribc_ok,threebuyer/src/threebuyer/ThreeBuyer2.scr) + +.PHONY: travel +travel: + @$(call scribc_apigen3,travel/src,travel/Travel.scr,Booking,A,C,S) + @$(call javac,travel/src,travel/BookingA.java) + @$(call javac,travel/src,travel/BookingC.java) + @$(call javac,travel/src,travel/BookingS.java) + +.PHONY: clean-travel +clean-travel: + @$(call rm_apigen,travel/src,travel/Travel,Booking) + +.PHONY: tutorial +tutorial: + @$(call scribc_apigen2,tutorial/src,tutorial/adder/Adder.scr,Adder,C,S) + @$(call javac,tutorial/src,tutorial/adder/AdderC.java) + @$(call javac,tutorial/src,tutorial/adder/AdderS.java) + +.PHONY: clean-tutorial +clean-tutorial: + @$(call rm_apigen,tutorial/src,tutorial/adder/Adder,Adder) + +.PHONY: twobuyer +twobuyer: + @$(call scribc_ok,twobuyer/src/twobuyer/TwoBuyer.scr) + +.PHONY: fase17 +fase17: + @$(call scribc_ko,$(SCRIBBLE_HOME)/scribble-test/src/test/scrib/demo/fase17/intro/FirstL.scr) + @$(call scribc_ok,$(SCRIBBLE_HOME)/scribble-test/src/test/scrib/demo/fase17/intro/FirstL.scr,-fair) + @$(call scribc_ko,$(SCRIBBLE_HOME)/scribble-test/src/test/scrib/demo/fase17/overview/P1.scr) + @$(call scribc_apigen3,$(SCRIBBLE_HOME)/scribble-test/src/test/scrib,demo/fase17/travel/TravelAgent.scr,TravelAgent,A,C,S) + @$(call javac,$(SCRIBBLE_HOME)/scribble-test/src/test/scrib,demo/fase17/travel/TravelA.java) + @$(call javac,$(SCRIBBLE_HOME)/scribble-test/src/test/scrib,demo/fase17/travel/TravelC.java) + @$(call javac,$(SCRIBBLE_HOME)/scribble-test/src/test/scrib,demo/fase17/travel/TravelS.java) + @$(call scribc_apigen3,$(SCRIBBLE_HOME)/scribble-test/src/test/scrib,demo/fase17/travel2/TravelAgent2.scr,TravelAgent2,A,C,S) + @$(call javac,$(SCRIBBLE_HOME)/scribble-test/src/test/scrib,demo/fase17/travel2/Travel2A.java) + @$(call javac,$(SCRIBBLE_HOME)/scribble-test/src/test/scrib,demo/fase17/travel2/Travel2C.java) + @$(call javac,$(SCRIBBLE_HOME)/scribble-test/src/test/scrib,demo/fase17/travel2/Travel2S.java) + +.PHONY: clean-fase17 +clean-fase17: + @$(call rm_apigen,$(SCRIBBLE_HOME)/scribble-test/src/test/scrib,demo/fase17/travel/TravelAgent,TravelAgent) + @$(call rm_apigen,$(SCRIBBLE_HOME)/scribble-test/src/test/scrib,demo/fase17/travel2/TravelAgent2,TravelAgent2) + +.PHONY: supplierinfo +supplierinfo: + @$(call scribc_ok,$(SCRIBBLE_HOME)/scribble-test/src/test/scrib/demo/supplierinfo/SupplierInfoExplicit.scr,-fair) + @$(call scribc_ok,$(SCRIBBLE_HOME)/scribble-test/src/test/scrib/demo/supplierinfo/SupplierInfoNoFair.scr) + +.PHONY: highlow +highlow: + @$(call scribc_apigen3,$(SCRIBBLE_HOME)/scribble-test/src/test/scrib/demo/,highlow/HighLow.scr,HighLow,A,B,C) + @$(call scribc_cbapigen3,$(SCRIBBLE_HOME)/scribble-test/src/test/scrib/demo/,highlow/HighLow.scr,HighLow,A,B,C) + @$(call javac,$(SCRIBBLE_HOME)/scribble-test/src/test/scrib/demo,highlow/HighLowA.java) + @$(call javac,$(SCRIBBLE_HOME)/scribble-test/src/test/scrib/demo,highlow/HighLowB.java) + @$(call javac,$(SCRIBBLE_HOME)/scribble-test/src/test/scrib/demo,highlow/HighLowC.java) + @$(call javac,$(SCRIBBLE_HOME)/scribble-test/src/test/scrib/demo,highlow/cb/MyA.java) + @$(call javac,$(SCRIBBLE_HOME)/scribble-test/src/test/scrib/demo,highlow/cb/MyB.java) + @$(call javac,$(SCRIBBLE_HOME)/scribble-test/src/test/scrib/demo,highlow/cb/MyC.java) + +.PHONY: clean-highlow +clean-highlow: + @$(call rm_apigen,$(SCRIBBLE_HOME)/scribble-test/src/test/scrib/demo/,highlow/HighLow,HighLow) + + +# filename, extra +define scribc_ok + echo "Validate OK: "$(1); \ + $(SCRIBBLEC) $(1) $(2) +endef + +# filename +define scribc_ko + echo "Validate KO: "$(1); \ + $(SCRIBBLEC) $(1) 2> /dev/null; \ + EXIT=$$?; if [ $$EXIT -eq 0 ]; then \ + echo "Expected protocol validation error, but none occurred."; \ + exit 1; \ + fi; +endef + +# dir, filename, proto, role1, role2, extra +define scribc_apigen2 + echo "API gen: "$(1)"/"$(2)", "$(3)" @ "$(4)", "$(5); \ + $(SCRIBBLEC) -d $(1) $(1)/$(2) -api $(3) $(4) -api $(3) $(5) $(6) +endef + +# dir, filename, proto, role1, role2, role3 +define scribc_apigen3 + echo "API gen: "$(1)"/"$(2)", "$(3)" @ "$(4)", "$(5)", "$(6); \ + $(SCRIBBLEC) -d $(1) $(1)/$(2) -api $(3) $(4) -api $(3) $(5) -api $(3) $(6) +endef + +# dir, filename, proto, role1, role2, role3 +define scribc_cbapigen3 +echo "CB API gen: "$(1)"/"$(2)", "$(3)" @ "$(4)", "$(5)", "$(6); \ + $(SCRIBBLEC) -d $(1) $(1)/$(2) -cbapi $(3) $(4) -cbapi $(3) $(5) -cbapi $(3) $(6) +endef + +# dir, filename, proto, role1, role2, role3, role4 +define scribc_apigen4 + echo "API gen: "$(1)"/"$(2)", "$(3)" @ "$(4)", "$(5)", "$(6)", "$(7); \ + $(SCRIBBLEC) -d $(1) $(1)/$(2) -api $(3) $(4) -api $(3) $(5) -api $(3) $(6) -api $(3) $(7) +endef + +# dir, dir, proto +define rm_apigen + echo "Deleting: "$(1)/$(2)/$(3); \ + rm -rf $(1)/$(2)/$(3); \ + rm -fd $(1)/$(2) +endef + +# dir, filename +define javac + echo "Compiling: "$(1)/$(2); \ + mkdir -p $(SCRIBBLE_HOME)/scribble-demos/target/test-classes; \ + javac -cp $(SCRIBBLE_HOME)/scribble-ast/target/classes:$(SCRIBBLE_HOME)/scribble-cli/target/classes:$(SCRIBBLE_HOME)/scribble-codegen/target/classes:$(SCRIBBLE_HOME)/scribble-core/target/classes:$(SCRIBBLE_HOME)/scribble-main/target/classes:$(SCRIBBLE_HOME)/scribble-parser/target/classes:$(SCRIBBLE_HOME)/scribble-parser/lib/antlr-3.5.2-complete.jar:$(SCRIBBLE_HOME)/scribble-runtime/target/classes:$(1) \ + $(1)/$(2) -d $(SCRIBBLE_HOME)/scribble-demos/target/test-classes +endef + diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/HttpLong.scr b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/HttpLong.scr new file mode 100644 index 000000000..a1fc9349d --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/HttpLong.scr @@ -0,0 +1,212 @@ +/** + * Assuming scribblec.sh in scribble-java root directory: + * + * ./scribblec.sh -d scribble-demos/scrib/betty16/src scribble-demos/scrib/betty16/src/betty16/lec1/httplong/HttpLong.scr -api Http C + * + * $ javadoc -cp scribble-core/target/classes:scribble-runtime/target/classes:scribble-demos/scrib/betty16/src -subpackages betty16.lec1.httplong.HttpLong.Http -d scribble-demos/scrib/betty16/javadoc/httplong + * + */ + + +module betty16.lec1.httplong.HttpLong; + + +sig "betty16.lec1.httplong.message.client.RequestLine" + from "betty16/lec1/httplong/message/RequestLine.java" + as REQUESTL; // GET /~rhu/ HTTP/1.1 + +sig "betty16.lec1.httplong.message.client.Host" + from "betty16/lec1/httplong/message/Host.java" + as HOST; // host: www.doc.ic.ac.uk + +sig "betty16.lec1.httplong.message.Body" + from "betty16/lec1/httplong/message/Body.java" + as BODY; // ... + +sig "betty16.lec1.httplong.message.client.UserAgent" + from "betty16/lec1/httplong/message/UserAgent.java" + as USERA; // User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0 + +sig "betty16.lec1.httplong.message.client.Accept" + from "betty16/lec1/httplong/message/Accept.java" + as ACCEPT; // Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 + +sig "betty16.lec1.httplong.message.client.AcceptLanguage" + from "betty16/lec1/httplong/message/AcceptLanguage.java" + as ACCEPTL; // Accept-Language: en-GB,en;q=0.5 + +sig "betty16.lec1.httplong.message.client.AcceptEncoding" + from "betty16/lec1/httplong/message/AcceptEncoding.java" + as ACCEPTE; // Accept-Encoding: gzip, deflate + +sig "betty16.lec1.httplong.message.client.DoNotTrack" + from "betty16/lec1/httplong/message/DoNotTrack.java" + as DNT; // DNT: 1 + +sig "betty16.lec1.httplong.message.client.Connection" + from "betty16/lec1/httplong/message/Connection.java" + as CONN; // Connection: keep-alive + +sig "betty16.lec1.httplong.message.client.UpgradeInsecureRequests" + from "betty16/lec1/httplong/message/UpgradeInsecureRequests.java" + as UPGRADEIR; // Upgrade-Insecure-Requests: 1 + +sig "betty16.lec1.httplong.message.client.Cookie" + from "betty16/lec1/httplong/message/Cookie.java" + as COOKIE; // Cookie: __utma=111872281.1372348290.1498163262.1498163262.1498163262.1; __utmz=111872281.1498163262.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none) + +sig "betty16.lec1.httplong.message.client.Pragma" + from "betty16/lec1/httplong/message/Pragma.java" + as PRAGMA; // Pragma: no-cache + +/*sig "betty16.lec1.httplong.message.client.CacheControl" + from "betty16/lec1/httplong/message/CacheControl.java" + as CACHEC; // Cache-Control: max-age=0*/ + + +sig "betty16.lec1.httplong.message.server.HttpVersion" + from "betty16/lec1/httplong/message/HttpVersion.java" + as HTTPV; // HTTP/1.1 + +sig "betty16.lec1.httplong.message.server._200" // "Status" line (with HTTPV) + from "betty16/lec1/httplong/message/_200.java" + as 200; // 200 OK + +sig "betty16.lec1.httplong.message.server._404" + from "betty16/lec1/httplong/message/_404.java" + as 404; + +sig "betty16.lec1.httplong.message.server.Date" + from "betty16/lec1/httplong/message/Date.java" + as DATE; // Date: Sun, 24 May 2015 21:04:36 GMT + +sig "betty16.lec1.httplong.message.server.Server" + from "betty16/lec1/httplong/message/Server.java" + as SERVER; // Server: Apache + +sig "betty16.lec1.httplong.message.server.StrictTransportSecurity" + from "betty16/lec1/httplong/message/StrictTransportSecurity.java" + as STRICTTS; // Strict-Transport-Security: max-age=31536000; preload; includeSubDomains + +sig "betty16.lec1.httplong.message.server.LastModified" + from "betty16/lec1/httplong/message/LastModified.java" + as LASTM; // Last-Modified: Sat, 23 Jul 2011 09:38:43 GMT + +sig "betty16.lec1.httplong.message.server.ETag" + from "betty16/lec1/httplong/message/ETag.java" + as ETAG; // ETag: "ac6fa008-559-4a8b95908aec0" + +sig "betty16.lec1.httplong.message.server.AcceptRanges" + from "betty16/lec1/httplong/message/AcceptRanges.java" + as ACCEPTR; // Accept-Ranges: bytes + +sig "betty16.lec1.httplong.message.server.ContentLength" + from "betty16/lec1/httplong/message/ContentLength.java" + as CONTENTL; // Content-Length: 1369 + +sig "betty16.lec1.httplong.message.server.Vary" + from "betty16/lec1/httplong/message/Vary.java" + as VARY; // Vary: Accept-Encoding + +sig "betty16.lec1.httplong.message.server.ContentType" + from "betty16/lec1/httplong/message/ContentType.java" + as CONTENTT; // Content-Type: text/html + +sig "betty16.lec1.httplong.message.server.Via" + from "betty16/lec1/httplong/message/Via.java" + as VIA; // Via: 1.1 www.doc.ic.ac.uk + + +global protocol Http(role C, role S) { + do Request(C, S); + do Response(C, S); +} + +aux global protocol Request(role C, role S) { + choice at C { + REQUESTL from C to S; // GET /~rhu/ HTTP/1.1 + rec X { + choice at C { + HOST from C to S; // Host: www.doc.ic.ac.uk + continue X; + } or { + USERA from C to S; // User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0 + continue X; + } or { + ACCEPT from C to S; // Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 + continue X; + } or { + ACCEPTL from C to S; // Accept-Language: en-GB,en;q=0.5 + continue X; + } or { + ACCEPTE from C to S; // Accept-Encoding: gzip, deflate + continue X; + } or { + DNT from C to S; // DNT: 1 + continue X; + } or { + CONN from C to S; // Connection: keep-alive + continue X; + } or { + UPGRADEIR from C to S; // Upgrade-Insecure-Requests: 1 + continue X; + } or { + COOKIE from C to S; // Cookie: __utma=111872281.1372348290.1498163262.1498163262.1498163262.1; __utmz=111872281.1498163262.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none) + continue X; + } or { + PRAGMA from C to S; // Pragma: no-cache + continue X; + /*} or { + CACHEC from C to S; // Cache-Control: max-age=0 + continue X; + */} or { + BODY from C to S; + } + } + } +} + +aux global protocol Response(role C, role S) { + HTTPV from S to C; // HTTP/1.1 + choice at S { + 200 from S to C; // 200 OK + } or { + 404 from S to C; + } + + rec Y { + choice at S { + DATE from S to C; // Date: Sun, 24 May 2015 21:04:36 GMT + continue Y; + } or { + SERVER from S to C; // Server: Apache + continue Y; + } or { + STRICTTS from S to C; // Strict-Transport-Security: max-age=31536000; preload; includeSubDomains + continue Y; + } or { + LASTM from S to C; // Last-Modified: Sat, 23 Jul 2011 09:38:43 GMT + continue Y; + } or { + ETAG from S to C; // ETag: "ac6fa008-559-4a8b95908aec0" + continue Y; + } or { + ACCEPTR from S to C; // Accept-Ranges: bytes + continue Y; + } or { + CONTENTL from S to C; // Content-Length: 1369 + continue Y; + } or { + VARY from S to C; // Vary: Accept-Encoding + continue Y; + } or { + CONTENTT from S to C; // Content-Type: text/html + continue Y; + } or { + VIA from S to C; // Via: 1.1 www.doc.ic.ac.uk + continue Y; + } or { + BODY from S to C; // Message length indicated by Content-Length + } + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/HttpLongC.java b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/HttpLongC.java new file mode 100644 index 000000000..787219c6e --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/HttpLongC.java @@ -0,0 +1,106 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec1.httplong; + +import static betty16.lec1.httplong.HttpLong.Http.Http.ACCEPTR; +import static betty16.lec1.httplong.HttpLong.Http.Http.BODY; +import static betty16.lec1.httplong.HttpLong.Http.Http.C; +import static betty16.lec1.httplong.HttpLong.Http.Http.CONTENTL; +import static betty16.lec1.httplong.HttpLong.Http.Http.CONTENTT; +import static betty16.lec1.httplong.HttpLong.Http.Http.DATE; +import static betty16.lec1.httplong.HttpLong.Http.Http.ETAG; +import static betty16.lec1.httplong.HttpLong.Http.Http.HTTPV; +import static betty16.lec1.httplong.HttpLong.Http.Http.LASTM; +import static betty16.lec1.httplong.HttpLong.Http.Http.S; +import static betty16.lec1.httplong.HttpLong.Http.Http.SERVER; +import static betty16.lec1.httplong.HttpLong.Http.Http.STRICTTS; +import static betty16.lec1.httplong.HttpLong.Http.Http.VARY; +import static betty16.lec1.httplong.HttpLong.Http.Http.VIA; +import static betty16.lec1.httplong.HttpLong.Http.Http._200; +import static betty16.lec1.httplong.HttpLong.Http.Http._404; + +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import betty16.lec1.httplong.HttpLong.Http.Http; +import betty16.lec1.httplong.HttpLong.Http.roles.C; +import betty16.lec1.httplong.HttpLong.Http.statechans.C.EndSocket; +import betty16.lec1.httplong.HttpLong.Http.statechans.C.Http_C_1; +import betty16.lec1.httplong.HttpLong.Http.statechans.C.Http_C_3; +import betty16.lec1.httplong.HttpLong.Http.statechans.C.Http_C_4_Cases; +import betty16.lec1.httplong.HttpLong.Http.statechans.C.Http_C_5; +import betty16.lec1.httplong.HttpLong.Http.statechans.C.Http_C_5_Cases; +import betty16.lec1.httplong.message.Body; +import betty16.lec1.httplong.message.HttpLongMessageFormatter; +import betty16.lec1.httplong.message.client.Host; +import betty16.lec1.httplong.message.client.RequestLine; + + +public class HttpLongC { + + public static void main(String[] args) throws Exception { + Http http = new Http(); + try (MPSTEndpoint client = new MPSTEndpoint<>(http, C, + new HttpLongMessageFormatter())) { + String host = "example.com"; int port = 80; String file = "/"; + //String host = "localhost"; int port = 8080; String file = "/"; + + client.request(S, SocketChannelEndpoint::new, host, port); + new HttpLongC().run(new Http_C_1(client), host, file); + } + } + + public EndSocket run(Http_C_1 c, String host, String file) throws Exception { + return doResponse(doRequest(c, host, file)); + } + + private Http_C_3 doRequest(Http_C_1 c1, String host, String file) throws Exception { + return c1.send(S, new RequestLine(file, "1.1")) + .send(S, new Host(host)) + .send(S, new Body("")); + } + + private EndSocket doResponse(Http_C_3 c3) throws Exception { + Http_C_4_Cases cases = c3.async(S, HTTPV).branch(S); + switch (cases.op) { + case _200: return doResponseAux(cases.receive(_200)); + case _404: return doResponseAux(cases.receive(_404)); + default: throw new RuntimeException("[TODO]: " + cases.op); + } + } + + private EndSocket doResponseAux(Http_C_5 c5) throws Exception { + Http_C_5_Cases cases = c5.branch(S); + switch (cases.op) { + case ACCEPTR: return doResponseAux(cases.receive(ACCEPTR)); + case CONTENTL: return doResponseAux(cases.receive(CONTENTL)); + case CONTENTT: return doResponseAux(cases.receive(CONTENTT)); + case DATE: return doResponseAux(cases.receive(DATE)); + case ETAG: return doResponseAux(cases.receive(ETAG)); + case LASTM: return doResponseAux(cases.receive(LASTM)); + case SERVER: return doResponseAux(cases.receive(SERVER)); + case STRICTTS: return doResponseAux(cases.receive(STRICTTS)); + case VARY: return doResponseAux(cases.receive(VARY)); + case VIA: return doResponseAux(cases.receive(VIA)); + case BODY: { + Buf buf_body = new Buf<>(); + EndSocket end = cases.receive(BODY, buf_body); + System.out.println(buf_body.val.getBody()); + return end; + } + default: throw new RuntimeException("[TODO]: " + cases.op); + } + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/HttpLongS.java b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/HttpLongS.java new file mode 100644 index 000000000..5b2f03b9b --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/HttpLongS.java @@ -0,0 +1,118 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec1.httplong; + +import static betty16.lec1.httplong.HttpLong.Http.Http.ACCEPT; +import static betty16.lec1.httplong.HttpLong.Http.Http.ACCEPTE; +import static betty16.lec1.httplong.HttpLong.Http.Http.ACCEPTL; +import static betty16.lec1.httplong.HttpLong.Http.Http.BODY; +import static betty16.lec1.httplong.HttpLong.Http.Http.C; +import static betty16.lec1.httplong.HttpLong.Http.Http.CONN; +import static betty16.lec1.httplong.HttpLong.Http.Http.COOKIE; +import static betty16.lec1.httplong.HttpLong.Http.Http.DNT; +import static betty16.lec1.httplong.HttpLong.Http.Http.HOST; +import static betty16.lec1.httplong.HttpLong.Http.Http.REQUESTL; +import static betty16.lec1.httplong.HttpLong.Http.Http.S; +import static betty16.lec1.httplong.HttpLong.Http.Http.UPGRADEIR; +import static betty16.lec1.httplong.HttpLong.Http.Http.USERA; +import static betty16.lec1.httplong.HttpLong.Http.Http.PRAGMA; +//import static betty16.lec1.httplong.HttpLong.Http.Http.CACHEC; + +import java.io.IOException; + +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.net.SocketChannelServer; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import betty16.lec1.httplong.HttpLong.Http.Http; +import betty16.lec1.httplong.HttpLong.Http.roles.S; +import betty16.lec1.httplong.HttpLong.Http.statechans.S.EndSocket; +import betty16.lec1.httplong.HttpLong.Http.statechans.S.Http_S_1; +import betty16.lec1.httplong.HttpLong.Http.statechans.S.Http_S_2; +import betty16.lec1.httplong.HttpLong.Http.statechans.S.Http_S_2_Cases; +import betty16.lec1.httplong.message.Body; +import betty16.lec1.httplong.message.HttpLongMessageFormatter; +import betty16.lec1.httplong.message.server.ContentLength; +import betty16.lec1.httplong.message.server.HttpVersion; +import betty16.lec1.httplong.message.server._200; + + +/** TODO: + * Cannot parse header field: Pragma: no-cache + * at betty16.lec1.httplong.message.HttpLongMessageFormatter.fromBytes(HttpLongMessageFormatter.java:197) + * + * java.lang.RuntimeException: Cannot parse header field: Cache-Control: max-age=0 + * at betty16.lec1.httplong.message.HttpLongMessageFormatter.fromBytes(HttpLongMessageFormatter.java:197) + */ + +public class HttpLongS +{ + public static void main(String[] args) throws Exception + { + try (ScribServerSocket ss = new SocketChannelServer(8080)) { + while (true) { + Http http = new Http(); + try (MPSTEndpoint server = new MPSTEndpoint<>(http, S, + new HttpLongMessageFormatter())) { + server.accept(ss, C); + + run(new Http_S_1(server)); + } + catch (IOException | ClassNotFoundException + | ScribRuntimeException e) + { + e.printStackTrace(); + } + } + } + } + + private static EndSocket run(Http_S_1 s1) + throws ClassNotFoundException, ScribRuntimeException, IOException { + Buf buf = new Buf<>(); + + Http_S_2 s2 = s1.receive(C, REQUESTL, buf); + System.out.println("Requested: " + buf.val); + + while (true) { + Http_S_2_Cases cases = s2.branch(C); + switch (cases.op) { + case ACCEPT: s2 = cases.receive(ACCEPT, buf); break; + case ACCEPTE: s2 = cases.receive(ACCEPTE, buf); break; + case ACCEPTL: s2 = cases.receive(ACCEPTL, buf); break; + case BODY: + { + String body = "Hello, World!"; + return + cases.receive(BODY, buf) + .send(C, new HttpVersion("1.1")) + .send(C, new _200("OK")) + .send(C, new ContentLength(body.length())) + .send(C, new Body(body)); + } + case CONN: s2 = cases.receive(CONN, buf); break; + case DNT: s2 = cases.receive(DNT, buf); break; + case UPGRADEIR: s2 = cases.receive(UPGRADEIR, buf); break; + case COOKIE: s2 = cases.receive(COOKIE, buf); break; + case HOST: s2 = cases.receive(HOST, buf); break; + case USERA: s2 = cases.receive(USERA, buf); break; + case PRAGMA: s2 = cases.receive(PRAGMA, buf); break; + //case CACHEC: s2 = cases.receive(CACHEC, buf); break; + default: throw new RuntimeException("Missing field case: " + cases.op); + } + } + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/Body.java b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/Body.java new file mode 100644 index 000000000..67235da3b --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/Body.java @@ -0,0 +1,32 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec1.httplong.message; + +import betty16.lec1.httplong.HttpLong.Http.Http; + +public class Body extends HttpLongMessage +{ + private static final long serialVersionUID = 1L; + + public Body(String body) + { + super(Http.BODY, body); + } + + @Override + public byte[] toBytes() + { + return (getOpString(this.op) + getBody()).getBytes(HttpLongMessageFormatter.cs); // opString should be empty + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/HeaderField.java b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/HeaderField.java new file mode 100644 index 000000000..f8869fc91 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/HeaderField.java @@ -0,0 +1,26 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec1.httplong.message; + +import org.scribble.core.type.name.Op; + +public abstract class HeaderField extends HttpLongMessage +{ + private static final long serialVersionUID = 1L; + + public HeaderField(Op name, String value) + { + super(name, ": " + value + " "); + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/HttpLongMessage.java b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/HttpLongMessage.java new file mode 100644 index 000000000..ea02f8a8f --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/HttpLongMessage.java @@ -0,0 +1,158 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec1.httplong.message; + +import org.scribble.runtime.message.ScribMessage; +import org.scribble.core.type.name.Op; + +import betty16.lec1.httplong.HttpLong.Http.Http; + +// Unlike ScribMessage, HttpMessage is not actually "sent", but we use it as the base class since the socket API takes ScribMessages +public abstract class HttpLongMessage extends ScribMessage +{ + private static final long serialVersionUID = 1L; + + // TODO: make case-insensitive + // " " after ops done by HeaderField + public static final String GET = "GET"; + public static final String HTTP = "HTTP"; + public static final String HOST = "Host"; + + public static final String USER_AGENT = "User-Agent"; + public static final String ACCEPT = "Accept"; + public static final String ACCEPT_LANGUAGE = "Accept-Language"; + public static final String ACCEPT_ENCODING = "Accept-Encoding"; + public static final String DO_NOT_TRACK = "DNT"; + public static final String CONNECTION = "Connection"; + public static final String UPGRADE_INSECURE_REQUESTS = "Upgrade-Insecure-Requests"; + public static final String COOKIE = "Cookie"; + public static final String PRAGMA = "Pragma"; + //public static final String CACHE_CONTROL = "Cache-Control"; + + public static final String DATE = "Date"; + public static final String CONTENT_TYPE = "Content-Type"; + public static final String _404 = "404"; + public static final String _200 = "200"; + public static final String ACCEPT_RANGES = "Accept-Ranges"; + public static final String LAST_MODIFIED = "Last-Modified"; + public static final String VARY = "Vary"; + public static final String SERVER = "Server"; + public static final String STRICT_TRANSPORT_SECURITY = "Strict-Transport-Security"; + public static final String VIA = "Via"; + public static final String ETAG = "ETag"; + public static final String CONTENT_LENGTH = "Content-Length"; + + protected static final String CRLF = "\r\n"; + + public HttpLongMessage(Op op) + { + super(op); + } + + public HttpLongMessage(Op op, String body) + { + super(op, body); + } + + public String getBody() + { + return (this.payload.length == 0) ? "" : (String) this.payload[0]; + } + + public byte[] toBytes() + { + return (getOpString(this.op) + getBody() + HttpLongMessage.CRLF) + .getBytes(HttpLongMessageFormatter.cs); + // Can give "utf-8" as arg directly + } + + @Override + public String toString() + { + return new String(toBytes()); + } + + // " " after ops done by HeaderField + protected static String getOpString(Op op) + { + if (op.equals(Http.CONTENTL)) + { + return HttpLongMessage.CONTENT_LENGTH; + } + else if (op.equals(Http.ETAG)) + { + return HttpLongMessage.ETAG; + } + else if (op.equals(Http.BODY)) + { + return HttpLongMessage.CRLF; // This CRLF "op" actually enacts the empty line for end-of-headers + } + else if (op.equals(Http.VIA)) + { + return HttpLongMessage.VIA; + } + else if (op.equals(Http.SERVER)) + { + return HttpLongMessage.SERVER; + } + else if (op.equals(Http.VARY)) + { + return HttpLongMessage.VARY; + } + else if (op.equals(HttpLongMessage.CRLF)) + { + return ""; + } + else if (op.equals(Http.REQUESTL)) // FIXME: not just GET (POST..) + { + return HttpLongMessage.GET; + } + else if (op.equals(Http.LASTM)) + { + return HttpLongMessage.LAST_MODIFIED; + } + else if (op.equals(Http.ACCEPTR)) + { + return HttpLongMessage.ACCEPT_RANGES; + } + else if (op.equals(Http.HOST)) + { + return HttpLongMessage.HOST; + } + else if (op.equals(Http.HTTPV)) + { + return HttpLongMessage.HTTP; + } + else if (op.equals(Http._200)) + { + return HttpLongMessage._200; + } + else if (op.equals(Http._404)) + { + return HttpLongMessage._404; + } + else if (op.equals(Http.CONTENTT)) + { + return HttpLongMessage.CONTENT_TYPE; + } + else if (op.equals(Http.DATE)) + { + return HttpLongMessage.DATE; + } + else + { + throw new RuntimeException("TODO: " + op); + } + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/HttpLongMessageFormatter.java b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/HttpLongMessageFormatter.java new file mode 100644 index 000000000..8a46665ac --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/HttpLongMessageFormatter.java @@ -0,0 +1,402 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec1.httplong.message; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; + +import betty16.lec1.httplong.message.client.*; +import betty16.lec1.httplong.message.server.*; +import org.scribble.runtime.message.ScribMessage; +import org.scribble.runtime.message.ScribMessageFormatter; + +public class HttpLongMessageFormatter implements ScribMessageFormatter +{ + public static final Charset cs = Charset.forName("UTF8"); + //private static CharsetDecoder cd = cs.newDecoder(); + + private int len = -1; + + public HttpLongMessageFormatter() + { + + } + + @Override + public byte[] toBytes(ScribMessage m) throws IOException + { + return ((HttpLongMessage) m).toBytes(); + } + + @Override + public ScribMessage fromBytes(ByteBuffer bb) throws IOException, ClassNotFoundException + { + bb.flip(); + int rem = bb.remaining(); + if (rem < 2) + { + bb.compact(); + return null; + } + + int pos = bb.position(); + String front = new String(new byte[] { bb.get(pos), bb.get(pos + 1) }, HttpLongMessageFormatter.cs); + if (front.equals(HttpLongMessage.CRLF)) // not sound? -- actually, due to sess types it is safe (same reason why interpreting any of these messages without context is sound) -- parsing doesn't have to follow the *full protocol* BNF any more to be sound + { + if (this.len == -1) + { + return new Body(""); + } + if (rem < this.len + 2) + { + bb.compact(); + return null; + } + //String body = readLine(dis) + HttpMessage.CRLF; // HACK: assumes at least 1 CRLF + StringBuffer sb = new StringBuffer(); + //for (int i = body.length(); i < this.len; i++) + for (int i = 0; i < this.len; i++) // CHECKME: Client-side len out by 1? e.g., example.com + { + sb.append((char) bb.get()); + } + this.len = -1; + //return new Body(body + sb.toString()); + return new Body(sb.toString()); + } + + if (rem < pos + 4) + { + bb.compact(); + return null; + } + //byte[] bs = new byte[2]; + //dis.readFully(bs); + front += new String(new byte[] { bb.get(pos + 2), bb.get(pos + 3) }, HttpLongMessageFormatter.cs); + // FIXME: factor out with HttpMessage op strings + int code = isStatusCode(front); + if (code > -1) + { + String reason = readLine(bb, pos + 4).trim(); // Whitespace already built into the message classes + bb.compact(); + if (reason == null) + { + return null; + } + switch (code) + { + case 200: return new _200(reason); + case 404: return new _404(reason); + default: throw new RuntimeException("Unknown status code: " + code); + } + } + else if (front.startsWith(HttpLongMessage.GET)) + { + String reql = readLine(bb, pos + 4).trim(); + bb.compact(); + if (reql == null) + { + return null; + } + String target = reql.substring(0, reql.indexOf(' ')); + String vers = reql.substring(reql.indexOf(' ') + 1).trim(); + vers = vers.substring(vers.indexOf('/') + 1); + return new RequestLine(target, vers); + } + else if (front.equals(HttpLongMessage.HTTP)) + { + //dis.read(); // '/' + if (rem < pos + 5) + { + bb.compact(); + return null; + } + String word = readWord(bb, pos + 5); + bb.compact(); + if (word == null) + { + return null; + } + return new HttpVersion(word); + } + else + { + String line = readLine(bb, pos + 4); + bb.compact(); + if (line == null) + { + return null; + } + line = front + line; + int colon = line.indexOf(':'); + if (colon > -1) + { + String name = line.substring(0, colon); + String value = line.substring(colon + 1).trim(); // Whitespace already built into the message classes + switch (name) + { + case HttpLongMessage.HOST: return new Host(value); + case HttpLongMessage.USER_AGENT: return new UserAgent(value); + case HttpLongMessage.ACCEPT: return new Accept(value); + case HttpLongMessage.ACCEPT_LANGUAGE: return new AcceptLanguage(value); + case HttpLongMessage.ACCEPT_ENCODING: return new AcceptEncoding(value); + case HttpLongMessage.DO_NOT_TRACK: return new DoNotTrack(Integer.parseInt(value)); + case HttpLongMessage.CONNECTION: return new Connection(value); + case HttpLongMessage.UPGRADE_INSECURE_REQUESTS: return new UpgradeInsecureRequests(Integer.parseInt(value)); + case HttpLongMessage.COOKIE: return new Cookie(value); + case HttpLongMessage.PRAGMA: return new Pragma(value); + //case HttpLongMessage.CACHE_CONTROL: return new CacheControl(value); + + case HttpLongMessage.DATE: return new Date(value); + case HttpLongMessage.SERVER: return new Server(value); + case HttpLongMessage.STRICT_TRANSPORT_SECURITY: return new StrictTransportSecurity(value); + case HttpLongMessage.LAST_MODIFIED: return new LastModified(value); + case HttpLongMessage.ETAG: return new ETag(value); + case HttpLongMessage.ACCEPT_RANGES: return new AcceptRanges(value); + case HttpLongMessage.CONTENT_LENGTH: + { + len = Integer.parseInt(value.trim()); + return new ContentLength(len); + } + case HttpLongMessage.VARY: return new Vary(value); + case HttpLongMessage.CONTENT_TYPE: return new ContentType(value); + case HttpLongMessage.VIA: return new Via(value); + default: { + //throw new RuntimeException("Cannot parse header field: " + line); + System.err.println("Cannot parse header field, attempting to skip: " + line); + return fromBytes(bb); + } + } + } + else + { + throw new RuntimeException("Cannot parse message: " + line); + } + } + } + + private static String readLine(ByteBuffer bb, int i) throws IOException + { + StringBuilder sb = new StringBuilder(); + for (int limit = bb.limit(); i <= limit; ) + { + char c = (char) bb.get(i++); // readChar is not the same + sb.append(c); + if (c == '\r') + { + if (i > limit) + { + return null; + } + c = (char) bb.get(i++); + sb.append(c); + if (c == '\n') + { + bb.position(i); + return sb.substring(0, sb.length() - 2).toString(); + } + } + } + return null; + } + + private static String readWord(ByteBuffer bb, int i) throws IOException + { + StringBuilder sb = new StringBuilder(); + for (int limit = bb.limit(); i <= limit; ) + { + char c = (char) bb.get(i++); + if (c == ' ') + { + bb.position(i); + return sb.toString(); + } + sb.append(c); + } + return null; + } + + //private int isStatusCode(byte[] bs) + private int isStatusCode(String front) + { + String code = ""; + for (int i = 0; i < 4; i++) + { + //char c = (char) bs[i]; + char c = front.charAt(i); + if (i < 3) + { + if (c < '0' || c > '9') + { + return -1; + } + code += c; + } + else + { + if (c != ' ') + { + return -1; + } + } + } + return Integer.parseInt(code); + } + + + + + + + + + + + // FIXME: delete + @Deprecated @Override + public void writeMessage(DataOutputStream dos, ScribMessage m) throws IOException + { + dos.write(((HttpLongMessage) m).toBytes()); + dos.flush(); + } + + @Deprecated @Override + public ScribMessage readMessage(DataInputStream dis) throws IOException + { + byte[] bs = new byte[2]; + dis.readFully(bs); + String front = new String(bs, HttpLongMessageFormatter.cs); + if (front.equals(HttpLongMessage.CRLF)) // not sound? -- actually, due to sess types it is safe (same reason why interpreting any of these messages without context is sound) -- parsing doesn't have to follow the *full protocol* BNF any more to be sound + { + if (this.len == -1) + { + return new Body(""); + } + //String body = readLine(dis) + HttpMessage.CRLF; // HACK: assumes at least 1 CRLF + StringBuffer sb = new StringBuffer(); + //for (int i = body.length(); i < this.len; i++) + for (int i = 0; i < this.len; i++) + { + sb.append((char) dis.read()); + } + this.len = -1; + //return new Body(body + sb.toString()); + return new Body(sb.toString()); + } + + bs = new byte[2]; + dis.readFully(bs); + front += new String(bs, HttpLongMessageFormatter.cs); + // FIXME: factor out with HttpMessage op strings + int code = isStatusCode(front); + if (code > -1) + { + String reason = readLine(dis).trim(); // Whitespace already built into the message classes + switch (code) + { + case 200: return new _200(reason); + case 404: return new _404(reason); + default: throw new RuntimeException("Unknown status code: " + code); + } + } + else if (front.startsWith(HttpLongMessage.GET)) + { + String reql = readLine(dis).trim(); + String target = reql.substring(0, reql.indexOf(' ')); + String vers = reql.substring(reql.indexOf(' ') + 1).trim(); + vers = vers.substring(vers.indexOf('/') + 1); + return new RequestLine(target, vers); + } + else if (front.equals(HttpLongMessage.HTTP)) + { + dis.read(); // '/' + String word = readWord(dis); + return new HttpVersion(word); + } + else + { + String line = front + readLine(dis); + int colon = line.indexOf(':'); + if (colon > -1) + { + String name = line.substring(0, colon); + String value = line.substring(colon + 1).trim(); // Whitespace already built into the message classes + switch (name) + { + case HttpLongMessage.HOST: return new Host("value"); + case HttpLongMessage.USER_AGENT: return new UserAgent(value); + case HttpLongMessage.ACCEPT: return new Accept(value); + case HttpLongMessage.ACCEPT_LANGUAGE: return new AcceptLanguage(value); + case HttpLongMessage.ACCEPT_ENCODING: return new AcceptEncoding(value); + case HttpLongMessage.DO_NOT_TRACK: return new DoNotTrack(Integer.parseInt(value)); + case HttpLongMessage.CONNECTION: return new Connection(value); + + case HttpLongMessage.DATE: return new Date(value); + case HttpLongMessage.SERVER: return new Server(value); + case HttpLongMessage.LAST_MODIFIED: return new LastModified(value); + case HttpLongMessage.ETAG: return new ETag(value); + case HttpLongMessage.ACCEPT_RANGES: return new AcceptRanges(value); + case HttpLongMessage.CONTENT_LENGTH: + { + len = Integer.parseInt(value.trim()); + return new ContentLength(len); + } + case HttpLongMessage.VARY: return new Vary(value); + case HttpLongMessage.CONTENT_TYPE: return new ContentType(value); + case HttpLongMessage.VIA: return new Via(value); + default: throw new RuntimeException("Cannot parse header field: " + line); + } + } + else + { + throw new RuntimeException("Cannot parse message: " + line); + } + } + } + + private static String readLine(DataInputStream dis) throws IOException + { + StringBuilder sb = new StringBuilder(); + for (; true; ) + { + char c = (char) dis.read(); // readChar is not the same + sb.append(c); + if (c == '\r') + { + c = (char) dis.read(); + sb.append(c); + if (c == '\n') + { + return sb.substring(0, sb.length() - 2).toString(); + } + } + } + } + + private static String readWord(DataInputStream dis) throws IOException + { + StringBuilder sb = new StringBuilder(); + for (; true; ) + { + char c = (char) dis.read(); + if (c == ' ') + { + return sb.toString(); + } + sb.append(c); + } + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/StartLine.java b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/StartLine.java new file mode 100644 index 000000000..d7eba14ef --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/StartLine.java @@ -0,0 +1,26 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec1.httplong.message; + +import org.scribble.core.type.name.Op; + +public abstract class StartLine extends HttpLongMessage +{ + private static final long serialVersionUID = 1L; + + public StartLine(Op op, String body) + { + super(op, body); + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/client/Accept.java b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/client/Accept.java new file mode 100644 index 000000000..c3fdce712 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/client/Accept.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec1.httplong.message.client; + +import betty16.lec1.httplong.HttpLong.Http.Http; +import betty16.lec1.httplong.message.HeaderField; + +public class Accept extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public Accept(String text) + { + super(Http.ACCEPT, text); + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/client/AcceptEncoding.java b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/client/AcceptEncoding.java new file mode 100644 index 000000000..c94c3dc10 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/client/AcceptEncoding.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec1.httplong.message.client; + +import betty16.lec1.httplong.HttpLong.Http.Http; +import betty16.lec1.httplong.message.HeaderField; + +public class AcceptEncoding extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public AcceptEncoding(String text) + { + super(Http.ACCEPTE, text); + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/client/AcceptLanguage.java b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/client/AcceptLanguage.java new file mode 100644 index 000000000..3d8970bd5 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/client/AcceptLanguage.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec1.httplong.message.client; + +import betty16.lec1.httplong.HttpLong.Http.Http; +import betty16.lec1.httplong.message.HeaderField; + +public class AcceptLanguage extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public AcceptLanguage(String text) + { + super(Http.ACCEPTL, text); + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/client/CacheControl.java b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/client/CacheControl.java new file mode 100644 index 000000000..986af0286 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/client/CacheControl.java @@ -0,0 +1,29 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec1.httplong.message.client; + +import betty16.lec1.httplong.HttpLong.Http.Http; +import betty16.lec1.httplong.message.HeaderField; + +public class CacheControl extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public CacheControl(String text) + { + //super(Http.CACHEC, text); + super(Http.PRAGMA, text); // FIXME + throw new RuntimeException("TODO"); + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/client/Connection.java b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/client/Connection.java new file mode 100644 index 000000000..6fe6f347c --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/client/Connection.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec1.httplong.message.client; + +import betty16.lec1.httplong.HttpLong.Http.Http; +import betty16.lec1.httplong.message.HeaderField; + +public class Connection extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public Connection(String text) + { + super(Http.CONN, text); + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/client/Cookie.java b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/client/Cookie.java new file mode 100644 index 000000000..fb672a646 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/client/Cookie.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec1.httplong.message.client; + +import betty16.lec1.httplong.HttpLong.Http.Http; +import betty16.lec1.httplong.message.HeaderField; + +public class Cookie extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public Cookie(String val) + { + super(Http.COOKIE, val); + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/client/DoNotTrack.java b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/client/DoNotTrack.java new file mode 100644 index 000000000..e7909f94b --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/client/DoNotTrack.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec1.httplong.message.client; + +import betty16.lec1.httplong.HttpLong.Http.Http; +import betty16.lec1.httplong.message.HeaderField; + +public class DoNotTrack extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public DoNotTrack(int val) + { + super(Http.DNT, Integer.toString(val)); + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/client/Host.java b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/client/Host.java new file mode 100644 index 000000000..01510acdf --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/client/Host.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec1.httplong.message.client; + +import betty16.lec1.httplong.HttpLong.Http.Http; +import betty16.lec1.httplong.message.HeaderField; + +public class Host extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public Host(String host) + { + super(Http.HOST, host); + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/client/Pragma.java b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/client/Pragma.java new file mode 100644 index 000000000..703a0ed6a --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/client/Pragma.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec1.httplong.message.client; + +import betty16.lec1.httplong.HttpLong.Http.Http; +import betty16.lec1.httplong.message.HeaderField; + +public class Pragma extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public Pragma(String text) + { + super(Http.PRAGMA, text); + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/client/RequestLine.java b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/client/RequestLine.java new file mode 100644 index 000000000..e2d4b9a82 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/client/RequestLine.java @@ -0,0 +1,29 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec1.httplong.message.client; + +import betty16.lec1.httplong.HttpLong.Http.Http; +import betty16.lec1.httplong.message.StartLine; + + +// FIXME: not just GET +public class RequestLine extends StartLine +{ + private static final long serialVersionUID = 1L; + + public RequestLine(String reqtarget, String vers) + { + super(Http.REQUESTL, " " + reqtarget + " HTTP" + "/" + vers); + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/client/UpgradeInsecureRequests.java b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/client/UpgradeInsecureRequests.java new file mode 100644 index 000000000..a85a62538 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/client/UpgradeInsecureRequests.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec1.httplong.message.client; + +import betty16.lec1.httplong.HttpLong.Http.Http; +import betty16.lec1.httplong.message.HeaderField; + +public class UpgradeInsecureRequests extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public UpgradeInsecureRequests(int val) + { + super(Http.UPGRADEIR, Integer.toString(val)); + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/client/UserAgent.java b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/client/UserAgent.java new file mode 100644 index 000000000..cf59f8b73 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/client/UserAgent.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec1.httplong.message.client; + +import betty16.lec1.httplong.HttpLong.Http.Http; +import betty16.lec1.httplong.message.HeaderField; + +public class UserAgent extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public UserAgent(String text) + { + super(Http.USERA, text); + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/AcceptRanges.java b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/AcceptRanges.java new file mode 100644 index 000000000..a664c5deb --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/AcceptRanges.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec1.httplong.message.server; + +import betty16.lec1.httplong.HttpLong.Http.Http; +import betty16.lec1.httplong.message.HeaderField; + +public class AcceptRanges extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public AcceptRanges(String text) + { + super(Http.ACCEPTR, text); + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/CRLF.java b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/CRLF.java new file mode 100644 index 000000000..b5ca83662 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/CRLF.java @@ -0,0 +1,29 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec1.httplong.message.server; + +import betty16.lec1.httplong.message.HttpLongMessage; + +@Deprecated +public class CRLF extends HttpLongMessage +{ + private static final long serialVersionUID = 1L; + + public CRLF() + { + //super(Http.CRLF, HttpMessage.CRLF); // No: HttpMessage already appends the CRLF + //super(Http.CRLF, ""); + super(null, ""); + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/ContentLength.java b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/ContentLength.java new file mode 100644 index 000000000..e9eeacb95 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/ContentLength.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec1.httplong.message.server; + +import betty16.lec1.httplong.HttpLong.Http.Http; +import betty16.lec1.httplong.message.HeaderField; + +public class ContentLength extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public ContentLength(Integer len) + { + super(Http.CONTENTL, len.toString()); + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/ContentType.java b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/ContentType.java new file mode 100644 index 000000000..e7d3ad4a3 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/ContentType.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec1.httplong.message.server; + +import betty16.lec1.httplong.HttpLong.Http.Http; +import betty16.lec1.httplong.message.HeaderField; + +public class ContentType extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public ContentType(String type) + { + super(Http.CONTENTT, type); + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/Date.java b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/Date.java new file mode 100644 index 000000000..0136c71d8 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/Date.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec1.httplong.message.server; + +import betty16.lec1.httplong.HttpLong.Http.Http; +import betty16.lec1.httplong.message.HeaderField; + +public class Date extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public Date(String date) + { + super(Http.DATE, date); + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/ETag.java b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/ETag.java new file mode 100644 index 000000000..2621dbb8c --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/ETag.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec1.httplong.message.server; + +import betty16.lec1.httplong.HttpLong.Http.Http; +import betty16.lec1.httplong.message.HeaderField; + +public class ETag extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public ETag(String tag) + { + super(Http.ETAG, tag); + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/HttpVersion.java b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/HttpVersion.java new file mode 100644 index 000000000..103334a94 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/HttpVersion.java @@ -0,0 +1,34 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec1.httplong.message.server; + +import betty16.lec1.httplong.HttpLong.Http.Http; +import betty16.lec1.httplong.message.HttpLongMessage; +import betty16.lec1.httplong.message.HttpLongMessageFormatter; + +public class HttpVersion extends HttpLongMessage +{ + private static final long serialVersionUID = 1L; + + public HttpVersion(String version) + { + super(Http.HTTPV, "/" + version); + } + + @Override + public byte[] toBytes() + { + return (getOpString(op) + getBody() + " ").getBytes(HttpLongMessageFormatter.cs); + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/LastModified.java b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/LastModified.java new file mode 100644 index 000000000..97442bd9d --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/LastModified.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec1.httplong.message.server; + +import betty16.lec1.httplong.HttpLong.Http.Http; +import betty16.lec1.httplong.message.HeaderField; + +public class LastModified extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public LastModified(String date) + { + super(Http.LASTM, date); + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/Server.java b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/Server.java new file mode 100644 index 000000000..2730e261e --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/Server.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec1.httplong.message.server; + +import betty16.lec1.httplong.HttpLong.Http.Http; +import betty16.lec1.httplong.message.HeaderField; + +public class Server extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public Server(String server) + { + super(Http.SERVER, server); + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/StatusCode.java b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/StatusCode.java new file mode 100644 index 000000000..376d0bf23 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/StatusCode.java @@ -0,0 +1,28 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec1.httplong.message.server; + +import org.scribble.core.type.name.Op; + +import betty16.lec1.httplong.message.HttpLongMessage; + +public abstract class StatusCode extends HttpLongMessage +{ + private static final long serialVersionUID = 1L; + + public StatusCode(Op code, String reason) + { + super(code, " " + reason); + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/StrictTransportSecurity.java b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/StrictTransportSecurity.java new file mode 100644 index 000000000..0ef9ebbfe --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/StrictTransportSecurity.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec1.httplong.message.server; + +import betty16.lec1.httplong.HttpLong.Http.Http; +import betty16.lec1.httplong.message.HeaderField; + +public class StrictTransportSecurity extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public StrictTransportSecurity(String server) + { + super(Http.STRICTTS, server); + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/Vary.java b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/Vary.java new file mode 100644 index 000000000..25b078749 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/Vary.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec1.httplong.message.server; + +import betty16.lec1.httplong.HttpLong.Http.Http; +import betty16.lec1.httplong.message.HeaderField; + +public class Vary extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public Vary(String text) + { + super(Http.VARY, text); + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/Via.java b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/Via.java new file mode 100644 index 000000000..fc0f933cd --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/Via.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec1.httplong.message.server; + +import betty16.lec1.httplong.HttpLong.Http.Http; +import betty16.lec1.httplong.message.HeaderField; + +public class Via extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public Via(String text) + { + super(Http.VIA, text); + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/_200.java b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/_200.java new file mode 100644 index 000000000..a5dcfe84c --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/_200.java @@ -0,0 +1,26 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec1.httplong.message.server; + +import betty16.lec1.httplong.HttpLong.Http.Http; + +public class _200 extends StatusCode +{ + private static final long serialVersionUID = 1L; + + public _200(String reason) + { + super(Http._200, reason); + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/_404.java b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/_404.java new file mode 100644 index 000000000..4a3b3f2e8 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/httplong/message/server/_404.java @@ -0,0 +1,26 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec1.httplong.message.server; + +import betty16.lec1.httplong.HttpLong.Http.Http; + +public class _404 extends StatusCode +{ + private static final long serialVersionUID = 1L; + + public _404(String reason) + { + super(Http._404, reason); + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/httpshort/HttpShort.scr b/scribble-demos/scrib/betty16/src/betty16/lec1/httpshort/HttpShort.scr new file mode 100644 index 000000000..fbda13229 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/httpshort/HttpShort.scr @@ -0,0 +1,38 @@ +/** + * Assuming scribblec.sh in scribble-java root directory: + * + * ./scribblec.sh -d scribble-demos/scrib/betty16/src scribble-demos/scrib/betty16/src/betty16/lec1/httpshort/HttpShort.scr -api Http C + * + * $ javadoc -cp scribble-core/target/classes:scribble-runtime/target/classes:scribble-demos/scrib/betty16/src -subpackages betty16.lec1.httpshort.HttpShort.Http -d scribble-demos/scrib/betty16/javadoc/httpshort + * + */ + + +module betty16.lec1.httpshort.HttpShort; + + +sig "betty16.lec1.httpshort.message.client.Request" + from "betty16/httpshort/message/Request.java" + as Request; + +sig "betty16.lec1.httpshort.message.server.Response" + from "betty16/shortvers/message/Response.java" + as Response; + + +global protocol Http(role C, role S) { + Request from C to S; + Response from S to C; +} + + + + + + + + + + + + diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/httpshort/HttpShortC.java b/scribble-demos/scrib/betty16/src/betty16/lec1/httpshort/HttpShortC.java new file mode 100644 index 000000000..789a31ac0 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/httpshort/HttpShortC.java @@ -0,0 +1,57 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec1.httpshort; + +import static betty16.lec1.httpshort.HttpShort.Http.Http.C; +import static betty16.lec1.httpshort.HttpShort.Http.Http.Response; +import static betty16.lec1.httpshort.HttpShort.Http.Http.S; + +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import betty16.lec1.httpshort.HttpShort.Http.Http; +import betty16.lec1.httpshort.HttpShort.Http.roles.C; +import betty16.lec1.httpshort.HttpShort.Http.statechans.C.EndSocket; +import betty16.lec1.httpshort.HttpShort.Http.statechans.C.Http_C_1; +import betty16.lec1.httpshort.message.HttpShortMessageFormatter; +import betty16.lec1.httpshort.message.client.Request; +import betty16.lec1.httpshort.message.server.Response; + +public class HttpShortC { + + public static void main(String[] args) throws Exception { + Http http = new Http(); + try (MPSTEndpoint client = new MPSTEndpoint<>(http, C, + new HttpShortMessageFormatter())) { + String host = "example.com"; int port = 80; String file = "/"; + //String host = "localhost"; int port = 8080; String file = "/"; + + client.request(S, SocketChannelEndpoint::new, host, port); + new HttpShortC().run(new Http_C_1(client), host, file); + } + } + + private EndSocket run(Http_C_1 c1, String host, String file) throws Exception { + Buf buf = new Buf<>(); + + EndSocket end = + c1.send(S, new Request(file, "1.1", host)) + .receive(S, Response, buf); + + System.out.println("Response:\n" + buf.val); + + return end; + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/httpshort/HttpShortS.java b/scribble-demos/scrib/betty16/src/betty16/lec1/httpshort/HttpShortS.java new file mode 100644 index 000000000..bbb62f6de --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/httpshort/HttpShortS.java @@ -0,0 +1,64 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec1.httpshort; + +import static betty16.lec1.httpshort.HttpShort.Http.Http.C; +import static betty16.lec1.httpshort.HttpShort.Http.Http.Request; +import static betty16.lec1.httpshort.HttpShort.Http.Http.S; + +import java.io.IOException; + +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.net.SocketChannelServer; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import betty16.lec1.httpshort.HttpShort.Http.Http; +import betty16.lec1.httpshort.HttpShort.Http.roles.S; +import betty16.lec1.httpshort.HttpShort.Http.statechans.S.Http_S_1; +import betty16.lec1.httpshort.HttpShort.Http.statechans.S.Http_S_2; +import betty16.lec1.httpshort.message.HttpShortMessageFormatter; +import betty16.lec1.httpshort.message.client.Request; +import betty16.lec1.httpshort.message.server.Response; + +public class HttpShortS { + + public static void main(String[] args) throws IOException { + try (ScribServerSocket ss = new SocketChannelServer(8080)) { + while (true) { + Http http = new Http(); + try (MPSTEndpoint server = new MPSTEndpoint<>(http, S, + new HttpShortMessageFormatter())) { + server.accept(ss, C); + + run(new Http_S_1(server)); + } + catch (IOException | ClassNotFoundException | ScribRuntimeException e) + { + e.printStackTrace(); + } + } + } + } + + private static void run(Http_S_1 s1) + throws ClassNotFoundException, ScribRuntimeException, IOException { + Buf buf = new Buf<>(); + + Http_S_2 s2 = s1.receive(C, Request, buf); + System.out.println("Request:\n" + buf.val); + s2.send(C, new Response("1.1", "Hello, World!")); + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/httpshort/message/HttpShortMessage.java b/scribble-demos/scrib/betty16/src/betty16/lec1/httpshort/message/HttpShortMessage.java new file mode 100644 index 000000000..424e90e63 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/httpshort/message/HttpShortMessage.java @@ -0,0 +1,67 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec1.httpshort.message; + +import org.scribble.runtime.message.ScribMessage; +import org.scribble.core.type.name.Op; + +import betty16.lec1.httpshort.HttpShort.Http.Http; + +public abstract class HttpShortMessage extends ScribMessage +{ + private static final long serialVersionUID = 1L; + + public static final String GET = "GET"; + public static final String HTTP = "HTTP"; + + public static final String CRLF = "\r\n"; + + public HttpShortMessage(Op op, String m) + { + super(op, m); + } + + public String getHeadersAndBody() + { + return (this.payload.length == 0) ? "" : (String) this.payload[0]; + } + + public byte[] toBytes() + { + // FIXME: factor better with Request/Response (e.g. " " after op, terminal CRLF, etc) + return (getOpString(this.op) + getHeadersAndBody()).getBytes(HttpShortMessageFormatter.cs); // Can give "utf-8" as arg directly + } + + @Override + public String toString() + { + return new String(toBytes()); + } + + protected static String getOpString(Op op) + { + if (op.equals(Http.Request)) + { + return HttpShortMessage.GET; + } + else if (op.equals(Http.Response)) + { + return HttpShortMessage.HTTP; + } + else + { + throw new RuntimeException("TODO: " + op); + } + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/httpshort/message/HttpShortMessageFormatter.java b/scribble-demos/scrib/betty16/src/betty16/lec1/httpshort/message/HttpShortMessageFormatter.java new file mode 100644 index 000000000..6e3f45924 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/httpshort/message/HttpShortMessageFormatter.java @@ -0,0 +1,274 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec1.httpshort.message; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.util.Arrays; + +import org.scribble.runtime.message.ScribMessage; +import org.scribble.runtime.message.ScribMessageFormatter; + +import betty16.lec1.httpshort.message.client.Request; +import betty16.lec1.httpshort.message.server.Response; + +public class HttpShortMessageFormatter implements ScribMessageFormatter +{ + public static final Charset cs = Charset.forName("UTF8"); + //private static CharsetDecoder cd = cs.newDecoder(); + + public HttpShortMessageFormatter() + { + + } + + @Override + public byte[] toBytes(ScribMessage m) throws IOException + { + return ((HttpShortMessage) m).toBytes(); + } + + @Override + public ScribMessage fromBytes(ByteBuffer bb) + throws IOException, ClassNotFoundException + { + bb.flip(); + int rem = bb.remaining(); + if (rem < 2) + { + bb.compact(); + return null; + } + + String curr = new String(Arrays.copyOf(bb.array(), bb.remaining()), + HttpShortMessageFormatter.cs); + String endOfHeaders = HttpShortMessage.CRLF + HttpShortMessage.CRLF; + if (!curr.contains(endOfHeaders)) + { + bb.compact(); + return null; + } + + if (curr.contains(Response.CONTENT_LENGTH)) + { + int eoh = curr.indexOf(endOfHeaders); + if (eoh == -1) + { + bb.compact(); + return null; + } + String contentLenSplit = curr + .substring(curr.indexOf(Response.CONTENT_LENGTH)); + int len = Integer.parseInt( + contentLenSplit.substring(Response.CONTENT_LENGTH.length() + 2, + contentLenSplit.indexOf('\r')).trim()); + if (curr.length() < eoh+4) + { + bb.compact(); + return null; + } + String body = curr.substring(eoh+4); + if (body.getBytes(HttpShortMessageFormatter.cs).length < len) + { + bb.compact(); + return null; + } + byte[] bs = new byte[bb.remaining()]; // FIXME: hardcoded Response parsing based on presence of Content-Length + bb.get(bs); + bb.compact(); + return parseResponse(new String(bs, HttpShortMessageFormatter.cs)); + } + else + { + byte[] bs = new byte[bb.remaining()]; + bb.get(bs); + bb.compact(); + return parseRequest(new String(bs, HttpShortMessageFormatter.cs)); // FIXME: assuming empty-body Request if no Content-Length + } + } + + // Assumes no body + private static HttpShortMessage parseRequest(String msg) + { + String get = null; + String http = null; + String host = null; + String userA = null; + String accept = null; + String acceptL = null; + String acceptE = null; + String dnt = null; + String connection = null; + String upgradeIR = null; + String cookie = null; + + for (boolean eoh = false; !eoh; ) + { + //if (msg.startsWith(HttpMessage.CRLF + HttpMessage.CRLF)) + if (msg.startsWith(HttpShortMessage.CRLF)) // First CRLF already trimmed after last header + { + eoh = true; + //msg = msg.substring(4); + msg = msg.substring(2); + break; + } + + msg = msg.replace("\\A\\s+", ""); + int i = msg.indexOf(":"); + if (i == -1) + { + throw new RuntimeException("Shouldn't get in here: " + msg); + } + if (msg.startsWith(HttpShortMessage.GET)) // FIXME + { + int j = msg.indexOf(' '); + get = msg.substring(j+1, msg.indexOf(' ', j+1)).trim(); + j = msg.indexOf('\r'); + http = msg.substring(msg.indexOf('/')+1, j).trim(); + msg = msg.substring(j+2); + } + else + { + String header = msg.substring(0, i); + int j = msg.indexOf("\r"); + switch (header) // FIXME: duplicates not checked + { + case Request.HOST: host = msg.substring(i+1, j).trim(); break; + case Request.USER_AGENT: userA = msg.substring(i+1, j).trim(); break; + case Request.ACCEPT: accept = msg.substring(i+1, j).trim(); break; + case Request.ACCEPT_LANGUAGE: acceptL = msg.substring(i+1, j).trim(); break; + case Request.ACCEPT_ENCODING: acceptE = msg.substring(i+1, j).trim(); break; + case Request.DO_NOT_TRACK: dnt = msg.substring(i+1, j).trim(); break; + case Request.CONNECTION: connection = msg.substring(i+1, j).trim(); break; + case Request.UPGRADE_INSECURE_REQUESTS: upgradeIR = msg.substring(i+1, j).trim(); break; + case Request.COOKIE: cookie = msg.substring(i+1, j).trim(); break; + //case Request.REFERER: referer = msg.substring(i+1, j).trim(); break; + //case Request.CACHECONTROL: cacheC = msg.substring(i+1, j).trim(); break; + default: { + //throw new RuntimeException("Cannot parse header field: " + msg.substring(0, j)); + System.err.println("Cannot parse header field, attempting to skip: " + msg.substring(0, j)); + } + } + msg = msg.substring(j+2); + } + } + if (!msg.isEmpty()) + { + throw new RuntimeException("Shouldn't get in here: " + msg); + } + return new Request(get, http, host, userA, accept, acceptL, acceptE, dnt, + connection, upgradeIR, cookie); + } + + private static HttpShortMessage parseResponse(String msg) + { + String httpv = null; + String ack = null; + String date = null; + String server = null; + String strictTS = null; + String lastMod = null; + String eTag = null; + String acceptR = null; + String contentL = null; + String vary = null; + String contentT = null; + String via = null; + String body = null; + + for (boolean eoh = false; !eoh; ) + { + //if (msg.startsWith(HttpMessage.CRLF + HttpMessage.CRLF)) + if (msg.startsWith(HttpShortMessage.CRLF)) // First CRLF already trimmed after last header + { + eoh = true; + //msg = msg.substring(4); + msg = msg.substring(2); + break; + } + + msg = msg.trim(); + int i = msg.indexOf(":"); + if (i == -1) + { + throw new RuntimeException("Shouldn't get in here: " + msg); + } + if (msg.startsWith(HttpShortMessage.HTTP)) // FIXME + { + int j = msg.indexOf(' '); + httpv = msg.substring(msg.indexOf('/')+1, j); + + int k = msg.indexOf('\r'); + ack = msg.substring(j+1, k); + /*if (!ack.equals("200 OK")) + { + if (!ack.startsWith("404")) + { + throw new RuntimeException("[TODO]: " + msg); + } + } + ack = "OK"; // Hardcoded*/ + msg = msg.substring(k+2); + } + else + { + String header = msg.substring(0, i); + int j = msg.indexOf("\r"); + switch (header) + { + case Response.DATE: date = msg.substring(i+1, j).trim(); break; + case Response.SERVER: server = msg.substring(i+1, j).trim(); break; + case Response.STRICT_TRANSPORT_SECURITY: strictTS = msg.substring(i+1, j).trim(); break; + case Response.LAST_MODIFIED: lastMod = msg.substring(i+1, j).trim(); break; + case Response.ETAG: eTag = msg.substring(i+1, j).trim(); break; + case Response.ACCEPT_RANGES: acceptR = msg.substring(i+1, j).trim(); break; + case Response.CONTENT_LENGTH: contentL = msg.substring(i+1, j).trim(); break; + case Response.VARY: vary = msg.substring(i+1, j).trim(); break; + case Response.CONTENT_TYPE: contentT = msg.substring(i+1, j).trim(); break; + case Response.VIA: via = msg.substring(i+1, j).trim(); break; + default: + //throw new RuntimeException("Cannot parse header field: " + msg.substring(0, msg.indexOf('\r'))); + System.err + .println("[Warning] Attempting to skip over response field: " + + header + "\n" + msg.substring(i + 1, j).trim()); + } + msg = msg.substring(j+2); + } + } + body = msg; + return new Response(httpv, ack, date, server, strictTS, lastMod, eTag, + acceptR, contentL, vary, contentT, via, body); + } + + + + + + + // TODO: delete + @Deprecated @Override + public void writeMessage(DataOutputStream dos, ScribMessage m) throws IOException + { + throw new RuntimeException("Shouldn't get in here: " + m); + } + + @Deprecated @Override + public ScribMessage readMessage(DataInputStream dis) throws IOException + { + throw new RuntimeException("Shouldn't get in here: "); + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/httpshort/message/client/Request.java b/scribble-demos/scrib/betty16/src/betty16/lec1/httpshort/message/client/Request.java new file mode 100644 index 000000000..b8fef7cdb --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/httpshort/message/client/Request.java @@ -0,0 +1,58 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec1.httpshort.message.client; + +import betty16.lec1.httpshort.HttpShort.Http.Http; +import betty16.lec1.httpshort.message.HttpShortMessage; + +public class Request extends HttpShortMessage { + + private static final long serialVersionUID = 1L; + + // TODO: make case-insensitive + public static final String HOST = "Host"; + public static final String USER_AGENT = "User-Agent"; + public static final String ACCEPT = "Accept"; + public static final String ACCEPT_LANGUAGE = "Accept-Language"; + public static final String ACCEPT_ENCODING = "Accept-Encoding"; + public static final String DO_NOT_TRACK = "DNT"; + public static final String CONNECTION = "Connection"; + public static final String UPGRADE_INSECURE_REQUESTS = "Upgrade-Insecure-Requests"; + public static final String COOKIE = "Cookie"; + public static final String REFERER = "Referer"; + public static final String CACHECONTROL = "Cache-Control"; + + public Request(String get, String http, String host, String userA, String accept, String acceptL, String acceptE, String dnt, String connection, String upgradeIR, String cookie) { + super(Http.Request, getHeadersAndBody(get, http, host, userA, accept, acceptL, acceptE, dnt, connection, upgradeIR, cookie)); + } + + public Request(String get, String http, String host) { + this(get, http, host, null, null, null, null, null, null, null, null); + } + + protected static String getHeadersAndBody(String get, String http, String host, String userA, String accept, String acceptL, String acceptE, String dnt, String connection, String upgradeIR, String cookie) { + return " " + + get + " " + HttpShortMessage.HTTP + "/" + http + HttpShortMessage.CRLF + + Request.HOST + ": " + host + HttpShortMessage.CRLF + + ((userA == null) ? "" : Request.USER_AGENT + ": " + userA + HttpShortMessage.CRLF) + + ((accept == null) ? "" : Request.ACCEPT + ": " + accept + HttpShortMessage.CRLF) + + ((acceptL == null) ? "" : Request.ACCEPT_LANGUAGE + ": " + acceptL + HttpShortMessage.CRLF) + + ((acceptE == null) ? "" : Request.ACCEPT_ENCODING + ": " + acceptE + HttpShortMessage.CRLF) + + ((dnt == null) ? "" : Request.DO_NOT_TRACK + ": " + dnt + HttpShortMessage.CRLF) + + ((connection == null) ? "" : Request.CONNECTION + ": " + connection + HttpShortMessage.CRLF) + + ((upgradeIR == null) ? "" : Request.UPGRADE_INSECURE_REQUESTS + ": " + upgradeIR + HttpShortMessage.CRLF) + + ((cookie == null) ? "" : Request.COOKIE + ": " + cookie + HttpShortMessage.CRLF) + + "" + HttpShortMessage.CRLF; // Empty body + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/httpshort/message/server/Response.java b/scribble-demos/scrib/betty16/src/betty16/lec1/httpshort/message/server/Response.java new file mode 100644 index 000000000..aa1cd2468 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/httpshort/message/server/Response.java @@ -0,0 +1,99 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec1.httpshort.message.server; + +import betty16.lec1.httpshort.HttpShort.Http.Http; +import betty16.lec1.httpshort.message.HttpShortMessage; + +public class Response extends HttpShortMessage +{ + private static final long serialVersionUID = 1L; + + // TODO: make case-insensitive + public static final String DATE = "Date"; + public static final String CONTENT_TYPE = "Content-Type"; + public static final String _404 = "404"; + public static final String _200 = "200"; + public static final String ACCEPT_RANGES = "Accept-Ranges"; + public static final String LAST_MODIFIED = "Last-Modified"; + public static final String VARY = "Vary"; + public static final String SERVER = "Server"; + public static final String STRICT_TRANSPORT_SECURITY = "Strict-Transport-Security"; + public static final String VIA = "Via"; + public static final String ETAG = "ETag"; + public static final String CONTENT_LENGTH = "Content-Length"; + + /*HTTP/1.1 200 OK + Date: Mon, 13 Jun 2016 19:42:34 GMT + Server: Apache + Strict-Transport-Security: max-age=31536000; preload; includeSubDomains + Strict-Transport-Security: max-age=31536000; preload; includeSubDomains // BUG? (Apache configuration) + Last-Modified: Thu, 14 Apr 2016 12:46:24 GMT + ETag: "74a-53071482f6e0f" + Accept-Ranges: bytes + Content-Length: 1866 + Vary: Accept-Encoding + Content-Type: text/html + Via: 1.1 www.doc.ic.ac.uk*/ + public Response(String httpv, String ack, String date, String server, String strictTS, String lastMod, + String eTag, String acceptR, String contentL, String vary, String contentT, String via, String body) + { + super(Http.Response, getHeadersAndBody( + httpv, ack, date, server, strictTS, lastMod, eTag, acceptR, contentL, vary, contentT, via, body)); + } + + /*public Response(String httpv, String ack, String contentL, String body) + { + super(Http.RESPONSE, getHeadersAndBody(httpv, ack, contentL, body)); + }*/ + + public Response(String httpv, String body) + { + this(httpv, Response._200 + " OK", null, null, null, null, null, null, Integer.toString(body.length()), null, null, null, body); + } + + // ack includes "op", e.g. 200, 404, ... + protected static String getHeadersAndBody(String httpv, String ack, String date, String server, String strictTS, String lastMod, + String eTag, String acceptR, String contentL, String vary, String contentT, String via, String body) + { + if (!ack.startsWith(Response._200) && !ack.startsWith(Response._404)) + { + throw new RuntimeException("[TODO]: " + ack); + } + return "/" + httpv + " " + + ack + HttpShortMessage.CRLF // Hardcoded + + ((date == null) ? "" : Response.DATE + ": " + date + HttpShortMessage.CRLF) + + ((server == null) ? "" : Response.SERVER + ": " + server + HttpShortMessage.CRLF) + + ((strictTS == null) ? "" : Response.STRICT_TRANSPORT_SECURITY + ": " + strictTS + HttpShortMessage.CRLF) + + ((lastMod == null) ? "" : Response.LAST_MODIFIED + ": " + lastMod + HttpShortMessage.CRLF) + + ((eTag == null) ? "" : Response.ETAG + ": " + eTag + HttpShortMessage.CRLF) + + ((acceptR == null) ? "" : Response.ACCEPT_RANGES + ": " + acceptR + HttpShortMessage.CRLF) + + Response.CONTENT_LENGTH + ": " + contentL + HttpShortMessage.CRLF + + ((vary == null) ? "" : Response.VARY + ": " + vary + HttpShortMessage.CRLF) + + ((contentT == null) ? "" : Response.CONTENT_TYPE + ": " + contentT + HttpShortMessage.CRLF) + + ((via == null) ? "" : Response.VIA + ": " + via + HttpShortMessage.CRLF) + + HttpShortMessage.CRLF // Empty line for end of headers + + body + HttpShortMessage.CRLF; + } + + /*// 404 + protected static String getHeadersAndBody(String httpv, String ack, String contentL, String body) + { + return "/" + httpv + " " + + _404 + ack + HttpMessage.CRLF // Hardcoded + + Response.CONTENT_LENGTH + ": " + contentL + HttpMessage.CRLF + + HttpMessage.CRLF // Empty line for end of headers + + body + HttpMessage.CRLF; + }*/ +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/misc/Choice1.scr b/scribble-demos/scrib/betty16/src/betty16/lec1/misc/Choice1.scr new file mode 100644 index 000000000..1b967f952 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/misc/Choice1.scr @@ -0,0 +1,14 @@ +module betty16.lec1.misc.Choice1; + + +global protocol Proto1(role A, role B, role C) { + choice at A { + 1() from A to B; + 3() from B to C; + 4() from C to A; + } or { + 2() from A to B; + 3() from B to C; + 5() from C to A; + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/misc/Choice2.scr b/scribble-demos/scrib/betty16/src/betty16/lec1/misc/Choice2.scr new file mode 100644 index 000000000..de85481c1 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/misc/Choice2.scr @@ -0,0 +1,69 @@ +module betty16.lec1.misc.Choice2; + + +global protocol Proto1(role A, role B, role C) { + choice at A { + 1() from A to B; + 3() from B to C; + 4() from C to A; + } or { + 2() from A to B; + 3() from B to C; + 4() from C to A; + } +} + + +global protocol Proto2(role A, role B, role C) { + choice at A { + 1() from A to B; + 3() from B to C; + do Merge2(A, C); + } or { + 2() from A to B; + 3() from B to C; + do Merge2(A, C); + } +} + +aux global protocol Merge2(role A, role C) { + 4() from C to A; +} + + +global protocol Proto3(role A, role B, role C) { + choice at A { + 1() from A to B; + 3() from B to C; + do Merge3(A, C); + } or { + 2() from A to B; + 3() from B to C; + do Merge3(A, C); + } +} + +aux global protocol Merge3(role A, role C) { + 4() from A to C; +} + + +global protocol Proto4(role A, role B, role C) { + choice at A { + 1() from A to B; + 3() from B to C; + do Merge4(A, C); + } or { + 2() from A to B; + 3() from B to C; + do Merge4(A, C); + } +} + +aux global protocol Merge4(role A, role C) { + choice at A { + 4() from A to C; + } or { + 5() from A to C; + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/misc/Choice3.scr b/scribble-demos/scrib/betty16/src/betty16/lec1/misc/Choice3.scr new file mode 100644 index 000000000..9e0ffd1b7 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/misc/Choice3.scr @@ -0,0 +1,15 @@ +module betty16.lec1.misc.Choice3; + + +global protocol Proto1(role A, role B, role C) { + choice at A { + 1() from A to B; + 2() from A to C; + 3() from B to C; + 4() from C to A; + } or { + 1b() from A to B; + 3() from B to C; + 4() from C to A; + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/misc/Choice4.scr b/scribble-demos/scrib/betty16/src/betty16/lec1/misc/Choice4.scr new file mode 100644 index 000000000..9ff9de823 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/misc/Choice4.scr @@ -0,0 +1,11 @@ +module betty16.lec1.misc.Choice4; + + +global protocol Proto1(role A, role B, role C) { + choice at A { + 1() from A to B; + 2() from A to C; + } or { + 3() from A to B; + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/misc/LocatedChoice.scr b/scribble-demos/scrib/betty16/src/betty16/lec1/misc/LocatedChoice.scr new file mode 100644 index 000000000..406f9cd31 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/misc/LocatedChoice.scr @@ -0,0 +1,23 @@ +module betty16.lec1.misc.LocatedChoice; + + +global protocol Proto1(role A, role B, role C) { + choice at A { + 1() from A to B; + 2() from A to C; + } or { + 3() from A to B; + 4() from A to C; + } +} + + +global protocol Proto2(role A, role B, role C) { + choice at A { + 1() from A to B; + 2() from A to C; + } or { + 4() from A to C; + 3() from A to B; + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/misc/LocatedChoice2.scr b/scribble-demos/scrib/betty16/src/betty16/lec1/misc/LocatedChoice2.scr new file mode 100644 index 000000000..3978d0892 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/misc/LocatedChoice2.scr @@ -0,0 +1,15 @@ +module betty16.lec1.misc.LocatedChoice2; + +data "java.lang.Integer" from "rt.jar" as Int; + +global protocol Proto1(role A, role B, role C) { + choice at A { + buyer1(Int) from A to B; // Total + (Int) from B to A; // B will pay this much + buyer2(Int) from A to C; // C will pay remainder + } or { + buyer1(Int) from A to C; // Total + (Int) from C to A; // C will pay this much + buyer2(Int) from A to B; // B will pay remainder + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/misc/Messaging.scr b/scribble-demos/scrib/betty16/src/betty16/lec1/misc/Messaging.scr new file mode 100644 index 000000000..0c30b83fb --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/misc/Messaging.scr @@ -0,0 +1,15 @@ +module betty16.lec1.misc.Messaging; + + +data "java.lang.Integer" from "rt.jar" as Int; +data "java.lang.String" from "rt.jar" as String; + + +global protocol Proto1(role A, role B) { + 123(Int, String) from A to B; +} + + +global protocol Proto2(role A, role B) { + () from A to B; +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/misc/Protocol1a.scr b/scribble-demos/scrib/betty16/src/betty16/lec1/misc/Protocol1a.scr new file mode 100644 index 000000000..3f3bf5dfd --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/misc/Protocol1a.scr @@ -0,0 +1,15 @@ +module betty16.lec1.misc.Protocol1a; + + +global protocol Proto1(role A, role B, role C) { + choice at A { + rec X { + 1() from A to B; + 1() from B to C; + continue X; + } + } or { + 2() from A to B; + 2() from B to C; + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/misc/Protocol1b.scr b/scribble-demos/scrib/betty16/src/betty16/lec1/misc/Protocol1b.scr new file mode 100644 index 000000000..6e7420adb --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/misc/Protocol1b.scr @@ -0,0 +1,15 @@ +module betty16.lec1.misc.Protocol1b; + + +global protocol Proto1(role A, role B, role C) { + choice at A { + rec X { + 1() from A to B; + //1() from B to C; + continue X; + } + } or { + 2() from A to B; + 2() from B to C; + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/misc/Protocol1c.scr b/scribble-demos/scrib/betty16/src/betty16/lec1/misc/Protocol1c.scr new file mode 100644 index 000000000..b35890270 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/misc/Protocol1c.scr @@ -0,0 +1,14 @@ +module betty16.lec1.misc.Protocol1c; + + +global protocol Proto1(role A, role B, role C) { + choice at A { + rec X { + 1() from A to B; + continue X; + } + } or { + 2() from A to B; + } + 2() from C to B; +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/misc/Protocol2.scr b/scribble-demos/scrib/betty16/src/betty16/lec1/misc/Protocol2.scr new file mode 100644 index 000000000..354563a8b --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/misc/Protocol2.scr @@ -0,0 +1,14 @@ +module betty16.lec1.misc.Protocol2; + + +global protocol Proto1(role A, role B, role C) { + rec X { + choice at A { + 1() from A to B; + continue X; + } or { + 2() from A to B; + 2() from B to C; + } + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/misc/Recursion1.scr b/scribble-demos/scrib/betty16/src/betty16/lec1/misc/Recursion1.scr new file mode 100644 index 000000000..cdca4bc74 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/misc/Recursion1.scr @@ -0,0 +1,16 @@ +module betty16.lec1.misc.Recursion1; + + +global protocol Proto1(role A, role B) { + rec X { + choice at A { + 1() from A to B; + continue X; + 2() from A to B; + } or { + 3() from A to B; + } + 4() from A to B; + } + 5() from A to B; +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/misc/Recursion2.scr b/scribble-demos/scrib/betty16/src/betty16/lec1/misc/Recursion2.scr new file mode 100644 index 000000000..21b89abfa --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/misc/Recursion2.scr @@ -0,0 +1,10 @@ +module betty16.lec1.misc.Recursion2; + + +global protocol Proto1(role A, role B) { + rec X { + 1() from A to B; + continue X; + } + 2() from A to B; +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/misc/Recursion3.scr b/scribble-demos/scrib/betty16/src/betty16/lec1/misc/Recursion3.scr new file mode 100644 index 000000000..2bb13ab5c --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/misc/Recursion3.scr @@ -0,0 +1,10 @@ +module betty16.lec1.misc.Recursion3; + + +global protocol Proto1(role A, role B, role C, role D) { + rec X { + 1() from A to B; + continue X; + } + 2() from C to D; +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/misc/RoleEnabling.scr b/scribble-demos/scrib/betty16/src/betty16/lec1/misc/RoleEnabling.scr new file mode 100644 index 000000000..a6b4b9147 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/misc/RoleEnabling.scr @@ -0,0 +1,17 @@ +module betty16.lec1.misc.RoleEnabling; + + +global protocol Proto1(role A, role B, role C) { + choice at A { + 1() from A to B; + 1() from B to C; + } or { + //2() from A to B; + 2() from B to A; + choice at B { + 3() from B to C; + } or { + 4() from B to C; + } + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec1/nego/Negotiate.scr b/scribble-demos/scrib/betty16/src/betty16/lec1/nego/Negotiate.scr new file mode 100644 index 000000000..adbf5e88a --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec1/nego/Negotiate.scr @@ -0,0 +1,70 @@ +/** + * Assuming scribblec.sh in scribble-java root directory: + * + * E.g., ./scribblec.sh scribble-demos/scrib/betty16/src/betty16/lec1/nego/Negotiate.scr -fsm Nego1 C + */ + + +module betty16.lec1.nego.Negotiate; + + +data "test.nego.SAP" from "test/nego/SAP.java" as SAP; + + +// C = Consumer, P = Producer +global protocol Nego1(role C, role P) { + propose(SAP) from C to P; + rec X { + choice at P { + accpt() from P to C; + confirm() from C to P; + } or { + reject() from P to C; + } or { + propose(SAP) from P to C; + choice at C { + accpt() from C to P; + confirm() from P to C; + } or { + reject() from C to P; + } or { + propose(SAP) from C to P; + continue X; + } + } + } +} + + +global protocol Nego2(role C, role P) +{ + propose(SAP) from C to P; + do Nego2Aux(P, C); +} + +aux global protocol Nego2Aux(role A, role B) +{ + choice at A { + accpt() from A to B; + confirm() from B to A; + } or { + reject() from A to B; + } or { + propose(SAP) from A to B; + do Nego2Aux(B, A); + } +} + + +global protocol Nego3(role C, role P) +{ + propose(SAP) from C to P; + choice at P { + accpt() from P to C; + confirm() from C to P; + } or { + reject() from P to C; + } or { + do Nego3(P, C); + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec2/adder/Adder.scr b/scribble-demos/scrib/betty16/src/betty16/lec2/adder/Adder.scr new file mode 100644 index 000000000..9216608b8 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec2/adder/Adder.scr @@ -0,0 +1,34 @@ +/** + * Assuming scribblec.sh in scribble-java root directory: + * + * (1) Check Adder protocol: + * $ ./scribblec.sh scribble-demos/scrib/betty16/src/betty16/lec2/adder/Adder.scr + * + * (2) Build Endpoint FSM for C: + * $ ./scribblec.sh scribble-demos/scrib/betty16/src/betty16/lec2/adder/Adder.scr -fsm Adder C + * + * (3) Generate Endpoint API ("Session API" and "State Channel API") for C: + * $ ./scribblec.sh -d scribble-demos/scrib/betty16/src/ scribble-demos/scrib/betty16/src/betty16/lec2/adder/Adder.scr -api Adder C + * + * (4) [Java] Generate javadoc from Endpoint API(s): modules/demos/scrib/betty16/src/betty16/lec2/adder/Adder.scr + * $ javadoc -cp scribble-core/target/classes:scribble-runtime/target/classes:scribble-demos/scrib/betty16/src -subpackages betty16.lec2.adder.Adder.Adder -d scribble-demos/scrib/betty16/javadoc/adder + * + */ + + +module betty16.lec2.adder.Adder; + + +data "java.lang.Integer" from "rt.jar" as Integer; + + +global protocol Adder(role C, role S) { + choice at C { + Add(Integer, Integer) from C to S; + Res(Integer) from S to C; + do Adder(C, S); + } or { + Bye() from C to S; + Bye() from S to C; + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec2/adder/AdderC1.java b/scribble-demos/scrib/betty16/src/betty16/lec2/adder/AdderC1.java new file mode 100644 index 000000000..57a379759 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec2/adder/AdderC1.java @@ -0,0 +1,54 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec2.adder; + +import static betty16.lec2.adder.Adder.Adder.Adder.Add; +import static betty16.lec2.adder.Adder.Adder.Adder.Bye; +import static betty16.lec2.adder.Adder.Adder.Adder.C; +import static betty16.lec2.adder.Adder.Adder.Adder.Res; +import static betty16.lec2.adder.Adder.Adder.Adder.S; + +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import betty16.lec2.adder.Adder.Adder.Adder; +import betty16.lec2.adder.Adder.Adder.roles.C; +import betty16.lec2.adder.Adder.Adder.statechans.C.Adder_C_1; + +public class AdderC1 { + + public static void main(String[] args) throws Exception { + Adder adder = new Adder(); + try (MPSTEndpoint client = new MPSTEndpoint<>(adder, C, + new ObjectStreamFormatter())) { + client.request(S, SocketChannelEndpoint::new, "localhost", 8888); + System.out.println("C: " + new AdderC1().run(client)); + } + } + + private int run(MPSTEndpoint client) throws Exception { + Buf i = new Buf<>(1); + + new Adder_C_1(client) + .send(S, Add, i.val, i.val) + .receive(S, Res, i) + .send(S, Add, i.val, i.val) + .receive(S, Res, i) + .send(S, Bye).receive(S, Bye); + + return i.val; + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec2/adder/AdderC2.java b/scribble-demos/scrib/betty16/src/betty16/lec2/adder/AdderC2.java new file mode 100644 index 000000000..e9d9968e2 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec2/adder/AdderC2.java @@ -0,0 +1,53 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec2.adder; + +import static betty16.lec2.adder.Adder.Adder.Adder.Add; +import static betty16.lec2.adder.Adder.Adder.Adder.Bye; +import static betty16.lec2.adder.Adder.Adder.Adder.C; +import static betty16.lec2.adder.Adder.Adder.Adder.Res; +import static betty16.lec2.adder.Adder.Adder.Adder.S; + +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import betty16.lec2.adder.Adder.Adder.Adder; +import betty16.lec2.adder.Adder.Adder.roles.C; +import betty16.lec2.adder.Adder.Adder.statechans.C.Adder_C_1; + +public class AdderC2 { + + public static void main(String[] args) throws Exception { + Adder adder = new Adder(); + try (MPSTEndpoint client = new MPSTEndpoint<>(adder, C, + new ObjectStreamFormatter())) { + client.request(S, SocketChannelEndpoint::new, "localhost", 8888); + System.out.println("C: " + new AdderC2().run(client)); + } + } + + private int run(MPSTEndpoint client) throws Exception { + Buf i = new Buf<>(1); + + Adder_C_1 s1 = new Adder_C_1(client); + for (int j = 0; j < 10; j++) { + s1 = s1.send(S, Add, i.val, i.val).receive(S, Res, i); + } + s1.send(S, Bye).receive(S, Bye); + + return i.val; + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec2/adder/AdderS1.java b/scribble-demos/scrib/betty16/src/betty16/lec2/adder/AdderS1.java new file mode 100644 index 000000000..e7c7e8f86 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec2/adder/AdderS1.java @@ -0,0 +1,77 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec2.adder; + +import static betty16.lec2.adder.Adder.Adder.Adder.Add; +import static betty16.lec2.adder.Adder.Adder.Adder.Bye; +import static betty16.lec2.adder.Adder.Adder.Adder.C; +import static betty16.lec2.adder.Adder.Adder.Adder.Res; +import static betty16.lec2.adder.Adder.Adder.Adder.S; + +import java.io.IOException; + +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.net.SocketChannelServer; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import betty16.lec2.adder.Adder.Adder.Adder; +import betty16.lec2.adder.Adder.Adder.roles.S; +import betty16.lec2.adder.Adder.Adder.statechans.S.Adder_S_1; +import betty16.lec2.adder.Adder.Adder.statechans.S.Adder_S_1_Cases; + +public class AdderS1 { + + public static void main(String[] args) throws Exception { + try (ScribServerSocket ss = new SocketChannelServer(8888)) { + while (true) { + Adder adder = new Adder(); + try (MPSTEndpoint server = new MPSTEndpoint<>(adder, S, + new ObjectStreamFormatter())) { + server.accept(ss, C); + new AdderS1().run(new Adder_S_1(server)); + } catch (ScribRuntimeException | IOException | ClassNotFoundException e) { + e.printStackTrace(); + } + } + } + } + + private void run(Adder_S_1 s1) throws Exception { + Buf i1 = new Buf<>(); + Buf i2 = new Buf<>(); + while (true) { + Adder_S_1_Cases cases = s1.branch(C); + switch (cases.op) { + case Add: s1 = cases.receive(Add, i1, i2).send(C, Res, i1.val+i2.val); break; + case Bye: cases.receive(Bye).send(C, Bye); return; + } + } + } + + /* + private EndSocket run(Adder_S_1 s1, Buf i1, Buf i2) throws Exception { + Adder_S_1_Cases cases = s1.branch(C); + switch (cases.op) { + case Add: return run( + cases.receive(Add, i1, i2).send(C, Res, i1.val+i2.val), + i1, i2); + case Bye: return cases.receive(Bye).send(C, Bye); + default: throw new RuntimeException("Dummy."); // Java + } + } + //*/ +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec2/adder/AdderS2.java b/scribble-demos/scrib/betty16/src/betty16/lec2/adder/AdderS2.java new file mode 100644 index 000000000..bd64eaade --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec2/adder/AdderS2.java @@ -0,0 +1,69 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec2.adder; + +import static betty16.lec2.adder.Adder.Adder.Adder.Bye; +import static betty16.lec2.adder.Adder.Adder.Adder.C; +import static betty16.lec2.adder.Adder.Adder.Adder.Res; +import static betty16.lec2.adder.Adder.Adder.Adder.S; + +import java.io.IOException; + +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.net.SocketChannelServer; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import betty16.lec2.adder.Adder.Adder.Adder; +import betty16.lec2.adder.Adder.Adder.ops.Add; +import betty16.lec2.adder.Adder.Adder.ops.Bye; +import betty16.lec2.adder.Adder.Adder.roles.S; +import betty16.lec2.adder.Adder.Adder.statechans.S.Adder_S_1; +import betty16.lec2.adder.Adder.Adder.statechans.S.Adder_S_1_Handler; +import betty16.lec2.adder.Adder.Adder.statechans.S.Adder_S_2; +import betty16.lec2.adder.Adder.Adder.statechans.S.Adder_S_3; + +public class AdderS2 implements Adder_S_1_Handler { + + public static void main(String[] args) throws Exception { + try (ScribServerSocket ss = new SocketChannelServer(8888)) { + while (true) { + Adder adder = new Adder(); + try (MPSTEndpoint server = new MPSTEndpoint<>(adder, S, + new ObjectStreamFormatter())) { + server.accept(ss, C); + + new Adder_S_1(server).branch(C, new AdderS2()); + } catch (ScribRuntimeException | IOException | ClassNotFoundException e) { + e.printStackTrace(); + } + } + } + } + + @Override + public void receive(Adder_S_2 s2, Add op, Buf arg1, + Buf arg2) + throws ScribRuntimeException, IOException, ClassNotFoundException + { + s2.send(C, Res, arg1.val + arg2.val).branch(C, this); + } + + @Override + public void receive(Adder_S_3 s3, Bye op) throws ScribRuntimeException, IOException { + s3.send(C, Bye); + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec2/adder/FibC1.java b/scribble-demos/scrib/betty16/src/betty16/lec2/adder/FibC1.java new file mode 100644 index 000000000..32dec9fc4 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec2/adder/FibC1.java @@ -0,0 +1,55 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec2.adder; + +import static betty16.lec2.adder.Adder.Adder.Adder.Add; +import static betty16.lec2.adder.Adder.Adder.Adder.Bye; +import static betty16.lec2.adder.Adder.Adder.Adder.C; +import static betty16.lec2.adder.Adder.Adder.Adder.Res; +import static betty16.lec2.adder.Adder.Adder.Adder.S; + +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import betty16.lec2.adder.Adder.Adder.Adder; +import betty16.lec2.adder.Adder.Adder.roles.C; +import betty16.lec2.adder.Adder.Adder.statechans.C.Adder_C_1; +import betty16.lec2.adder.Adder.Adder.statechans.C.EndSocket; + +public class FibC1 { + + public static void main(String[] args) throws Exception { + Adder adder = new Adder(); + try (MPSTEndpoint client = new MPSTEndpoint<>(adder, C, + new ObjectStreamFormatter())) { + client.request(S, SocketChannelEndpoint::new, "localhost", 8888); + + Buf i1 = new Buf<>(0); + Buf i2 = new Buf<>(1); + int N = 10; + new FibC1().fibo(new Adder_C_1(client), i1, i2, N); + System.out.println(N + ": " + i1.val); + } + } + + // Post: i1.val is the i-th Fibonacci number + private EndSocket fibo(Adder_C_1 c1, Buf i1, Buf i2, int i) + throws Exception { + return (i > 0) + ? fibo(c1.send(S, Add, i1.val, i1.val=i2.val).receive(S, Res, i2), i1, i2, i-1) + : c1.send(S, Bye).receive(S, Bye); + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec2/adder/MyAdderC.java b/scribble-demos/scrib/betty16/src/betty16/lec2/adder/MyAdderC.java new file mode 100644 index 000000000..05371bf54 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec2/adder/MyAdderC.java @@ -0,0 +1,55 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec2.adder; + +import static betty16.lec2.adder.Adder.Adder.Adder.C; +import static betty16.lec2.adder.Adder.Adder.Adder.S; + +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import betty16.lec2.adder.Adder.Adder.Adder; +import betty16.lec2.adder.Adder.Adder.roles.C; +import betty16.lec2.adder.Adder.Adder.statechans.C.Adder_C_1; + +public class MyAdderC { + + public static void main(String[] args) throws Exception { + Adder adder = new Adder(); + try (MPSTEndpoint client = new MPSTEndpoint<>(adder, C, + new ObjectStreamFormatter())) { + client.request(S, SocketChannelEndpoint::new, "localhost", 8888); + System.out.println("C: " + new MyAdderC().run(client)); + } + } + + private int run(MPSTEndpoint client) throws Exception { + Buf i = new Buf<>(1); + + Adder_C_1 c1 = new Adder_C_1(client); + + // TODO + + return i.val; + } +} + + + + + + + diff --git a/scribble-demos/scrib/betty16/src/betty16/lec2/adder/MyAdderS.java b/scribble-demos/scrib/betty16/src/betty16/lec2/adder/MyAdderS.java new file mode 100644 index 000000000..2abeacb50 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec2/adder/MyAdderS.java @@ -0,0 +1,77 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec2.adder; + +import static betty16.lec2.adder.Adder.Adder.Adder.Add; +import static betty16.lec2.adder.Adder.Adder.Adder.Bye; +import static betty16.lec2.adder.Adder.Adder.Adder.C; +import static betty16.lec2.adder.Adder.Adder.Adder.Res; +import static betty16.lec2.adder.Adder.Adder.Adder.S; + +import java.io.IOException; + +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.net.SocketChannelServer; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import betty16.lec2.adder.Adder.Adder.Adder; +import betty16.lec2.adder.Adder.Adder.roles.S; +import betty16.lec2.adder.Adder.Adder.statechans.S.Adder_S_1; +import betty16.lec2.adder.Adder.Adder.statechans.S.Adder_S_1_Cases; + +public class MyAdderS { + + public static void main(String[] args) throws Exception { + try (ScribServerSocket ss = new SocketChannelServer(8888)) { + while (true) { + Adder adder = new Adder(); + try (MPSTEndpoint server = new MPSTEndpoint<>(adder, S, + new ObjectStreamFormatter())) { + server.accept(ss, C); + new MyAdderS().run(new Adder_S_1(server)); + } catch (ScribRuntimeException | IOException | ClassNotFoundException e) { + e.printStackTrace(); + } + } + } + } + + private void run(Adder_S_1 s1) throws Exception { + Buf i1 = new Buf<>(); + Buf i2 = new Buf<>(); + while (true) { + Adder_S_1_Cases cases = s1.branch(C); + switch (cases.op) { + case Add: s1 = cases.receive(Add, i1, i2).send(C, Res, i1.val+i2.val); break; + case Bye: cases.receive(Bye).send(C, Bye); return; + } + } + } + + /* + private EndSocket run(Adder_S_1 s1, Buf i1, Buf i2) throws Exception { + Adder_S_1_Cases cases = s1.branch(C); + switch (cases.op) { + case Add: return run( + cases.receive(Add, i1, i2).send(C, Res, i1.val+i2.val), + i1, i2); + case Bye: return cases.receive(Bye).send(C, Bye); + default: throw new RuntimeException("Dummy."); // Java + } + } + //*/ +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec2/adder/MyFibC.java b/scribble-demos/scrib/betty16/src/betty16/lec2/adder/MyFibC.java new file mode 100644 index 000000000..6129bc53c --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec2/adder/MyFibC.java @@ -0,0 +1,51 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec2.adder; + +import static betty16.lec2.adder.Adder.Adder.Adder.C; +import static betty16.lec2.adder.Adder.Adder.Adder.S; + +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import betty16.lec2.adder.Adder.Adder.Adder; +import betty16.lec2.adder.Adder.Adder.roles.C; +import betty16.lec2.adder.Adder.Adder.statechans.C.Adder_C_1; +import betty16.lec2.adder.Adder.Adder.statechans.C.EndSocket; + +public class MyFibC { + + public static void main(String[] args) throws Exception { + Adder adder = new Adder(); + try (MPSTEndpoint client = new MPSTEndpoint<>(adder, C, new ObjectStreamFormatter())) { + client.request(S, SocketChannelEndpoint::new, "localhost", 8888); + + Buf i1 = new Buf<>(0); + Buf i2 = new Buf<>(1); + int N = 10; + new MyFibC().fibo(new Adder_C_1(client), i1, i2, N); + System.out.println("C: " + i1.val); + } + } + + // Result: i1.val contains the N-th Fibonacci number + private EndSocket fibo(Adder_C_1 c1, Buf i1, Buf i2, int i) throws Exception { + + //... c1.send(S, Add, i1.val, i1.val=i2.val) ... + + throw new RuntimeException("[TODO]"); + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec2/smtp/MySmtpC.java b/scribble-demos/scrib/betty16/src/betty16/lec2/smtp/MySmtpC.java new file mode 100644 index 000000000..3f2f3bb51 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec2/smtp/MySmtpC.java @@ -0,0 +1,80 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec2.smtp; + +import static betty16.lec2.smtp.Smtp.Smtp.Smtp.C; +import static betty16.lec2.smtp.Smtp.Smtp.Smtp.S; +import static betty16.lec2.smtp.Smtp.Smtp.Smtp._220; + +import org.scribble.runtime.net.SSLSocketChannelWrapper; +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.statechans.LinearSocket; + +import betty16.lec2.smtp.Smtp.Smtp.Smtp; +import betty16.lec2.smtp.Smtp.Smtp.roles.C; +import betty16.lec2.smtp.Smtp.Smtp.statechans.C.EndSocket; +import betty16.lec2.smtp.Smtp.Smtp.statechans.C.Smtp_C_1; +import betty16.lec2.smtp.Smtp.Smtp.statechans.C.Smtp_C_4; +import betty16.lec2.smtp.Smtp.Smtp.statechans.C.Smtp_C_6; +import betty16.lec2.smtp.Smtp.Smtp.statechans.C.ioifaces.Select_C_S_Ehlo; +import betty16.lec2.smtp.Smtp.Smtp.statechans.C.ioifaces.Succ_In_S_250; +import betty16.lec2.smtp.message.SmtpMessageFormatter; +import betty16.lec2.smtp.message.client.StartTls; + +public class MySmtpC { + + public static void main(String[] args) throws Exception { + String host = "smtp.cc.ic.ac.uk"; + int port = 25; + + Smtp smtp = new Smtp(); + try (MPSTEndpoint client = new MPSTEndpoint<>(smtp, C, + new SmtpMessageFormatter())) { + client.request(S, SocketChannelEndpoint::new, host, port); + new MySmtpC().run(new Smtp_C_1(client)); + } + } + + private EndSocket run(Smtp_C_1 c1) throws Exception { + /* + + return + doInit( + doStartTls( + doInit(c1.async(S, _220))) + ) + .send(S, new Quit()); + + /*/ + throw new RuntimeException("[TODO]: "); + //*/ + } + + private + // succ(S?250) <- S!{ Ehlo: ?? } + Succ_In_S_250 doInit(Select_C_S_Ehlo c) throws Exception { + + throw new RuntimeException("[TODO]: "); + + } + + private Smtp_C_6 doStartTls(Smtp_C_4 c4) throws Exception { + return + LinearSocket.wrapClient( + c4.send(S, new StartTls()) + .async(S, _220) + , S, SSLSocketChannelWrapper::new); + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec2/smtp/Smtp.scr b/scribble-demos/scrib/betty16/src/betty16/lec2/smtp/Smtp.scr new file mode 100644 index 000000000..243dd6bb2 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec2/smtp/Smtp.scr @@ -0,0 +1,62 @@ +/** + * Note: this simplified example does not include the actual mail exchanges. + * See, e.g., scribble-demos/scrib/smtp/src/Smtp.scr for a more complete version. + * + * Assuming scribblec.sh in scribble-java root directory: + * + * (1) Generate Endpoint API for C + * $ ./scribblec.sh -d scribble-demos/scrib/betty16/src scribble-demos/scrib/betty16/src/betty16/lec2/smtp/Smtp.scr -api Smtp C + * + * (2) Generate Endpoint API for C with session subtyping interfaces + * $ ./scribblec.sh -d scribble-demos/scrib/betty16/src scribble-demos/scrib/betty16/src/betty16/lec2/smtp/Smtp.scr -subtypes -api Smtp C + * + */ + + +module betty16.lec2.smtp.Smtp; + + +sig "betty16.lec2.smtp.message.server._220" + from "betty16/smtp/message/server/_220.java" as 220; +sig "betty16.lec2.smtp.message.server._250" + from "betty16/smtp/message/server/_250.java" as 250; +sig "betty16.lec2.smtp.message.server._250d" + from "betty16/smtp/message/server/_250d.java" as 250d; + + +sig "betty16.lec2.smtp.message.client.Ehlo" + from "betty16/smtp/message/client/Ehlo.java" as Ehlo; +sig "betty16.lec2.smtp.message.client.StartTls" + from "betty16/smtp/message/client/StartTls.java" as StartTls; +sig "betty16.lec2.smtp.message.client.Quit" + from "betty16/smtp/message/client/Quit.java" as Quit; + + +global protocol Smtp(role C, role S) { + 220 from S to C; + //choice at C { + do Init(C, S); + do StartTls(C, S); + do Init(C, S); + Quit from C to S; + /*} or { + Quit from C to S; + }*/ +} + +aux global protocol Init(role C, role S) { + Ehlo from C to S; + rec X { + choice at S { + 250d from S to C; + continue X; + } or { + 250 from S to C; + } + } +} + +aux global protocol StartTls(role C, role S) { + StartTls from C to S; + 220 from S to C; +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec2/smtp/SmtpC1.java b/scribble-demos/scrib/betty16/src/betty16/lec2/smtp/SmtpC1.java new file mode 100644 index 000000000..95b941dbb --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec2/smtp/SmtpC1.java @@ -0,0 +1,105 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec2.smtp; + +import static betty16.lec2.smtp.Smtp.Smtp.Smtp.C; +import static betty16.lec2.smtp.Smtp.Smtp.Smtp.S; +import static betty16.lec2.smtp.Smtp.Smtp.Smtp._220; +import static betty16.lec2.smtp.Smtp.Smtp.Smtp._250; +import static betty16.lec2.smtp.Smtp.Smtp.Smtp._250d; + +import org.scribble.runtime.net.SSLSocketChannelWrapper; +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.statechans.LinearSocket; +import org.scribble.runtime.util.Buf; + +import betty16.lec2.smtp.Smtp.Smtp.Smtp; +import betty16.lec2.smtp.Smtp.Smtp.roles.C; +import betty16.lec2.smtp.Smtp.Smtp.statechans.C.EndSocket; +import betty16.lec2.smtp.Smtp.Smtp.statechans.C.Smtp_C_1; +import betty16.lec2.smtp.Smtp.Smtp.statechans.C.Smtp_C_2; +import betty16.lec2.smtp.Smtp.Smtp.statechans.C.Smtp_C_3; +import betty16.lec2.smtp.Smtp.Smtp.statechans.C.Smtp_C_3_Cases; +import betty16.lec2.smtp.Smtp.Smtp.statechans.C.Smtp_C_4; +import betty16.lec2.smtp.Smtp.Smtp.statechans.C.Smtp_C_6; +import betty16.lec2.smtp.Smtp.Smtp.statechans.C.Smtp_C_7; +import betty16.lec2.smtp.Smtp.Smtp.statechans.C.Smtp_C_7_Cases; +import betty16.lec2.smtp.Smtp.Smtp.statechans.C.Smtp_C_8; +import betty16.lec2.smtp.message.SmtpMessageFormatter; +import betty16.lec2.smtp.message.client.Ehlo; +import betty16.lec2.smtp.message.client.Quit; +import betty16.lec2.smtp.message.client.StartTls; + +public class SmtpC1 +{ + public static void main(String[] args) throws Exception { + String host = "...smtp server..."; + int port = 25; + + Smtp smtp = new Smtp(); + try (MPSTEndpoint client = new MPSTEndpoint<>(smtp, C, + new SmtpMessageFormatter())) { + client.request(S, SocketChannelEndpoint::new, host, port); + new SmtpC1().run(new Smtp_C_1(client)); + } + } + + private EndSocket run(Smtp_C_1 c1) throws Exception { + return + doInit( + doStartTls( + doInit(c1.async(S, _220))) + ) + .send(S, new Quit()); + } + + private Smtp_C_4 doInit(Smtp_C_2 c2) throws Exception { + Smtp_C_3 c3 = c2.send(S, new Ehlo("test")); + Buf buf = new Buf<>(); + while (true) { + Smtp_C_3_Cases cases = c3.branch(S); + switch (cases.getOp()) { + case _250d: c3 = cases.receive(S, _250d, buf); System.out.print(buf.val); break; + case _250: return printlnBuf(cases.receive(S, _250, buf), buf); + } + } + } + + private Smtp_C_6 doStartTls(Smtp_C_4 c4) throws Exception { + return + LinearSocket.wrapClient( + c4.send(S, new StartTls()) + .async(S, _220) + , S, SSLSocketChannelWrapper::new); + } + + private Smtp_C_8 doInit(Smtp_C_6 c6) throws Exception { + Smtp_C_7 c7 = c6.send(S, new Ehlo("test")); + Buf buf = new Buf<>(); + while (true) { + Smtp_C_7_Cases cases = c7.branch(S); + switch (cases.getOp()) { + case _250d: c7 = cases.receive(S, _250d, buf); System.out.print(buf.val); break; + case _250: return printlnBuf(cases.receive(S, _250, buf), buf); + } + } + } + + private static > S printlnBuf(S s, B b) { + System.out.println(b.val); + return s; + } +} + diff --git a/scribble-demos/scrib/betty16/src/betty16/lec2/smtp/SmtpC2.java b/scribble-demos/scrib/betty16/src/betty16/lec2/smtp/SmtpC2.java new file mode 100644 index 000000000..349a4c652 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec2/smtp/SmtpC2.java @@ -0,0 +1,100 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec2.smtp; + +import static betty16.lec2.smtp.Smtp.Smtp.Smtp.C; +import static betty16.lec2.smtp.Smtp.Smtp.Smtp.S; +import static betty16.lec2.smtp.Smtp.Smtp.Smtp._220; +import static betty16.lec2.smtp.Smtp.Smtp.Smtp._250; +import static betty16.lec2.smtp.Smtp.Smtp.Smtp._250d; + +import org.scribble.runtime.net.SSLSocketChannelWrapper; +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.statechans.LinearSocket; +import org.scribble.runtime.util.Buf; + +import betty16.lec2.smtp.Smtp.Smtp.Smtp; +import betty16.lec2.smtp.Smtp.Smtp.roles.C; +import betty16.lec2.smtp.Smtp.Smtp.statechans.C.EndSocket; +import betty16.lec2.smtp.Smtp.Smtp.statechans.C.Smtp_C_1; +import betty16.lec2.smtp.Smtp.Smtp.statechans.C.ioifaces.Branch_C_S_250__S_250d; +import betty16.lec2.smtp.Smtp.Smtp.statechans.C.ioifaces.Case_C_S_250__S_250d; +import betty16.lec2.smtp.Smtp.Smtp.statechans.C.ioifaces.Receive_C_S_220; +import betty16.lec2.smtp.Smtp.Smtp.statechans.C.ioifaces.Select_C_S_Ehlo; +import betty16.lec2.smtp.Smtp.Smtp.statechans.C.ioifaces.Select_C_S_Quit; +import betty16.lec2.smtp.Smtp.Smtp.statechans.C.ioifaces.Select_C_S_StartTls; +import betty16.lec2.smtp.Smtp.Smtp.statechans.C.ioifaces.Succ_In_S_220; +import betty16.lec2.smtp.Smtp.Smtp.statechans.C.ioifaces.Succ_In_S_250; +import betty16.lec2.smtp.message.SmtpMessageFormatter; +import betty16.lec2.smtp.message.client.Ehlo; +import betty16.lec2.smtp.message.client.Quit; +import betty16.lec2.smtp.message.client.StartTls; + +public class SmtpC2 { + + public static void main(String[] args) throws Exception { + String host = "...smtp server..."; + int port = 25; + + Smtp smtp = new Smtp(); + try (MPSTEndpoint client = new MPSTEndpoint<>(smtp, C, + new SmtpMessageFormatter())) { + client.request(S, SocketChannelEndpoint::new, host, port); + new SmtpC2().run(new Smtp_C_1(client)); + } + } + + private EndSocket run(Smtp_C_1 c1) throws Exception { + return + doInit( + doStartTls( + doInit(c1.async(S, _220)).to(Select_C_S_StartTls.cast) + ).to(Select_C_S_Ehlo.cast) + ) + .to(Select_C_S_Quit.cast) + .send(S, new Quit()) + .to(EndSocket.cast); + } + + private Succ_In_S_250 doInit(Select_C_S_Ehlo c) throws Exception { + Branch_C_S_250__S_250d b = + c.send(S, new Ehlo("test")).to(Branch_C_S_250__S_250d.cast); + Buf buf = new Buf<>(); + for (Case_C_S_250__S_250d cases = b.branch(S); true; cases = b.branch(S)) { + switch (cases.getOp()) { + case _250: return printlnBuf(cases.receive(S, _250, buf), buf); + case _250d: b = cases.receive(S, _250d, buf).to(Branch_C_S_250__S_250d.cast); System.out.print(buf.val); break; + } + } + } + + private Succ_In_S_220 doStartTls(Select_C_S_StartTls c) throws Exception { + return + LinearSocket.wrapClient( + c.send(S, new StartTls()).to(Receive_C_S_220.cast) + .async(S, _220) + , S, SSLSocketChannelWrapper::new); + } + + private static > S printlnBuf(S s, B b) { + System.out.println(b.val); + return s; + } + + /*private static > S printBuf(S s, B b) { + System.out.print(b.val); + return s; + }*/ +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec2/smtp/SmtpC3.java b/scribble-demos/scrib/betty16/src/betty16/lec2/smtp/SmtpC3.java new file mode 100644 index 000000000..2d2e31285 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec2/smtp/SmtpC3.java @@ -0,0 +1,121 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec2.smtp; + +import static betty16.lec2.smtp.Smtp.Smtp.Smtp.C; +import static betty16.lec2.smtp.Smtp.Smtp.Smtp.S; +import static betty16.lec2.smtp.Smtp.Smtp.Smtp._220; +import static betty16.lec2.smtp.Smtp.Smtp.Smtp._250; +import static betty16.lec2.smtp.Smtp.Smtp.Smtp._250d; + +import org.scribble.runtime.net.SSLSocketChannelWrapper; +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.statechans.LinearSocket; +import org.scribble.runtime.util.Buf; + +import betty16.lec2.smtp.Smtp.Smtp.Smtp; +import betty16.lec2.smtp.Smtp.Smtp.roles.C; +import betty16.lec2.smtp.Smtp.Smtp.statechans.C.EndSocket; +import betty16.lec2.smtp.Smtp.Smtp.statechans.C.Smtp_C_1; +import betty16.lec2.smtp.Smtp.Smtp.statechans.C.Smtp_C_4; +import betty16.lec2.smtp.Smtp.Smtp.statechans.C.Smtp_C_6; +import betty16.lec2.smtp.Smtp.Smtp.statechans.C.ioifaces.Branch_C_S_250__S_250d; +import betty16.lec2.smtp.Smtp.Smtp.statechans.C.ioifaces.Case_C_S_250__S_250d; +import betty16.lec2.smtp.Smtp.Smtp.statechans.C.ioifaces.Select_C_S_Ehlo; +import betty16.lec2.smtp.Smtp.Smtp.statechans.C.ioifaces.Succ_In_S_250; +import betty16.lec2.smtp.message.SmtpMessageFormatter; +import betty16.lec2.smtp.message.client.Ehlo; +import betty16.lec2.smtp.message.client.Quit; +import betty16.lec2.smtp.message.client.StartTls; + +public class SmtpC3 { + + public static void main(String[] args) throws Exception { + String host = "...smtp server..."; + int port = 25; + + Smtp smtp = new Smtp(); + try (MPSTEndpoint client = new MPSTEndpoint<>(smtp, C, + new SmtpMessageFormatter())) { + client.request(S, SocketChannelEndpoint::new, host, port); + new SmtpC3().run(new Smtp_C_1(client)); + } + } + + private EndSocket run(Smtp_C_1 c1) throws Exception { + return + doInit( + doStartTls( + doInit(c1.async(S, _220))) + ) + .send(S, new Quit()); + } + + /* + private + < + S1 extends Branch_C_S_250__S_250d // S1 = S?{ 250: Succ(S?250), 250d: S1 } + > + // S!Ehlo.S1 -> S2 + Succ_In_S_250 doInit(Select_C_S_Ehlo c) throws Exception { + S1 b = c.send(S, new Ehlo("test")); + Buf buf = new Buf<>(); + for (Case_C_S_250__S_250d cases = b.branch(S); true; cases = b.branch(S)) { + switch (cases.getOp()) { + case _250: return printlnBuf(cases.receive(S, _250, buf), buf); + case _250d: b = cases.receive(S, _250d, buf); System.out.print(buf.val); break; + } + } + } + //*/ + + //* + private + < + S1 extends Branch_C_S_250__S_250d, // S1 = S?{ 250: S2, 250d: S1 } + S2 extends Succ_In_S_250 // S2 = Succ(S?250) + > + // S!Ehlo.S1 -> S2 + S2 doInit(Select_C_S_Ehlo c) throws Exception { + S1 b = c.send(S, new Ehlo("test")); + Buf buf = new Buf<>(); + while (true) { + Case_C_S_250__S_250d cases = b.branch(S); + switch (cases.getOp()) { + case _250d: b = cases.receive(S, _250d, buf); System.out.print(buf.val); break; + case _250: return printlnBuf(cases.receive(S, _250, buf), buf); + } + } + } + //*/ + + private Smtp_C_6 doStartTls(Smtp_C_4 c4) throws Exception { + return + LinearSocket.wrapClient( + c4.send(S, new StartTls()) + .async(S, _220) + , S, SSLSocketChannelWrapper::new); + } + + private static > S printlnBuf(S s, B b) { + System.out.println(b.val); + return s; + } + + /*private static > S printBuf(S s, B b) { + System.out.print(b.val); + return s; + }*/ +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec2/smtp/SmtpC4.java b/scribble-demos/scrib/betty16/src/betty16/lec2/smtp/SmtpC4.java new file mode 100644 index 000000000..617cfa93d --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec2/smtp/SmtpC4.java @@ -0,0 +1,107 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec2.smtp; + +import static betty16.lec2.smtp.Smtp.Smtp.Smtp.S; +import static betty16.lec2.smtp.Smtp.Smtp.Smtp._220; + +import java.io.IOException; + +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.net.SSLSocketChannelWrapper; +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.statechans.LinearSocket; +import org.scribble.runtime.util.Buf; + +import betty16.lec2.smtp.Smtp.Smtp.Smtp; +import betty16.lec2.smtp.Smtp.Smtp.roles.C; +import betty16.lec2.smtp.Smtp.Smtp.statechans.C.Smtp_C_1; +import betty16.lec2.smtp.Smtp.Smtp.statechans.C.Smtp_C_3; +import betty16.lec2.smtp.Smtp.Smtp.statechans.C.Smtp_C_3_Handler; +import betty16.lec2.smtp.Smtp.Smtp.statechans.C.Smtp_C_4; +import betty16.lec2.smtp.Smtp.Smtp.statechans.C.Smtp_C_7; +import betty16.lec2.smtp.Smtp.Smtp.statechans.C.Smtp_C_7_Handler; +import betty16.lec2.smtp.Smtp.Smtp.statechans.C.Smtp_C_8; +import betty16.lec2.smtp.message.SmtpMessageFormatter; +import betty16.lec2.smtp.message.client.Ehlo; +import betty16.lec2.smtp.message.client.Quit; +import betty16.lec2.smtp.message.client.StartTls; +import betty16.lec2.smtp.message.server._250; +import betty16.lec2.smtp.message.server._250d; + +public class SmtpC4 { + + public static void main(String[] args) throws Exception + { + String host = "...smtp server..."; + int port = 25; + + Smtp smtp = new Smtp(); + try (MPSTEndpoint client = new MPSTEndpoint<>(smtp, Smtp.C, + new SmtpMessageFormatter())) + { + client.request(S, SocketChannelEndpoint::new, host, port); + new SmtpC4().run(new Smtp_C_1(client)); + } + } + + private void run(Smtp_C_1 c1) throws Exception { + + System.out.println("Init: "); + + c1.async(S, _220).send(S, new Ehlo("test")).branch(S, new MySmtp_C_3Handler()); + } +} + +class MySmtp_C_3Handler implements Smtp_C_3_Handler { + + @Override + public void receive(Smtp_C_3 s3, betty16.lec2.smtp.Smtp.Smtp.ops._250d op, Buf<_250d> arg) throws ScribRuntimeException, IOException, ClassNotFoundException + { + System.out.println("250-: " + arg.val.getBody()); + + s3.branch(S, this); + } + + @Override + public void receive(Smtp_C_4 s4, betty16.lec2.smtp.Smtp.Smtp.ops._250 op, Buf<_250> arg) throws ScribRuntimeException, IOException, ClassNotFoundException + { + System.out.println("250: " + arg.val.getBody()); + + LinearSocket.wrapClient( + s4.send(S, new StartTls()).async(S, _220) + , S, SSLSocketChannelWrapper::new) + .send(S, new Ehlo("test")).branch(S, new MySmtp_C_8Handler()); + } +} + +class MySmtp_C_8Handler implements Smtp_C_7_Handler { + + @Override + public void receive(Smtp_C_7 s7, betty16.lec2.smtp.Smtp.Smtp.ops._250d op, Buf<_250d> arg) throws ScribRuntimeException, IOException, ClassNotFoundException + { + System.out.println("(TLS) 250-: " + arg.val.getBody()); + + s7.branch(S, this); + } + + @Override + public void receive(Smtp_C_8 s8, betty16.lec2.smtp.Smtp.Smtp.ops._250 op, Buf<_250> arg) throws ScribRuntimeException, IOException, ClassNotFoundException + { + System.out.println("(TLS) 250: " + arg.val.getBody()); + + s8.send(S, new Quit()); + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec2/smtp/message/SmtpMessage.java b/scribble-demos/scrib/betty16/src/betty16/lec2/smtp/message/SmtpMessage.java new file mode 100644 index 000000000..b2c5f5b81 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec2/smtp/message/SmtpMessage.java @@ -0,0 +1,86 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec2.smtp.message; + +import org.scribble.runtime.message.ScribMessage; +import org.scribble.core.type.name.Op; +import org.scribble.util.Caller; + +import betty16.lec2.smtp.Smtp.Smtp.Smtp; + +public abstract class SmtpMessage extends ScribMessage +{ + public static final String _220 = "220"; + public static final String _250 = "250"; + public static final String _250_ = "250-"; + public static final String _235 = "235"; + public static final String _535 = "535"; + public static final String _501 = "501"; + public static final String _354 = "354"; + + public static final String EHLO = "ehlo"; + public static final String STARTTLS = "starttls"; + public static final String AUTH = "auth plain"; + public static final String MAIL = "mail from:"; + public static final String RCPT = "rcpt to:"; + public static final String SUBJECT = "subject:"; + public static final String DATA = "data"; + public static final String QUIT = "quit"; + + public static final String DATA_LINE = ""; + public static final String END_OF_DATA = ""; + + private static final long serialVersionUID = 1L; + + protected static final String CRLF = "\r\n"; + + public SmtpMessage(Op op) + { + super(op); + } + + public SmtpMessage(Op op, String body) + { + super(op, body); + } + + public String getBody() + { + return (this.payload.length == 0) ? "" : (String) this.payload[0]; + } + + public byte[] toBytes() + { + byte[] bs = (getOpString(this.op) + " " + getBody() + SmtpMessage.CRLF).getBytes(SmtpMessageFormatter.cs); // Can give "utf-8" as arg directly + return bs; + } + + @Override + public String toString() + { + return new String(toBytes()); + } + + protected static String getOpString(Op op) + { + return + (op.equals(Smtp._220)) ? SmtpMessage._220 + : (op.equals(Smtp._250)) ? SmtpMessage._250 + : (op.equals(Smtp._250d)) ? SmtpMessage._250_ + : (op.equals(Smtp.Ehlo)) ? SmtpMessage.EHLO + : (op.equals(Smtp.StartTls)) ? SmtpMessage.STARTTLS + : (op.equals(Smtp.Quit)) ? SmtpMessage.QUIT + : new Caller().call(() -> { throw new RuntimeException("TODO: " + op); }); + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec2/smtp/message/SmtpMessageFormatter.java b/scribble-demos/scrib/betty16/src/betty16/lec2/smtp/message/SmtpMessageFormatter.java new file mode 100644 index 000000000..9540ae25e --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec2/smtp/message/SmtpMessageFormatter.java @@ -0,0 +1,446 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec2.smtp.message; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; + +import org.scribble.runtime.message.ScribMessage; +import org.scribble.runtime.message.ScribMessageFormatter; + +import betty16.lec2.smtp.message.server._220; +import betty16.lec2.smtp.message.server._250; +import betty16.lec2.smtp.message.server._250d; + +// Currently supports only client-side reading, not server-side +public class SmtpMessageFormatter implements ScribMessageFormatter +{ + //.. fix formatting + //.. try ssl wrapper + //.. add connection (transport) actions + + public static Charset cs = Charset.forName("UTF8"); + //private static CharsetDecoder cd = cs.newDecoder(); + + public SmtpMessageFormatter() + { + + } + + @Override + public byte[] toBytes(ScribMessage m) throws IOException + { + return ((SmtpMessage) m).toBytes(); + } + + @Override + public ScribMessage fromBytes(ByteBuffer bb) throws IOException, ClassNotFoundException + { + bb.flip(); + //byte[] bs = new byte[2]; + int rem = bb.remaining(); + if (rem < 2) + { + bb.compact(); + return null; + } + + int pos = bb.position(); + String front = new String(new byte[] { bb.get(pos), bb.get(pos + 1) }, SmtpMessageFormatter.cs); + if (front.equals(SmtpMessage.CRLF)) + { + throw new RuntimeException("TODO: "); + } + + if (rem < pos + 4) + { + bb.compact(); + return null; + } + front += new String(new byte[] { bb.get(pos + 2), bb.get(pos + 3) }, SmtpMessageFormatter.cs); + int code = isStatusCode(front); + if (code > -1) + { + String body = readLine(bb, pos + 4).trim(); // Whitespace already built into the message classes + bb.compact(); + if (body == null) + { + return null; + } + switch (code) + { + case 220: return new _220(body); + case 250: + { + if (front.charAt(3) == '-') + { + return new _250d(body); + } + return new _250(body); + } + /*case 235: return new _235(body); + case 535: return new _535(body); + case 501: return new _501(body); + case 354: return new _354(body);*/ + default: throw new RuntimeException("Unknown status code " + code + ": " + body); + } + } + /*else if (front.startsWith(HttpMessage.GET)) // TODO: server-side (EHLO, STARTTLS, etc) + { + }*/ + else + { + // TODO: server-side (MAIL FROM:, RCPT TO:, etc) + String line = front + readLine(bb, pos + 4); + bb.compact(); + /*if (line == null) // deadcode + { + return null; + }*/ + throw new RuntimeException("Cannot parse message: " + line); + } + } + + private static String readLine(ByteBuffer bb, int i) throws IOException + { + StringBuilder sb = new StringBuilder(); + for (int limit = bb.limit(); i <= limit; ) + { + char c = (char) bb.get(i++); + sb.append(c); + if (c == '\r') + { + c = (char) bb.get(i++); + sb.append(c); + if (c == '\n') + { + bb.position(i); + return sb.substring(0, sb.length() - 2).toString(); + } + } + } + return null; + } + + // Duplicated from HttpMessageFormatter // FIXME: factor out + private int isStatusCode(String front) + { + String code = ""; + for (int i = 0; i < 4; i++) + { + //char c = (char) bs[i]; + char c = front.charAt(i); + if (i < 3) + { + if (c < '0' || c > '9') + { + return -1; + } + code += c; + } + else + { + if (c != ' ' && c != '-') // HACK: hypen + { + return -1; + } + } + } + return Integer.parseInt(code); + } + + /*private static String readWord(ByteBuffer bb, int i) throws IOException + { + StringBuilder sb = new StringBuilder(); + for (int limit = bb.limit(); i <= limit; ) + { + char c = (char) bb.get(i); + if (c == ' ') + { + bb.position(i); + return sb.toString(); + } + sb.append(c); + } + return null; + }*/ + + /* // Pre: flipped ready for reading + @Override + public SmtpMessage readMessage(DataInputStream dis) throws IOException + { + String header = getHeader(dis); + switch (header) + { + // FIXME: factor out text constants with Session constants? + case "220 ": + { + return new _220(getBody(dis)); + } + case "235 ": + { + return new _235(getBody(dis)); + } + case "250-": + { + return new _250_(getBody(dis)); + } + case "250 ": + { + return new _250(getBody(dis)); + } + case "354 ": + { + return new _354(getBody(dis)); + } + case "501 ": + { + return new _501(getBody(dis)); + } + case "535 ": + { + return new _535(getBody(dis)); + } + default: + { + throw new RuntimeException("Unknown header: " + header); + } + } + } + + // *4* char headers (3 digits, dash or space) + private String getHeader(DataInputStream dis) throws IOException + { + readMinimumBytes(dis, 4); + + int limit = bb.limit(); + bb.limit(4); + String header = cd.decode(bb).toString(); // updates bb position + bb.limit(limit); + bb.compact(); + bb.flip(); + return header; + } + + // Reads up to \r\n inclusive; doesn't return the \r\n + private String getBody(DataInputStream dis) throws IOException + { + int min = 2; + readMinimumBytes(dis, min); // Min should be more? + while (true) + { + String all = cd.decode(bb).toString(); // updates bb position + if (all.contains("\n")) // FIXME: didn't check exactly \r\n + { + int i = all.indexOf("\n"); + String body = all.substring(0, i - 1); + bb.position(i + 1); // \r\n -- ASCII 1-to-1 byte-char index + bb.compact(); + bb.flip(); + return body; + } + bb.rewind(); + readMinimumBytes(dis, ++min); // FIXME: buffered readLine would be more efficient + } + } + + // FIXME: min should mean min fresh (i.e. not including bb cached -- there currently is no cache: is.available doesn't work for SSLSocket, always returns 0) + private void readMinimumBytes(DataInputStream dis, int min) throws IOException + { + for (int remaining = bb.remaining(); remaining < min; remaining = bb.remaining()) + { + bb.compact(); + bb.put((byte) dis.read()); // FIXME: check for buffer overflow + bb.flip(); + } + }*/ + + @Override + public void writeMessage(DataOutputStream dos, ScribMessage m) throws IOException + { + dos.write(((SmtpMessage) m).toBytes()); + dos.flush(); + } + + @Override + public SmtpMessage readMessage(DataInputStream dis) throws IOException + { + byte[] bs = new byte[2]; + dis.readFully(bs); + String front = new String(bs, SmtpMessageFormatter.cs); + if (front.equals(SmtpMessage.CRLF)) + { + throw new RuntimeException("TODO: "); + } + bs = new byte[2]; + dis.readFully(bs); + front += new String(bs, SmtpMessageFormatter.cs); + int code = isStatusCode(front); + if (code > -1) + { + String body = readLine(dis).trim(); // Whitespace already built into the message classes + switch (code) + { + case 220: return new _220(body); + case 250: + { + if (front.charAt(3) == '-') + { + return new _250d(body); + } + return new _250(body); + } + /*case 235: return new _235(body); + case 535: return new _535(body); + case 501: return new _501(body); + case 354: return new _354(body);*/ + default: throw new RuntimeException("Unknown status code: " + code); + } + } + /*else if (front.startsWith(HttpMessage.GET)) + { + }*/ + else + { + String line = front + readLine(dis); + throw new RuntimeException("Cannot parse message: " + line); + } + } + + private static String readLine(DataInputStream dis) throws IOException + { + StringBuilder sb = new StringBuilder(); + for (; true; ) + { + char c = (char) dis.read(); // readChar is not the same + sb.append(c); + if (c == '\r') + { + c = (char) dis.read(); + sb.append(c); + if (c == '\n') + { + return sb.substring(0, sb.length() - 2).toString(); + } + } + } + } + + /*private static String readWord(DataInputStream dis) throws IOException + { + StringBuilder sb = new StringBuilder(); + for (; true; ) + { + char c = (char) dis.read(); + if (c == ' ') + { + return sb.toString(); + } + sb.append(c); + } + }*/ + + /* // Pre: flipped ready for reading + @Override + public SmtpMessage readMessage(DataInputStream dis) throws IOException + { + String header = getHeader(dis); + switch (header) + { + // FIXME: factor out text constants with Session constants? + case "220 ": + { + return new _220(getBody(dis)); + } + case "235 ": + { + return new _235(getBody(dis)); + } + case "250-": + { + return new _250_(getBody(dis)); + } + case "250 ": + { + return new _250(getBody(dis)); + } + case "354 ": + { + return new _354(getBody(dis)); + } + case "501 ": + { + return new _501(getBody(dis)); + } + case "535 ": + { + return new _535(getBody(dis)); + } + default: + { + throw new RuntimeException("Unknown header: " + header); + } + } + } + + // *4* char headers (3 digits, dash or space) + private String getHeader(DataInputStream dis) throws IOException + { + readMinimumBytes(dis, 4); + + int limit = bb.limit(); + bb.limit(4); + String header = cd.decode(bb).toString(); // updates bb position + bb.limit(limit); + bb.compact(); + bb.flip(); + return header; + } + + // Reads up to \r\n inclusive; doesn't return the \r\n + private String getBody(DataInputStream dis) throws IOException + { + int min = 2; + readMinimumBytes(dis, min); // Min should be more? + while (true) + { + String all = cd.decode(bb).toString(); // updates bb position + if (all.contains("\n")) // FIXME: didn't check exactly \r\n + { + int i = all.indexOf("\n"); + String body = all.substring(0, i - 1); + bb.position(i + 1); // \r\n -- ASCII 1-to-1 byte-char index + bb.compact(); + bb.flip(); + return body; + } + bb.rewind(); + readMinimumBytes(dis, ++min); // FIXME: buffered readLine would be more efficient + } + } + + // FIXME: min should mean min fresh (i.e. not including bb cached -- there currently is no cache: is.available doesn't work for SSLSocket, always returns 0) + private void readMinimumBytes(DataInputStream dis, int min) throws IOException + { + for (int remaining = bb.remaining(); remaining < min; remaining = bb.remaining()) + { + bb.compact(); + bb.put((byte) dis.read()); // FIXME: check for buffer overflow + bb.flip(); + } + }*/ +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec2/smtp/message/client/Ehlo.java b/scribble-demos/scrib/betty16/src/betty16/lec2/smtp/message/client/Ehlo.java new file mode 100644 index 000000000..9a5789550 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec2/smtp/message/client/Ehlo.java @@ -0,0 +1,32 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec2.smtp.message.client; + +import betty16.lec2.smtp.Smtp.Smtp.Smtp; +import betty16.lec2.smtp.message.SmtpMessage; + +public class Ehlo extends SmtpMessage +{ + private static final long serialVersionUID = 1L; + + public Ehlo() + { + super(Smtp.Ehlo); + } + + public Ehlo(String body) + { + super(Smtp.Ehlo, body); + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec2/smtp/message/client/Quit.java b/scribble-demos/scrib/betty16/src/betty16/lec2/smtp/message/client/Quit.java new file mode 100644 index 000000000..06a0cbc15 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec2/smtp/message/client/Quit.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec2.smtp.message.client; + +import betty16.lec2.smtp.Smtp.Smtp.Smtp; +import betty16.lec2.smtp.message.SmtpMessage; + +public class Quit extends SmtpMessage +{ + private static final long serialVersionUID = 1L; + + public Quit() + { + super(Smtp.Quit); + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec2/smtp/message/client/StartTls.java b/scribble-demos/scrib/betty16/src/betty16/lec2/smtp/message/client/StartTls.java new file mode 100644 index 000000000..91a81ae70 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec2/smtp/message/client/StartTls.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec2.smtp.message.client; + +import betty16.lec2.smtp.Smtp.Smtp.Smtp; +import betty16.lec2.smtp.message.SmtpMessage; + +public class StartTls extends SmtpMessage +{ + private static final long serialVersionUID = 1L; + + public StartTls() + { + super(Smtp.StartTls); + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec2/smtp/message/server/_220.java b/scribble-demos/scrib/betty16/src/betty16/lec2/smtp/message/server/_220.java new file mode 100644 index 000000000..2187da431 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec2/smtp/message/server/_220.java @@ -0,0 +1,38 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec2.smtp.message.server; + +import betty16.lec2.smtp.Smtp.Smtp.Smtp; +import betty16.lec2.smtp.message.SmtpMessage; + +public class _220 extends SmtpMessage +{ + private static final long serialVersionUID = 1L; + + public _220() + { + super(Smtp._220); + } + + public _220(String body) + { + super(Smtp._220, body); + } + + /*@Override + public Operator getOperator() + { + return Smtp._220; + }*/ +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec2/smtp/message/server/_250.java b/scribble-demos/scrib/betty16/src/betty16/lec2/smtp/message/server/_250.java new file mode 100644 index 000000000..dec23a6d7 --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec2/smtp/message/server/_250.java @@ -0,0 +1,32 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec2.smtp.message.server; + +import betty16.lec2.smtp.Smtp.Smtp.Smtp; +import betty16.lec2.smtp.message.SmtpMessage; + +public class _250 extends SmtpMessage +{ + private static final long serialVersionUID = 1L; + + public _250() + { + super(Smtp._250); + } + + public _250(String body) + { + super(Smtp._250, body); + } +} diff --git a/scribble-demos/scrib/betty16/src/betty16/lec2/smtp/message/server/_250d.java b/scribble-demos/scrib/betty16/src/betty16/lec2/smtp/message/server/_250d.java new file mode 100644 index 000000000..2bdd9c35f --- /dev/null +++ b/scribble-demos/scrib/betty16/src/betty16/lec2/smtp/message/server/_250d.java @@ -0,0 +1,40 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package betty16.lec2.smtp.message.server; + +import betty16.lec2.smtp.Smtp.Smtp.Smtp; +import betty16.lec2.smtp.message.SmtpMessage; +import betty16.lec2.smtp.message.SmtpMessageFormatter; + +public class _250d extends SmtpMessage +{ + private static final long serialVersionUID = 1L; + + public _250d() + { + super(Smtp._250d); + } + + public _250d(String body) + { + super(Smtp._250d, body); + } + + @Override + public byte[] toBytes() + { + // No space after op + return (getOpString(this.op) + getBody() + SmtpMessage.CRLF).getBytes(SmtpMessageFormatter.cs); + } +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/http/longv/HttpLong.scr b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/HttpLong.scr new file mode 100644 index 000000000..2ea18410c --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/HttpLong.scr @@ -0,0 +1,188 @@ +/** + * Assuming scribblec.sh in scribble-java root directory: + * + * ./scribblec.sh -d scribble-demos/scrib/bettybook/src scribble-demos/scrib/bettybook/src/bettybook/http/longv/HttpLong.scr -api Http C + */ + + +module bettybook.http.longv.HttpLong; + + +sig "bettybook.http.longv.message.client.RequestLine" + from "bettybook/http/longv/message/RequestLine.java" + as RequestL; // GET /~rhu/ HTTP/1.1 + +sig "bettybook.http.longv.message.client.Host" + from "bettybook/http/longv/message/Host.java" + as Host; // host: www.doc.ic.ac.uk + +sig "bettybook.http.longv.message.Body" + from "bettybook/http/longv/message/Body.java" + as Body; // ... + +sig "bettybook.http.longv.message.client.UserAgent" + from "bettybook/http/longv/message/UserAgent.java" + as UserA; // User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0 + +sig "bettybook.http.longv.message.client.Accept" + from "bettybook/http/longv/message/Accept.java" + as Accept; // Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 + +sig "bettybook.http.longv.message.client.AcceptLanguage" + from "bettybook/http/longv/message/AcceptLanguage.java" + as AcceptL; // Accept-Language: en-GB,en;q=0.5 + +sig "bettybook.http.longv.message.client.AcceptEncoding" + from "bettybook/http/longv/message/AcceptEncoding.java" + as AcceptE; // Accept-Encoding: gzip, deflate + +sig "bettybook.http.longv.message.client.DoNotTrack" + from "bettybook/http/longv/message/DoNotTrack.java" + as DNT; // DNT: 1 + +sig "bettybook.http.longv.message.client.Connection" + from "bettybook/http/longv/message/Connection.java" + as Connection; // Connection: keep-alive + +sig "bettybook.http.longv.message.client.UpgradeInsecureRequests" + from "bettybook/http/longv/message/UpgradeInsecureRequests.java" + as UpgradeIR; // Upgrade-Insecure-Requests: 1 + + +sig "bettybook.http.longv.message.server.HttpVersion" + from "bettybook/http/longv/message/HttpVersion.java" + as HttpV; // HTTP/1.1 + +sig "bettybook.http.longv.message.server._200" // "Status" line (with HttpV) + from "bettybook/http/longv/message/_200.java" + as 200; // 200 OK + +sig "bettybook.http.longv.message.server._404" + from "bettybook/http/longv/message/_404.java" + as 404; + +sig "bettybook.http.longv.message.server.Date" + from "bettybook/http/longv/message/Date.java" + as Date; // Date: Sun, 24 May 2015 21:04:36 GMT + +sig "bettybook.http.longv.message.server.Server" + from "bettybook/http/longv/message/Server.java" + as Server; // Server: Apache + +sig "bettybook.http.longv.message.server.StrictTransportSecurity" + from "bettybook/http/longv/message/StrictTransportSecurity.java" + as StrictTS; // Strict-Transport-Security: max-age=31536000; preload; includeSubDomains + +sig "bettybook.http.longv.message.server.LastModified" + from "bettybook/http/longv/message/LastModified.java" + as LastM; // Last-Modified: Sat, 23 Jul 2011 09:38:43 GMT + +sig "bettybook.http.longv.message.server.ETag" + from "bettybook/http/longv/message/ETag.java" + as ETag; // ETag: "ac6fa008-559-4a8b95908aec0" + +sig "bettybook.http.longv.message.server.AcceptRanges" + from "bettybook/http/longv/message/AcceptRanges.java" + as AcceptR; // Accept-Ranges: bytes + +sig "bettybook.http.longv.message.server.ContentLength" + from "bettybook/http/longv/message/ContentLength.java" + as ContentL; // Content-Length: 1369 + +sig "bettybook.http.longv.message.server.Vary" + from "bettybook/http/longv/message/Vary.java" + as Vary; // Vary: Accept-Encoding + +sig "bettybook.http.longv.message.server.ContentType" + from "bettybook/http/longv/message/ContentType.java" + as ContentT; // Content-Type: text/html + +sig "bettybook.http.longv.message.server.Via" + from "bettybook/http/longv/message/Via.java" + as Via; // Via: 1.1 www.doc.ic.ac.uk + + +global protocol Http(role C, role S) { + do Request(C, S); + do Response(C, S); +} + +aux global protocol Request(role C, role S) { + choice at C { + RequestL from C to S; // GET /~rhu/ HTTP/1.1 + rec X { + choice at C { + Host from C to S; // Host: www.doc.ic.ac.uk + continue X; + } or { + UserA from C to S; // User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0 + continue X; + } or { + Accept from C to S; // Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 + continue X; + } or { + AcceptL from C to S; // Accept-Language: en-GB,en;q=0.5 + continue X; + } or { + AcceptE from C to S; // Accept-Encoding: gzip, deflate + continue X; + } or { + DNT from C to S; // DNT: 1 + continue X; + } or { + Connection from C to S; // Connection: keep-alive + continue X; + } or { + UpgradeIR from C to S; // Upgrade-Insecure-Requests: 1 + continue X; + } or { + Body from C to S; + } + } + } +} + +aux global protocol Response(role C, role S) { + HttpV from S to C; // HTTP/1.1 + choice at S { + 200 from S to C; // 200 OK + } or { + 404 from S to C; + } + + rec Y { + choice at S { + Date from S to C; // Date: Sun, 24 May 2015 21:04:36 GMT + continue Y; + } or { + Server from S to C; // Server: Apache + continue Y; + } or { + StrictTS from S to C; // Strict-Transport-Security: max-age=31536000; preload; includeSubDomains + continue Y; + } or { + LastM from S to C; // Last-Modified: Sat, 23 Jul 2011 09:38:43 GMT + continue Y; + } or { + ETag from S to C; // ETag: "ac6fa008-559-4a8b95908aec0" + continue Y; + } or { + AcceptR from S to C; // Accept-Ranges: bytes + continue Y; + } or { + ContentL from S to C; // Content-Length: 1369 + continue Y; + } or { + Vary from S to C; // Vary: Accept-Encoding + continue Y; + } or { + ContentT from S to C; // Content-Type: text/html + continue Y; + } or { + Via from S to C; // Via: 1.1 www.doc.ic.ac.uk + continue Y; + } or { + Body from S to C; // Message length indicated by Content-Length + } + } +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/http/longv/HttpLongC.java b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/HttpLongC.java new file mode 100644 index 000000000..33b06b8e5 --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/HttpLongC.java @@ -0,0 +1,105 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.http.longv; + +import static bettybook.http.longv.HttpLong.Http.Http.AcceptR; +import static bettybook.http.longv.HttpLong.Http.Http.Body; +import static bettybook.http.longv.HttpLong.Http.Http.C; +import static bettybook.http.longv.HttpLong.Http.Http.ContentL; +import static bettybook.http.longv.HttpLong.Http.Http.ContentT; +import static bettybook.http.longv.HttpLong.Http.Http.Date; +import static bettybook.http.longv.HttpLong.Http.Http.ETag; +import static bettybook.http.longv.HttpLong.Http.Http.HttpV; +import static bettybook.http.longv.HttpLong.Http.Http.LastM; +import static bettybook.http.longv.HttpLong.Http.Http.S; +import static bettybook.http.longv.HttpLong.Http.Http.Server; +import static bettybook.http.longv.HttpLong.Http.Http.StrictTS; +import static bettybook.http.longv.HttpLong.Http.Http.Vary; +import static bettybook.http.longv.HttpLong.Http.Http.Via; +import static bettybook.http.longv.HttpLong.Http.Http._200; +import static bettybook.http.longv.HttpLong.Http.Http._404; + +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import bettybook.http.longv.HttpLong.Http.Http; +import bettybook.http.longv.HttpLong.Http.roles.C; +import bettybook.http.longv.HttpLong.Http.statechans.C.EndSocket; +import bettybook.http.longv.HttpLong.Http.statechans.C.Http_C_1; +import bettybook.http.longv.HttpLong.Http.statechans.C.Http_C_3; +import bettybook.http.longv.HttpLong.Http.statechans.C.Http_C_4_Cases; +import bettybook.http.longv.HttpLong.Http.statechans.C.Http_C_5; +import bettybook.http.longv.HttpLong.Http.statechans.C.Http_C_5_Cases; +import bettybook.http.longv.message.Body; +import bettybook.http.longv.message.HttpLongMessageFormatter; +import bettybook.http.longv.message.client.Host; +import bettybook.http.longv.message.client.RequestLine; + +public class HttpLongC { + + public static void main(String[] args) throws Exception { + Http http = new Http(); + try (MPSTEndpoint client = new MPSTEndpoint<>(http, C, + new HttpLongMessageFormatter())) { + String host = "example.com"; int port = 80; String file = "/"; + //String host = "localhost"; int port = 8080; String file = "/"; + + client.request(S, SocketChannelEndpoint::new, host, port); + new HttpLongC().run(new Http_C_1(client), host, file); + } + } + + public void run(Http_C_1 s1, String host, String file) throws Exception { + doResponse(doRequest(s1, host, file)); + } + + private Http_C_3 doRequest(Http_C_1 s1, String host, String file) throws Exception { + return s1.send(S, new RequestLine(file, "1.1")) + .send(S, new Host(host)) + .send(S, new Body("")); + } + + private void doResponse(Http_C_3 s3) throws Exception { + Http_C_4_Cases cases = s3.async(S, HttpV).branch(S); + switch (cases.op) { + case _200: doResponseAux(cases.receive(_200)); break; + case _404: doResponseAux(cases.receive(_404)); break; + default: throw new RuntimeException("[TODO]: " + cases.op); + } + } + + private EndSocket doResponseAux(Http_C_5 c5) throws Exception { + Http_C_5_Cases cases = c5.branch(S); + switch (cases.op) { + case AcceptR: return doResponseAux(cases.receive(AcceptR)); + case ContentL: return doResponseAux(cases.receive(ContentL)); + case ContentT: return doResponseAux(cases.receive(ContentT)); + case Date: return doResponseAux(cases.receive(Date)); + case ETag: return doResponseAux(cases.receive(ETag)); + case LastM: return doResponseAux(cases.receive(LastM)); + case Server: return doResponseAux(cases.receive(Server)); + case StrictTS: return doResponseAux(cases.receive(StrictTS)); + case Vary: return doResponseAux(cases.receive(Vary)); + case Via: return doResponseAux(cases.receive(Via)); + case Body: { + Buf buf_body = new Buf<>(); + EndSocket end = cases.receive(Body, buf_body); + System.out.println(buf_body.val.getBody()); + return end; + } + default: throw new RuntimeException("[TODO]: " + cases.op); + } + } +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/http/longv/HttpLongS.java b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/HttpLongS.java new file mode 100644 index 000000000..5fd4ceefa --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/HttpLongS.java @@ -0,0 +1,100 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.http.longv; + +import static bettybook.http.longv.HttpLong.Http.Http.Accept; +import static bettybook.http.longv.HttpLong.Http.Http.AcceptE; +import static bettybook.http.longv.HttpLong.Http.Http.AcceptL; +import static bettybook.http.longv.HttpLong.Http.Http.Body; +import static bettybook.http.longv.HttpLong.Http.Http.C; +import static bettybook.http.longv.HttpLong.Http.Http.Connection; +import static bettybook.http.longv.HttpLong.Http.Http.DNT; +import static bettybook.http.longv.HttpLong.Http.Http.Host; +import static bettybook.http.longv.HttpLong.Http.Http.RequestL; +import static bettybook.http.longv.HttpLong.Http.Http.S; +import static bettybook.http.longv.HttpLong.Http.Http.UpgradeIR; +import static bettybook.http.longv.HttpLong.Http.Http.UserA; + +import java.io.IOException; + +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.net.SocketChannelServer; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import bettybook.http.longv.HttpLong.Http.Http; +import bettybook.http.longv.HttpLong.Http.roles.S; +import bettybook.http.longv.HttpLong.Http.statechans.S.Http_S_1; +import bettybook.http.longv.HttpLong.Http.statechans.S.Http_S_2; +import bettybook.http.longv.HttpLong.Http.statechans.S.Http_S_2_Cases; +import bettybook.http.longv.message.Body; +import bettybook.http.longv.message.HttpLongMessageFormatter; +import bettybook.http.longv.message.server.ContentLength; +import bettybook.http.longv.message.server.HttpVersion; +import bettybook.http.longv.message.server._200; + +public class HttpLongS +{ + public static void main(String[] args) throws Exception + { + try (ScribServerSocket ss = new SocketChannelServer(8080)) { + while (true) { + Http http = new Http(); + try (MPSTEndpoint server = new MPSTEndpoint<>(http, S, + new HttpLongMessageFormatter())) { + server.accept(ss, C); + + run(new Http_S_1(server)); + } + catch (IOException | ClassNotFoundException | ScribRuntimeException e) + { + e.printStackTrace(); + } + } + } + } + + private static void run(Http_S_1 s1) + throws ClassNotFoundException, ScribRuntimeException, IOException { + Buf buf = new Buf<>(); + + Http_S_2 s2 = s1.receive(C, RequestL, buf); + System.out.println("Requested: " + buf.val); + + Y: while (true) { + Http_S_2_Cases cases = s2.branch(C); + switch (cases.op) { + case Accept: s2 = cases.receive(Accept, buf); break; + case AcceptE: s2 = cases.receive(AcceptE, buf); break; + case AcceptL: s2 = cases.receive(AcceptL, buf); break; + case Body: + { + String body = "Hello, World!"; + cases.receive(Body, buf) + .send(C, new HttpVersion("1.1")) + .send(C, new _200("OK")) + .send(C, new ContentLength(body.length())) + .send(C, new Body(body)); + break Y; + } + case Connection: s2 = cases.receive(Connection, buf); break; + case DNT: s2 = cases.receive(DNT, buf); break; + case UpgradeIR: s2 = cases.receive(UpgradeIR, buf); break; + case Host: s2 = cases.receive(Host, buf); break; + case UserA: s2 = cases.receive(UserA, buf); break; + } + } + } +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/Body.java b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/Body.java new file mode 100644 index 000000000..a013fda47 --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/Body.java @@ -0,0 +1,32 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.http.longv.message; + +import bettybook.http.longv.HttpLong.Http.Http; + +public class Body extends HttpLongMessage +{ + private static final long serialVersionUID = 1L; + + public Body(String body) + { + super(Http.Body, body); + } + + @Override + public byte[] toBytes() + { + return (getOpString(this.op) + getBody()).getBytes(HttpLongMessageFormatter.cs); // opString should be empty + } +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/HeaderField.java b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/HeaderField.java new file mode 100644 index 000000000..9ea724145 --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/HeaderField.java @@ -0,0 +1,26 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.http.longv.message; + +import org.scribble.core.type.name.Op; + +public abstract class HeaderField extends HttpLongMessage +{ + private static final long serialVersionUID = 1L; + + public HeaderField(Op name, String value) + { + super(name, ": " + value + " "); + } +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/HttpLongMessage.java b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/HttpLongMessage.java new file mode 100644 index 000000000..7b4cce573 --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/HttpLongMessage.java @@ -0,0 +1,152 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.http.longv.message; + +import org.scribble.core.type.name.Op; +import org.scribble.runtime.message.ScribMessage; + +import bettybook.http.longv.HttpLong.Http.Http; + +// Unlike ScribMessage, HttpMessage is not actually "sent", but we use it as the base class since the socket API takes ScribMessages +public abstract class HttpLongMessage extends ScribMessage +{ + private static final long serialVersionUID = 1L; + + // " " after ops done by HeaderField + public static final String GET = "GET"; + public static final String HTTP = "HTTP"; + public static final String HOST = "Host"; + + public static final String USER_AGENT = "User-Agent"; + public static final String ACCEPT = "Accept"; + public static final String ACCEPT_LANGUAGE = "Accept-Language"; + public static final String ACCEPT_ENCODING = "Accept-Encoding"; + public static final String DO_NOT_TRACK = "DNT"; + public static final String CONNECTION = "Connection"; + public static final String UPGRADE_INSECURE_REQUESTS = "Upgrade-Insecure-Requests"; + + public static final String DATE = "Date"; + public static final String CONTENT_TYPE = "Content-Type"; + public static final String _404 = "404"; + public static final String _200 = "200"; + public static final String ACCEPT_RANGES = "Accept-Ranges"; + public static final String LAST_MODIFIED = "Last-Modified"; + public static final String VARY = "Vary"; + public static final String SERVER = "Server"; + public static final String STRICT_TRANSPORT_SECURITY = "Strict-Transport-Security"; + public static final String VIA = "Via"; + public static final String ETAG = "ETag"; + public static final String CONTENT_LENGTH = "Content-Length"; + + protected static final String CRLF = "\r\n"; + + public HttpLongMessage(Op op) + { + super(op); + } + + public HttpLongMessage(Op op, String body) + { + super(op, body); + } + + public String getBody() + { + return (this.payload.length == 0) ? "" : (String) this.payload[0]; + } + + public byte[] toBytes() + { + return (getOpString(this.op) + getBody() + HttpLongMessage.CRLF).getBytes(HttpLongMessageFormatter.cs); // Can give "utf-8" as arg directly + } + + @Override + public String toString() + { + return new String(toBytes()); + } + + // " " after ops done by HeaderField + protected static String getOpString(Op op) + { + if (op.equals(Http.ContentL)) + { + return HttpLongMessage.CONTENT_LENGTH; + } + else if (op.equals(Http.ETag)) + { + return HttpLongMessage.ETAG; + } + else if (op.equals(Http.Body)) + { + return HttpLongMessage.CRLF; // This CRLF "op" actually enacts the empty line for end-of-headers + } + else if (op.equals(Http.Via)) + { + return HttpLongMessage.VIA; + } + else if (op.equals(Http.Server)) + { + return HttpLongMessage.SERVER; + } + else if (op.equals(Http.Vary)) + { + return HttpLongMessage.VARY; + } + else if (op.equals(HttpLongMessage.CRLF)) + { + return ""; + } + else if (op.equals(Http.RequestL)) // FIXME: not just GET (POST..) + { + return HttpLongMessage.GET; + } + else if (op.equals(Http.LastM)) + { + return HttpLongMessage.LAST_MODIFIED; + } + else if (op.equals(Http.AcceptR)) + { + return HttpLongMessage.ACCEPT_RANGES; + } + else if (op.equals(Http.Host)) + { + return HttpLongMessage.HOST; + } + else if (op.equals(Http.HttpV)) + { + return HttpLongMessage.HTTP; + } + else if (op.equals(Http._200)) + { + return HttpLongMessage._200; + } + else if (op.equals(Http._404)) + { + return HttpLongMessage._404; + } + else if (op.equals(Http.ContentT)) + { + return HttpLongMessage.CONTENT_TYPE; + } + else if (op.equals(Http.Date)) + { + return HttpLongMessage.DATE; + } + else + { + throw new RuntimeException("TODO: " + op); + } + } +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/HttpLongMessageFormatter.java b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/HttpLongMessageFormatter.java new file mode 100644 index 000000000..2ff68850c --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/HttpLongMessageFormatter.java @@ -0,0 +1,413 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.http.longv.message; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; + +import org.scribble.runtime.message.ScribMessage; +import org.scribble.runtime.message.ScribMessageFormatter; + +import bettybook.http.longv.message.client.Accept; +import bettybook.http.longv.message.client.AcceptEncoding; +import bettybook.http.longv.message.client.AcceptLanguage; +import bettybook.http.longv.message.client.Connection; +import bettybook.http.longv.message.client.DoNotTrack; +import bettybook.http.longv.message.client.Host; +import bettybook.http.longv.message.client.RequestLine; +import bettybook.http.longv.message.client.UpgradeInsecureRequests; +import bettybook.http.longv.message.client.UserAgent; +import bettybook.http.longv.message.server.AcceptRanges; +import bettybook.http.longv.message.server.ContentLength; +import bettybook.http.longv.message.server.ContentType; +import bettybook.http.longv.message.server.Date; +import bettybook.http.longv.message.server.ETag; +import bettybook.http.longv.message.server.HttpVersion; +import bettybook.http.longv.message.server.LastModified; +import bettybook.http.longv.message.server.Server; +import bettybook.http.longv.message.server.StrictTransportSecurity; +import bettybook.http.longv.message.server.Vary; +import bettybook.http.longv.message.server.Via; +import bettybook.http.longv.message.server._200; +import bettybook.http.longv.message.server._404; + +public class HttpLongMessageFormatter implements ScribMessageFormatter +{ + public static final Charset cs = Charset.forName("UTF8"); + //private static CharsetDecoder cd = cs.newDecoder(); + + private int len = -1; + + public HttpLongMessageFormatter() + { + + } + + @Override + public byte[] toBytes(ScribMessage m) throws IOException + { + return ((HttpLongMessage) m).toBytes(); + } + + @Override + public ScribMessage fromBytes(ByteBuffer bb) throws IOException, ClassNotFoundException + { + bb.flip(); + int rem = bb.remaining(); + if (rem < 2) + { + bb.compact(); + return null; + } + + int pos = bb.position(); + String front = new String(new byte[] { bb.get(pos), bb.get(pos + 1) }, HttpLongMessageFormatter.cs); + if (front.equals(HttpLongMessage.CRLF)) // not sound? -- actually, due to sess types it is safe (same reason why interpreting any of these messages without context is sound) -- parsing doesn't have to follow the *full protocol* BNF any more to be sound + { + if (this.len == -1) + { + return new Body(""); + } + if (rem < this.len + 2) + { + bb.compact(); + return null; + } + //String body = readLine(dis) + HttpMessage.CRLF; // HACK: assumes at least 1 CRLF + StringBuffer sb = new StringBuffer(); + //for (int i = body.length(); i < this.len; i++) + for (int i = 0; i < this.len; i++) + { + sb.append((char) bb.get()); + } + this.len = -1; + //return new Body(body + sb.toString()); + return new Body(sb.toString()); + } + + if (rem < pos + 4) + { + bb.compact(); + return null; + } + //byte[] bs = new byte[2]; + //dis.readFully(bs); + front += new String(new byte[] { bb.get(pos + 2), bb.get(pos + 3) }, HttpLongMessageFormatter.cs); + // FIXME: factor out with HttpMessage op strings + int code = isStatusCode(front); + if (code > -1) + { + String reason = readLine(bb, pos + 4).trim(); // Whitespace already built into the message classes + bb.compact(); + if (reason == null) + { + return null; + } + switch (code) + { + case 200: return new _200(reason); + case 404: return new _404(reason); + default: throw new RuntimeException("Unknown status code: " + code); + } + } + else if (front.startsWith(HttpLongMessage.GET)) + { + String reql = readLine(bb, pos + 4).trim(); + bb.compact(); + if (reql == null) + { + return null; + } + String target = reql.substring(0, reql.indexOf(' ')); + String vers = reql.substring(reql.indexOf(' ') + 1).trim(); + vers = vers.substring(vers.indexOf('/') + 1); + return new RequestLine(target, vers); + } + else if (front.equals(HttpLongMessage.HTTP)) + { + //dis.read(); // '/' + if (rem < pos + 5) + { + bb.compact(); + return null; + } + String word = readWord(bb, pos + 5); + bb.compact(); + if (word == null) + { + return null; + } + return new HttpVersion(word); + } + else + { + String line = readLine(bb, pos + 4); + bb.compact(); + if (line == null) + { + return null; + } + line = front + line; + int colon = line.indexOf(':'); + if (colon > -1) + { + String name = line.substring(0, colon); + String value = line.substring(colon + 1).trim(); // Whitespace already built into the message classes + switch (name) + { + case HttpLongMessage.HOST: return new Host("value"); + case HttpLongMessage.USER_AGENT: return new UserAgent(value); + case HttpLongMessage.ACCEPT: return new Accept(value); + case HttpLongMessage.ACCEPT_LANGUAGE: return new AcceptLanguage(value); + case HttpLongMessage.ACCEPT_ENCODING: return new AcceptEncoding(value); + case HttpLongMessage.DO_NOT_TRACK: return new DoNotTrack(Integer.parseInt(value)); + case HttpLongMessage.CONNECTION: return new Connection(value); + case HttpLongMessage.UPGRADE_INSECURE_REQUESTS: return new UpgradeInsecureRequests(Integer.parseInt(value)); + + case HttpLongMessage.DATE: return new Date(value); + case HttpLongMessage.SERVER: return new Server(value); + case HttpLongMessage.STRICT_TRANSPORT_SECURITY: return new StrictTransportSecurity(value); + case HttpLongMessage.LAST_MODIFIED: return new LastModified(value); + case HttpLongMessage.ETAG: return new ETag(value); + case HttpLongMessage.ACCEPT_RANGES: return new AcceptRanges(value); + case HttpLongMessage.CONTENT_LENGTH: + { + len = Integer.parseInt(value.trim()); + return new ContentLength(len); + } + case HttpLongMessage.VARY: return new Vary(value); + case HttpLongMessage.CONTENT_TYPE: return new ContentType(value); + case HttpLongMessage.VIA: return new Via(value); + default: { + //throw new RuntimeException("Cannot parse header field: " + line); + System.err.println("Cannot parse header field, attempting to skip: " + line); + return fromBytes(bb); + } + } + } + else + { + throw new RuntimeException("Cannot parse message: " + line); + } + } + } + + private static String readLine(ByteBuffer bb, int i) throws IOException + { + StringBuilder sb = new StringBuilder(); + for (int limit = bb.limit(); i <= limit; ) + { + char c = (char) bb.get(i++); // readChar is not the same + sb.append(c); + if (c == '\r') + { + if (i > limit) + { + return null; + } + c = (char) bb.get(i++); + sb.append(c); + if (c == '\n') + { + bb.position(i); + return sb.substring(0, sb.length() - 2).toString(); + } + } + } + return null; + } + + private static String readWord(ByteBuffer bb, int i) throws IOException + { + StringBuilder sb = new StringBuilder(); + for (int limit = bb.limit(); i <= limit; ) + { + char c = (char) bb.get(i++); + if (c == ' ') + { + bb.position(i); + return sb.toString(); + } + sb.append(c); + } + return null; + } + + //private int isStatusCode(byte[] bs) + private int isStatusCode(String front) + { + String code = ""; + for (int i = 0; i < 4; i++) + { + //char c = (char) bs[i]; + char c = front.charAt(i); + if (i < 3) + { + if (c < '0' || c > '9') + { + return -1; + } + code += c; + } + else + { + if (c != ' ') + { + return -1; + } + } + } + return Integer.parseInt(code); + } + + + + // FIXME: delete + @Deprecated @Override + public void writeMessage(DataOutputStream dos, ScribMessage m) throws IOException + { + dos.write(((HttpLongMessage) m).toBytes()); + dos.flush(); + } + + @Deprecated @Override + public ScribMessage readMessage(DataInputStream dis) throws IOException + { + byte[] bs = new byte[2]; + dis.readFully(bs); + String front = new String(bs, HttpLongMessageFormatter.cs); + if (front.equals(HttpLongMessage.CRLF)) // not sound? -- actually, due to sess types it is safe (same reason why interpreting any of these messages without context is sound) -- parsing doesn't have to follow the *full protocol* BNF any more to be sound + { + if (this.len == -1) + { + return new Body(""); + } + //String body = readLine(dis) + HttpMessage.CRLF; // HACK: assumes at least 1 CRLF + StringBuffer sb = new StringBuffer(); + //for (int i = body.length(); i < this.len; i++) + for (int i = 0; i < this.len; i++) + { + sb.append((char) dis.read()); + } + this.len = -1; + //return new Body(body + sb.toString()); + return new Body(sb.toString()); + } + + bs = new byte[2]; + dis.readFully(bs); + front += new String(bs, HttpLongMessageFormatter.cs); + // FIXME: factor out with HttpMessage op strings + int code = isStatusCode(front); + if (code > -1) + { + String reason = readLine(dis).trim(); // Whitespace already built into the message classes + switch (code) + { + case 200: return new _200(reason); + case 404: return new _404(reason); + default: throw new RuntimeException("Unknown status code: " + code); + } + } + else if (front.startsWith(HttpLongMessage.GET)) + { + String reql = readLine(dis).trim(); + String target = reql.substring(0, reql.indexOf(' ')); + String vers = reql.substring(reql.indexOf(' ') + 1).trim(); + vers = vers.substring(vers.indexOf('/') + 1); + return new RequestLine(target, vers); + } + else if (front.equals(HttpLongMessage.HTTP)) + { + dis.read(); // '/' + String word = readWord(dis); + return new HttpVersion(word); + } + else + { + String line = front + readLine(dis); + int colon = line.indexOf(':'); + if (colon > -1) + { + String name = line.substring(0, colon); + String value = line.substring(colon + 1).trim(); // Whitespace already built into the message classes + switch (name) + { + case HttpLongMessage.HOST: return new Host("value"); + case HttpLongMessage.USER_AGENT: return new UserAgent(value); + case HttpLongMessage.ACCEPT: return new Accept(value); + case HttpLongMessage.ACCEPT_LANGUAGE: return new AcceptLanguage(value); + case HttpLongMessage.ACCEPT_ENCODING: return new AcceptEncoding(value); + case HttpLongMessage.DO_NOT_TRACK: return new DoNotTrack(Integer.parseInt(value)); + case HttpLongMessage.CONNECTION: return new Connection(value); + + case HttpLongMessage.DATE: return new Date(value); + case HttpLongMessage.SERVER: return new Server(value); + case HttpLongMessage.LAST_MODIFIED: return new LastModified(value); + case HttpLongMessage.ETAG: return new ETag(value); + case HttpLongMessage.ACCEPT_RANGES: return new AcceptRanges(value); + case HttpLongMessage.CONTENT_LENGTH: + { + len = Integer.parseInt(value.trim()); + return new ContentLength(len); + } + case HttpLongMessage.VARY: return new Vary(value); + case HttpLongMessage.CONTENT_TYPE: return new ContentType(value); + case HttpLongMessage.VIA: return new Via(value); + default: throw new RuntimeException("Cannot parse header field: " + line); + } + } + else + { + throw new RuntimeException("Cannot parse message: " + line); + } + } + } + + private static String readLine(DataInputStream dis) throws IOException + { + StringBuilder sb = new StringBuilder(); + for (; true; ) + { + char c = (char) dis.read(); // readChar is not the same + sb.append(c); + if (c == '\r') + { + c = (char) dis.read(); + sb.append(c); + if (c == '\n') + { + return sb.substring(0, sb.length() - 2).toString(); + } + } + } + } + + private static String readWord(DataInputStream dis) throws IOException + { + StringBuilder sb = new StringBuilder(); + for (; true; ) + { + char c = (char) dis.read(); + if (c == ' ') + { + return sb.toString(); + } + sb.append(c); + } + } +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/StartLine.java b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/StartLine.java new file mode 100644 index 000000000..ac7122583 --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/StartLine.java @@ -0,0 +1,26 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.http.longv.message; + +import org.scribble.core.type.name.Op; + +public abstract class StartLine extends HttpLongMessage +{ + private static final long serialVersionUID = 1L; + + public StartLine(Op op, String body) + { + super(op, body); + } +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/client/Accept.java b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/client/Accept.java new file mode 100644 index 000000000..9ba0138c8 --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/client/Accept.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.http.longv.message.client; + +import bettybook.http.longv.HttpLong.Http.Http; +import bettybook.http.longv.message.HeaderField; + +public class Accept extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public Accept(String text) + { + super(Http.Accept, text); + } +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/client/AcceptEncoding.java b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/client/AcceptEncoding.java new file mode 100644 index 000000000..93ae038eb --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/client/AcceptEncoding.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.http.longv.message.client; + +import bettybook.http.longv.HttpLong.Http.Http; +import bettybook.http.longv.message.HeaderField; + +public class AcceptEncoding extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public AcceptEncoding(String text) + { + super(Http.AcceptE, text); + } +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/client/AcceptLanguage.java b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/client/AcceptLanguage.java new file mode 100644 index 000000000..b09b325c3 --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/client/AcceptLanguage.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.http.longv.message.client; + +import bettybook.http.longv.HttpLong.Http.Http; +import bettybook.http.longv.message.HeaderField; + +public class AcceptLanguage extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public AcceptLanguage(String text) + { + super(Http.AcceptL, text); + } +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/client/Connection.java b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/client/Connection.java new file mode 100644 index 000000000..58ad475f1 --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/client/Connection.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.http.longv.message.client; + +import bettybook.http.longv.HttpLong.Http.Http; +import bettybook.http.longv.message.HeaderField; + +public class Connection extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public Connection(String text) + { + super(Http.Connection, text); + } +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/client/DoNotTrack.java b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/client/DoNotTrack.java new file mode 100644 index 000000000..43df8a147 --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/client/DoNotTrack.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.http.longv.message.client; + +import bettybook.http.longv.HttpLong.Http.Http; +import bettybook.http.longv.message.HeaderField; + +public class DoNotTrack extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public DoNotTrack(int val) + { + super(Http.DNT, Integer.toString(val)); + } +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/client/Host.java b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/client/Host.java new file mode 100644 index 000000000..355ef0904 --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/client/Host.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.http.longv.message.client; + +import bettybook.http.longv.HttpLong.Http.Http; +import bettybook.http.longv.message.HeaderField; + +public class Host extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public Host(String host) + { + super(Http.Host, host); + } +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/client/RequestLine.java b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/client/RequestLine.java new file mode 100644 index 000000000..90cbdd8d7 --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/client/RequestLine.java @@ -0,0 +1,29 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.http.longv.message.client; + +import bettybook.http.longv.HttpLong.Http.Http; +import bettybook.http.longv.message.StartLine; + + +// FIXME: not just GET +public class RequestLine extends StartLine +{ + private static final long serialVersionUID = 1L; + + public RequestLine(String reqtarget, String vers) + { + super(Http.RequestL, " " + reqtarget + " HTTP" + "/" + vers); + } +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/client/UpgradeInsecureRequests.java b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/client/UpgradeInsecureRequests.java new file mode 100644 index 000000000..844fc8447 --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/client/UpgradeInsecureRequests.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.http.longv.message.client; + +import bettybook.http.longv.HttpLong.Http.Http; +import bettybook.http.longv.message.HeaderField; + +public class UpgradeInsecureRequests extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public UpgradeInsecureRequests(int val) + { + super(Http.UpgradeIR, Integer.toString(val)); + } +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/client/UserAgent.java b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/client/UserAgent.java new file mode 100644 index 000000000..81b402550 --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/client/UserAgent.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.http.longv.message.client; + +import bettybook.http.longv.HttpLong.Http.Http; +import bettybook.http.longv.message.HeaderField; + +public class UserAgent extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public UserAgent(String text) + { + super(Http.UserA, text); + } +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/AcceptRanges.java b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/AcceptRanges.java new file mode 100644 index 000000000..3323cd20c --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/AcceptRanges.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.http.longv.message.server; + +import bettybook.http.longv.HttpLong.Http.Http; +import bettybook.http.longv.message.HeaderField; + +public class AcceptRanges extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public AcceptRanges(String text) + { + super(Http.AcceptR, text); + } +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/CRLF.java b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/CRLF.java new file mode 100644 index 000000000..6b6c85dc8 --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/CRLF.java @@ -0,0 +1,29 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.http.longv.message.server; + +import bettybook.http.longv.message.HttpLongMessage; + +@Deprecated +public class CRLF extends HttpLongMessage +{ + private static final long serialVersionUID = 1L; + + public CRLF() + { + //super(Http.CRLF, HttpMessage.CRLF); // No: HttpMessage already appends the CRLF + //super(Http.CRLF, ""); + super(null, ""); + } +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/ContentLength.java b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/ContentLength.java new file mode 100644 index 000000000..f92f59e26 --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/ContentLength.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.http.longv.message.server; + +import bettybook.http.longv.HttpLong.Http.Http; +import bettybook.http.longv.message.HeaderField; + +public class ContentLength extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public ContentLength(Integer len) + { + super(Http.ContentL, len.toString()); + } +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/ContentType.java b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/ContentType.java new file mode 100644 index 000000000..c22d6d7d5 --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/ContentType.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.http.longv.message.server; + +import bettybook.http.longv.HttpLong.Http.Http; +import bettybook.http.longv.message.HeaderField; + +public class ContentType extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public ContentType(String type) + { + super(Http.ContentT, type); + } +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/Date.java b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/Date.java new file mode 100644 index 000000000..a7a68d9d1 --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/Date.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.http.longv.message.server; + +import bettybook.http.longv.HttpLong.Http.Http; +import bettybook.http.longv.message.HeaderField; + +public class Date extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public Date(String date) + { + super(Http.Date, date); + } +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/ETag.java b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/ETag.java new file mode 100644 index 000000000..c76d42fb7 --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/ETag.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.http.longv.message.server; + +import bettybook.http.longv.HttpLong.Http.Http; +import bettybook.http.longv.message.HeaderField; + +public class ETag extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public ETag(String tag) + { + super(Http.ETag, tag); + } +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/HttpVersion.java b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/HttpVersion.java new file mode 100644 index 000000000..7234c179b --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/HttpVersion.java @@ -0,0 +1,34 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.http.longv.message.server; + +import bettybook.http.longv.HttpLong.Http.Http; +import bettybook.http.longv.message.HttpLongMessage; +import bettybook.http.longv.message.HttpLongMessageFormatter; + +public class HttpVersion extends HttpLongMessage +{ + private static final long serialVersionUID = 1L; + + public HttpVersion(String version) + { + super(Http.HttpV, "/" + version); + } + + @Override + public byte[] toBytes() + { + return (getOpString(op) + getBody() + " ").getBytes(HttpLongMessageFormatter.cs); + } +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/LastModified.java b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/LastModified.java new file mode 100644 index 000000000..8e8e39374 --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/LastModified.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.http.longv.message.server; + +import bettybook.http.longv.HttpLong.Http.Http; +import bettybook.http.longv.message.HeaderField; + +public class LastModified extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public LastModified(String date) + { + super(Http.LastM, date); + } +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/Server.java b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/Server.java new file mode 100644 index 000000000..0404f42d4 --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/Server.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.http.longv.message.server; + +import bettybook.http.longv.HttpLong.Http.Http; +import bettybook.http.longv.message.HeaderField; + +public class Server extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public Server(String server) + { + super(Http.Server, server); + } +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/StatusCode.java b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/StatusCode.java new file mode 100644 index 000000000..f2216df9e --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/StatusCode.java @@ -0,0 +1,28 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.http.longv.message.server; + +import org.scribble.core.type.name.Op; + +import bettybook.http.longv.message.HttpLongMessage; + +public abstract class StatusCode extends HttpLongMessage +{ + private static final long serialVersionUID = 1L; + + public StatusCode(Op code, String reason) + { + super(code, " " + reason); + } +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/StrictTransportSecurity.java b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/StrictTransportSecurity.java new file mode 100644 index 000000000..d9b970653 --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/StrictTransportSecurity.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.http.longv.message.server; + +import bettybook.http.longv.HttpLong.Http.Http; +import bettybook.http.longv.message.HeaderField; + +public class StrictTransportSecurity extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public StrictTransportSecurity(String server) + { + super(Http.StrictTS, server); + } +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/Vary.java b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/Vary.java new file mode 100644 index 000000000..99d8f0811 --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/Vary.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.http.longv.message.server; + +import bettybook.http.longv.HttpLong.Http.Http; +import bettybook.http.longv.message.HeaderField; + +public class Vary extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public Vary(String text) + { + super(Http.Vary, text); + } +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/Via.java b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/Via.java new file mode 100644 index 000000000..985272b9f --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/Via.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.http.longv.message.server; + +import bettybook.http.longv.HttpLong.Http.Http; +import bettybook.http.longv.message.HeaderField; + +public class Via extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public Via(String text) + { + super(Http.Via, text); + } +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/_200.java b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/_200.java new file mode 100644 index 000000000..6cffdb99c --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/_200.java @@ -0,0 +1,26 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.http.longv.message.server; + +import bettybook.http.longv.HttpLong.Http.Http; + +public class _200 extends StatusCode +{ + private static final long serialVersionUID = 1L; + + public _200(String reason) + { + super(Http._200, reason); + } +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/_404.java b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/_404.java new file mode 100644 index 000000000..5414ef71b --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/http/longv/message/server/_404.java @@ -0,0 +1,26 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.http.longv.message.server; + +import bettybook.http.longv.HttpLong.Http.Http; + +public class _404 extends StatusCode +{ + private static final long serialVersionUID = 1L; + + public _404(String reason) + { + super(Http._404, reason); + } +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/http/shortv/HttpShort.scr b/scribble-demos/scrib/bettybook/src/bettybook/http/shortv/HttpShort.scr new file mode 100644 index 000000000..e8baa5d33 --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/http/shortv/HttpShort.scr @@ -0,0 +1,23 @@ +/** + * Assuming scribblec.sh in scribble-java root directory: + * + * bin/scribblec.sh -d scribble-demos/scrib/bettybook/src scribble-demos/scrib/bettybook/src/bettybook/http/shortv/HttpShort.scr -api Http C + */ + + +module bettybook.http.shortv.HttpShort; + + +sig "bettybook.http.shortv.message.client.Req" + from "bettybook/httpshort/message/Req.java" + as Req; + +sig "bettybook.http.shortv.message.server.Resp" + from "bettybook/shortvers/message/Resp.java" + as Resp; + + +global protocol Http(role C, role S) { + Req from C to S; + Resp from S to C; +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/http/shortv/HttpShortC.java b/scribble-demos/scrib/bettybook/src/bettybook/http/shortv/HttpShortC.java new file mode 100644 index 000000000..c0c12b183 --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/http/shortv/HttpShortC.java @@ -0,0 +1,60 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.http.shortv; + +import static bettybook.http.shortv.HttpShort.Http.Http.C; +import static bettybook.http.shortv.HttpShort.Http.Http.Resp; +import static bettybook.http.shortv.HttpShort.Http.Http.S; + +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import bettybook.http.shortv.HttpShort.Http.Http; +import bettybook.http.shortv.HttpShort.Http.roles.C; +import bettybook.http.shortv.HttpShort.Http.statechans.C.Http_C_1; +import bettybook.http.shortv.message.HttpShortMessageFormatter; +import bettybook.http.shortv.message.client.Req; +import bettybook.http.shortv.message.server.Resp; + +public class HttpShortC { + + public static void main(String[] args) throws Exception + { + Http http = new Http(); + try (MPSTEndpoint client = new MPSTEndpoint<>(http, C, + new HttpShortMessageFormatter())) + { + String host = "example.com"; int port = 80; String file = "/"; + //String host = "localhost"; int port = 8080; String file = "/"; + + client.request(S, SocketChannelEndpoint::new, host, port); + new HttpShortC().run(client, host, file); + } + } + + private void run(MPSTEndpoint client, String host, String file) throws Exception + { + Buf buf = new Buf<>(); + Http_C_1 c = new Http_C_1(client); + + + c.send(S, new Req(file, "1.1", host)) + .receive(S, Resp, buf); + + + System.out.println("Response:\n" + buf.val); + } +} + diff --git a/scribble-demos/scrib/bettybook/src/bettybook/http/shortv/HttpShortS.java b/scribble-demos/scrib/bettybook/src/bettybook/http/shortv/HttpShortS.java new file mode 100644 index 000000000..0ff18c669 --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/http/shortv/HttpShortS.java @@ -0,0 +1,68 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.http.shortv; + +import static bettybook.http.shortv.HttpShort.Http.Http.C; +import static bettybook.http.shortv.HttpShort.Http.Http.Req; +import static bettybook.http.shortv.HttpShort.Http.Http.S; + +import java.io.IOException; + +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.net.SocketChannelServer; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import bettybook.http.shortv.HttpShort.Http.Http; +import bettybook.http.shortv.HttpShort.Http.roles.S; +import bettybook.http.shortv.HttpShort.Http.statechans.S.Http_S_1; +import bettybook.http.shortv.HttpShort.Http.statechans.S.Http_S_2; +import bettybook.http.shortv.message.HttpShortMessageFormatter; +import bettybook.http.shortv.message.client.Req; +import bettybook.http.shortv.message.server.Resp; + +public class HttpShortS { + + public static void main(String[] args) throws IOException + { + try (ScribServerSocket ss = new SocketChannelServer(8080)) + { + while (true) + { + Http http = new Http(); + try (MPSTEndpoint server = new MPSTEndpoint<>(http, S, + new HttpShortMessageFormatter())) { + server.accept(ss, C); + + run(new Http_S_1(server)); + } + catch (IOException | ClassNotFoundException | ScribRuntimeException e) + { + e.printStackTrace(); + } + } + } + } + + private static void run(Http_S_1 s1) + throws ClassNotFoundException, ScribRuntimeException, IOException + { + Buf buf = new Buf<>(); + + Http_S_2 s2 = s1.receive(C, Req, buf); + System.out.println("Request:\n" + buf.val); + s2.send(C, new Resp("1.1", "Hello, World!")); + } +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/http/shortv/message/HttpShortMessage.java b/scribble-demos/scrib/bettybook/src/bettybook/http/shortv/message/HttpShortMessage.java new file mode 100644 index 000000000..e31d5e111 --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/http/shortv/message/HttpShortMessage.java @@ -0,0 +1,67 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.http.shortv.message; + +import org.scribble.core.type.name.Op; +import org.scribble.runtime.message.ScribMessage; + +import bettybook.http.shortv.HttpShort.Http.Http; + +public abstract class HttpShortMessage extends ScribMessage +{ + private static final long serialVersionUID = 1L; + + public static final String GET = "GET"; + public static final String HTTP = "HTTP"; + + public static final String CRLF = "\r\n"; + + public HttpShortMessage(Op op, String m) + { + super(op, m); + } + + public String getHeadersAndBody() + { + return (this.payload.length == 0) ? "" : (String) this.payload[0]; + } + + public byte[] toBytes() + { + // FIXME: factor better with Request/Response (e.g. " " after op, terminal CRLF, etc) + return (getOpString(this.op) + getHeadersAndBody()).getBytes(HttpShortMessageFormatter.cs); // Can give "utf-8" as arg directly + } + + @Override + public String toString() + { + return new String(toBytes()); + } + + protected static String getOpString(Op op) + { + if (op.equals(Http.Req)) + { + return HttpShortMessage.GET; + } + else if (op.equals(Http.Resp)) + { + return HttpShortMessage.HTTP; + } + else + { + throw new RuntimeException("TODO: " + op); + } + } +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/http/shortv/message/HttpShortMessageFormatter.java b/scribble-demos/scrib/bettybook/src/bettybook/http/shortv/message/HttpShortMessageFormatter.java new file mode 100644 index 000000000..4964fe91f --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/http/shortv/message/HttpShortMessageFormatter.java @@ -0,0 +1,258 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.http.shortv.message; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.util.Arrays; + +import org.scribble.runtime.message.ScribMessage; +import org.scribble.runtime.message.ScribMessageFormatter; + +import bettybook.http.shortv.message.client.Req; +import bettybook.http.shortv.message.server.Resp; + +public class HttpShortMessageFormatter implements ScribMessageFormatter +{ + public static final Charset cs = Charset.forName("UTF8"); + //private static CharsetDecoder cd = cs.newDecoder(); + + public HttpShortMessageFormatter() + { + + } + + @Override + public byte[] toBytes(ScribMessage m) throws IOException + { + return ((HttpShortMessage) m).toBytes(); + } + + @Override + public ScribMessage fromBytes(ByteBuffer bb) throws IOException, ClassNotFoundException + { + bb.flip(); + int rem = bb.remaining(); + if (rem < 2) + { + bb.compact(); + return null; + } + + String curr = new String(Arrays.copyOf(bb.array(), bb.remaining()), HttpShortMessageFormatter.cs); + String endOfHeaders = HttpShortMessage.CRLF + HttpShortMessage.CRLF; + if (!curr.contains(endOfHeaders)) + { + bb.compact(); + return null; + } + + if (curr.contains(Resp.CONTENT_LENGTH)) + { + int eoh = curr.indexOf(endOfHeaders); + if (eoh == -1) + { + bb.compact(); + return null; + } + String contentLenSplit = curr.substring(curr.indexOf(Resp.CONTENT_LENGTH)); + int len = Integer.parseInt(contentLenSplit.substring(Resp.CONTENT_LENGTH.length()+2, contentLenSplit.indexOf('\r')).trim()); + if (curr.length() < eoh+4) + { + bb.compact(); + return null; + } + String body = curr.substring(eoh+4); + if (body.getBytes(HttpShortMessageFormatter.cs).length < len) + { + bb.compact(); + return null; + } + byte[] bs = new byte[bb.remaining()]; // FIXME: hardcoded Response parsing based on presence of Content-Length + bb.get(bs); + bb.compact(); + return parseResponse(new String(bs, HttpShortMessageFormatter.cs)); + } + else + { + byte[] bs = new byte[bb.remaining()]; + bb.get(bs); + bb.compact(); + return parseRequest(new String(bs, HttpShortMessageFormatter.cs)); // FIXME: assuming empty-body Request if no Content-Length + } + } + + // Assumes no body + private static HttpShortMessage parseRequest(String msg) + { + String get = null; + String http = null; + String host = null; + String userA = null; + String accept = null; + String acceptL = null; + String acceptE = null; + String dnt = null; + String connection = null; + String upgradeIR = null; + + for (boolean eoh = false; !eoh; ) + { + //if (msg.startsWith(HttpMessage.CRLF + HttpMessage.CRLF)) + if (msg.startsWith(HttpShortMessage.CRLF)) // First CRLF already trimmed after last header + { + eoh = true; + //msg = msg.substring(4); + msg = msg.substring(2); + break; + } + + msg = msg.replace("\\A\\s+", ""); + int i = msg.indexOf(":"); + if (i == -1) + { + throw new RuntimeException("Shouldn't get in here: " + msg); + } + if (msg.startsWith(HttpShortMessage.GET)) // FIXME + { + int j = msg.indexOf(' '); + get = msg.substring(j+1, msg.indexOf(' ', j+1)).trim(); + j = msg.indexOf('\r'); + http = msg.substring(msg.indexOf('/')+1, j).trim(); + msg = msg.substring(j+2); + } + else + { + String header = msg.substring(0, i); + int j = msg.indexOf("\r"); + switch (header) // FIXME: duplicates not checked + { + case Req.HOST: host = msg.substring(i+1, j).trim(); break; + case Req.USER_AGENT: userA = msg.substring(i+1, j).trim(); break; + case Req.ACCEPT: accept = msg.substring(i+1, j).trim(); break; + case Req.ACCEPT_LANGUAGE: acceptL = msg.substring(i+1, j).trim(); break; + case Req.ACCEPT_ENCODING: acceptE = msg.substring(i+1, j).trim(); break; + case Req.DO_NOT_TRACK: dnt = msg.substring(i+1, j).trim(); break; + case Req.CONNECTION: connection = msg.substring(i+1, j).trim(); break; + case Req.UPGRADE_INSECURE_REQUESTS: upgradeIR = msg.substring(i+1, j).trim(); break; + default: { + //throw new RuntimeException("Cannot parse header field: " + msg.substring(0, j)); + System.err.println("Cannot parse header field, attempting to skip: " + msg.substring(0, j)); + } + } + msg = msg.substring(j+2); + } + } + if (!msg.isEmpty()) + { + throw new RuntimeException("Shouldn't get in here: " + msg); + } + return new Req(get, http, host, userA, accept, acceptL, acceptE, dnt, connection, upgradeIR); + } + + private static HttpShortMessage parseResponse(String msg) + { + String httpv = null; + String ack = null; + String date = null; + String server = null; + String strictTS = null; + String lastMod = null; + String eTag = null; + String acceptR = null; + String contentL = null; + String vary = null; + String contentT = null; + String via = null; + String body = null; + + for (boolean eoh = false; !eoh; ) + { + //if (msg.startsWith(HttpMessage.CRLF + HttpMessage.CRLF)) + if (msg.startsWith(HttpShortMessage.CRLF)) // First CRLF already trimmed after last header + { + eoh = true; + //msg = msg.substring(4); + msg = msg.substring(2); + break; + } + + msg = msg.trim(); + int i = msg.indexOf(":"); + if (i == -1) + { + throw new RuntimeException("Shouldn't get in here: " + msg); + } + if (msg.startsWith(HttpShortMessage.HTTP)) // FIXME + { + int j = msg.indexOf(' '); + httpv = msg.substring(msg.indexOf('/')+1, j); + + int k = msg.indexOf('\r'); + ack = msg.substring(j+1, k); + /*if (!ack.equals("200 OK")) + { + if (!ack.startsWith("404")) + { + throw new RuntimeException("[TODO]: " + msg); + } + } + ack = "OK"; // Hardcoded*/ + msg = msg.substring(k+2); + } + else + { + String header = msg.substring(0, i); + int j = msg.indexOf("\r"); + switch (header) + { + case Resp.DATE: date = msg.substring(i+1, j).trim(); break; + case Resp.SERVER: server = msg.substring(i+1, j).trim(); break; + case Resp.STRICT_TRANSPORT_SECURITY: strictTS = msg.substring(i+1, j).trim(); break; + case Resp.LAST_MODIFIED: lastMod = msg.substring(i+1, j).trim(); break; + case Resp.ETAG: eTag = msg.substring(i+1, j).trim(); break; + case Resp.ACCEPT_RANGES: acceptR = msg.substring(i+1, j).trim(); break; + case Resp.CONTENT_LENGTH: contentL = msg.substring(i+1, j).trim(); break; + case Resp.VARY: vary = msg.substring(i+1, j).trim(); break; + case Resp.CONTENT_TYPE: contentT = msg.substring(i+1, j).trim(); break; + case Resp.VIA: via = msg.substring(i+1, j).trim(); break; + default: + //throw new RuntimeException("Cannot parse header field: " + msg.substring(0, msg.indexOf('\r'))); + System.err.println("[Warning] Attempting to skip over response field: " + header + "\n" + msg.substring(i+1, j).trim()); + } + msg = msg.substring(j+2); + } + } + body = msg; + return new Resp(httpv, ack, date, server, strictTS, lastMod, eTag, acceptR, contentL, vary, contentT, via, body); + } + + + + // FIXME: delete + @Deprecated @Override + public void writeMessage(DataOutputStream dos, ScribMessage m) throws IOException + { + throw new RuntimeException("Shouldn't get in here: " + m); + } + + @Deprecated @Override + public ScribMessage readMessage(DataInputStream dis) throws IOException + { + throw new RuntimeException("Shouldn't get in here: "); + } +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/http/shortv/message/client/Req.java b/scribble-demos/scrib/bettybook/src/bettybook/http/shortv/message/client/Req.java new file mode 100644 index 000000000..9ec29a4b4 --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/http/shortv/message/client/Req.java @@ -0,0 +1,53 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.http.shortv.message.client; + +import bettybook.http.shortv.HttpShort.Http.Http; +import bettybook.http.shortv.message.HttpShortMessage; + +public class Req extends HttpShortMessage { + + private static final long serialVersionUID = 1L; + + public static final String HOST = "Host"; + public static final String USER_AGENT = "User-Agent"; + public static final String ACCEPT = "Accept"; + public static final String ACCEPT_LANGUAGE = "Accept-Language"; + public static final String ACCEPT_ENCODING = "Accept-Encoding"; + public static final String DO_NOT_TRACK = "DNT"; + public static final String CONNECTION = "Connection"; + public static final String UPGRADE_INSECURE_REQUESTS = "Upgrade-Insecure-Requests"; + + public Req(String get, String http, String host, String userA, String accept, String acceptL, String acceptE, String dnt, String connection, String upgradeIR) { + super(Http.Req, getHeadersAndBody(get, http, host, userA, accept, acceptL, acceptE, dnt, connection, upgradeIR)); + } + + public Req(String get, String http, String host) { + this(get, http, host, null, null, null, null, null, null, null); + } + + protected static String getHeadersAndBody(String get, String http, String host, String userA, String accept, String acceptL, String acceptE, String dnt, String connection, String upgradeIR) { + return " " + + get + " " + HttpShortMessage.HTTP + "/" + http + HttpShortMessage.CRLF + + Req.HOST + ": " + host + HttpShortMessage.CRLF + + ((userA == null) ? "" : Req.USER_AGENT + ": " + userA + HttpShortMessage.CRLF) + + ((accept == null) ? "" : Req.ACCEPT + ": " + accept + HttpShortMessage.CRLF) + + ((acceptL == null) ? "" : Req.ACCEPT_LANGUAGE + ": " + acceptL + HttpShortMessage.CRLF) + + ((acceptE == null) ? "" : Req.ACCEPT_ENCODING + ": " + acceptE + HttpShortMessage.CRLF) + + ((dnt == null) ? "" : Req.DO_NOT_TRACK + ": " + dnt + HttpShortMessage.CRLF) + + ((connection == null) ? "" : Req.CONNECTION + ": " + connection + HttpShortMessage.CRLF) + + ((upgradeIR == null) ? "" : Req.UPGRADE_INSECURE_REQUESTS + ": " + upgradeIR + HttpShortMessage.CRLF) + + "" + HttpShortMessage.CRLF; // Empty body + } +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/http/shortv/message/server/Resp.java b/scribble-demos/scrib/bettybook/src/bettybook/http/shortv/message/server/Resp.java new file mode 100644 index 000000000..8f3778d0e --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/http/shortv/message/server/Resp.java @@ -0,0 +1,98 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.http.shortv.message.server; + +import bettybook.http.shortv.HttpShort.Http.Http; +import bettybook.http.shortv.message.HttpShortMessage; + +public class Resp extends HttpShortMessage +{ + private static final long serialVersionUID = 1L; + + public static final String DATE = "Date"; + public static final String CONTENT_TYPE = "Content-Type"; + public static final String _404 = "404"; + public static final String _200 = "200"; + public static final String ACCEPT_RANGES = "Accept-Ranges"; + public static final String LAST_MODIFIED = "Last-Modified"; + public static final String VARY = "Vary"; + public static final String SERVER = "Server"; + public static final String STRICT_TRANSPORT_SECURITY = "Strict-Transport-Security"; + public static final String VIA = "Via"; + public static final String ETAG = "ETag"; + public static final String CONTENT_LENGTH = "Content-Length"; + + /*HTTP/1.1 200 OK + Date: Mon, 13 Jun 2016 19:42:34 GMT + Server: Apache + Strict-Transport-Security: max-age=31536000; preload; includeSubDomains + Strict-Transport-Security: max-age=31536000; preload; includeSubDomains // BUG? (Apache configuration) + Last-Modified: Thu, 14 Apr 2016 12:46:24 GMT + ETag: "74a-53071482f6e0f" + Accept-Ranges: bytes + Content-Length: 1866 + Vary: Accept-Encoding + Content-Type: text/html + Via: 1.1 www.doc.ic.ac.uk*/ + public Resp(String httpv, String ack, String date, String server, String strictTS, String lastMod, + String eTag, String acceptR, String contentL, String vary, String contentT, String via, String body) + { + super(Http.Resp, getHeadersAndBody( + httpv, ack, date, server, strictTS, lastMod, eTag, acceptR, contentL, vary, contentT, via, body)); + } + + /*public Response(String httpv, String ack, String contentL, String body) + { + super(Http.RESPONSE, getHeadersAndBody(httpv, ack, contentL, body)); + }*/ + + public Resp(String httpv, String body) + { + this(httpv, Resp._200 + " OK", null, null, null, null, null, null, Integer.toString(body.length()), null, null, null, body); + } + + // ack includes "op", e.g. 200, 404, ... + protected static String getHeadersAndBody(String httpv, String ack, String date, String server, String strictTS, String lastMod, + String eTag, String acceptR, String contentL, String vary, String contentT, String via, String body) + { + if (!ack.startsWith(Resp._200) && !ack.startsWith(Resp._404)) + { + throw new RuntimeException("[TODO]: " + ack); + } + return "/" + httpv + " " + + ack + HttpShortMessage.CRLF // Hardcoded + + ((date == null) ? "" : Resp.DATE + ": " + date + HttpShortMessage.CRLF) + + ((server == null) ? "" : Resp.SERVER + ": " + server + HttpShortMessage.CRLF) + + ((strictTS == null) ? "" : Resp.STRICT_TRANSPORT_SECURITY + ": " + strictTS + HttpShortMessage.CRLF) + + ((lastMod == null) ? "" : Resp.LAST_MODIFIED + ": " + lastMod + HttpShortMessage.CRLF) + + ((eTag == null) ? "" : Resp.ETAG + ": " + eTag + HttpShortMessage.CRLF) + + ((acceptR == null) ? "" : Resp.ACCEPT_RANGES + ": " + acceptR + HttpShortMessage.CRLF) + + Resp.CONTENT_LENGTH + ": " + contentL + HttpShortMessage.CRLF + + ((vary == null) ? "" : Resp.VARY + ": " + vary + HttpShortMessage.CRLF) + + ((contentT == null) ? "" : Resp.CONTENT_TYPE + ": " + contentT + HttpShortMessage.CRLF) + + ((via == null) ? "" : Resp.VIA + ": " + via + HttpShortMessage.CRLF) + + HttpShortMessage.CRLF // Empty line for end of headers + + body + HttpShortMessage.CRLF; + } + + /*// 404 + protected static String getHeadersAndBody(String httpv, String ack, String contentL, String body) + { + return "/" + httpv + " " + + _404 + ack + HttpMessage.CRLF // Hardcoded + + Response.CONTENT_LENGTH + ": " + contentL + HttpMessage.CRLF + + HttpMessage.CRLF // Empty line for end of headers + + body + HttpMessage.CRLF; + }*/ +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/math/rmi/RMIMath.java b/scribble-demos/scrib/bettybook/src/bettybook/math/rmi/RMIMath.java new file mode 100644 index 000000000..4a8817e82 --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/math/rmi/RMIMath.java @@ -0,0 +1,25 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.math.rmi; + +import java.rmi.Remote; +import java.rmi.RemoteException; + +public interface RMIMath extends Remote +{ + void Val(Integer x) throws RemoteException; + void Bye() throws RemoteException; + Integer Add(Integer y) throws RemoteException; + Integer Mult(Integer y) throws RemoteException; +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/math/rmi/RMIMathC.java b/scribble-demos/scrib/bettybook/src/bettybook/math/rmi/RMIMathC.java new file mode 100644 index 000000000..bc3e50dac --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/math/rmi/RMIMathC.java @@ -0,0 +1,45 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +//$ java -cp scribble-demos/target/test-classes/ -Djava.security.policy=file:/C:/Users/..FIXME../github.com/scribble/scribble-java/scribble-demos/scrib/bettybook/src/bettybook/math/rmi/server.policy bettybook.math.rmi.RMIMathC + + +package bettybook.math.rmi; + +import bettybook.math.rmi.RMIMath; + +import java.rmi.registry.LocateRegistry; +import java.rmi.registry.Registry; + +public class RMIMathC +{ + public static void main(String[] args) throws Exception + { + Registry registry = LocateRegistry.getRegistry(8888); + RMIMath mathS = (RMIMath) registry.lookup("MathService"); + + int i = 5; + int res = i; + while (i > 1) + { + mathS.Val(i); + i = mathS.Add(-1); + mathS.Val(res); + res = mathS.Mult(i); + } + mathS.Bye(); + + System.out.println("Facto: " + res); + } +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/math/rmi/RMIMathS.java b/scribble-demos/scrib/bettybook/src/bettybook/math/rmi/RMIMathS.java new file mode 100644 index 000000000..0c674cd2c --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/math/rmi/RMIMathS.java @@ -0,0 +1,68 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +//$ java -cp scribble-demos/target/test-classes -Djava.security.policy=file:/C:/Users/..FIXME../github.com/scribble/scribble-java/scribble-demos/scrib/bettybook/src/bettybook/math/rmi/server.policy bettybook.math.rmi.RMIMathS +//$ java -cp scribble-demos/target/test-classes -Djava.rmi.server.codebase=file:/C:/cygwin/home/..FIXME../scribble-java/modules/demos/scrib/bettybook/target/classes/ -Djava.security.policy=file:/C:/cygwin/home/Raymond/code/scribble/github-rhu1/scribble-java/modules/core/src/test/scrib/demo/bettybook/math/rmi/server.policy bettybook.math.rmi.RMIMathS -- FIXME: codebase arg not working + +package bettybook.math.rmi; + +import java.rmi.RemoteException; +import java.rmi.registry.LocateRegistry; +import java.rmi.registry.Registry; +import java.rmi.server.UnicastRemoteObject; + +public class RMIMathS implements RMIMath +{ + private int x; + + public void Val(Integer x) throws RemoteException + { + this.x = x; + } + + public void Bye() throws RemoteException + { + + } + + public Integer Add(Integer y) throws RemoteException + { + return this.x + y; + } + + public Integer Mult(Integer y) throws RemoteException + { + return this.x * y; + } + + public static void main(String[] args) throws Exception + { + Registry registry = LocateRegistry.createRegistry(8888); + + RMIMath stub = (RMIMath) UnicastRemoteObject.exportObject(new RMIMathS(), 0); + registry.rebind("MathService", stub); + + System.out.println("RMI Math Server running."); + } +} + + + + + + //System.setProperty("java.security.policy","file:/C:/cygwin64/home/.../scribble-java/scribble-demos/scrib/bettybook/src/bettybook/math/rmi/server.policy"); + //if (System.getSecurityManager() == null) { System.setSecurityManager(new SecurityManager()); } + + /*-Djava.security.policy=file:/C:/Users/..../github.com/scribble/scribble-java/scribble-demos/scrib/bettybook/src/bettybook/math/rmi/server.policy + Registry registry = LocateRegistry.getRegistry(8888);*/ diff --git a/scribble-demos/scrib/bettybook/src/bettybook/math/rmi/server.policy b/scribble-demos/scrib/bettybook/src/bettybook/math/rmi/server.policy new file mode 100644 index 000000000..d12f69de5 --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/math/rmi/server.policy @@ -0,0 +1,3 @@ +grant codeBase "file:/C:/cygwin64/home/rhu/code/eclipse/scribble/github.com/rhu1/scribble-java/scribble-core/target/classes/" { + permission java.security.AllPermission; +}; diff --git a/scribble-demos/scrib/bettybook/src/bettybook/math/scrib/Math.scr b/scribble-demos/scrib/bettybook/src/bettybook/math/scrib/Math.scr new file mode 100644 index 000000000..f63c2a817 --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/math/scrib/Math.scr @@ -0,0 +1,33 @@ +//$ ./scribblec.sh -ip scribble-demos/scrib/bettybook/src -d scribble-demos/scrib/bettybook/src scribble-demos/scrib/bettybook/src/bettybook/math/scrib/Math.scr -api MathService C +//$ javadoc -cp scribble-core/target/classes:scribble-runtime/target/classes:scribble-demos/scrib/bettybook/src -subpackages bettybook.math.scrib.Math.MathService -d scribble-demos/scrib/bettybook/javadoc/math + + +module bettybook.math.scrib.Math; + +data "java.lang.Integer" from "rt.jar" as Int; + + +// N.B. calling this Math will clash with java.lang.Math +global protocol MathService(role C, role S) +{ + choice at C + { + Val(Int) from C to S; + choice at C + { + Add(Int) from C to S; + Sum(Int) from S to C; + } + or + { + Mult(Int) from C to S; + Prod(Int) from S to C; + } + do MathService(C, S); + } + or + { + //Val(Int) from C to S; + Bye() from C to S; + } +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/math/scrib/MathC.java b/scribble-demos/scrib/bettybook/src/bettybook/math/scrib/MathC.java new file mode 100644 index 000000000..872078e5e --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/math/scrib/MathC.java @@ -0,0 +1,119 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.math.scrib; + +import static bettybook.math.scrib.Math.MathService.MathService.Add; +import static bettybook.math.scrib.Math.MathService.MathService.Bye; +import static bettybook.math.scrib.Math.MathService.MathService.C; +import static bettybook.math.scrib.Math.MathService.MathService.Mult; +import static bettybook.math.scrib.Math.MathService.MathService.Prod; +import static bettybook.math.scrib.Math.MathService.MathService.S; +import static bettybook.math.scrib.Math.MathService.MathService.Sum; +import static bettybook.math.scrib.Math.MathService.MathService.Val; + +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import bettybook.math.scrib.Math.MathService.MathService; +import bettybook.math.scrib.Math.MathService.roles.C; +import bettybook.math.scrib.Math.MathService.statechans.C.EndSocket; +import bettybook.math.scrib.Math.MathService.statechans.C.MathService_C_1; + +public class MathC +{ + public MathC() throws Exception + { + facto(5); + fibo(10); + } + + private int facto(int n) throws Exception + { + Buf i = new Buf<>(n), res = new Buf<>(i.val); + MathService sess = new MathService(); + try (MPSTEndpoint se = new MPSTEndpoint<>(sess, C, + new ObjectStreamFormatter())) { + se.request(S, SocketChannelEndpoint::new, "localhost", 8888); + + MathService_C_1 s1 = new MathService_C_1(se); + + //facto(s1, i, res); + facto(s1, res).send(S, Bye); + + System.out.println("Facto " + n + ": " + res.val); + + return res.val; + } + } + + private static void facto(MathService_C_1 s1, Buf i, Buf res) throws Exception + { + while (i.val > 1) + { + s1 = sub1(s1, i).send(S, Val, res.val).send(S, Mult, i.val).receive(S, Prod, res); + } + s1.send(S, Bye); + } + + // Pre: b.val >= 1 + private static MathService_C_1 facto(MathService_C_1 s1, Buf b) throws Exception + { + if (b.val == 1) + { + return s1; + } + Buf tmp = new Buf<>(b.val); + return facto(sub1(s1, tmp), tmp).send(S, Val, b.val).send(S, Mult, tmp.val).receive(S, Prod, b); + } + + private int fibo(int i) throws Exception + { + Buf i1 = new Buf<>(0); + Buf i2 = new Buf<>(1); + MathService sess = new MathService(); + try (MPSTEndpoint se = new MPSTEndpoint<>(sess, C, new ObjectStreamFormatter())) + { + se.request(S, SocketChannelEndpoint::new, "localhost", 8888); + + fibo(new MathService_C_1(se), i1, i2, new Buf<>(i)); + + System.out.println("Fibo " + i + ": " + i1.val); + + return i1.val; + } + } + + // Pre: i >= 0 + // Post: i1.val is the i-th Fibonacci number + private static EndSocket fibo(MathService_C_1 s1, Buf i1, Buf i2, Buf i) throws Exception + { + return (i.val > 0) + ? fibo( + sub1(s1, i).send(S, Val, i1.val).send(S, Add, i1.val=i2.val).receive(S, Sum, i2), + i1, i2, i) + : s1.send(S, Bye); + } + + private static MathService_C_1 sub1(MathService_C_1 s1, Buf b) throws Exception + { + return s1.send(S, Val, b.val).send(S, Add, -1).receive(S, Sum, b); + } + + public static void main(String[] args) throws Exception + { + new MathC(); + } +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/math/scrib/MathS1.java b/scribble-demos/scrib/bettybook/src/bettybook/math/scrib/MathS1.java new file mode 100644 index 000000000..eabcd55b8 --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/math/scrib/MathS1.java @@ -0,0 +1,85 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.math.scrib; + +import static bettybook.math.scrib.Math.MathService.MathService.Add; +import static bettybook.math.scrib.Math.MathService.MathService.Bye; +import static bettybook.math.scrib.Math.MathService.MathService.C; +import static bettybook.math.scrib.Math.MathService.MathService.Mult; +import static bettybook.math.scrib.Math.MathService.MathService.Prod; +import static bettybook.math.scrib.Math.MathService.MathService.S; +import static bettybook.math.scrib.Math.MathService.MathService.Sum; +import static bettybook.math.scrib.Math.MathService.MathService.Val; + +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.net.SocketChannelServer; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import bettybook.math.scrib.Math.MathService.MathService; +import bettybook.math.scrib.Math.MathService.roles.S; +import bettybook.math.scrib.Math.MathService.statechans.S.MathService_S_1; +import bettybook.math.scrib.Math.MathService.statechans.S.MathService_S_1_Cases; +import bettybook.math.scrib.Math.MathService.statechans.S.MathService_S_2_Cases; + +public class MathS1 +{ + public MathS1() throws Exception + { + run(); + } + + private void run() throws Exception + { + try (ScribServerSocket ss = new SocketChannelServer(8888)) + { + while (true) + { + MathService sess = new MathService(); + try (MPSTEndpoint se = new MPSTEndpoint<>(sess, S, + new ObjectStreamFormatter())) { + se.accept(ss, C); + Buf b1 = new Buf<>(); + Buf b2 = new Buf<>(); + + MathService_S_1 s1 = new MathService_S_1(se); + Loop: while (true) + { + MathService_S_1_Cases c1 = s1.branch(C); + switch (c1.op) + { + case Bye: c1.receive(Bye); break Loop; + case Val: + { + MathService_S_2_Cases c2 = c1.receive(Val, b1).branch(C); + switch (c2.op) + { + case Add: s1 = c2.receive(Add, b2).send(C, Sum, b1.val + b2.val); break; + case Mult: s1 = c2.receive(Mult, b2).send(C, Prod, b1.val * b2.val); break; + } + break; + } + } + } + } + } + } + } + + public static void main(String[] args) throws Exception + { + new MathS1(); + } +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/math/scrib/MathS2.java b/scribble-demos/scrib/bettybook/src/bettybook/math/scrib/MathS2.java new file mode 100644 index 000000000..f670c01e1 --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/math/scrib/MathS2.java @@ -0,0 +1,98 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.math.scrib; + +import static bettybook.math.scrib.Math.MathService.MathService.C; +import static bettybook.math.scrib.Math.MathService.MathService.Prod; +import static bettybook.math.scrib.Math.MathService.MathService.S; +import static bettybook.math.scrib.Math.MathService.MathService.Sum; + +import java.io.IOException; + +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.net.SocketChannelServer; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import bettybook.math.scrib.Math.MathService.MathService; +import bettybook.math.scrib.Math.MathService.ops.Add; +import bettybook.math.scrib.Math.MathService.ops.Bye; +import bettybook.math.scrib.Math.MathService.ops.Mult; +import bettybook.math.scrib.Math.MathService.ops.Val; +import bettybook.math.scrib.Math.MathService.roles.S; +import bettybook.math.scrib.Math.MathService.statechans.S.EndSocket; +import bettybook.math.scrib.Math.MathService.statechans.S.MathService_S_1; +import bettybook.math.scrib.Math.MathService.statechans.S.MathService_S_1_Handler; +import bettybook.math.scrib.Math.MathService.statechans.S.MathService_S_2; +import bettybook.math.scrib.Math.MathService.statechans.S.MathService_S_2_Handler; +import bettybook.math.scrib.Math.MathService.statechans.S.MathService_S_3; +import bettybook.math.scrib.Math.MathService.statechans.S.MathService_S_4; + +public class MathS2 +{ + public static void main(String[] args) throws Exception + { + try (ScribServerSocket ss = new SocketChannelServer(8888)) + { + while (true) + { + MathService sess = new MathService(); + try (MPSTEndpoint se = new MPSTEndpoint<>(sess, S, + new ObjectStreamFormatter())) { + se.accept(ss, C); + + MathService_S_1 s1 = new MathService_S_1(se); + s1.branch(C, new MathSHandler()); + } + } + } + } +} + +// FIXME: add generic session-state object to handler methods +class MathSHandler implements MathService_S_1_Handler, MathService_S_2_Handler +{ + private Buf b1; + + @Override + public void receive(MathService_S_2 s2, Val op, Buf b1) + throws ScribRuntimeException, IOException, ClassNotFoundException + { + this.b1 = b1; + s2.branch(C, this); + } + + @Override + public void receive(EndSocket end, Bye op) throws ScribRuntimeException, + IOException, ClassNotFoundException + { + + } + + @Override + public void receive(MathService_S_3 s3, Add op, Buf b2) + throws ScribRuntimeException, IOException, ClassNotFoundException + { + s3.send(C, Sum, this.b1.val + b2.val).branch(C, this); + } + + @Override + public void receive(MathService_S_4 s4, Mult op, Buf b2) + throws ScribRuntimeException, IOException, ClassNotFoundException + { + s4.send(C, Prod, this.b1.val * b2.val).branch(C, this); + } +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/math/sock/SockMathC.java b/scribble-demos/scrib/bettybook/src/bettybook/math/sock/SockMathC.java new file mode 100644 index 000000000..1dcc547f4 --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/math/sock/SockMathC.java @@ -0,0 +1,113 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.math.sock; + +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.Serializable; +import java.net.Socket; + +public class SockMathC +{ + public static void main(String[] args) throws Exception + { + try (Socket s = new Socket("localhost", 8888); + ObjectOutputStream oos = new ObjectOutputStream(s.getOutputStream()); + ObjectInputStream ois = new ObjectInputStream(s.getInputStream())) + { + int i = 5, res = i; + while (i > 1) + { + oos.writeObject(new Val(i)); + oos.writeObject(new Add(-1)); + oos.flush(); + i = ((Sum) ois.readObject()).val; + oos.writeObject(new Val(res)); + oos.writeObject(new Mult(i)); + oos.flush(); + res = ((Prod) ois.readObject()).val; + } + oos.writeObject(new Bye()); + oos.flush(); + + System.out.println("Facto: " + res); + } + } +} + +abstract class NumMsg implements Serializable +{ + private static final long serialVersionUID = 1L; + public int val; + + public NumMsg(int val) + { + this.val = val; + } +} + +class Val extends NumMsg +{ + private static final long serialVersionUID = 1L; + + public Val(int x) + { + super(x); + } +} + +class Add extends NumMsg +{ + private static final long serialVersionUID = 1L; + + public Add(int val) + { + super(val); + } +} + +class Sum extends NumMsg +{ + private static final long serialVersionUID = 1L; + + public Sum(int val) + { + super(val); + } +} + +class Mult extends NumMsg +{ + private static final long serialVersionUID = 1L; + + public Mult(int val) + { + super(val); + } +} + +class Prod extends NumMsg +{ + private static final long serialVersionUID = 1L; + + public Prod(int val) + { + super(val); + } +} + +class Bye implements Serializable +{ + private static final long serialVersionUID = 1L; +} diff --git a/scribble-demos/scrib/bettybook/src/bettybook/math/sock/SockMathS.java b/scribble-demos/scrib/bettybook/src/bettybook/math/sock/SockMathS.java new file mode 100644 index 000000000..7a756ed07 --- /dev/null +++ b/scribble-demos/scrib/bettybook/src/bettybook/math/sock/SockMathS.java @@ -0,0 +1,75 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package bettybook.math.sock; + +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.net.ServerSocket; +import java.net.Socket; + +public class SockMathS +{ + public static void main(String[] args) throws Exception + { + try (ServerSocket ss = new ServerSocket(8888)) + { + while (true) + { + try (Socket s = ss.accept()) + { + try (ObjectInputStream ois = new ObjectInputStream(s.getInputStream()); + ObjectOutputStream oos = new ObjectOutputStream(s.getOutputStream())) + { + Loop: while (true) + { + Object msg = ois.readObject(); + if (msg instanceof Val) + { + int x = ((Val) msg).val; + msg = ois.readObject(); + if (msg instanceof Add) + { + int y = ((Add) msg).val; + oos.writeObject(new Sum(x + y)); + } + else if (msg instanceof Mult) + { + int y = ((Mult) msg).val; + oos.writeObject(new Prod(x * y)); + } + else + { + throw new Exception("Bad message: " + msg.getClass()); + } + oos.flush(); + } + else if (msg instanceof Bye) + { + break Loop; + } + else + { + throw new Exception("Bad message: " + msg.getClass()); + } + } + } + } + catch (Exception x) + { + x.printStackTrace(); + } + } + } + } +} diff --git a/scribble-demos/scrib/coco/src/coco/fibo/Fibo.scr b/scribble-demos/scrib/coco/src/coco/fibo/Fibo.scr new file mode 100644 index 000000000..9786773ee --- /dev/null +++ b/scribble-demos/scrib/coco/src/coco/fibo/Fibo.scr @@ -0,0 +1,25 @@ +//$ ./scribblec.sh -ip scribble-demos/scrib/coco/src -d scribble-demos/scrib/coco/src scribble-demos/scrib/coco/src/coco/fibo/Fibo.scr -api Fibonacci A +//$ javadoc -cp scribble-core/target/classes:scribble-runtime/target/classes:scribble-demos/scrib/coco/src scribble-demos/scrib/coco/src/coco/fibo/*.java -subpackages coco.fibo.Fibo.Fibonacci -d scribble-demos/scrib/coco/javadoc/fibo + +module coco.fibo.Fibo; + + +data "java.lang.Long" from "rt.jar" as Long; + + +global protocol Fibonacci(role A, role B) +{ + rec Fib + { + choice at A + { + fibonacci(Long) from A to B; + fibonacci(Long) from B to A; + continue Fib; + } + or + { + stop() from A to B; + } + } +} diff --git a/scribble-demos/scrib/coco/src/coco/fibo/FiboA.java b/scribble-demos/scrib/coco/src/coco/fibo/FiboA.java new file mode 100644 index 000000000..27fd0338c --- /dev/null +++ b/scribble-demos/scrib/coco/src/coco/fibo/FiboA.java @@ -0,0 +1,101 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package coco.fibo; + +import static coco.fibo.Fibo.Fibonacci.Fibonacci.A; +import static coco.fibo.Fibo.Fibonacci.Fibonacci.B; +import static coco.fibo.Fibo.Fibonacci.Fibonacci.fibonacci; +import static coco.fibo.Fibo.Fibonacci.Fibonacci.stop; + +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import coco.fibo.Fibo.Fibonacci.Fibonacci; +import coco.fibo.Fibo.Fibonacci.roles.A; +import coco.fibo.Fibo.Fibonacci.statechans.A.EndSocket; +import coco.fibo.Fibo.Fibonacci.statechans.A.Fibonacci_A_1; +import coco.fibo.Fibo.Fibonacci.statechans.A.ioifaces.In_B_fibonacci_Long; +import coco.fibo.Fibo.Fibonacci.statechans.A.ioifaces.Out_B_fibonacci_Long; +import coco.fibo.Fibo.Fibonacci.statechans.A.ioifaces.Out_B_stop; +import coco.fibo.Fibo.Fibonacci.statechans.A.ioifaces.Succ_In_B_fibonacci_Long; +import coco.fibo.Fibo.Fibonacci.statechans.A.ioifaces.Succ_Out_B_fibonacci_Long; + +public class FiboA extends Thread +{ + private final Fibonacci fib; + private Buf b = new Buf<>(0L); + + public FiboA(Fibonacci fib) + { + this.fib = fib; + } + + @Override + public void run() + { + int n = 19; + try (MPSTEndpoint se = new MPSTEndpoint<>(this.fib, A, + new ObjectStreamFormatter())) + { + se.request(B, SocketChannelEndpoint::new, "localhost", 8888); + run(new Fibonacci_A_1(se), n); // 4184 + System.out.println("A #" + n + ": " + this.b.val); + } + catch (Exception x) + { + x.printStackTrace(); + } + } + + private EndSocket run(Fibonacci_A_1 s, int todo) throws Exception + { + return run1(s, todo); + } + + private + < + //*/ + T1 extends + Out_B_fibonacci_Long & Out_B_stop // Action I/f's + & Succ_In_B_fibonacci_Long, // Successor I/f's + T2 extends + In_B_fibonacci_Long + & Succ_Out_B_fibonacci_Long //, E extends Succ_Out_B_stop + /*/ + T1 extends Select_A_B_fibonacci_Long__B_stop, + T2 extends Receive_A_B_fibonacci_Long + //*/ + > + EndSocket run1(T1 s, int todo) throws Exception + { + return (todo > 0) + ? run1( + next(this.b.val, + s.send(B, fibonacci, this.b.val) + .receive(B, fibonacci, this.b), todo), + todo - 2) + : s.send(Fibonacci.B, stop); + } + + //private Fibonacci_A_1 next(long prev, Fibonacci_A_1 s, int todo) + private S next(long prev, S s, int todo) + { + //System.out.println("A: " + prev); + if (todo > 1) + this.b.val += prev; + return s; + } +} \ No newline at end of file diff --git a/scribble-demos/scrib/coco/src/coco/fibo/FiboB.java b/scribble-demos/scrib/coco/src/coco/fibo/FiboB.java new file mode 100644 index 000000000..139d9b216 --- /dev/null +++ b/scribble-demos/scrib/coco/src/coco/fibo/FiboB.java @@ -0,0 +1,84 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package coco.fibo; + +import static coco.fibo.Fibo.Fibonacci.Fibonacci.A; +import static coco.fibo.Fibo.Fibonacci.Fibonacci.B; +import static coco.fibo.Fibo.Fibonacci.Fibonacci.fibonacci; +import static coco.fibo.Fibo.Fibonacci.Fibonacci.stop; + +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.net.SocketChannelServer; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import coco.fibo.Fibo.Fibonacci.Fibonacci; +import coco.fibo.Fibo.Fibonacci.roles.B; +import coco.fibo.Fibo.Fibonacci.statechans.B.EndSocket; +import coco.fibo.Fibo.Fibonacci.statechans.B.Fibonacci_B_1; +import coco.fibo.Fibo.Fibonacci.statechans.B.Fibonacci_B_1_Cases; + +public class FiboB extends Thread +{ + private final Fibonacci fib; + private Buf b = new Buf<>(1L); + + public FiboB(Fibonacci fib) + { + this.fib = fib; + } + + @Override + public void run() + { + try ( + ScribServerSocket ss = new SocketChannelServer(8888); + MPSTEndpoint se = new MPSTEndpoint<>(this.fib, B, + new ObjectStreamFormatter())) + { + se.accept(ss, A); + run(new Fibonacci_B_1(se)); + } + catch (Exception x) + { + x.printStackTrace(); + } + } + + private EndSocket run(Fibonacci_B_1 s) throws Exception + { + /* + ... s.branch(A); + switch (...) // Value-switch + { + ... + } + } +} +/*/ + Fibonacci_B_1_Cases c = s.branch(A); + switch (c.op) + { + case fibonacci: + long prev = this.b.val; + return run(c.receive(fibonacci, this.b).send(A, fibonacci, this.b.val += prev)); + case stop: + return c.receive(stop); + default: + throw new RuntimeException("Will never get here"); + } + } +} +//*/ diff --git a/scribble-demos/scrib/coco/src/coco/fibo/FiboBHandler.java b/scribble-demos/scrib/coco/src/coco/fibo/FiboBHandler.java new file mode 100644 index 000000000..c46a00027 --- /dev/null +++ b/scribble-demos/scrib/coco/src/coco/fibo/FiboBHandler.java @@ -0,0 +1,81 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package coco.fibo; + +import static coco.fibo.Fibo.Fibonacci.Fibonacci.A; +import static coco.fibo.Fibo.Fibonacci.Fibonacci.B; +import static coco.fibo.Fibo.Fibonacci.Fibonacci.fibonacci; + +import java.io.IOException; + +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.net.SocketChannelServer; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import coco.fibo.Fibo.Fibonacci.Fibonacci; +import coco.fibo.Fibo.Fibonacci.ops.fibonacci; +import coco.fibo.Fibo.Fibonacci.ops.stop; +import coco.fibo.Fibo.Fibonacci.roles.B; +import coco.fibo.Fibo.Fibonacci.statechans.B.EndSocket; +import coco.fibo.Fibo.Fibonacci.statechans.B.Fibonacci_B_1; +import coco.fibo.Fibo.Fibonacci.statechans.B.Fibonacci_B_1_Handler; +import coco.fibo.Fibo.Fibonacci.statechans.B.Fibonacci_B_2; + +public class FiboBHandler extends Thread implements Fibonacci_B_1_Handler +{ + private final Fibonacci fib; + private long x = 1; + + public FiboBHandler(Fibonacci fib) + { + this.fib = fib; + } + + @Override + public void run() + { + try ( + ScribServerSocket ss = new SocketChannelServer(8888); + MPSTEndpoint se = new MPSTEndpoint<>(this.fib, B, + new ObjectStreamFormatter())) + { + se.accept(ss, A); + new Fibonacci_B_1(se).branch(A, this); + } + catch (Exception x) + { + x.printStackTrace(); + } + } +/* +} +/*/ + @Override + public void receive(Fibonacci_B_2 s2, fibonacci op, Buf arg1) + throws ScribRuntimeException, IOException, ClassNotFoundException + { + s2.send(A, fibonacci, (this.x += arg1.val)).branch(A, this); + } + + @Override + public void receive(EndSocket end, stop op) + throws ScribRuntimeException, IOException, ClassNotFoundException + { + //System.out.println("B done: " + this.x); + } +} +//*/ diff --git a/scribble-demos/scrib/coco/src/coco/fibo/FiboMain.java b/scribble-demos/scrib/coco/src/coco/fibo/FiboMain.java new file mode 100644 index 000000000..a4f2db47e --- /dev/null +++ b/scribble-demos/scrib/coco/src/coco/fibo/FiboMain.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package coco.fibo; + +import coco.fibo.Fibo.Fibonacci.Fibonacci; + +public class FiboMain +{ + public static void main(String[] args) throws Exception + { + Fibonacci fib = new Fibonacci(); + //new MyB(fib).start(); + new FiboBHandler(fib).start(); + new FiboA(fib).start(); + } +} diff --git a/scribble-demos/scrib/coco/src/coco/smtp/MySmtpC.java b/scribble-demos/scrib/coco/src/coco/smtp/MySmtpC.java new file mode 100644 index 000000000..8039da897 --- /dev/null +++ b/scribble-demos/scrib/coco/src/coco/smtp/MySmtpC.java @@ -0,0 +1,110 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +//$ java -cp modules/cli/target/classes/';'modules/core/target/classes';'modules/parser/target/classes';'modules/demos/target/classes/ coco.smtp.Client + +package coco.smtp; + +import static coco.smtp.Smtp.Smtp.Smtp.C; +import static coco.smtp.Smtp.Smtp.Smtp.S; +import static coco.smtp.Smtp.Smtp.Smtp._220; + +import org.scribble.runtime.net.SSLSocketChannelWrapper; +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.statechans.LinearSocket; +import org.scribble.runtime.util.Buf; + +import coco.smtp.Smtp.Smtp.Smtp; +import coco.smtp.Smtp.Smtp.roles.C; +import coco.smtp.Smtp.Smtp.statechans.C.Smtp_C_1; +import coco.smtp.Smtp.Smtp.statechans.C.ioifaces.Out_S_Ehlo; +import coco.smtp.Smtp.Smtp.statechans.C.ioifaces.Receive_C_S_220; +import coco.smtp.Smtp.Smtp.statechans.C.ioifaces.Select_C_S_Ehlo; +import coco.smtp.Smtp.Smtp.statechans.C.ioifaces.Select_C_S_Quit; +import coco.smtp.Smtp.Smtp.statechans.C.ioifaces.Select_C_S_StartTls; +import coco.smtp.Smtp.Smtp.statechans.C.ioifaces.Succ_In_S_250; +import coco.smtp.message.SmtpMessageFormatter; +import coco.smtp.message.client.Quit; +import coco.smtp.message.client.StartTls; + +public class MySmtpC +{ + public MySmtpC() throws Exception + { + run(); + } + + public static void main(String[] args) throws Exception + { + new MySmtpC(); + } + + public void run() throws Exception + { + String host = "smtp.cc.ic.ac.uk"; + int port = 25; + + Smtp smtp = new Smtp(); + try (MPSTEndpoint se = new MPSTEndpoint<>(smtp, C, + new SmtpMessageFormatter())) { + se.request(S, SocketChannelEndpoint::new, host, port); + + Smtp_C_1 s1 = new Smtp_C_1(se); + doInit( + LinearSocket.wrapClient( + doInit(s1.receive(S, _220, new Buf<>())) + .to(Select_C_S_StartTls.cast) // Run-time cast + .send(S, new StartTls()) + .to(Receive_C_S_220.cast) // Safe cast + .receive(S, _220, new Buf<>()) + .to(Select_C_S_Ehlo.cast) // Safe cast + , S, SSLSocketChannelWrapper::new) + ) + .to(Select_C_S_Quit.cast) // Run-time cast + .send(S, new Quit()); + } + } + + //* + private Succ_In_S_250 doInit(Out_S_Ehlo s) throws Exception + { + // TODO: ... + return null; + } + /*/ + private Succ_In_S_250 doInit(Select_C_S_Ehlo s) throws Exception + { + Branch_C_S_250__S_250d b = + s.send(S, new Ehlo("test")) + .to(Branch_C_S_250__S_250d.cast); // Safe cast + Buf<_250> b1 = new Buf<>(); + Buf<_250d> b2 = new Buf<>(); + while (true) + { + Case_C_S_250__S_250d c = b.branch(S); + switch (c.getOp()) + { + case _250: + return Client1.printlnBuf(c.receive(S, _250, b1), b1); + case _250d: + b = Client1.printBuf( + c.receive(S, _250d, b2) + .to(Branch_C_S_250__S_250d.cast) // Safe cast + , b2); + break; + } + } + } + //*/ +} diff --git a/scribble-demos/scrib/coco/src/coco/smtp/Smtp.scr b/scribble-demos/scrib/coco/src/coco/smtp/Smtp.scr new file mode 100644 index 000000000..46d9c3311 --- /dev/null +++ b/scribble-demos/scrib/coco/src/coco/smtp/Smtp.scr @@ -0,0 +1,68 @@ +//$ ./scribblec.sh -ip scribble-demos/scrib/coco/src -d scribble-demos/scrib/coco/src scribble-demos/scrib/coco/src/coco/smtp/Smtp.scr -api Smtp C +//$ javadoc -cp scribble-core/target/classes:scribble-runtime/target/classes:scribble-demos/scrib/coco/src scribble-demos/scrib/coco/src/coco/smtp/*.java -subpackages coco.smtp.Smtp.Smtp -d scribble-demos/scrib/coco/javadoc/smtp + +//http://sandbox.kidstrythisathome.com/erdos/ + + +module coco.smtp.Smtp; + +sig "coco.smtp.message.server._220" + from "coco/smtp/message/server/_220.java" as 220; +sig "coco.smtp.message.server._250" + from "coco/smtp/message/server/_250.java" as 250; +sig "coco.smtp.message.server._250d" + from "coco/smtp/message/server/_250d.java" as 250d; + +sig "coco.smtp.message.client.Ehlo" + from "coco/smtp/message/client/Ehlo.java" as Ehlo; +sig "coco.smtp.message.client.StartTls" + from "coco/smtp/message/client/StartTls.java" as StartTls; +sig "coco.smtp.message.client.Quit" + from "coco/smtp/message/client/Quit.java" as Quit; + +global protocol Smtp(role C, role S) +{ + 220 from S to C; //* + do Init(C, S); + do StartTls(C, S); + do Init(C, S); + Quit from C to S; +} +/*/ + choice at C + { + do Init(C, S); + do StartTls(C, S); + do Init(C, S); + Quit from C to S; + } + or + { + Quit from C to S; + } +} +//*/ + +aux global protocol Init(role C, role S) +{ + Ehlo from C to S; + rec X + { + choice at S + { + 250d from S to C; + continue X; + } + or + { + 250 from S to C; + } + } + // or { Quit from C to S; } // FIXME: apigen +} + +aux global protocol StartTls(role C, role S) +{ + StartTls from C to S; + 220 from S to C; +} diff --git a/scribble-demos/scrib/coco/src/coco/smtp/SmtpC1.java b/scribble-demos/scrib/coco/src/coco/smtp/SmtpC1.java new file mode 100644 index 000000000..6ef39d541 --- /dev/null +++ b/scribble-demos/scrib/coco/src/coco/smtp/SmtpC1.java @@ -0,0 +1,137 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +//$ java -cp modules/cli/target/classes/';'modules/core/target/classes';'modules/parser/target/classes';'modules/demos/target/classes/ coco.smtp.Client1 + + +package coco.smtp; + +import static coco.smtp.Smtp.Smtp.Smtp.C; +import static coco.smtp.Smtp.Smtp.Smtp.S; +import static coco.smtp.Smtp.Smtp.Smtp._220; +import static coco.smtp.Smtp.Smtp.Smtp._250; +import static coco.smtp.Smtp.Smtp.Smtp._250d; + +import org.scribble.runtime.net.SSLSocketChannelWrapper; +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.statechans.LinearSocket; +import org.scribble.runtime.util.Buf; + +import coco.smtp.Smtp.Smtp.Smtp; +import coco.smtp.Smtp.Smtp.roles.C; +import coco.smtp.Smtp.Smtp.statechans.C.Smtp_C_1; +import coco.smtp.Smtp.Smtp.statechans.C.Smtp_C_2; +import coco.smtp.Smtp.Smtp.statechans.C.Smtp_C_3; +import coco.smtp.Smtp.Smtp.statechans.C.Smtp_C_3_Cases; +import coco.smtp.Smtp.Smtp.statechans.C.Smtp_C_4; +import coco.smtp.Smtp.Smtp.statechans.C.Smtp_C_6; +import coco.smtp.Smtp.Smtp.statechans.C.Smtp_C_7; +import coco.smtp.Smtp.Smtp.statechans.C.Smtp_C_7_Cases; +import coco.smtp.Smtp.Smtp.statechans.C.Smtp_C_8; +import coco.smtp.message.SmtpMessageFormatter; +import coco.smtp.message.client.Ehlo; +import coco.smtp.message.client.Quit; +import coco.smtp.message.client.StartTls; +import coco.smtp.message.server._250; +import coco.smtp.message.server._250d; + +public class SmtpC1 +{ + public SmtpC1() throws Exception + { + run(); + } + + public static void main(String[] args) throws Exception + { + new SmtpC1(); + } + + public void run() throws Exception + { + String host = "...smtp server..."; + int port = 25; + + Smtp smtp = new Smtp(); + try (MPSTEndpoint se = new MPSTEndpoint<>(smtp, C, + new SmtpMessageFormatter())) { + se.request(S, SocketChannelEndpoint::new, host, port); + + Smtp_C_1 s1 = new Smtp_C_1(se); + doInit( + doStartTls( + doInit(s1.receive(S, _220, new Buf<>())) + ) + ) + .send(S, new Quit()); + } + } + + private Smtp_C_4 doInit(Smtp_C_2 s2) throws Exception + { + Smtp_C_3 s3 = s2.send(S, new Ehlo("test")); + Buf<_250> b1 = new Buf<>(); + Buf<_250d> b2 = new Buf<>(); + while (true) + { + Smtp_C_3_Cases c = s3.branch(S); + switch (c.op) + { + case _250: + return printlnBuf(c.receive(S, _250, b1), b1); + case _250d: + s3 = printBuf(c.receive(S, _250d, b2), b2); + break; + } + } + } + + private Smtp_C_8 doInit(Smtp_C_6 s6) throws Exception + { + Smtp_C_7 s7 = s6.send(S, new Ehlo("test")); + Buf<_250> b1 = new Buf<>(); + Buf<_250d> b2 = new Buf<>(); + while (true) + { + Smtp_C_7_Cases c = s7.branch(S); + switch (c.op) + { + case _250: + return printlnBuf(c.receive(S, _250, b1), b1); + case _250d: + s7 = printBuf(c.receive(S, _250d, b2), b2); + break; + } + } + } + + private Smtp_C_6 doStartTls(Smtp_C_4 s4) throws Exception + { + return LinearSocket.wrapClient( + s4.send(S, new StartTls()).receive(S, _220, new Buf<>()), S, SSLSocketChannelWrapper::new + ); + } + + public static > S printBuf(S s, B b) + { + System.out.print(b.val); + return s; + } + + public static > S printlnBuf(S s, B b) + { + System.out.println(b.val); + return s; + } +} diff --git a/scribble-demos/scrib/coco/src/coco/smtp/SmtpC2.java b/scribble-demos/scrib/coco/src/coco/smtp/SmtpC2.java new file mode 100644 index 000000000..ceb0727e0 --- /dev/null +++ b/scribble-demos/scrib/coco/src/coco/smtp/SmtpC2.java @@ -0,0 +1,153 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +//$ java -cp modules/cli/target/classes/';'modules/core/target/classes';'modules/parser/target/classes';'modules/demos/target/classes/ coco.smtp.Client2 + + +package coco.smtp; + +import static coco.smtp.Smtp.Smtp.Smtp.S; +import static coco.smtp.Smtp.Smtp.Smtp._220; +import static coco.smtp.Smtp.Smtp.Smtp._250; +import static coco.smtp.Smtp.Smtp.Smtp._250d; + +import org.scribble.runtime.net.SSLSocketChannelWrapper; +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.statechans.LinearSocket; +import org.scribble.runtime.util.Buf; + +import coco.smtp.Smtp.Smtp.Smtp; +import coco.smtp.Smtp.Smtp.roles.C; +import coco.smtp.Smtp.Smtp.statechans.C.Smtp_C_1; +import coco.smtp.Smtp.Smtp.statechans.C.Smtp_C_1_Future; +import coco.smtp.Smtp.Smtp.statechans.C.ioifaces.Branch_C_S_250__S_250d; +import coco.smtp.Smtp.Smtp.statechans.C.ioifaces.Case_C_S_250__S_250d; +import coco.smtp.Smtp.Smtp.statechans.C.ioifaces.Receive_C_S_220; +import coco.smtp.Smtp.Smtp.statechans.C.ioifaces.Select_C_S_Ehlo; +import coco.smtp.Smtp.Smtp.statechans.C.ioifaces.Select_C_S_Quit; +import coco.smtp.Smtp.Smtp.statechans.C.ioifaces.Select_C_S_StartTls; +import coco.smtp.Smtp.Smtp.statechans.C.ioifaces.Succ_In_S_250; +import coco.smtp.message.SmtpMessageFormatter; +import coco.smtp.message.client.Ehlo; +import coco.smtp.message.client.Quit; +import coco.smtp.message.client.StartTls; +import coco.smtp.message.server._250; +import coco.smtp.message.server._250d; + +public class SmtpC2 +{ + public SmtpC2() throws Exception + { + run(); + } + + public static void main(String[] args) throws Exception + { + new SmtpC2(); + } + + public void run() throws Exception + { + String host = "...smtp server..."; + int port = 25; + + Smtp smtp = new Smtp(); + try (MPSTEndpoint se = new MPSTEndpoint<>(smtp, Smtp.C, + new SmtpMessageFormatter())) { + se.request(Smtp.S, SocketChannelEndpoint::new, host, port); + + Buf b1 = new Buf<>(); + Smtp_C_1 s1 = new Smtp_C_1(se); + //Buf b2 = new Buf<>(); // only supported by concrete state chans + doInit( + LinearSocket.wrapClient( + doInit(s1.async(S, _220, b1)) + .to(Select_C_S_StartTls.cast).send(S, new StartTls()) // Run-time cast + .to(Receive_C_S_220.cast) // Safe cast + //.receive(S, _220, new Buf<>()) + .async(S, _220) + .to(Select_C_S_Ehlo.cast) // Safe cast + , S, SSLSocketChannelWrapper::new) + ) + .to(Select_C_S_Quit.cast).send(S, new Quit()); // Run-time cast + + //b1.val.sync(); + //System.out.println("b1: " + b1.val.sync().msg); + //System.out.println("b2: " + b2.val.sync().msg); + } + } + + //private > Succ_In_S_250 doInit(S s) throws Exception + //private Succ_In_S_250 doInit(Select_C_S_Ehlo__S_Quit s) throws Exception + private Succ_In_S_250 doInit(Select_C_S_Ehlo s) throws Exception + { + /* + ... + } + /*/ + Branch_C_S_250__S_250d b = + s.send(S, new Ehlo("test")) + .to(Branch_C_S_250__S_250d.cast); // Safe cast + Buf<_250> b1 = new Buf<>(); + Buf<_250d> b2 = new Buf<>(); + while (true) + { + Case_C_S_250__S_250d c = b.branch(S); + switch (c.getOp()) + { + case _250: + return SmtpC1.printlnBuf(c.receive(S, _250, b1), b1); + case _250d: + b = SmtpC1.printBuf( + c.receive(S, _250d, b2) + .to(Branch_C_S_250__S_250d.cast) // Safe cast + , b2); + break; + } + } + } + //*/ +} + + + + + /*private Succ_In_S_250 doInitiation(Receive_C_S_220 s) throws Exception + { + Branch_C_S_250d__S_250 b = + s.receive(S, _220, new Buf<>()).to(Select_C_S_Ehlo.cast) + .send(S, new Ehlo("test")) + .to(Branch_C_S_250d__S_250.cast); // Safe cast + Buf<_250> b1 = new Buf<>(); + Buf<_250_> b2 = new Buf<>(); + while (true) + { + Case_C_S_250d__S_250 c = b.branch(S); + switch (c.getOp()) + { + case _250d: + { + b = c.receive(S, _250d, b2).to(Branch_C_S_250d__S_250.cast); + System.out.print(b2.val); + break; + } + case _250: + { + Succ_In_S_250 succ = c.receive(S, _250, b1); + System.out.println(b1.val); + return succ; + } + } + } + }*/ \ No newline at end of file diff --git a/scribble-demos/scrib/coco/src/coco/smtp/SmtpC3.java b/scribble-demos/scrib/coco/src/coco/smtp/SmtpC3.java new file mode 100644 index 000000000..5fb4d44ce --- /dev/null +++ b/scribble-demos/scrib/coco/src/coco/smtp/SmtpC3.java @@ -0,0 +1,104 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +//$ java -cp modules/cli/target/classes/';'modules/core/target/classes';'modules/parser/target/classes';'modules/demos/target/classes/ coco.smtp.Client3 + + +package coco.smtp; + +import static coco.smtp.Smtp.Smtp.Smtp.C; +import static coco.smtp.Smtp.Smtp.Smtp.S; +import static coco.smtp.Smtp.Smtp.Smtp._220; +import static coco.smtp.Smtp.Smtp.Smtp._250; +import static coco.smtp.Smtp.Smtp.Smtp._250d; + +import org.scribble.runtime.net.SSLSocketChannelWrapper; +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.statechans.LinearSocket; +import org.scribble.runtime.util.Buf; + +import coco.smtp.Smtp.Smtp.Smtp; +import coco.smtp.Smtp.Smtp.roles.C; +import coco.smtp.Smtp.Smtp.statechans.C.Smtp_C_1; +import coco.smtp.Smtp.Smtp.statechans.C.Smtp_C_1_Future; +import coco.smtp.Smtp.Smtp.statechans.C.ioifaces.Branch_C_S_250__S_250d; +import coco.smtp.Smtp.Smtp.statechans.C.ioifaces.Case_C_S_250__S_250d; +import coco.smtp.Smtp.Smtp.statechans.C.ioifaces.Select_C_S_Ehlo; +import coco.smtp.Smtp.Smtp.statechans.C.ioifaces.Succ_In_S_250; +import coco.smtp.message.SmtpMessageFormatter; +import coco.smtp.message.client.Ehlo; +import coco.smtp.message.client.Quit; +import coco.smtp.message.client.StartTls; +import coco.smtp.message.server._250; +import coco.smtp.message.server._250d; + +// "No casts" version -- via generic inference +public class SmtpC3 +{ + public SmtpC3() throws Exception + { + run(); + } + + public static void main(String[] args) throws Exception + { + new SmtpC3(); + } + + public void run() throws Exception + { + String host = "...smtp server..."; + int port = 25; + + Smtp smtp = new Smtp(); + try (MPSTEndpoint se = new MPSTEndpoint<>(smtp, C, new SmtpMessageFormatter())) + { + se.request(S, SocketChannelEndpoint::new, host, port); + + Smtp_C_1 s1 = new Smtp_C_1(se); + Buf b = new Buf<>(); + doInit( + LinearSocket.wrapClient( + doInit(s1.async(S, _220, b)) + .send(S, new StartTls()) + .async(S, _220) + , S, SSLSocketChannelWrapper::new) + ) + .send(S, new Quit()); + + //System.out.println("b1: " + b.val.sync().msg); + } + } + + private , T2 extends Succ_In_S_250> + //T2 doInit(Select_C_S_Ehlo__S_Quit s) throws Exception + T2 doInit(Select_C_S_Ehlo s) throws Exception + { + Branch_C_S_250__S_250d b = s.send(S, new Ehlo("test")); + Buf<_250> b1 = new Buf<>(); + Buf<_250d> b2 = new Buf<>(); + while (true) + { + Case_C_S_250__S_250d c = b.branch(S); + switch (c.getOp()) + { + case _250d: + b = SmtpC1.printBuf(c.receive(S, _250d, b2), b2); + break; + case _250: + return SmtpC1.printlnBuf(c.receive(S, _250, b1), b1); + } + } + } +} diff --git a/scribble-demos/scrib/coco/src/coco/smtp/message/SmtpMessage.java b/scribble-demos/scrib/coco/src/coco/smtp/message/SmtpMessage.java new file mode 100644 index 000000000..ff7499bd9 --- /dev/null +++ b/scribble-demos/scrib/coco/src/coco/smtp/message/SmtpMessage.java @@ -0,0 +1,86 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package coco.smtp.message; + +import org.scribble.core.type.name.Op; +import org.scribble.runtime.message.ScribMessage; +import org.scribble.util.Caller; + +import coco.smtp.Smtp.Smtp.Smtp; + +public abstract class SmtpMessage extends ScribMessage +{ + public static final String _220 = "220"; + public static final String _250 = "250"; + public static final String _250_ = "250-"; + public static final String _235 = "235"; + public static final String _535 = "535"; + public static final String _501 = "501"; + public static final String _354 = "354"; + + public static final String EHLO = "ehlo"; + public static final String STARTTLS = "starttls"; + public static final String AUTH = "auth plain"; + public static final String MAIL = "mail from:"; + public static final String RCPT = "rcpt to:"; + public static final String SUBJECT = "subject:"; + public static final String DATA = "data"; + public static final String QUIT = "quit"; + + public static final String DATA_LINE = ""; + public static final String END_OF_DATA = ""; + + private static final long serialVersionUID = 1L; + + protected static final String CRLF = "\r\n"; + + public SmtpMessage(Op op) + { + super(op); + } + + public SmtpMessage(Op op, String body) + { + super(op, body); + } + + public String getBody() + { + return (this.payload.length == 0) ? "" : (String) this.payload[0]; + } + + public byte[] toBytes() + { + byte[] bs = (getOpString(this.op) + " " + getBody() + SmtpMessage.CRLF).getBytes(SmtpMessageFormatter.cs); // Can give "utf-8" as arg directly + return bs; + } + + @Override + public String toString() + { + return new String(toBytes()); + } + + protected static String getOpString(Op op) + { + return + (op.equals(Smtp._220)) ? SmtpMessage._220 + : (op.equals(Smtp._250)) ? SmtpMessage._250 + : (op.equals(Smtp._250d)) ? SmtpMessage._250_ + : (op.equals(Smtp.Ehlo)) ? SmtpMessage.EHLO + : (op.equals(Smtp.StartTls)) ? SmtpMessage.STARTTLS + : (op.equals(Smtp.Quit)) ? SmtpMessage.QUIT + : new Caller().call(() -> { throw new RuntimeException("TODO: " + op); }); + } +} diff --git a/scribble-demos/scrib/coco/src/coco/smtp/message/SmtpMessageFormatter.java b/scribble-demos/scrib/coco/src/coco/smtp/message/SmtpMessageFormatter.java new file mode 100644 index 000000000..cd010038f --- /dev/null +++ b/scribble-demos/scrib/coco/src/coco/smtp/message/SmtpMessageFormatter.java @@ -0,0 +1,446 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package coco.smtp.message; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; + +import org.scribble.runtime.message.ScribMessage; +import org.scribble.runtime.message.ScribMessageFormatter; + +import coco.smtp.message.server._220; +import coco.smtp.message.server._250; +import coco.smtp.message.server._250d; + +// Currently supports only client-side reading, not server-side +public class SmtpMessageFormatter implements ScribMessageFormatter +{ + //.. fix formatting + //.. try ssl wrapper + //.. add connection (transport) actions + + public static Charset cs = Charset.forName("UTF8"); + //private static CharsetDecoder cd = cs.newDecoder(); + + public SmtpMessageFormatter() + { + + } + + @Override + public byte[] toBytes(ScribMessage m) throws IOException + { + return ((SmtpMessage) m).toBytes(); + } + + @Override + public ScribMessage fromBytes(ByteBuffer bb) throws IOException, ClassNotFoundException + { + bb.flip(); + //byte[] bs = new byte[2]; + int rem = bb.remaining(); + if (rem < 2) + { + bb.compact(); + return null; + } + + int pos = bb.position(); + String front = new String(new byte[] { bb.get(pos), bb.get(pos + 1) }, SmtpMessageFormatter.cs); + if (front.equals(SmtpMessage.CRLF)) + { + throw new RuntimeException("TODO: "); + } + + if (rem < pos + 4) + { + bb.compact(); + return null; + } + front += new String(new byte[] { bb.get(pos + 2), bb.get(pos + 3) }, SmtpMessageFormatter.cs); + int code = isStatusCode(front); + if (code > -1) + { + String body = readLine(bb, pos + 4).trim(); // Whitespace already built into the message classes + bb.compact(); + if (body == null) + { + return null; + } + switch (code) + { + case 220: return new _220(body); + case 250: + { + if (front.charAt(3) == '-') + { + return new _250d(body); + } + return new _250(body); + } + /*case 235: return new _235(body); + case 535: return new _535(body); + case 501: return new _501(body); + case 354: return new _354(body);*/ + default: throw new RuntimeException("Unknown status code " + code + ": " + body); + } + } + /*else if (front.startsWith(HttpMessage.GET)) // TODO: server-side (EHLO, STARTTLS, etc) + { + }*/ + else + { + // TODO: server-side (MAIL FROM:, RCPT TO:, etc) + String line = front + readLine(bb, pos + 4); + bb.compact(); + /*if (line == null) // deadcode + { + return null; + }*/ + throw new RuntimeException("Cannot parse message: " + line); + } + } + + private static String readLine(ByteBuffer bb, int i) throws IOException + { + StringBuilder sb = new StringBuilder(); + for (int limit = bb.limit(); i <= limit; ) + { + char c = (char) bb.get(i++); + sb.append(c); + if (c == '\r') + { + c = (char) bb.get(i++); + sb.append(c); + if (c == '\n') + { + bb.position(i); + return sb.substring(0, sb.length() - 2).toString(); + } + } + } + return null; + } + + // Duplicated from HttpMessageFormatter // FIXME: factor out + private int isStatusCode(String front) + { + String code = ""; + for (int i = 0; i < 4; i++) + { + //char c = (char) bs[i]; + char c = front.charAt(i); + if (i < 3) + { + if (c < '0' || c > '9') + { + return -1; + } + code += c; + } + else + { + if (c != ' ' && c != '-') // HACK: hypen + { + return -1; + } + } + } + return Integer.parseInt(code); + } + + /*private static String readWord(ByteBuffer bb, int i) throws IOException + { + StringBuilder sb = new StringBuilder(); + for (int limit = bb.limit(); i <= limit; ) + { + char c = (char) bb.get(i); + if (c == ' ') + { + bb.position(i); + return sb.toString(); + } + sb.append(c); + } + return null; + }*/ + + /* // Pre: flipped ready for reading + @Override + public SmtpMessage readMessage(DataInputStream dis) throws IOException + { + String header = getHeader(dis); + switch (header) + { + // FIXME: factor out text constants with Session constants? + case "220 ": + { + return new _220(getBody(dis)); + } + case "235 ": + { + return new _235(getBody(dis)); + } + case "250-": + { + return new _250_(getBody(dis)); + } + case "250 ": + { + return new _250(getBody(dis)); + } + case "354 ": + { + return new _354(getBody(dis)); + } + case "501 ": + { + return new _501(getBody(dis)); + } + case "535 ": + { + return new _535(getBody(dis)); + } + default: + { + throw new RuntimeException("Unknown header: " + header); + } + } + } + + // *4* char headers (3 digits, dash or space) + private String getHeader(DataInputStream dis) throws IOException + { + readMinimumBytes(dis, 4); + + int limit = bb.limit(); + bb.limit(4); + String header = cd.decode(bb).toString(); // updates bb position + bb.limit(limit); + bb.compact(); + bb.flip(); + return header; + } + + // Reads up to \r\n inclusive; doesn't return the \r\n + private String getBody(DataInputStream dis) throws IOException + { + int min = 2; + readMinimumBytes(dis, min); // Min should be more? + while (true) + { + String all = cd.decode(bb).toString(); // updates bb position + if (all.contains("\n")) // FIXME: didn't check exactly \r\n + { + int i = all.indexOf("\n"); + String body = all.substring(0, i - 1); + bb.position(i + 1); // \r\n -- ASCII 1-to-1 byte-char index + bb.compact(); + bb.flip(); + return body; + } + bb.rewind(); + readMinimumBytes(dis, ++min); // FIXME: buffered readLine would be more efficient + } + } + + // FIXME: min should mean min fresh (i.e. not including bb cached -- there currently is no cache: is.available doesn't work for SSLSocket, always returns 0) + private void readMinimumBytes(DataInputStream dis, int min) throws IOException + { + for (int remaining = bb.remaining(); remaining < min; remaining = bb.remaining()) + { + bb.compact(); + bb.put((byte) dis.read()); // FIXME: check for buffer overflow + bb.flip(); + } + }*/ + + @Override + public void writeMessage(DataOutputStream dos, ScribMessage m) throws IOException + { + dos.write(((SmtpMessage) m).toBytes()); + dos.flush(); + } + + @Override + public SmtpMessage readMessage(DataInputStream dis) throws IOException + { + byte[] bs = new byte[2]; + dis.readFully(bs); + String front = new String(bs, SmtpMessageFormatter.cs); + if (front.equals(SmtpMessage.CRLF)) + { + throw new RuntimeException("TODO: "); + } + bs = new byte[2]; + dis.readFully(bs); + front += new String(bs, SmtpMessageFormatter.cs); + int code = isStatusCode(front); + if (code > -1) + { + String body = readLine(dis).trim(); // Whitespace already built into the message classes + switch (code) + { + case 220: return new _220(body); + case 250: + { + if (front.charAt(3) == '-') + { + return new _250d(body); + } + return new _250(body); + } + /*case 235: return new _235(body); + case 535: return new _535(body); + case 501: return new _501(body); + case 354: return new _354(body);*/ + default: throw new RuntimeException("Unknown status code: " + code); + } + } + /*else if (front.startsWith(HttpMessage.GET)) + { + }*/ + else + { + String line = front + readLine(dis); + throw new RuntimeException("Cannot parse message: " + line); + } + } + + private static String readLine(DataInputStream dis) throws IOException + { + StringBuilder sb = new StringBuilder(); + for (; true; ) + { + char c = (char) dis.read(); // readChar is not the same + sb.append(c); + if (c == '\r') + { + c = (char) dis.read(); + sb.append(c); + if (c == '\n') + { + return sb.substring(0, sb.length() - 2).toString(); + } + } + } + } + + /*private static String readWord(DataInputStream dis) throws IOException + { + StringBuilder sb = new StringBuilder(); + for (; true; ) + { + char c = (char) dis.read(); + if (c == ' ') + { + return sb.toString(); + } + sb.append(c); + } + }*/ + + /* // Pre: flipped ready for reading + @Override + public SmtpMessage readMessage(DataInputStream dis) throws IOException + { + String header = getHeader(dis); + switch (header) + { + // FIXME: factor out text constants with Session constants? + case "220 ": + { + return new _220(getBody(dis)); + } + case "235 ": + { + return new _235(getBody(dis)); + } + case "250-": + { + return new _250_(getBody(dis)); + } + case "250 ": + { + return new _250(getBody(dis)); + } + case "354 ": + { + return new _354(getBody(dis)); + } + case "501 ": + { + return new _501(getBody(dis)); + } + case "535 ": + { + return new _535(getBody(dis)); + } + default: + { + throw new RuntimeException("Unknown header: " + header); + } + } + } + + // *4* char headers (3 digits, dash or space) + private String getHeader(DataInputStream dis) throws IOException + { + readMinimumBytes(dis, 4); + + int limit = bb.limit(); + bb.limit(4); + String header = cd.decode(bb).toString(); // updates bb position + bb.limit(limit); + bb.compact(); + bb.flip(); + return header; + } + + // Reads up to \r\n inclusive; doesn't return the \r\n + private String getBody(DataInputStream dis) throws IOException + { + int min = 2; + readMinimumBytes(dis, min); // Min should be more? + while (true) + { + String all = cd.decode(bb).toString(); // updates bb position + if (all.contains("\n")) // FIXME: didn't check exactly \r\n + { + int i = all.indexOf("\n"); + String body = all.substring(0, i - 1); + bb.position(i + 1); // \r\n -- ASCII 1-to-1 byte-char index + bb.compact(); + bb.flip(); + return body; + } + bb.rewind(); + readMinimumBytes(dis, ++min); // FIXME: buffered readLine would be more efficient + } + } + + // FIXME: min should mean min fresh (i.e. not including bb cached -- there currently is no cache: is.available doesn't work for SSLSocket, always returns 0) + private void readMinimumBytes(DataInputStream dis, int min) throws IOException + { + for (int remaining = bb.remaining(); remaining < min; remaining = bb.remaining()) + { + bb.compact(); + bb.put((byte) dis.read()); // FIXME: check for buffer overflow + bb.flip(); + } + }*/ +} diff --git a/scribble-demos/scrib/coco/src/coco/smtp/message/client/Ehlo.java b/scribble-demos/scrib/coco/src/coco/smtp/message/client/Ehlo.java new file mode 100644 index 000000000..13b1cd279 --- /dev/null +++ b/scribble-demos/scrib/coco/src/coco/smtp/message/client/Ehlo.java @@ -0,0 +1,32 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package coco.smtp.message.client; + +import coco.smtp.Smtp.Smtp.Smtp; +import coco.smtp.message.SmtpMessage; + +public class Ehlo extends SmtpMessage +{ + private static final long serialVersionUID = 1L; + + public Ehlo() + { + super(Smtp.Ehlo); + } + + public Ehlo(String body) + { + super(Smtp.Ehlo, body); + } +} diff --git a/scribble-demos/scrib/coco/src/coco/smtp/message/client/Quit.java b/scribble-demos/scrib/coco/src/coco/smtp/message/client/Quit.java new file mode 100644 index 000000000..63e0dde10 --- /dev/null +++ b/scribble-demos/scrib/coco/src/coco/smtp/message/client/Quit.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package coco.smtp.message.client; + +import coco.smtp.Smtp.Smtp.Smtp; +import coco.smtp.message.SmtpMessage; + +public class Quit extends SmtpMessage +{ + private static final long serialVersionUID = 1L; + + public Quit() + { + super(Smtp.Quit); + } +} diff --git a/scribble-demos/scrib/coco/src/coco/smtp/message/client/StartTls.java b/scribble-demos/scrib/coco/src/coco/smtp/message/client/StartTls.java new file mode 100644 index 000000000..2e1688fc1 --- /dev/null +++ b/scribble-demos/scrib/coco/src/coco/smtp/message/client/StartTls.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package coco.smtp.message.client; + +import coco.smtp.Smtp.Smtp.Smtp; +import coco.smtp.message.SmtpMessage; + +public class StartTls extends SmtpMessage +{ + private static final long serialVersionUID = 1L; + + public StartTls() + { + super(Smtp.StartTls); + } +} diff --git a/scribble-demos/scrib/coco/src/coco/smtp/message/server/_220.java b/scribble-demos/scrib/coco/src/coco/smtp/message/server/_220.java new file mode 100644 index 000000000..fedec067e --- /dev/null +++ b/scribble-demos/scrib/coco/src/coco/smtp/message/server/_220.java @@ -0,0 +1,38 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package coco.smtp.message.server; + +import coco.smtp.Smtp.Smtp.Smtp; +import coco.smtp.message.SmtpMessage; + +public class _220 extends SmtpMessage +{ + private static final long serialVersionUID = 1L; + + public _220() + { + super(Smtp._220); + } + + public _220(String body) + { + super(Smtp._220, body); + } + + /*@Override + public Operator getOperator() + { + return Smtp._220; + }*/ +} diff --git a/scribble-demos/scrib/coco/src/coco/smtp/message/server/_250.java b/scribble-demos/scrib/coco/src/coco/smtp/message/server/_250.java new file mode 100644 index 000000000..c121479c0 --- /dev/null +++ b/scribble-demos/scrib/coco/src/coco/smtp/message/server/_250.java @@ -0,0 +1,32 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package coco.smtp.message.server; + +import coco.smtp.Smtp.Smtp.Smtp; +import coco.smtp.message.SmtpMessage; + +public class _250 extends SmtpMessage +{ + private static final long serialVersionUID = 1L; + + public _250() + { + super(Smtp._250); + } + + public _250(String body) + { + super(Smtp._250, body); + } +} diff --git a/scribble-demos/scrib/coco/src/coco/smtp/message/server/_250d.java b/scribble-demos/scrib/coco/src/coco/smtp/message/server/_250d.java new file mode 100644 index 000000000..651c9b072 --- /dev/null +++ b/scribble-demos/scrib/coco/src/coco/smtp/message/server/_250d.java @@ -0,0 +1,40 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package coco.smtp.message.server; + +import coco.smtp.Smtp.Smtp.Smtp; +import coco.smtp.message.SmtpMessage; +import coco.smtp.message.SmtpMessageFormatter; + +public class _250d extends SmtpMessage +{ + private static final long serialVersionUID = 1L; + + public _250d() + { + super(Smtp._250d); + } + + public _250d(String body) + { + super(Smtp._250d, body); + } + + @Override + public byte[] toBytes() + { + // No space after op + return (getOpString(this.op) + getBody() + SmtpMessage.CRLF).getBytes(SmtpMessageFormatter.cs); + } +} diff --git a/scribble-demos/scrib/fase16/src/fase16/adder/Adder.scr b/scribble-demos/scrib/fase16/src/fase16/adder/Adder.scr new file mode 100644 index 000000000..2abbcbe52 --- /dev/null +++ b/scribble-demos/scrib/fase16/src/fase16/adder/Adder.scr @@ -0,0 +1,24 @@ +//$ ./scribblec.sh -ip scribble-demos/scrib/fase16/src -d scribble-demos/scrib/fase16/src scribble-demos/scrib/fase16/src/fase16/adder/Adder.scr -api Adder C +//$ javadoc -cp scribble-core/target/classes:scribble-runtime/target/classes:scribble-demos/scrib/fase16/src/ scribble-demos/scrib/fase16/src/fase16/adder/Adder/Adder/*.java -subpackages fase16.adder.Adder.Adder -d scribble-demos/scrib/fase16/javadoc/adder + + +module fase16.adder.Adder; + + +data "java.lang.Integer" from "rt.jar" as Integer; + + +global protocol Adder(role C, role S) +{ + choice at C + { + Add(Integer, Integer) from C to S; + Res(Integer) from S to C; + do Adder(C, S); + } + or + { + Bye() from C to S; + Bye() from S to C; + } +} diff --git a/scribble-demos/scrib/fase16/src/fase16/adder/AdderC.java b/scribble-demos/scrib/fase16/src/fase16/adder/AdderC.java new file mode 100644 index 000000000..7bf12f0d1 --- /dev/null +++ b/scribble-demos/scrib/fase16/src/fase16/adder/AdderC.java @@ -0,0 +1,98 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package fase16.adder; + +import static fase16.adder.Adder.Adder.Adder.Add; +import static fase16.adder.Adder.Adder.Adder.Bye; +import static fase16.adder.Adder.Adder.Adder.C; +import static fase16.adder.Adder.Adder.Adder.Res; +import static fase16.adder.Adder.Adder.Adder.S; + +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import fase16.adder.Adder.Adder.Adder; +import fase16.adder.Adder.Adder.roles.C; +import fase16.adder.Adder.Adder.statechans.C.Adder_C_1; +import fase16.adder.Adder.Adder.statechans.C.Adder_C_3; + +public class AdderC +{ + private static final int N = 10; + + public static void main(String[] args) throws Exception + { + //adder(); + fib(); + } + + private static void adder() throws Exception + { + Adder adder = new Adder(); + try (MPSTEndpoint se = new MPSTEndpoint<>(adder, C, + new ObjectStreamFormatter())) { + se.request(S, SocketChannelEndpoint::new, "localhost", 8888); + + Adder_C_1 s1 = new Adder_C_1(se); + + + + Buf i = new Buf<>(1); + //* + for (int j = 0; j < N; j++) + { + s1 = s1.send(S, Add, i.val, i.val).receive(S, Res, i); + } + s1.send(S, Bye).receive(S, Bye); + + + + + /*/ + s1.send(S, Add, i.val, i.val) + .receive(S, Res, i) + .send(S, Add, i.val, i.val) + .receive(S, Res, i) + //... + .send(S, Bye).receive(S, Bye); + //*/ + + System.out.println("C: " + i.val); + } + } + + private static void fib() throws Exception + { + Adder adder = new Adder(); + try (MPSTEndpoint se = new MPSTEndpoint<>(adder, C, new ObjectStreamFormatter())) + { + se.request(S, SocketChannelEndpoint::new, "localhost", 8888); + + Adder_C_1 s1 = new Adder_C_1(se); + Buf i = new Buf<>(0); + fib(s1, i, new Buf(1), 0).receive(S, Bye); + + System.out.println("Fib: " + i.val); + } + } + + private static Adder_C_3 fib(Adder_C_1 s1, Buf i1, Buf i2, int i) throws Exception + { + return (i < N) + ? fib(s1.send(S, Add, i1.val, i1.val=i2.val).receive(S, Res, i2), i1, i2, i+1) + : s1.send(S, Bye); + } +} diff --git a/scribble-demos/scrib/fase16/src/fase16/adder/AdderS.java b/scribble-demos/scrib/fase16/src/fase16/adder/AdderS.java new file mode 100644 index 000000000..5ba75ebb3 --- /dev/null +++ b/scribble-demos/scrib/fase16/src/fase16/adder/AdderS.java @@ -0,0 +1,80 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package fase16.adder; + +import static fase16.adder.Adder.Adder.Adder.Add; +import static fase16.adder.Adder.Adder.Adder.Bye; +import static fase16.adder.Adder.Adder.Adder.C; +import static fase16.adder.Adder.Adder.Adder.Res; +import static fase16.adder.Adder.Adder.Adder.S; + +import java.io.IOException; + +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.net.SocketChannelServer; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import fase16.adder.Adder.Adder.Adder; +import fase16.adder.Adder.Adder.roles.S; +import fase16.adder.Adder.Adder.statechans.S.Adder_S_1; +import fase16.adder.Adder.Adder.statechans.S.Adder_S_1_Cases; +import fase16.adder.Adder.Adder.statechans.S.Adder_S_3; + + +public class AdderS +{ + public static void main(String[] args) throws Exception + { + try (ScribServerSocket ss = new SocketChannelServer(8888)) + { + Buf i1 = new Buf<>(); + Buf i2 = new Buf<>(); + + while (true) + { + Adder adder = new Adder(); + try (MPSTEndpoint se = new MPSTEndpoint<>(adder, S, + new ObjectStreamFormatter())) { + se.accept(ss, C); + + add(new Adder_S_1(se), i1, i2).send(C, Bye); + } + catch (ScribRuntimeException | IOException | ClassNotFoundException e) + { + e.printStackTrace(); + } + } + } + } + + private static Adder_S_3 add(Adder_S_1 s1, Buf i1, Buf i2) throws Exception + { + Adder_S_1_Cases cases = s1.branch(C); + switch (cases.op) + { + case Add: + return add( + cases.receive(Add, i1, i2) + .send(C, Res, i1.val+i2.val) + , i1, i2); + case Bye: + return cases.receive(Bye); + default: + throw new RuntimeException("Will never get here."); + } + } +} diff --git a/scribble-demos/scrib/fase16/src/fase16/adder/MyAdderC.java b/scribble-demos/scrib/fase16/src/fase16/adder/MyAdderC.java new file mode 100644 index 000000000..2e413a086 --- /dev/null +++ b/scribble-demos/scrib/fase16/src/fase16/adder/MyAdderC.java @@ -0,0 +1,63 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package fase16.adder; + +import static fase16.adder.Adder.Adder.Adder.Add; +import static fase16.adder.Adder.Adder.Adder.Bye; +import static fase16.adder.Adder.Adder.Adder.C; +import static fase16.adder.Adder.Adder.Adder.Res; +import static fase16.adder.Adder.Adder.Adder.S; + +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import fase16.adder.Adder.Adder.Adder; +import fase16.adder.Adder.Adder.roles.C; +import fase16.adder.Adder.Adder.statechans.C.Adder_C_1; +import fase16.adder.Adder.Adder.statechans.C.Adder_C_3; + +public class MyAdderC +{ + public static void main(String[] args) throws Exception + { + Adder adder = new Adder(); + try (MPSTEndpoint se = new MPSTEndpoint<>(adder, C, + new ObjectStreamFormatter())) + { + se.request(S, SocketChannelEndpoint::new, "localhost", 8888); + + + Buf i = new Buf<>(); + + Adder_C_1 c1 = new Adder_C_1(se); + + for (int j = 0; j<3; j++) + { + c1 = c1.send(S, Add, 1, 2).receive(S, Res, i); + } + c1.send(S, Bye).receive(S, Bye); + + } + } + + private static final int N = 10; + + private static Adder_C_3 fib(Adder_C_1 s1, Buf i1, Buf i2, + int i) throws Exception + { + return null; + } +} diff --git a/scribble-demos/scrib/fase16/src/fase16/smtp/Smtp.scr b/scribble-demos/scrib/fase16/src/fase16/smtp/Smtp.scr new file mode 100644 index 000000000..653424a96 --- /dev/null +++ b/scribble-demos/scrib/fase16/src/fase16/smtp/Smtp.scr @@ -0,0 +1,68 @@ +//http://sandbox.kidstrythisathome.com/erdos/ + +//$ ./scribblec.sh -ip scribble-demos/scrib/fase16/src -d scribble-demos/scrib/fase16/src scribble-demos/scrib/fase16/src/fase16/smtp/Smtp.scr -subtypes -api Smtp C +//$ javadoc -cp scribble-core/target/classes:scribble-runtime/target/classes:scribble-demos/scrib/fase16/src scribble-demos/scrib/fase16/src/fase16/smtp/*.java -subpackages fase16.smtp.Smtp.Smtp -d scribble-demos/scrib/fase16/javadoc/smtp + + +module fase16.smtp.Smtp; + +sig "fase16.smtp.message.server._220" + from "fase16/smtp/message/server/_220.java" as 220; +sig "fase16.smtp.message.server._250" + from "fase16/smtp/message/server/_250.java" as 250; +sig "fase16.smtp.message.server._250d" + from "fase16/smtp/message/server/_250d.java" as 250d; + +sig "fase16.smtp.message.client.Ehlo" + from "fase16/smtp/message/client/Ehlo.java" as Ehlo; +sig "fase16.smtp.message.client.StartTls" + from "fase16/smtp/message/client/StartTls.java" as StartTls; +sig "fase16.smtp.message.client.Quit" + from "fase16/smtp/message/client/Quit.java" as Quit; + +global protocol Smtp(role C, role S) +{ + 220 from S to C; //* + do Init(C, S); + do StartTls(C, S); + do Init(C, S); + Quit from C to S; +} +/*/ + choice at C + { + do Init(C, S); + do StartTls(C, S); + do Init(C, S); + Quit from C to S; + } + or + { + Quit from C to S; + } +} +//*/ + +global protocol Init(role C, role S) +{ + Ehlo from C to S; + rec X + { + choice at S + { + 250d from S to C; + continue X; + } + or + { + 250 from S to C; + } + } + // or Quit from C to S; // FIXME: +} + +global protocol StartTls(role C, role S) +{ + StartTls from C to S; + 220 from S to C; +} diff --git a/scribble-demos/scrib/fase16/src/fase16/smtp/SmtpC.java b/scribble-demos/scrib/fase16/src/fase16/smtp/SmtpC.java new file mode 100644 index 000000000..49b1ecbf9 --- /dev/null +++ b/scribble-demos/scrib/fase16/src/fase16/smtp/SmtpC.java @@ -0,0 +1,194 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + + +//$ java -cp scribble-core/target/classes:scribble-runtime/target/classes:scribble-demos/target/classes fase16.smtp.SmtpC + + +package fase16.smtp; + +import static fase16.smtp.Smtp.Smtp.Smtp.S; +import static fase16.smtp.Smtp.Smtp.Smtp._220; +import static fase16.smtp.Smtp.Smtp.Smtp._250; +import static fase16.smtp.Smtp.Smtp.Smtp._250d; + +import java.io.IOException; + +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.net.SSLSocketChannelWrapper; +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.statechans.LinearSocket; +import org.scribble.runtime.util.Buf; + +import fase16.smtp.Smtp.Smtp.Smtp; +import fase16.smtp.Smtp.Smtp.roles.C; +import fase16.smtp.Smtp.Smtp.statechans.C.Smtp_C_1; +import fase16.smtp.Smtp.Smtp.statechans.C.Smtp_C_1_Future; +import fase16.smtp.Smtp.Smtp.statechans.C.Smtp_C_3; +import fase16.smtp.Smtp.Smtp.statechans.C.Smtp_C_3_Handler; +import fase16.smtp.Smtp.Smtp.statechans.C.Smtp_C_4; +import fase16.smtp.Smtp.Smtp.statechans.C.ioifaces.Branch_C_S_250__S_250d; +import fase16.smtp.Smtp.Smtp.statechans.C.ioifaces.Case_C_S_250__S_250d; +import fase16.smtp.Smtp.Smtp.statechans.C.ioifaces.Select_C_S_Ehlo; +import fase16.smtp.Smtp.Smtp.statechans.C.ioifaces.Succ_In_S_250; +import fase16.smtp.message.SmtpMessageFormatter; +import fase16.smtp.message.client.Ehlo; +import fase16.smtp.message.client.Quit; +import fase16.smtp.message.client.StartTls; +import fase16.smtp.message.server._250; +import fase16.smtp.message.server._250d; + +public class SmtpC +{ + public SmtpC() throws Exception + { + run(); + } + + public static void main(String[] args) throws Exception + { + new SmtpC(); + } + + public void run() throws Exception + { + String host = "smtp.cc.ic.ac.uk"; + int port = 25; + + Smtp smtp = new Smtp(); + try (MPSTEndpoint se = new MPSTEndpoint<>(smtp, Smtp.C, + new SmtpMessageFormatter())) + { + se.request(Smtp.S, SocketChannelEndpoint::new, host, port); + + Buf f1 = new Buf<>(); + Smtp_C_1 s1 = new Smtp_C_1(se); + + /* + doInit( + LinearSocket.wrapClient( + doInit(s1.async(S, _220, b1)) + .to(Select_C_S_StartTls.cast).send(S, new StartTls()) + .to(Receive_C_S_220.cast).async(S, _220) + .to(Select_C_S_Ehlo.cast) + , S, SSLSocketChannelWrapper::new) + ) + .to(Select_C_S_Quit.cast).send(S, new Quit()); + /*/ + doInit( + LinearSocket.wrapClient( + doInit(s1.async(S, _220, f1)) + .send(S, new StartTls()) + .async(S, _220) + , S, SSLSocketChannelWrapper::new) + ) + .send(S, new Quit()); + //*/ + + System.out.println("Server greeting: " + f1.val.sync().msg); + } + } + + private Succ_In_S_250 doInitWithCasts(Select_C_S_Ehlo s) throws Exception + { + Branch_C_S_250__S_250d b = + s.send(S, new Ehlo("test")).to(Branch_C_S_250__S_250d.cast); + Buf<_250> b1 = new Buf<>(); + Buf<_250d> b2 = new Buf<>(); + for (Case_C_S_250__S_250d c = b.branch(S); true; c = b.branch(S)) + { + switch (c.getOp()) + { + case _250: + return printlnBuf(c.receive(S, _250, b1), b1); + case _250d: + b = printBuf(c.receive(S, _250d, b2).to(Branch_C_S_250__S_250d.cast), b2); + break; + } + } + } + + private + < + S1 extends Branch_C_S_250__S_250d, + S2 extends Succ_In_S_250 + > + S2 doInit(Select_C_S_Ehlo s) throws Exception + { + Branch_C_S_250__S_250d b = s.send(S, new Ehlo("test")); + Buf<_250> b1 = new Buf<>(); + Buf<_250d> b2 = new Buf<>(); + for (Case_C_S_250__S_250d c = b.branch(S); true; c = b.branch(S)) + { + switch (c.getOp()) + { + case _250: + return printlnBuf(c.receive(S, _250, b1), b1); + case _250d: + b = printBuf(c.receive(S, _250d, b2), b2); + break; + } + } + } + + public static > S printBuf(S s, B b) + { + System.out.print(b.val); + return s; + } + + public static > S printlnBuf(S s, B b) + { + System.out.println(b.val); + return s; + } + + class MySmtpC3Handler implements Smtp_C_3_Handler + { + @Override + public void receive(Smtp_C_3 s3, fase16.smtp.Smtp.Smtp.ops._250d op, + Buf<_250d> arg) + throws ScribRuntimeException, IOException, ClassNotFoundException + { + s3.branch(S, this); + } + + @Override + public void receive(Smtp_C_4 s4, fase16.smtp.Smtp.Smtp.ops._250 op, + Buf<_250> arg) + throws ScribRuntimeException, IOException, ClassNotFoundException + { + try + { + doInit( + LinearSocket.wrapClient( + s4.send(S, new StartTls()) + .async(S, _220) + , S, SSLSocketChannelWrapper::new) + ) + .send(S, new Quit()); + } + catch (ScribRuntimeException | IOException | ClassNotFoundException x) + { + throw x; + } + catch (Exception x) + { + throw new ScribRuntimeException(x); + } + } + } +} + diff --git a/scribble-demos/scrib/fase16/src/fase16/smtp/message/SmtpMessage.java b/scribble-demos/scrib/fase16/src/fase16/smtp/message/SmtpMessage.java new file mode 100644 index 000000000..621094a83 --- /dev/null +++ b/scribble-demos/scrib/fase16/src/fase16/smtp/message/SmtpMessage.java @@ -0,0 +1,86 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package fase16.smtp.message; + +import org.scribble.core.type.name.Op; +import org.scribble.runtime.message.ScribMessage; +import org.scribble.util.Caller; + +import fase16.smtp.Smtp.Smtp.Smtp; + +public abstract class SmtpMessage extends ScribMessage +{ + public static final String _220 = "220"; + public static final String _250 = "250"; + public static final String _250_ = "250-"; + public static final String _235 = "235"; + public static final String _535 = "535"; + public static final String _501 = "501"; + public static final String _354 = "354"; + + public static final String EHLO = "ehlo"; + public static final String STARTTLS = "starttls"; + public static final String AUTH = "auth plain"; + public static final String MAIL = "mail from:"; + public static final String RCPT = "rcpt to:"; + public static final String SUBJECT = "subject:"; + public static final String DATA = "data"; + public static final String QUIT = "quit"; + + public static final String DATA_LINE = ""; + public static final String END_OF_DATA = ""; + + private static final long serialVersionUID = 1L; + + protected static final String CRLF = "\r\n"; + + public SmtpMessage(Op op) + { + super(op); + } + + public SmtpMessage(Op op, String body) + { + super(op, body); + } + + public String getBody() + { + return (this.payload.length == 0) ? "" : (String) this.payload[0]; + } + + public byte[] toBytes() + { + byte[] bs = (getOpString(this.op) + " " + getBody() + SmtpMessage.CRLF).getBytes(SmtpMessageFormatter.cs); // Can give "utf-8" as arg directly + return bs; + } + + @Override + public String toString() + { + return new String(toBytes()); + } + + protected static String getOpString(Op op) + { + return + (op.equals(Smtp._220)) ? SmtpMessage._220 + : (op.equals(Smtp._250)) ? SmtpMessage._250 + : (op.equals(Smtp._250d)) ? SmtpMessage._250_ + : (op.equals(Smtp.Ehlo)) ? SmtpMessage.EHLO + : (op.equals(Smtp.StartTls)) ? SmtpMessage.STARTTLS + : (op.equals(Smtp.Quit)) ? SmtpMessage.QUIT + : new Caller().call(() -> { throw new RuntimeException("TODO: " + op); }); + } +} diff --git a/scribble-demos/scrib/fase16/src/fase16/smtp/message/SmtpMessageFormatter.java b/scribble-demos/scrib/fase16/src/fase16/smtp/message/SmtpMessageFormatter.java new file mode 100644 index 000000000..fcb8f4771 --- /dev/null +++ b/scribble-demos/scrib/fase16/src/fase16/smtp/message/SmtpMessageFormatter.java @@ -0,0 +1,447 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package fase16.smtp.message; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; + +import org.scribble.runtime.message.ScribMessage; +import org.scribble.runtime.message.ScribMessageFormatter; + +import fase16.smtp.message.server._220; +import fase16.smtp.message.server._250; +import fase16.smtp.message.server._250d; + +// Currently supports only client-side reading, not server-side +public class SmtpMessageFormatter implements ScribMessageFormatter +{ + //.. fix formatting + //.. try ssl wrapper + //.. add connection (transport) actions + + public static Charset cs = Charset.forName("UTF8"); + //private static CharsetDecoder cd = cs.newDecoder(); + + public SmtpMessageFormatter() + { + + } + + @Override + public byte[] toBytes(ScribMessage m) throws IOException + { + return ((SmtpMessage) m).toBytes(); + } + + @Override + public ScribMessage fromBytes(ByteBuffer bb) + throws IOException, ClassNotFoundException + { + bb.flip(); + //byte[] bs = new byte[2]; + int rem = bb.remaining(); + if (rem < 2) + { + bb.compact(); + return null; + } + + int pos = bb.position(); + String front = new String(new byte[] { bb.get(pos), bb.get(pos + 1) }, SmtpMessageFormatter.cs); + if (front.equals(SmtpMessage.CRLF)) + { + throw new RuntimeException("TODO: "); + } + + if (rem < pos + 4) + { + bb.compact(); + return null; + } + front += new String(new byte[] { bb.get(pos + 2), bb.get(pos + 3) }, SmtpMessageFormatter.cs); + int code = isStatusCode(front); + if (code > -1) + { + String body = readLine(bb, pos + 4).trim(); // Whitespace already built into the message classes + bb.compact(); + if (body == null) + { + return null; + } + switch (code) + { + case 220: return new _220(body); + case 250: + { + if (front.charAt(3) == '-') + { + return new _250d(body); + } + return new _250(body); + } + /*case 235: return new _235(body); + case 535: return new _535(body); + case 501: return new _501(body); + case 354: return new _354(body);*/ + default: throw new RuntimeException("Unknown status code " + code + ": " + body); + } + } + /*else if (front.startsWith(HttpMessage.GET)) // TODO: server-side (EHLO, STARTTLS, etc) + { + }*/ + else + { + // TODO: server-side (MAIL FROM:, RCPT TO:, etc) + String line = front + readLine(bb, pos + 4); + bb.compact(); + /*if (line == null) // deadcode + { + return null; + }*/ + throw new RuntimeException("Cannot parse message: " + line); + } + } + + private static String readLine(ByteBuffer bb, int i) throws IOException + { + StringBuilder sb = new StringBuilder(); + for (int limit = bb.limit(); i <= limit; ) + { + char c = (char) bb.get(i++); + sb.append(c); + if (c == '\r') + { + c = (char) bb.get(i++); + sb.append(c); + if (c == '\n') + { + bb.position(i); + return sb.substring(0, sb.length() - 2).toString(); + } + } + } + return null; + } + + // Duplicated from HttpMessageFormatter // FIXME: factor out + private int isStatusCode(String front) + { + String code = ""; + for (int i = 0; i < 4; i++) + { + //char c = (char) bs[i]; + char c = front.charAt(i); + if (i < 3) + { + if (c < '0' || c > '9') + { + return -1; + } + code += c; + } + else + { + if (c != ' ' && c != '-') // HACK: hypen + { + return -1; + } + } + } + return Integer.parseInt(code); + } + + /*private static String readWord(ByteBuffer bb, int i) throws IOException + { + StringBuilder sb = new StringBuilder(); + for (int limit = bb.limit(); i <= limit; ) + { + char c = (char) bb.get(i); + if (c == ' ') + { + bb.position(i); + return sb.toString(); + } + sb.append(c); + } + return null; + }*/ + + /* // Pre: flipped ready for reading + @Override + public SmtpMessage readMessage(DataInputStream dis) throws IOException + { + String header = getHeader(dis); + switch (header) + { + // FIXME: factor out text constants with Session constants? + case "220 ": + { + return new _220(getBody(dis)); + } + case "235 ": + { + return new _235(getBody(dis)); + } + case "250-": + { + return new _250_(getBody(dis)); + } + case "250 ": + { + return new _250(getBody(dis)); + } + case "354 ": + { + return new _354(getBody(dis)); + } + case "501 ": + { + return new _501(getBody(dis)); + } + case "535 ": + { + return new _535(getBody(dis)); + } + default: + { + throw new RuntimeException("Unknown header: " + header); + } + } + } + + // *4* char headers (3 digits, dash or space) + private String getHeader(DataInputStream dis) throws IOException + { + readMinimumBytes(dis, 4); + + int limit = bb.limit(); + bb.limit(4); + String header = cd.decode(bb).toString(); // updates bb position + bb.limit(limit); + bb.compact(); + bb.flip(); + return header; + } + + // Reads up to \r\n inclusive; doesn't return the \r\n + private String getBody(DataInputStream dis) throws IOException + { + int min = 2; + readMinimumBytes(dis, min); // Min should be more? + while (true) + { + String all = cd.decode(bb).toString(); // updates bb position + if (all.contains("\n")) // FIXME: didn't check exactly \r\n + { + int i = all.indexOf("\n"); + String body = all.substring(0, i - 1); + bb.position(i + 1); // \r\n -- ASCII 1-to-1 byte-char index + bb.compact(); + bb.flip(); + return body; + } + bb.rewind(); + readMinimumBytes(dis, ++min); // FIXME: buffered readLine would be more efficient + } + } + + // FIXME: min should mean min fresh (i.e. not including bb cached -- there currently is no cache: is.available doesn't work for SSLSocket, always returns 0) + private void readMinimumBytes(DataInputStream dis, int min) throws IOException + { + for (int remaining = bb.remaining(); remaining < min; remaining = bb.remaining()) + { + bb.compact(); + bb.put((byte) dis.read()); // FIXME: check for buffer overflow + bb.flip(); + } + }*/ + + @Override + public void writeMessage(DataOutputStream dos, ScribMessage m) throws IOException + { + dos.write(((SmtpMessage) m).toBytes()); + dos.flush(); + } + + @Override + public SmtpMessage readMessage(DataInputStream dis) throws IOException + { + byte[] bs = new byte[2]; + dis.readFully(bs); + String front = new String(bs, SmtpMessageFormatter.cs); + if (front.equals(SmtpMessage.CRLF)) + { + throw new RuntimeException("TODO: "); + } + bs = new byte[2]; + dis.readFully(bs); + front += new String(bs, SmtpMessageFormatter.cs); + int code = isStatusCode(front); + if (code > -1) + { + String body = readLine(dis).trim(); // Whitespace already built into the message classes + switch (code) + { + case 220: return new _220(body); + case 250: + { + if (front.charAt(3) == '-') + { + return new _250d(body); + } + return new _250(body); + } + /*case 235: return new _235(body); + case 535: return new _535(body); + case 501: return new _501(body); + case 354: return new _354(body);*/ + default: throw new RuntimeException("Unknown status code: " + code); + } + } + /*else if (front.startsWith(HttpMessage.GET)) + { + }*/ + else + { + String line = front + readLine(dis); + throw new RuntimeException("Cannot parse message: " + line); + } + } + + private static String readLine(DataInputStream dis) throws IOException + { + StringBuilder sb = new StringBuilder(); + for (; true; ) + { + char c = (char) dis.read(); // readChar is not the same + sb.append(c); + if (c == '\r') + { + c = (char) dis.read(); + sb.append(c); + if (c == '\n') + { + return sb.substring(0, sb.length() - 2).toString(); + } + } + } + } + + /*private static String readWord(DataInputStream dis) throws IOException + { + StringBuilder sb = new StringBuilder(); + for (; true; ) + { + char c = (char) dis.read(); + if (c == ' ') + { + return sb.toString(); + } + sb.append(c); + } + }*/ + + /* // Pre: flipped ready for reading + @Override + public SmtpMessage readMessage(DataInputStream dis) throws IOException + { + String header = getHeader(dis); + switch (header) + { + // FIXME: factor out text constants with Session constants? + case "220 ": + { + return new _220(getBody(dis)); + } + case "235 ": + { + return new _235(getBody(dis)); + } + case "250-": + { + return new _250_(getBody(dis)); + } + case "250 ": + { + return new _250(getBody(dis)); + } + case "354 ": + { + return new _354(getBody(dis)); + } + case "501 ": + { + return new _501(getBody(dis)); + } + case "535 ": + { + return new _535(getBody(dis)); + } + default: + { + throw new RuntimeException("Unknown header: " + header); + } + } + } + + // *4* char headers (3 digits, dash or space) + private String getHeader(DataInputStream dis) throws IOException + { + readMinimumBytes(dis, 4); + + int limit = bb.limit(); + bb.limit(4); + String header = cd.decode(bb).toString(); // updates bb position + bb.limit(limit); + bb.compact(); + bb.flip(); + return header; + } + + // Reads up to \r\n inclusive; doesn't return the \r\n + private String getBody(DataInputStream dis) throws IOException + { + int min = 2; + readMinimumBytes(dis, min); // Min should be more? + while (true) + { + String all = cd.decode(bb).toString(); // updates bb position + if (all.contains("\n")) // FIXME: didn't check exactly \r\n + { + int i = all.indexOf("\n"); + String body = all.substring(0, i - 1); + bb.position(i + 1); // \r\n -- ASCII 1-to-1 byte-char index + bb.compact(); + bb.flip(); + return body; + } + bb.rewind(); + readMinimumBytes(dis, ++min); // FIXME: buffered readLine would be more efficient + } + } + + // FIXME: min should mean min fresh (i.e. not including bb cached -- there currently is no cache: is.available doesn't work for SSLSocket, always returns 0) + private void readMinimumBytes(DataInputStream dis, int min) throws IOException + { + for (int remaining = bb.remaining(); remaining < min; remaining = bb.remaining()) + { + bb.compact(); + bb.put((byte) dis.read()); // FIXME: check for buffer overflow + bb.flip(); + } + }*/ +} diff --git a/scribble-demos/scrib/fase16/src/fase16/smtp/message/client/Ehlo.java b/scribble-demos/scrib/fase16/src/fase16/smtp/message/client/Ehlo.java new file mode 100644 index 000000000..732b68550 --- /dev/null +++ b/scribble-demos/scrib/fase16/src/fase16/smtp/message/client/Ehlo.java @@ -0,0 +1,32 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package fase16.smtp.message.client; + +import fase16.smtp.Smtp.Smtp.Smtp; +import fase16.smtp.message.SmtpMessage; + +public class Ehlo extends SmtpMessage +{ + private static final long serialVersionUID = 1L; + + public Ehlo() + { + super(Smtp.Ehlo); + } + + public Ehlo(String body) + { + super(Smtp.Ehlo, body); + } +} diff --git a/scribble-demos/scrib/fase16/src/fase16/smtp/message/client/Quit.java b/scribble-demos/scrib/fase16/src/fase16/smtp/message/client/Quit.java new file mode 100644 index 000000000..128aa9004 --- /dev/null +++ b/scribble-demos/scrib/fase16/src/fase16/smtp/message/client/Quit.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package fase16.smtp.message.client; + +import fase16.smtp.Smtp.Smtp.Smtp; +import fase16.smtp.message.SmtpMessage; + +public class Quit extends SmtpMessage +{ + private static final long serialVersionUID = 1L; + + public Quit() + { + super(Smtp.Quit); + } +} diff --git a/scribble-demos/scrib/fase16/src/fase16/smtp/message/client/StartTls.java b/scribble-demos/scrib/fase16/src/fase16/smtp/message/client/StartTls.java new file mode 100644 index 000000000..4565fb371 --- /dev/null +++ b/scribble-demos/scrib/fase16/src/fase16/smtp/message/client/StartTls.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package fase16.smtp.message.client; + +import fase16.smtp.Smtp.Smtp.Smtp; +import fase16.smtp.message.SmtpMessage; + +public class StartTls extends SmtpMessage +{ + private static final long serialVersionUID = 1L; + + public StartTls() + { + super(Smtp.StartTls); + } +} diff --git a/scribble-demos/scrib/fase16/src/fase16/smtp/message/server/_220.java b/scribble-demos/scrib/fase16/src/fase16/smtp/message/server/_220.java new file mode 100644 index 000000000..2e60f7ce5 --- /dev/null +++ b/scribble-demos/scrib/fase16/src/fase16/smtp/message/server/_220.java @@ -0,0 +1,38 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package fase16.smtp.message.server; + +import fase16.smtp.Smtp.Smtp.Smtp; +import fase16.smtp.message.SmtpMessage; + +public class _220 extends SmtpMessage +{ + private static final long serialVersionUID = 1L; + + public _220() + { + super(Smtp._220); + } + + public _220(String body) + { + super(Smtp._220, body); + } + + /*@Override + public Operator getOperator() + { + return Smtp._220; + }*/ +} diff --git a/scribble-demos/scrib/fase16/src/fase16/smtp/message/server/_250.java b/scribble-demos/scrib/fase16/src/fase16/smtp/message/server/_250.java new file mode 100644 index 000000000..a79d8aa36 --- /dev/null +++ b/scribble-demos/scrib/fase16/src/fase16/smtp/message/server/_250.java @@ -0,0 +1,32 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package fase16.smtp.message.server; + +import fase16.smtp.Smtp.Smtp.Smtp; +import fase16.smtp.message.SmtpMessage; + +public class _250 extends SmtpMessage +{ + private static final long serialVersionUID = 1L; + + public _250() + { + super(Smtp._250); + } + + public _250(String body) + { + super(Smtp._250, body); + } +} diff --git a/scribble-demos/scrib/fase16/src/fase16/smtp/message/server/_250d.java b/scribble-demos/scrib/fase16/src/fase16/smtp/message/server/_250d.java new file mode 100644 index 000000000..68179cd15 --- /dev/null +++ b/scribble-demos/scrib/fase16/src/fase16/smtp/message/server/_250d.java @@ -0,0 +1,40 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package fase16.smtp.message.server; + +import fase16.smtp.Smtp.Smtp.Smtp; +import fase16.smtp.message.SmtpMessage; +import fase16.smtp.message.SmtpMessageFormatter; + +public class _250d extends SmtpMessage +{ + private static final long serialVersionUID = 1L; + + public _250d() + { + super(Smtp._250d); + } + + public _250d(String body) + { + super(Smtp._250d, body); + } + + @Override + public byte[] toBytes() + { + // No space after op + return (getOpString(this.op) + getBody() + SmtpMessage.CRLF).getBytes(SmtpMessageFormatter.cs); + } +} diff --git a/scribble-demos/scrib/fib/src/fib/AdderClient.java b/scribble-demos/scrib/fib/src/fib/AdderClient.java new file mode 100644 index 000000000..5350e50e5 --- /dev/null +++ b/scribble-demos/scrib/fib/src/fib/AdderClient.java @@ -0,0 +1,106 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +//$ java -cp modules/cli/target/classes/';'modules/core/target/classes';'modules/trace/target/classes';'modules/parser/target/classes';c:\Users\Raymond\.m2\repository\org\antlr\antlr-runtime\3.2\antlr-runtime-3.2.jar;'modules/validation/target/classes/';'modules/projection/target/classes/';C:\Users\Raymond\.m2\repository\org\codehaus\jackson\jackson-mapper-asl\1.9.9\jackson-mapper-asl-1.9.9.jar;C:\Users\Raymond\.m2\repository\org\codehaus\jackson\jackson-core-asl\1.9.9\jackson-core-asl-1.9.9.jar' org.scribble2.cli.CommandLine -path modules/validation/src/test/scrib/src modules/validation/src/test/scrib/src/Test.scr -session Foo -d modules/validation/src/main/java +//$ java -cp modules/cli/target/classes/';'modules/core/target/classes';'modules/trace/target/classes';'modules/parser/target/classes';c:\Users\Raymond\.m2\repository\org\antlr\antlr-runtime\3.2\antlr-runtime-3.2.jar;'modules/validation/target/classes/';'modules/projection/target/classes/';C:\Users\Raymond\.m2\repository\org\codehaus\jackson\jackson-mapper-asl\1.9.9\jackson-mapper-asl-1.9.9.jar;C:\Users\Raymond\.m2\repository\org\codehaus\jackson\jackson-core-asl\1.9.9\jackson-core-asl-1.9.9.jar' org.scribble2.cli.CommandLine -path modules/validation/src/test/scrib/src modules/validation/src/test/scrib/src/Test.scr -api Foo A -d modules/validation/src/main/java + +package fib; + +import java.io.IOException; +import java.net.UnknownHostException; +import java.util.concurrent.ExecutionException; + +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import fib.Fib.Adder.Adder; +import fib.Fib.Adder.roles.C; +import fib.Fib.Adder.statechans.C.Adder_C_1; +import fib.Fib.Adder.statechans.C.ioifaces.Receive_C_S_BYE; +import fib.Fib.Adder.statechans.C.ioifaces.Receive_C_S_RES_Int; +import fib.Fib.Adder.statechans.C.ioifaces.Select_C_S_ADD_Int_Int__S_BYE; +import fib.Fib.Adder.statechans.C.ioifaces.Succ_Out_S_BYE; + + +public class AdderClient +{ + public static void main(String[] args) + throws UnknownHostException, ScribRuntimeException, IOException, + ClassNotFoundException, ExecutionException, InterruptedException + { + Buf i1 = new Buf<>(1); + //Buf i2 = new Buf<>(2); + + Adder adder = new Adder(); + try (MPSTEndpoint se = new MPSTEndpoint<>(adder, Adder.C, + new ObjectStreamFormatter())) + { + se.request(Adder.S, SocketChannelEndpoint::new, "localhost", 8888); + + Adder_C_1 s1 = new Adder_C_1(se); + + /*s1.send(Adder.S, Adder.ADD, i1.val, i1.val) + .receive(Adder.S, Adder.RES, i1) + .send(Adder.S, Adder.ADD, i1.val, i1.val) + .receive(Adder.S, Adder.RES, i1) + .send(Adder.S, Adder.BYE) + .receive(Adder.S, Adder.BYE);*/ + + /*while (i1.val < 100) + { + s1 = s1.send(Adder.S, Adder.ADD, i1.val, i1.val).receive(Adder.S, Adder.RES, i1); + } + s1.send(Adder.S, Adder.BYE).receive(Adder.S, Adder.BYE) + .end();*/ + + //fib(i1, i2, s1).end(); + + foo(s1, i1).to(Receive_C_S_BYE.cast).receive(Adder.S, Adder.BYE); + //foo(s1, i1); + + System.out.println("Client: " + i1.val); + } + } + + private static Succ_Out_S_BYE foo(Select_C_S_ADD_Int_Int__S_BYE s, Buf i) throws ClassNotFoundException, ScribRuntimeException, IOException + //private static EndSocket foo(Select_C_S_ADD_Integer_Integer__S_BYE s, Buf i) throws ClassNotFoundException, ScribRuntimeException, IOException + { + return (i.val < 100) + ? foo( + s.send(Adder.S, Adder.ADD, i.val, i.val) + .to(Receive_C_S_RES_Int.cast) + .receive(Adder.S, Adder.RES, i) + .to(Select_C_S_ADD_Int_Int__S_BYE.cast) + , i) + : s.send(Adder.S, Adder.BYE); + } + + /*private static EndSocket fib(Buf i1, Buf i2, Adder_C_1 s1) throws ScribRuntimeException, IOException, ClassNotFoundException, ExecutionException, InterruptedException + { + return (i1.val < 100) + ? fib(i1, i2, + side(i1, i2, s1.send(Adder.S, Adder.ADD, i1.val, i2.val)).receive(Adder.S, Adder.RES, i2) + ) + : s1.send(Adder.S, Adder.BYE).receive(Adder.S, Adder.BYE); + } + + private static Adder_C_2 side(Buf i1, Buf i2, Adder_C_2 s2) + { + i1.val = i2.val; + System.out.print(i1.val + " "); + return s2; + }*/ +} diff --git a/scribble-demos/scrib/fib/src/fib/AdderServer.java b/scribble-demos/scrib/fib/src/fib/AdderServer.java new file mode 100644 index 000000000..5465ae60a --- /dev/null +++ b/scribble-demos/scrib/fib/src/fib/AdderServer.java @@ -0,0 +1,81 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package fib; + +import java.io.IOException; +import java.util.concurrent.ExecutionException; + +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.net.SocketChannelServer; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import fib.Fib.Adder.Adder; +import fib.Fib.Adder.roles.S; +import fib.Fib.Adder.statechans.S.Adder_S_1; +import fib.Fib.Adder.statechans.S.Adder_S_1_Cases; +import fib.Fib.Adder.statechans.S.Adder_S_3; + +public class AdderServer +{ + public static void main(String[] args) throws IOException, + ScribRuntimeException, ExecutionException, InterruptedException + { + try (ScribServerSocket ss = new SocketChannelServer(8888)) + { + Buf i1 = new Buf<>(); + Buf i2 = new Buf<>(); + + while (true) + { + Adder foo = new Adder(); + try (MPSTEndpoint se = new MPSTEndpoint<>(foo, Adder.S, + new ObjectStreamFormatter())) + { + se.accept(ss, Adder.C); + + X(new Adder_S_1(se), i1, i2).send(Adder.C, Adder.BYE); + } + catch (ScribRuntimeException | IOException | ClassNotFoundException e) + { + e.printStackTrace(); + } + } + } + } + + private static Adder_S_3 X(Adder_S_1 s1, Buf i1, Buf i2) + throws ClassNotFoundException, ScribRuntimeException, IOException, + ExecutionException, InterruptedException + { + Adder_S_1_Cases cases = s1.branch(Adder.C); + switch (cases.op) + { + case BYE: + { + return cases.receive(Adder.BYE); + } + case ADD: + { + return X(cases.receive(Adder.ADD, i1, i2).send(Adder.C, Adder.RES, i1.val + i2.val), i1, i2); + } + default: + { + throw new RuntimeException("Won't get here: "); + } + } + } +} diff --git a/scribble-demos/scrib/fib/src/fib/Fib.scr b/scribble-demos/scrib/fib/src/fib/Fib.scr new file mode 100644 index 000000000..3a2be9408 --- /dev/null +++ b/scribble-demos/scrib/fib/src/fib/Fib.scr @@ -0,0 +1,46 @@ +//$ ./scribblec.sh -ip scribble-demos/scrib/fib/src -d scribble-demos/scrib/fib/src scribble-demos/scrib/fib/src/fib/Fib.scr -api Adder C +//$ javadoc -cp scribble-core/target/classes:scribble-runtime/target/classes:scribble-demos/scrib/fib/src scribble-demos/scrib/fib/src/fib/*.java -subpackages fib.Fib.Adder -d scribble-demos/scrib/fib/javadoc/adder + +module fib.Fib; + + +data "java.lang.Integer" from "rt.jar" as Int; + + +global protocol Adder(role C, role S) +{ + /*[x+1<10 && x<9 && x<10] + ADD(x:Int) from C to S;*/ + + choice at C + { + ADD(Int, Int) from C to S; + RES(Int) from S to C; + do Adder(C, S); + } + or + { + BYE() from C to S; + BYE() from S to C; + } +} + + + + +global protocol Fibonacci(role A, role B) +{ + rec Fib + { + choice at A + { + fibonacci(Int) from A to B; + fibonacci(Int) from B to A; + continue Fib; + } + or + { + end() from A to B; + } + } +} diff --git a/scribble-demos/scrib/fib/src/fib/FibClient.java b/scribble-demos/scrib/fib/src/fib/FibClient.java new file mode 100644 index 000000000..69c929601 --- /dev/null +++ b/scribble-demos/scrib/fib/src/fib/FibClient.java @@ -0,0 +1,69 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package fib; + +import java.io.IOException; +import java.net.UnknownHostException; +import java.util.concurrent.ExecutionException; + +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import fib.Fib.Adder.Adder; +import fib.Fib.Adder.roles.C; +import fib.Fib.Adder.statechans.C.Adder_C_1; +import fib.Fib.Adder.statechans.C.Adder_C_2; +import fib.Fib.Adder.statechans.C.Adder_C_3; + +public class FibClient +{ + public static void main(String[] args) + throws UnknownHostException, ScribRuntimeException, IOException, + ClassNotFoundException, ExecutionException, InterruptedException + { + Buf i1 = new Buf<>(0); + Buf i2 = new Buf<>(1); + + Adder adder = new Adder(); + try (MPSTEndpoint se = new MPSTEndpoint<>(adder, Adder.C, + new ObjectStreamFormatter())) + { + se.request(Adder.S, SocketChannelEndpoint::new, "localhost", 8888); + + Adder_C_1 s1 = new Adder_C_1(se); + + fib(s1, i1, i2, 0).receive(Adder.S, Adder.BYE); + } + } + + private static Adder_C_3 fib(Adder_C_1 s1, Buf i1, Buf i2, + int i) throws ClassNotFoundException, ScribRuntimeException, IOException, + ExecutionException, InterruptedException + { + return (i < 20) + //? fib(side(s1.send(Adder.S, Adder.ADD, i1.val, i2.val), i1, i2).receive(Adder.RES, i2), i1, i2, i + 1) + ? fib(side(s1.send(Adder.S, Adder.ADD, i1.val, i1.val = i2.val), i1, i2).receive(Adder.S, Adder.RES, i2), i1, i2, i + 1) + : s1.send(Adder.S, Adder.BYE); + } + + private static Adder_C_2 side(Adder_C_2 s2, Buf i1, Buf i2) + { + System.out.print(i1.val + " "); + //i1.val = i2.val; + return s2; + } +} diff --git a/scribble-demos/scrib/fib/src/fib/Fibo.java b/scribble-demos/scrib/fib/src/fib/Fibo.java new file mode 100644 index 000000000..acf74a8b2 --- /dev/null +++ b/scribble-demos/scrib/fib/src/fib/Fibo.java @@ -0,0 +1,135 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +//$ bin/scribblec.sh modules/core/src/test/scrib/demo/fib/Fib.scr -ip modules/core/src/test/scrib/ -d modules/core/src/test/scrib/ -api Fibonacci A -api Fibonacci B + +package fib; + +import java.io.IOException; + +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.net.SocketChannelServer; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import fib.Fib.Fibonacci.Fibonacci; +import fib.Fib.Fibonacci.ops.end; +import fib.Fib.Fibonacci.ops.fibonacci; +import fib.Fib.Fibonacci.roles.A; +import fib.Fib.Fibonacci.roles.B; +import fib.Fib.Fibonacci.statechans.A.Fibonacci_A_1; +import fib.Fib.Fibonacci.statechans.B.EndSocket; +import fib.Fib.Fibonacci.statechans.B.Fibonacci_B_1; +import fib.Fib.Fibonacci.statechans.B.Fibonacci_B_1_Handler; +import fib.Fib.Fibonacci.statechans.B.Fibonacci_B_2; + +public class Fibo +{ + public static void main(String[] args) throws Exception + { + Fibonacci fib = new Fibonacci(); + new MyB(fib).start(); + new MyA(fib).start(); + } +} + +class MyB extends Thread implements Fibonacci_B_1_Handler +{ + private final Fibonacci fib; + private int x = 1; + + public MyB(Fibonacci fib) + { + this.fib = fib; + } + + @Override + public void run() + { + try (ScribServerSocket ss = new SocketChannelServer(8888); + MPSTEndpoint se = new MPSTEndpoint<>(this.fib, + Fibonacci.B, new ObjectStreamFormatter())) + { + se.accept(ss, Fibonacci.A); + new Fibonacci_B_1(se).branch(Fibonacci.A, this); + } + catch (Exception x) + { + x.printStackTrace(); + } + } + + @Override + public void receive(Fibonacci_B_2 s, fibonacci op, Buf arg1) + throws ScribRuntimeException, IOException, ClassNotFoundException + { + s.send(Fibonacci.A, Fibonacci.fibonacci, (this.x += arg1.val)).branch(Fibonacci.A, this); + } + + @Override + public void receive(EndSocket schan, end op) + throws ScribRuntimeException, IOException, ClassNotFoundException + { + //System.out.println("B done: " + this.x); + } +} + +class MyA extends Thread +{ + private final Fibonacci fib; + private Buf b = new Buf<>(0); + + public MyA(Fibonacci fib) + { + this.fib = fib; + } + + @Override + public void run() + { + try (MPSTEndpoint se = new MPSTEndpoint<>(this.fib, + Fibonacci.A, new ObjectStreamFormatter())) + { + se.request(Fibonacci.B, SocketChannelEndpoint::new, "localhost", 8888); + run(new Fibonacci_A_1(se), 19); // 4184 + System.out.println("A done: " + this.b.val); + } + catch (Exception x) + { + x.printStackTrace(); + } + } + + private fib.Fib.Fibonacci.statechans.A.EndSocket run(Fibonacci_A_1 s, int todo) + throws Exception + { + return (todo > 0) + ? run( + next(this.b.val, + s.send(Fibonacci.B, Fibonacci.fibonacci, this.b.val) + .receive(Fibonacci.B, Fibonacci.fibonacci, this.b), todo), + todo - 2) + : s.send(Fibonacci.B, Fibonacci.end); + } + + private Fibonacci_A_1 next(int prev, Fibonacci_A_1 s, int todo) + { + //System.out.println("A: " + prev); + if (todo > 1) + this.b.val += prev; + return s; + } +} diff --git a/scribble-demos/scrib/fib/src/fib/MyAdderC.java b/scribble-demos/scrib/fib/src/fib/MyAdderC.java new file mode 100644 index 000000000..2755ae8ea --- /dev/null +++ b/scribble-demos/scrib/fib/src/fib/MyAdderC.java @@ -0,0 +1,46 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package fib; + +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.session.MPSTEndpoint; + +import fib.Fib.Adder.Adder; +import fib.Fib.Adder.roles.C; +import fib.Fib.Adder.statechans.C.Adder_C_1; + +public class MyAdderC +{ + public static void main(String[] args) throws Exception + { + Adder adder = new Adder(); + try (MPSTEndpoint se = new MPSTEndpoint<>(adder, Adder.C, + new ObjectStreamFormatter())) + { + se.request(Adder.S, SocketChannelEndpoint::new, "localhost", 8888); + + Adder_C_1 s1 = new Adder_C_1(se); + + //System.out.println("Client: " + buf.val); + } + } + + /*private static Adder_C_3 side(Buff i1, Buff i2, Adder_C_3 s3) + { + System.out.print(i1.val + " "); + i1.val = i2.val; + return s3; + }*/ +} diff --git a/scribble-demos/scrib/game/src/game/Game1.scr b/scribble-demos/scrib/game/src/game/Game1.scr new file mode 100644 index 000000000..8765d54e1 --- /dev/null +++ b/scribble-demos/scrib/game/src/game/Game1.scr @@ -0,0 +1,47 @@ +//$ ./scribblec.sh -ip scribble-demos/scrib/game/src -d scribble-demos/scrib/game/src scribble-demos/scrib/game/src/game/Game1.scr + + +module game.Game1; + + +global protocol Proto(role Client, role S1, role S2) +{ + choice at S1 + { + playAsA() from S1 to Client; + do Game(Client, S1, S2); + } + or + { + playAsB(Game@B) from S1 to Client; + fin() from S1 to S2; + } + or + { + playAsC(Game@C) from S1 to Client; + fin() from S1 to S2; + } +} + + +aux global protocol Game(role A, role B, role C) +{ + // Arbitrary for now + rec X + { + choice at A + { + 1() from A to B; + 1() from B to C; + 1() from C to A; + continue X; + } + or + { + 2() from A to B; + 2() from B to C; + 2() from C to A; + } + } +} + diff --git a/scribble-demos/scrib/game/src/game/Game2.scr b/scribble-demos/scrib/game/src/game/Game2.scr new file mode 100644 index 000000000..3e6e6f429 --- /dev/null +++ b/scribble-demos/scrib/game/src/game/Game2.scr @@ -0,0 +1,43 @@ +//$ ./scribblec.sh -ip scribble-demos/scrib/game/src -d scribble-demos/scrib/game/src scribble-demos/scrib/game/src/game/Game2.scr + +module game.Game2; + + +global protocol Proto(role C, role S) +{ + choice at S + { + playAsA(Game@A) from S to C; + } + or + { + playAsB(Game@B) from S to C; + } + or + { + playAsC(Game@C) from S to C; + } +} + + +global protocol Game(role A, role B, role C) +{ + // Arbitrary for now + rec X + { + choice at A + { + 1() from A to B; + 1() from B to C; + 1() from C to A; + continue X; + } + or + { + 2() from A to B; + 2() from B to C; + 2() from C to A; + } + } +} + diff --git a/scribble-demos/scrib/http/src/http/longvers/HttpLong.scr b/scribble-demos/scrib/http/src/http/longvers/HttpLong.scr new file mode 100644 index 000000000..de847c5a3 --- /dev/null +++ b/scribble-demos/scrib/http/src/http/longvers/HttpLong.scr @@ -0,0 +1,285 @@ +//$ ./scribblec.sh -ip scribble-demos/scrib/http/src -d scribble-demos/scrib/http/src scribble-demos/scrib/http/src/http/longvers/HttpLong.scr -api Http C +//$ javadoc -cp scribble-core/target/classes:scribble-runtime/target/classes:scribble-demos/scrib/http/src/ scribble-demos/scrib/http/src/http/longvers/*.java -subpackages http.longvers.HttpLong.Http -d scribble-demos/scrib/http/javadoc/longvers + + +module http.longvers.HttpLong; + +/*Connected to www.doc.ic.ac.uk. +Escape character is '^]'. +GET /~rhu/ HTTP/1.1 +host: www.doc.ic.ac.uk + +HTTP/1.1 200 OK // 200 is a separate message +Date: Mon, 13 Jun 2016 19:42:34 GMT +Server: Apache +Strict-Transport-Security: max-age=31536000; preload; includeSubDomains +Strict-Transport-Security: max-age=31536000; preload; includeSubDomains // BUG? (Apache configuration) +Last-Modified: Thu, 14 Apr 2016 12:46:24 GMT +ETag: "74a-53071482f6e0f" +Accept-Ranges: bytes +Content-Length: 1866 // Not using Transfer-Encoding: Chunked +Vary: Accept-Encoding +Content-Type: text/html +Via: 1.1 www.doc.ic.ac.uk*/ + + +sig "http.longvers.message.client.RequestLine" + from "http/longvers/message/RequestLine.java" + as REQUESTL; // GET /~rhu/ HTTP/1.1 + +sig "http.longvers.message.client.Host" + from "http/longvers/message/Host.java" + as HOST; // host: www.doc.ic.ac.uk + +//sig "http.longvers.message.CRLF" from "http.longvers.message.CRLF.java" as CRLF; + +sig "http.longvers.message.Body" + from "http/longvers/message/Body.java" + as BODY; + +sig "http.longvers.message.client.UserAgent" + from "http/longvers/message/UserAgent.java" + as USERA; // User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0 + +sig "http.longvers.message.client.Accept" + from "http/longvers/message/Accept.java" + as ACCEPT; // Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 + +sig "http.longvers.message.client.AcceptLanguage" + from "http/longvers/message/AcceptLanguage.java" + as ACCEPTL; // Accept-Language: en-GB,en;q=0.5 + +sig "http.longvers.message.client.AcceptEncoding" + from "http/longvers/message/AcceptEncoding.java" + as ACCEPTE; // Accept-Encoding: gzip, deflate + +sig "http.longvers.message.client.DoNotTrack" + from "http/longvers/message/DoNotTrack.java" + as DNT; // DNT: 1 + +sig "http.longvers.message.client.Connection" + from "http/longvers/message/Connection.java" + as CONNECTION; // Connection: keep-alive + +sig "http.longvers.message.client.UpgradeInsecureRequests" + from "http/longvers/message/UpgradeInsecureRequests.java" + as UPGRADEIR; // Upgrade-Insecure-Requests: 1 + +sig "http.longvers.message.client.Cookie" + from "http/longvers/message/Cookie.java" + as COOKIE; // Cookie: __utma=111872281.1372348290.1498163262.1498163262.1498163262.1; __utmz=111872281.1498163262.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none) + + +sig "http.longvers.message.server.HttpVersion" + from "http/longvers/message/HttpVersion.java" + as HTTPV; // HTTP/1.1 + +sig "http.longvers.message.server._200" // "Status" line (with HTTPV) + from "http/longvers/message/_200.java" + as 200; // 200 OK + +sig "http.longvers.message.server._404" + from "http/longvers/message/_404.java" + as 404; + +sig "http.longvers.message.server.Date" + from "http/longvers/message/Date.java" + as DATE; // Date: Sun, 24 May 2015 21:04:36 GMT + +sig "http.longvers.message.server.Server" + from "http/longvers/message/Server.java" + as SERVER; // Server: Apache + +sig "http.longvers.message.server.StrictTransportSecurity" + from "http/longvers/message/StrictTransportSecurity.java" + as STRICTTS; // Strict-Transport-Security: max-age=31536000; preload; includeSubDomains + //as STRICT_TRANSPORT_SECURITY; + +sig "http.longvers.message.server.LastModified" + from "http/longvers/message/LastModified.java" + as LASTM; // Last-Modified: Sat, 23 Jul 2011 09:38:43 GMT + +sig "http.longvers.message.server.ETag" + from "http/longvers/message/ETag.java" + as ETAG; // ETag: "ac6fa008-559-4a8b95908aec0" + +sig "http.longvers.message.server.AcceptRanges" + from "http/longvers/message/AcceptRanges.java" + as ACCEPTR; // Accept-Ranges: bytes + +sig "http.longvers.message.server.ContentLength" + from "http/longvers/message/ContentLength.java" + as CONTENTL; // Content-Length: 1369 + +sig "http.longvers.message.server.Vary" + from "http/longvers/message/Vary.java" + as VARY; // Vary: Accept-Encoding + +sig "http.longvers.message.server.ContentType" + from "http/longvers/message/ContentType.java" + as CONTENTT; // Content-Type: text/html + +sig "http.longvers.message.server.Via" + from "http/longvers/message/Via.java" + as VIA; // Via: 1.1 www.doc.ic.ac.uk + + +global protocol Http(role C, role S) +{ + do Request(C, S); + do Response(C, S); +} + +aux global protocol Request(role C, role S) +{ + choice at C + { + REQUESTL from C to S; // GET /~rhu/ HTTP/1.1 + rec X + { + choice at C + { + HOST from C to S; // Host: www.doc.ic.ac.uk + continue X; + } + or + { + USERA from C to S; // User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0 + continue X; + } + or + { + ACCEPT from C to S; // Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 + continue X; + } + or + { + ACCEPTL from C to S; // Accept-Language: en-GB,en;q=0.5 + continue X; + } + or + { + ACCEPTE from C to S; // Accept-Encoding: gzip, deflate + continue X; + } + or + { + DNT from C to S; // DNT: 1 + continue X; + } + or + { + CONNECTION from C to S; // Connection: keep-alive + continue X; + } + or + { + UPGRADEIR from C to S; // Upgrade-Insecure-Requests: 1 + continue X; + } + or + { + COOKIE from C to S; // Cookie: __utma=111872281.1372348290.1498163262.1498163262.1498163262.1; __utmz=111872281.1498163262.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none) + continue X; + } + or + { + //CRLF from C to S; + BODY from C to S; // FIXME: should be empty for client (maybe just ignored by server) without Content-Length (or Transfer-Encoding) headers + } + } + } + /*or + { + ... + }*/ +} + +/*interruptible +{ + par + { + HOST from C to S; + } + and + { + USERA from C to S; + } + ... +} +with // finally? +{ + BODY by C; +}*/ + +aux global protocol Response(role C, role S) +{ + HTTPV from S to C; // HTTP/1.1 + choice at S + { + 200 from S to C; // 200 OK + } + or + { + 404 from S to C; + } + + rec Y + { + choice at S + { + DATE from S to C; // Date: Sun, 24 May 2015 21:04:36 GMT + continue Y; + } + or + { + SERVER from S to C; // Server: Apache + continue Y; + } + or + { + STRICTTS from S to C; // Strict-Transport-Security: max-age=31536000; preload; includeSubDomains + //STRICT_TRANSPORT_SECURITY from S to C; + continue Y; + } + or + { + LASTM from S to C; // Last-Modified: Sat, 23 Jul 2011 09:38:43 GMT + continue Y; + } + or + { + ETAG from S to C; // ETag: "ac6fa008-559-4a8b95908aec0" + continue Y; + } + or + { + ACCEPTR from S to C; // Accept-Ranges: bytes + continue Y; + } + or + { + CONTENTL from S to C; // Content-Length: 1369 + continue Y; + } + or + { + VARY from S to C; // Vary: Accept-Encoding + continue Y; + } + or + { + CONTENTT from S to C; // Content-Type: text/html + continue Y; + } + or + { + VIA from S to C; // Via: 1.1 www.doc.ic.ac.uk + continue Y; + } + or + { + BODY from S to C; // Message length indicated by Content-Length + } + } +} diff --git a/scribble-demos/scrib/http/src/http/longvers/HttpLongC.java b/scribble-demos/scrib/http/src/http/longvers/HttpLongC.java new file mode 100644 index 000000000..683ad2d54 --- /dev/null +++ b/scribble-demos/scrib/http/src/http/longvers/HttpLongC.java @@ -0,0 +1,229 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package http.longvers; + +import static http.longvers.HttpLong.Http.Http.ACCEPTR; +import static http.longvers.HttpLong.Http.Http.BODY; +import static http.longvers.HttpLong.Http.Http.C; +import static http.longvers.HttpLong.Http.Http.CONTENTL; +import static http.longvers.HttpLong.Http.Http.CONTENTT; +import static http.longvers.HttpLong.Http.Http.DATE; +import static http.longvers.HttpLong.Http.Http.ETAG; +import static http.longvers.HttpLong.Http.Http.HTTPV; +import static http.longvers.HttpLong.Http.Http.LASTM; +import static http.longvers.HttpLong.Http.Http.S; +import static http.longvers.HttpLong.Http.Http.SERVER; +import static http.longvers.HttpLong.Http.Http.STRICTTS; +import static http.longvers.HttpLong.Http.Http.VARY; +import static http.longvers.HttpLong.Http.Http.VIA; +import static http.longvers.HttpLong.Http.Http._200; +import static http.longvers.HttpLong.Http.Http._404; + +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; +import org.scribble.util.Caller; + +import http.longvers.HttpLong.Http.Http; +import http.longvers.HttpLong.Http.roles.C; +import http.longvers.HttpLong.Http.statechans.C.Http_C_1; +import http.longvers.HttpLong.Http.statechans.C.Http_C_3; +import http.longvers.HttpLong.Http.statechans.C.Http_C_4_Cases; +import http.longvers.HttpLong.Http.statechans.C.Http_C_5; +import http.longvers.HttpLong.Http.statechans.C.Http_C_5_Cases; +import http.longvers.HttpLong.Http.statechans.C.ioifaces.Branch_C_S_200__S_404.Branch_C_S_200__S_404_Enum; +import http.longvers.message.Body; +import http.longvers.message.HttpLongMessageFormatter; +import http.longvers.message.client.Host; +import http.longvers.message.client.RequestLine; +import http.longvers.message.server.ContentLength; +import http.longvers.message.server.ContentType; +import http.longvers.message.server.HttpVersion; +import http.longvers.message.server.Server; + + +/** TODO + * + * Cannot parse header field: Cache-Control: max-age=604800 + * at http.longvers.message.HttpLongMessageFormatter.fromBytes(HttpLongMessageFormatter.java:198) + */ + +public class HttpLongC +{ + public HttpLongC() throws Exception + { + run(); + } + + public static void main(String[] args) throws Exception + { + new HttpLongC(); + } + + public void run() throws Exception + { + Http http = new Http(); + try (MPSTEndpoint client = new MPSTEndpoint<>(http, C, + new HttpLongMessageFormatter())) { + + String host = "example.com"; int port = 80; String file = "/~rhu/"; + //String host = "localhost"; int port = 8080; String file = "/"; + + client.request(S, SocketChannelEndpoint::new, host, port); + + doResponse( + doRequest(new Http_C_1(client), host, file) + ); + } + } + + private Http_C_3 doRequest(Http_C_1 s1, String host, String file) throws Exception + { + return s1.send(S, new RequestLine(file, "1.1")) + .send(S, new Host(host)) + .send(S, new Body("")); + } + + private void doResponse(Http_C_3 s3) throws Exception + { + Http_C_4_Cases s4cases = s3.async(S, HTTPV).branch(S); + switch (s4cases.op) + { + case _200: doResponseAux(s4cases.receive(_200)); break; + case _404: doResponseAux(s4cases.receive(_404)); break; + default: throw new RuntimeException("[TODO]: " + s4cases.op); + } + } + + private void doResponseAux(Http_C_5 s5) throws Exception + { + Http_C_5_Cases cases = s5.branch(S); + switch (cases.op) + { + case ACCEPTR: doResponseAux(cases.receive(ACCEPTR)); break; + case CONTENTL: doResponseAux(cases.receive(CONTENTL)); break; + case CONTENTT: doResponseAux(cases.receive(CONTENTT)); break; + case DATE: doResponseAux(cases.receive(DATE)); break; + case ETAG: doResponseAux(cases.receive(ETAG)); break; + case LASTM: doResponseAux(cases.receive(LASTM)); break; + case SERVER: doResponseAux(cases.receive(SERVER)); break; + case STRICTTS: doResponseAux(cases.receive(STRICTTS)); break; + case VARY: doResponseAux(cases.receive(VARY)); break; + case VIA: doResponseAux(cases.receive(VIA)); break; + case BODY: + { + Buf buf_body = new Buf<>(); + cases.receive(BODY, buf_body); + System.out.println(buf_body.val.getBody()); + return; + } + default: throw new RuntimeException("[TODO]: " + cases.op); + } + } + + public void run1() throws Exception + { + Buf b_vers = new Buf<>(); + Buf b_clen = new Buf<>(); + Buf b_ctype = new Buf<>(); + Buf b_body = new Buf<>(); + Buf b_serv = new Buf<>(); + + Http http = new Http(); + try (MPSTEndpoint se = new MPSTEndpoint<>(http, Http.C, new HttpLongMessageFormatter())) + { + String host = "www.doc.ic.ac.uk"; int port = 80; + //String host = "localhost"; int port = 8080; + + se.request(S, SocketChannelEndpoint::new, host, port); + + Http_C_1 s1 = new Http_C_1(se); + + Http_C_4_Cases s4cases = + s1.send(S, new RequestLine("/~rhu/", "1.1")) + .send(S, new Host(host)) + .send(S, new Body("")) + .receive(S, HTTPV, b_vers) + .branch(S); + Http_C_5 s5 = // S?{ 200: ..., 404: ..., ... } + (s4cases.op == Branch_C_S_200__S_404_Enum._200) ? s4cases.receive(_200) + : (s4cases.op == Branch_C_S_200__S_404_Enum._404) ? s4cases.receive(_404) + : new Caller().call(() -> { throw new RuntimeException("Unknown status code: " + s4cases.op); }); + + Y: while (true) + { + Http_C_5_Cases cases = s5.branch(S); + switch (cases.op) + { + case ACCEPTR: + { + s5 = cases.receive(ACCEPTR); + break; + } + case BODY: + { + cases.receive(BODY, b_body); + System.out.println(b_body.val.getBody()); + break Y; + } + case CONTENTL: + { + s5 = cases.receive(CONTENTL, b_clen); + break; + } + case CONTENTT: + { + s5 = cases.receive(CONTENTT, b_ctype); + break; + } + case DATE: + { + s5 = cases.receive(DATE); + break; + } + case ETAG: + { + s5 = cases.receive(ETAG); + break; + } + case LASTM: + { + s5 = cases.receive(LASTM); + break; + } + case SERVER: + { + s5 = cases.receive(SERVER, b_serv); + break; + } + case STRICTTS: + { + s5 = cases.receive(STRICTTS); + break; + } + case VARY: + { + s5 = cases.receive(VARY); + break; + } + case VIA: + { + s5 = cases.receive(VIA); + break; + } + } + } + } + } +} diff --git a/scribble-demos/scrib/http/src/http/longvers/HttpLongS.java b/scribble-demos/scrib/http/src/http/longvers/HttpLongS.java new file mode 100644 index 000000000..375d8c8cf --- /dev/null +++ b/scribble-demos/scrib/http/src/http/longvers/HttpLongS.java @@ -0,0 +1,144 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package http.longvers; + +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.net.SocketChannelServer; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import http.longvers.HttpLong.Http.Http; +import http.longvers.HttpLong.Http.roles.S; +import http.longvers.HttpLong.Http.statechans.S.Http_S_1; +import http.longvers.HttpLong.Http.statechans.S.Http_S_2; +import http.longvers.HttpLong.Http.statechans.S.Http_S_2_Cases; +import http.longvers.message.Body; +import http.longvers.message.HttpLongMessageFormatter; +import http.longvers.message.client.Accept; +import http.longvers.message.client.AcceptEncoding; +import http.longvers.message.client.AcceptLanguage; +import http.longvers.message.client.Connection; +import http.longvers.message.client.Cookie; +import http.longvers.message.client.DoNotTrack; +import http.longvers.message.client.Host; +import http.longvers.message.client.RequestLine; +import http.longvers.message.client.UpgradeInsecureRequests; +import http.longvers.message.client.UserAgent; +import http.longvers.message.server.ContentLength; +import http.longvers.message.server.HttpVersion; +import http.longvers.message.server._200; + +public class HttpLongS +{ + public HttpLongS() + { + + } + + public static void main(String[] args) throws Exception + { + Buf b_reql = new Buf<>(); + Buf b_host = new Buf<>(); + Buf b_usera = new Buf<>(); + Buf b_acc = new Buf<>(); + Buf b_accl = new Buf<>(); + Buf b_acce = new Buf<>(); + Buf b_dnt = new Buf<>(); + Buf b_conn = new Buf<>(); + Buf b_upgradeir = new Buf<>(); + Buf b_cookie = new Buf<>(); + Buf b_body = new Buf<>(); + + try (ScribServerSocket ss = new SocketChannelServer(8080)) + { + while (true) + { + Http http = new Http(); + try (MPSTEndpoint se = new MPSTEndpoint<>(http, Http.S, new HttpLongMessageFormatter())) + { + se.accept(ss, Http.C); + + Http_S_1 s1 = new Http_S_1(se); + Http_S_2 s2 = s1.receive(Http.C, Http.REQUESTL, b_reql); + + System.out.println("Requested: " + b_reql.val); + + X: while (true) + { + Http_S_2_Cases s2cases = s2.branch(Http.C); + switch (s2cases.op) + { + case ACCEPT: + { + s2 = s2cases.receive(Http.ACCEPT, b_acc); + break; + } + case ACCEPTE: + { + s2 = s2cases.receive(Http.ACCEPTE, b_acce); + break; + } + case ACCEPTL: + { + s2 = s2cases.receive(Http.ACCEPTL, b_accl); + break; + } + case BODY: + { + //String body = ""; + String body = "Hello, world!"; + s2cases.receive(Http.BODY, b_body) + .send(Http.C, new HttpVersion("1.1")) + .send(Http.C, new _200("OK")) + .send(Http.C, new ContentLength(body.length())) + .send(Http.C, new Body(body)); + break X; + } + case CONNECTION: + { + s2 = s2cases.receive(Http.CONNECTION, b_conn); + break; + } + case DNT: + { + s2 = s2cases.receive(Http.DNT, b_dnt); + break; + } + case UPGRADEIR: + { + s2 = s2cases.receive(Http.UPGRADEIR, b_upgradeir); + break; + } + case COOKIE: + { + s2 = s2cases.receive(Http.COOKIE, b_cookie); + break; + } + case HOST: + { + s2 = s2cases.receive(Http.HOST, b_host); + break; + } + case USERA: + { + s2 = s2cases.receive(Http.USERA, b_usera); + break; + } + } + } + } + } + } + } +} diff --git a/scribble-demos/scrib/http/src/http/longvers/message/Body.java b/scribble-demos/scrib/http/src/http/longvers/message/Body.java new file mode 100644 index 000000000..2c4cb94ae --- /dev/null +++ b/scribble-demos/scrib/http/src/http/longvers/message/Body.java @@ -0,0 +1,32 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package http.longvers.message; + +import http.longvers.HttpLong.Http.Http; + +public class Body extends HttpLongMessage +{ + private static final long serialVersionUID = 1L; + + public Body(String body) + { + super(Http.BODY, body); + } + + @Override + public byte[] toBytes() + { + return (getOpString(this.op) + getBody()).getBytes(HttpLongMessageFormatter.cs); // opString should be empty + } +} diff --git a/scribble-demos/scrib/http/src/http/longvers/message/HeaderField.java b/scribble-demos/scrib/http/src/http/longvers/message/HeaderField.java new file mode 100644 index 000000000..0c6774462 --- /dev/null +++ b/scribble-demos/scrib/http/src/http/longvers/message/HeaderField.java @@ -0,0 +1,26 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package http.longvers.message; + +import org.scribble.core.type.name.Op; + +public abstract class HeaderField extends HttpLongMessage +{ + private static final long serialVersionUID = 1L; + + public HeaderField(Op name, String value) + { + super(name, ": " + value + " "); + } +} diff --git a/scribble-demos/scrib/http/src/http/longvers/message/HttpLongMessage.java b/scribble-demos/scrib/http/src/http/longvers/message/HttpLongMessage.java new file mode 100644 index 000000000..2dea67fc9 --- /dev/null +++ b/scribble-demos/scrib/http/src/http/longvers/message/HttpLongMessage.java @@ -0,0 +1,154 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package http.longvers.message; + +import org.scribble.runtime.message.ScribMessage; +import org.scribble.core.type.name.Op; + +import http.longvers.HttpLong.Http.Http; + +// Unlike ScribMessage, HttpMessage is not actually "sent", but we use it as the base class since the socket API takes ScribMessages +public abstract class HttpLongMessage extends ScribMessage +{ + private static final long serialVersionUID = 1L; + + // " " after ops done by HeaderField + public static final String GET = "GET"; + public static final String HTTP = "HTTP"; + public static final String HOST = "Host"; + + public static final String USER_AGENT = "User-Agent"; + public static final String ACCEPT = "Accept"; + public static final String ACCEPT_LANGUAGE = "Accept-Language"; + public static final String ACCEPT_ENCODING = "Accept-Encoding"; + public static final String DO_NOT_TRACK = "DNT"; + public static final String CONNECTION = "Connection"; + + public static final String UPGRADE_INSECURE_REQUESTS = "Upgrade-Insecure-Requests"; + public static final String COOKIE = "Cookie"; + + public static final String DATE = "Date"; + public static final String CONTENT_TYPE = "Content-Type"; + public static final String _404 = "404"; + public static final String _200 = "200"; + public static final String ACCEPT_RANGES = "Accept-Ranges"; + public static final String LAST_MODIFIED = "Last-Modified"; + public static final String VARY = "Vary"; + public static final String SERVER = "Server"; + public static final String STRICT_TRANSPORT_SECURITY = "Strict-Transport-Security"; + public static final String VIA = "Via"; + public static final String ETAG = "ETag"; + public static final String CONTENT_LENGTH = "Content-Length"; + + protected static final String CRLF = "\r\n"; + + public HttpLongMessage(Op op) + { + super(op); + } + + public HttpLongMessage(Op op, String body) + { + super(op, body); + } + + public String getBody() + { + return (this.payload.length == 0) ? "" : (String) this.payload[0]; + } + + public byte[] toBytes() + { + return (getOpString(this.op) + getBody() + HttpLongMessage.CRLF).getBytes(HttpLongMessageFormatter.cs); // Can give "utf-8" as arg directly + } + + @Override + public String toString() + { + return new String(toBytes()); + } + + // " " after ops done by HeaderField + protected static String getOpString(Op op) + { + if (op.equals(Http.CONTENTL)) + { + return HttpLongMessage.CONTENT_LENGTH; + } + else if (op.equals(Http.ETAG)) + { + return HttpLongMessage.ETAG; + } + else if (op.equals(Http.BODY)) + { + return HttpLongMessage.CRLF; // This CRLF "op" actually enacts the empty line for end-of-headers + } + else if (op.equals(Http.VIA)) + { + return HttpLongMessage.VIA; + } + else if (op.equals(Http.SERVER)) + { + return HttpLongMessage.SERVER; + } + else if (op.equals(Http.VARY)) + { + return HttpLongMessage.VARY; + } + else if (op.equals(HttpLongMessage.CRLF)) + { + return ""; + } + else if (op.equals(Http.REQUESTL)) // FIXME: not just GET (POST..) + { + return HttpLongMessage.GET; + } + else if (op.equals(Http.LASTM)) + { + return HttpLongMessage.LAST_MODIFIED; + } + else if (op.equals(Http.ACCEPTR)) + { + return HttpLongMessage.ACCEPT_RANGES; + } + else if (op.equals(Http.HOST)) + { + return HttpLongMessage.HOST; + } + else if (op.equals(Http.HTTPV)) + { + return HttpLongMessage.HTTP; + } + else if (op.equals(Http._200)) + { + return HttpLongMessage._200; + } + else if (op.equals(Http._404)) + { + return HttpLongMessage._404; + } + else if (op.equals(Http.CONTENTT)) + { + return HttpLongMessage.CONTENT_TYPE; + } + else if (op.equals(Http.DATE)) + { + return HttpLongMessage.DATE; + } + else + { + throw new RuntimeException("TODO: " + op); + } + } +} diff --git a/scribble-demos/scrib/http/src/http/longvers/message/HttpLongMessageFormatter.java b/scribble-demos/scrib/http/src/http/longvers/message/HttpLongMessageFormatter.java new file mode 100644 index 000000000..6c4ecdb98 --- /dev/null +++ b/scribble-demos/scrib/http/src/http/longvers/message/HttpLongMessageFormatter.java @@ -0,0 +1,416 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package http.longvers.message; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; + +import org.scribble.runtime.message.ScribMessage; +import org.scribble.runtime.message.ScribMessageFormatter; + +import http.longvers.message.client.Accept; +import http.longvers.message.client.AcceptEncoding; +import http.longvers.message.client.AcceptLanguage; +import http.longvers.message.client.Connection; +import http.longvers.message.client.Cookie; +import http.longvers.message.client.DoNotTrack; +import http.longvers.message.client.Host; +import http.longvers.message.client.RequestLine; +import http.longvers.message.client.UpgradeInsecureRequests; +import http.longvers.message.client.UserAgent; +import http.longvers.message.server.AcceptRanges; +import http.longvers.message.server.ContentLength; +import http.longvers.message.server.ContentType; +import http.longvers.message.server.Date; +import http.longvers.message.server.ETag; +import http.longvers.message.server.HttpVersion; +import http.longvers.message.server.LastModified; +import http.longvers.message.server.Server; +import http.longvers.message.server.StrictTransportSecurity; +import http.longvers.message.server.Vary; +import http.longvers.message.server.Via; +import http.longvers.message.server._200; +import http.longvers.message.server._404; + +// FIXME: investigate if factoring out the C/S deserialization simplifies things +public class HttpLongMessageFormatter implements ScribMessageFormatter +{ + public static final Charset cs = Charset.forName("UTF8"); + //private static CharsetDecoder cd = cs.newDecoder(); + + private int len = -1; + + public HttpLongMessageFormatter() + { + + } + + @Override + public byte[] toBytes(ScribMessage m) throws IOException + { + return ((HttpLongMessage) m).toBytes(); + } + + @Override + public ScribMessage fromBytes(ByteBuffer bb) throws IOException, ClassNotFoundException + { + bb.flip(); + int rem = bb.remaining(); + if (rem < 2) + { + bb.compact(); + return null; + } + + int pos = bb.position(); + String front = new String(new byte[] { bb.get(pos), bb.get(pos + 1) }, HttpLongMessageFormatter.cs); + if (front.equals(HttpLongMessage.CRLF)) // not sound? -- actually, due to sess types it is safe (same reason why interpreting any of these messages without context is sound) -- parsing doesn't have to follow the *full protocol* BNF any more to be sound + { + if (this.len == -1) + { + return new Body(""); + } + if (rem < this.len + 2) + { + bb.compact(); + return null; + } + //String body = readLine(dis) + HttpMessage.CRLF; // HACK: assumes at least 1 CRLF + StringBuffer sb = new StringBuffer(); + //for (int i = body.length(); i < this.len; i++) + for (int i = 0; i < this.len; i++) + { + sb.append((char) bb.get()); + } + this.len = -1; + //return new Body(body + sb.toString()); + return new Body(sb.toString()); + } + + if (rem < pos + 4) + { + bb.compact(); + return null; + } + //byte[] bs = new byte[2]; + //dis.readFully(bs); + front += new String(new byte[] { bb.get(pos + 2), bb.get(pos + 3) }, HttpLongMessageFormatter.cs); + // FIXME: factor out with HttpMessage op strings + int code = isStatusCode(front); + if (code > -1) + { + String reason = readLine(bb, pos + 4).trim(); // Whitespace already built into the message classes + bb.compact(); + if (reason == null) + { + return null; + } + switch (code) + { + case 200: return new _200(reason); + case 404: return new _404(reason); + default: throw new RuntimeException("Unknown status code: " + code); + } + } + else if (front.startsWith(HttpLongMessage.GET)) + { + String reql = readLine(bb, pos + 4).trim(); + bb.compact(); + if (reql == null) + { + return null; + } + String target = reql.substring(0, reql.indexOf(' ')); + String vers = reql.substring(reql.indexOf(' ') + 1).trim(); + vers = vers.substring(vers.indexOf('/') + 1); + return new RequestLine(target, vers); + } + else if (front.equals(HttpLongMessage.HTTP)) + { + //dis.read(); // '/' + if (rem < pos + 5) + { + bb.compact(); + return null; + } + String word = readWord(bb, pos + 5); + bb.compact(); + if (word == null) + { + return null; + } + return new HttpVersion(word); + } + else + { + String line = readLine(bb, pos + 4); + bb.compact(); + if (line == null) + { + return null; + } + line = front + line; + int colon = line.indexOf(':'); + if (colon > -1) + { + String name = line.substring(0, colon); + String value = line.substring(colon + 1).trim(); // Whitespace already built into the message classes + switch (name) + { + case HttpLongMessage.HOST: return new Host("value"); + case HttpLongMessage.USER_AGENT: return new UserAgent(value); + case HttpLongMessage.ACCEPT: return new Accept(value); + case HttpLongMessage.ACCEPT_LANGUAGE: return new AcceptLanguage(value); + case HttpLongMessage.ACCEPT_ENCODING: return new AcceptEncoding(value); + case HttpLongMessage.DO_NOT_TRACK: return new DoNotTrack(Integer.parseInt(value)); + case HttpLongMessage.CONNECTION: return new Connection(value); + case HttpLongMessage.UPGRADE_INSECURE_REQUESTS: return new UpgradeInsecureRequests(Integer.parseInt(value)); + case HttpLongMessage.COOKIE: return new Cookie(value); + + case HttpLongMessage.DATE: return new Date(value); + case HttpLongMessage.SERVER: return new Server(value); + case HttpLongMessage.STRICT_TRANSPORT_SECURITY: return new StrictTransportSecurity(value); + case HttpLongMessage.LAST_MODIFIED: return new LastModified(value); + case HttpLongMessage.ETAG: return new ETag(value); + case HttpLongMessage.ACCEPT_RANGES: return new AcceptRanges(value); + case HttpLongMessage.CONTENT_LENGTH: + { + len = Integer.parseInt(value.trim()); + return new ContentLength(len); + } + case HttpLongMessage.VARY: return new Vary(value); + case HttpLongMessage.CONTENT_TYPE: return new ContentType(value); + case HttpLongMessage.VIA: return new Via(value); + default: { + //throw new RuntimeException("Cannot parse header field: " + line); + System.err.println("Cannot parse header field, attempting to skip: " + line); + return fromBytes(bb); + } + } + } + else + { + throw new RuntimeException("Cannot parse message: " + line); + } + } + } + + private static String readLine(ByteBuffer bb, int i) throws IOException + { + StringBuilder sb = new StringBuilder(); + for (int limit = bb.limit(); i <= limit; ) + { + char c = (char) bb.get(i++); // readChar is not the same + sb.append(c); + if (c == '\r') + { + if (i > limit) + { + return null; + } + c = (char) bb.get(i++); + sb.append(c); + if (c == '\n') + { + bb.position(i); + return sb.substring(0, sb.length() - 2).toString(); + } + } + } + return null; + } + + private static String readWord(ByteBuffer bb, int i) throws IOException + { + StringBuilder sb = new StringBuilder(); + for (int limit = bb.limit(); i <= limit; ) + { + char c = (char) bb.get(i++); + if (c == ' ') + { + bb.position(i); + return sb.toString(); + } + sb.append(c); + } + return null; + } + + //private int isStatusCode(byte[] bs) + private int isStatusCode(String front) + { + String code = ""; + for (int i = 0; i < 4; i++) + { + //char c = (char) bs[i]; + char c = front.charAt(i); + if (i < 3) + { + if (c < '0' || c > '9') + { + return -1; + } + code += c; + } + else + { + if (c != ' ') + { + return -1; + } + } + } + return Integer.parseInt(code); + } + + + + // FIXME: delete + @Deprecated @Override + public void writeMessage(DataOutputStream dos, ScribMessage m) throws IOException + { + dos.write(((HttpLongMessage) m).toBytes()); + dos.flush(); + } + + @Deprecated @Override + public ScribMessage readMessage(DataInputStream dis) throws IOException + { + byte[] bs = new byte[2]; + dis.readFully(bs); + String front = new String(bs, HttpLongMessageFormatter.cs); + if (front.equals(HttpLongMessage.CRLF)) // not sound? -- actually, due to sess types it is safe (same reason why interpreting any of these messages without context is sound) -- parsing doesn't have to follow the *full protocol* BNF any more to be sound + { + if (this.len == -1) + { + return new Body(""); + } + //String body = readLine(dis) + HttpMessage.CRLF; // HACK: assumes at least 1 CRLF + StringBuffer sb = new StringBuffer(); + //for (int i = body.length(); i < this.len; i++) + for (int i = 0; i < this.len; i++) + { + sb.append((char) dis.read()); + } + this.len = -1; + //return new Body(body + sb.toString()); + return new Body(sb.toString()); + } + + bs = new byte[2]; + dis.readFully(bs); + front += new String(bs, HttpLongMessageFormatter.cs); + // FIXME: factor out with HttpMessage op strings + int code = isStatusCode(front); + if (code > -1) + { + String reason = readLine(dis).trim(); // Whitespace already built into the message classes + switch (code) + { + case 200: return new _200(reason); + case 404: return new _404(reason); + default: throw new RuntimeException("Unknown status code: " + code); + } + } + else if (front.startsWith(HttpLongMessage.GET)) + { + String reql = readLine(dis).trim(); + String target = reql.substring(0, reql.indexOf(' ')); + String vers = reql.substring(reql.indexOf(' ') + 1).trim(); + vers = vers.substring(vers.indexOf('/') + 1); + return new RequestLine(target, vers); + } + else if (front.equals(HttpLongMessage.HTTP)) + { + dis.read(); // '/' + String word = readWord(dis); + return new HttpVersion(word); + } + else + { + String line = front + readLine(dis); + int colon = line.indexOf(':'); + if (colon > -1) + { + String name = line.substring(0, colon); + String value = line.substring(colon + 1).trim(); // Whitespace already built into the message classes + switch (name) + { + case HttpLongMessage.HOST: return new Host("value"); + case HttpLongMessage.USER_AGENT: return new UserAgent(value); + case HttpLongMessage.ACCEPT: return new Accept(value); + case HttpLongMessage.ACCEPT_LANGUAGE: return new AcceptLanguage(value); + case HttpLongMessage.ACCEPT_ENCODING: return new AcceptEncoding(value); + case HttpLongMessage.DO_NOT_TRACK: return new DoNotTrack(Integer.parseInt(value)); + case HttpLongMessage.CONNECTION: return new Connection(value); + + case HttpLongMessage.DATE: return new Date(value); + case HttpLongMessage.SERVER: return new Server(value); + case HttpLongMessage.LAST_MODIFIED: return new LastModified(value); + case HttpLongMessage.ETAG: return new ETag(value); + case HttpLongMessage.ACCEPT_RANGES: return new AcceptRanges(value); + case HttpLongMessage.CONTENT_LENGTH: + { + len = Integer.parseInt(value.trim()); + return new ContentLength(len); + } + case HttpLongMessage.VARY: return new Vary(value); + case HttpLongMessage.CONTENT_TYPE: return new ContentType(value); + case HttpLongMessage.VIA: return new Via(value); + default: throw new RuntimeException("Cannot parse header field: " + line); + } + } + else + { + throw new RuntimeException("Cannot parse message: " + line); + } + } + } + + private static String readLine(DataInputStream dis) throws IOException + { + StringBuilder sb = new StringBuilder(); + for (; true; ) + { + char c = (char) dis.read(); // readChar is not the same + sb.append(c); + if (c == '\r') + { + c = (char) dis.read(); + sb.append(c); + if (c == '\n') + { + return sb.substring(0, sb.length() - 2).toString(); + } + } + } + } + + private static String readWord(DataInputStream dis) throws IOException + { + StringBuilder sb = new StringBuilder(); + for (; true; ) + { + char c = (char) dis.read(); + if (c == ' ') + { + return sb.toString(); + } + sb.append(c); + } + } +} diff --git a/scribble-demos/scrib/http/src/http/longvers/message/StartLine.java b/scribble-demos/scrib/http/src/http/longvers/message/StartLine.java new file mode 100644 index 000000000..54d86be69 --- /dev/null +++ b/scribble-demos/scrib/http/src/http/longvers/message/StartLine.java @@ -0,0 +1,26 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package http.longvers.message; + +import org.scribble.core.type.name.Op; + +public abstract class StartLine extends HttpLongMessage +{ + private static final long serialVersionUID = 1L; + + public StartLine(Op op, String body) + { + super(op, body); + } +} diff --git a/scribble-demos/scrib/http/src/http/longvers/message/client/Accept.java b/scribble-demos/scrib/http/src/http/longvers/message/client/Accept.java new file mode 100644 index 000000000..9c37257a8 --- /dev/null +++ b/scribble-demos/scrib/http/src/http/longvers/message/client/Accept.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package http.longvers.message.client; + +import http.longvers.HttpLong.Http.Http; +import http.longvers.message.HeaderField; + +public class Accept extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public Accept(String text) + { + super(Http.ACCEPT, text); + } +} diff --git a/scribble-demos/scrib/http/src/http/longvers/message/client/AcceptEncoding.java b/scribble-demos/scrib/http/src/http/longvers/message/client/AcceptEncoding.java new file mode 100644 index 000000000..137a409f2 --- /dev/null +++ b/scribble-demos/scrib/http/src/http/longvers/message/client/AcceptEncoding.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package http.longvers.message.client; + +import http.longvers.HttpLong.Http.Http; +import http.longvers.message.HeaderField; + +public class AcceptEncoding extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public AcceptEncoding(String text) + { + super(Http.ACCEPTE, text); + } +} diff --git a/scribble-demos/scrib/http/src/http/longvers/message/client/AcceptLanguage.java b/scribble-demos/scrib/http/src/http/longvers/message/client/AcceptLanguage.java new file mode 100644 index 000000000..8d44d5cd2 --- /dev/null +++ b/scribble-demos/scrib/http/src/http/longvers/message/client/AcceptLanguage.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package http.longvers.message.client; + +import http.longvers.HttpLong.Http.Http; +import http.longvers.message.HeaderField; + +public class AcceptLanguage extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public AcceptLanguage(String text) + { + super(Http.ACCEPTL, text); + } +} diff --git a/scribble-demos/scrib/http/src/http/longvers/message/client/Connection.java b/scribble-demos/scrib/http/src/http/longvers/message/client/Connection.java new file mode 100644 index 000000000..a464e240a --- /dev/null +++ b/scribble-demos/scrib/http/src/http/longvers/message/client/Connection.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package http.longvers.message.client; + +import http.longvers.HttpLong.Http.Http; +import http.longvers.message.HeaderField; + +public class Connection extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public Connection(String text) + { + super(Http.CONNECTION, text); + } +} diff --git a/scribble-demos/scrib/http/src/http/longvers/message/client/Cookie.java b/scribble-demos/scrib/http/src/http/longvers/message/client/Cookie.java new file mode 100644 index 000000000..fee652fd2 --- /dev/null +++ b/scribble-demos/scrib/http/src/http/longvers/message/client/Cookie.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package http.longvers.message.client; + +import http.longvers.HttpLong.Http.Http; +import http.longvers.message.HeaderField; + +public class Cookie extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public Cookie(String val) + { + super(Http.COOKIE, val); + } +} diff --git a/scribble-demos/scrib/http/src/http/longvers/message/client/DoNotTrack.java b/scribble-demos/scrib/http/src/http/longvers/message/client/DoNotTrack.java new file mode 100644 index 000000000..7d9734d74 --- /dev/null +++ b/scribble-demos/scrib/http/src/http/longvers/message/client/DoNotTrack.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package http.longvers.message.client; + +import http.longvers.HttpLong.Http.Http; +import http.longvers.message.HeaderField; + +public class DoNotTrack extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public DoNotTrack(int val) + { + super(Http.DNT, Integer.toString(val)); + } +} diff --git a/scribble-demos/scrib/http/src/http/longvers/message/client/Host.java b/scribble-demos/scrib/http/src/http/longvers/message/client/Host.java new file mode 100644 index 000000000..de3c6ad7a --- /dev/null +++ b/scribble-demos/scrib/http/src/http/longvers/message/client/Host.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package http.longvers.message.client; + +import http.longvers.HttpLong.Http.Http; +import http.longvers.message.HeaderField; + +public class Host extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public Host(String host) + { + super(Http.HOST, host); + } +} diff --git a/scribble-demos/scrib/http/src/http/longvers/message/client/RequestLine.java b/scribble-demos/scrib/http/src/http/longvers/message/client/RequestLine.java new file mode 100644 index 000000000..289ec1aea --- /dev/null +++ b/scribble-demos/scrib/http/src/http/longvers/message/client/RequestLine.java @@ -0,0 +1,29 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package http.longvers.message.client; + +import http.longvers.HttpLong.Http.Http; +import http.longvers.message.StartLine; + + +// FIXME: not just GET +public class RequestLine extends StartLine +{ + private static final long serialVersionUID = 1L; + + public RequestLine(String reqtarget, String vers) + { + super(Http.REQUESTL, " " + reqtarget + " HTTP" + "/" + vers); + } +} diff --git a/scribble-demos/scrib/http/src/http/longvers/message/client/UpgradeInsecureRequests.java b/scribble-demos/scrib/http/src/http/longvers/message/client/UpgradeInsecureRequests.java new file mode 100644 index 000000000..84db1ed7c --- /dev/null +++ b/scribble-demos/scrib/http/src/http/longvers/message/client/UpgradeInsecureRequests.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package http.longvers.message.client; + +import http.longvers.HttpLong.Http.Http; +import http.longvers.message.HeaderField; + +public class UpgradeInsecureRequests extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public UpgradeInsecureRequests(int val) + { + super(Http.UPGRADEIR, Integer.toString(val)); + } +} diff --git a/scribble-demos/scrib/http/src/http/longvers/message/client/UserAgent.java b/scribble-demos/scrib/http/src/http/longvers/message/client/UserAgent.java new file mode 100644 index 000000000..03d6e6507 --- /dev/null +++ b/scribble-demos/scrib/http/src/http/longvers/message/client/UserAgent.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package http.longvers.message.client; + +import http.longvers.HttpLong.Http.Http; +import http.longvers.message.HeaderField; + +public class UserAgent extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public UserAgent(String text) + { + super(Http.USERA, text); + } +} diff --git a/scribble-demos/scrib/http/src/http/longvers/message/server/AcceptRanges.java b/scribble-demos/scrib/http/src/http/longvers/message/server/AcceptRanges.java new file mode 100644 index 000000000..eac61312a --- /dev/null +++ b/scribble-demos/scrib/http/src/http/longvers/message/server/AcceptRanges.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package http.longvers.message.server; + +import http.longvers.HttpLong.Http.Http; +import http.longvers.message.HeaderField; + +public class AcceptRanges extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public AcceptRanges(String text) + { + super(Http.ACCEPTR, text); + } +} diff --git a/scribble-demos/scrib/http/src/http/longvers/message/server/CRLF.java b/scribble-demos/scrib/http/src/http/longvers/message/server/CRLF.java new file mode 100644 index 000000000..3655d546e --- /dev/null +++ b/scribble-demos/scrib/http/src/http/longvers/message/server/CRLF.java @@ -0,0 +1,29 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package http.longvers.message.server; + +import http.longvers.message.HttpLongMessage; + +@Deprecated +public class CRLF extends HttpLongMessage +{ + private static final long serialVersionUID = 1L; + + public CRLF() + { + //super(Http.CRLF, HttpMessage.CRLF); // No: HttpMessage already appends the CRLF + //super(Http.CRLF, ""); + super(null, ""); + } +} diff --git a/scribble-demos/scrib/http/src/http/longvers/message/server/ContentLength.java b/scribble-demos/scrib/http/src/http/longvers/message/server/ContentLength.java new file mode 100644 index 000000000..145380f67 --- /dev/null +++ b/scribble-demos/scrib/http/src/http/longvers/message/server/ContentLength.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package http.longvers.message.server; + +import http.longvers.HttpLong.Http.Http; +import http.longvers.message.HeaderField; + +public class ContentLength extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public ContentLength(Integer len) + { + super(Http.CONTENTL, len.toString()); + } +} diff --git a/scribble-demos/scrib/http/src/http/longvers/message/server/ContentType.java b/scribble-demos/scrib/http/src/http/longvers/message/server/ContentType.java new file mode 100644 index 000000000..3ac9797a2 --- /dev/null +++ b/scribble-demos/scrib/http/src/http/longvers/message/server/ContentType.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package http.longvers.message.server; + +import http.longvers.HttpLong.Http.Http; +import http.longvers.message.HeaderField; + +public class ContentType extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public ContentType(String type) + { + super(Http.CONTENTT, type); + } +} diff --git a/scribble-demos/scrib/http/src/http/longvers/message/server/Date.java b/scribble-demos/scrib/http/src/http/longvers/message/server/Date.java new file mode 100644 index 000000000..9b087aee7 --- /dev/null +++ b/scribble-demos/scrib/http/src/http/longvers/message/server/Date.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package http.longvers.message.server; + +import http.longvers.HttpLong.Http.Http; +import http.longvers.message.HeaderField; + +public class Date extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public Date(String date) + { + super(Http.DATE, date); + } +} diff --git a/scribble-demos/scrib/http/src/http/longvers/message/server/ETag.java b/scribble-demos/scrib/http/src/http/longvers/message/server/ETag.java new file mode 100644 index 000000000..7c510d61a --- /dev/null +++ b/scribble-demos/scrib/http/src/http/longvers/message/server/ETag.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package http.longvers.message.server; + +import http.longvers.HttpLong.Http.Http; +import http.longvers.message.HeaderField; + +public class ETag extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public ETag(String tag) + { + super(Http.ETAG, tag); + } +} diff --git a/scribble-demos/scrib/http/src/http/longvers/message/server/HttpVersion.java b/scribble-demos/scrib/http/src/http/longvers/message/server/HttpVersion.java new file mode 100644 index 000000000..5aca34437 --- /dev/null +++ b/scribble-demos/scrib/http/src/http/longvers/message/server/HttpVersion.java @@ -0,0 +1,34 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package http.longvers.message.server; + +import http.longvers.HttpLong.Http.Http; +import http.longvers.message.HttpLongMessage; +import http.longvers.message.HttpLongMessageFormatter; + +public class HttpVersion extends HttpLongMessage +{ + private static final long serialVersionUID = 1L; + + public HttpVersion(String version) + { + super(Http.HTTPV, "/" + version); + } + + @Override + public byte[] toBytes() + { + return (getOpString(op) + getBody() + " ").getBytes(HttpLongMessageFormatter.cs); + } +} diff --git a/scribble-demos/scrib/http/src/http/longvers/message/server/LastModified.java b/scribble-demos/scrib/http/src/http/longvers/message/server/LastModified.java new file mode 100644 index 000000000..3791725c6 --- /dev/null +++ b/scribble-demos/scrib/http/src/http/longvers/message/server/LastModified.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package http.longvers.message.server; + +import http.longvers.HttpLong.Http.Http; +import http.longvers.message.HeaderField; + +public class LastModified extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public LastModified(String date) + { + super(Http.LASTM, date); + } +} diff --git a/scribble-demos/scrib/http/src/http/longvers/message/server/Server.java b/scribble-demos/scrib/http/src/http/longvers/message/server/Server.java new file mode 100644 index 000000000..4db3a69ca --- /dev/null +++ b/scribble-demos/scrib/http/src/http/longvers/message/server/Server.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package http.longvers.message.server; + +import http.longvers.HttpLong.Http.Http; +import http.longvers.message.HeaderField; + +public class Server extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public Server(String server) + { + super(Http.SERVER, server); + } +} diff --git a/scribble-demos/scrib/http/src/http/longvers/message/server/StatusCode.java b/scribble-demos/scrib/http/src/http/longvers/message/server/StatusCode.java new file mode 100644 index 000000000..730d707cf --- /dev/null +++ b/scribble-demos/scrib/http/src/http/longvers/message/server/StatusCode.java @@ -0,0 +1,28 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package http.longvers.message.server; + +import org.scribble.core.type.name.Op; + +import http.longvers.message.HttpLongMessage; + +public abstract class StatusCode extends HttpLongMessage +{ + private static final long serialVersionUID = 1L; + + public StatusCode(Op code, String reason) + { + super(code, " " + reason); + } +} diff --git a/scribble-demos/scrib/http/src/http/longvers/message/server/StrictTransportSecurity.java b/scribble-demos/scrib/http/src/http/longvers/message/server/StrictTransportSecurity.java new file mode 100644 index 000000000..9db70f2b6 --- /dev/null +++ b/scribble-demos/scrib/http/src/http/longvers/message/server/StrictTransportSecurity.java @@ -0,0 +1,28 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package http.longvers.message.server; + +import http.longvers.HttpLong.Http.Http; +import http.longvers.message.HeaderField; + +public class StrictTransportSecurity extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public StrictTransportSecurity(String server) + { + super(Http.STRICTTS, server); + //super(Http.STRICT_TRANSPORT_SECURITY, server); + } +} diff --git a/scribble-demos/scrib/http/src/http/longvers/message/server/Vary.java b/scribble-demos/scrib/http/src/http/longvers/message/server/Vary.java new file mode 100644 index 000000000..db8a53d41 --- /dev/null +++ b/scribble-demos/scrib/http/src/http/longvers/message/server/Vary.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package http.longvers.message.server; + +import http.longvers.HttpLong.Http.Http; +import http.longvers.message.HeaderField; + +public class Vary extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public Vary(String text) + { + super(Http.VARY, text); + } +} diff --git a/scribble-demos/scrib/http/src/http/longvers/message/server/Via.java b/scribble-demos/scrib/http/src/http/longvers/message/server/Via.java new file mode 100644 index 000000000..cbae6a33c --- /dev/null +++ b/scribble-demos/scrib/http/src/http/longvers/message/server/Via.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package http.longvers.message.server; + +import http.longvers.HttpLong.Http.Http; +import http.longvers.message.HeaderField; + +public class Via extends HeaderField +{ + private static final long serialVersionUID = 1L; + + public Via(String text) + { + super(Http.VIA, text); + } +} diff --git a/scribble-demos/scrib/http/src/http/longvers/message/server/_200.java b/scribble-demos/scrib/http/src/http/longvers/message/server/_200.java new file mode 100644 index 000000000..7d7dd1638 --- /dev/null +++ b/scribble-demos/scrib/http/src/http/longvers/message/server/_200.java @@ -0,0 +1,26 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package http.longvers.message.server; + +import http.longvers.HttpLong.Http.Http; + +public class _200 extends StatusCode +{ + private static final long serialVersionUID = 1L; + + public _200(String reason) + { + super(Http._200, reason); + } +} diff --git a/scribble-demos/scrib/http/src/http/longvers/message/server/_404.java b/scribble-demos/scrib/http/src/http/longvers/message/server/_404.java new file mode 100644 index 000000000..8e8d3114e --- /dev/null +++ b/scribble-demos/scrib/http/src/http/longvers/message/server/_404.java @@ -0,0 +1,26 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package http.longvers.message.server; + +import http.longvers.HttpLong.Http.Http; + +public class _404 extends StatusCode +{ + private static final long serialVersionUID = 1L; + + public _404(String reason) + { + super(Http._404, reason); + } +} diff --git a/scribble-demos/scrib/http/src/http/shortvers/HttpShort.scr b/scribble-demos/scrib/http/src/http/shortvers/HttpShort.scr new file mode 100644 index 000000000..42de41bc9 --- /dev/null +++ b/scribble-demos/scrib/http/src/http/shortvers/HttpShort.scr @@ -0,0 +1,39 @@ +//$ ./scribblec.sh -ip scribble-demos/scrib/http/src -d scribble-demos/scrib/http/src scribble-demos/scrib/http/src/http/shortvers/HttpShort.scr -api Http C +//$ javadoc -cp scribble-core/target/classes:scribble-runtime/target/classes:scribble-demos/scrib/http/src/ scribble-demos/scrib/http/src/http/shortvers/*.java -subpackages http.shortvers.HttpShort.Http -d scribble-demos/scrib/http/javadoc/shortvers + +module http.shortvers.HttpShort; + +/*Connected to www.doc.ic.ac.uk. +Escape character is '^]'. +GET /~rhu/ HTTP/1.1 +host: www.doc.ic.ac.uk + +HTTP/1.1 200 OK // 200 is a separate message +Date: Mon, 13 Jun 2016 19:42:34 GMT +Server: Apache +Strict-Transport-Security: max-age=31536000; preload; includeSubDomains +Strict-Transport-Security: max-age=31536000; preload; includeSubDomains // BUG? (Apache configuration) +Last-Modified: Thu, 14 Apr 2016 12:46:24 GMT +ETag: "74a-53071482f6e0f" +Accept-Ranges: bytes +Content-Length: 1866 // Not using Transfer-Encoding: Chunked +Vary: Accept-Encoding +Content-Type: text/html +Via: 1.1 www.doc.ic.ac.uk*/ + + +sig "http.shortvers.message.client.Request" + from "http/shortvers/message/Request.java" + as REQUEST; + +sig "http.shortvers.message.server.Response" + from "http/shortvers/message/Response.java" + as RESPONSE; + + +// Could use RequestResponse subproto +global protocol Http(role C, role S) +{ + REQUEST from C to S; + RESPONSE from S to C; +} diff --git a/scribble-demos/scrib/http/src/http/shortvers/HttpShortC.java b/scribble-demos/scrib/http/src/http/shortvers/HttpShortC.java new file mode 100644 index 000000000..d863860e1 --- /dev/null +++ b/scribble-demos/scrib/http/src/http/shortvers/HttpShortC.java @@ -0,0 +1,61 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package http.shortvers; + +import static http.shortvers.HttpShort.Http.Http.C; +import static http.shortvers.HttpShort.Http.Http.RESPONSE; +import static http.shortvers.HttpShort.Http.Http.S; + +import org.scribble.runtime.util.Buf; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.net.SocketChannelEndpoint; + +import http.shortvers.HttpShort.Http.Http; +import http.shortvers.HttpShort.Http.statechans.C.Http_C_1; +import http.shortvers.HttpShort.Http.roles.C; +import http.shortvers.message.HttpShortMessageFormatter; +import http.shortvers.message.client.Request; +import http.shortvers.message.server.Response; + +public class HttpShortC +{ + public HttpShortC() throws Exception + { + run(); + } + + public static void main(String[] args) throws Exception + { + new HttpShortC(); + } + + public void run() throws Exception + { + Http http = new Http(); + try (MPSTEndpoint client = new MPSTEndpoint<>(http, C, new HttpShortMessageFormatter())) + { + String host = "example.com"; int port = 80; String file = "/"; + //String host = "localhost"; int port = 8080; String file = "/"; + + client.request(S, SocketChannelEndpoint::new, host, port); + + Buf buf = new Buf<>(); + new Http_C_1(client) + .send(S, new Request(file, "1.1", host)) + .receive(S, RESPONSE, buf); + + System.out.println("Response:\n" + buf.val); + } + } +} diff --git a/scribble-demos/scrib/http/src/http/shortvers/HttpShortS.java b/scribble-demos/scrib/http/src/http/shortvers/HttpShortS.java new file mode 100644 index 000000000..03161daf1 --- /dev/null +++ b/scribble-demos/scrib/http/src/http/shortvers/HttpShortS.java @@ -0,0 +1,69 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package http.shortvers; + +import static http.shortvers.HttpShort.Http.Http.C; +import static http.shortvers.HttpShort.Http.Http.REQUEST; +import static http.shortvers.HttpShort.Http.Http.S; + +import java.io.IOException; + +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.net.SocketChannelServer; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import http.shortvers.HttpShort.Http.Http; +import http.shortvers.HttpShort.Http.roles.S; +import http.shortvers.HttpShort.Http.statechans.S.Http_S_1; +import http.shortvers.HttpShort.Http.statechans.S.Http_S_2; +import http.shortvers.message.HttpShortMessageFormatter; +import http.shortvers.message.client.Request; +import http.shortvers.message.server.Response; + +public class HttpShortS +{ + public HttpShortS() + { + + } + + public static void main(String[] args) throws IOException + { + try (ScribServerSocket ss = new SocketChannelServer(8080)) + { + while (true) + { + Http http = new Http(); + try (MPSTEndpoint se = new MPSTEndpoint<>(http, S, + new HttpShortMessageFormatter())) + { + se.accept(ss, C); + + Buf buf = new Buf<>(); + Http_S_2 s2 = new Http_S_1(se).receive(C, REQUEST, buf); + + System.out.println("Request:\n" + buf.val); + + s2.send(C, new Response("1.1", "Hello")); + } + catch (IOException | ClassNotFoundException | ScribRuntimeException e) + { + e.printStackTrace(); + } + } + } + } +} diff --git a/scribble-demos/scrib/http/src/http/shortvers/message/HttpShortMessage.java b/scribble-demos/scrib/http/src/http/shortvers/message/HttpShortMessage.java new file mode 100644 index 000000000..7c452ff0f --- /dev/null +++ b/scribble-demos/scrib/http/src/http/shortvers/message/HttpShortMessage.java @@ -0,0 +1,67 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package http.shortvers.message; + +import org.scribble.runtime.message.ScribMessage; +import org.scribble.core.type.name.Op; + +import http.shortvers.HttpShort.Http.Http; + +public abstract class HttpShortMessage extends ScribMessage +{ + private static final long serialVersionUID = 1L; + + public static final String GET = "GET"; + public static final String HTTP = "HTTP"; + + public static final String CRLF = "\r\n"; + + public HttpShortMessage(Op op, String m) + { + super(op, m); + } + + public String getHeadersAndBody() + { + return (this.payload.length == 0) ? "" : (String) this.payload[0]; + } + + public byte[] toBytes() + { + // FIXME: factor better with Request/Response (e.g. " " after op, terminal CRLF, etc) + return (getOpString(this.op) + getHeadersAndBody()).getBytes(HttpShortMessageFormatter.cs); // Can give "utf-8" as arg directly + } + + @Override + public String toString() + { + return new String(toBytes()); + } + + protected static String getOpString(Op op) + { + if (op.equals(Http.REQUEST)) + { + return HttpShortMessage.GET; + } + else if (op.equals(Http.RESPONSE)) + { + return HttpShortMessage.HTTP; + } + else + { + throw new RuntimeException("TODO: " + op); + } + } +} diff --git a/scribble-demos/scrib/http/src/http/shortvers/message/HttpShortMessageFormatter.java b/scribble-demos/scrib/http/src/http/shortvers/message/HttpShortMessageFormatter.java new file mode 100644 index 000000000..fe1898a5c --- /dev/null +++ b/scribble-demos/scrib/http/src/http/shortvers/message/HttpShortMessageFormatter.java @@ -0,0 +1,258 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package http.shortvers.message; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.util.Arrays; + +import org.scribble.runtime.message.ScribMessage; +import org.scribble.runtime.message.ScribMessageFormatter; + +import http.shortvers.message.client.Request; +import http.shortvers.message.server.Response; + +public class HttpShortMessageFormatter implements ScribMessageFormatter +{ + public static final Charset cs = Charset.forName("UTF8"); + //private static CharsetDecoder cd = cs.newDecoder(); + + public HttpShortMessageFormatter() + { + + } + + @Override + public byte[] toBytes(ScribMessage m) throws IOException + { + return ((HttpShortMessage) m).toBytes(); + } + + @Override + public ScribMessage fromBytes(ByteBuffer bb) throws IOException, ClassNotFoundException + { + bb.flip(); + int rem = bb.remaining(); + if (rem < 2) + { + bb.compact(); + return null; + } + + String curr = new String(Arrays.copyOf(bb.array(), bb.remaining()), HttpShortMessageFormatter.cs); + String endOfHeaders = HttpShortMessage.CRLF + HttpShortMessage.CRLF; + if (!curr.contains(endOfHeaders)) + { + bb.compact(); + return null; + } + + if (curr.contains(Response.CONTENT_LENGTH)) + { + int eoh = curr.indexOf(endOfHeaders); + if (eoh == -1) + { + bb.compact(); + return null; + } + String contentLenSplit = curr.substring(curr.indexOf(Response.CONTENT_LENGTH)); + int len = Integer.parseInt(contentLenSplit.substring(Response.CONTENT_LENGTH.length()+2, contentLenSplit.indexOf('\r')).trim()); + if (curr.length() < eoh+4) + { + bb.compact(); + return null; + } + String body = curr.substring(eoh+4); + if (body.getBytes(HttpShortMessageFormatter.cs).length < len) + { + bb.compact(); + return null; + } + byte[] bs = new byte[bb.remaining()]; // FIXME: hardcoded Response parsing based on presence of Content-Length + bb.get(bs); + bb.compact(); + return parseResponse(new String(bs, HttpShortMessageFormatter.cs)); + } + else + { + byte[] bs = new byte[bb.remaining()]; + bb.get(bs); + bb.compact(); + return parseRequest(new String(bs, HttpShortMessageFormatter.cs)); // FIXME: assuming empty-body Request if no Content-Length + } + } + + // Assumes no body + private static HttpShortMessage parseRequest(String msg) + { + String get = null; + String http = null; + String host = null; + String userA = null; + String accept = null; + String acceptL = null; + String acceptE = null; + String dnt = null; + String connection = null; + String upgradeIR = null; + String cookie = null; + + for (boolean eoh = false; !eoh; ) + { + //if (msg.startsWith(HttpMessage.CRLF + HttpMessage.CRLF)) + if (msg.startsWith(HttpShortMessage.CRLF)) // First CRLF already trimmed after last header + { + eoh = true; + //msg = msg.substring(4); + msg = msg.substring(2); + break; + } + + msg = msg.replace("\\A\\s+", ""); + int i = msg.indexOf(":"); + if (i == -1) + { + throw new RuntimeException("Shouldn't get in here: " + msg); + } + if (msg.startsWith(HttpShortMessage.GET)) // FIXME + { + int j = msg.indexOf(' '); + get = msg.substring(j+1, msg.indexOf(' ', j+1)).trim(); + j = msg.indexOf('\r'); + http = msg.substring(msg.indexOf('/')+1, j).trim(); + msg = msg.substring(j+2); + } + else + { + String header = msg.substring(0, i); + int j = msg.indexOf("\r"); + switch (header) // FIXME: duplicates not checked + { + case Request.HOST: host = msg.substring(i+1, j).trim(); break; + case Request.USER_AGENT: userA = msg.substring(i+1, j).trim(); break; + case Request.ACCEPT: accept = msg.substring(i+1, j).trim(); break; + case Request.ACCEPT_LANGUAGE: acceptL = msg.substring(i+1, j).trim(); break; + case Request.ACCEPT_ENCODING: acceptE = msg.substring(i+1, j).trim(); break; + case Request.DO_NOT_TRACK: dnt = msg.substring(i+1, j).trim(); break; + case Request.CONNECTION: connection = msg.substring(i+1, j).trim(); break; + case Request.UPGRADE_INSECURE_REQUESTS: upgradeIR = msg.substring(i+1, j).trim(); break; + case Request.COOKIE: cookie = msg.substring(i+1, j).trim(); break; + default: { + //throw new RuntimeException("Cannot parse header field: " + msg.substring(0, j)); + System.err.println("Cannot parse header field, attempting to skip: " + msg.substring(0, j)); + } + } + msg = msg.substring(j+2); + } + } + if (!msg.isEmpty()) + { + throw new RuntimeException("Shouldn't get in here: " + msg); + } + return new Request(get, http, host, userA, accept, acceptL, acceptE, dnt, connection, upgradeIR, cookie); + } + + private static HttpShortMessage parseResponse(String msg) + { + String httpv = null; + String ack = null; + String date = null; + String server = null; + String strictTS = null; + String lastMod = null; + String eTag = null; + String acceptR = null; + String contentL = null; + String vary = null; + String contentT = null; + String via = null; + String body = null; + + for (boolean eoh = false; !eoh; ) + { + //if (msg.startsWith(HttpMessage.CRLF + HttpMessage.CRLF)) + if (msg.startsWith(HttpShortMessage.CRLF)) // First CRLF already trimmed after last header + { + eoh = true; + //msg = msg.substring(4); + msg = msg.substring(2); + break; + } + + msg = msg.trim(); + int i = msg.indexOf(":"); + if (i == -1) + { + throw new RuntimeException("Shouldn't get in here: " + msg); + } + if (msg.startsWith(HttpShortMessage.HTTP)) // FIXME + { + int j = msg.indexOf(' '); + httpv = msg.substring(msg.indexOf('/')+1, j); + + int k = msg.indexOf('\r'); + ack = msg.substring(j+1, k); + /*if (!ack.equals("200 OK")) + { + if (!ack.startsWith("404")) + { + throw new RuntimeException("[TODO]: " + msg); + } + } + ack = "OK"; // Hardcoded*/ + msg = msg.substring(k+2); + } + else + { + String header = msg.substring(0, i); + int j = msg.indexOf("\r"); + switch (header) + { + case Response.DATE: date = msg.substring(i+1, j).trim(); break; + case Response.SERVER: server = msg.substring(i+1, j).trim(); break; + case Response.STRICT_TRANSPORT_SECURITY: strictTS = msg.substring(i+1, j).trim(); break; + case Response.LAST_MODIFIED: lastMod = msg.substring(i+1, j).trim(); break; + case Response.ETAG: eTag = msg.substring(i+1, j).trim(); break; + case Response.ACCEPT_RANGES: acceptR = msg.substring(i+1, j).trim(); break; + case Response.CONTENT_LENGTH: contentL = msg.substring(i+1, j).trim(); break; + case Response.VARY: vary = msg.substring(i+1, j).trim(); break; + case Response.CONTENT_TYPE: contentT = msg.substring(i+1, j).trim(); break; + case Response.VIA: via = msg.substring(i+1, j).trim(); break; + default: + //throw new RuntimeException("Cannot parse header field: " + msg.substring(0, msg.indexOf('\r'))); + System.err.println("[Warning] Attempting to skip over response field: " + header + "\n" + msg.substring(i+1, j).trim()); + } + msg = msg.substring(j+2); + } + } + body = msg; + return new Response(httpv, ack, date, server, strictTS, lastMod, eTag, acceptR, contentL, vary, contentT, via, body); + } + + // FIXME: delete + @Deprecated @Override + public void writeMessage(DataOutputStream dos, ScribMessage m) throws IOException + { + throw new RuntimeException("Shouldn't get in here: " + m); + } + + @Deprecated @Override + public ScribMessage readMessage(DataInputStream dis) throws IOException + { + throw new RuntimeException("Shouldn't get in here: "); + } +} diff --git a/scribble-demos/scrib/http/src/http/shortvers/message/client/Request.java b/scribble-demos/scrib/http/src/http/shortvers/message/client/Request.java new file mode 100644 index 000000000..611077482 --- /dev/null +++ b/scribble-demos/scrib/http/src/http/shortvers/message/client/Request.java @@ -0,0 +1,63 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package http.shortvers.message.client; + +import http.shortvers.HttpShort.Http.Http; +import http.shortvers.message.HttpShortMessage; + +public class Request extends HttpShortMessage +{ + private static final long serialVersionUID = 1L; + + //public static final String GET = "GET"; + //public static final String HTTP = "HTTP"; + public static final String HOST = "Host"; + + public static final String USER_AGENT = "User-Agent"; + public static final String ACCEPT = "Accept"; + public static final String ACCEPT_LANGUAGE = "Accept-Language"; + public static final String ACCEPT_ENCODING = "Accept-Encoding"; + public static final String DO_NOT_TRACK = "DNT"; + public static final String CONNECTION = "Connection"; + public static final String UPGRADE_INSECURE_REQUESTS = "Upgrade-Insecure-Requests"; + public static final String COOKIE = "Cookie"; + + public Request(String get, String http, String host, String userA, String accept, String acceptL, String acceptE, String dnt, String connection, String upgradeIR, String cookie) + { + super(Http.REQUEST, getHeadersAndBody(get, http, host, userA, accept, acceptL, acceptE, dnt, connection, upgradeIR, cookie)); + } + + /*GET /~rhu/ HTTP/1.1 + host: www.doc.ic.ac.uk*/ + public Request(String get, String http, String host) + { + this(get, http, host, null, null, null, null, null, null, null, null); + } + + // Empty body + protected static String getHeadersAndBody(String get, String http, String host, String userA, String accept, String acceptL, String acceptE, String dnt, String connection, String upgradeIR, String cookie) { + return " " + + get + " " + HttpShortMessage.HTTP + "/" + http + HttpShortMessage.CRLF + + Request.HOST + ": " + host + HttpShortMessage.CRLF + + ((userA == null) ? "" : Request.USER_AGENT + ": " + userA + HttpShortMessage.CRLF) + + ((accept == null) ? "" : Request.ACCEPT + ": " + accept + HttpShortMessage.CRLF) + + ((acceptL == null) ? "" : Request.ACCEPT_LANGUAGE + ": " + acceptL + HttpShortMessage.CRLF) + + ((acceptE == null) ? "" : Request.ACCEPT_ENCODING + ": " + acceptE + HttpShortMessage.CRLF) + + ((dnt == null) ? "" : Request.DO_NOT_TRACK + ": " + dnt + HttpShortMessage.CRLF) + + ((connection == null) ? "" : Request.CONNECTION + ": " + connection + HttpShortMessage.CRLF) + + ((upgradeIR == null) ? "" : Request.UPGRADE_INSECURE_REQUESTS + ": " + upgradeIR + HttpShortMessage.CRLF) + + ((cookie == null) ? "" : Request.COOKIE + ": " + cookie + HttpShortMessage.CRLF) + + "" + HttpShortMessage.CRLF; // Empty body + } +} diff --git a/scribble-demos/scrib/http/src/http/shortvers/message/server/Response.java b/scribble-demos/scrib/http/src/http/shortvers/message/server/Response.java new file mode 100644 index 000000000..19b1a9373 --- /dev/null +++ b/scribble-demos/scrib/http/src/http/shortvers/message/server/Response.java @@ -0,0 +1,98 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package http.shortvers.message.server; + +import http.shortvers.HttpShort.Http.Http; +import http.shortvers.message.HttpShortMessage; + +public class Response extends HttpShortMessage +{ + private static final long serialVersionUID = 1L; + + public static final String DATE = "Date"; + public static final String CONTENT_TYPE = "Content-Type"; + public static final String _404 = "404"; + public static final String _200 = "200"; + public static final String ACCEPT_RANGES = "Accept-Ranges"; + public static final String LAST_MODIFIED = "Last-Modified"; + public static final String VARY = "Vary"; + public static final String SERVER = "Server"; + public static final String STRICT_TRANSPORT_SECURITY = "Strict-Transport-Security"; + public static final String VIA = "Via"; + public static final String ETAG = "ETag"; + public static final String CONTENT_LENGTH = "Content-Length"; + + /*HTTP/1.1 200 OK + Date: Mon, 13 Jun 2016 19:42:34 GMT + Server: Apache + Strict-Transport-Security: max-age=31536000; preload; includeSubDomains + Strict-Transport-Security: max-age=31536000; preload; includeSubDomains // BUG? (Apache configuration) + Last-Modified: Thu, 14 Apr 2016 12:46:24 GMT + ETag: "74a-53071482f6e0f" + Accept-Ranges: bytes + Content-Length: 1866 + Vary: Accept-Encoding + Content-Type: text/html + Via: 1.1 www.doc.ic.ac.uk*/ + public Response(String httpv, String ack, String date, String server, String strictTS, String lastMod, + String eTag, String acceptR, String contentL, String vary, String contentT, String via, String body) + { + super(Http.RESPONSE, getHeadersAndBody( + httpv, ack, date, server, strictTS, lastMod, eTag, acceptR, contentL, vary, contentT, via, body)); + } + + /*public Response(String httpv, String ack, String contentL, String body) + { + super(Http.RESPONSE, getHeadersAndBody(httpv, ack, contentL, body)); + }*/ + + public Response(String httpv, String body) + { + this(httpv, Response._200 + " OK", null, null, null, null, null, null, Integer.toString(body.length()), null, null, null, body); + } + + // ack includes "op", e.g. 200, 404, ... + protected static String getHeadersAndBody(String httpv, String ack, String date, String server, String strictTS, String lastMod, + String eTag, String acceptR, String contentL, String vary, String contentT, String via, String body) + { + if (!ack.startsWith(Response._200) && !ack.startsWith(Response._404)) + { + throw new RuntimeException("[TODO]: " + ack); + } + return "/" + httpv + " " + + ack + HttpShortMessage.CRLF // Hardcoded + + ((date == null) ? "" : Response.DATE + ": " + date + HttpShortMessage.CRLF) + + ((server == null) ? "" : Response.SERVER + ": " + server + HttpShortMessage.CRLF) + + ((strictTS == null) ? "" : Response.STRICT_TRANSPORT_SECURITY + ": " + strictTS + HttpShortMessage.CRLF) + + ((lastMod == null) ? "" : Response.LAST_MODIFIED + ": " + lastMod + HttpShortMessage.CRLF) + + ((eTag == null) ? "" : Response.ETAG + ": " + eTag + HttpShortMessage.CRLF) + + ((acceptR == null) ? "" : Response.ACCEPT_RANGES + ": " + acceptR + HttpShortMessage.CRLF) + + Response.CONTENT_LENGTH + ": " + contentL + HttpShortMessage.CRLF + + ((vary == null) ? "" : Response.VARY + ": " + vary + HttpShortMessage.CRLF) + + ((contentT == null) ? "" : Response.CONTENT_TYPE + ": " + contentT + HttpShortMessage.CRLF) + + ((via == null) ? "" : Response.VIA + ": " + via + HttpShortMessage.CRLF) + + HttpShortMessage.CRLF // Empty line for end of headers + + body + HttpShortMessage.CRLF; + } + + /*// 404 + protected static String getHeadersAndBody(String httpv, String ack, String contentL, String body) + { + return "/" + httpv + " " + + _404 + ack + HttpMessage.CRLF // Hardcoded + + Response.CONTENT_LENGTH + ": " + contentL + HttpMessage.CRLF + + HttpMessage.CRLF // Empty line for end of headers + + body + HttpMessage.CRLF; + }*/ +} diff --git a/scribble-demos/scrib/loan/src/loan/LoanApplicant.java b/scribble-demos/scrib/loan/src/loan/LoanApplicant.java new file mode 100644 index 000000000..39d3b0df9 --- /dev/null +++ b/scribble-demos/scrib/loan/src/loan/LoanApplicant.java @@ -0,0 +1,62 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package loan; + +import static loan.LoanApplication.BuyerBrokerSupplier.BuyerBrokerSupplier.Applicant; +import static loan.LoanApplication.BuyerBrokerSupplier.BuyerBrokerSupplier.ApplicationPortal; +import static loan.LoanApplication.BuyerBrokerSupplier.BuyerBrokerSupplier.applyForLoan; +import static loan.LoanApplication.BuyerBrokerSupplier.BuyerBrokerSupplier.reject; +import static loan.LoanApplication.BuyerBrokerSupplier.BuyerBrokerSupplier.requestConfirmation; + +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import loan.LoanApplication.BuyerBrokerSupplier.BuyerBrokerSupplier; +import loan.LoanApplication.BuyerBrokerSupplier.roles.Applicant; +import loan.LoanApplication.BuyerBrokerSupplier.statechans.Applicant.BuyerBrokerSupplier_Applicant_1; +import loan.LoanApplication.BuyerBrokerSupplier.statechans.Applicant.BuyerBrokerSupplier_Applicant_2_Cases; + +public class LoanApplicant +{ + public static void main(String[] args) throws Exception + { + BuyerBrokerSupplier sess = new BuyerBrokerSupplier(); + try (MPSTEndpoint se + = new MPSTEndpoint<>(sess, Applicant, new ObjectStreamFormatter())) + { + se.request(ApplicationPortal, SocketChannelEndpoint::new, "localhost", 8888); + + BuyerBrokerSupplier_Applicant_2_Cases branch + = new BuyerBrokerSupplier_Applicant_1(se) + .send(ApplicationPortal, applyForLoan, "Name", "DoB", 123, 456) + .branch(ApplicationPortal); + switch (branch.getOp()) + { + case reject: + { + branch.receive(reject); + break; + } + case requestConfirmation: + { + Buf b = new Buf<>(); + branch.receive(requestConfirmation, b); + break; + } + } + } + } +} diff --git a/scribble-demos/scrib/loan/src/loan/LoanApplication.scr b/scribble-demos/scrib/loan/src/loan/LoanApplication.scr new file mode 100644 index 000000000..b6beab53c --- /dev/null +++ b/scribble-demos/scrib/loan/src/loan/LoanApplication.scr @@ -0,0 +1,70 @@ +//$ ./scribblec.sh -ip scribble-demos/scrib/loan/src -d scribble-demos/scrib/loan/src scribble-demos/scrib/loan/src/loan/LoanApplication.scr -api BuyerBrokerSupplier Applicant +//$ javadoc -cp scribble-core/target/classes:scribble-runtime/target/classes:scribble-demos/scrib/loan/src scribble-demos/scrib/loan/src/loan/*.java -subpackages loan.LoanApplication.BuyerBrokerSupplier -d scribble-demos/scrib/loan/javadoc + +module loan.LoanApplication; + +/*data "CustomerName" from "CustomerName.xsd" as CustomerName; +data "DateOfBirth" from "DateOfBirth.xsd" as DateOfBirth; +data "AnnualSalary" from "AnnualSalary.xsd" as AnnualSalary; +data "CreditRating" from "CreditRating.xsd" as CreditRating; +data "LoanAmount" from "LoanAmount.xsd" as LoanAmount; +data "Approval" from "Approval.xsd" as Approval;*/ + +data "java.lang.Integer" from "rt.jar" as Int; +data "java.lang.String" from "rt.jar" as String; +data "java.lang.Boolean" from "rt.jar" as Bool; + +global protocol BuyerBrokerSupplier(role Applicant, role ApplicationPortal, role ProcessingDept, role FinanceDept) +{ + /*applyForLoan(CustomerName, DateOfBirth, AnnualSalary, CreditRating) from Applicant to ApplicationPortal; + checkEligibility(CustomerName, DateOfBirth, AnnualSalary, CreditRating) from ApplicationPortal to ProcessingDept; + respond(Approval) from ProcessingDept to ApplicationPortal;*/ + applyForLoan(String, String, Int, Int) from Applicant to ApplicationPortal; + checkEligibility(String, String, Int, Int) from ApplicationPortal to ProcessingDept; + respond(Bool) from ProcessingDept to ApplicationPortal; + + choice at ApplicationPortal + { + // "Approval" scenario + /*getLoanAmount(AnnualSalary) from ApplicationPortal to FinanceDept; + sendLoanAmount(LoanAmount) from FinanceDept to ApplicationPortal; + requestConfirmation(LoanAmount) from ApplicationPortal to Applicant;*/ + getLoanAmount(Int) from ApplicationPortal to FinanceDept; + sendLoanAmount(Int) from FinanceDept to ApplicationPortal; + requestConfirmation(Int) from ApplicationPortal to Applicant; + } + or + { + // "Reject" scenario + reject() from ApplicationPortal to FinanceDept; + reject() from ApplicationPortal to Applicant; + } +} + + +explicit global protocol BBSOriginal +( + role Applicant, role ApplicationPortal, role ProcessingDept, role FinanceDept +) +{ + connect Applicant to ApplicationPortal; + connect ApplicationPortal to ProcessingDept; + + applyForLoan(String, String, Int, Int) from Applicant to ApplicationPortal; + checkEligibility(String, String, Int, Int) from ApplicationPortal to ProcessingDept; + respond(Bool) from ProcessingDept to ApplicationPortal; + + choice at ApplicationPortal + { + // "Approval" scenario + connect ApplicationPortal to FinanceDept; + getLoanAmount(Int) from ApplicationPortal to FinanceDept; + sendLoanAmount(Int) from FinanceDept to ApplicationPortal; + requestConfirmation(Int) from ApplicationPortal to Applicant; + } + or + { + // "Reject" scenario + reject() from ApplicationPortal to Applicant; + } +} diff --git a/scribble-demos/scrib/loan/src/loan/LoanApplicationPortal.java b/scribble-demos/scrib/loan/src/loan/LoanApplicationPortal.java new file mode 100644 index 000000000..0091a12bc --- /dev/null +++ b/scribble-demos/scrib/loan/src/loan/LoanApplicationPortal.java @@ -0,0 +1,81 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package loan; + +import static loan.LoanApplication.BuyerBrokerSupplier.BuyerBrokerSupplier.Applicant; +import static loan.LoanApplication.BuyerBrokerSupplier.BuyerBrokerSupplier.ApplicationPortal; +import static loan.LoanApplication.BuyerBrokerSupplier.BuyerBrokerSupplier.FinanceDept; +import static loan.LoanApplication.BuyerBrokerSupplier.BuyerBrokerSupplier.ProcessingDept; +import static loan.LoanApplication.BuyerBrokerSupplier.BuyerBrokerSupplier.applyForLoan; +import static loan.LoanApplication.BuyerBrokerSupplier.BuyerBrokerSupplier.checkEligibility; +import static loan.LoanApplication.BuyerBrokerSupplier.BuyerBrokerSupplier.getLoanAmount; +import static loan.LoanApplication.BuyerBrokerSupplier.BuyerBrokerSupplier.reject; +import static loan.LoanApplication.BuyerBrokerSupplier.BuyerBrokerSupplier.requestConfirmation; +import static loan.LoanApplication.BuyerBrokerSupplier.BuyerBrokerSupplier.respond; +import static loan.LoanApplication.BuyerBrokerSupplier.BuyerBrokerSupplier.sendLoanAmount; + +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.net.SocketChannelServer; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import loan.LoanApplication.BuyerBrokerSupplier.BuyerBrokerSupplier; +import loan.LoanApplication.BuyerBrokerSupplier.roles.ApplicationPortal; +import loan.LoanApplication.BuyerBrokerSupplier.statechans.ApplicationPortal.BuyerBrokerSupplier_ApplicationPortal_1; +import loan.LoanApplication.BuyerBrokerSupplier.statechans.ApplicationPortal.BuyerBrokerSupplier_ApplicationPortal_4; + +public class LoanApplicationPortal +{ + public static void main(String[] args) throws Exception + { + BuyerBrokerSupplier sess = new BuyerBrokerSupplier(); + try ( + ScribServerSocket ss = new SocketChannelServer(8888); + MPSTEndpoint se + = new MPSTEndpoint<>(sess, ApplicationPortal, + new ObjectStreamFormatter())) + { + se.accept(ss, Applicant); + se.request(ProcessingDept, SocketChannelEndpoint::new, "localhost", 7777); + se.request(FinanceDept, SocketChannelEndpoint::new, "localhost", 9999); + + Buf customerName = new Buf<>(); + Buf dateOfBirth = new Buf<>(); + Buf annualSalary = new Buf<>(); + Buf creditRating = new Buf<>(); + Buf response = new Buf<>(); + BuyerBrokerSupplier_ApplicationPortal_4 s4 + = new BuyerBrokerSupplier_ApplicationPortal_1(se) + .receive(Applicant, applyForLoan, customerName, dateOfBirth, + annualSalary, creditRating) + .send(ProcessingDept, checkEligibility, customerName.val, + dateOfBirth.val, annualSalary.val, creditRating.val) + .receive(ProcessingDept, respond, response); + if (response.val) + { + Buf loan = new Buf<>(); + s4.send(FinanceDept, getLoanAmount, 789) + .receive(FinanceDept, sendLoanAmount, loan) + .send(Applicant, requestConfirmation, loan.val); + } + else + { + s4.send(FinanceDept, reject) + .send(Applicant, reject); + } + } + } +} diff --git a/scribble-demos/scrib/loan/src/loan/LoanFinanceDept.java b/scribble-demos/scrib/loan/src/loan/LoanFinanceDept.java new file mode 100644 index 000000000..ef5aae496 --- /dev/null +++ b/scribble-demos/scrib/loan/src/loan/LoanFinanceDept.java @@ -0,0 +1,65 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package loan; + +import static loan.LoanApplication.BuyerBrokerSupplier.BuyerBrokerSupplier.ApplicationPortal; +import static loan.LoanApplication.BuyerBrokerSupplier.BuyerBrokerSupplier.FinanceDept; +import static loan.LoanApplication.BuyerBrokerSupplier.BuyerBrokerSupplier.getLoanAmount; +import static loan.LoanApplication.BuyerBrokerSupplier.BuyerBrokerSupplier.reject; +import static loan.LoanApplication.BuyerBrokerSupplier.BuyerBrokerSupplier.sendLoanAmount; + +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.net.SocketChannelServer; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import loan.LoanApplication.BuyerBrokerSupplier.BuyerBrokerSupplier; +import loan.LoanApplication.BuyerBrokerSupplier.roles.FinanceDept; +import loan.LoanApplication.BuyerBrokerSupplier.statechans.FinanceDept.BuyerBrokerSupplier_FinanceDept_1; +import loan.LoanApplication.BuyerBrokerSupplier.statechans.FinanceDept.BuyerBrokerSupplier_FinanceDept_1_Cases; + +public class LoanFinanceDept +{ + public static void main(String[] args) throws Exception + { + BuyerBrokerSupplier sess = new BuyerBrokerSupplier(); + try ( + ScribServerSocket ss = new SocketChannelServer(9999); + MPSTEndpoint se + = new MPSTEndpoint<>(sess, FinanceDept, new ObjectStreamFormatter())) + { + se.accept(ss, ApplicationPortal); + + BuyerBrokerSupplier_FinanceDept_1_Cases branch + = new BuyerBrokerSupplier_FinanceDept_1(se).branch(ApplicationPortal); + switch (branch.getOp()) + { + case getLoanAmount: + { + Buf loan = new Buf<>(); + branch + .receive(ApplicationPortal, getLoanAmount, loan) + .send(ApplicationPortal, sendLoanAmount, loan.val); + break; + } + case reject: + { + branch.receive(ApplicationPortal, reject); + break; + } + } + } + } +} diff --git a/scribble-demos/scrib/loan/src/loan/LoanProcessingDept.java b/scribble-demos/scrib/loan/src/loan/LoanProcessingDept.java new file mode 100644 index 000000000..800b613cc --- /dev/null +++ b/scribble-demos/scrib/loan/src/loan/LoanProcessingDept.java @@ -0,0 +1,54 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package loan; + +import static loan.LoanApplication.BuyerBrokerSupplier.BuyerBrokerSupplier.ApplicationPortal; +import static loan.LoanApplication.BuyerBrokerSupplier.BuyerBrokerSupplier.ProcessingDept; +import static loan.LoanApplication.BuyerBrokerSupplier.BuyerBrokerSupplier.checkEligibility; +import static loan.LoanApplication.BuyerBrokerSupplier.BuyerBrokerSupplier.respond; + +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.net.SocketChannelServer; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import loan.LoanApplication.BuyerBrokerSupplier.BuyerBrokerSupplier; +import loan.LoanApplication.BuyerBrokerSupplier.roles.ProcessingDept; +import loan.LoanApplication.BuyerBrokerSupplier.statechans.ProcessingDept.BuyerBrokerSupplier_ProcessingDept_1; + +public class LoanProcessingDept +{ + public static void main(String[] args) throws Exception + { + BuyerBrokerSupplier sess = new BuyerBrokerSupplier(); + try ( + ScribServerSocket ss = new SocketChannelServer(7777); + MPSTEndpoint se + = new MPSTEndpoint<>(sess, ProcessingDept, + new ObjectStreamFormatter())) + { + se.accept(ss, ApplicationPortal); + + Buf customerName = new Buf<>(); + Buf dateOfBirth = new Buf<>(); + Buf annualSalary = new Buf<>(); + Buf creditRating = new Buf<>(); + new BuyerBrokerSupplier_ProcessingDept_1(se) + .receive(ApplicationPortal, checkEligibility, customerName, + dateOfBirth, annualSalary, creditRating) + .send(ApplicationPortal, respond, true); + } + } +} diff --git a/scribble-demos/scrib/nego/src/nego/Nego1.scr b/scribble-demos/scrib/nego/src/nego/Nego1.scr new file mode 100644 index 000000000..081ac337c --- /dev/null +++ b/scribble-demos/scrib/nego/src/nego/Nego1.scr @@ -0,0 +1,42 @@ +//$ ./scribblec.sh -ip scribble-demos/scrib/nego/src -d scribble-demos/scrib/nego/src scribble-demos/scrib/nego/src/nego/Nego1.scr + +module nego.Nego1; + +data "test.nego.SAP" from "test/nego/SAP.java" as SAP; + +// C = Consumer, P = Producer +global protocol Negotiate(role C, role P) +{ + propose(SAP) from C to P; + rec X + { + choice at P + { + accpt() from P to C; + confirm() from C to P; + } + or + { + reject() from P to C; + } + or + { + propose(SAP) from P to C; + choice at C + { + accpt() from C to P; + confirm() from P to C; + } + or + { + reject() from C to P; + } + or + { + propose(SAP) from C to P; + continue X; + } + } + } +} + diff --git a/scribble-demos/scrib/nego/src/nego/Nego2.scr b/scribble-demos/scrib/nego/src/nego/Nego2.scr new file mode 100644 index 000000000..132f1c3a8 --- /dev/null +++ b/scribble-demos/scrib/nego/src/nego/Nego2.scr @@ -0,0 +1,30 @@ +//$ ./scribblec.sh -ip scribble-demos/scrib/nego/src -d scribble-demos/scrib/nego/src scribble-demos/scrib/nego/src/nego/Nego2.scr + +module demo.nego.Nego2; + +data "test.nego.SAP" from "test/nego/SAP.java" as SAP; + +// C = Consumer, P = Producer +global protocol Negotiate(role C, role P) +{ + propose(SAP) from C to P; + do NegotiateAux(P, C); +} + +aux global protocol NegotiateAux(role A, role B) +{ + choice at A + { + accpt() from A to B; + confirm() from B to A; + } + or + { + reject() from A to B; + } + or + { + propose(SAP) from A to B; + do NegotiateAux(B, A); + } +} diff --git a/scribble-demos/scrib/nego/src/nego/Nego3.scr b/scribble-demos/scrib/nego/src/nego/Nego3.scr new file mode 100644 index 000000000..83e3e65d8 --- /dev/null +++ b/scribble-demos/scrib/nego/src/nego/Nego3.scr @@ -0,0 +1,24 @@ +//$ ./scribblec.sh -ip scribble-demos/scrib/nego/src -d scribble-demos/scrib/nego/src scribble-demos/scrib/nego/src/nego/Nego3.scr + +module demo.nego.Nego3; + +data "test.nego.SAP" from "test/nego/SAP.java" as SAP; + +// C = Consumer, P = Producer +global protocol Negotiate(role C, role P) +{ + propose(SAP) from C to P; + choice at P + { + accpt() from P to C; + confirm() from C to P; + } + or + { + reject() from P to C; + } + or + { + do Negotiate(P, C); + } +} diff --git a/scribble-demos/scrib/rpc/src/rpc/RPC.scr b/scribble-demos/scrib/rpc/src/rpc/RPC.scr new file mode 100644 index 000000000..8f41ff0a3 --- /dev/null +++ b/scribble-demos/scrib/rpc/src/rpc/RPC.scr @@ -0,0 +1,88 @@ +//$ ./scribblec.sh -ip modules/demos/scrib/rpc/src -d scribble-demos/scrib/src/rpc scribble-demos/scrib/rpc/src/rpc/RPC.scr + +module rpc.RPC; + + +global protocol Proto(role C, role S1, role S2, role S3) +{ + 1() from C to S1; + 2() from S1 to S2; + 2a() from S2 to S1; + 3() from S1 to S3; + 3a() from S3 to S1; + 1a() from S1 to C; +} + + +global protocol RPC(role C, role S) +{ + M1 from C to S; + M2 from S to C; +} + +global protocol RPCComp(role C, role S1, role S2, role S3) +{ + 1() from C to S1; + do RPC<2(), 2a()>(S1, S2); + do RPC<3(), 3a()>(S1, S3); + 1a() from S1 to C; +} + + +global protocol Relay(role R1, role R2, role R3) +{ + M1 from R1 to R2; + M2 from R2 to R3; +} + +global protocol RPCComp2(role C, role S1, role S2, role S3) +{ + do Relay<1(), 2()>(C, S1, S2); + do Relay<2a(), 3()>(S2, S1, S3); + do Relay<3a(), 1a()>(S3, S1, C); +} + +global protocol MyRelay(role A, role B, role C) +{ + do Relay(A, B, C); +} + + +/*global protocol RPC2(role C, role S) +{ + do Relay(C, S, C); // FIXME: +} + +global protocol RPCComp3(role C, role S1, role S2, role S3) +{ + 1() from C to S1; + do RPC2<2(), 2a()>(S1, S2); + do RPC2<3(), 3a()>(S1, S3); + 1a() from S1 to C; +}*/ + + + + + + + +/*global protocol MessageTransfer(role A, role B) +{ + X from A to B; +} + +global protocol Test(role A, role B, role C) +{ + choice at A + { + do MessageTransfer<1()>(A, B); + do MessageTransfer<1()>(B, C); + do Test(A, B, C); + } + or + { + do MessageTransfer<2()>(A, B); + do MessageTransfer<2()>(B, C); + } +}*/ diff --git a/scribble-demos/scrib/smtp/src/smtp/EraserThread.java b/scribble-demos/scrib/smtp/src/smtp/EraserThread.java new file mode 100644 index 000000000..a8d87f980 --- /dev/null +++ b/scribble-demos/scrib/smtp/src/smtp/EraserThread.java @@ -0,0 +1,40 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package smtp; + +public class EraserThread extends Thread +{ + private boolean stop = true; + + public void run() + { + try + { + while (this.stop) + { + System.out.print("\010 "); + Thread.sleep(1); + } + } + catch (InterruptedException e) + { + throw new RuntimeException(e); + } + } + + public void stopMasking() + { + this.stop = false; + } +} diff --git a/scribble-demos/scrib/smtp/src/smtp/SimpleSmtpC.java b/scribble-demos/scrib/smtp/src/smtp/SimpleSmtpC.java new file mode 100644 index 000000000..8fb895f42 --- /dev/null +++ b/scribble-demos/scrib/smtp/src/smtp/SimpleSmtpC.java @@ -0,0 +1,296 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +//$ java -cp scribble-runtime/target/classes/:scribble-core/target/classes:scribble-demos/target/classes smtp.SimpleSmtpC + + +package smtp; + +import static smtp.Smtp.Smtp.Smtp.C; +import static smtp.Smtp.Smtp.Smtp.S; +import static smtp.Smtp.Smtp.Smtp._220; +import static smtp.Smtp.Smtp.Smtp._221; +import static smtp.Smtp.Smtp.Smtp._235; +import static smtp.Smtp.Smtp.Smtp._250; +import static smtp.Smtp.Smtp.Smtp._250d; +import static smtp.Smtp.Smtp.Smtp._354; +import static smtp.Smtp.Smtp.Smtp._501; +import static smtp.Smtp.Smtp.Smtp._535; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.Base64; + +import org.scribble.runtime.net.SSLSocketChannelWrapper; +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.statechans.LinearSocket; +import org.scribble.runtime.util.Buf; + +import smtp.Smtp.Smtp.Smtp; +import smtp.Smtp.Smtp.statechans.C.Smtp_C_1; +import smtp.Smtp.Smtp.statechans.C.Smtp_C_10; +import smtp.Smtp.Smtp.statechans.C.Smtp_C_11_Cases; +import smtp.Smtp.Smtp.statechans.C.Smtp_C_4; +import smtp.Smtp.Smtp.statechans.C.Smtp_C_6; +import smtp.Smtp.Smtp.statechans.C.Smtp_C_8; +import smtp.Smtp.Smtp.statechans.C.Smtp_C_9_Cases; +import smtp.Smtp.Smtp.statechans.C.ioifaces.Branch_C_S_250__S_250d; +import smtp.Smtp.Smtp.statechans.C.ioifaces.Case_C_S_250__S_250d; +import smtp.Smtp.Smtp.statechans.C.ioifaces.Select_C_S_Ehlo; +import smtp.Smtp.Smtp.statechans.C.ioifaces.Succ_In_S_250; +import smtp.Smtp.Smtp.roles.C; +import smtp.message.SmtpMessageFormatter; +import smtp.message.client.Auth; +import smtp.message.client.Data; +import smtp.message.client.DataLine; +import smtp.message.client.Ehlo; +import smtp.message.client.EndOfData; +import smtp.message.client.Mail; +import smtp.message.client.Quit; +import smtp.message.client.Rcpt; +import smtp.message.client.StartTls; +import smtp.message.client.Subject; + +// NB: needs the -subtypes option in the Endpoint API generation +public class SimpleSmtpC +{ + public SimpleSmtpC() throws Exception + { + run(); + } + + public void run() throws Exception + { + String host = "smtp.cc.ic.ac.uk"; + int port = 25; + + String ehlo = "user.testing.com"; + String mailFrom = "rhu@doc.ic.ac.uk"; // Sender + String rcptTo = mailFrom; + String subj = "test"; + String body = "body"; + + Smtp smtp = new Smtp(); + try (MPSTEndpoint se = new MPSTEndpoint<>(smtp, C, new SmtpMessageFormatter())) + { + se.request(S, SocketChannelEndpoint::new, host, port); + + Smtp_C_11_Cases cases = + doAuth( + doEhlo( + doStartTls( + doEhlo(new Smtp_C_1(se).async(S, _220), ehlo) + ) + , ehlo)) + .send(S, new Mail(mailFrom)) + .branch(S); + switch (cases.getOp()) + { + case _250: + { + cases.receive(_250) + .send(S, new Rcpt(rcptTo)).async(S, _250) + .send(S, new Data()).async(S, _354) + .send(S, new Subject(subj)) + .send(S, new DataLine(body)) + .send(S, new EndOfData()) + .receive(S, _250, new Buf<>()) + .send(S, new Quit()).async(S, _221); + break; + } + case _501: + { + cases.receive(_501).send(S, new Quit()).async(S, _221); + } + } + } + } + + private > + S1 doEhlo(Select_C_S_Ehlo s, String ehlo) throws Exception + { + Branch_C_S_250__S_250d bra = s.send(S, new Ehlo(ehlo)); + while (true) + { + Case_C_S_250__S_250d cases = bra.branch(S); + switch (cases.getOp()) + { + case _250: + { + return cases.receive(_250); + } + case _250d: + { + bra = cases.receive(_250d); + break; + } + } + } + } + + private Smtp_C_6 doStartTls(Smtp_C_4 s4) throws Exception + { + return + LinearSocket.wrapClient( + s4.send(S, new StartTls()) + .async(S, _220) + , S, SSLSocketChannelWrapper::new); + } + + private Smtp_C_10 doAuth(Smtp_C_8 s8) throws Exception + { + Smtp_C_9_Cases s9cases = s8.send(S, new Auth(getAuthPlain())).branch(S); + switch (s9cases.op) + { + case _235: + { + return s9cases.receive(_235); + } + case _535: + { + s9cases.receive(_535).send(S, new Quit()); + System.exit(0); + } + default: // To satisfy Java typing for return + { + throw new RuntimeException("Won't get in here: " + s9cases.op); + } + } + } + + private String getAuthPlain() throws IOException + { + return myGetAuthPlain(); + } + + private static String myGetAuthPlain() throws IOException + { + BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + + String user; + String pw; + + System.out.println("User: "); + user = br.readLine(); + + System.out.println("Password: "); + EraserThread et = new EraserThread(); + et.start(); + pw = br.readLine(); + et.stopMasking(); + + byte[] u = user.getBytes("utf-8"); + byte[] p = pw.getBytes("utf-8"); + byte[] bs = new byte[u.length + p.length + 2]; + System.arraycopy(u, 0, bs, 1, u.length); + System.arraycopy(p, 0, bs, u.length + 2, p.length); + + return Base64.getEncoder().encodeToString(bs); + } + + public static void main(String[] args) throws Exception + { + new SimpleSmtpC(); + } + + + + + /*public void run() throws Exception + { + String host = "smtp.cc.ic.ac.uk"; + int port = 25; + + String ehlo = "user.testing.com"; + String mail = "rhu@doc.ic.ac.uk"; // Sender + String rcpt = "raymond.hu05@imperial.ac.uk"; + String subj = "test"; + String body = "body"; + + Smtp smtp = new Smtp(); + try (SessionEndpoint se = new SessionEndpoint<>(smtp, C, new SmtpMessageFormatter())) + { + se.connect(S, SocketChannelEndpoint::new, host, port); + + Smtp_C_11_Cases cases = + doAuth( + doEhlo( + doStartTls( + //doEhlo(new Smtp_C_1(se).async(S, _220), ehlo).to(Select_C_S_Quit__S_StartTls.cast).to(Smtp_C_4.cast) + doEhlo(new Smtp_C_1(se).async(S, _220), ehlo) + ) + //, ehlo).to(Select_C_S_Auth__S_Quit.cast).to(Smtp_C_8.cast)) + , ehlo)) + .send(S, new Mail(mail)) + .branch(S); + switch (cases.getOp()) + { + case _250: + { + cases.receive(_250) + .send(S, new Rcpt(rcpt)) + .async(S, _250) + .send(S, new Data()) + .async(S, _354) + .send(S, new Subject(subj)) + .send(S, new DataLine(body)) + .send(S, new EndOfData()) + .receive(S, _250, new Buf<>()) + //.async(S, _250) + .send(S, new Quit()); + break; + } + case _501: + { + cases.receive(_501).send(S, new Quit()); + } + } + } + } + + //private Succ_In_S_250 doEhlo(Select_C_S_Ehlo__S_Quit s, String ehlo) throws Exception + //private S doEhlo(Select_C_S_Ehlo__S_Quit, ?> s, String ehlo) throws Exception + // NOTE: needs the -subtypes option + private > + //S1 doEhlo(Select_C_S_Ehlo__S_Quit, ?> s, String ehlo) throws Exception + //S1 doEhlo(Select_C_S_Ehlo__S_Quit s, String ehlo) throws Exception + S1 doEhlo(Select_C_S_Ehlo s, String ehlo) throws Exception + { + //Branch_C_S_250__S_250d bra = s.send(S, new Ehlo(ehlo)).to(Branch_C_S_250__S_250d.cast); + //Branch_C_S_250__S_250d bra = s.send(S, new Ehlo(ehlo)); + Branch_C_S_250__S_250d bra = s.send(S, new Ehlo(ehlo)); + while (true) + { + //Case_C_S_250__S_250d cases = bra.branch(S); + //Case_C_S_250__S_250d cases = bra.branch(S); + Case_C_S_250__S_250d cases = bra.branch(S); + switch (cases.getOp()) + { + case _250: + { + return cases.receive(_250); + } + case _250d: + { + //bra = cases.receive(_250d).to(Branch_C_S_250__S_250d.cast); + //bra = (Branch_C_S_250__S_250d) cases.receive(_250d); + bra = cases.receive(_250d); + break; + } + } + } + }*/ +} diff --git a/scribble-demos/scrib/smtp/src/smtp/Smtp.scr b/scribble-demos/scrib/smtp/src/smtp/Smtp.scr new file mode 100644 index 000000000..5426ebb34 --- /dev/null +++ b/scribble-demos/scrib/smtp/src/smtp/Smtp.scr @@ -0,0 +1,205 @@ +//$ ./scribblec.sh -ip scribble-demos/scrib/smtp/src -d scribble-demos/scrib/smtp/src scribble-demos/scrib/smtp/src/smtp/Smtp.scr -subtypes -api Smtp C +//$ javadoc -cp scribble-core/target/classes:scribble-runtime/target/classes:scribble-demos/scrib/smtp/src/ scribble-demos/scrib/smtp/src/smtp/*.java -subpackages smtp.Smtp.Smtp -d scribble-demos/scrib/smtp/javadoc + + +module smtp.Smtp; + +sig "smtp.message.server._220" + from "smtp/message/server/_220.java" as 220; +sig "smtp.message.server._221" + from "smtp/message/server/_221.java" as 221; +sig "smtp.message.server._250" + from "smtp/message/server/_250.java" as 250; +sig "smtp.message.server._250d" + from "smtp/message/server/_250d.java" as 250d; +sig "smtp.message.server._235" + from "smtp/message/server/_235.java" as 235; +sig "smtp.message.server._535" + from "smtp/message/server/_535.java" as 535; +sig "smtp.message.server._501" + from "smtp/message/server/_501.java" as 501; +sig "smtp.message.server._354" + from "smtp/message/server/_354.java" as 354; + +sig "smtp.message.client.Ehlo" + from "smtp/message/client/Ehlo.java" as Ehlo; +sig "smtp.message.client.StartTls" + from "smtp/message/client/StartTls.java" as StartTls; +sig "smtp.message.client.Auth" + from "smtp/message/client/Auth.java" as Auth; +sig "smtp.message.client.Mail" + from "smtp/message/client/Mail.java" as Mail; +sig "smtp.message.client.Rcpt" + from "smtp/message/client/Rcpt.java" as Rcpt; +sig "smtp.message.client.Subject" + from "smtp/message/client/Subject.java" as Subject; +sig "smtp.message.client.DataLine" + from "smtp/message/client/DataLine.java" as DataLine; +sig "smtp.message.client.Data" + from "smtp/message/client/Data.java" as Data; +sig "smtp.message.client.EndOfData" + from "smtp/message/client/EndOfData.java" as EndOfData; +sig "smtp.message.client.Quit" + from "smtp/message/client/Quit.java" as Quit; + +global protocol Smtp(role S, role C) +{ + 220 from S to C; + do Ehlo(S, C); +} + +aux global protocol Ehlo(role S, role C) +{ + choice at C + { + Ehlo from C to S; + rec X + { + choice at S + { + //250 from S to C; + 250d from S to C; + continue X; + } + or + { + 250 from S to C; + do StartTls(S, C); + } + } + } + or + { + Quit from C to S; + } +} + +aux global protocol StartTls(role S, role C) +{ + choice at C + { + StartTls from C to S; + 220 from S to C; + // Do TLS handshake here: level below the application level protocol (like regular TCP handshake) + do SecureEhlo(S, C); + } + or + { + Quit from C to S; + } +} + +aux global protocol SecureEhlo(role S, role C) +{ + choice at C + { + Ehlo from C to S; + rec X + { + choice at S + { + 250d from S to C; + continue X; + } + or + { + 250 from S to C; + do Auth(S, C); + } + } + } + or + { + Quit from C to S; + } +} + +aux global protocol Auth(role S, role C) +{ + rec Y + { + choice at C + { + Auth from C to S; + choice at S + { + 235 from S to C; + do Mail(S, C); + } + or + { + 535 from S to C; + continue Y; + } + //.. 501 Invalid base64 Data + } + or + { + Quit from C to S; + } + } +} + +aux global protocol Mail(role S, role C) +{ + rec Z1 + { + choice at C + { + Mail from C to S; //Mail from: + choice at S + { + 501 from S to C; + continue Z1; + } + or + { + 250 from S to C; + + rec Z2 + { + choice at C + { + Rcpt from C to S; //Rcpt to: + choice at S + { + 250 from S to C; + continue Z2; + } + } + or + { + Data from C to S; + 354 from S to C; + //too from C to S; //to: + //froom from C to S; //from: + rec Z3 + { + choice at C + { + DataLine from C to S; + continue Z3; + } + or + { + Subject from C to S; //Subject: + continue Z3; + } + or + { + EndOfData from C to S; // CRLF.CRLF + 250 from S to C; + continue Z1; + } + } + } + } + } + } + or + { + Quit from C to S; + 221 from S to C; + } + } +} diff --git a/scribble-demos/scrib/smtp/src/smtp/SmtpC.java b/scribble-demos/scrib/smtp/src/smtp/SmtpC.java new file mode 100644 index 000000000..ff4b1c098 --- /dev/null +++ b/scribble-demos/scrib/smtp/src/smtp/SmtpC.java @@ -0,0 +1,344 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +//$ java -cp scribble-core/target/classes:scribble-runtime/target/classes:scribble-demos/target/classes smtp.SmtpC smtp.cc.ic.ac.uk sender@bar.com recipient@foo.com subj body + + +package smtp; + +import static smtp.Smtp.Smtp.Smtp.C; +import static smtp.Smtp.Smtp.Smtp.S; +import static smtp.Smtp.Smtp.Smtp._220; +import static smtp.Smtp.Smtp.Smtp._221; +import static smtp.Smtp.Smtp.Smtp._235; +import static smtp.Smtp.Smtp.Smtp._250; +import static smtp.Smtp.Smtp.Smtp._250d; +import static smtp.Smtp.Smtp.Smtp._354; +import static smtp.Smtp.Smtp.Smtp._501; +import static smtp.Smtp.Smtp.Smtp._535; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.Base64; + +import org.scribble.runtime.net.SSLSocketChannelWrapper; +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import smtp.Smtp.Smtp.Smtp; +import smtp.Smtp.Smtp.statechans.C.EndSocket; +import smtp.Smtp.Smtp.statechans.C.Smtp_C_1; +import smtp.Smtp.Smtp.statechans.C.Smtp_C_10; +import smtp.Smtp.Smtp.statechans.C.Smtp_C_11_Cases; +import smtp.Smtp.Smtp.statechans.C.Smtp_C_12; +import smtp.Smtp.Smtp.statechans.C.Smtp_C_2; +import smtp.Smtp.Smtp.statechans.C.Smtp_C_3; +import smtp.Smtp.Smtp.statechans.C.Smtp_C_3_Cases; +import smtp.Smtp.Smtp.statechans.C.Smtp_C_4; +import smtp.Smtp.Smtp.statechans.C.Smtp_C_6; +import smtp.Smtp.Smtp.statechans.C.Smtp_C_7; +import smtp.Smtp.Smtp.statechans.C.Smtp_C_7_Cases; +import smtp.Smtp.Smtp.statechans.C.Smtp_C_8; +import smtp.Smtp.Smtp.statechans.C.Smtp_C_9_Cases; +import smtp.Smtp.Smtp.roles.C; +import smtp.message.SmtpMessageFormatter; +import smtp.message.client.Auth; +import smtp.message.client.Data; +import smtp.message.client.DataLine; +import smtp.message.client.Ehlo; +import smtp.message.client.EndOfData; +import smtp.message.client.Mail; +import smtp.message.client.Quit; +import smtp.message.client.Rcpt; +import smtp.message.client.StartTls; +import smtp.message.client.Subject; + +public class SmtpC +{ + private static final int PORT = 25; + + private final String server; // e.g., smtp.cc.ic.ac.uk; + private final String mailFrom; // sender@bar.com + private final String rcptTo; // recipient@foo.com + private final String subj; + private final String body; + + public SmtpC(String server, String mailFrom, String rcptTo, String subj, String body) throws Exception + { + this.server = server; + this.mailFrom = mailFrom; + this.rcptTo = rcptTo; + this.subj = subj; + this.body = body; + + run(); + } + + public static void main(String[] args) throws Exception + { + new SmtpC(args[0], args[1], args[2], args[3], args[4]); + } + + public void run() throws Exception + { + Smtp smtp = new Smtp(); + try (MPSTEndpoint se = + new MPSTEndpoint<>(smtp, C, new SmtpMessageFormatter())) + { + se.request(S, SocketChannelEndpoint::new, this.server, SmtpC.PORT); + + Smtp_C_1 s1 = new Smtp_C_1(se); + Smtp_C_2 s2 = s1.receive(S, _220, new Buf<>()); + + Smtp_C_10 s10 = + doAuth( + doSecureEhlo( + doStartTls( + doEhlo(s2) + ))); + + Smtp_C_11_Cases s11cases = + s10.send(S, new Mail(this.mailFrom)) + .branch(S); + switch (s11cases.op) + { + case _250: + { + sendMail(s11cases.receive(_250)); + break; + } + case _501: + { + s11cases.receive(_501).send(S, new Quit()); + break; + } + } + } + } + + private Smtp_C_4 doEhlo(Smtp_C_2 s2) throws Exception + { + Smtp_C_3 s3 = s2.send(S, new Ehlo("testing1")); + Buf b = new Buf<>(); + while (true) + { + Smtp_C_3_Cases s3cases = s3.branch(S); + switch (s3cases.op) + { + case _250: + { + Smtp_C_4 s4 = s3cases.receive(_250, b); + System.out.print("Ehlo: " + b.val); + return s4; + } + case _250d: + { + s3 = s3cases.receive(_250d, b); + System.out.print("Ehlo: " + b.val); + break; + } + } + } + } + + private Smtp_C_6 doStartTls(Smtp_C_4 s4) throws Exception + { + Buf b = new Buf<>(); + Smtp_C_6 s6 = s4.send(S, new StartTls()).receive(S, _220, b); + System.out.print("StartTLS: " + b.val); + s6.wrapClient(S, SSLSocketChannelWrapper::new); + return s6; + } + + private Smtp_C_8 doSecureEhlo(Smtp_C_6 s6) throws Exception + { + Smtp_C_7 s7 = s6.send(S, new Ehlo("testing2")); + Buf b = new Buf<>(); + while (true) + { + Smtp_C_7_Cases s7cases = s7.branch(S); + switch(s7cases.op) + { + case _250: + { + Smtp_C_8 s8 = s7cases.receive(_250, b); + System.out.print("Ehlo: " + b.val); + return s8; + } + case _250d: + { + s7 = s7cases.receive(_250d, b); + System.out.print("Ehlo: " + b.val); + break; + } + } + } + } + + private Smtp_C_10 doAuth(Smtp_C_8 s8) throws Exception + { + Smtp_C_9_Cases s9cases = s8.send(S, new Auth(getAuthPlain())).branch(S); + Buf b = new Buf<>(); + switch (s9cases.op) + { + case _235: + { + Smtp_C_10 s10 = s9cases.receive(_235, b); + System.out.print("Auth: " + b.val); + return s10; + } + case _535: + { + s9cases.receive(_535, b).send(S, new Quit()); + System.out.print("Auth: " + b.val); + System.exit(0); + } + default: + { + throw new RuntimeException("Shouldn't get in here: " + s9cases.op); + } + } + } + + private EndSocket sendMail(Smtp_C_12 s12) throws Exception + { + return + s12.send(S, new Rcpt(this.rcptTo)) + .async(S, _250) + .send(S, new Data()) + .async(S, _354) + .send(S, new Subject(this.subj)) + .send(S, new DataLine(this.body)) + .send(S, new EndOfData()) + .receive(S, _250, new Buf<>()) + .send(S, new Quit()) + .receive(S, _221, new Buf<>()); + } + + + /*public void run() throws ScribbleRuntimeException, IOException + { + String host = "smtp.cc.ic.ac.uk"; + int port = 25; + + Smtp smtp = new Smtp(); + try (SessionEndpoint se = new SessionEndpoint<>(smtp, Smtp.C, new SmtpMessageFormatter())) + { + se.connect(Smtp.S, SocketChannelEndpoint::new, host, port); + + Smtp_C_1 s1 = new Smtp_C_1(se); + + Buf f220 = new Buf<>(); + Smtp_C_2 s2 = s1.async(Smtp.S, Smtp._220, f220); + System.out.print("Greeting: " + f220.val.sync().msg); + + Smtp_C_4 s4 = doEhlo(s2); + Smtp_C_6 s6 = doStartTls(s4); + Smtp_C_8 s8 = doEhlo(s6); + Smtp_C_10 s10 = doAuth(s8); + + Smtp_C_11_Cases s11cases = s10.send(Smtp.S, new Mail("rhu@doc.ic.ac.uk")).branch(Smtp.S); + Smtp_C_12 s12 = null; + switch (s11cases.op) + { + case _250: + { + s12 = s11cases.receive(Smtp._250); + break; + } + case _501: // FIXME: "functional interface" for quit states + { + s11cases.receive(Smtp._501).send(Smtp.S, new Quit()); + System.exit(0); + } + } + s12.send(Smtp.S, new Rcpt("rhu@doc.ic.ac.uk")) + .async(Smtp.S, Smtp._250) + .send(Smtp.S, new Data()) + .async(Smtp.S, Smtp._354) + .send(Smtp.S, new Subject("hello ARVI")) + .send(Smtp.S, new DataLine("body")) + .send(Smtp.S, new EndOfData()) + .receive(Smtp.S, Smtp._250, new Buf<>()) // Final sync needed for session to be successful? + .send(Smtp.S, new Quit()); + + /*Case_C_S_501__S_250 mailResponse = + doAuth( + doEhlo( + doStartTls( + doEhlo(new Smtp_C_1(se).async(Smtp.S, Smtp._220), ehlo)) + , ehlo)) + .send(Smtp.S, new Mail(mail)) + .branch(Smtp.S); + switch (mailResponse.getOp()) + { + case _250: + { + mailResponse.receive(Smtp._250) + .to(Select_C_S_Rcpt__S_Data.cast).send(Smtp.S, new Rcpt(rcpt)) + .to(Receive_C_S_250.cast).async(Smtp.S, Smtp._250) + .to(Select_C_S_Rcpt__S_Data.cast).send(Smtp.S, new Data()) + .to(Receive_C_S_354.cast).async(Smtp.S, Smtp._354) + .to(Select_C_S_DataLine__S_Subject__S_EndOfDate.cast).send(Smtp.S, new Subject(subj)) + .to(Select_C_S_DataLine__S_Subject__S_EndOfDate.cast).send(Smtp.S, new DataLine(body)) + .to(Select_C_S_DataLine__S_Subject__S_EndOfDate.cast).send(Smtp.S, new EndOfData()) + .to(Receive_C_S_250.cast) + //.async(Smtp.S, Smtp._250) + .receive(Smtp.S, Smtp._250, new Buf<>()) // Final sync needed for session to be successful? + .to(Select_C_S_Mail__S_Quit.cast).send(Smtp.S, new Quit()); + break; + } + case _501: + { + mailResponse.receive(Smtp._501).to(Select_C_S_Mail__S_Quit.cast).send(Smtp.S, new Quit()); + } + }* / + } + catch (Exception e) + { + if (e instanceof ScribbleRuntimeException) + { + throw (ScribbleRuntimeException) e; + } + throw new ScribbleRuntimeException(e); + } + }*/ + + protected static String getAuthPlain() throws IOException + { + BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + + String user; + String pw; + + System.out.println("User: "); + user = br.readLine(); + + System.out.println("Password: "); + EraserThread et = new EraserThread(); + et.start(); + pw = br.readLine(); + et.stopMasking(); + + byte[] u = user.getBytes("utf-8"); + byte[] p = pw.getBytes("utf-8"); + byte[] bs = new byte[u.length + p.length + 2]; + System.arraycopy(u, 0, bs, 1, u.length); + System.arraycopy(p, 0, bs, u.length + 2, p.length); + + return Base64.getEncoder().encodeToString(bs); + } +} diff --git a/scribble-demos/scrib/smtp/src/smtp/message/SmtpMessage.java b/scribble-demos/scrib/smtp/src/smtp/message/SmtpMessage.java new file mode 100644 index 000000000..e3860c471 --- /dev/null +++ b/scribble-demos/scrib/smtp/src/smtp/message/SmtpMessage.java @@ -0,0 +1,98 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package smtp.message; + +import org.scribble.runtime.message.ScribMessage; +import org.scribble.core.type.name.Op; +import org.scribble.util.Caller; + +import smtp.Smtp.Smtp.Smtp; + +public abstract class SmtpMessage extends ScribMessage +{ + public static final String _220 = "220"; + public static final String _250 = "250"; + public static final String _250_ = "250-"; + public static final String _235 = "235"; + public static final String _535 = "535"; + public static final String _501 = "501"; + public static final String _354 = "354"; + + public static final String EHLO = "ehlo"; + public static final String STARTTLS = "starttls"; + public static final String AUTH = "auth plain"; + public static final String MAIL = "mail from:"; + public static final String RCPT = "rcpt to:"; + public static final String SUBJECT = "subject:"; + public static final String DATA = "data"; + public static final String QUIT = "quit"; + + public static final String DATA_LINE = ""; + public static final String END_OF_DATA = ""; + + private static final long serialVersionUID = 1L; + + protected static final String CRLF = "\r\n"; + + public SmtpMessage(Op op) + { + super(op); + } + + public SmtpMessage(Op op, String body) + { + super(op, body); + } + + public String getBody() + { + return (this.payload.length == 0) ? "" : (String) this.payload[0]; + } + + public byte[] toBytes() + { + // FIXME: " " after op should depend on op (OK for client, no "-" ops) + byte[] bs = (getOpString(this.op) + " " + getBody() + SmtpMessage.CRLF).getBytes(SmtpMessageFormatter.cs); // Can give "utf-8" as arg directly + return bs; + } + + @Override + public String toString() + { + return new String(toBytes()); + } + + protected static String getOpString(Op op) + { + return + (op.equals(Smtp._220)) ? SmtpMessage._220 + : (op.equals(Smtp._250)) ? SmtpMessage._250 + : (op.equals(Smtp._250d)) ? SmtpMessage._250_ + : (op.equals(Smtp._235)) ? SmtpMessage._235 + : (op.equals(Smtp._535)) ? SmtpMessage._535 + : (op.equals(Smtp._501)) ? SmtpMessage._501 + : (op.equals(Smtp._354)) ? SmtpMessage._354 + : (op.equals(Smtp.Ehlo)) ? SmtpMessage.EHLO + : (op.equals(Smtp.StartTls)) ? SmtpMessage.STARTTLS + : (op.equals(Smtp.Auth)) ? SmtpMessage.AUTH + : (op.equals(Smtp.Mail)) ? SmtpMessage.MAIL + : (op.equals(Smtp.Rcpt)) ? SmtpMessage.RCPT + : (op.equals(Smtp.Subject)) ? SmtpMessage.SUBJECT + : (op.equals(Smtp.Data)) ? SmtpMessage.DATA + : (op.equals(Smtp.Quit)) ? SmtpMessage.QUIT + : (op.equals(Smtp.DataLine)) ? SmtpMessage.DATA_LINE + : (op.equals(Smtp.EndOfData)) ? SmtpMessage.END_OF_DATA + : new Caller().call(() -> { throw new RuntimeException("TODO: " + op); }); + } +} diff --git a/scribble-demos/scrib/smtp/src/smtp/message/SmtpMessageFormatter.java b/scribble-demos/scrib/smtp/src/smtp/message/SmtpMessageFormatter.java new file mode 100644 index 000000000..c28f36091 --- /dev/null +++ b/scribble-demos/scrib/smtp/src/smtp/message/SmtpMessageFormatter.java @@ -0,0 +1,454 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package smtp.message; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; + +import org.scribble.runtime.message.ScribMessage; +import org.scribble.runtime.message.ScribMessageFormatter; + +import smtp.message.server._220; +import smtp.message.server._221; +import smtp.message.server._235; +import smtp.message.server._250; +import smtp.message.server._250d; +import smtp.message.server._354; +import smtp.message.server._501; +import smtp.message.server._535; + +// Currently supports only client-side reading, not server-side +public class SmtpMessageFormatter implements ScribMessageFormatter +{ + //.. fix formatting + //.. try ssl wrapper + //.. add connection (transport) actions + + public static Charset cs = Charset.forName("UTF8"); + //private static CharsetDecoder cd = cs.newDecoder(); + + public SmtpMessageFormatter() + { + + } + + @Override + public byte[] toBytes(ScribMessage m) throws IOException + { + return ((SmtpMessage) m).toBytes(); + } + + @Override + public ScribMessage fromBytes(ByteBuffer bb) throws IOException, ClassNotFoundException + { + bb.flip(); + //byte[] bs = new byte[2]; + int rem = bb.remaining(); + if (rem < 2) + { + bb.compact(); + return null; + } + + int pos = bb.position(); + String front = new String(new byte[] { bb.get(pos), bb.get(pos + 1) }, SmtpMessageFormatter.cs); + if (front.equals(SmtpMessage.CRLF)) + { + throw new RuntimeException("TODO: "); + } + + if (rem < pos + 4) + { + bb.compact(); + return null; + } + front += new String(new byte[] { bb.get(pos + 2), bb.get(pos + 3) }, SmtpMessageFormatter.cs); + int code = isStatusCode(front); + if (code > -1) + { + String body = readLine(bb, pos + 4).trim(); // Whitespace already built into the message classes + bb.compact(); + if (body == null) + { + return null; + } + switch (code) + { + case 220: return new _220(body); + case 250: + { + if (front.charAt(3) == '-') + { + return new _250d(body); + } + return new _250(body); + } + case 235: return new _235(body); + case 535: return new _535(body); + case 501: return new _501(body); + case 354: return new _354(body); + case 221: return new _221(body); + default: throw new RuntimeException("Unknown status code " + code + ": " + body); + } + } + /*else if (front.startsWith(HttpMessage.GET)) // TODO: server-side (EHLO, STARTTLS, etc) + { + }*/ + else + { + // TODO: server-side (MAIL FROM:, RCPT TO:, etc) + String line = front + readLine(bb, pos + 4); + bb.compact(); + /*if (line == null) // deadcode + { + return null; + }*/ + throw new RuntimeException("Cannot parse message: " + line); + } + } + + private static String readLine(ByteBuffer bb, int i) throws IOException + { + StringBuilder sb = new StringBuilder(); + for (int limit = bb.limit(); i <= limit; ) + { + char c = (char) bb.get(i++); + sb.append(c); + if (c == '\r') + { + c = (char) bb.get(i++); + sb.append(c); + if (c == '\n') + { + bb.position(i); + return sb.substring(0, sb.length() - 2).toString(); + } + } + } + return null; + } + + // Duplicated from HttpMessageFormatter // FIXME: factor out + private int isStatusCode(String front) + { + String code = ""; + for (int i = 0; i < 4; i++) + { + //char c = (char) bs[i]; + char c = front.charAt(i); + if (i < 3) + { + if (c < '0' || c > '9') + { + return -1; + } + code += c; + } + else + { + if (c != ' ' && c != '-') // HACK: hypen + { + return -1; + } + } + } + return Integer.parseInt(code); + } + + /*private static String readWord(ByteBuffer bb, int i) throws IOException + { + StringBuilder sb = new StringBuilder(); + for (int limit = bb.limit(); i <= limit; ) + { + char c = (char) bb.get(i); + if (c == ' ') + { + bb.position(i); + return sb.toString(); + } + sb.append(c); + } + return null; + }*/ + + /* // Pre: flipped ready for reading + @Override + public SmtpMessage readMessage(DataInputStream dis) throws IOException + { + String header = getHeader(dis); + switch (header) + { + // FIXME: factor out text constants with Session constants? + case "220 ": + { + return new _220(getBody(dis)); + } + case "235 ": + { + return new _235(getBody(dis)); + } + case "250-": + { + return new _250_(getBody(dis)); + } + case "250 ": + { + return new _250(getBody(dis)); + } + case "354 ": + { + return new _354(getBody(dis)); + } + case "501 ": + { + return new _501(getBody(dis)); + } + case "535 ": + { + return new _535(getBody(dis)); + } + default: + { + throw new RuntimeException("Unknown header: " + header); + } + } + } + + // *4* char headers (3 digits, dash or space) + private String getHeader(DataInputStream dis) throws IOException + { + readMinimumBytes(dis, 4); + + int limit = bb.limit(); + bb.limit(4); + String header = cd.decode(bb).toString(); // updates bb position + bb.limit(limit); + bb.compact(); + bb.flip(); + return header; + } + + // Reads up to \r\n inclusive; doesn't return the \r\n + private String getBody(DataInputStream dis) throws IOException + { + int min = 2; + readMinimumBytes(dis, min); // Min should be more? + while (true) + { + String all = cd.decode(bb).toString(); // updates bb position + if (all.contains("\n")) // FIXME: didn't check exactly \r\n + { + int i = all.indexOf("\n"); + String body = all.substring(0, i - 1); + bb.position(i + 1); // \r\n -- ASCII 1-to-1 byte-char index + bb.compact(); + bb.flip(); + return body; + } + bb.rewind(); + readMinimumBytes(dis, ++min); // FIXME: buffered readLine would be more efficient + } + } + + // FIXME: min should mean min fresh (i.e. not including bb cached -- there currently is no cache: is.available doesn't work for SSLSocket, always returns 0) + private void readMinimumBytes(DataInputStream dis, int min) throws IOException + { + for (int remaining = bb.remaining(); remaining < min; remaining = bb.remaining()) + { + bb.compact(); + bb.put((byte) dis.read()); // FIXME: check for buffer overflow + bb.flip(); + } + }*/ + + @Deprecated + @Override + public void writeMessage(DataOutputStream dos, ScribMessage m) throws IOException + { + dos.write(((SmtpMessage) m).toBytes()); + dos.flush(); + } + + @Deprecated + @Override + public SmtpMessage readMessage(DataInputStream dis) throws IOException + { + byte[] bs = new byte[2]; + dis.readFully(bs); + String front = new String(bs, SmtpMessageFormatter.cs); + if (front.equals(SmtpMessage.CRLF)) + { + throw new RuntimeException("TODO: "); + } + bs = new byte[2]; + dis.readFully(bs); + front += new String(bs, SmtpMessageFormatter.cs); + int code = isStatusCode(front); + if (code > -1) + { + String body = readLine(dis).trim(); // Whitespace already built into the message classes + switch (code) + { + case 220: return new _220(body); + case 250: + { + if (front.charAt(3) == '-') + { + return new _250d(body); + } + return new _250(body); + } + case 235: return new _235(body); + case 535: return new _535(body); + case 501: return new _501(body); + case 354: return new _354(body); + default: throw new RuntimeException("Unknown status code: " + code); + } + } + /*else if (front.startsWith(HttpMessage.GET)) + { + }*/ + else + { + String line = front + readLine(dis); + throw new RuntimeException("Cannot parse message: " + line); + } + } + + private static String readLine(DataInputStream dis) throws IOException + { + StringBuilder sb = new StringBuilder(); + for (; true; ) + { + char c = (char) dis.read(); // readChar is not the same + sb.append(c); + if (c == '\r') + { + c = (char) dis.read(); + sb.append(c); + if (c == '\n') + { + return sb.substring(0, sb.length() - 2).toString(); + } + } + } + } + + /*private static String readWord(DataInputStream dis) throws IOException + { + StringBuilder sb = new StringBuilder(); + for (; true; ) + { + char c = (char) dis.read(); + if (c == ' ') + { + return sb.toString(); + } + sb.append(c); + } + }*/ + + /* // Pre: flipped ready for reading + @Override + public SmtpMessage readMessage(DataInputStream dis) throws IOException + { + String header = getHeader(dis); + switch (header) + { + // FIXME: factor out text constants with Session constants? + case "220 ": + { + return new _220(getBody(dis)); + } + case "235 ": + { + return new _235(getBody(dis)); + } + case "250-": + { + return new _250_(getBody(dis)); + } + case "250 ": + { + return new _250(getBody(dis)); + } + case "354 ": + { + return new _354(getBody(dis)); + } + case "501 ": + { + return new _501(getBody(dis)); + } + case "535 ": + { + return new _535(getBody(dis)); + } + default: + { + throw new RuntimeException("Unknown header: " + header); + } + } + } + + // *4* char headers (3 digits, dash or space) + private String getHeader(DataInputStream dis) throws IOException + { + readMinimumBytes(dis, 4); + + int limit = bb.limit(); + bb.limit(4); + String header = cd.decode(bb).toString(); // updates bb position + bb.limit(limit); + bb.compact(); + bb.flip(); + return header; + } + + // Reads up to \r\n inclusive; doesn't return the \r\n + private String getBody(DataInputStream dis) throws IOException + { + int min = 2; + readMinimumBytes(dis, min); // Min should be more? + while (true) + { + String all = cd.decode(bb).toString(); // updates bb position + if (all.contains("\n")) // FIXME: didn't check exactly \r\n + { + int i = all.indexOf("\n"); + String body = all.substring(0, i - 1); + bb.position(i + 1); // \r\n -- ASCII 1-to-1 byte-char index + bb.compact(); + bb.flip(); + return body; + } + bb.rewind(); + readMinimumBytes(dis, ++min); // FIXME: buffered readLine would be more efficient + } + } + + // FIXME: min should mean min fresh (i.e. not including bb cached -- there currently is no cache: is.available doesn't work for SSLSocket, always returns 0) + private void readMinimumBytes(DataInputStream dis, int min) throws IOException + { + for (int remaining = bb.remaining(); remaining < min; remaining = bb.remaining()) + { + bb.compact(); + bb.put((byte) dis.read()); // FIXME: check for buffer overflow + bb.flip(); + } + }*/ +} diff --git a/scribble-demos/scrib/smtp/src/smtp/message/client/Auth.java b/scribble-demos/scrib/smtp/src/smtp/message/client/Auth.java new file mode 100644 index 000000000..42467c366 --- /dev/null +++ b/scribble-demos/scrib/smtp/src/smtp/message/client/Auth.java @@ -0,0 +1,39 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package smtp.message.client; + +import smtp.Smtp.Smtp.Smtp; +import smtp.message.SmtpMessage; + +public class Auth extends SmtpMessage +{ + private static final long serialVersionUID = 1L; + + public Auth() + { + super(Smtp.Auth); + } + + // Move base 64 encode into here? (Or override toBytes) + public Auth(String body) + { + super(Smtp.Auth, body); + } + + @Override + public String toString() + { + return this.op + "(***)"; // FIXME + } +} diff --git a/scribble-demos/scrib/smtp/src/smtp/message/client/Data.java b/scribble-demos/scrib/smtp/src/smtp/message/client/Data.java new file mode 100644 index 000000000..04df7f406 --- /dev/null +++ b/scribble-demos/scrib/smtp/src/smtp/message/client/Data.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package smtp.message.client; + +import smtp.Smtp.Smtp.Smtp; +import smtp.message.SmtpMessage; + +public class Data extends SmtpMessage +{ + private static final long serialVersionUID = 1L; + + public Data() + { + super(Smtp.Data); + } +} diff --git a/scribble-demos/scrib/smtp/src/smtp/message/client/DataLine.java b/scribble-demos/scrib/smtp/src/smtp/message/client/DataLine.java new file mode 100644 index 000000000..aee5775a8 --- /dev/null +++ b/scribble-demos/scrib/smtp/src/smtp/message/client/DataLine.java @@ -0,0 +1,40 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package smtp.message.client; + +import smtp.Smtp.Smtp.Smtp; +import smtp.message.SmtpMessage; +import smtp.message.SmtpMessageFormatter; + +// FIXME: rename +public class DataLine extends SmtpMessage +{ + private static final long serialVersionUID = 1L; + + public DataLine(String body) + { + super(Smtp.DataLine, body); + if (body.equals(".")) + { + throw new RuntimeException("Illegal body: " + body); + } + } + + @Override + public byte[] toBytes() + { + // No space after op and no implicit CRLF + return (SmtpMessage.getOpString(this.op) + getBody()).getBytes(SmtpMessageFormatter.cs); + } +} diff --git a/scribble-demos/scrib/smtp/src/smtp/message/client/Ehlo.java b/scribble-demos/scrib/smtp/src/smtp/message/client/Ehlo.java new file mode 100644 index 000000000..829d8fe58 --- /dev/null +++ b/scribble-demos/scrib/smtp/src/smtp/message/client/Ehlo.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package smtp.message.client; + +import smtp.Smtp.Smtp.Smtp; +import smtp.message.SmtpMessage; + +public class Ehlo extends SmtpMessage +{ + private static final long serialVersionUID = 1L; + + public Ehlo(String body) + { + super(Smtp.Ehlo, body); + } +} diff --git a/scribble-demos/scrib/smtp/src/smtp/message/client/EndOfData.java b/scribble-demos/scrib/smtp/src/smtp/message/client/EndOfData.java new file mode 100644 index 000000000..25efc40d3 --- /dev/null +++ b/scribble-demos/scrib/smtp/src/smtp/message/client/EndOfData.java @@ -0,0 +1,36 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package smtp.message.client; + +import smtp.Smtp.Smtp.Smtp; +import smtp.message.SmtpMessage; +import smtp.message.SmtpMessageFormatter; + +public class EndOfData extends SmtpMessage +{ + private static final long serialVersionUID = 1L; + + public EndOfData() + { + super(Smtp.EndOfData, SmtpMessage.CRLF + "." + SmtpMessage.CRLF); + } + + // Drop operator used for Scribble + @Override + public byte[] toBytes() + { + // No space after op and no implicit CRLF + return (SmtpMessage.getOpString(this.op) + getBody()).getBytes(SmtpMessageFormatter.cs); + } +} diff --git a/scribble-demos/scrib/smtp/src/smtp/message/client/Mail.java b/scribble-demos/scrib/smtp/src/smtp/message/client/Mail.java new file mode 100644 index 000000000..3be5fce98 --- /dev/null +++ b/scribble-demos/scrib/smtp/src/smtp/message/client/Mail.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package smtp.message.client; + +import smtp.Smtp.Smtp.Smtp; +import smtp.message.SmtpMessage; + +public class Mail extends SmtpMessage +{ + private static final long serialVersionUID = 1L; + + public Mail(String sender) + { + super(Smtp.Mail, "<" + sender + ">"); + } +} diff --git a/scribble-demos/scrib/smtp/src/smtp/message/client/Quit.java b/scribble-demos/scrib/smtp/src/smtp/message/client/Quit.java new file mode 100644 index 000000000..fc82d9688 --- /dev/null +++ b/scribble-demos/scrib/smtp/src/smtp/message/client/Quit.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package smtp.message.client; + +import smtp.Smtp.Smtp.Smtp; +import smtp.message.SmtpMessage; + +public class Quit extends SmtpMessage +{ + private static final long serialVersionUID = 1L; + + public Quit() + { + super(Smtp.Quit); + } +} diff --git a/scribble-demos/scrib/smtp/src/smtp/message/client/Rcpt.java b/scribble-demos/scrib/smtp/src/smtp/message/client/Rcpt.java new file mode 100644 index 000000000..599c17866 --- /dev/null +++ b/scribble-demos/scrib/smtp/src/smtp/message/client/Rcpt.java @@ -0,0 +1,32 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package smtp.message.client; + +import smtp.Smtp.Smtp.Smtp; +import smtp.message.SmtpMessage; + +public class Rcpt extends SmtpMessage +{ + private static final long serialVersionUID = 1L; + + /*public Rcpt() + { + super(SMTP.RCPT); + }*/ + + public Rcpt(String receiver) + { + super(Smtp.Rcpt, "<" + receiver + ">"); + } +} diff --git a/scribble-demos/scrib/smtp/src/smtp/message/client/StartTls.java b/scribble-demos/scrib/smtp/src/smtp/message/client/StartTls.java new file mode 100644 index 000000000..0ddbec349 --- /dev/null +++ b/scribble-demos/scrib/smtp/src/smtp/message/client/StartTls.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package smtp.message.client; + +import smtp.Smtp.Smtp.Smtp; +import smtp.message.SmtpMessage; + +public class StartTls extends SmtpMessage +{ + private static final long serialVersionUID = 1L; + + public StartTls() + { + super(Smtp.StartTls); + } +} diff --git a/scribble-demos/scrib/smtp/src/smtp/message/client/Subject.java b/scribble-demos/scrib/smtp/src/smtp/message/client/Subject.java new file mode 100644 index 000000000..c93da3607 --- /dev/null +++ b/scribble-demos/scrib/smtp/src/smtp/message/client/Subject.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package smtp.message.client; + +import smtp.Smtp.Smtp.Smtp; +import smtp.message.SmtpMessage; + +public class Subject extends SmtpMessage +{ + private static final long serialVersionUID = 1L; + + public Subject(String subject) + { + super(Smtp.Subject, subject); + } +} diff --git a/scribble-demos/scrib/smtp/src/smtp/message/server/_220.java b/scribble-demos/scrib/smtp/src/smtp/message/server/_220.java new file mode 100644 index 000000000..d7e1581bd --- /dev/null +++ b/scribble-demos/scrib/smtp/src/smtp/message/server/_220.java @@ -0,0 +1,38 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package smtp.message.server; + +import smtp.Smtp.Smtp.Smtp; +import smtp.message.SmtpMessage; + +public class _220 extends SmtpMessage +{ + private static final long serialVersionUID = 1L; + + public _220() + { + super(Smtp._220); + } + + public _220(String body) + { + super(Smtp._220, body); + } + + /*@Override + public Operator getOperator() + { + return Smtp._220; + }*/ +} diff --git a/scribble-demos/scrib/smtp/src/smtp/message/server/_221.java b/scribble-demos/scrib/smtp/src/smtp/message/server/_221.java new file mode 100644 index 000000000..11026f488 --- /dev/null +++ b/scribble-demos/scrib/smtp/src/smtp/message/server/_221.java @@ -0,0 +1,38 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package smtp.message.server; + +import smtp.Smtp.Smtp.Smtp; +import smtp.message.SmtpMessage; + +public class _221 extends SmtpMessage +{ + private static final long serialVersionUID = 1L; + + public _221() + { + super(Smtp._220); + } + + public _221(String body) + { + super(Smtp._220, body); + } + + /*@Override + public Operator getOperator() + { + return Smtp._220; + }*/ +} diff --git a/scribble-demos/scrib/smtp/src/smtp/message/server/_235.java b/scribble-demos/scrib/smtp/src/smtp/message/server/_235.java new file mode 100644 index 000000000..baf91639a --- /dev/null +++ b/scribble-demos/scrib/smtp/src/smtp/message/server/_235.java @@ -0,0 +1,38 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package smtp.message.server; + +import smtp.Smtp.Smtp.Smtp; +import smtp.message.SmtpMessage; + +public class _235 extends SmtpMessage +{ + private static final long serialVersionUID = 1L; + + public _235() + { + super(Smtp._235); + } + + public _235(String body) + { + super(Smtp._235, body); + } + + /*@Override + public Operator getOperator() + { + return Smtp._235; + }*/ +} diff --git a/scribble-demos/scrib/smtp/src/smtp/message/server/_250.java b/scribble-demos/scrib/smtp/src/smtp/message/server/_250.java new file mode 100644 index 000000000..fec0b318b --- /dev/null +++ b/scribble-demos/scrib/smtp/src/smtp/message/server/_250.java @@ -0,0 +1,32 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package smtp.message.server; + +import smtp.Smtp.Smtp.Smtp; +import smtp.message.SmtpMessage; + +public class _250 extends SmtpMessage +{ + private static final long serialVersionUID = 1L; + + public _250() + { + super(Smtp._250); + } + + public _250(String body) + { + super(Smtp._250, body); + } +} diff --git a/scribble-demos/scrib/smtp/src/smtp/message/server/_250d.java b/scribble-demos/scrib/smtp/src/smtp/message/server/_250d.java new file mode 100644 index 000000000..c5dd2b478 --- /dev/null +++ b/scribble-demos/scrib/smtp/src/smtp/message/server/_250d.java @@ -0,0 +1,40 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package smtp.message.server; + +import smtp.Smtp.Smtp.Smtp; +import smtp.message.SmtpMessage; +import smtp.message.SmtpMessageFormatter; + +public class _250d extends SmtpMessage +{ + private static final long serialVersionUID = 1L; + + public _250d() + { + super(Smtp._250d); + } + + public _250d(String body) + { + super(Smtp._250d, body); + } + + @Override + public byte[] toBytes() + { + // No space after op + return (getOpString(this.op) + getBody() + SmtpMessage.CRLF).getBytes(SmtpMessageFormatter.cs); + } +} diff --git a/scribble-demos/scrib/smtp/src/smtp/message/server/_354.java b/scribble-demos/scrib/smtp/src/smtp/message/server/_354.java new file mode 100644 index 000000000..65a8a261a --- /dev/null +++ b/scribble-demos/scrib/smtp/src/smtp/message/server/_354.java @@ -0,0 +1,38 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package smtp.message.server; + +import smtp.Smtp.Smtp.Smtp; +import smtp.message.SmtpMessage; + +public class _354 extends SmtpMessage +{ + private static final long serialVersionUID = 1L; + + public _354() + { + super(Smtp._354); + } + + public _354(String body) + { + super(Smtp._354, body); + } + + /*@Override + public Operator getOperator() + { + return Smtp._354; + }*/ +} diff --git a/scribble-demos/scrib/smtp/src/smtp/message/server/_501.java b/scribble-demos/scrib/smtp/src/smtp/message/server/_501.java new file mode 100644 index 000000000..22823e42c --- /dev/null +++ b/scribble-demos/scrib/smtp/src/smtp/message/server/_501.java @@ -0,0 +1,38 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package smtp.message.server; + +import smtp.Smtp.Smtp.Smtp; +import smtp.message.SmtpMessage; + +public class _501 extends SmtpMessage +{ + private static final long serialVersionUID = 1L; + + public _501() + { + super(Smtp._501); + } + + public _501(String body) + { + super(Smtp._501, body); + } + + /*@Override + public Operator getOperator() + { + return Smtp._354; + }*/ +} diff --git a/scribble-demos/scrib/smtp/src/smtp/message/server/_535.java b/scribble-demos/scrib/smtp/src/smtp/message/server/_535.java new file mode 100644 index 000000000..b90db084a --- /dev/null +++ b/scribble-demos/scrib/smtp/src/smtp/message/server/_535.java @@ -0,0 +1,38 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package smtp.message.server; + +import smtp.Smtp.Smtp.Smtp; +import smtp.message.SmtpMessage; + +public class _535 extends SmtpMessage +{ + private static final long serialVersionUID = 1L; + + public _535() + { + super(Smtp._535); + } + + public _535(String body) + { + super(Smtp._535, body); + } + + /*@Override + public Operator getOperator() + { + return Smtp._354; + }*/ +} diff --git a/scribble-demos/scrib/threebuyer/src/threebuyer/ThreeBuyer.scr b/scribble-demos/scrib/threebuyer/src/threebuyer/ThreeBuyer.scr new file mode 100644 index 000000000..6e691d748 --- /dev/null +++ b/scribble-demos/scrib/threebuyer/src/threebuyer/ThreeBuyer.scr @@ -0,0 +1,53 @@ +/** + * Taken from [MSCS16] Global Progress for Dynamically Interleaved Sessions + */ + +module threebuyer.ThreeBuyer; + + +data "java.lang.Integer" from "rt.jar" as Int; +data "java.lang.String" from "rt.jar" as String; +data "test.twobuyer.Date" from "test/twobuyer/Date.java" as Date; + + +// 1 = B, 2 = A, 3 = S +global protocol TwoBuyer(role A, role B, role S) +{ + (String) from A to S; + (Int) from S to A; + (Int) from S to B; + (Int) from A to B; + do TwoBuyerChoice(A, B, S); +} + +aux global protocol TwoBuyerChoice(role A, role B, role S) +{ + choice at B + { + ok(String) from B to A; + ok(String) from B to S; + (Date) from S to B; + } + or + { + quit() from B to A; + quit() from B to S; + } +} + + +// 1 = C, 2 = B +//global protocol ThreeBuyer(role C, role B) +global protocol Proto(role C, role B) +{ + (Int) from B to C; // Should be same value as the Int on line 19 + (TwoBuyerChoice@B) from B to C; + choice at C + { + ok() from C to B; // Not enforced: consistency of "ok" choice here and in the delegated session + } + or + { + quit() from C to B; + } +} diff --git a/scribble-demos/scrib/threebuyer/src/threebuyer/ThreeBuyer2.scr b/scribble-demos/scrib/threebuyer/src/threebuyer/ThreeBuyer2.scr new file mode 100644 index 000000000..ab1eef33f --- /dev/null +++ b/scribble-demos/scrib/threebuyer/src/threebuyer/ThreeBuyer2.scr @@ -0,0 +1,61 @@ +module threebuyer.ThreeBuyer2; + + +data "java.lang.Integer" from "rt.jar" as Int; +data "java.lang.String" from "rt.jar" as String; +data "test.twobuyer.Date" from "test/twobuyer/Date.java" as Date; + + +// 1 = B, 2 = A, 3 = S +explicit global protocol Proto(role A, role B, role S, role C) +{ + connect A to B; + connect A to S; + connect B to S; + (String) from A to S; + (Int) from S to A; + (Int) from S to B; + (Int) from A to B; + do ThreeBuyerChoice(A, B, S, C); +} + +aux global protocol ThreeBuyerChoice(role A, role B, role S, role C) +{ + choice at B + { + do TwoBuyerChoice(A, B, S); + } + or + { + dummy() from B to A; + dummy() from B to S; + connect B to C; + (Int) from B to C; + connect C to A; + connect C to S; + do TwoBuyerChoice(A, C, S); + choice at C + { + ok() from C to B; + } + or + { + quit() from C to B; + } + } +} + +aux global protocol TwoBuyerChoice(role A, role B, role S) +{ + choice at B + { + ok(String) from B to A; + ok(String) from B to S; + (Date) from S to B; + } + or + { + quit() from B to A; + quit() from B to S; + } +} diff --git a/scribble-demos/scrib/travel/src/travel/BookingA.java b/scribble-demos/scrib/travel/src/travel/BookingA.java new file mode 100644 index 000000000..26391c76b --- /dev/null +++ b/scribble-demos/scrib/travel/src/travel/BookingA.java @@ -0,0 +1,87 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package travel; + +import java.io.IOException; +import java.util.concurrent.ExecutionException; + +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.net.SocketChannelServer; +import org.scribble.runtime.session.MPSTEndpoint; + +import travel.Travel.Booking.Booking; +import travel.Travel.Booking.roles.A; +import travel.Travel.Booking.statechans.A.Booking_A_1; +import travel.Travel.Booking.statechans.A.Booking_A_1_Cases; + +public class BookingA +{ + public static void main(String[] args) throws IOException, + ScribRuntimeException, ExecutionException, InterruptedException + { + try (ScribServerSocket ss_C = new SocketChannelServer(7777)) + { + while (true) + { + int quote = 1000; + + Booking booking = new Booking(); + try (MPSTEndpoint se = new MPSTEndpoint<>(booking, + Booking.A, new ObjectStreamFormatter())) + { + se.accept(ss_C, Booking.C); + + //Thread.sleep(1000); // CHECKME: ensure S is ready + + se.request(Booking.S, SocketChannelEndpoint::new, "localhost", 9999); + + Booking_A_1 s1 = new Booking_A_1(se); + Booking_A_1_Cases s1cases; + X: while (true) + { + s1cases = s1.branch(Booking.C); + switch (s1cases.op) + { + case Query: + s1 = s1cases.receive(Booking.Query) + .send(Booking.C, Booking.Quote, quote -= 100) + .send(Booking.S, Booking.Dummy); + break; + case No: + s1cases.receive(Booking.No) + .send(Booking.S, Booking.No) + .receive(Booking.C, Booking.Bye); + break X; + case Yes: + System.out.println("Yes: "); + s1cases.receive(Booking.Yes) + .send(Booking.S, Booking.Yes) + .receive(Booking.C, Booking.Bye); + break X; + } + } + + System.out.println("Done:"); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + } + } +} diff --git a/scribble-demos/scrib/travel/src/travel/BookingC.java b/scribble-demos/scrib/travel/src/travel/BookingC.java new file mode 100644 index 000000000..b9574c376 --- /dev/null +++ b/scribble-demos/scrib/travel/src/travel/BookingC.java @@ -0,0 +1,149 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package travel; + +import java.util.List; +import java.util.stream.Collectors; +import java.util.stream.IntStream; + +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import travel.Travel.Booking.Booking; +import travel.Travel.Booking.roles.C; +import travel.Travel.Booking.statechans.C.Booking_C_1; +import travel.Travel.Booking.statechans.C.Booking_C_5; + + +public class BookingC +{ + static int MAX = 500; + static List QUERIES = IntStream.range(97, 122) + .mapToObj(i -> new Character((char) i).toString()) + .collect(Collectors.toList()); + + public static void main(String[] args) throws Exception + { + Booking booking = new Booking(); + try (MPSTEndpoint se = new MPSTEndpoint<>(booking, Booking.C, + new ObjectStreamFormatter())) + { + se.request(Booking.A, SocketChannelEndpoint::new, "localhost", 7777); + se.request(Booking.S, SocketChannelEndpoint::new, "localhost", 8888); + Booking_C_1 s1 = new Booking_C_1(se); + + Buf quote = new Buf<>(); + Booking_C_5 s3; + for (int i = 0; ; i++) + { + if (i >= QUERIES.size()) + { + s3 = s1.send(Booking.A, Booking.No); + break; + } + System.out.println("Querying: " + QUERIES.get(i)); + s1 = s1.send(Booking.A, Booking.Query, QUERIES.get(i)) + .receive(Booking.A, Booking.Quote, quote); + System.out.println("Quoted: " + quote.val); + if (quote.val <= MAX) + { + System.out.println("Yes: "); + s3 = s1.send(Booking.A, Booking.Yes) + .send(Booking.S, Booking.Payment, "...") + .receive(Booking.S, Booking.Ack); + break; + } + } + s3.send(Booking.A, Booking.Bye); + + //foo(s1, quote); + //doQuery(s1, 0, quote).send(Booking.A, Booking.Bye); + + System.out.println("End: "); + } + } + + /*private static void foo(Booking_C_1 s1, Buf buf) throws Exception + { + for (int i = 0; i < QUERIES.size(); i++) // Stream.forEach not suitable due to Exceptions + { + System.out.println("Querying: " + QUERIES.get(i)); + s1 = s1.send(Booking.A, Booking.Query, QUERIES.get(i)) + .receive(Booking.A, Booking.Quote, buf); + System.out.println("Quoted: " + buf.val); + if (buf.val <= MAX) + { + System.out.println("Yes: "); + s1.send(Booking.A, Booking.Yes) + .send(Booking.S, Booking.Payment, "...") + .receive(Booking.S, Booking.Ack) + .send(Booking.A, Booking.Bye); + return; + } + } + s1.send(Booking.A, Booking.No).send(Booking.A, Booking.Bye); + }*/ + + private static Booking_C_5 doQuery(Booking_C_1 s1, int i, Buf buf) throws Exception + { + return (i >= QUERIES.size()) + ? s1.send(Booking.A, Booking.No) + //: foo3(s1.send(Booking.A, Booking.Query, println(QUERIES.get(i), QUERIES.get(i))).receive(Booking.Quote, QUOTE), i, println(QUOTE.val, Integer.toString(QUOTE.val))); + : checkMax(s1.send(Booking.A, Booking.Query, QUERIES.get(i)) + .receive(Booking.A, Booking.Quote, buf) + , i, buf); + } + + private static Booking_C_5 checkMax(Booking_C_1 s1, int i, Buf buf) throws Exception + { + return (buf.val <= MAX) + ? s1.send(Booking.A, Booking.Yes) + .send(Booking.S, Booking.Payment, "...") + .receive(Booking.S, Booking.Ack) + : doQuery(s1, i + 1, buf); + } + + /*private static T println(T t, String m) + { + System.out.println(m); + return t; + }*/ + + /*static Optional opt; + private static Booking_C_1 foo2(Booking_C_1 s1, int i) throws Exception + { + return (i >= QUERIES.size()) + ? ((opt = foo3(s1.send(Booking.A, Booking.Query, QUERIES.get(i)).receive(Booking.Quote, QUOTE), QUOTE.val)).isPresent()) + ? null + : null + : s1.send(, op);; + /*if (QUOTE.val <= MAX) + { + s1.send(Booking.A, Booking.Yes).send(Booking.S, Booking.Payment, "...").receive(Booking.Ack); + } + else + { + if () + }* / + } + + private static Optional foo3(Booking_C_1 s1, int quote) throws Exception + { + return (quote <= MAX) + ? Optional.of(quote) + : Optional.empty(); + }*/ +} diff --git a/scribble-demos/scrib/travel/src/travel/BookingS.java b/scribble-demos/scrib/travel/src/travel/BookingS.java new file mode 100644 index 000000000..6d59298fa --- /dev/null +++ b/scribble-demos/scrib/travel/src/travel/BookingS.java @@ -0,0 +1,82 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package travel; + +import java.io.IOException; +import java.util.concurrent.ExecutionException; + +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.net.SocketChannelServer; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import travel.Travel.Booking.Booking; +import travel.Travel.Booking.roles.S; +import travel.Travel.Booking.statechans.S.Booking_S_1; +import travel.Travel.Booking.statechans.S.Booking_S_1_Cases; + +public class BookingS +{ + public static void main(String[] args) throws IOException, + ScribRuntimeException, ExecutionException, InterruptedException + { + try (ScribServerSocket ss_C = new SocketChannelServer(8888); + ScribServerSocket ss_A = new SocketChannelServer(9999)) + { + while (true) + { + Booking booking = new Booking(); + try (MPSTEndpoint se = new MPSTEndpoint<>(booking, + Booking.S, new ObjectStreamFormatter())) + { + //S.register(Booking.A, ss_A); + + se.accept(ss_C, Booking.C); + se.accept(ss_A, Booking.A); + Buf payment = new Buf<>(); + + Booking_S_1 s1 = new Booking_S_1(se); + Booking_S_1_Cases s1cases; + X: while (true) + { + s1cases = s1.branch(Booking.A); + switch (s1cases.op) + { + case Dummy: + s1 = s1cases.receive(Booking.Dummy); + break; + case No: + s1cases.receive(Booking.No); + break X; + case Yes: + System.out.println("Yes: "); + s1cases.receive(Booking.Yes) + .receive(Booking.C, Booking.Payment, payment) + .send(Booking.C, Booking.Ack); + break X; + } + } + + System.out.println("Done:"); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + } + } +} diff --git a/scribble-demos/scrib/travel/src/travel/Travel.scr b/scribble-demos/scrib/travel/src/travel/Travel.scr new file mode 100644 index 000000000..e7444b514 --- /dev/null +++ b/scribble-demos/scrib/travel/src/travel/Travel.scr @@ -0,0 +1,78 @@ +//$ ./scribblec.sh -ip scribble-demos/scrib/travel/src -d scribble-demos/scrib/travel/src scribble-demos/scrib/travel/src/travel/Travel.scr -api Booking C +//$ javadoc -cp scribble-core/target/classes:scribble-runtime/target/classes:scribble-demos/scrib/travel/src -subpackages travel.Travel.Booking -d scribble-demos/scrib/travel/javadoc + +module travel.Travel; + +data "java.lang.Integer" from "rt.jar" as Int; +data "java.lang.String" from "rt.jar" as String; + + +//* +global protocol Booking(role C, role A, role S) +{ + choice at C + { + Query(String) from C to A; + Quote(Int) from A to C; + Dummy() from A to S; // Dummy + do Booking(C, A, S); + } + or + { + choice at C + { + Yes() from C to A; + Yes() from A to S; + Payment(String) from C to S; + Ack() from S to C; + } + or + { + No() from C to A; + No() from A to S; + } + Bye() from C to A; + } +} +//*/ + + +/* +explicit global protocol BookingExp(role C, role A, role S) +{ + connect C to A; + do BookingExpAux(C, A, S); +} + +aux global protocol BookingExpAux(role C, role A, role S) +{ + choice at C + { + Query(String) from C to A; + Quote(Int) from A to C; + //continue X; + do BookingExpAux(C, A, S); + } + or + { + choice at C + { + Yes() from C to A; + connect A to S; + Yes() from A to S; + //disconnect A and S; // Disconnects not needed in non-recursive flows + + connect S to C; // Needs session id to correlate connections -- ideally fresh "shared channels" + Payment(String) from C to S; + Ack() from S to C; + + //disconnect S and C; + } + or + { + No() from C to A; + } + Bye() from C to A; + } +} +//*/ diff --git a/scribble-demos/scrib/tutorial/src/tutorial/adder/Adder.scr b/scribble-demos/scrib/tutorial/src/tutorial/adder/Adder.scr new file mode 100644 index 000000000..15359f537 --- /dev/null +++ b/scribble-demos/scrib/tutorial/src/tutorial/adder/Adder.scr @@ -0,0 +1,30 @@ +/** + * Assuming scribblec.sh in the scribble-java root directory: + * + * Check Adder protocol: + * $ ./scribblec.sh scribble-demos/scrib/tutorial/src/tutorial/adder/Adder.scr + * + * Generate Endpoint API for C: + * $ ./scribblec.sh scribble-demos/scrib/tutorial/src/tutorial/adder/Adder.scr -d scribble-demos/scrib/tutorial/src/ -api Adder C + * + * [Java] Generate javadoc from Endpoint API(s): + * $ javadoc -cp scribble-core/target/classes:scribble-runtime/target/classes:scribble-demos/scrib/tutorial/src -subpackages tutorial.adder.Adder.Adder -d scribble-demos/scrib/tutorial/javadoc/adder + * + */ + + +module tutorial.adder.Adder; + + +data "java.lang.Integer" from "rt.jar" as Int; + + +global protocol Adder(role C, role S) { + choice at C { + Add(Int, Int) from C to S; + Res(Int) from S to C; + do Adder(C, S); + } or { + Bye() from C to S; + } +} diff --git a/scribble-demos/scrib/tutorial/src/tutorial/adder/AdderC.java b/scribble-demos/scrib/tutorial/src/tutorial/adder/AdderC.java new file mode 100644 index 000000000..2c2c1c3a4 --- /dev/null +++ b/scribble-demos/scrib/tutorial/src/tutorial/adder/AdderC.java @@ -0,0 +1,62 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package tutorial.adder; + +import static tutorial.adder.Adder.Adder.Adder.Add; +import static tutorial.adder.Adder.Adder.Adder.Bye; +import static tutorial.adder.Adder.Adder.Adder.C; +import static tutorial.adder.Adder.Adder.Adder.Res; +import static tutorial.adder.Adder.Adder.Adder.S; + +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import tutorial.adder.Adder.Adder.Adder; +import tutorial.adder.Adder.Adder.roles.C; +import tutorial.adder.Adder.Adder.statechans.C.Adder_C_1; +import tutorial.adder.Adder.Adder.statechans.C.Adder_C_2; + +public class AdderC { + + public static void main(String[] args) throws Exception { + Adder adder = new Adder(); + try (MPSTEndpoint client = + new MPSTEndpoint<>(adder, C, new ObjectStreamFormatter())) { + client.request(S, SocketChannelEndpoint::new, "localhost", 8888); + int n = 10; + System.out.println(n + "th Fibonacci number: " + + fibo(new Adder_C_1(client), n)); + } + } + + private static int fibo(Adder_C_1 c1, int n) throws Exception { + Buf x = new Buf<>(0); + Buf y = new Buf<>(1); + Buf i = new Buf<>(1); + while (i.val < n) { + Adder_C_2 c2 = c1.send(S, Add, x.val, y.val); + x.val = y.val; + c1 = c2.receive(S, Res, y); + c1 = add1(c1, i); + } + c1.send(S, Bye); // EndSocket + return x.val; + } + + private static Adder_C_1 add1(Adder_C_1 c1, Buf i) throws Exception { + return c1.send(S, Add, i.val, 1).receive(S, Res, i); + } +} diff --git a/scribble-demos/scrib/tutorial/src/tutorial/adder/AdderS.java b/scribble-demos/scrib/tutorial/src/tutorial/adder/AdderS.java new file mode 100644 index 000000000..be7359d94 --- /dev/null +++ b/scribble-demos/scrib/tutorial/src/tutorial/adder/AdderS.java @@ -0,0 +1,65 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package tutorial.adder; + +import static tutorial.adder.Adder.Adder.Adder.Add; +import static tutorial.adder.Adder.Adder.Adder.Bye; +import static tutorial.adder.Adder.Adder.Adder.C; +import static tutorial.adder.Adder.Adder.Adder.Res; +import static tutorial.adder.Adder.Adder.Adder.S; + +import java.io.IOException; + +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.net.SocketChannelServer; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import tutorial.adder.Adder.Adder.Adder; +import tutorial.adder.Adder.Adder.roles.S; +import tutorial.adder.Adder.Adder.statechans.S.Adder_S_1; +import tutorial.adder.Adder.Adder.statechans.S.Adder_S_1_Cases; + +public class AdderS { + + public static void main(String[] args) throws Exception { + try (ScribServerSocket ss = new SocketChannelServer(8888)) { + while (true) { + Adder adder = new Adder(); + try (MPSTEndpoint server + = new MPSTEndpoint<>(adder, S, new ObjectStreamFormatter())) { + server.accept(ss, C); + new AdderS().run(new Adder_S_1(server)); + } catch (ScribRuntimeException | IOException | ClassNotFoundException e) { + e.printStackTrace(); + } + } + } + } + + private void run(Adder_S_1 s1) throws Exception { + Buf x = new Buf<>(); + Buf y = new Buf<>(); + while (true) { + Adder_S_1_Cases cases = s1.branch(C); + switch (cases.op) { + case Add: s1 = cases.receive(Add, x, y) + .send(C, Res, x.val+y.val); break; + case Bye: cases.receive(Bye); return; + } + } + } +} diff --git a/scribble-demos/scrib/twobuyer/src/twobuyer/TwoBuyer.scr b/scribble-demos/scrib/twobuyer/src/twobuyer/TwoBuyer.scr new file mode 100644 index 000000000..c9565fc2b --- /dev/null +++ b/scribble-demos/scrib/twobuyer/src/twobuyer/TwoBuyer.scr @@ -0,0 +1,61 @@ +module twobuyer.TwoBuyer; + + +data "java.lang.Integer" from "rt.jar" as int; +data "java.lang.String" from "rt.jar" as String; +data "test.twobuyer.Address" from "test/twobuyer/Address.java" as Address; +data "test.twobuyer.Date" from "test/twobuyer/Date.java" as Date; + + +global protocol TwoBuyer(role A, role B, role S) +{ + title(String) from A to S; + //quote(int) from S to A, B; // EFSM building for multicast not currently supported + quote(int) from S to A; + quote(int) from S to B; + quoteByTwo(int) from A to B; + choice at B + { + ok(Address) from B to S; + (Date) from S to B; + } + or + { + quit() from B to S; + } +} + + +global protocol TwoBuyerAlt(role A, role B, role S) +{ + title(String) from A to S; + choice at S // Not expressible by "directed" choice + { + quote1(int) from S to A; + //(int) from A to B; // Not supported (inconsistent local choice subject) + (int) from A to S; + quote2(int) from S to B; + do TwoBuyerAltAux(B, S); + } + or + { + quote1(int) from S to B; + //(int) from B to A; + (int) from B to S; + quote2(int) from S to A; + do TwoBuyerAltAux(A, S); + } +} + +aux global protocol TwoBuyerAltAux(role C, role S) +{ + choice at C + { + ok(Address) from C to S; + (Date) from S to C; + } + or + { + quit() from C to S; + } +} diff --git a/scribble-dist/pom.xml b/scribble-dist/pom.xml new file mode 100644 index 000000000..87a484261 --- /dev/null +++ b/scribble-dist/pom.xml @@ -0,0 +1,81 @@ + + + + 4.0.0 + + + scribble-dist + pom + + + + org.scribble + scribble-core + + + org.scribble + scribble-ast + + + org.scribble + scribble-parser + + + org.scribble + scribble-cli + + + org.scribble + scribble-codegen + + + + org.scribble + scribble-runtime + + + + + org.scribble + parent + 0.5.1-SNAPSHOT + ../pom.xml + + + + + + + maven-assembly-plugin + + + src/main/scripts/distro-assembly.xml + + false + + + + distro-assembly + package + + single + + + + + + + + + scribble-dist + Scribble distribution. + + diff --git a/scribble-dist/src/main/resources/scribblec.sh b/scribble-dist/src/main/resources/scribblec.sh new file mode 100644 index 000000000..6de535a89 --- /dev/null +++ b/scribble-dist/src/main/resources/scribblec.sh @@ -0,0 +1,199 @@ +#!/bin/sh +# +# Copyright 2008 The Scribble Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except +# in compliance with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License +# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +# or implied. See the License for the specific language governing permissions and limitations under +# the License. +# + + +## +# Config: +# +# $SCRIBBLE_HOME +# Set this to the `scribble-java` root directory. +# i.e., the directory of the `parent` mvn module (that contains the +# `scribble-ast`, `scribble-cli`, etc. mvn submodules), +# or the directory that contains the `lib` directory containing the generated +# distribution jars. +if [ -z "${SCRIBBLE_HOME}" ]; then + SCRIBHOME=$(dirname "$0") +else + SCRIBHOME=${SCRIBBLE_HOME} +fi + +# ANTLR 3 runtime jar location. +# Set this to the location of the ANTLR 3 runtime jar, or place the jar in: +# `$SCRIBHOME/lib`. (This script looks for the ANTLR jar in those locations.) +ANTLR_RUNTIME_JAR=$SCRIBHOME'/scribble-parser/lib/antlr-3.5.2-complete.jar' + # e.g., '~/.m2/repository/org/antlr/antlr-runtime/3.4/antlr-runtime-3.4.jar' + # or '/cygdrive/c/Users/[User]/.m2/repository/org/antlr/antlr-runtime/3.4/antlr-runtime-3.4.jar' + # (i.e., the Maven install location) + +# Local env. +JAVA='java' # Java executable +WSL=0 # Set to 1 for ';' classpath separator and wslpath formatting +CYGWIN=0 # Set to 1 for ';' classpath separator and cygpath formatting + +#if [ "$(uname | grep -c CYGWIN)" -ne 0 ]; then +# CYGWIN=1 +#fi +# +## + + +usage() { + echo 'Set $SCRIBBLE_HOME to the scribble-java root directory (default: current dir).' + cat < [option]...' + + Source Scribble module (.scr file) + +Options: + -h, --help Show this info and exit + -v Scribble debug info + --verbose Echo the java command + + -ip Scribble module import path + + -project Project protocol + + -fsm Generate default Endpoint FSM + -aut Output as aut (instead of dot) + -fsmpng + Draw default Endpoint FSM as png (via dot) + -vfsm, -ufsm + -vfsmpng, -ufsmpng + Output the EFSM used in validation (or the "unfair" variant) + -minlts + Minimise EFSMs for dot output and API generation (but not validation) + (Requires ltsconvert) + + + -model Generate global model + -modelpng + Draw global model as png (requires dot) + -fair Assume fair output choices + -umodel, -umodelpng (with appropriate args) "Unfair" variant + + + -api Generate Java Endpoint API + -d API output directory + -sessapi Generate Session API only + -chanapi Generate State Channel API only + -subtypes Enable subtypes for -chanapi +EOF +} + + +SEP=':' # Classpath separator +if [ "$WSL" = 1 ] || [ "$CYGWIN" = 1 ]; then + SEP=';' +fi + +fixpath() { + p="$1" + if [ "$WSL" = 1 ]; then + p=$(wslpath -w "$p" | sed 's/\\/\\\\/g') + elif [ "$CYGWIN" = 1 ]; then + p=$(cygpath -pw "$p") + fi + printf "%s" "$p" +} + +CLASSPATH= +# If first module dir present, assume all are... +if [ -d "$SCRIBHOME"'/scribble-ast/target/classes' ]; then + CLASSPATH=$(fixpath "$SCRIBHOME"'/scribble-ast/target/classes') + CLASSPATH="$CLASSPATH$SEP"$(fixpath "$SCRIBHOME"'/scribble-cli/target/classes') + CLASSPATH="$CLASSPATH$SEP"$(fixpath "$SCRIBHOME"'/scribble-codegen/target/classes') + CLASSPATH="$CLASSPATH$SEP"$(fixpath "$SCRIBHOME"'/scribble-core/target/classes') + CLASSPATH="$CLASSPATH$SEP"$(fixpath "$SCRIBHOME"'/scribble-main/target/classes') + CLASSPATH="$CLASSPATH$SEP"$(fixpath "$SCRIBHOME"'/scribble-parser/target/classes') +fi +# If first module jar present, assume all are... +if [ -f "$SCRIBHOME"'/lib/scribble-ast.jar' ]; then + if [ ! -z "$CLASSPATH" ]; then + CLASSPATH="$CLASSPATH$SEP" + fi + CLASSPATH="$CLASSPATH"$(fixpath "$SCRIBHOME"'/lib/scribble-ast.jar') + CLASSPATH="$CLASSPATH$SEP"$(fixpath "$SCRIBHOME"'/lib/scribble-cli.jar') + CLASSPATH="$CLASSPATH$SEP"$(fixpath "$SCRIBHOME"'/lib/scribble-codegen.jar') + CLASSPATH="$CLASSPATH$SEP"$(fixpath "$SCRIBHOME"'/lib/scribble-core.jar') + CLASSPATH="$CLASSPATH$SEP"$(fixpath "$SCRIBHOME"'/lib/scribble-main.jar') + CLASSPATH="$CLASSPATH$SEP"$(fixpath "$SCRIBHOME"'/lib/scribble-parser.jar') +fi +# Below assumes CLASSPATH non-empty +if [ -f "$ANTLR_RUNTIME_JAR" ]; then + CLASSPATH="$CLASSPATH$SEP"$(fixpath "$ANTLR_RUNTIME_JAR") +fi +if [ -f "$SCRIBHOME"'/lib/antlr.jar' ]; then + CLASSPATH="$CLASSPATH$SEP"$(fixpath "$SCRIBHOME"'/lib/antlr.jar') +fi +if [ -f "$SCRIBHOME"'/lib/antlr-runtime.jar' ]; then + CLASSPATH="$CLASSPATH$SEP"$(fixpath "$SCRIBHOME"'/lib/antlr-runtime.jar') +fi +#if [ -f '/lib/commons-io.jar' ]; then +# CLASSPATH=$CLASSPATH$SEP$(fixpath $SCRIBHOME'/lib/commons-io.jar') +#fi +#CLASSPATH=$CLASSPATH':'$SCRIBHOME'/lib/stringtemplate.jar' +##CLASSPATH=\'"$(fixpath "$CLASSPATH")"\' + + +usage=0 +verbose=0 +ARGS= + +while true; do + case "$1" in + "") + break + ;; + -h) + usage=1 + break + ;; + --help) + usage=1 + break + ;; + --verbose) + verbose=1 + shift + ;; + *) + ARGS="$ARGS '$1'" + shift + ;; + esac +done + +if [ "$usage" = 1 ] || [ -z "$ARGS" ]; then + + usage + exit 0 +fi + + +CMD="$JAVA"' -cp '\'"$CLASSPATH"\'' org.scribble.cli.CommandLine' + +scribblec() { + eval "$CMD" "$@" +} + +if [ "$verbose" = 1 ]; then + echo "$CMD" "$ARGS" +fi + +scribblec "$ARGS" + diff --git a/scribble-dist/src/main/scripts/distro-assembly.xml b/scribble-dist/src/main/scripts/distro-assembly.xml new file mode 100644 index 000000000..f23279a45 --- /dev/null +++ b/scribble-dist/src/main/scripts/distro-assembly.xml @@ -0,0 +1,49 @@ + + + + + distribution + + zip + + + false + ${project.build.finalName} + + + + src/main/resources + + + + + + + lib + false + ${artifact.artifactId}.${artifact.extension} + false + 0644 + 0755 + + + + + diff --git a/scribble-main/pom.xml b/scribble-main/pom.xml new file mode 100644 index 000000000..f4ef86985 --- /dev/null +++ b/scribble-main/pom.xml @@ -0,0 +1,40 @@ + + + 4.0.0 + + + scribble-main + + + + org.scribble + scribble-core + + + org.scribble + scribble-parser + + + org.scribble + scribble-ast + + + + junit + junit + test + + + + + org.scribble + parent + 0.5.1-SNAPSHOT + ../pom.xml + + + + scribble-main + + diff --git a/scribble-main/src/main/java/org/scribble/main/Main.java b/scribble-main/src/main/java/org/scribble/main/Main.java new file mode 100644 index 000000000..10e82a04c --- /dev/null +++ b/scribble-main/src/main/java/org/scribble/main/Main.java @@ -0,0 +1,187 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.main; + +import java.nio.file.Path; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; +import java.util.stream.Collectors; + +import org.scribble.ast.AstFactory; +import org.scribble.ast.AstFactoryImpl; +import org.scribble.ast.ImportDecl; +import org.scribble.ast.ImportModule; +import org.scribble.ast.Module; +import org.scribble.core.job.CoreArgs; +import org.scribble.core.type.name.ModuleName; +import org.scribble.del.DelFactory; +import org.scribble.del.DelFactoryImpl; +import org.scribble.job.Job; +import org.scribble.main.resource.Resource; +import org.scribble.main.resource.loader.ScribModuleLoader; +import org.scribble.main.resource.locator.ResourceLocator; +import org.scribble.parser.ScribAntlrWrapper; +import org.scribble.util.Pair; +import org.scribble.util.ScribException; +import org.scribble.util.ScribParserException; + +/** + * Main loads the main module, and then all other (transitively) imported + * modules. Its main purpose is to offer the newJob factory method. + * + * Main takes an abstract ResourceLocator, e.g. DirectoryResourceLocator -- (for + * non-inline main modules)... + * ...but because Resource is primarily based on file paths, it takes mainpath + * (rather than something more abstract, e.g., URI) to identify the "main" + * resource. + * + * TODO: Resource and ResourceLocator should be made more abstract from (file) + * paths (cf. use of modname.toPath in ScribModuleLoader). + */ +public class Main +{ + public final ModuleName main; + public final Map args; + + private final ScribAntlrWrapper antlr; + //private final ResourceLocator locator; // Path -> Resource + private final ScribModuleLoader loader; // ModuleName -> Pair + + // Keys are full names -- parsed are the modules read from file, distinguished from the generated projection modules + // Resource recorded for source path + private final Map> parsed + = new HashMap<>(); + + // Load main module from file system + // Load other modules via locator -- CHECKME: a bit inconsistent w.r.t. main? + // TODO: make Path abstract as e.g. URI -- locator is abstract but Path is coupled to concrete DirectoryResourceLocator + public Main(ResourceLocator locator, Path mainpath, + Map args) throws ScribException, ScribParserException + { + this(new Pair<>(locator, null), mainpath, args); + } + + // Load an inline module arg -- module imports not allowed (currently no ResourceLocator) + public Main(String inline, Map args) + throws ScribException, ScribParserException + { + this(new Pair<>(null, inline), null, args); + } + + // Pre: hack.left == null xor hack.right == null + // Hack to "unify" the constructors (to satisfy final field init more conveniently) + private Main(Pair hack, Path mainpath, + Map args) throws ScribException, ScribParserException + { + this.antlr = newAntlr(); + + // Set this.loader and load main + Pair main; + if (hack.right == null) + { + //this.locator = hack.left; + this.loader = new ScribModuleLoader(hack.left, this.antlr); + main = this.loader.loadMainModule(mainpath); + } + else + { + //this.locator = null; + this.loader = new ScribModuleLoader(null, this.antlr); // CHECKME: null locator OK? + main = this.loader.loadMainModule(hack.right); + if (main.right.getImportDeclChildren().stream() + .anyMatch(x -> x.isImportModule())) + { + throw new ScribException( + "Module imports not permitted in inline main modules."); + // Because (currently) null locator + } + } + + this.main = main.right.getFullModuleName(); + this.args = Collections.unmodifiableMap(args); + loadAllModuleImports(main); + } + + // A Scribble extension should override newAntlr/Job as appropriate + protected ScribAntlrWrapper newAntlr() + { + DelFactory df = newDelFactory(); + return new ScribAntlrWrapper(df); + } + + // N.B. not used by antlr generated parser itself (cf. ScribTreeAdaptor, takes source tokens and sets dels manually) + // Here (cf. Job) because it takes antlr for token creation (and lives in scribble-parser) + protected AstFactory newAstFactory(ScribAntlrWrapper antlr) + { + return new AstFactoryImpl(antlr); + } + + // Here (cf. Job) because df used by this.antlr and this.af (and lives in scribble-parser) + protected DelFactory newDelFactory() + { + return new DelFactoryImpl(); + } + + // For a Scribble extension, override newJob(parsed, args, mainFullname, AstFactory) + public final Job newJob() throws ScribException + { + AstFactory af = newAstFactory(this.antlr); + return newJob(getParsedModules(), this.args, this.main, af, this.antlr.df); + } + + // A Scribble extension should override newAntlr/Job as appropriate + protected Job newJob(Map parsed, + Map args, ModuleName mainFullname, AstFactory af, + DelFactory df) throws ScribException + { + // Was previously made inside Job, but AstFactoryImpl now lives in scribble-parser, to access ScribbleParser constants + return new Job(mainFullname, args, parsed, af, df); + } + + // Pre: main Module loaded by this.loader + // Given the already loaded main, populates this.parsed and this.modcs + // Does so by transitively loading all module imports + private void loadAllModuleImports(Pair main) + throws ScribParserException, ScribException + { + loadAllAux(main); // Populates this.parsed + } + + // Recursively records m in this.parsed and loads all module imports of m + private void loadAllAux(Pair m) + throws ScribParserException, ScribException + { + this.parsed.put(m.right.getFullModuleName(), m); + for (ImportDecl id : m.right.getImportDeclChildren()) + { + if (id.isImportModule()) + { + ModuleName fullname = + ((ImportModule) id).getModuleNameNodeChild().toName(); + if (!this.parsed.containsKey(fullname)) + { + loadAllAux(this.loader.loadModule(fullname)); + } + } + } + } + + public Map getParsedModules() + { + return this.parsed.entrySet().stream() + .collect(Collectors.toMap(Entry::getKey, e -> e.getValue().right)); + } +} diff --git a/scribble-main/src/main/java/org/scribble/main/resource/AbstractResource.java b/scribble-main/src/main/java/org/scribble/main/resource/AbstractResource.java new file mode 100644 index 000000000..42ed19f4d --- /dev/null +++ b/scribble-main/src/main/java/org/scribble/main/resource/AbstractResource.java @@ -0,0 +1,44 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.main.resource; + + +/** + * This class represents the resource. + * + */ +public abstract class AbstractResource implements Resource +{ + private final String loc; + + /** + * The constructor. + * + * @param path The path to the resource -- the "full" path including import path prefix + */ + public AbstractResource(String loc) + { + this.loc = loc; + } + + + /** + * {@inheritDoc} + */ + @Override + public String getLocation() + { + return this.loc; + } +} diff --git a/scribble-main/src/main/java/org/scribble/main/resource/FileResource.java b/scribble-main/src/main/java/org/scribble/main/resource/FileResource.java new file mode 100644 index 000000000..8aa56668b --- /dev/null +++ b/scribble-main/src/main/java/org/scribble/main/resource/FileResource.java @@ -0,0 +1,58 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.main.resource; + +import java.nio.file.Path; + +/** + * This class represents the resource. + * + */ +public class FileResource extends AbstractResource +{ + private final Path path; + private java.io.InputStream _inputStream = null; + + /** + * The constructor. + * + * @param path The optional resource path + * @param is The input stream + */ + public FileResource(Path path, java.io.InputStream is) + { + super(path.toString()); + this.path = path; + this._inputStream = is; + } + + public Path getPath() + { + return path; + } + + @Override + public boolean isFileResource() + { + return true; + } + + /** + * {@inheritDoc} + */ + public java.io.InputStream getInputStream() + { + return (this._inputStream); + } +} diff --git a/scribble-main/src/main/java/org/scribble/main/resource/InlineResource.java b/scribble-main/src/main/java/org/scribble/main/resource/InlineResource.java new file mode 100644 index 000000000..b1ced5837 --- /dev/null +++ b/scribble-main/src/main/java/org/scribble/main/resource/InlineResource.java @@ -0,0 +1,53 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.main.resource; + +import java.io.ByteArrayInputStream; +import java.nio.charset.StandardCharsets; + + +// Module supplied directly as a String arg. +public class InlineResource extends AbstractResource +{ + //private final String res; + private java.io.InputStream _inputStream = null; + + /** + * The constructor. + * + * @param path The optional resource path + * @param is The input stream + */ + public InlineResource(String res) + { + super(Resource.INLINE_LOCATION); + //this.res = res; + this._inputStream = new ByteArrayInputStream( + res.getBytes(StandardCharsets.UTF_8)); + } + + @Override + public boolean isInlineResource() + { + return true; + } + + /** + * {@inheritDoc} + */ + public java.io.InputStream getInputStream() + { + return (this._inputStream); + } +} diff --git a/scribble-main/src/main/java/org/scribble/main/resource/Resource.java b/scribble-main/src/main/java/org/scribble/main/resource/Resource.java new file mode 100644 index 000000000..ccb388d6a --- /dev/null +++ b/scribble-main/src/main/java/org/scribble/main/resource/Resource.java @@ -0,0 +1,51 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.main.resource; + +import java.io.InputStream; + +/** + * This class represents the resource. + * + * CHECKME: maybe refactor core Resource classes out of cli package (generalise) + * + */ +public interface Resource +{ + public static final String INLINE_LOCATION = "-"; + + /** + * This method returns the resource path. + * + * @return The resource path -- the "full" path including import path prefix + */ + String getLocation(); + + default boolean isInlineResource() + { + return false; + } + + default boolean isFileResource() + { + return false; + } + + /** + * This method returns an input stream containing the resource content. -- FIXME: a "fresh" stream? + * + * @return The input stream + */ + InputStream getInputStream(); +} diff --git a/scribble-main/src/main/java/org/scribble/main/resource/loader/DefaultModuleLoader.java b/scribble-main/src/main/java/org/scribble/main/resource/loader/DefaultModuleLoader.java new file mode 100644 index 000000000..4959bd17c --- /dev/null +++ b/scribble-main/src/main/java/org/scribble/main/resource/loader/DefaultModuleLoader.java @@ -0,0 +1,53 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.main.resource.loader; + +import org.scribble.ast.Module; +import org.scribble.core.type.name.ModuleName; +import org.scribble.main.resource.Resource; +import org.scribble.util.Pair; +import org.scribble.util.ScribException; +import org.scribble.util.ScribParserException; + + +/** + * This class provides a default implementation of the module loader interface. + * + */ +public abstract class DefaultModuleLoader implements ModuleLoader +{ + // CHECKME: redundant? Modules recorded (and updated) in MainContext + private java.util.Map> _modules=new java.util.HashMap<>(); + + /** + * This method registers the supplied module. + * + * @param m The module + */ + public void registerModule(Resource res, Module m) + { + _modules.put(m.getFullModuleName(), new Pair<>(res, m)); + } + + /** + * {@inheritDoc} + * @throws ScribParserException + */ + @Override + public Pair loadModule(ModuleName fullname) + throws ScribParserException, ScribException + { + return (_modules.get(fullname)); + } +} diff --git a/scribble-main/src/main/java/org/scribble/main/resource/loader/ModuleLoader.java b/scribble-main/src/main/java/org/scribble/main/resource/loader/ModuleLoader.java new file mode 100644 index 000000000..77be9862c --- /dev/null +++ b/scribble-main/src/main/java/org/scribble/main/resource/loader/ModuleLoader.java @@ -0,0 +1,44 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.main.resource.loader; + +import org.scribble.ast.Module; +import org.scribble.core.type.name.ModuleName; +import org.scribble.main.resource.Resource; +import org.scribble.util.Pair; +import org.scribble.util.ScribException; +import org.scribble.util.ScribParserException; + + +/** + * This interface is responsible for loading modules. + * + * loading = sesstype.ModuleName -> Pair + * ModuleName --> Path --ResourceLocator--> Resource --AntlrParser--> ANTLR --ScribParser--> ScribNode + * + * FIXME: Path should be abstracted, e.g. URI (Path is tied to DirectoryResourceLocator) + */ +public interface ModuleLoader +{ + /** + * This method loads the module associated with the specified name. + * + * @param module The module name + * @return The module, or null if not found + * @throws ScribParserException + */ + public Pair loadModule(ModuleName fullname) + throws ScribParserException, ScribException; +} + diff --git a/scribble-main/src/main/java/org/scribble/main/resource/loader/ScribModuleLoader.java b/scribble-main/src/main/java/org/scribble/main/resource/loader/ScribModuleLoader.java new file mode 100644 index 000000000..50499f6fa --- /dev/null +++ b/scribble-main/src/main/java/org/scribble/main/resource/loader/ScribModuleLoader.java @@ -0,0 +1,120 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.main.resource.loader; + +import java.io.File; +import java.nio.file.Path; + +import org.antlr.runtime.tree.CommonTree; +import org.scribble.ast.Module; +import org.scribble.core.type.name.ModuleName; +import org.scribble.main.resource.InlineResource; +import org.scribble.main.resource.Resource; +import org.scribble.main.resource.locator.DirectoryResourceLocator; +import org.scribble.main.resource.locator.ResourceLocator; +import org.scribble.parser.ScribAntlrWrapper; +import org.scribble.util.Pair; +import org.scribble.util.ScribException; +import org.scribble.util.ScribParserException; + +// loading: ModuleName -> Module +// ModuleName --> Path --ResourceLocator--> Resource --ScribAntlrWrapper--> Module +public class ScribModuleLoader extends DefaultModuleLoader +{ + private ResourceLocator locator; + private ScribAntlrWrapper antlr; + + public ScribModuleLoader(ResourceLocator locator, ScribAntlrWrapper antlr) + { + this.locator = locator; + this.antlr = antlr; + } + + // CHECKME: check only called once? at start? + public Pair loadMainModule(Path mainpath) + throws ScribException, ScribParserException + { + Resource res = DirectoryResourceLocator.getResourceByFullPath(mainpath); + // Hardcoded to DirectoryResourceLocator + Module m = this.antlr.parse(res.getInputStream()); // Does del decoration + ScribModuleLoader.checkMainModuleName(mainpath, m); + ModuleName fullname = m.getFullModuleName(); + Pair cached = super.loadModule(fullname); + if (cached != null) + { + return cached; // CHECKME: compare loaded against cached? + } + registerModule(res, m); + return new Pair<>(res, m); + } + + // CHECKME: check only called once? at start? + public Pair loadMainModule(String inline) + throws ScribException, ScribParserException + { + Resource res = new InlineResource(inline); + Module m = (Module) this.antlr.parse(res.getInputStream()); // Does del decoration + registerModule(res, m); + return new Pair<>(res, m); + } + + // Used to load import modules (not the main module) + @Override + public Pair loadModule(ModuleName fullname) + throws ScribException, ScribParserException + { + Pair cached = super.loadModule(fullname); + if (cached != null) + { + return cached; + } + Resource res = this.locator.getResource(fullname.toPath()); + Module m = this.antlr.parse(res.getInputStream()); // Does del decoration + ScribModuleLoader.checkModuleName(fullname, res, m); + registerModule(res, m); + return new Pair<>(res, m); + } + + // Check module loaded from fullname.toPath has the expected mod decl + private static void checkModuleName(ModuleName fullname, Resource res, + Module m) + { + if (!fullname.equals(m.getFullModuleName())) + { + throw new RuntimeException("Invalid module name " + + m.getFullModuleName() + " at location: " + res.getLocation()); + } + } + + // For main module loaded from a path, check only the simple module name against the last path element + // Not Scribble's job to check nested directory location of module fully corresponds to the full name of module, cf. Java classes + private static void checkMainModuleName(Path mainpath, Module main) + throws ScribException + { + String path = mainpath.toString(); // FIXME: hack + // FileSystems.getDefault().getSeparator() ? + int last = path.lastIndexOf(File.separator); + String tmp = path.substring((last == -1) + ? 0 + : last + 1, path.lastIndexOf('.')); + if (!tmp.equals(main.getFullModuleName().getSimpleName().toString())) + // ModuleName.toString hack? + { + CommonTree source = main.getModuleDeclChild().getNameNodeChild() + .getSource(); + throw new ScribException(source, "Simple module name at path " + path + + " mismatch: " + main.getFullModuleName()); + } + } +} diff --git a/scribble-main/src/main/java/org/scribble/main/resource/locator/DirectoryResourceLocator.java b/scribble-main/src/main/java/org/scribble/main/resource/locator/DirectoryResourceLocator.java new file mode 100644 index 000000000..5d5d47fe4 --- /dev/null +++ b/scribble-main/src/main/java/org/scribble/main/resource/locator/DirectoryResourceLocator.java @@ -0,0 +1,87 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.main.resource.locator; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.LinkedList; +import java.util.List; + +import org.scribble.main.resource.FileResource; +import org.scribble.util.ScribException; + +/** + * This class provides a directory based resource locator. + * + */ +// TODO: rename exceptions +public class DirectoryResourceLocator extends ResourceLocator +{ + //private static final Logger LOG = Logger.getLogger(DirectoryResourceLocator.class.getName()); // TODO: + + private List impaths; + + /** + * This is the constructor for the directory resource + * locator, initialised with a ':' separated list + * of root directories. + * + * @param paths The ':' separated list of directory paths + */ + public DirectoryResourceLocator(List paths) + { + this.impaths = new LinkedList<>(paths); + } + + // TODO: need to sort out what "getResource" should mean at level of ResourceLocator abstraction... + // ...e.g. if arg is specifically a Path or more abstract, whether it is the complete location or partial, etc + @Override + public FileResource getResource(Path path) throws ScribException + { + for (Path impath : this.impaths) + { + Path prefixedpath = impath.resolve(path); + if (Files.exists(prefixedpath)) + { + return openFileInputStreamResource(prefixedpath); + } + } + throw new ScribException("Couldn't open resource: " + path); + } + + // "full" path from working directory, as opposed to "relative" paths from import prefixes + public static FileResource getResourceByFullPath(Path path) + throws ScribException // TODO: should be abstracted out as front-end functionality, e.g. DirectoryResourceLocator, to find/load main module; then MainContext uses abstract ResourceLocator to load rest + { + if (!Files.exists(path)) + { + throw new ScribException("File couldn't be opened: " + path); + } + return openFileInputStreamResource(path); + } + + private static FileResource openFileInputStreamResource(Path path) + throws ScribException + { + try + { + return new FileResource(path, Files.newInputStream(path)); + } + catch (IOException e) + { + throw new ScribException(e); + } + } +} diff --git a/scribble-main/src/main/java/org/scribble/main/resource/locator/IResourceLocator.java b/scribble-main/src/main/java/org/scribble/main/resource/locator/IResourceLocator.java new file mode 100644 index 000000000..06b845038 --- /dev/null +++ b/scribble-main/src/main/java/org/scribble/main/resource/locator/IResourceLocator.java @@ -0,0 +1,38 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.main.resource.locator; + +import java.nio.file.Path; + +import org.scribble.main.resource.Resource; +import org.scribble.util.ScribException; + + +/** + * This interface provides the resource location capability. + * + */ +public interface IResourceLocator +{ + /** + * This method obtains the resource associated with the + * supplied path. + * + * @param path The resource path -- "relative" path from import path prefixes + * @return The resource, or null if not found + */ + + Resource getResource(Path path) throws ScribException; + // TODO: Path should be made more abstract, e.g. some kind of URI (cf., Resource.getLocation) +} diff --git a/scribble-main/src/main/java/org/scribble/main/resource/locator/ResourceLocator.java b/scribble-main/src/main/java/org/scribble/main/resource/locator/ResourceLocator.java new file mode 100644 index 000000000..86f2c69af --- /dev/null +++ b/scribble-main/src/main/java/org/scribble/main/resource/locator/ResourceLocator.java @@ -0,0 +1,20 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.main.resource.locator; + + +public abstract class ResourceLocator implements IResourceLocator +{ + +} diff --git a/modules/monitor/LICENSE.txt b/scribble-parser/LICENSE.txt similarity index 100% rename from modules/monitor/LICENSE.txt rename to scribble-parser/LICENSE.txt diff --git a/scribble-parser/build.properties b/scribble-parser/build.properties new file mode 100644 index 000000000..c987bb752 --- /dev/null +++ b/scribble-parser/build.properties @@ -0,0 +1,33 @@ +# +# Copyright 2008 The Scribble Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except +# in compliance with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License +# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +# or implied. See the License for the specific language governing permissions and limitations under +# the License. +# + +source.. = src/main/java/,\ + target/generated-sources/antlr3/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + src/main/resources/lib/antlr-3.2.jar,\ + OSGI-INF/,\ + LICENSE.txt +src.includes = target/generated-sources/,\ + src/,\ + pom.xml,\ + build.properties,\ + META-INF/,\ + .project,\ + .classpath,\ + OSGI-INF/,\ + LICENSE.txt +jars.compile.order = .,\ + lib/antlr-3.2.jar diff --git a/scribble-parser/lib/antlr-3.5.2-complete.jar b/scribble-parser/lib/antlr-3.5.2-complete.jar new file mode 100644 index 000000000..260de7634 Binary files /dev/null and b/scribble-parser/lib/antlr-3.5.2-complete.jar differ diff --git a/scribble-parser/pom.xml b/scribble-parser/pom.xml new file mode 100644 index 000000000..3f0617c98 --- /dev/null +++ b/scribble-parser/pom.xml @@ -0,0 +1,54 @@ + + 4.0.0 + + + scribble-parser + jar + + + org.scribble + parent + 0.5.1-SNAPSHOT + ../pom.xml + + + + + org.scribble + scribble-core + + + + org.scribble + scribble-ast + + + + org.antlr + antlr-runtime + + + + + + + + org.antlr + antlr3-maven-plugin + ${antlr.version} + + + + antlr + + + + + + + + + scribble-parser + + diff --git a/modules/parser/src/main/antlr3/org/scribble/parser/antlr/Scribble-0.3.original b/scribble-parser/src/main/antlr3/org/scribble/parser/antlr/Scribble-0.3.original similarity index 100% rename from modules/parser/src/main/antlr3/org/scribble/parser/antlr/Scribble-0.3.original rename to scribble-parser/src/main/antlr3/org/scribble/parser/antlr/Scribble-0.3.original diff --git a/scribble-parser/src/main/antlr3/org/scribble/parser/antlr/Scribble.g b/scribble-parser/src/main/antlr3/org/scribble/parser/antlr/Scribble.g new file mode 100644 index 000000000..303606541 --- /dev/null +++ b/scribble-parser/src/main/antlr3/org/scribble/parser/antlr/Scribble.g @@ -0,0 +1,693 @@ +/** + * N.B. in Eclipse do Package Explorer, right click -> Open With -> Java Editor at least once for .g file association and syntax highlighting to work properly + * + * > scribble-java + * $ java -cp scribble-parser/lib/antlr-3.5.2-complete.jar org.antlr.Tool -o scribble-parser/target/generated-sources/antlr3 scribble-parser/src/main/antlr3/org/scribble/parser/antlr/Scribble.g + * + * Cygwin/Windows + * > scribble-java + * $ java -cp scribble-parser/lib/antlr-3.5.2-complete.jar org.antlr.Tool -o scribble-parser/target/generated-sources/antlr3/org/scribble/parser/antlr scribble-parser/src/main/antlr3/org/scribble/parser/antlr/Scribble.g + * $ mv scribble-parser/target/generated-sources/antlr3/org/scribble/parser/antlr/Scribble.tokens scribble-parser/target/generated-sources/antlr3/ + */ + +/* * -- ** not allowed here..... + * Pattern: most nodes have "imaginary token types". + * Where token attributes are not "inherited" from a concrete token, the default is to use textual name of the token type field as its text + * e.g., gprotodecl: ... -> ^(GPROTODECL ...). I.e., each token will be equivalent to, e.g., new CommonToken(ScribbleParser.GPROTODECL, "GPROTODECL"). + * The actual info of every imaginary node is in its children (i.e., its token text can be disregarded). + * The exceptions are for ID/EXTID, where the text is the ID value, i.e., new CommonToken(ScribbleParser.ID, "..."). + */ + +grammar Scribble; + + +options +{ + language = Java; + output = AST; + ASTLabelType = ScribNodeBase; +} + + +tokens +{ + /* Parser "input" constants (lexer output; keywords, Section 2.4) + */ + MODULE_KW = 'module'; + IMPORT_KW = 'import'; + DATA_KW = 'data'; + SIG_KW = 'sig'; + TYPE_KW = 'type'; + PROTOCOL_KW = 'protocol'; + AS_KW = 'as'; + + GLOBAL_KW = 'global'; + LOCAL_KW = 'local'; // Currently not parsed, but may be generated + EXPLICIT_KW = 'explicit'; + AUX_KW = 'aux'; + + ROLE_KW = 'role'; + SELF_KW = 'self'; // Currently not parsed, but may be generated + + FROM_KW = 'from'; + TO_KW = 'to'; + CONNECT_KW = 'connect'; + WRAP_KW = 'wrap'; + + DISCONNECT_KW = 'disconnect'; + AND_KW = 'and'; + + CHOICE_KW = 'choice'; + AT_KW = 'at'; + OR_KW = 'or'; + + REC_KW = 'rec'; + CONTINUE_KW = 'continue'; + DO_KW = 'do'; + + + /* Scribble AST token types (corresponding to the Scribble BNF). + * These token types are used by ScribTreeAdaptor to create the output nodes + * using the org.scribble.ast classes. + * (Trying to construct those classes directly from here doesn't seem to work + * well for most cases.) + * These tokens are ANTLR "imaginary tokens": they are derived by the ANTLR + * "rewrite rules" on the actual source tokens. + * The specific value of these tokens aren't important (the constants are + * accessed via fields of ScribbleParser). + * As a naming convention, we use a few "_" suffixes: _KW, _NAME, _LIT and + * _LIST. + */ + + // Special cases + EMPTY_OP = '__EMPTY_OP'; + + // Simple names "constructed directly", e.g., t=ID -> ID<...Node>[$t] + + // Compound names + GPROTO_NAME = 'GPROTO_NAME'; // Parse specifically as GProto, for ScribTreeAdaptor.create + LPROTO_NAME = 'LPROTO_NAME'; + MODULE_NAME = 'MODULE_NAME'; + DATA_NAME = 'DATA_NAME'; // N.B. distinct from DATAPARAM_NAME + SIG_NAME = 'SIG_NAME'; // N.B. distinct from SIGPARAM_NAME + + // Sig literals + SIG_LIT = 'SIG_LIT'; + PAYELEM_LIST = 'PAYELEM_LIST'; + UNARY_PAYELEM = 'UNARY_PAYELEM'; + GDELEG_PAYELEM = 'GDELEG_PAYELEM'; + + // Scribble "language" nodes, i.e., the nodes that are not "session nodes" (see below) + MODULE = 'MODULE'; + MODULEDECL = 'MODULEDECL'; + IMPORTMODULE = 'IMPORTMODULE'; + + DATADECL = 'DATADECL'; + SIGDECL = 'SIGDECL'; + GPROTODECL = 'GPROTODECL'; + PROTOMOD_LIST = 'PROTOMOD_LIST'; + + GPROTOHEADER = 'GPROTOHEADER'; + ROLEDECL_LIST = 'ROLEDECL_LIST'; + ROLEDECL = 'ROLEDECL'; + PARAMDECL_LIST = 'PARAMDECL_LIST'; + DATAPARAMDECL = 'DATAPARAMDECL'; + SIGPARAMDECL = 'SIGPARAMDECL'; + + GPROTODEF = 'GPROTODEF'; + GPROTOBLOCK = 'GPROTOBLOCK'; + + // Scribble "session nodes" -- cf. org.scribble.core.type.session vs. org.scribble.core.lang + GINTERSEQ = 'GINTERSEQ'; + + GMSGTRANSFER = 'GMSGTRANSFER'; + GCONNECT = 'GCONNECT'; + GDCONN = 'GDCONN'; // TODO: rename GDISCONN + GWRAP = 'GWRAP'; + + GCONTINUE = 'GCONTINUE'; + GDO = 'GDO'; + + ROLEARG_LIST = 'ROLEARG_LIST'; // Cf. ROLEDECL + ROLEARG = 'ROLEARG'; + NONROLEARG_LIST = 'NONROLEARG_LIST'; // Cf. ...PARAMDECL + NONROLEARG = 'NONROLEARG'; + + GCHOICE = 'GCHOICE'; + GRECURSION = 'GRECURSION'; + + // Locals: currently not directly parsed, but needed for, e.g., projection + LPROTODECL = 'LPROTODECL'; + + LPROTOHEADER = 'LPROTOHEADER'; + LSELFROLEDECL = 'LSELFROLEDECL'; + + LPROTODEF = 'LPROTODEF'; + LPROTOBLOCK = 'LPROTOBLOCK'; + + LINTERSEQ = 'LINTERSEQ'; + + LSEND = 'LSEND'; + LRECV = 'LRECV'; + LACC = 'LACC'; + LREQ = 'LREQ'; + LDCONN = 'LDCONN'; + LCLIENTWRAP = 'LCLIENTWRAP'; + LSERVERWRAP = 'LSERVERWRAP'; + + LCONTINUE = 'LCONTINUE'; + LDO = 'LDO'; + + LCHOICE = 'LCHOICE'; + LRECURSION = 'LRECURSION'; +} + + +@lexer::header +{ + package org.scribble.parser.antlr; +} + + +@lexer::members +{ + @Override + public void displayRecognitionError(String[] tokenNames, + RecognitionException e) + { + super.displayRecognitionError(tokenNames, e); + System.exit(1); + } +} + + +// Must come after tokens? +@parser::header +{ + package org.scribble.parser.antlr; + + import org.scribble.ast.NonRoleArg; + import org.scribble.ast.ScribNodeBase; + import org.scribble.ast.UnaryPayElem; + import org.scribble.ast.name.simple.AmbigNameNode; + import org.scribble.ast.name.simple.IdNode; + import org.scribble.ast.name.simple.OpNode; + import org.scribble.ast.name.simple.RecVarNode; + import org.scribble.ast.name.simple.RoleNode; + import org.scribble.ast.name.simple.SigParamNode; + import org.scribble.ast.name.simple.DataParamNode; + import org.scribble.ast.name.qualified.DataNameNode; +} + + +@parser::members +{ + // Abort tool run on parsing errors (and display user-friendly message) -- obsoletes CommonErrorNode check? + @Override + public void displayRecognitionError(String[] tokenNames, + RecognitionException e) + { + super.displayRecognitionError(tokenNames, e); + System.exit(1); + } + + // Currently unused -- TODO: check later in intermed translation, instead of parsing + public static CommonTree checkId(CommonTree id) + { + if (id.getText().contains("__")) + { + System.err.println("Double underscores are reserved: " + id); + System.exit(1); + } + return id; + } +} + + + +/**************************************************************************** + * Chapter 2 Lexical Structure (Lexer rules) + ***************************************************************************/ + +/* * // Double star here not accepted by ANTLR... + * Section 2.1 White space (Section 2.1) + */ +// Not referred to explicitly, deals with whitespace implicitly (don't delete this) +WHITESPACE: + ('\t' | ' ' | '\r' | '\n'| '\u000C')+ + { + $channel = HIDDEN; + } +; + +/** + * Section 2.2 Comments + */ +COMMENT: + '/*' .* '*/' + { + $channel=HIDDEN; + } +; + +LINE_COMMENT: + '//' ~('\n'|'\r')* '\r'? '\n' + { + $channel=HIDDEN; + } +; + + +/** + * Section 2.3 Identifiers + */ +ID: + (LETTER | DIGIT | UNDERSCORE)* + /* Underscore currently can cause ambiguities in the API generation naming + * scheme But maybe only consecutive underscores are the problem -- cannot + * completely disallow underscores as needed for projection naming scheme + * Or disallow underscores only for role/op/messagesig names + */ +; + +fragment SYMBOL: + '{' | '}' | '(' | ')' | '[' | ']' | ':' | '/' | '\\' | '.' | '\#' +| + '&' | '?' | '!' | UNDERSCORE +; + +// Comes after SYMBOL due to an ANTLR syntax highlighting issue involving +// quotes. +// Parser doesn't work without quotes here (e.g. if inlined into parser rules) +EXTID: + '\"' (LETTER | DIGIT | SYMBOL)* '\"' +; + //(LETTER | DIGIT | SYMBOL)* // Not working + +fragment LETTER: + 'a'..'z' | 'A'..'Z' +; + +fragment DIGIT: + '0'..'9' +; + +fragment UNDERSCORE: + '_' +; + + +/**************************************************************************** + * Chapter 3 Syntax (Parser rules) + ***************************************************************************/ + +/* * // Double star here not accepted by ANTLR... + * Section 3.1 Primitive Names + */ +//simplename: id=ID -> { checkId($id.tree) } ; // How to integrate with ID[$t] ? + +// "The TreeAdaptor is not called; instead [the] constructors are invoked directly." +// "Note that parameters are not allowed on token references to the left of ->:" +// "Use imaginary nodes as you normally would, but with the addition of the node type:" // But currently, ID token itself unchanged and ttype int ends up discarded +ambigname: t=ID -> ID[$t] ; +dataparamname: t=ID -> ID[$t] ; +opname: -> ^(EMPTY_OP) | t=ID -> ID[$t] ; +recvarname: t=ID -> ID[$t] ; +rolename: t=ID -> ID[$t] ; +sigparamname: t=ID -> ID[$t] ; + + +/** + * Section 3.2.1 Package, Module and Module Member Names + */ +// May be compound or simple +gprotoname: t=ID ('.' ID)* -> ^(GPROTO_NAME[$t] ID+) ; +modulename: t=ID ('.' ID)* -> ^(MODULE_NAME[$t] ID+) ; + +// Compound only (cf., e.g., gprotoname; cf. simpledataname) +qualifieddataname: t=ID '.' ID ('.' ID)* -> ^(DATA_NAME[$t] ID+) ; + +// Cf. primitive names, above +simpledataname: t=ID -> ^(DATA_NAME[$t] ID) ; +simplegprotoname: t=ID -> ^(GPROTO_NAME[$t] ID) ; +simplemodulename: t=ID -> ^(MODULE_NAME[$t] ID) ; +simplesigname: t=ID -> ^(SIG_NAME[$t] ID) ; + + +/** + * Section 3.2.2 Top-level Module Structure + * Section 3.2.3 Module Declarations + */ +// "References to tokens with rewrite not found on left of -> are imaginary tokens." +// Inlined moduledecl to make token label work +module: + t=MODULE_KW modulename ';' importmodule* nonprotodecl* protodecl* EOF +-> + ^(MODULE[$t] ^(MODULEDECL[$t] modulename) importmodule* nonprotodecl* + protodecl*) +; +// moduledecl: MODULE_KW^ modulename ';' + // "Become root" ^ cannot be on rhs? -- so "manually" rewrite to Scribble AST token types + + +/** + * Section 3.3 Import Declarations + */ +importmodule: + t=IMPORT_KW modulename (AS_KW alias=simplemodulename)? ';' +-> + ^(IMPORTMODULE[$t] modulename $alias?) +; + + +/** + * Section 3.4 "Non Protocol" Declarations + */ +nonprotodecl: + datadecl | sigdecl ; + +datadecl: + // Deprecate TYPE_KW ? + t=TYPE_KW '<' schema=ID '>' extName=EXTID FROM_KW + extSource=EXTID AS_KW alias=simpledataname ';' +-> + // alias first to be uniform with other NameDeclNode (getRawNameNodeChild) + ^(DATADECL[$t] $alias $schema $extName $extSource) +| + // CHECKME: duplicated above, because t=(TYPE_KW | DATA_KW) *sometimes* causes null token NPEs... + t=DATA_KW '<' schema=ID '>' extName=EXTID FROM_KW + extSource=EXTID AS_KW alias=simpledataname ';' +-> + // alias first to be uniform with other NameDeclNode (getRawNameNodeChild) + ^(DATADECL[$t] $alias $schema $extName $extSource) +; + +sigdecl: + t=SIG_KW '<' schema=ID '>' extName=EXTID FROM_KW extSource=EXTID AS_KW + alias=simplesigname ';' +-> + // alias first to be uniform with other NameDeclNode (getRawNameNodeChild) + ^(SIGDECL[$t] $alias $schema $extName $extSource) +; + + +/** + * Section 3.5 Message Signatures + */ +siglit: + opname '(' payelems ')' -> ^(SIG_LIT opname payelems) +; +// CHECKME: how to apply [$t] in such situations? + +payelems: + -> ^(PAYELEM_LIST) +| + payelem (',' payelem)* -> ^(PAYELEM_LIST payelem+) +; + +payelem: + // Payload element must be a data kind, cannot be a sig name + // Qualified name must be a data type name + // Also subsumes simple names, could be a data *param* + gprotoname '@' rolename -> ^(GDELEG_PAYELEM gprotoname rolename) +| + ambigname -> ^(UNARY_PAYELEM ambigname) +| + qualifieddataname -> ^(UNARY_PAYELEM qualifieddataname) +; +// { parsePayloadElem($qualifiedname.tree) } // Use ".text" instead of ".tree" for token String + + + + +/** + * Section 3.6 Protocol Declarations + */ +protodecl: + gprotodecl ; + + +/** + * Section 3.7 Global Protocol Declarations + */ +gprotodecl: + protomods gprotoheader gprotodef +-> + ^(GPROTODECL protomods gprotoheader gprotodef) +; + +// "aux" must come before "explicit" +protomods: + -> ^(PROTOMOD_LIST) +| t=AUX_KW -> ^(PROTOMOD_LIST[$t] AUX_KW) +| t=AUX_KW EXPLICIT_KW -> ^(PROTOMOD_LIST[$t] AUX_KW EXPLICIT_KW) +| t=EXPLICIT_KW -> ^(PROTOMOD_LIST[$t] EXPLICIT_KW) +; + +gprotoheader: + t=GLOBAL_KW PROTOCOL_KW simplegprotoname paramdecls roledecls +-> + ^(GPROTOHEADER[$t] simplegprotoname paramdecls roledecls) +; +// N.B. intermed translation uses full proto name + +roledecls: + t='(' roledecl (',' roledecl)* ')' -> ^(ROLEDECL_LIST[$t] roledecl+) ; + +roledecl: + t=ROLE_KW rolename -> ^(ROLEDECL[$t] rolename) ; + +paramdecls: + -> ^(PARAMDECL_LIST) +| + t='<' (paramdecl (',' paramdecl)*)? '>' -> ^(PARAMDECL_LIST[$t] paramdecl*) +; + +paramdecl: dataparamdecl | sigparamdecl ; + +dataparamdecl: + t=TYPE_KW dataparamname -> ^(DATAPARAMDECL[$t] dataparamname) +| + t=DATA_KW dataparamname -> ^(DATAPARAMDECL[$t] dataparamname) + // TODO: refactor -- cf. datadecl +; + +sigparamdecl: + t=SIG_KW sigparamname -> ^(SIGPARAMDECL[$t] sigparamname) ; + + +/** + * Section 3.7.1 Global Protocol Definitions + */ +gprotodef: + gprotoblock -> ^(GPROTODEF gprotoblock) ; + + +/** + * Section 3.7.3 Global Interaction Sequences and Blocks + */ +gprotoblock: + t='{' gseq '}' -> ^(GPROTOBLOCK[$t] gseq) +; + +gseq: + ginteraction* -> ^(GINTERSEQ ginteraction*) +; + +ginteraction: + // Simple session node: directed interaction + gconnect | gmsgtransfer + + // Simple session node: basic interaction + | gwrap | gdisconnect + + // Simple session node (other) + | gcontinue | gdo + + // Compound session node + | gchoice | grecursion +; + + +/** + * Section 3.7.4 Global Message Transfer + */ +message: + siglit | ambigname // ambigname = sig name or sig param name +; + +// TODO: qualified (messagesig) names -- although qualified signame subsumes parametername case +gmsgtransfer: + message FROM_KW rolename TO_KW rolename (',' rolename )* ';' +-> + ^(GMSGTRANSFER message rolename+) +; +// TODO: multisend + +gconnect: + message CONNECT_KW rolename TO_KW rolename ';' +-> + ^(GCONNECT message rolename rolename) +| + t=CONNECT_KW rolename TO_KW rolename ';' +-> + ^(GCONNECT[$t] ^(SIG_LIT ^(EMPTY_OP) ^(PAYELEM_LIST)) rolename rolename) + // CHECKME: deprecate? i.e., require "()" as for message transfers? i.e., simply delete this rule? +; + +gdisconnect: + t=DISCONNECT_KW rolename AND_KW rolename ';' +-> + ^(GDCONN[$t] rolename rolename) +; + +gwrap: + t=WRAP_KW rolename TO_KW rolename ';' +-> + ^(GWRAP[$t] rolename rolename) +; + + +/** + * Section 3.7.5 Global Choice + */ +gchoice: + t=CHOICE_KW AT_KW rolename gprotoblock (OR_KW gprotoblock)* +-> + ^(GCHOICE[$t] rolename gprotoblock+) +; + + +/** + * Section 3.7.6 Global Recursion + */ +grecursion: + t=REC_KW recvarname gprotoblock +-> + ^(GRECURSION[$t] recvarname gprotoblock) +; + +gcontinue: + t=CONTINUE_KW recvarname ';' +-> + ^(GCONTINUE[$t] recvarname) +; + + +/** + * Section 3.7.9 Global Do + */ +gdo: + DO_KW gprotoname nonroleargs roleargs ';' +-> + ^(GDO gprotoname nonroleargs roleargs) +; + +roleargs: + t='(' rolearg (',' rolearg)* ')' -> ^(ROLEARG_LIST[$t] rolearg+) +; + +rolearg: + rolename -> ^(ROLEARG rolename) ; + +nonroleargs: + -> ^(NONROLEARG_LIST) +| + t='<' (nonrolearg (',' nonrolearg)*)? '>' -> ^(NONROLEARG_LIST[$t] nonrolearg*) +; + +// Grammatically same as message, but qualifiedname case may also be a payload type +nonrolearg: + siglit -> ^(NONROLEARG siglit) +| + ambigname -> ^(NONROLEARG ambigname) +| + qualifieddataname -> ^(NONROLEARG qualifieddataname) // FIXME: sig name -- need an ambig qualified name +; +// { parseNonRoleArg($qualifiedname.tree) } // Like payelem, simple names need disambiguation + + + + + + + + + + + + + + + + + + + + + + + +/* +@parser::members +{ + // qn is an IdNode "holder" for a "qualifiedname" COMPOUND_NAME -- see ScribTreeAdaptor + // CHECKME: do the returns of these "bypass" ScribTreeAdaptor? specifically AmbigNode + // { parsePayloadElem($qualifiedname.tree) } // Use ".text" instead of ".tree" for token String + public static CommonTree parsePayloadElem(CommonTree qn) throws RecognitionException + { + if (qn.getChildCount() > 1) // qn has IdNode children, elements of the qualifiedname + { + // Cf. AstFactoryImpl, token creation + DataNameNode dt = new DataNameNode(new CommonToken(DATA_NAME, "DATA_NAME")); + ((List) qn.getChildren()).forEach(x -> + dt.addChild(new IdNode(new CommonToken(ID, ((CommonTree) x).getText())))); + UnaryPayElem pe = + new UnaryPayElem(new CommonToken(UNARY_PAYELEM, "UNARYPAYLOADELEM")); + pe.addChild(dt); + return pe; + } + else //if (qn.getChildCount() == 1) + { + // Similar to NonRoleArg: cannot syntactically distinguish right now between a simple data name and a param name + // Cf. AstFactoryImpl, token creation + String text = qn.getChild(0).getText(); + AmbigNameNode an = + new AmbigNameNode(AMBIG_NAME, new CommonToken(ID, text)); + UnaryPayElem e = new UnaryPayElem( + new CommonToken(UNARY_PAYELEM, "UNARYPAYLOADELEM")); + e.addChild(an); + return e; + } + } + + // qn is an IdNode "holder" for a "qualifiedname" COMPOUND_NAME -- see ScribTreeAdaptor + // Only for "qualifiedName" (DataNameNode or AmbigNameNode), not sig literals + // Use by: { parseNonRoleArg($qualifiedname.tree) } + public static CommonTree parseNonRoleArg(CommonTree qn) throws RecognitionException + { + if (qn.getChildCount() > 1) // qn has IdNode children, elements of the qualifiedname + { + // Cf. AstFactoryImpl, token creation + DataNameNode dt = + new DataNameNode(new CommonToken(DATA_NAME, "DATA_NAME")); // FIXME: could be a sig name arg... + ((List) qn.getChildren()).forEach(x -> + dt.addChild(new IdNode(new CommonToken(ID, ((CommonTree) x).getText())))); + NonRoleArg a = + new NonRoleArg(new CommonToken(ARG, "ARG")); + a.addChild(dt); + return a; + } + else //if (qn.getChildCount() == 1) + { + // Cf. AstFactoryImpl, token creation + String text = qn.getChild(0).getText(); + AmbigNameNode an = + new AmbigNameNode(AMBIG_NAME, new CommonToken(ID, text)); + NonRoleArg a = new NonRoleArg(new CommonToken(ARG, "ARG")); + a.addChild(an); + return a; + } + } +} +//*/ \ No newline at end of file diff --git a/scribble-parser/src/main/java/org/scribble/ast/AstFactoryImpl.java b/scribble-parser/src/main/java/org/scribble/ast/AstFactoryImpl.java new file mode 100644 index 000000000..b11dc9840 --- /dev/null +++ b/scribble-parser/src/main/java/org/scribble/ast/AstFactoryImpl.java @@ -0,0 +1,1027 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.ast; + +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.antlr.runtime.CommonToken; +import org.antlr.runtime.Token; +import org.scribble.ast.global.GChoice; +import org.scribble.ast.global.GConnect; +import org.scribble.ast.global.GContinue; +import org.scribble.ast.global.GDelegPayElem; +import org.scribble.ast.global.GDisconnect; +import org.scribble.ast.global.GDo; +import org.scribble.ast.global.GInteractionSeq; +import org.scribble.ast.global.GMsgTransfer; +import org.scribble.ast.global.GProtoBlock; +import org.scribble.ast.global.GProtoDecl; +import org.scribble.ast.global.GProtoDef; +import org.scribble.ast.global.GProtoHeader; +import org.scribble.ast.global.GRecursion; +import org.scribble.ast.global.GSessionNode; +import org.scribble.ast.global.GWrap; +import org.scribble.ast.local.LAcc; +import org.scribble.ast.local.LChoice; +import org.scribble.ast.local.LClientWrap; +import org.scribble.ast.local.LContinue; +import org.scribble.ast.local.LDisconnect; +import org.scribble.ast.local.LDo; +import org.scribble.ast.local.LInteractionSeq; +import org.scribble.ast.local.LProjectionDecl; +import org.scribble.ast.local.LProtoBlock; +import org.scribble.ast.local.LProtoDef; +import org.scribble.ast.local.LProtoHeader; +import org.scribble.ast.local.LRecursion; +import org.scribble.ast.local.LRecv; +import org.scribble.ast.local.LReq; +import org.scribble.ast.local.LSelfDecl; +import org.scribble.ast.local.LSend; +import org.scribble.ast.local.LServerWrap; +import org.scribble.ast.local.LSessionNode; +import org.scribble.ast.name.PayElemNameNode; +import org.scribble.ast.name.qualified.DataNameNode; +import org.scribble.ast.name.qualified.GProtoNameNode; +import org.scribble.ast.name.qualified.LProtoNameNode; +import org.scribble.ast.name.qualified.ModuleNameNode; +import org.scribble.ast.name.qualified.SigNameNode; +import org.scribble.ast.name.simple.AmbigNameNode; +import org.scribble.ast.name.simple.DataParamNode; +import org.scribble.ast.name.simple.ExtIdNode; +import org.scribble.ast.name.simple.IdNode; +import org.scribble.ast.name.simple.OpNode; +import org.scribble.ast.name.simple.RecVarNode; +import org.scribble.ast.name.simple.RoleNode; +import org.scribble.ast.name.simple.SigParamNode; +import org.scribble.core.type.kind.NonRoleParamKind; +import org.scribble.core.type.kind.PayElemKind; +import org.scribble.del.DefaultDel; +import org.scribble.del.DelFactory; +import org.scribble.del.ScribDel; +import org.scribble.parser.ScribAntlrWrapper; +import org.scribble.parser.antlr.ScribbleParser; + + +public class AstFactoryImpl implements AstFactory +{ + // Purely for the convenience of newToken(Token, type), parser instance used to access token int constants + protected final ScribbleParser parser; + protected final Map tokens; + + protected final DelFactory df; + + public AstFactoryImpl(ScribAntlrWrapper antlr) + { + try + { + Class parserC = + org.scribble.parser.antlr.ScribbleParser.class; + this.parser = antlr.newScribbleParser(null); + Map tokens = new HashMap<>(); + for (String t : ScribbleParser.tokenNames) + { + char c = t.charAt(0); + if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')) + { + tokens.put(parserC.getField(t).getInt(this.parser), t); + } + } + this.tokens = Collections.unmodifiableMap(tokens); + this.df = antlr.df; + } + catch (IllegalArgumentException | IllegalAccessException + | NoSuchFieldException | SecurityException e) + { + throw new RuntimeException(e); + } + } + + // type comes from the int constants in ScribbleParser, which come from the tokens in Scribble.g + // Pre: type is an "imaginary token" type from ScribbleParser -- (not ID) + protected CommonToken newToken(Token old, int type) + { + // As a default, token text is set to the textual name of the token type int field (also the Scribble.g default) + String text = this.tokens.get(type); + if (old == null) + { + return new CommonToken(type, text); + } + CommonToken t = new CommonToken(old); + t.setType(type); + t.setText(text); + return t; + } + + protected CommonToken newIdToken(Token old, String text) + { + if (old == null) + { + return new CommonToken(ScribbleParser.ID, text); + } + CommonToken t = new CommonToken(old); // Type and text set below, but "inherit" some other additional info + t.setType(ScribbleParser.ID); + t.setText(text); + return t; + } + + protected ScribDel createDefaultDelegate() + { + return new DefaultDel(); + } + + // public for DelDecoratorImpl (used from there; not here directly) + // Mutating setter + public static void setDel(ScribNodeBase n, ScribDel del) + { + //ScribNodeBase.del(n, del); // Defensive setter -- unnecessary ? + n.setDel(del); // Mutating setter + } + + + /** + * NameNodes + */ + + @Override + public IdNode IdNode(Token t, String text) + { + t = newIdToken(t, text); + // (Ext)IdNode is the only token with a "different" text to its node type -- info stored directly as its the text, no children + IdNode n = new IdNode(t); + n.decorateDel(this.df); + return n; + } + + @Override + public ExtIdNode ExtIdNode(Token t, String text) + { + t = newIdToken(t, text); + // (Ext)IdNode is the only token with a "different" text to its node type -- info stored directly as its the text, no children + ExtIdNode n = new ExtIdNode(t); + n.decorateDel(this.df); + return n; + } + + // Deprecate? Never need to make ambigname "manually" via af? (only constructed by ScribbleParser) + @Override + public AmbigNameNode AmbigNameNode(Token t, String text) + { + int ttype = ScribbleParser.ID; + t = newIdToken(t, text); + AmbigNameNode n = new AmbigNameNode(ttype, t); // Cf. Scribble.g, ID<...Node>[$ID] + n.decorateDel(this.df); + return n; + } + + @Override + public DataParamNode DataParamNode(Token t, String text) + { + int ttype = ScribbleParser.ID; // N.B. cf. ScribbleParser.DATA_NAME + t = newIdToken(t, text); + DataParamNode n = new DataParamNode(ttype, t); // Cf. Scribble.g, ID<...Node>[$ID] + n.decorateDel(this.df); + return n; + } + + @Override + public OpNode OpNode(Token t, String text) + { + int ttype = ScribbleParser.ID; + t = newIdToken(t, text); + OpNode n = new OpNode(ttype, t); // Cf. Scribble.g, ID<...Node>[$ID] + n.decorateDel(this.df); + return n; + } + + @Override + public RecVarNode RecVarNode(Token t, String text) + { + int ttype = ScribbleParser.ID; + t = newIdToken(t, text); + RecVarNode n = new RecVarNode(ttype, t); // Cf. Scribble.g, ID<...Node>[$ID] + n.decorateDel(this.df); + return n; + } + + @Override + public RoleNode RoleNode(Token t, String text) + { + int ttype = ScribbleParser.ID; + t = newIdToken(t, text); + RoleNode n = new RoleNode(ttype, t); // Cf. Scribble.g, ID<...Node>[$ID] + n.decorateDel(this.df); + return n; + } + + @Override + public SigParamNode SigParamNode(Token t, String text) + { + int ttype = ScribbleParser.ID; // N.B. cf. ScribbleParser.SIG_NAME + t = newIdToken(t, text); + SigParamNode n = new SigParamNode(ttype, t); // Cf. Scribble.g, ID<...Node>[$ID] + n.decorateDel(this.df); + return n; + } + + @Override + public DataNameNode DataNameNode(Token t, List elems) + { + t = newToken(t, ScribbleParser.DATA_NAME); + DataNameNode n = new DataNameNode(t); + n.addChildren(elems); + n.decorateDel(this.df); + return n; + } + + @Override + public GProtoNameNode GProtoNameNode(Token t, List elems) + { + t = newToken(t, ScribbleParser.GPROTO_NAME); + GProtoNameNode n = new GProtoNameNode(t); + n.addChildren(elems); + n.decorateDel(this.df); + return n; + } + + @Override + public LProtoNameNode LProtoNameNode(Token t, List elems) + { + t = newToken(t, ScribbleParser.LPROTO_NAME); + LProtoNameNode n = new LProtoNameNode(t); + n.addChildren(elems); + n.decorateDel(this.df); + return n; + } + + @Override + public ModuleNameNode ModuleNameNode(Token t, List elems) + { + t = newToken(t, ScribbleParser.MODULE_NAME); + ModuleNameNode n = new ModuleNameNode(t); + n.addChildren(elems); + n.decorateDel(this.df); + return n; + } + + @Override + public SigNameNode SigNameNode(Token t, List elems) + { + t = newToken(t, ScribbleParser.SIG_NAME); + SigNameNode n = new SigNameNode(t); + n.addChildren(elems); + n.decorateDel(this.df); + return n; + } + + + + /** + * From here, remaining ScribNodes that are not NameNodes -- should use the node specific addChildren1 (TODO: rename) + */ + + @Override + public Module Module(Token t, ModuleDecl moddecl, List> imports, + List> data, List> protos) + { + t = newToken(t, ScribbleParser.MODULE); + Module n = new Module(t); + n.addScribChildren(moddecl, imports, data, protos); + n.decorateDel(this.df); + return n; + } + + @Override + public ModuleDecl ModuleDecl(Token t, ModuleNameNode fullname) + { + t = newToken(t, ScribbleParser.MODULEDECL); + ModuleDecl n = new ModuleDecl(t); + n.addScribChildren(fullname); + n.decorateDel(this.df); + return n; + } + + @Override + public ImportModule ImportModule(Token t, ModuleNameNode modname, + ModuleNameNode alias) + { + t = newToken(t, ScribbleParser.IMPORTMODULE); + ImportModule n = new ImportModule(t); + n.addScribChildren(modname, alias); + n.decorateDel(this.df); + return n; + } + + @Override + public DataDecl DataDecl(Token t, IdNode schema, ExtIdNode extName, + ExtIdNode extSource, DataNameNode alias) + { + t = newToken(t, ScribbleParser.DATADECL); + DataDecl n = new DataDecl(t); + n.addScribChildren(alias, schema, extName, extSource); + n.decorateDel(this.df); + return n; + } + + @Override + public SigDecl SigDecl(Token t, IdNode schema, ExtIdNode extName, + ExtIdNode extSource, SigNameNode alias) + { + t = newToken(t, ScribbleParser.SIGDECL); + SigDecl n = new SigDecl(t); + n.addScribChildren(alias, schema, extName, extSource); + n.decorateDel(this.df); + return n; + } + + @Override + public GProtoDecl GProtoDecl(Token t, ProtoModList mods, GProtoHeader header, + GProtoDef def) + { + t = newToken(t, ScribbleParser.GPROTODECL); + GProtoDecl n = new GProtoDecl(t); + n.addScribChildren(mods, header, def); + n.decorateDel(this.df); + return n; + } + + @Override + public ProtoModList ProtoModList(Token t, List mods) + { + t = newToken(t, ScribbleParser.PROTOMOD_LIST); + ProtoModList n = new ProtoModList(t); + n.addScribChildren(mods); + n.decorateDel(this.df); + return n; + } + + @Override + public AuxMod AuxMod(Token t) + { + t = newToken(t, ScribbleParser.AUX_KW); // N.B. directly using KW + AuxMod n = new AuxMod(t); + n.decorateDel(this.df); + return n; + } + + @Override + public ExplicitMod ExplicitMod(Token t) + { + t = newToken(t, ScribbleParser.EXPLICIT_KW); // N.B. directly using KW + ExplicitMod n = new ExplicitMod(t); + n.decorateDel(this.df); + return n; + } + + @Override + public GProtoHeader GProtocolHeader(Token t, GProtoNameNode name, + RoleDeclList rs, NonRoleParamDeclList ps) + { + t = newToken(t, ScribbleParser.GPROTOHEADER); + GProtoHeader n = new GProtoHeader(t); + n.addScribChildren(name, ps, rs); + n.decorateDel(this.df); + return n; + } + + @Override + public RoleDeclList RoleDeclList(Token t, List ds) + { + t = newToken(t, ScribbleParser.ROLEDECL_LIST); + RoleDeclList n = new RoleDeclList(t); + n.addScribChildren(ds); + n.decorateDel(this.df); + return n; + } + + @Override + public RoleDecl RoleDecl(Token t, RoleNode r) + { + t = newToken(t, ScribbleParser.ROLEDECL); + RoleDecl n = new RoleDecl(t); + n.addScribChildren(r); + n.decorateDel(this.df); + return n; + } + + @Override + public NonRoleParamDeclList NonRoleParamDeclList(Token t, + List> ds) + { + t = newToken(t, ScribbleParser.PARAMDECL_LIST); + NonRoleParamDeclList n = new NonRoleParamDeclList(t); + n.addScribChildren(ds); + n.decorateDel(this.df); + return n; + } + + @Override + public DataParamDecl DataParamDecl(Token t, DataParamNode p) + { + t = newToken(t, ScribbleParser.DATAPARAMDECL); + DataParamDecl n = new DataParamDecl(t); + n.addScribChildren(p); + n.decorateDel(this.df); + return n; + } + + @Override + public SigParamDecl SigParamDecl(Token t, SigParamNode p) + { + t = newToken(t, ScribbleParser.SIGPARAMDECL); + SigParamDecl n = new SigParamDecl(t); + n.addScribChildren(p); + n.decorateDel(this.df); + return n; + } + + @Override + public GProtoDef GProtoDef(Token t, GProtoBlock block) + { + t = newToken(t, ScribbleParser.GPROTODEF); + GProtoDef n = new GProtoDef(t); + n.addScribChildren(block); + return n; + } + + @Override + public GProtoBlock GProtoBlock(Token t, GInteractionSeq seq) + { + t = newToken(t, ScribbleParser.GPROTOBLOCK); + GProtoBlock n = new GProtoBlock(t); + n.addScribChildren(seq); + n.decorateDel(this.df); + return n; + } + + @Override + public GInteractionSeq GInteractionSeq(Token t, List elems) + { + t = newToken(t, ScribbleParser.GINTERSEQ); + GInteractionSeq n = new GInteractionSeq(t); + n.addScribChildren(elems); + n.decorateDel(this.df); + return n; + } + + @Override + public SigLitNode SigLitNode(Token t, OpNode op, PayElemList pay) + { + t = newToken(t, ScribbleParser.SIG_LIT); + SigLitNode n = new SigLitNode(t); + n.addScribChildren(op, pay); + n.decorateDel(this.df); + return n; + } + + @Override + public PayElemList PayElemList(Token t, List> elems) + { + t = newToken(t, ScribbleParser.PAYELEM_LIST); + PayElemList n = new PayElemList(t); + n.addScribChildren(elems); + n.decorateDel(this.df); + return n; + } + + @Override + public UnaryPayElem UnaryPayElem(Token t, + PayElemNameNode name) + { + t = newToken(t, ScribbleParser.UNARY_PAYELEM); + UnaryPayElem n = new UnaryPayElem<>(t); + n.addScribChildren(name); + n.decorateDel(this.df); + return n; + } + + @Override + public GDelegPayElem GDelegPayElem(Token t, GProtoNameNode proto, + RoleNode role) + { + t = newToken(t, ScribbleParser.GDELEG_PAYELEM); + GDelegPayElem n = new GDelegPayElem(t); + n.addScribChildren(proto, role); + n.decorateDel(this.df); + return n; + } + + @Override + public GMsgTransfer GMsgTransfer(Token t, RoleNode src, MsgNode msg, + List dsts) + { + t = newToken(t, ScribbleParser.GMSGTRANSFER); + GMsgTransfer n = new GMsgTransfer(t); + n.addScribChildren(msg, src, dsts); + n.decorateDel(this.df); + return n; + } + + @Override + public GConnect GConnect(Token t, RoleNode src, MsgNode msg, RoleNode dst) + { + t = newToken(t, ScribbleParser.GCONNECT); + GConnect n = new GConnect(t); + n.addScribChildren(msg, src, Arrays.asList(dst)); + n.decorateDel(this.df); + return n; + } + + @Override + public GDisconnect GDisconnect(Token t, RoleNode left, RoleNode right) + { + t = newToken(t, ScribbleParser.GDCONN); + GDisconnect n = new GDisconnect(t); + n.addScribChildren(left, right); + n.decorateDel(this.df); + return n; + } + + @Override + public GWrap GWrap(Token t, RoleNode client, RoleNode server) + { + t = newToken(t, ScribbleParser.GWRAP); + GWrap n = new GWrap(t); + n.addScribChildren(client, server); + n.decorateDel(this.df); + return n; + } + + @Override + public GContinue GContinue(Token t, RecVarNode rv) + { + t = newToken(t, ScribbleParser.GCONTINUE); + GContinue n = new GContinue(t); + n.addScribChildren(rv); + n.decorateDel(this.df); + return n; + } + + @Override + public GDo GDo(Token t, GProtoNameNode proto, NonRoleArgList as, + RoleArgList rs) + { + t = newToken(t, ScribbleParser.GDO); + GDo n = new GDo(t); + n.addScribChildren(proto, as, rs); + n.decorateDel(this.df); + return n; + } + + @Override + public RoleArgList RoleArgList(Token t, List rs) + { + t = newToken(t, ScribbleParser.ROLEARG_LIST); + RoleArgList n = new RoleArgList(t); + n.addScribChildren(rs); + n.decorateDel(this.df); + return n; + } + + @Override + public RoleArg RoleArg(Token t, RoleNode r) + { + t = newToken(t, ScribbleParser.ROLEARG); + RoleArg n = new RoleArg(t); + n.addScribChildren(r); + n.decorateDel(this.df); + return n; + } + + @Override + public NonRoleArgList NonRoleArgList(Token t, List as) + { + t = newToken(t, ScribbleParser.NONROLEARG_LIST); + NonRoleArgList n = new NonRoleArgList(t); + n.addScribChildren(as); + n.decorateDel(this.df); + return n; + } + + @Override + public NonRoleArg NonRoleArg(Token t, NonRoleArgNode arg) + { + t = newToken(t, ScribbleParser.NONROLEARG); + NonRoleArg n = new NonRoleArg(t); + n.addScribChildren(arg); + n.decorateDel(this.df); + return n; + } + + @Override + public GChoice GChoice(Token t, RoleNode subj, List blocks) + { + t = newToken(t, ScribbleParser.GCHOICE); + GChoice n = new GChoice(t); + n.addScribChildren(subj, blocks); + n.decorateDel(this.df); + return n; + } + + @Override + public GRecursion GRecursion(Token t, RecVarNode rv, GProtoBlock block) + { + t = newToken(t, ScribbleParser.GRECURSION); + GRecursion n = new GRecursion(t); + n.addScribChildren(rv, block); + n.decorateDel(this.df); + return n; + } + + @Override + public LProjectionDecl LProjectionDecl(Token t, ProtoModList mods, + LProtoHeader header, LProtoDef def, GProtoNameNode fullname, + RoleNode self) // del extends that of LProtoDecl + { + t = newToken(t, ScribbleParser.LPROTODECL); + LProjectionDecl n = new LProjectionDecl(t); + n.addScribChildren(mods, header, def, fullname, self); + n.decorateDel(this.df); + return n; + } + + @Override + public LProtoHeader LProtoHeader(Token t, LProtoNameNode name, RoleDeclList rs, + NonRoleParamDeclList ps) + { + t = newToken(t, ScribbleParser.LPROTOHEADER); + LProtoHeader n = new LProtoHeader(t); + n.addScribChildren(name, ps, rs); + n.decorateDel(this.df); + return n; + } + + @Override + public LSelfDecl LSelfDecl(Token t, RoleNode r) + { + t = newToken(t, ScribbleParser.LSELFROLEDECL); + LSelfDecl n = new LSelfDecl(t); + n.addScribChildren(r); + n.decorateDel(this.df); + return n; + } + + @Override + public LProtoDef LProtoDef(Token t, LProtoBlock block) + { + t = newToken(t, ScribbleParser.LPROTODEF); + LProtoDef n = new LProtoDef(t); + n.addScribChildren(block); + return n; + } + + @Override + public LProtoBlock LProtoBlock(Token t, LInteractionSeq seq) + { + t = newToken(t, ScribbleParser.LPROTOBLOCK); + LProtoBlock n = new LProtoBlock(t); + n.addScribChildren(seq); + n.decorateDel(this.df); + return n; + } + + @Override + public LInteractionSeq LInteractionSeq(Token t, List elems) + { + t = newToken(t, ScribbleParser.LINTERSEQ); + LInteractionSeq n = new LInteractionSeq(t); + n.addScribChildren(elems); + n.decorateDel(this.df); + return n; + } + + @Override + public LSend LSend(Token t, RoleNode self, MsgNode msg, RoleNode dst) + { + t = newToken(t, ScribbleParser.LSEND); + LSend n = new LSend(t); + n.addScribChildren(msg, self, Arrays.asList(dst)); + n.decorateDel(this.df); + return n; + } + + @Override + public LRecv LRecv(Token t, RoleNode src, MsgNode msg, RoleNode self) + { + t = newToken(t, ScribbleParser.LRECV); + LRecv n = new LRecv(t); + n.addScribChildren(msg, src, Arrays.asList(self)); + n.decorateDel(this.df); + return n; + } + + @Override + public LAcc LAcc(Token t, RoleNode src, MsgNode msg, RoleNode self) + { + t = newToken(t, ScribbleParser.LACC); + LAcc n = new LAcc(t); + n.addScribChildren(msg, src, Arrays.asList(self)); + n.decorateDel(this.df); + return n; + } + + @Override + public LReq LReq(Token t, RoleNode self, MsgNode msg, RoleNode dst) + { + t = newToken(t, ScribbleParser.LREQ); + LReq n = new LReq(t); + n.addScribChildren(msg, self, Arrays.asList(dst)); + n.decorateDel(this.df); + return n; + } + + @Override + public LDisconnect LDisconnect(Token t, RoleNode self, RoleNode peer) + { + t = newToken(t, ScribbleParser.LDCONN); + LDisconnect n = new LDisconnect(t); + n.addScribChildren(self, peer); + n.decorateDel(this.df); + return n; + } + + @Override + public LClientWrap LClientWrap(Token t, RoleNode client, RoleNode server) + { + t = newToken(t, ScribbleParser.LCLIENTWRAP); + LClientWrap n = new LClientWrap(t); + n.addScribChildren(client, server); + n.decorateDel(this.df); + return n; + } + + @Override + public LServerWrap LServerWrap(Token t, RoleNode client, RoleNode server) + { + t = newToken(t, ScribbleParser.LSERVERWRAP); + LServerWrap n = new LServerWrap(t); + n.addScribChildren(client, server); + n.decorateDel(this.df); + return n; + } + + @Override + public LContinue LContinue(Token t, RecVarNode rv) + { + t = newToken(t, ScribbleParser.LCONTINUE); + LContinue n = new LContinue(t); + n.addScribChildren(rv); + n.decorateDel(this.df); + return n; + } + + @Override + public LDo LDo(Token t, LProtoNameNode proto, NonRoleArgList as, + RoleArgList rs) + { + t = newToken(t, ScribbleParser.LDO); + LDo n = new LDo(t); + n.addScribChildren(proto, as, rs); + n.decorateDel(this.df); + return n; + } + + @Override + public LChoice LChoice(Token t, RoleNode subj, List blocks) + { + t = newToken(t, ScribbleParser.LCHOICE); + LChoice n = new LChoice(t); + n.addScribChildren(subj, blocks); + n.decorateDel(this.df); + return n; + } + + @Override + public LRecursion LRecursion(Token t, RecVarNode rv, LProtoBlock block) + { + t = newToken(t, ScribbleParser.LRECURSION); + LRecursion n = new LRecursion(t); + n.addScribChildren(rv, block); + n.decorateDel(this.df); + return n; + } +} + + + + + + + + + + + + + + + + + + + + + + + + + + +/* + @Override + public DummyProjectionRoleNode DummyProjectionRoleNode() + { + DummyProjectionRoleNode dprn = new DummyProjectionRoleNode(); + dprn = (DummyProjectionRoleNode) dprn.del(createDefaultDelegate()); + return dprn; + } + + @Override + public LDelegationElem LDelegationElem(CommonTree source, + LProtocolNameNode proto) + { + LDelegationElem de = new LDelegationElem(source, proto); + de = del(de, createDefaultDelegate()); + return de; + } + + @Override // Called from LProtocolDecl::clone, but currently never used -- local proto decls only projected, not parsed + public LProtocolDecl LProtocolDecl(CommonTree source, List mods, + LProtocolHeader header, LProtocolDef def) + { + LProtocolDecl lpd = new LProtocolDecl(source, mods, header, def); + lpd = del(lpd, new LProtocolDeclDel()); + return lpd; + } + + @Override + public LProjectionDecl LProjectionDecl(CommonTree source, + List mods, GProtocolName fullname, Role self, + LProtocolHeader header, LProtocolDef def) + // del extends that of LProtocolDecl + { + LProjectionDecl lpd = new LProjectionDecl(source, mods, header, def); + lpd = del(lpd, new LProjectionDeclDel());//fullname, self)); + return lpd; + } + + @Override + public LProtocolHeader LProtocolHeader(CommonTree source, + LProtocolNameNode name, RoleDeclList roledecls, + NonRoleParamDeclList paramdecls) + { + LProtocolHeader lph = new LProtocolHeader(source, name, roledecls, + paramdecls); + lph = del(lph, createDefaultDelegate()); + return lph; + } + + @Override + public SelfRoleDecl SelfRoleDecl(CommonTree source, RoleNode namenode) + { + SelfRoleDecl rd = new SelfRoleDecl(source, namenode); + rd = del(rd, new RoleDeclDel()); + return rd; + } + + @Override + public LProtocolDef LProtocolDef(CommonTree source, LProtocolBlock block) + { + LProtocolDef lpd = new LProtocolDef(source, block); + lpd = del(lpd, new LProtocolDefDel()); + return lpd; + } + + @Override + public LProtocolBlock LProtocolBlock(CommonTree source, LInteractionSeq seq) + { + LProtocolBlock lpb = new LProtocolBlock(source, seq); + lpb = del(lpb, new LProtocolBlockDel()); + return lpb; + } + + @Override + public LInteractionSeq LInteractionSeq(CommonTree source, + List actions) + { + LInteractionSeq lis = new LInteractionSeq(source, actions); + lis = del(lis, new LInteractionSeqDel()); + return lis; + } + + @Override + public LSend LSend(CommonTree source, RoleNode src, MessageNode msg, + List dests) + { + LSend ls = new LSend(source, src, msg, dests); + ls = del(ls, new LSendDel()); + return ls; + } + + @Override + public LRecv LReceive(CommonTree source, RoleNode src, MessageNode msg, + List dests) + { + LRecv ls = new LRecv(source, src, msg, dests); + ls = del(ls, new LReceiveDel()); + return ls; + } + + @Override + public LRequest LRequest(CommonTree source, RoleNode src, MessageNode msg, + RoleNode dest) + //public LConnect LConnect(RoleNode src, RoleNode dest) + { + LRequest lc = new LRequest(source, src, msg, dest); + //LConnect lc = new LConnect(src, dest); + lc = del(lc, new LRequestDel()); + return lc; + } + + @Override + public LAccept LAccept(CommonTree source, RoleNode src, MessageNode msg, + RoleNode dest) + //public LAccept LAccept(RoleNode src, RoleNode dest) + { + LAccept la = new LAccept(source, src, msg, dest); + //LAccept la = new LAccept(src, dest); + la = del(la, new LAcceptDel()); + return la; + } + + @Override + public LDisconnect LDisconnect(CommonTree source, RoleNode self, + RoleNode peer) + { + LDisconnect lc = new LDisconnect(source, UnitMessageSigNode(), self, peer); + lc = del(lc, new LDisconnectDel()); + return lc; + } + + @Override + public LWrapClient LWrapClient(CommonTree source, RoleNode self, + RoleNode peer) + { + LWrapClient lwc = new LWrapClient(source, UnitMessageSigNode(), self, peer); + lwc = del(lwc, new LWrapClientDel()); + return lwc; + } + + @Override + public LWrapServer LWrapServer(CommonTree source, RoleNode self, + RoleNode peer) + { + LWrapServer lws = new LWrapServer(source, UnitMessageSigNode(), self, peer); + lws = del(lws, new LWrapServerDel()); + return lws; + } + + @Override + public LChoice LChoice(CommonTree source, RoleNode subj, + List blocks) + { + LChoice lc = new LChoice(source, subj, blocks); + lc = del(lc, new LChoiceDel()); + return lc; + } + + @Override + public LRecursion LRecursion(CommonTree source, RecVarNode recvar, + LProtocolBlock block) + { + LRecursion lr = new LRecursion(source, recvar, block); + lr = del(lr, new LRecursionDel()); + return lr; + } + + @Override + public LContinue LContinue(CommonTree source, RecVarNode recvar) + { + LContinue lc = new LContinue(source, recvar); + lc = del(lc, new LContinueDel()); + return lc; + } + + @Override + public LDo LDo(CommonTree source, RoleArgList roleinstans, + NonRoleArgList arginstans, LProtocolNameNode proto) + { + LDo ld = new LDo(source, roleinstans, arginstans, proto); + ld = del(ld, new LDoDel()); + return ld; + } +*/ diff --git a/scribble-parser/src/main/java/org/scribble/del/DelFactoryImpl.java b/scribble-parser/src/main/java/org/scribble/del/DelFactoryImpl.java new file mode 100644 index 000000000..88c607567 --- /dev/null +++ b/scribble-parser/src/main/java/org/scribble/del/DelFactoryImpl.java @@ -0,0 +1,543 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.del; + +import org.scribble.ast.AstFactoryImpl; +import org.scribble.ast.AuxMod; +import org.scribble.ast.DataDecl; +import org.scribble.ast.DataParamDecl; +import org.scribble.ast.ExplicitMod; +import org.scribble.ast.ImportModule; +import org.scribble.ast.Module; +import org.scribble.ast.ModuleDecl; +import org.scribble.ast.NonRoleArg; +import org.scribble.ast.NonRoleArgList; +import org.scribble.ast.NonRoleParamDeclList; +import org.scribble.ast.PayElemList; +import org.scribble.ast.ProtoModList; +import org.scribble.ast.RoleArg; +import org.scribble.ast.RoleArgList; +import org.scribble.ast.RoleDecl; +import org.scribble.ast.RoleDeclList; +import org.scribble.ast.ScribNodeBase; +import org.scribble.ast.SigDecl; +import org.scribble.ast.SigLitNode; +import org.scribble.ast.SigParamDecl; +import org.scribble.ast.UnaryPayElem; +import org.scribble.ast.global.GChoice; +import org.scribble.ast.global.GConnect; +import org.scribble.ast.global.GContinue; +import org.scribble.ast.global.GDelegPayElem; +import org.scribble.ast.global.GDisconnect; +import org.scribble.ast.global.GDo; +import org.scribble.ast.global.GInteractionSeq; +import org.scribble.ast.global.GMsgTransfer; +import org.scribble.ast.global.GProtoBlock; +import org.scribble.ast.global.GProtoDecl; +import org.scribble.ast.global.GProtoDef; +import org.scribble.ast.global.GProtoHeader; +import org.scribble.ast.global.GRecursion; +import org.scribble.ast.global.GWrap; +import org.scribble.ast.local.LAcc; +import org.scribble.ast.local.LChoice; +import org.scribble.ast.local.LClientWrap; +import org.scribble.ast.local.LContinue; +import org.scribble.ast.local.LDisconnect; +import org.scribble.ast.local.LDo; +import org.scribble.ast.local.LInteractionSeq; +import org.scribble.ast.local.LProjectionDecl; +import org.scribble.ast.local.LProtoBlock; +import org.scribble.ast.local.LProtoDecl; +import org.scribble.ast.local.LProtoDef; +import org.scribble.ast.local.LProtoHeader; +import org.scribble.ast.local.LRecursion; +import org.scribble.ast.local.LRecv; +import org.scribble.ast.local.LReq; +import org.scribble.ast.local.LSelfDecl; +import org.scribble.ast.local.LSend; +import org.scribble.ast.local.LServerWrap; +import org.scribble.ast.name.qualified.DataNameNode; +import org.scribble.ast.name.qualified.GProtoNameNode; +import org.scribble.ast.name.qualified.LProtoNameNode; +import org.scribble.ast.name.qualified.ModuleNameNode; +import org.scribble.ast.name.qualified.SigNameNode; +import org.scribble.ast.name.simple.AmbigNameNode; +import org.scribble.ast.name.simple.DataParamNode; +import org.scribble.ast.name.simple.ExtIdNode; +import org.scribble.ast.name.simple.IdNode; +import org.scribble.ast.name.simple.OpNode; +import org.scribble.ast.name.simple.RecVarNode; +import org.scribble.ast.name.simple.RoleNode; +import org.scribble.ast.name.simple.SigParamNode; +import org.scribble.del.global.GChoiceDel; +import org.scribble.del.global.GConnectDel; +import org.scribble.del.global.GContinueDel; +import org.scribble.del.global.GDelegationElemDel; +import org.scribble.del.global.GDisconnectDel; +import org.scribble.del.global.GDoDel; +import org.scribble.del.global.GInteractionSeqDel; +import org.scribble.del.global.GMessageTransferDel; +import org.scribble.del.global.GProtoBlockDel; +import org.scribble.del.global.GProtoDeclDel; +import org.scribble.del.global.GProtoDefDel; +import org.scribble.del.global.GRecursionDel; +import org.scribble.del.global.GWrapDel; +import org.scribble.del.local.LAccDel; +import org.scribble.del.local.LChoiceDel; +import org.scribble.del.local.LClientWrapDel; +import org.scribble.del.local.LContinueDel; +import org.scribble.del.local.LDisconnectDel; +import org.scribble.del.local.LDoDel; +import org.scribble.del.local.LInteractionSeqDel; +import org.scribble.del.local.LProjectionDeclDel; +import org.scribble.del.local.LProtoBlockDel; +import org.scribble.del.local.LProtoDeclDel; +import org.scribble.del.local.LProtoDefDel; +import org.scribble.del.local.LRecursionDel; +import org.scribble.del.local.LRecvDel; +import org.scribble.del.local.LReqDel; +import org.scribble.del.local.LSendDel; +import org.scribble.del.local.LServerWrapDel; +import org.scribble.del.name.qualified.DataNameNodeDel; +import org.scribble.del.name.qualified.SigNameNodeDel; +import org.scribble.del.name.simple.AmbigNameNodeDel; +import org.scribble.del.name.simple.NonRoleParamNodeDel; +import org.scribble.del.name.simple.RecVarNodeDel; +import org.scribble.del.name.simple.RoleNodeDel; + + +public class DelFactoryImpl implements DelFactory +{ + public DelFactoryImpl() + { + + } + + protected ScribDel createDefaultDel() + { + return new DefaultDel(); + } + + // Mutating setter + protected static void setDel(ScribNodeBase n, ScribDel del) + { + AstFactoryImpl.setDel(n, del); + } + + @Override + public void IdNode(IdNode n) + { + setDel(n, createDefaultDel()); // Necessary? + } + + @Override + public void ExtIdNode(ExtIdNode n) + { + setDel(n, createDefaultDel()); // Necessary? + } + + @Override + public void AmbigNameNode(AmbigNameNode n) + { + setDel(n, new AmbigNameNodeDel()); + } + + @Override + public void DataParamNode(DataParamNode n) + { + setDel(n, new NonRoleParamNodeDel()); + } + + @Override + public void OpNode(OpNode n) + { + setDel(n, createDefaultDel()); + } + + @Override + public void RecVarNode(RecVarNode n) + { + setDel(n, new RecVarNodeDel()); + } + + @Override + public void RoleNode(RoleNode r) + { + setDel(r, new RoleNodeDel()); + } + + @Override + public void SigParamNode(SigParamNode n) + { + setDel(n, new NonRoleParamNodeDel()); + } + + @Override + public void DataNameNode(DataNameNode n) + { + setDel(n, new DataNameNodeDel()); + } + + @Override + public void GProtoNameNode(GProtoNameNode n) + { + setDel(n, createDefaultDel()); + } + + @Override + public void LProtoNameNode(LProtoNameNode n) + { + setDel(n, createDefaultDel()); + } + + @Override + public void ModuleNameNode(ModuleNameNode n) + { + setDel(n, createDefaultDel()); + } + + @Override + public void SigNameNode(SigNameNode n) + { + setDel(n, new SigNameNodeDel()); + } + + @Override + public void Module(Module n) + { + setDel(n, new ModuleDel()); + } + + @Override + public void ModuleDecl(ModuleDecl n) + { + setDel(n, createDefaultDel()); + } + + @Override + public void ImportModule(ImportModule n) + { + setDel(n, new ImportModuleDel()); + } + + @Override + public void DataDecl(DataDecl n) + { + setDel(n, createDefaultDel()); + } + + @Override + public void SigDecl(SigDecl n) + { + setDel(n, createDefaultDel()); + } + + @Override + public void GProtoDecl(GProtoDecl n) + { + setDel(n, new GProtoDeclDel()); + } + + @Override + public void ProtoModList(ProtoModList n) + { + setDel(n, createDefaultDel()); + } + + @Override + public void AuxMod(AuxMod n) + { + setDel(n, createDefaultDel()); + } + + @Override + public void ExplicitMod(ExplicitMod n) + { + setDel(n, createDefaultDel()); + } + + @Override + public void GProtoHeader(GProtoHeader n) + { + setDel(n, createDefaultDel()); + } + + @Override + public void RoleDeclList(RoleDeclList n) + { + setDel(n, new RoleDeclListDel()); + } + + @Override + public void RoleDecl(RoleDecl n) + { + setDel(n, new RoleDeclDel()); + } + + @Override + public void NonRoleParamDeclList(NonRoleParamDeclList n) + { + setDel(n, new NonRoleParamDeclListDel()); + } + + @Override + public void DataParamDecl(DataParamDecl n) + { + setDel(n, new NonRoleParamDeclDel()); + } + + @Override + public void SigParamDecl(SigParamDecl sd) + { + setDel(sd, new NonRoleParamDeclDel()); + } + + @Override + public void GProtoDef(GProtoDef n) + { + setDel(n, new GProtoDefDel()); + } + + @Override + public void GProtoBlock(GProtoBlock n) + { + setDel(n, new GProtoBlockDel()); + } + + @Override + public void GInteractionSeq(GInteractionSeq n) + { + setDel(n, new GInteractionSeqDel()); + } + + @Override + public void SigLitNode(SigLitNode n) + { + setDel(n, createDefaultDel()); + } + + @Override + public void PayElemList(PayElemList n) + { + setDel(n, createDefaultDel()); + //setDel(pay, new PayloadElemListDel()); + } + + @Override + public void UnaryPayElem(UnaryPayElem n) + { + setDel(n, createDefaultDel()); + } + + @Override + public void GDelegPayElem(GDelegPayElem n) + { + //setDel(n, createDefaultDelegate()); + setDel(n, new GDelegationElemDel()); + } + + /*@Override + public LDelegationElem LDelegationElem(CommonTree source, LProtocolNameNode proto) + { + LDelegationElem de = new LDelegationElem(source, proto); + de = setDel(de, createDefaultDelegate()); + return de; + }*/ + + @Override + public void GMsgTransfer(GMsgTransfer n) + { + setDel(n, new GMessageTransferDel()); + } + + @Override + public void GConnect(GConnect n) + { + setDel(n, new GConnectDel()); + } + + @Override + public void GDisconnect(GDisconnect n) + { + setDel(n, new GDisconnectDel()); + } + + @Override + public void GWrap(GWrap n) + { + setDel(n, new GWrapDel()); + } + + @Override + public void GContinue(GContinue n) + { + setDel(n, new GContinueDel()); + } + + @Override + public void GDo(GDo n) + { + setDel(n, new GDoDel()); + } + + @Override + public void RoleArgList(RoleArgList n) + { + setDel(n, new RoleArgListDel()); + } + + @Override + public void RoleArg(RoleArg n) + { + setDel(n, createDefaultDel()); + } + + @Override + public void NonRoleArgList(NonRoleArgList n) + { + setDel(n, new NonRoleArgListDel()); + } + + @Override + public void NonRoleArg(NonRoleArg n) + { + setDel(n, createDefaultDel()); + } + + @Override + public void GChoice(GChoice n) + { + setDel(n, new GChoiceDel()); + } + + @Override + public void GRecursion(GRecursion n) + { + setDel(n, new GRecursionDel()); + } + + @Override + public void LProtoDecl(LProtoDecl n) + { + setDel(n, new LProtoDeclDel()); + } + + @Override + public void LProjectionDecl(LProjectionDecl n) + { + setDel(n, new LProjectionDeclDel()); + } + + @Override + public void LProtoHeader(LProtoHeader n) + { + setDel(n, createDefaultDel()); + } + + @Override + public void LSelfDecl(LSelfDecl n) + { + setDel(n, new RoleDeclDel()); + } + + @Override + public void LProtoDef(LProtoDef n) + { + setDel(n, new LProtoDefDel()); + } + + @Override + public void LProtoBlock(LProtoBlock n) + { + setDel(n, new LProtoBlockDel()); + } + + @Override + public void LInteractionSeq(LInteractionSeq n) + { + setDel(n, new LInteractionSeqDel()); + } + + /*@Override + public void LDelegElem(LDelegElem n) + { + setDel(n, new LDelegElemDel()); + }*/ + + @Override + public void LSend(LSend n) + { + setDel(n, new LSendDel()); + } + + @Override + public void LRecv(LRecv n) + { + setDel(n, new LRecvDel()); + } + + @Override + public void LAcc(LAcc n) + { + setDel(n, new LAccDel()); + } + + @Override + public void LReq(LReq n) + { + setDel(n, new LReqDel()); + } + + @Override + public void LDisconnect(LDisconnect n) + { + setDel(n, new LDisconnectDel()); + } + + @Override + public void LClientWrap(LClientWrap n) + { + setDel(n, new LClientWrapDel()); + } + + @Override + public void LServerWrap(LServerWrap n) + { + setDel(n, new LServerWrapDel()); + } + + @Override + public void LContinue(LContinue n) + { + setDel(n, new LContinueDel()); + } + + @Override + public void LDo(LDo n) + { + setDel(n, new LDoDel()); + } + + @Override + public void LChoice(LChoice n) + { + setDel(n, new LChoiceDel()); + } + + @Override + public void LRecursion(LRecursion n) + { + setDel(n, new LRecursionDel()); + } +} diff --git a/scribble-parser/src/main/java/org/scribble/parser/ScribAntlrWrapper.java b/scribble-parser/src/main/java/org/scribble/parser/ScribAntlrWrapper.java new file mode 100644 index 000000000..3ac6bedb4 --- /dev/null +++ b/scribble-parser/src/main/java/org/scribble/parser/ScribAntlrWrapper.java @@ -0,0 +1,122 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.parser; + +import java.io.IOException; +import java.io.InputStream; +import java.util.List; +import java.util.stream.Collectors; + +import org.antlr.runtime.ANTLRStringStream; +import org.antlr.runtime.CommonTokenStream; +import org.antlr.runtime.Lexer; +import org.antlr.runtime.RecognitionException; +import org.antlr.runtime.tree.CommonErrorNode; +import org.antlr.runtime.tree.CommonTree; +import org.scribble.ast.Module; +import org.scribble.del.DelFactory; +import org.scribble.parser.antlr.ScribbleLexer; +import org.scribble.parser.antlr.ScribbleParser; +import org.scribble.util.ScribParserException; + +// InputStream -> ANTLR CommonTree -- parses Resource.getInputStream() into ANTLR CommonTrees +// Wraps the ScribbleLexer and ScribbleParser generated by ANTLR from Scribble.g +public class ScribAntlrWrapper +{ + public final DelFactory df; // Will be shared with af and Job (by Main) + + public ScribAntlrWrapper(DelFactory df) + { + this.df = df; + } + + // Scribble extensions should override newScribbleLexer/Parser as appropriate + // A fresh Lexer/Parser is needed by each call to parse + public Lexer newScribbleLexer(ANTLRStringStream ss) + { + return new ScribbleLexer(ss); + } + + // Scribble extensions should override newScribbleLexer/Parser as appropriate + // ScribbleParser: a Parser that has a top-level "module" method + // (And has "setTreeAdaptor") + public ScribbleParser newScribbleParser(CommonTokenStream ts) + { + return new ScribbleParser(ts); + } + + // Parse InputStream (from a Resource) into a Module -- N.B. not del decorated (yet) + public Module parse(InputStream is) throws ScribParserException + { + try + { + String input = ScribAntlrWrapper.readInput(is); + Lexer lex = newScribbleLexer(new ANTLRStringStream(input)); + Module mod = runScribbleParser(new CommonTokenStream(lex)); + return mod; + } + catch (IOException e) + { + throw new ScribParserException(e); + } + } + + protected Module runScribbleParser(CommonTokenStream ts) + throws ScribParserException + { + try + { + ScribbleParser p = newScribbleParser(ts); + p.setTreeAdaptor(new ScribTreeAdaptor(this.df)); + return (Module) p.module().getTree(); + // Cast, because no convenient way to expose an interface for all (Scribble)Parsers with top-level "module" method? + } + catch (RecognitionException e) + { + throw new ScribParserException(e); + } + } + + // CHECKME: should this be used somewhere? + public static void checkForAntlrErrors(CommonTree t) + { + if (t.getChildCount() > 0) // getChildren returns null instead of empty list + { + List errors = ((List) t.getChildren()).stream() + .filter(c -> (c instanceof CommonErrorNode)) + .map(c -> (CommonErrorNode) c) + .collect(Collectors.toList()); + if (errors.size() > 0) // Antlr prints errors to System.err by default, but then attempts to carry on + // Should never get here now, Antlr displayRecognitionError overridden to force exit: Antlr error recovery means not all errors produce CommonErrorNode + { + // TODO: improve feedback message + System.err + .println("[ScribParser] Aborting due to parsing errors: " + errors); + System.exit(1); + } + } + } + + protected static String readInput(InputStream is) throws IOException + { + return new String(ScribAntlrWrapper.readResource(is)); + } + + private static byte[] readResource(InputStream is) throws IOException + { + byte[] bs = new byte[is.available()]; + is.read(bs); + return bs; + } +} diff --git a/scribble-parser/src/main/java/org/scribble/parser/ScribTreeAdaptor.java b/scribble-parser/src/main/java/org/scribble/parser/ScribTreeAdaptor.java new file mode 100644 index 000000000..10b18fdff --- /dev/null +++ b/scribble-parser/src/main/java/org/scribble/parser/ScribTreeAdaptor.java @@ -0,0 +1,169 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.parser; + +import org.antlr.runtime.CommonToken; +import org.antlr.runtime.Token; +import org.antlr.runtime.tree.CommonTreeAdaptor; +import org.scribble.ast.AuxMod; +import org.scribble.ast.DataDecl; +import org.scribble.ast.DataParamDecl; +import org.scribble.ast.ExplicitMod; +import org.scribble.ast.ImportModule; +import org.scribble.ast.Module; +import org.scribble.ast.ModuleDecl; +import org.scribble.ast.NonRoleArg; +import org.scribble.ast.NonRoleArgList; +import org.scribble.ast.NonRoleParamDeclList; +import org.scribble.ast.PayElemList; +import org.scribble.ast.ProtoModList; +import org.scribble.ast.RoleArg; +import org.scribble.ast.RoleArgList; +import org.scribble.ast.RoleDecl; +import org.scribble.ast.RoleDeclList; +import org.scribble.ast.ScribNil; +import org.scribble.ast.ScribNode; +import org.scribble.ast.ScribNodeBase; +import org.scribble.ast.SigDecl; +import org.scribble.ast.SigLitNode; +import org.scribble.ast.SigParamDecl; +import org.scribble.ast.UnaryPayElem; +import org.scribble.ast.global.GChoice; +import org.scribble.ast.global.GConnect; +import org.scribble.ast.global.GContinue; +import org.scribble.ast.global.GDelegPayElem; +import org.scribble.ast.global.GDisconnect; +import org.scribble.ast.global.GDo; +import org.scribble.ast.global.GInteractionSeq; +import org.scribble.ast.global.GMsgTransfer; +import org.scribble.ast.global.GProtoBlock; +import org.scribble.ast.global.GProtoDecl; +import org.scribble.ast.global.GProtoDef; +import org.scribble.ast.global.GProtoHeader; +import org.scribble.ast.global.GRecursion; +import org.scribble.ast.global.GWrap; +import org.scribble.ast.name.qualified.DataNameNode; +import org.scribble.ast.name.qualified.GProtoNameNode; +import org.scribble.ast.name.qualified.ModuleNameNode; +import org.scribble.ast.name.qualified.SigNameNode; +import org.scribble.ast.name.simple.ExtIdNode; +import org.scribble.ast.name.simple.IdNode; +import org.scribble.ast.name.simple.OpNode; +import org.scribble.del.DelFactory; +import org.scribble.parser.antlr.ScribbleParser; + +// CHECKME: do del setting directly here (or use af?), instead of DelDecorator +// get/setType don't seem to be really used +public class ScribTreeAdaptor extends CommonTreeAdaptor +{ + protected final DelFactory df; // N.B. not af -- here, create nodes "manually" (with del setting) to preserve original tokens + + public ScribTreeAdaptor(DelFactory df) + { + this.df = df; + } + + // Generated parser seems to use nil to create "blank" nodes and then "fill them in" + @Override + public Object nil() + { + return new ScribNil(); + } + + // Create a Tree (ScribNode) from a Token + @Override + public ScribNode create(Token t) + { + // Switching on ScribbleParser int type constants -- generated from Scribble.g tokens + // Previously: String tname = t.getText(); -- by convention of Scribble.g, type constant name given as node text, e.g., module: ... -> ^(MODULE ...) + ScribNodeBase n; + switch (t.getType()) + { + case ScribbleParser.ID: n = new IdNode(t); break; + case ScribbleParser.EXTID: + t = new CommonToken(t); + String text = t.getText(); + t.setText(text.substring(1, text.length()-1)); // N.B. remove surrounding quotes "..." + n = new ExtIdNode(t); + break; + + // Simple names "constructed directly" by parser, e.g., t=ID -> ID<...Node>[$t] -- N.B. DelDecorator pass needed for them (CHECKME: also do those here instead? to deprecate DelDecorator) + + // Compound names + case ScribbleParser.GPROTO_NAME: n = new GProtoNameNode(t); break; + case ScribbleParser.MODULE_NAME: n = new ModuleNameNode(t); break; + case ScribbleParser.DATA_NAME: n = new DataNameNode(t); break; + case ScribbleParser.SIG_NAME: n = new SigNameNode(t); break; + + // Non-name (i.e., general) AST nodes + case ScribbleParser.MODULE: n = new Module(t); break; + case ScribbleParser.MODULEDECL: n = new ModuleDecl(t); break; + case ScribbleParser.IMPORTMODULE: n = new ImportModule(t); break; + + case ScribbleParser.DATADECL: n = new DataDecl(t); break; + case ScribbleParser.SIGDECL: n = new SigDecl(t); break; + case ScribbleParser.GPROTODECL: n = new GProtoDecl(t); break; + + // CHECKME: refactor into header? + case ScribbleParser.PROTOMOD_LIST: n = new ProtoModList(t); break; + case ScribbleParser.AUX_KW: n = new AuxMod(t); break; // FIXME: KW return by parser directly (cf. other tokens are imaginary) + case ScribbleParser.EXPLICIT_KW: n = new ExplicitMod(t); break; + + case ScribbleParser.GPROTOHEADER: n = new GProtoHeader(t); break; + case ScribbleParser.ROLEDECL_LIST: n = new RoleDeclList(t); break; + case ScribbleParser.ROLEDECL: n = new RoleDecl(t); break; + case ScribbleParser.PARAMDECL_LIST: + n = new NonRoleParamDeclList(t); + break; + case ScribbleParser.DATAPARAMDECL: n = new DataParamDecl(t); break; + case ScribbleParser.SIGPARAMDECL: n = new SigParamDecl(t); break; + + case ScribbleParser.GPROTODEF: n = new GProtoDef(t); break; + case ScribbleParser.GPROTOBLOCK: n = new GProtoBlock(t); break; + case ScribbleParser.GINTERSEQ: n = new GInteractionSeq(t); break; + + case ScribbleParser.SIG_LIT: n = new SigLitNode(t); break; + case ScribbleParser.PAYELEM_LIST: n = new PayElemList(t); break; + case ScribbleParser.UNARY_PAYELEM: n = new UnaryPayElem<>(t); break; + case ScribbleParser.GDELEG_PAYELEM: n = new GDelegPayElem(t); break; + + case ScribbleParser.GMSGTRANSFER: n = new GMsgTransfer(t); break; + case ScribbleParser.GCONNECT: n = new GConnect(t); break; + case ScribbleParser.GDCONN: n = new GDisconnect(t); break; + case ScribbleParser.GWRAP: n = new GWrap(t); break; + + case ScribbleParser.GCONTINUE: n = new GContinue(t); break; + case ScribbleParser.GDO: n = new GDo(t); break; + + case ScribbleParser.ROLEARG_LIST: n = new RoleArgList(t); break; + case ScribbleParser.ROLEARG: n = new RoleArg(t); break; + case ScribbleParser.NONROLEARG_LIST: n = new NonRoleArgList(t); break; + case ScribbleParser.NONROLEARG: n = new NonRoleArg(t); break; + + case ScribbleParser.GCHOICE: n = new GChoice(t); break; + case ScribbleParser.GRECURSION: n = new GRecursion(t); break; + + // Special cases + case ScribbleParser.EMPTY_OP: n = new OpNode(t); break; // From Scribble.g, token (t) text is OpNode.EMPTY_OP_TOKEN_TEXT*/ + + default: + { + throw new RuntimeException("[TODO] Unknown token type (cf. ScribbleParser): " + t); + } + } + n.decorateDel(this.df); + + return n; + } +} diff --git a/modules/parser/src/test/resources/scribble/examples/GChoice.scr b/scribble-parser/src/test/resources/scribble/examples/GChoice.scr similarity index 100% rename from modules/parser/src/test/resources/scribble/examples/GChoice.scr rename to scribble-parser/src/test/resources/scribble/examples/GChoice.scr diff --git a/scribble-parser/src/test/resources/scribble/examples/GDo.scr b/scribble-parser/src/test/resources/scribble/examples/GDo.scr new file mode 100644 index 000000000..8b8e171ec --- /dev/null +++ b/scribble-parser/src/test/resources/scribble/examples/GDo.scr @@ -0,0 +1,20 @@ +module scribble.examples.GDo; + +type "{http://www.acme.com/financial}Order" from "http://www.acme.com/schemas/Order.xsd" as Order; +type "{http://www.acme.com/financial}Receipt" from "http://www.acme.com/schemas/Receipt.xsd" as Receipt; + +global protocol GDoTest(role Buyer, role Seller) { + do OtherProtocol(Buyer, Seller); + do a.b.c.OtherProtocol(Buyer, Seller); + do AnotherProtocol(Buyer, Seller); + do a.b.c.AnotherProtocol(Buyer, Seller); +} + +aux global protocol OtherProtocol(role OtherBuyer, role OtherSeller) { + dummy() from OtherBuyer to OtherSeller; +} + +aux global protocol AnotherProtocol(role OtherBuyer, role OtherSeller) { + Buy from OtherBuyer to OtherSeller; + Confirm from OtherSeller to OtherBuyer; +} diff --git a/scribble-parser/src/test/resources/scribble/examples/GMessage.scr b/scribble-parser/src/test/resources/scribble/examples/GMessage.scr new file mode 100644 index 000000000..ad361a2ba --- /dev/null +++ b/scribble-parser/src/test/resources/scribble/examples/GMessage.scr @@ -0,0 +1,20 @@ +module scribble.examples.GMessage; + +type "{http://www.acme.com/financial}Order" from "http://www.acme.com/schemas/Order.xsd" as Order; +type "{http://www.acme.com/financial}Customer" from "http://www.acme.com/schemas/Customer.xsd" as Customer; + +global protocol GMessageTest(role Buyer, role SellerA, role SellerB) { + buy(Order, Customer) from Buyer to SellerA; + //buy(Order, Customer) from Buyer to SellerA, SellerB; + buy(Order, Customer) from Buyer to SellerA; + //buy(Order) from Buyer to SellerA, SellerB; + buy(Order) from Buyer to SellerA; +} + +aux global protocol PlaceOrder(role Buyer, role Seller) { + +} + +aux global protocol Receipt(role Buyer, role Seller) { + +} diff --git a/scribble-parser/src/test/resources/scribble/examples/GProtocol.scr b/scribble-parser/src/test/resources/scribble/examples/GProtocol.scr new file mode 100644 index 000000000..8065d0916 --- /dev/null +++ b/scribble-parser/src/test/resources/scribble/examples/GProtocol.scr @@ -0,0 +1,16 @@ +module scribble.examples.GProtocol; + +global protocol GMessageTest(role Buyer, role SellerA, role SellerB) { + +} + +global protocol Order(role Buyer, role Seller) { + +} + +global protocol Receipt(role Buyer, role Seller) { + +} + +//global protocol GMessageTest2(role Buyer,role SellerA,role SellerB) instantiates GMessageTest(Buyer,SellerA,SellerB); + diff --git a/scribble-parser/src/test/resources/scribble/examples/GRecursion.scr b/scribble-parser/src/test/resources/scribble/examples/GRecursion.scr new file mode 100644 index 000000000..a4bef2011 --- /dev/null +++ b/scribble-parser/src/test/resources/scribble/examples/GRecursion.scr @@ -0,0 +1,10 @@ +module scribble.examples.GRecursion; + +type "{http://www.acme.com/financial}Order" from "http://www.acme.com/schemas/Order.xsd" as Order; + +global protocol GRecursionTest(role Buyer, role Seller) { + rec MyLabel { + buy(Order) from Buyer to Seller; + continue MyLabel; + } +} diff --git a/scribble-parser/src/test/resources/scribble/examples/Imports.scr b/scribble-parser/src/test/resources/scribble/examples/Imports.scr new file mode 100644 index 000000000..2e7f71069 --- /dev/null +++ b/scribble-parser/src/test/resources/scribble/examples/Imports.scr @@ -0,0 +1,9 @@ +module scribble.examples.Imports; + +import scribble.examples.GMessage; +//from scribble.examples.GMessage import PlaceOrder; +//from scribble.examples.GMessage import Receipt as OrderReceipt; + +global protocol ImportsTest(role Buyer, role Seller) { + +} diff --git a/modules/parser/src/test/resources/scribble/examples/LChoice.scr b/scribble-parser/src/test/resources/scribble/examples/LChoice.scr similarity index 80% rename from modules/parser/src/test/resources/scribble/examples/LChoice.scr rename to scribble-parser/src/test/resources/scribble/examples/LChoice.scr index f7904b561..8cce478d9 100644 --- a/modules/parser/src/test/resources/scribble/examples/LChoice.scr +++ b/scribble-parser/src/test/resources/scribble/examples/LChoice.scr @@ -3,8 +3,8 @@ module scribble.examples.LChoice; type "{http://www.acme.com/financial}Order" from "http://www.acme.com/schemas/Order.xsd" as Order; type "{http://www.acme.com/financial}QuoteRequest" from "http://www.acme.com/schemas/QuoteRequest.xsd" as QuoteRequest; -local protocol LChoiceTest at Buyer(role Buyer,role Seller) { - choice at Buyer { +local protocol LChoiceTest(self Buyer, role Seller) { + choice at self { buy(Order) to Seller; } or { buy(QuoteRequest) to Seller; diff --git a/scribble-parser/src/test/resources/scribble/examples/LDo.scr b/scribble-parser/src/test/resources/scribble/examples/LDo.scr new file mode 100644 index 000000000..e34624fa6 --- /dev/null +++ b/scribble-parser/src/test/resources/scribble/examples/LDo.scr @@ -0,0 +1,8 @@ +module scribble.examples.LDo; + +local protocol LDoTest(self Buyer, role Seller) { + do OtherProtocol(self, Seller); + do a.b.c.OtherProtocol(self, Seller); + do OtherProtocol(self, Seller); + do a.b.c.OtherProtocol(self, Seller); +} diff --git a/scribble-parser/src/test/resources/scribble/examples/LProtocol.scr b/scribble-parser/src/test/resources/scribble/examples/LProtocol.scr new file mode 100644 index 000000000..6bf92ed38 --- /dev/null +++ b/scribble-parser/src/test/resources/scribble/examples/LProtocol.scr @@ -0,0 +1,13 @@ +module scribble.examples.LProtocol; + +local protocol GMessageTest(role Buyer, role SellerA, role SellerB) { +} + +local protocol Order(role Buyer, self Seller) { +} + +local protocol Receipt(self Buyer, role Seller) { +} + +//local protocol GMessageTest2 at SellerB(role Buyer,role SellerA,role SellerB) instantiates GMessageTest(Buyer,SellerA,SellerB); + diff --git a/scribble-parser/src/test/resources/scribble/examples/LReceive_Seller.scr b/scribble-parser/src/test/resources/scribble/examples/LReceive_Seller.scr new file mode 100644 index 000000000..5c5533db6 --- /dev/null +++ b/scribble-parser/src/test/resources/scribble/examples/LReceive_Seller.scr @@ -0,0 +1,9 @@ +module scribble.examples.LReceive_Seller; + +type "{http://www.acme.com/financial}Order" from "http://www.acme.com/schemas/Order.xsd" as Order; +type "{http://www.acme.com/financial}Customer" from "http://www.acme.com/schemas/Customer.xsd" as Customer; + +local protocol LReceiveTest(role Buyer, self Seller) { + buy(Order, Customer) from Buyer; + buy(Order) from Buyer; +} diff --git a/modules/parser/src/test/resources/scribble/examples/LRecursion.scr b/scribble-parser/src/test/resources/scribble/examples/LRecursion.scr similarity index 76% rename from modules/parser/src/test/resources/scribble/examples/LRecursion.scr rename to scribble-parser/src/test/resources/scribble/examples/LRecursion.scr index 423e3da10..dc15df9fa 100644 --- a/modules/parser/src/test/resources/scribble/examples/LRecursion.scr +++ b/scribble-parser/src/test/resources/scribble/examples/LRecursion.scr @@ -2,7 +2,7 @@ module scribble.examples.LRecursion; type "{http://www.acme.com/financial}Order" from "http://www.acme.com/schemas/Order.xsd" as Order; -local protocol LRecursionTest at Buyer(role Buyer,role Seller) { +local protocol LRecursionTest(self Buyer, role Seller) { rec MyLabel { buy(Order) to Seller; continue MyLabel; diff --git a/scribble-parser/src/test/resources/scribble/examples/LSend_Buyer.scr b/scribble-parser/src/test/resources/scribble/examples/LSend_Buyer.scr new file mode 100644 index 000000000..72fa7539d --- /dev/null +++ b/scribble-parser/src/test/resources/scribble/examples/LSend_Buyer.scr @@ -0,0 +1,9 @@ +module scribble.examples.LSend_Buyer; + +type "{http://www.acme.com/financial}Order" from "http://www.acme.com/schemas/Order.xsd" as Order; +type "{http://www.acme.com/financial}Customer" from "http://www.acme.com/schemas/Customer.xsd" as Customer; + +local protocol LSendTest(self Buyer, role Seller) { + buy(Order, Customer) to Seller; + buy(Order) to Seller; +} diff --git a/scribble-parser/src/test/resources/scribble/examples/Types.scr b/scribble-parser/src/test/resources/scribble/examples/Types.scr new file mode 100644 index 000000000..84284f42e --- /dev/null +++ b/scribble-parser/src/test/resources/scribble/examples/Types.scr @@ -0,0 +1,7 @@ +module scribble.examples.Types; + +type "{http://www.acme.com/financial}Trade" from "http://www.acme.com/schemas/Trade.xsd" as Trade; + +global protocol TestTypes(role Buyer, role Seller) { + +} diff --git a/modules/parser/src/test/resources/scribble/issues/RTGOV406.scr b/scribble-parser/src/test/resources/scribble/issues/RTGOV406.scr similarity index 96% rename from modules/parser/src/test/resources/scribble/issues/RTGOV406.scr rename to scribble-parser/src/test/resources/scribble/issues/RTGOV406.scr index 7188f1ee1..9333491b3 100644 --- a/modules/parser/src/test/resources/scribble/issues/RTGOV406.scr +++ b/scribble-parser/src/test/resources/scribble/issues/RTGOV406.scr @@ -1,17 +1,17 @@ -module scribble.issues.RTGOV406; - -type "java.lang.String" from "rt.jar" as String; -type "java.lang.Integer" from "rt.jar" as Int; - -global protocol ProtocolName(role Buyer1,role Buyer2,role Seller) { - book(String) from Buyer1 to Seller; - book(Int) from Seller to Buyer1; - quote(Int) from Buyer1 to Buyer2; - choice at Buyer2 { - agree() from Buyer2 to Buyer1,Seller; - transfer(Int) from Buyer1 to Seller; - transfer(Int) from Buyer2 to Seller; - } or { - quit() from Buyer2 to Buyer1,Seller; - } +module scribble.issues.RTGOV406; + +type "java.lang.String" from "rt.jar" as String; +type "java.lang.Integer" from "rt.jar" as Int; + +global protocol ProtocolName(role Buyer1,role Buyer2,role Seller) { + book(String) from Buyer1 to Seller; + book(Int) from Seller to Buyer1; + quote(Int) from Buyer1 to Buyer2; + choice at Buyer2 { + agree() from Buyer2 to Buyer1,Seller; + transfer(Int) from Buyer1 to Seller; + transfer(Int) from Buyer2 to Seller; + } or { + quit() from Buyer2 to Buyer1,Seller; + } } \ No newline at end of file diff --git a/scribble-runtime/pom.xml b/scribble-runtime/pom.xml new file mode 100644 index 000000000..c30f9cec7 --- /dev/null +++ b/scribble-runtime/pom.xml @@ -0,0 +1,26 @@ + + + 4.0.0 + + + scribble-runtime + + + + org.scribble + scribble-core + + + + + org.scribble + parent + 0.5.1-SNAPSHOT + ../pom.xml + + + + scribble-runtime + + diff --git a/scribble-runtime/src/main/java/org/scribble/main/ScribRuntimeException.java b/scribble-runtime/src/main/java/org/scribble/main/ScribRuntimeException.java new file mode 100644 index 000000000..6f7b1e75a --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/main/ScribRuntimeException.java @@ -0,0 +1,31 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.main; + +// Note: not a run-time ScribbleException +// CHECKME: relocate? +public class ScribRuntimeException extends Exception +{ + private static final long serialVersionUID = 1L; + + public ScribRuntimeException(String s) + { + super(s); + } + + public ScribRuntimeException(Throwable t) + { + super(t); + } +} diff --git a/scribble-runtime/src/main/java/org/scribble/runtime/handlers/ScribBranch.java b/scribble-runtime/src/main/java/org/scribble/runtime/handlers/ScribBranch.java new file mode 100644 index 000000000..d88130b3d --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/runtime/handlers/ScribBranch.java @@ -0,0 +1,22 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.runtime.handlers; + +import org.scribble.runtime.message.ScribMessage; + +// FIXME: integrate with BranchSocket and Handler I/f's +public interface ScribBranch +{ + public void dispatch(D data, ScribMessage m); +} diff --git a/scribble-runtime/src/main/java/org/scribble/runtime/handlers/ScribOutputEvent.java b/scribble-runtime/src/main/java/org/scribble/runtime/handlers/ScribOutputEvent.java new file mode 100644 index 000000000..db2228e9c --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/runtime/handlers/ScribOutputEvent.java @@ -0,0 +1,26 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.runtime.handlers; + +import org.scribble.core.type.name.Op; +import org.scribble.core.type.name.Role; + +// FIXME: make interface and add to bounds of output icallback -- cf. CBEndpointApiGenerator +// FIXME: not serializable due to RoleKind (in Role) +public interface ScribOutputEvent +{ + Role getPeer(); + Op getOp(); + Object[] getPayload(); +} diff --git a/scribble-runtime/src/main/java/org/scribble/runtime/handlers/ScribSigMessage.java b/scribble-runtime/src/main/java/org/scribble/runtime/handlers/ScribSigMessage.java new file mode 100644 index 000000000..a71c55856 --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/runtime/handlers/ScribSigMessage.java @@ -0,0 +1,21 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.runtime.handlers; + +import org.scribble.runtime.message.ScribMessage; + +public interface ScribSigMessage +{ + ScribMessage getSig(); +} diff --git a/scribble-runtime/src/main/java/org/scribble/runtime/handlers/states/ScribEndState.java b/scribble-runtime/src/main/java/org/scribble/runtime/handlers/states/ScribEndState.java new file mode 100644 index 000000000..5ba3b73e8 --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/runtime/handlers/states/ScribEndState.java @@ -0,0 +1,30 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.runtime.handlers.states; + +abstract public class ScribEndState extends ScribState +{ + //public ScribEndState() + public ScribEndState(String name) + { + //super("End"); + super(name); + } + + @Override + protected boolean canEqual(Object o) + { + return o instanceof ScribEndState; + } +} diff --git a/scribble-runtime/src/main/java/org/scribble/runtime/handlers/states/ScribInputState.java b/scribble-runtime/src/main/java/org/scribble/runtime/handlers/states/ScribInputState.java new file mode 100644 index 000000000..82561cc76 --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/runtime/handlers/states/ScribInputState.java @@ -0,0 +1,33 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.runtime.handlers.states; + +import org.scribble.core.type.name.Role; + +abstract public class ScribInputState extends ScribState +{ + public final Role peer; + + public ScribInputState(String name, Role peer) + { + super(name); + this.peer = peer; + } + + @Override + protected boolean canEqual(Object o) + { + return o instanceof ScribInputState; + } +} diff --git a/scribble-runtime/src/main/java/org/scribble/runtime/handlers/states/ScribOutputState.java b/scribble-runtime/src/main/java/org/scribble/runtime/handlers/states/ScribOutputState.java new file mode 100644 index 000000000..71db63699 --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/runtime/handlers/states/ScribOutputState.java @@ -0,0 +1,28 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.runtime.handlers.states; + +abstract public class ScribOutputState extends ScribState +{ + public ScribOutputState(String name) + { + super(name); + } + + @Override + protected boolean canEqual(Object o) + { + return o instanceof ScribOutputState; + } +} diff --git a/scribble-runtime/src/main/java/org/scribble/runtime/handlers/states/ScribState.java b/scribble-runtime/src/main/java/org/scribble/runtime/handlers/states/ScribState.java new file mode 100644 index 000000000..29f3712be --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/runtime/handlers/states/ScribState.java @@ -0,0 +1,63 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.runtime.handlers.states; + +import java.util.HashMap; +import java.util.Map; + +import org.scribble.core.type.name.Op; + +abstract public class ScribState +{ + public final String name; + + //public final Map succs = new HashMap<>(); // FIXME + public final Map succs = new HashMap<>(); + + public ScribState(String name) + { + this.name = name; + } + + @Override + public String toString() + { + return this.name; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof ScribState)) + { + return false; + } + ScribState n = (ScribState) o; + return n.canEqual(this) && this.name.equals(n.name); + } + + protected abstract boolean canEqual(Object o); + + @Override + public int hashCode() + { + int hash = 7907; + hash = 31 * hash + this.name.hashCode(); + return hash; + } +} diff --git a/scribble-runtime/src/main/java/org/scribble/runtime/message/ObjectStreamFormatter.java b/scribble-runtime/src/main/java/org/scribble/runtime/message/ObjectStreamFormatter.java new file mode 100644 index 000000000..a5d661a60 --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/runtime/message/ObjectStreamFormatter.java @@ -0,0 +1,110 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.runtime.message; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectInputStream; +import java.io.ObjectOutput; +import java.io.ObjectOutputStream; +import java.nio.Buffer; +import java.nio.ByteBuffer; +import java.util.Arrays; + +public class ObjectStreamFormatter implements ScribMessageFormatter { + public ObjectStreamFormatter() { + + } + + @Override + //public byte[] toBytes(ScribMessage m) throws IOException + public void writeMessage(DataOutputStream dos, ScribMessage m) throws IOException { + throw new RuntimeException("Deprecated"); + /*byte[] bs = serialize(m); + dos.writeInt(bs.length); + dos.write(bs); + dos.flush();*/ + } + + @Override + public ScribMessage readMessage(DataInputStream dis) throws IOException { + throw new RuntimeException("Deprecated"); + /*try + { + int len = dis.readInt(); + byte[] bs = new byte[len]; + dis.readFully(bs); + return deserialize(bs); + } + catch (ClassNotFoundException cnfe) + { + throw new IOException(cnfe); + }*/ + } + + @Override + public byte[] toBytes(ScribMessage m) throws IOException { + byte[] body = serialize(m); + byte[] header = ByteBuffer.allocate(4).putInt(body.length).array(); // FIXME: buffer alloc + byte[] bs = new byte[header.length + body.length]; + System.arraycopy(header, 0, bs, 0, header.length); + System.arraycopy(body, 0, bs, 4, body.length); + return bs; + } + + @Override + public ScribMessage fromBytes(ByteBuffer bb) throws IOException, ClassNotFoundException { + // Pre: bb:put + ((Buffer) bb).flip(); // Cast HACK -- cf. https://stackoverflow.com/questions/61267495/exception-in-thread-main-java-lang-nosuchmethoderror-java-nio-bytebuffer-flip + if (bb.remaining() <= 4) { + bb.compact(); + return null; + } + byte[] header = Arrays.copyOf(bb.array(), 4); + int size = ByteBuffer.wrap(header).getInt(); + if (bb.remaining() < (4 + size)) { + bb.compact(); + return null; + } + // Cast HACK -- cf. https://stackoverflow.com/questions/61267495/exception-in-thread-main-java-lang-nosuchmethoderror-java-nio-bytebuffer-flip + bb.position(bb.position() + 4); // position is always 0 here? + //((Buffer) bb).position(((Buffer) bb).position() + 4); // position is always 0 here? + byte[] bs = new byte[size]; + bb.get(bs); + ScribMessage m = deserialize(bs); + bb.compact(); // Post: bb:put + return m; + } + + private static byte[] serialize(Object o) throws IOException { + try (ByteArrayOutputStream bos = new ByteArrayOutputStream()) { + try (ObjectOutput out = new ObjectOutputStream(bos)) { + out.writeObject(o); + return bos.toByteArray(); + } + } + } + + private static ScribMessage deserialize(byte[] bs) throws IOException, ClassNotFoundException { + try (ByteArrayInputStream bis = new ByteArrayInputStream(bs)) { + try (ObjectInput in = new ObjectInputStream(bis)) { + return (ScribMessage) in.readObject(); + } + } + } +} diff --git a/scribble-runtime/src/main/java/org/scribble/runtime/message/ScribInterrupt.java b/scribble-runtime/src/main/java/org/scribble/runtime/message/ScribInterrupt.java new file mode 100644 index 000000000..eb0f4968d --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/runtime/message/ScribInterrupt.java @@ -0,0 +1,41 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.runtime.message; + +import org.scribble.core.type.name.Op; + +public class ScribInterrupt extends ScribMessage +{ + private static final long serialVersionUID = 1L; + + public static final Op SCRIB_INTERR = new Op("__interr"); + + public ScribInterrupt(Throwable t) + { + super(SCRIB_INTERR, new Object[] { t }); + } + + @Override + public int hashCode() + { + int hash = 79; + hash = 31 * hash + super.hashCode(); + return hash; + } + + public boolean canEqual(Object o) + { + return o instanceof ScribInterrupt; + } +} diff --git a/scribble-runtime/src/main/java/org/scribble/runtime/message/ScribMessage.java b/scribble-runtime/src/main/java/org/scribble/runtime/message/ScribMessage.java new file mode 100644 index 000000000..11a07ad0d --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/runtime/message/ScribMessage.java @@ -0,0 +1,98 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.runtime.message; + +import java.io.Serializable; +import java.util.Arrays; +import java.util.stream.Collectors; + +import org.scribble.core.type.name.Op; + +public class ScribMessage implements Serializable +{ + private static final long serialVersionUID = 1L; + + // add msg source + public final Op op; + public final Object[] payload; + + public ScribMessage(Op op, Object... payload) + { + this.op = op; + this.payload = payload; // FIXME: make defensive array copy? + } + + /*// Unicast + public MulticastSignature toMulticastSignature(Role src, Role dest, Scope scope) + { + return toMulticastSignature(src, Arrays.asList(dest), scope); + } + + public MulticastSignature toMulticastSignature(Role src, List dests, Scope scope) + { + return new MulticastSignature(src, dests, scope, op, getPayloadTypes()); + } + + protected final List getPayloadTypes() + { + List types = new LinkedList<>(); + for (Object o : this.payload) + { + // FIXME: routine should be plugin based on schema + types.add(new PayloadType(o.getClass().toString())); + } + return types; + }*/ + + @Override + public int hashCode() + { + int hash = 73; + //hash = 31 * hash + super.hashCode(); + hash = 31 * hash + this.op.hashCode(); + hash = 31 * hash + this.payload.hashCode(); + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof ScribMessage)) + { + return false; + } + ScribMessage m = (ScribMessage) o; + return m.canEqual(this) && this.op.equals(m.op) && this.payload.equals(m.payload); + } + + public boolean canEqual(Object o) + { + return o instanceof ScribMessage; + } + + @Override + public String toString() + { + String s = this.op + "("; + if (this.payload.length > 0) + { + s += Arrays.asList(this.payload).stream().map((o) -> o.toString()).collect(Collectors.joining(", ")); + } + return s + ")"; + } +} diff --git a/scribble-runtime/src/main/java/org/scribble/runtime/message/ScribMessageFormatter.java b/scribble-runtime/src/main/java/org/scribble/runtime/message/ScribMessageFormatter.java new file mode 100644 index 000000000..b46249ace --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/runtime/message/ScribMessageFormatter.java @@ -0,0 +1,34 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.runtime.message; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.nio.ByteBuffer; + +public interface ScribMessageFormatter +{ + //byte[] toBytes(ScribMessage m) throws IOException; + @Deprecated + void writeMessage(DataOutputStream dos, ScribMessage m) throws IOException; + @Deprecated + ScribMessage readMessage(DataInputStream dis) throws IOException; + + byte[] toBytes(ScribMessage m) throws IOException; + + // Pre and post: bb:put (maybe get would be more intuitive, but Buffers work better with put as default) + // Returns null if not enough data (FIXME?) + ScribMessage fromBytes(ByteBuffer bb) throws IOException, ClassNotFoundException; +} diff --git a/scribble-runtime/src/main/java/org/scribble/runtime/net/BinaryChannelEndpoint.java b/scribble-runtime/src/main/java/org/scribble/runtime/net/BinaryChannelEndpoint.java new file mode 100644 index 000000000..ae30dbba2 --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/runtime/net/BinaryChannelEndpoint.java @@ -0,0 +1,215 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.runtime.net; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.channels.spi.AbstractSelectableChannel; +import java.util.LinkedList; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; + +import org.scribble.runtime.message.ScribInterrupt; +import org.scribble.runtime.message.ScribMessage; +import org.scribble.runtime.session.SessionEndpoint; +import org.scribble.util.RuntimeScribException; + +public abstract class BinaryChannelEndpoint +{ + //protected MPSTEndpoint se; + protected SessionEndpoint se; + + //protected BinaryChannelEndpoint parent; + private AbstractSelectableChannel c; + private ByteBuffer bb; + + //private final SocketChannel; + protected final List msgs = new LinkedList<>(); + + private boolean isClosed = false; + + private int count = 0; // How many ScribMessages read so far // volatile? + private int ticket = 0; // Index of the next expected ScribMessage + + private final List> pending = new LinkedList<>(); + + // Server side + //protected BinaryChannelEndpoint(MPSTEndpoint se, AbstractSelectableChannel c) throws IOException + protected BinaryChannelEndpoint(SessionEndpoint se, AbstractSelectableChannel c) throws IOException + { + this.bb = ByteBuffer.allocate(16921); // FIXME: size // Use put mode as default + init(se, c); + } + + // Client side + protected BinaryChannelEndpoint() + { + this.bb = ByteBuffer.allocate(16921); // FIXME: size // Use put mode as default + } + + //public abstract void initClient(MPSTEndpoint se, String host, int port) throws IOException; + public abstract void initClient(SessionEndpoint se, String host, int port) throws IOException; + + //protected void init(MPSTEndpoint se, AbstractSelectableChannel c) throws IOException + protected void init(SessionEndpoint se, AbstractSelectableChannel c) throws IOException + { + this.se = se; + this.c = c; + this.c.configureBlocking(false); + } + + // Pre: selector is paused + //protected BinaryChannelEndpoint(BinaryChannelEndpoint c) + public void wrapChannel(BinaryChannelEndpoint c) throws IOException + { + this.se = c.se; + //this.msgs.addAll(c.msgs); // Guaranteed to be empty/0 for reconnect? + //this.count = c.count; + //this.ticket = c.ticket; + //this.parent = c; + this.c = c.c; + this.bb = c.bb; + + //FIXME: complete all pending futures on parent chan -- no: not enough by itself, that is just reading the already-deserialized cache + //FIXME: pull all pending data out of parent chan (due to selector not handling it yet -- in send states, we just need to clear all expected messages up to this point) + // -- so that wrapper handshake is starting clean + // --- futures must be completed before here, since selector is paused + } + + public AbstractSelectableChannel getSelectableChannel() // For asynchrony (via nio Selector) -- maybe implement/extend instead + { + return this.c; + } + + public void write(ScribMessage m) throws IOException + { + writeBytes(this.se.smf.toBytes(m)); + } + + // Default CompletableFuture executed by common forkjoin pool -- so all messages that are received/async'd will eventually be pulled from the queue (no manual GC necessary) + public synchronized CompletableFuture getFuture() + { + // FIXME: better exception handling (integrate with Future interface?) + final int ticket = getTicket(); + CompletableFuture fut = CompletableFuture.supplyAsync(() -> + { + try + { + ScribMessage m = read(ticket); + if (m instanceof ScribInterrupt) // FIXME: hacked in + { + throw new RuntimeScribException((Throwable) ((ScribInterrupt) m).payload[0]); + } + return m; + } + catch(IOException e) + { + throw new RuntimeScribException(e); + } + finally + { + this.pending.remove(0); // Safe? + } + }); + synchronized (this.pending) + { + this.pending.add(fut); + } + return fut; + } + + public void sync() throws IOException // Hacky + { + try + { + synchronized (this.pending) + { + if (!this.pending.isEmpty()) + { + this.pending.get(this.pending.size() - 1).get(); + } + } + } + catch (InterruptedException | ExecutionException e) + { + throw new IOException(e); + } + } + + private synchronized ScribMessage read(int ticket) throws IOException + { + try + { + while (this.count < ticket && !this.isClosed) // "Chain" futures directly? i.e. each future syncs on predecessor? + { + wait(); + } + while (this.msgs.isEmpty() && !this.isClosed) + { + wait(); + } + if (this.isClosed) + { + throw new IOException("Channel closed"); + } + this.count++; + ScribMessage m = this.msgs.remove(0); + notifyAll(); // A later future might have gone first and blocked, so wake up (with the message already enqueued, so no notify coming from there) // finally? + return m; + } + catch (InterruptedException e) + { + throw new IOException(e); + } + } + + protected synchronized void enqueue(ScribMessage m) + { + this.msgs.add(m); + //this.count++; + notifyAll(); + } + + public abstract void writeBytes(byte[] bs) throws IOException; + protected abstract void readBytesIntoBuffer() throws IOException; // synchronized (against read) // bytes ready for reading: try to deserialize and then enqueue, or else cache for later + + public synchronized void readAndEnqueueMessages() throws ClassNotFoundException, IOException // Here for synchronisation + { + readBytesIntoBuffer(); + ScribMessage m; + while ((m = this.se.smf.fromBytes(this.bb)) != null) + { + enqueue(m); + } + } + + public synchronized void close() throws IOException + { + this.isClosed = true; + notifyAll(); + } + + public synchronized int getTicket() + { + //return ++this.ticket; + return this.ticket++; + } + + // post: bb:put + public ByteBuffer getBuffer() + { + return this.bb; + } +} diff --git a/scribble-runtime/src/main/java/org/scribble/runtime/net/BinaryChannelWrapper.java b/scribble-runtime/src/main/java/org/scribble/runtime/net/BinaryChannelWrapper.java new file mode 100644 index 000000000..ee63ed663 --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/runtime/net/BinaryChannelWrapper.java @@ -0,0 +1,66 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.runtime.net; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.security.KeyManagementException; +import java.security.NoSuchAlgorithmException; + +import org.scribble.runtime.session.SessionEndpoint; + +public abstract class BinaryChannelWrapper extends BinaryChannelEndpoint +{ + // Use this in readUnwrappedBytesIntoBuffer (super.getBuffer used for read-but-still-wrapped -- decoded into here by unwrap) + private final ByteBuffer wrapped = ByteBuffer.allocate(16921); // FIXME: size // Use put mode as default + + protected BinaryChannelWrapper() + { + + } + + @Override + //public void initClient(MPSTEndpoint se, String host, int port) throws IOException + public void initClient(SessionEndpoint se, String host, int port) throws IOException + { + throw new RuntimeException("Shouldn't get in here: "); + } + + public abstract void clientHandshake() throws IOException, KeyManagementException, NoSuchAlgorithmException; // FIXME: name + public abstract void serverHandshake() throws IOException, KeyManagementException, NoSuchAlgorithmException; // FIXME: name + + public abstract byte[] wrap(byte[] bs) throws IOException; + public abstract void unwrap() throws IOException; // Decode from this.wrapped (this.getUnwrapped()) into this.bb + + protected abstract void writeWrappedBytes(byte[] bs) throws IOException; + protected abstract void readWrappedBytesIntoBuffer() throws IOException; // Read wrapped data into this.wrapped + + @Override + public void writeBytes(byte[] bs) throws IOException + { + writeWrappedBytes(wrap(bs)); + } + + @Override + protected void readBytesIntoBuffer() throws IOException + { + readWrappedBytesIntoBuffer(); + unwrap(); + } + + protected ByteBuffer getWrapped() + { + return this.wrapped; + } +} diff --git a/scribble-runtime/src/main/java/org/scribble/runtime/net/SSLSocketChannelServer.java b/scribble-runtime/src/main/java/org/scribble/runtime/net/SSLSocketChannelServer.java new file mode 100644 index 000000000..bb9d40870 --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/runtime/net/SSLSocketChannelServer.java @@ -0,0 +1,54 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.runtime.net; + +import java.io.IOException; +import java.nio.channels.ServerSocketChannel; + +import org.scribble.runtime.session.SessionEndpoint; + +// FIXME: +public class SSLSocketChannelServer extends ScribServerSocket +{ + private ServerSocketChannel ss; + + public SSLSocketChannelServer(int port) throws IOException + { + super(port); + throw new RuntimeException("TODO"); + /*this.ss = ServerSocketChannel.open(); + this.ss.socket().bind(new InetSocketAddress(port));*/ + } + + @Override + //public synchronized SocketChannelEndpoint accept(MPSTEndpoint se) throws IOException + public synchronized SocketChannelEndpoint accept(SessionEndpoint se) throws IOException + { + return new SocketChannelEndpoint(se, ss.accept()); + } + + @Override + public void close() + { + try + { + this.ss.close(); + } + catch (IOException e) + { + // FIXME + e.printStackTrace(); + } + } +} diff --git a/scribble-runtime/src/main/java/org/scribble/runtime/net/SSLSocketChannelWrapper.java b/scribble-runtime/src/main/java/org/scribble/runtime/net/SSLSocketChannelWrapper.java new file mode 100644 index 000000000..78847bc7d --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/runtime/net/SSLSocketChannelWrapper.java @@ -0,0 +1,279 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.runtime.net; + +import java.io.IOException; +import java.net.InetSocketAddress; +import java.nio.ByteBuffer; +import java.nio.channels.SocketChannel; +import java.security.KeyManagementException; +import java.security.NoSuchAlgorithmException; + +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLEngine; +import javax.net.ssl.SSLEngineResult; +import javax.net.ssl.SSLException; +import javax.net.ssl.SSLSession; + +public class SSLSocketChannelWrapper extends BinaryChannelWrapper +{ + private SSLEngine engine; + + private ByteBuffer EMPTY = ByteBuffer.allocate(0); + + private ByteBuffer myAppData; + private ByteBuffer myNetData; + + //private ByteBuffer peerAppData = ByteBuffer.allocate(16916); // Hacked constant + //private ByteBuffer peerNetData; + + public SSLSocketChannelWrapper() + { + + } + + private void init(InetSocketAddress addr) throws NoSuchAlgorithmException, KeyManagementException + { + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(null, null, null); + this.engine = sslContext.createSSLEngine(addr.getHostName(), addr.getPort()); + } + + @Override + public void clientHandshake() throws IOException, KeyManagementException, NoSuchAlgorithmException + { + SocketChannel s = getSelectableChannel(); + init((InetSocketAddress) s.getRemoteAddress()); + this.engine.setUseClientMode(true); + SSLSession session = this.engine.getSession(); + this.myAppData = ByteBuffer.allocate(session.getApplicationBufferSize()); // 16916 + this.myNetData = ByteBuffer.allocate(session.getPacketBufferSize()); // 16921 + //this.peerAppData = ByteBuffer.allocate(16916); // Hacked constant + //this.peerNetData = ByteBuffer.allocate(session.getPacketBufferSize()); + doHandshake(s, this.engine, this.myNetData); + } + + @Override + public void serverHandshake() throws IOException, KeyManagementException, NoSuchAlgorithmException + { + SocketChannel s = getSelectableChannel(); + init((InetSocketAddress) s.getRemoteAddress()); + throw new RuntimeException("TODO"); + } + + @Override + public SocketChannel getSelectableChannel() + { + return (SocketChannel) super.getSelectableChannel(); + } + + @Override + protected void writeWrappedBytes(byte[] bs) throws IOException + { + getSelectableChannel().write(ByteBuffer.wrap(bs)); + } + + @Override + protected void readWrappedBytesIntoBuffer() throws IOException + { + ByteBuffer bb = getWrapped(); + getSelectableChannel().read(bb); + } + + @Override + public byte[] wrap(byte[] bs) throws IOException + { + this.myAppData.put(bs); + this.myAppData.flip(); + this.myNetData.clear(); + while (this.myAppData.hasRemaining()) + { + SSLEngineResult res = this.engine.wrap(this.myAppData, this.myNetData); + if (res.getStatus() == SSLEngineResult.Status.OK) + { + this.myAppData.compact(); + this.myAppData.flip(); + } + else + { + // Handle other status: BUFFER_OVERFLOW (write some first), BUFFER_UNDERFLOW, CLOSED + throw new RuntimeException("TODO: " + res.getStatus()); + } + } + this.myAppData.compact(); // Should be same as clear here (i.e. empty) + this.myNetData.flip(); + byte[] res = new byte[this.myNetData.remaining()]; + System.arraycopy(this.myNetData.array(), this.myNetData.position(), res, 0, res.length); + return res; + } + + // Decode from this.wrapped (this.getUnwrapped()) into this.bb + @Override + public void unwrap() throws IOException // Decode from this.wrapped (this.getUnwrapped()) into this.bb + { + ByteBuffer peerNetData = getWrapped(); + ByteBuffer peerAppData = getBuffer(); + //for (boolean done = false; !done; ) + { + //s.read(peerNetData); // Assumes there is something to read (or else blocked) + peerNetData.flip(); + SSLEngineResult res = this.engine.unwrap(peerNetData, peerAppData); + peerNetData.compact(); + if (res.getStatus() == SSLEngineResult.Status.OK) + { + //done = true; + } + else if (res.getStatus() == SSLEngineResult.Status.BUFFER_UNDERFLOW) + { + //peerNetData.flip(); + //return; + } + + else if (res.getStatus() == SSLEngineResult.Status.CLOSED) + { + // FIXME: check if closed is OK or not (if not, throw exception) + } + + else + { + // Handle other status: BUFFER_OVERFLOW + throw new RuntimeException("TODO: " + res.getStatus()); + } + } + } + + private void doHandshake(SocketChannel s, SSLEngine engine, ByteBuffer myNetData) throws IOException + { + ByteBuffer peerNetData = ByteBuffer.allocate(engine.getSession().getPacketBufferSize()); + ByteBuffer peerAppData = ByteBuffer.allocate(engine.getSession().getApplicationBufferSize()); + + engine.beginHandshake(); // Not explicitly needed for initial handshake + + SSLEngineResult.HandshakeStatus hs = engine.getHandshakeStatus(); + while (hs != SSLEngineResult.HandshakeStatus.FINISHED && hs != SSLEngineResult.HandshakeStatus.NOT_HANDSHAKING) + { + switch (hs) + { + case NEED_UNWRAP: + { + for (boolean done = false; !done; ) + { + peerNetData.flip(); + SSLEngineResult res = engine.unwrap(peerNetData, peerAppData); + peerNetData.compact(); + + hs = res.getHandshakeStatus(); + switch (res.getStatus()) + { + case OK: + { + done = true; + break; + } + case BUFFER_UNDERFLOW: + { + if (s.read(peerNetData) < 0) + { + throw new RuntimeException("TODO: "); + } + break; + } + default: + { + // Handle other status: BUFFER_OVERFLOW, CLOSED + throw new RuntimeException("TODO: " + res.getStatus()); + } + } + } + break; + } + case NEED_WRAP: + { + myNetData.clear(); + SSLEngineResult res = engine.wrap(EMPTY, myNetData); + + hs = res.getHandshakeStatus(); + switch (res.getStatus()) + { + case OK: + { + myNetData.flip(); + while (myNetData.hasRemaining()) + { + if (s.write(myNetData) < 0) + { + throw new RuntimeException("TODO: "); + } + } + myNetData.compact(); + break; + } + default: + { + // Handle other status: BUFFER_OVERFLOW (write some first to free up space), BUFFER_UNDERFLOW, CLOSED + throw new RuntimeException("TODO: " + hs); + } + } + break; + } + case NEED_TASK: + { + engine.getDelegatedTask().run(); + hs = engine.getHandshakeStatus(); + break; + } + default: + { + // Handle other status: // FINISHED or NOT_HANDSHAKING + throw new RuntimeException("TODO: " + hs); + } + } + } + } + + private void doShutdown() throws SSLException, IOException + { + SocketChannel s = getSelectableChannel(); + this.engine.closeOutbound(); + myNetData.clear(); + while (!this.engine.isOutboundDone()) + { + SSLEngineResult res = this.engine.wrap(EMPTY, myNetData); + if (res.getStatus() != SSLEngineResult.Status.CLOSED) // FIXME: is this the correct state to check for? or OK? (or both) + { + throw new RuntimeException("TODO: " + res.getStatus()); + } + this.myNetData.flip(); + while (this.myNetData.hasRemaining()) + { + int num1 = s.write(this.myNetData); + if (num1 == -1) + { + throw new RuntimeException("TODO: "); + } + this.myNetData.compact(); + this.myNetData.flip(); + } + } + + //s1.close(); + } + + @Override + public synchronized void close() throws IOException + { + doShutdown(); + super.close(); + } +} diff --git a/scribble-runtime/src/main/java/org/scribble/runtime/net/ScribServerSocket.java b/scribble-runtime/src/main/java/org/scribble/runtime/net/ScribServerSocket.java new file mode 100644 index 000000000..1cf3879f5 --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/runtime/net/ScribServerSocket.java @@ -0,0 +1,51 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.runtime.net; + +import java.io.IOException; + +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.session.SessionEndpoint; + +public abstract class ScribServerSocket implements AutoCloseable +{ + public final int port; + + private boolean reg = false; + + public ScribServerSocket(int port) throws IOException + { + this.port = port; + } + + //public abstract BinaryChannelEndpoint accept(MPSTEndpoint se) throws IOException; // synchronize + public abstract BinaryChannelEndpoint accept(SessionEndpoint se) throws IOException; // synchronize + + public synchronized void bind() throws ScribRuntimeException + { + if (this.reg) + { + throw new ScribRuntimeException("Server socket already registered."); + } + this.reg = true; + } + + public synchronized void unbind() + { + this.reg = false; + } + + @Override + public abstract void close(); +} diff --git a/scribble-runtime/src/main/java/org/scribble/runtime/net/SocketChannelEndpoint.java b/scribble-runtime/src/main/java/org/scribble/runtime/net/SocketChannelEndpoint.java new file mode 100644 index 000000000..6b8eac311 --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/runtime/net/SocketChannelEndpoint.java @@ -0,0 +1,91 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.runtime.net; + +import java.io.IOException; +import java.net.InetSocketAddress; +import java.nio.ByteBuffer; +import java.nio.channels.SocketChannel; + +import org.scribble.runtime.session.SessionEndpoint; + +public class SocketChannelEndpoint extends BinaryChannelEndpoint +{ + //private final SocketChannel s; + + //private final ByteBuffer bb = ByteBuffer.allocate(16921); // FIXME: size + + // Server side + //public SocketChannelEndpoint(MPSTEndpoint se, SocketChannel s) throws IOException + public SocketChannelEndpoint(SessionEndpoint se, SocketChannel s) throws IOException + { + super(se, s); + } + + // Client side + public SocketChannelEndpoint() + { + + } + + @Override + //public void initClient(MPSTEndpoint se, String host, int port) throws IOException + public void initClient(SessionEndpoint se, String host, int port) throws IOException + { + SocketChannel s = SocketChannel.open(new InetSocketAddress(host, port)); + super.init(se, s); + } + + @Override + public SocketChannel getSelectableChannel() + { + return (SocketChannel) super.getSelectableChannel(); + } + + public void writeBytes(byte[] bs) throws IOException + { + getSelectableChannel().write(ByteBuffer.wrap(bs)); // Currently does not depend on SocketChannel + // flush not supported -- async: manually check if written yet if needed + } + + @Override + public synchronized void readBytesIntoBuffer() throws IOException + { + /*getSelectableChannel().read(this.bb); // Pre: bb:put + // FIXME: what if bb is full? + ScribMessage m = this.se.smf.fromBytes(this.bb); // Post: bb:put + if (m != null) + { + enqueue(m); + }*/ + ByteBuffer bb = (ByteBuffer) getBuffer(); + getSelectableChannel().read(bb); // Currently does not depend on SocketChannel + //bb.compact(); // Post: bb:put + } + + @Override + public void close() + { + try + { + super.close(); + getSelectableChannel().close(); + } + catch (IOException e) + { + // FIXME: (BinaryChannelEndpoint read will throw exception) + e.printStackTrace(); + } + } +} diff --git a/scribble-runtime/src/main/java/org/scribble/runtime/net/SocketChannelServer.java b/scribble-runtime/src/main/java/org/scribble/runtime/net/SocketChannelServer.java new file mode 100644 index 000000000..d301be0ce --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/runtime/net/SocketChannelServer.java @@ -0,0 +1,53 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.runtime.net; + +import java.io.IOException; +import java.net.InetSocketAddress; +import java.nio.channels.ServerSocketChannel; + +import org.scribble.runtime.session.SessionEndpoint; + +public class SocketChannelServer extends ScribServerSocket +{ + private ServerSocketChannel ss; + + public SocketChannelServer(int port) throws IOException + { + super(port); + this.ss = ServerSocketChannel.open(); + this.ss.socket().bind(new InetSocketAddress(port)); + } + + @Override + //public synchronized SocketChannelEndpoint accept(MPSTEndpoint se) throws IOException + public synchronized SocketChannelEndpoint accept(SessionEndpoint se) throws IOException + { + return new SocketChannelEndpoint(se, this.ss.accept()); + } + + @Override + public void close() + { + try + { + this.ss.close(); + } + catch (IOException e) + { + // FIXME + e.printStackTrace(); + } + } +} diff --git a/scribble-runtime/src/main/java/org/scribble/runtime/net/SocketEndpoint.java b/scribble-runtime/src/main/java/org/scribble/runtime/net/SocketEndpoint.java new file mode 100644 index 000000000..34f210b9c --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/runtime/net/SocketEndpoint.java @@ -0,0 +1,140 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.runtime.net; + +import java.io.DataInputStream; +import java.io.IOException; + +import org.scribble.core.type.name.Role; +import org.scribble.runtime.message.ScribMessage; +import org.scribble.runtime.session.MPSTEndpoint; + +// Read/write Objects on the binary connection to an endpoint in the session +@Deprecated +public class SocketEndpoint +{ + private final MPSTEndpoint ep; + //private final Role peer; + private final SocketWrapper sw; + + public SocketWrapper getSocketWrapper() + { + return this.sw; + } + + private final ReceiverThread receiver; + + public SocketEndpoint(MPSTEndpoint ep, Role peer, SocketWrapper sw) //throws IOException + { + this.ep = ep; + //this.peer = peer; + this.sw = sw; + + this.receiver = new ReceiverThread(ep, peer, sw.dis); + this.receiver.start(); + } + + /*// For SelfSocketEndpoint only + protected SocketEndpoint(Role src, SessionInputQueue inputq) + { + this.src = src; + this.inputq = inputq; + this.sw = null; + this.recthread = null; + }*/ + + public void writeMessage(ScribMessage msg) throws IOException + { + this.ep.smf.writeMessage(this.sw.dos, msg); + } + + public void flush() throws IOException + { + this.sw.dos.flush(); + } + + public void writeMessageAndFlush(ScribMessage msg) throws IOException + { + writeMessage(msg); + flush(); + } + + public void close() throws IOException + { + this.sw.close(); + } + + @Override + public String toString() + { + return this.sw.sock.getInetAddress().toString() + ":" + this.sw.sock.getPort(); + } +} + +// Could move to EndpointInputQueues +class ReceiverThread extends Thread +{ + /*private final MPSTEndpoint ep; + private final Role peer; + private final DataInputStream dis; + + private Throwable fail;*/ + + public ReceiverThread(MPSTEndpoint ep, Role peer, DataInputStream dis) + { + /*this.ep = ep; + this.peer = peer; + this.dis = dis;*/ + + //ep.getInputQueues().register(peer); + } + + public void run() + { + /*EndpointInputQueues queues = null;//this.ep.getInputQueues(); + try + { + while (true) + { + ScribMessage m = this.ep.smf.readMessage(this.dis); + queues.enqueue(this.peer, m); // FIXME: bounded buffer? (endpoint queue property?) + } + } + catch (IOException e) + { + this.fail = e; + } + finally + { + try + { + dis.close(); // Maybe just rely on main SocketEndpoint.close + } + catch (IOException e) + { + if (this.fail == null) + { + this.fail = e; + } + } + finally + { + if (this.fail != null) + { + queues.interrupt(this.peer, this.fail); + } + } + }*/ + } +} diff --git a/scribble-runtime/src/main/java/org/scribble/runtime/net/SocketWrapper.java b/scribble-runtime/src/main/java/org/scribble/runtime/net/SocketWrapper.java new file mode 100644 index 000000000..e53b92176 --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/runtime/net/SocketWrapper.java @@ -0,0 +1,59 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.runtime.net; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.net.Socket; + +// FIXME: should be IO wrapper: should abstract sockets, shared memory, RMI, AMQP, etc etc +@Deprecated +public class SocketWrapper +{ + protected final Socket sock; + protected final DataOutputStream dos; + protected final DataInputStream dis; + + public SocketWrapper(Socket s) throws IOException + { + this.sock = s; + this.dos = new DataOutputStream(s.getOutputStream()); + this.dis = new DataInputStream(s.getInputStream()); + } + + public void close() throws IOException + { + try + { + this.dis.close(); + } + finally + { + try + { + this.dos.close(); + } + finally + { + this.sock.close(); + } + } + } + + public Socket getSocket() + { + return this.sock; + } +} diff --git a/scribble-runtime/src/main/java/org/scribble/runtime/session/CBEndpoint.java b/scribble-runtime/src/main/java/org/scribble/runtime/session/CBEndpoint.java new file mode 100644 index 000000000..fab986022 --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/runtime/session/CBEndpoint.java @@ -0,0 +1,187 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.runtime.session; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; +import java.util.function.Function; + +import org.scribble.core.type.name.Role; +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.handlers.ScribBranch; +import org.scribble.runtime.handlers.ScribOutputEvent; +import org.scribble.runtime.handlers.ScribSigMessage; +import org.scribble.runtime.handlers.states.ScribEndState; +import org.scribble.runtime.handlers.states.ScribInputState; +import org.scribble.runtime.handlers.states.ScribOutputState; +import org.scribble.runtime.handlers.states.ScribState; +import org.scribble.runtime.message.ScribMessage; +import org.scribble.runtime.message.ScribMessageFormatter; + +public class CBEndpoint extends MPSTEndpoint +{ + protected final ScribState init; + protected final Map> outputs = new HashMap<>(); + protected final Map> inputs = new HashMap<>(); + + protected final D data; + + protected final Map states = new HashMap<>(); // Bypass problem of mutual references and static field initialisation (class loading) + + public CBEndpoint(S sess, R self, ScribMessageFormatter smf, ScribState init, D data) throws IOException, ScribRuntimeException + { + super(sess, self, smf); + this.init = init; + this.data = data; + } + + public Future run() throws ScribRuntimeException + { + Object[] res = new Object[1]; + + // FIXME: integrate with selector (or make Executor) + new Thread() + { + private final CBEndpoint edep; + + { + this.edep = CBEndpoint.this; + } + + public void run() + { + try + { + ScribState curr = this.edep.init; + while (!(curr instanceof ScribEndState)) + { + if (curr instanceof ScribOutputState) + { + // FIXME: make ScribOutputEvent an interface and add to bounds of output icallback (to preclude dynamic cast check) -- also make generated ..._Message an interface + ScribOutputEvent m = (ScribOutputEvent) this.edep.outputs.get(curr).apply(this.edep.data); // FIXME: state object + /*getChannelEndpoint(m.getPeer()).write(new ScribMessage(m.getOp(), m.getPayload().toArray(new Object[0]))); // FIXME: ScribEvent has extra Role + curr = this.edep.states.get(((ScribOutputState) curr).succs.get(m.getOp()));*/ + if (m instanceof ScribSigMessage) + { + getChannelEndpoint(m.getPeer()).write(((ScribSigMessage) m).getSig()); + } + else + { + getChannelEndpoint(m.getPeer()).write(new ScribMessage(m.getOp(), m.getPayload())); // API gen extends ScribMessage, but no guarantee about user-defined types -- can only rely on ScribOutputEvent i/f + } + curr = this.edep.states.get(((ScribOutputState) curr).succs.get(m.getOp())); + } + else if (curr instanceof ScribInputState) + { + try // cf. ReceiveSocket#readScribMessage + { + ScribMessage m = getChannelEndpoint(((ScribInputState) curr).peer).getFuture().get(); + this.edep.inputs.get(curr).dispatch(this.edep.data, m); + curr = this.edep.states.get(((ScribInputState) curr).succs.get(m.op)); + } + catch (InterruptedException e) + { + //throw new IOException(e); + res[0] = new IOException(e); + break; + } + catch (ExecutionException e) + { + //throw new IOException(e); + res[0] = new IOException(e); + break; + } + } + else + { + throw new RuntimeException("Shouldn't get in here: " + curr); + } + } + } + catch (IOException e) + { + res[0] = e; + } + + if (res[0] == null) + { + res[0] = 0; + } + synchronized(res) + { + res.notify(); + } + setCompleted(); + } + }.start(); + + return new EventDrivenEndpointFuture(res); + } +} + +class EventDrivenEndpointFuture implements Future +{ + private final Object[] res; + + protected EventDrivenEndpointFuture(Object[] res) + { + this.res = res; + } + + @Override + public boolean cancel(boolean mayInterruptIfRunning) + { + throw new RuntimeException("TODO"); + } + + @Override + public Void get() throws InterruptedException, ExecutionException + { + while (this.res[0] == null) + { + synchronized (this.res) + { + this.res.wait(); + } + } + if (this.res[0] instanceof IOException) + { + throw new ExecutionException((IOException) this.res[0]); + } + return null; + } + + @Override + public Void get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException + { + throw new RuntimeException("TODO"); + } + + @Override + public boolean isCancelled() + { + throw new RuntimeException("TODO"); + } + + @Override + public boolean isDone() + { + return this.res[0] != null; + } +} \ No newline at end of file diff --git a/scribble-runtime/src/main/java/org/scribble/runtime/session/EndpointInputQueues.java b/scribble-runtime/src/main/java/org/scribble/runtime/session/EndpointInputQueues.java new file mode 100644 index 000000000..aef3dcfa0 --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/runtime/session/EndpointInputQueues.java @@ -0,0 +1,179 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.runtime.session; + +import java.io.IOException; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.CompletableFuture; + +import org.scribble.core.type.name.Role; +import org.scribble.runtime.message.ScribInterrupt; +import org.scribble.runtime.message.ScribMessage; +import org.scribble.util.RuntimeScribException; + +@Deprecated +public class EndpointInputQueues +{ + // FIXME: factor out individual role queues (with counts and tickets, and bounded cache size?) + + private final Map> queues = new HashMap<>(); + //private final List list = new LinkedList<>(); + + private final Map counts = new HashMap<>(); // How many ScribMessages read so far + private final Map tickets = new HashMap<>(); // Index of the next expected ScribMessage + + public EndpointInputQueues() + { + + } + + public synchronized int getTicket(Role peer) + { + int next = this.tickets.get(peer) + 1; + this.tickets.put(peer, next); + return next; + } + + public synchronized void register(Role peer) + { + this.queues.put(peer, new LinkedList<>()); + this.counts.put(peer, 0); + this.tickets.put(peer, 0); + } + + public synchronized void enqueue(Role peer, ScribMessage o) + { + this.queues.get(peer).add(o); + //this.list.add(o); + this.counts.put(peer, this.counts.get(peer) + 1); + notifyAll(); // FIXME: notify just for each peer + } + + public synchronized void interrupt(Role peer, Throwable t) + { + enqueue(peer, new ScribInterrupt(t)); + } + + public synchronized boolean isEmpty(Role peer) + { + return this.queues.get(peer).isEmpty(); + } + + /*public synchronized Object peek(Role src) + { + return this.queues.get(src).get(0); + }*/ + + // Default CompletableFuture executed by common forkjoin pool -- so all messages that are received/async'd will eventually be pulled from the queue (no manual GC necessary) + public synchronized CompletableFuture getFuture(Role peer) + { + // FIXME: better exception handling (integrate with Future interface?) + return CompletableFuture.supplyAsync(() -> + { + try + { + ScribMessage m = dequeue(peer, getTicket(peer)); + if (m instanceof ScribInterrupt) // FIXME: hacked in + { + throw new RuntimeScribException((Throwable) ((ScribInterrupt) m).payload[0]); + } + return m; + } + catch(IOException e) + { + throw new RuntimeScribException(e); + } + }); + } + + protected synchronized ScribMessage dequeue(Role peer, int ticket) throws IOException + { + try + { + while (this.counts.get(peer) < ticket) + { + wait(); + } + List queue = this.queues.get(peer); + while (queue.isEmpty()) + { + wait(); + } + ScribMessage m = queue.remove(0); + //this.list.remove(o); + return m; + } + catch (InterruptedException e) + { + throw new IOException(e); + } + } + + /*public boolean isEmpty() + { + return this.list.isEmpty(); + }*/ + + /*public Object dequeue() + { + Object o = this.list.remove(0); + for (List os : this.global.values()) + { + if (os.contains(o)) + { + os.remove(o); + break; + } + } + return o; + }*/ + + /*// Synchronized against usage in SocketEndpoint + public synchronized Object readObject() throws IOException + { + synchronized (this) + { + while (isEmpty()) + { + try + { + this.wait(); + } + catch (InterruptedException e) + { + throw new IOException(e); + } + } + return dequeue(); + } + }*/ + + /*public ScribbleInterrupt checkForInterrupt() + { + synchronized (this) + { + for (List queue : this.global.values()) + { + if (!queue.isEmpty() && (queue.get(0) instanceof ScribbleInterrupt)) + { + return (ScribbleInterrupt) queue.remove(0); + } + } + } + return null; + }*/ +} diff --git a/scribble-runtime/src/main/java/org/scribble/runtime/session/ExplicitEndpoint.java b/scribble-runtime/src/main/java/org/scribble/runtime/session/ExplicitEndpoint.java new file mode 100644 index 000000000..ba353a2b3 --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/runtime/session/ExplicitEndpoint.java @@ -0,0 +1,38 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.runtime.session; + +import java.io.IOException; + +import org.scribble.core.type.name.Role; +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.message.ScribMessageFormatter; + +public class ExplicitEndpoint extends SessionEndpoint +{ + public ExplicitEndpoint(S sess, R self, ScribMessageFormatter smf) throws IOException, ScribRuntimeException + { + super(sess, self, smf); + } + + // FIXME HACK: "init" really only for MPSTEndpoint? Then refactor into there only + @Override + public void init() throws ScribRuntimeException + { + if (this.init) + { + throw new ScribRuntimeException("Session endpoint already initialised."); + } + } +} diff --git a/scribble-runtime/src/main/java/org/scribble/runtime/session/MPSTEndpoint.java b/scribble-runtime/src/main/java/org/scribble/runtime/session/MPSTEndpoint.java new file mode 100644 index 000000000..709e51813 --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/runtime/session/MPSTEndpoint.java @@ -0,0 +1,111 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.runtime.session; + +import java.io.IOException; +import java.net.UnknownHostException; +import java.util.concurrent.Callable; + +import org.scribble.core.type.name.Role; +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.message.ScribMessageFormatter; +import org.scribble.runtime.net.BinaryChannelEndpoint; +import org.scribble.runtime.net.ScribServerSocket; + +// FIXME: factor out between role-endpoint based socket and channel-endpoint sockets +//.. initiator and joiner endpoints +public class MPSTEndpoint extends SessionEndpoint +{ + public MPSTEndpoint(S sess, R self, ScribMessageFormatter smf) throws IOException, ScribRuntimeException + { + super(sess, self, smf); + } + + public void request(Role role, Callable cons, String host, int port) throws ScribRuntimeException, UnknownHostException, IOException + { + MPSTEndpoint.request(this, role, cons, host, port); + } + + // HACK FIXME: refactor (location, protected, etc) + public static void request(SessionEndpoint se, Role role, Callable cons, String host, int port) throws ScribRuntimeException, UnknownHostException, IOException + { + // Can connect unlimited, as long as not already used via init + //if (this.init) + if (se.init) + { + //throw new ScribbleRuntimeException("Socket already initialised: " + this.getClass()); + throw new ScribRuntimeException("Socket already initialised: " + se.getClass()); + } + //if (this.chans.containsKey(role)) + if (se.chans.containsKey(role)) + { + throw new ScribRuntimeException("Already connected to: " + role); + } + try + { + BinaryChannelEndpoint c = cons.call(); + /*c.initClient(this, host, port); + register(role, c);*/ + c.initClient(se, host, port); + se.register(role, c); + } + catch (Exception e) + { + if (e instanceof IOException) + { + throw (IOException) e; + } + throw new IOException(e); + } + } + + public void accept(ScribServerSocket ss, Role role) throws IOException, ScribRuntimeException + { + accept(this, ss, role); + } + + //public static void accept(SessionEndpoint se, ScribServerSocket ss, Role role) throws IOException, ScribbleRuntimeException + public static void accept(SessionEndpoint se, ScribServerSocket ss, Role role) throws IOException, ScribRuntimeException + { + //if (this.init) + if (se.init) + { + //throw new ScribbleRuntimeException("Socket already initialised: " + this.getClass()); + throw new ScribRuntimeException("Socket already initialised: " + se.getClass()); + } + //if (this.chans.containsKey(role)) + if (se.chans.containsKey(role)) + { + throw new ScribRuntimeException("Already connected to: " + role); + } + //register(role, ss.accept(this)); // FIXME: serv map in SessionEndpoint not currently used + se.register(role, ss.accept(se)); // FIXME: serv map in SessionEndpoint not currently used + } + + public void disconnect(Role role) throws IOException, ScribRuntimeException + { + MPSTEndpoint.disconnect(this, role); + } + + public static void disconnect(SessionEndpoint se, Role role) throws IOException, ScribRuntimeException + { + //if (!this.chans.containsKey(role)) + if (!se.chans.containsKey(role)) + { + throw new ScribRuntimeException("Not connected to: " + role); + } + //deregister(role); + se.deregister(role); + } +} diff --git a/scribble-runtime/src/main/java/org/scribble/runtime/session/OpEnum.java b/scribble-runtime/src/main/java/org/scribble/runtime/session/OpEnum.java new file mode 100644 index 000000000..64419db70 --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/runtime/session/OpEnum.java @@ -0,0 +1,19 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.runtime.session; + +public interface OpEnum +{ + +} diff --git a/scribble-runtime/src/main/java/org/scribble/runtime/session/Principal.java b/scribble-runtime/src/main/java/org/scribble/runtime/session/Principal.java new file mode 100644 index 000000000..0f9d52675 --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/runtime/session/Principal.java @@ -0,0 +1,67 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.runtime.session; + +import java.io.Serializable; + +import org.scribble.core.type.name.Role; + +@Deprecated +public class Principal implements Serializable +{ + private static final long serialVersionUID = 1L; + + public final Role role; + /*public final String host; + public final int port; // The "session port"*/ + + public Principal(Role role)//, String host, int port) + { + this.role = role; + //this.host = host; + //this.port = port; + } + + @Override + public int hashCode() + { + int hash = 859; + hash = 31 * hash + this.role.hashCode(); + //hash = 31 * hash + this.host.hashCode(); + //hash = 31 * hash + this.port; + return hash; + } + + @Override + public boolean equals(Object o) + { + if (this == o) + { + return true; + } + if (!(o instanceof Principal)) + { + return false; + } + Principal p = (Principal) o; + return this.role.equals(p.role);//this.host.equals(p.host) && this.port == p.port; + } + + @Override + public String toString() + { + //return this.role + "@" + this.host + ":" + this.port; + return this.role.toString(); + } +} diff --git a/scribble-runtime/src/main/java/org/scribble/runtime/session/ScribInputSelector.java b/scribble-runtime/src/main/java/org/scribble/runtime/session/ScribInputSelector.java new file mode 100644 index 000000000..5041da9e9 --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/runtime/session/ScribInputSelector.java @@ -0,0 +1,154 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.runtime.session; + +import java.io.IOException; +import java.nio.channels.ClosedChannelException; +import java.nio.channels.SelectionKey; +import java.nio.channels.Selector; +import java.nio.channels.spi.AbstractSelectableChannel; +import java.util.Set; + +import org.scribble.core.type.name.Role; +import org.scribble.runtime.net.BinaryChannelEndpoint; + +public class ScribInputSelector extends Thread +{ + //private MPSTEndpoint se; // FIXME + private SessionEndpoint se; // FIXME + private final Selector sel; + + private volatile boolean paused = false; + private volatile boolean closed = false; + + //public ScribInputSelector(MPSTEndpoint se) throws IOException + public ScribInputSelector(SessionEndpoint se) throws IOException + { + this.se = se; + this.sel = Selector.open(); + } + + @Override + public void run() + { + try + { + //waitForInit(); + //..FIXME: reg serversocketchannel with sel -- midsession reg needs wakeup and re-select? + //..here: do java smtp version using nio + + while (!this.closed) + { + this.sel.select(); + if (this.closed) + { + return; + } + synchronized (this) // sync'd with pause, unpause + { + while (paused) + { + wait(); + } + + Set keys = this.sel.selectedKeys(); + for (SelectionKey key : keys) + { + //SocketChannel s = (SocketChannel) key.channel(); + if (key.isReadable()) + { + Role peer = (Role) key.attachment(); + this.se.chans.get(peer).readAndEnqueueMessages(); // Read as many message as possible as selector only woken up by actual I/O + } + else + { + throw new RuntimeException("TODO: " + key); + } + } + } + } + } + catch (Exception e) + { + // FIXME: throw to user -- e.g. MessageFormatter.fromBytes exception + e.printStackTrace(); // FIXME? java.nio.channels.CancelledKeyException + } + finally + { + try + { + this.sel.close(); + } + catch (IOException e) + { + // FIXME + e.printStackTrace(); + } + } + } + + protected Selector getSelector() + { + return this.sel; + } + + // synchronize? + protected SelectionKey register(AbstractSelectableChannel c) throws ClosedChannelException + { + return c.register(this.sel, SelectionKey.OP_READ); + } + + protected void deregister(SelectionKey key) // FIXME: refactor to internalise key inside here? + { + key.cancel(); + } + + // process all keys and keep doing until all pending futures have completed -- i.e. all reads done up to this send state (currently wrap assumed to in send state only) + protected synchronized void clear() + { + + } + + protected synchronized void pause() + { + this.paused = true; + this.sel.wakeup(); + } + + protected synchronized void unpause() + { + this.paused = false; + notify(); + } + + protected synchronized void close() + { + this.closed = true; + this.paused = false; + //for (BinaryChannelEndpoint c : this.se.chans.values()) + for (Role peer : this.se.getPeers()) + { + try + { + BinaryChannelEndpoint c = this.se.getChannelEndpoint(peer); + c.close(); // dereg from sel? + } + catch (IOException e) + { + e.printStackTrace(); + } + } + this.sel.wakeup(); + } +} diff --git a/scribble-runtime/src/main/java/org/scribble/runtime/session/Session.java b/scribble-runtime/src/main/java/org/scribble/runtime/session/Session.java new file mode 100644 index 000000000..53f21f628 --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/runtime/session/Session.java @@ -0,0 +1,166 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.runtime.session; + +import java.io.IOException; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Random; + +import org.scribble.core.type.name.GProtoName; +import org.scribble.core.type.name.Role; +import org.scribble.main.ScribRuntimeException; +import org.scribble.util.ScribException; + +public abstract class Session +{ + private static final Map sessions = new HashMap(); + + public final int id; + + public final List impath; + public final String modpath; + public final GProtoName proto; + + //private final Map> endpoints = new HashMap<>(); // Only for local endpoints + private final Map> endpoints = new HashMap<>(); // Only for local endpoints + + public Session(int id, List impath, String modpath, GProtoName proto) + { + this.id = id; + this.impath = impath; + this.modpath = modpath; + this.proto = proto; + + Session.sessions.put(id, this); + } + + public Session(List importPath, String source, GProtoName proto) + { + this(getFreshId(), importPath, source, proto); + } + + /*// Client side + //public SessionEndpointOld toEndpoint(Principal p) throws ScribbleException, IOException + public SessionEndpoint project(R role, ScribMessageFormatter smf) throws ScribbleRuntimeException + { + if (this.endpoints.containsKey(role)) + { + throw new ScribbleRuntimeException("Session endpoint already created for: " + role); + } + try + { + SessionEndpoint ep = new SessionEndpoint<>(this, role, smf); + this.endpoints.put(role, ep); + return ep; + } + catch (IOException e) + { + throw new ScribbleRuntimeException(e); + } + }*/ + //protected

SessionEndpoint project(R role, ScribMessageFormatter smf) throws ScribbleRuntimeException, IOException + //protected void project(MPSTEndpoint se) throws ScribbleRuntimeException, IOException + protected void project(SessionEndpoint se) throws ScribRuntimeException, IOException + { + if (!getRoles().contains(se.self)) + { + throw new ScribRuntimeException("Invalid role: " + se.self); + } + if (this.endpoints.containsKey(se.self)) + { + throw new ScribRuntimeException("Session endpoint already created for: " + se.self); + } + //SessionEndpoint ep = new SessionEndpoint<>(this, role, smf); + this.endpoints.put(se.self, se); + //return ep; + } + + /*// Server side + protected SessionEndpoint project(R role, ScribMessageFormatter smf, ScribServerSocket ss) throws ScribbleRuntimeException, IOException + { + // FIXME: check valid role + if (this.endpoints.containsKey(role)) + { + throw new ScribbleRuntimeException("Session endpoint already created for: " + role); + } + SessionEndpoint ep = (ss == null) + ? new SessionEndpoint<>(this, role, smf) + : new SessionEndpoint<>(this, role, smf, ss); + this.endpoints.put(role, ep); + return ep; + }*/ + + /*public SessionEndpointOld project(Principal p) throws ScribbleException, IOException + { + if (this.endpoints.containsKey(p.role)) + { + throw new ScribbleException("Session endpoint already created for: " + p.role); + } + SessionEndpointOld ep = new SessionEndpointOld(this, p); + //this.endpoints.put(p.role, ep); + return ep; + }*/ + + public boolean hasEndpoint(Role role) + { + return this.endpoints.containsKey(role); + } + + //public SessionEndpoint getEndpoint(Role role) throws ScribbleException + public MPSTEndpoint getEndpoint(R role) throws ScribException + { + if (!this.endpoints.containsKey(role)) + { + throw new ScribException("No endpoint for: " + role); + } + @SuppressWarnings("unchecked") + MPSTEndpoint cast = (MPSTEndpoint) this.endpoints.get(role); // FIXME: + return cast; + } + + /*public static boolean hasSession(int id) + { + return Session.sessions.containsKey(id); + }*/ + + public static Session getSession(int id) throws ScribException + { + if (!Session.sessions.containsKey(id)) + { + throw new ScribException("No such session: " + id); + } + return Session.sessions.get(id); + } + + private static int getFreshId() + { + Random random = new Random(); + int id = random.nextInt(10000); + while (Session.sessions.keySet().contains(id)) + { + id = random.nextInt(10000); + } + return id; + } + + @Override + protected void finalize() + { + Session.sessions.remove(this.id); + } + + public abstract List getRoles(); +} diff --git a/scribble-runtime/src/main/java/org/scribble/runtime/session/SessionEndpoint.java b/scribble-runtime/src/main/java/org/scribble/runtime/session/SessionEndpoint.java new file mode 100644 index 000000000..c26225fb4 --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/runtime/session/SessionEndpoint.java @@ -0,0 +1,386 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.runtime.session; + +import java.io.IOException; +import java.nio.channels.SelectionKey; +import java.security.GeneralSecurityException; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +import org.scribble.core.type.name.Role; +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.message.ScribMessageFormatter; +import org.scribble.runtime.net.BinaryChannelEndpoint; +import org.scribble.runtime.net.BinaryChannelWrapper; +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.util.Buf; +import org.scribble.util.RuntimeScribException; + +// FIXME: factor out between role-endpoint based socket and channel-endpoint sockets +//.. initiator and joiner endpoints +public abstract class SessionEndpoint implements AutoCloseable +{ + public final Buf gc = new Buf<>(); + + public final Session sess; + public final Role self; + public final ScribMessageFormatter smf; + + protected boolean init = false; + //private boolean bound = false; + private boolean complete = false; + private boolean closed = false; + + protected final Map servs = new HashMap<>(); // For multi-role endpoints? // Or currently only self is used as a key, but should be peer roles instead? + // Generally, think was in the middle of refactoring for explicit connections + protected final Map chans = new HashMap<>(); + + private final ScribInputSelector sel; + private final Map keys = new HashMap<>(); + + public SessionEndpoint(S sess, R self, ScribMessageFormatter smf) throws IOException, ScribRuntimeException + { + this.sess = sess; + this.self = self; + this.smf = smf; + + sess.project(this); + + this.sel = new ScribInputSelector(this); + this.sel.start(); + } + + /*// FIXME: generalise roles and server socks for endpoints playing multiple roles + public SessionEndpoint(Session sess, Role self, ScribMessageFormatter smf, ScribServerSocket ss) throws IOException, ScribbleRuntimeException + { + this(sess, self, smf); + //register(self, ss); + this.sel.pause(); + this.servs.put(self, ss); + this.sel.unpause(); + } + + // FIXME: allowing multiple serversocks to be registered, but it just overrides the self entry (already set by constructor) -- server socks not identified with peer (or protocol state) + // -- and InitSocket accept always uses the self server sock + //public synchronized void register(Role self, ScribServerSocket ss) throws IOException, ScribbleRuntimeException + // TODO: was refactoring for explicit connections + protected synchronized void register(Role self, ScribServerSocket ss) throws IOException, ScribbleRuntimeException + { + this.sel.pause(); + this.servs.put(self, ss); + this.sel.unpause(); + }*/ + + /*public synchronized void register(Role peer, String host, int port) throws IOException + { + throw new RuntimeException("TODO: " + host + ", " + port); + }*/ + + public synchronized void register(Role peer, BinaryChannelEndpoint c) throws IOException + { + this.sel.pause(); + SelectionKey key = this.sel.register(c.getSelectableChannel()); + key.attach(peer); + this.keys.put(peer, key); + this.chans.put(peer, c); + this.sel.unpause(); + } + + // w is uninitialised (need to use wrapChannel) + public synchronized void reregister(Role peer, BinaryChannelWrapper w) throws IOException, GeneralSecurityException + { + /*this.sel.pause(); + SelectionKey old = getChannelEndpoint(peer).getSelectableChannel().keyFor(this.sel.getSelector()); + if (old == null) + { + throw new RuntimeException("Endpoint not yet registered for: " + peer); + } + old.cancel(); + SelectionKey key = this.sel.register(c.getSelectableChannel()); + key.attach(peer); + this.chans.put(peer, c); + this.sel.unpause();*/ + + BinaryChannelEndpoint c = getChannelEndpoint(peer); + c.sync(); + + this.sel.pause(); + // FIXME: consume all pending messages/futures first? or ok to leave data in existing bb -- or only permit in states where bb is empty? + // Underlying selectable channel is the same, so no need to cancel key and re-reg -- OK to assume in general? + w.wrapChannel(c); + w.clientHandshake(); + this.chans.put(peer, w); // SelectoinKey unchanged? + this.sel.unpause(); + } + + public synchronized void deregister(Role peer) throws IOException + { + this.sel.pause(); + try + { + //this.keys.remove(peer).cancel(); + this.sel.deregister(this.keys.remove(peer)); + this.chans.remove(peer).close(); + } + finally + { + this.sel.unpause(); + } + } + + public ScribInputSelector getSelector() + { + return this.sel; + } + + public BinaryChannelEndpoint getChannelEndpoint(Role role) + { + if (!this.chans.containsKey(role)) + { + throw new RuntimeScribException(this.self + " is not connected to: " + role); + } + return this.chans.get(role); + } + + public void setCompleted() + { + this.complete = true; + } + + public boolean isCompleted() + { + return this.complete; + } + + @Override + public synchronized void close() throws ScribRuntimeException + { + if (!this.closed) + { + try + { + this.closed = true; + this.sel.close(); + this.servs.values().forEach(ss -> ss.unbind()); + } + finally + { + if (!isCompleted()) // Subsumes use -- must be used for sess to be completed + { + throw new ScribRuntimeException("Session not completed: " + this.self); + } + } + } + } + + public ScribServerSocket getSelfServerSocket() + { + ScribServerSocket ss = this.servs.get(this.self); + if (ss == null) + { + throw new RuntimeScribException("No server registered."); + } + return ss; + } + + protected Set getPeers() + { + return this.chans.keySet(); + } + + + /*public void connect(Role role, Callable cons, String host, int port) throws ScribbleRuntimeException, UnknownHostException, IOException + { + // Can connect unlimited, as long as not already used via init + if (this.init) + { + throw new ScribbleRuntimeException("Socket already initialised: " + this.getClass()); + } + if (this.chans.containsKey(role)) + { + throw new ScribbleRuntimeException("Already connected to: " + role); + } + try + { + BinaryChannelEndpoint c = cons.call(); + c.initClient(this, host, port); + register(role, c); + } + catch (Exception e) + { + if (e instanceof IOException) + { + throw (IOException) e; + } + throw new IOException(e); + } + } + + public void accept(ScribServerSocket ss, Role role) throws IOException, ScribbleRuntimeException + { + if (this.init) + { + throw new ScribbleRuntimeException("Socket already initialised: " + this.getClass()); + } + if (this.chans.containsKey(role)) + { + throw new ScribbleRuntimeException("Already connected to: " + role); + } + register(role, ss.accept(this)); // FIXME: serv map in SessionEndpoint not currently used + } + + public void disconnect(Role role) throws IOException, ScribbleRuntimeException + { + if (!this.chans.containsKey(role)) + { + throw new ScribbleRuntimeException("Not connected to: " + role); + } + deregister(role); + }*/ + + /*public void init() + { + this.initialised = true; + }*/ + + /*protected boolean isInitialised() + { + return this.initialised; + }*/ + + //public void bind() throws ScribbleRuntimeException + public void init() throws ScribRuntimeException + { + /*if (this.bound) + { + throw new ScribbleRuntimeException("Session endpoint already bound."); + }*/ + //if (!this.initialised) + if (this.init) + { + throw new ScribRuntimeException("Session endpoint already initialised."); + } + //this.bound = true; + this.init = true; + } + + + + + + /*public final Session sess; + //public final Principal self; + public final Role self; + public final ScribMessageFormatter smf; + + private boolean complete = false; + + private final Map socks = new HashMap<>(); // Includes SelfSocketEndpoint + private final EndpointInputQueues queues = new EndpointInputQueues(); + + //protected final LocalProtocolDecl root; + //public final Monitor monitor; + + protected SessionEndpoint(Session sess, Role self, ScribMessageFormatter smf) //throws ScribbleException, IOException + { + this.sess = sess; + this.self = self; + this.smf = smf; + + /*ProtocolName lpn = Projector.makeProjectedProtocolName(sess.proto, this.self.role); + this.root = (LocalProtocolDecl) projections.get(lpn.getPrefix()).protos.get(0);* / + //this.monitor = createMonitor(sess.impath, sess.source, sess.proto, self); + } + + public void setCompleted() + { + this.complete = true; + } + + public boolean isCompleted() + { + return this.complete; + } + + // Only for remote endpoints (self SocketEndpoint is done in above constructor; but not recorded in role-principal map) + public void register(Role peer, SocketWrapper sw) //throws IOException + { + this.socks.put(peer, new SocketEndpoint(this, peer, sw)); + } + + /*public Set getRemoteRoles() + { + return this.remroles.keySet(); + } + + public Principal getRemotePrincipal(Role role) + { + return this.remroles.get(role); + }* / + + public SocketEndpoint getSocketEndpoint(Role role) + { + if (!this.socks.containsKey(role)) + { + throw new RuntimeScribbleException(this.self + " is not connected to: " + role); + } + return this.socks.get(role); + } + + public EndpointInputQueues getInputQueues() + { + return this.queues; + } + + public void close() + { + for (SocketEndpoint se : this.socks.values()) + { + try + { + se.close(); + } + catch (IOException e) + { + // FIXME: + } + } + } + + /* // proto is fullname + private static Monitor createMonitor(List impath, String source, ProtocolName proto, Role self) throws ScribbleException, IOException + { + // FIXME: API (strings vs non-strings, simple vs full names) + Job job = Tool.getWellFormedJob(impath, source); + Map projections = Tool.getProjections(job, proto.getSimpleName().toString(), self.toString()); + Map graphs = Tool.buildGraphs(job, projections); + + ProtocolName lpn = Projector.makeProjectedProtocolName(proto, self); + System.out.println("[DEBUG] Projected graph: " + graphs.get(lpn).toDot()); + + return new Monitor(graphs, lpn); + }*/ + + /*public Set getRemoteRoles() + { + return this.remroles.keySet(); + } + + public Principal getRemotePrincipal(Role role) + { + return this.remroles.get(role); + }*/ +} diff --git a/scribble-runtime/src/main/java/org/scribble/runtime/statechans/AcceptSocket.java b/scribble-runtime/src/main/java/org/scribble/runtime/statechans/AcceptSocket.java new file mode 100644 index 000000000..1415ae8e6 --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/runtime/statechans/AcceptSocket.java @@ -0,0 +1,45 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.runtime.statechans; + +import java.io.IOException; + +import org.scribble.core.type.name.Role; +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.session.Session; +import org.scribble.runtime.session.SessionEndpoint; + +public abstract class AcceptSocket extends LinearSocket +{ + //protected AcceptSocket(MPSTEndpoint ep) + protected AcceptSocket(SessionEndpoint ep) + { + super(ep); + } + + /*public void accept(ScribServerSocket ss, Role role) throws IOException, ScribbleRuntimeException + { + use(); + this.ep.register(role, ss.accept()); + }*/ + + protected void accept(ScribServerSocket ss, Role role) throws IOException, ScribRuntimeException + { + use(); + //this.se.accept(ss, role); // FIXME: csat + MPSTEndpoint.accept(this.se, ss, role); + } +} diff --git a/scribble-runtime/src/main/java/org/scribble/runtime/statechans/AffineSocket.java b/scribble-runtime/src/main/java/org/scribble/runtime/statechans/AffineSocket.java new file mode 100644 index 000000000..fd1d1a5c5 --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/runtime/statechans/AffineSocket.java @@ -0,0 +1,33 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.runtime.statechans; + +import org.scribble.core.type.name.Role; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.session.Session; + +@Deprecated +public abstract class AffineSocket extends LinearSocket +{ + protected AffineSocket(MPSTEndpoint ep) + { + super(ep); + } + + /*@Override + protected void close() throws ScribbleRuntimeException + { + this.ep.close(); // No used check + }*/ +} diff --git a/scribble-runtime/src/main/java/org/scribble/runtime/statechans/BranchSocket.java b/scribble-runtime/src/main/java/org/scribble/runtime/statechans/BranchSocket.java new file mode 100644 index 000000000..80acc14fa --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/runtime/statechans/BranchSocket.java @@ -0,0 +1,27 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.runtime.statechans; + +import org.scribble.core.type.name.Role; +import org.scribble.runtime.session.Session; +import org.scribble.runtime.session.SessionEndpoint; + +public abstract class BranchSocket extends ReceiveSocket +{ + //protected BranchSocket(MPSTEndpoint ep) + protected BranchSocket(SessionEndpoint ep) + { + super(ep); + } +} diff --git a/scribble-runtime/src/main/java/org/scribble/runtime/statechans/CaseSocket.java b/scribble-runtime/src/main/java/org/scribble/runtime/statechans/CaseSocket.java new file mode 100644 index 000000000..f502d8c03 --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/runtime/statechans/CaseSocket.java @@ -0,0 +1,28 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.runtime.statechans; + +import org.scribble.core.type.name.Role; +import org.scribble.runtime.session.Session; +import org.scribble.runtime.session.SessionEndpoint; + +// For "receiving" the payloads after a branch is done +public abstract class CaseSocket extends LinearSocket // No I/O induced by this socket itself (i.e. not a ReceiveSocket) +{ + //protected CaseSocket(MPSTEndpoint ep) + protected CaseSocket(SessionEndpoint ep) + { + super(ep); + } +} diff --git a/scribble-runtime/src/main/java/org/scribble/runtime/statechans/ConnectSocket.java b/scribble-runtime/src/main/java/org/scribble/runtime/statechans/ConnectSocket.java new file mode 100644 index 000000000..26a5a8434 --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/runtime/statechans/ConnectSocket.java @@ -0,0 +1,46 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.runtime.statechans; + +import java.io.IOException; +import java.net.UnknownHostException; +import java.util.concurrent.Callable; + +import org.scribble.core.type.name.Role; +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.net.BinaryChannelEndpoint; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.session.Session; + +@Deprecated +public abstract class ConnectSocket extends LinearSocket +{ + protected ConnectSocket(MPSTEndpoint ep) + { + super(ep); + } + + /*public void connect(Role role, String host, int port) throws ScribbleRuntimeException, UnknownHostException, IOException + { + use(); + Socket s = new Socket(host, port); + this.ep.register(role, new SocketWrapper(s)); + }*/ + + protected void connect(Role role, Callable cons, String host, int port) throws ScribRuntimeException, UnknownHostException, IOException + { + use(); + //this.se.connect(role, cons, host, port); + } +} diff --git a/scribble-runtime/src/main/java/org/scribble/runtime/statechans/EndSocket.java b/scribble-runtime/src/main/java/org/scribble/runtime/statechans/EndSocket.java new file mode 100644 index 000000000..8ca386cd0 --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/runtime/statechans/EndSocket.java @@ -0,0 +1,51 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.runtime.statechans; + +import org.scribble.core.type.name.Role; +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.session.Session; +import org.scribble.runtime.session.SessionEndpoint; + +public abstract class EndSocket extends ScribSocket +{ + //public EndSocket(SessionEndpoint se, boolean dummy) + //protected EndSocket(MPSTEndpoint se) + protected EndSocket(SessionEndpoint se) + { + super(se); + } + + public void end() throws ScribRuntimeException + { + /*super.use(); + this.se.setCompleted();*/ + /*if (!this.se.isCompleted()) // Disabled for user implementations of the Handle interface -- No: unnecessary -- and if EndSocket has been returned, then session must be complete anyway... + { + throw new ScribbleRuntimeException("Session not completed: " + this.se); + }*/ + this.se.setCompleted(); + this.se.close(); + //this.closed = true; + } + + /*@Override + public void close() + { + if (!this.closed) + { + this.ep.close(); + } + }*/ +} diff --git a/scribble-runtime/src/main/java/org/scribble/runtime/statechans/InitSocket.java b/scribble-runtime/src/main/java/org/scribble/runtime/statechans/InitSocket.java new file mode 100644 index 000000000..8dc8f3c0f --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/runtime/statechans/InitSocket.java @@ -0,0 +1,94 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.runtime.statechans; + +import java.io.IOException; +import java.net.UnknownHostException; +import java.util.concurrent.Callable; + +import org.scribble.core.type.name.Role; +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.net.BinaryChannelEndpoint; +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.session.Session; + +// Establishing transport connections handled in here and wrapped up in SocketWrapper +@Deprecated +public abstract class InitSocket extends LinearSocket implements AutoCloseable +{ + protected InitSocket(MPSTEndpoint se) + { + super(se); + } + + public void connect(Callable cons, Role role, String host, int port) throws ScribRuntimeException, UnknownHostException, IOException + { + // Can connect unlimited, as long as not already used via init + if (isUsed()) + { + throw new ScribRuntimeException("Socket already initialised: " + this.getClass()); + } + try + { + BinaryChannelEndpoint c = cons.call(); + c.initClient(se, host, port); + this.se.register(role, c); + } + catch (Exception e) + { + if (e instanceof IOException) + { + throw (IOException) e; + } + throw new IOException(e); + } + } + + public void accept(ScribServerSocket ss, Role role) throws IOException, ScribRuntimeException + { + //accept(null, role); + if (isUsed()) + { + throw new ScribRuntimeException("Socket already initialised: " + this.getClass()); + } + this.se.register(role, ss.accept(this.se)); // FIXME: serv map in SessionEndpoint not currently used + } + + @Deprecated + public void accept(Role role) throws IOException, ScribRuntimeException + { + if (isUsed()) + { + throw new ScribRuntimeException("Socket already initialised: " + this.getClass()); + } + this.se.register(role, this.se.getSelfServerSocket().accept(this.se)); + } + + @Override + public void close() throws ScribRuntimeException + { + try + { + this.se.close(); + } + finally + { + if (!this.se.isCompleted()) // Subsumes use -- must be used for sess to be completed + { + throw new ScribRuntimeException("Session not completed: " + this.se.self); + } + } + } +} diff --git a/scribble-runtime/src/main/java/org/scribble/runtime/statechans/LinearSocket.java b/scribble-runtime/src/main/java/org/scribble/runtime/statechans/LinearSocket.java new file mode 100644 index 000000000..7244c2491 --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/runtime/statechans/LinearSocket.java @@ -0,0 +1,111 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.runtime.statechans; + +import java.io.IOException; +import java.util.concurrent.Callable; + +import org.scribble.core.type.name.Role; +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.net.BinaryChannelWrapper; +import org.scribble.runtime.session.Session; +import org.scribble.runtime.session.SessionEndpoint; + +// Not AutoClosable -- leave that to InitSocket +public abstract class LinearSocket extends ScribSocket +{ + private boolean used = false; + + //protected LinearSocket(MPSTEndpoint ep) + protected LinearSocket(SessionEndpoint ep) + { + super(ep); + } + + protected boolean isUsed() + { + return this.used; + } + + //protected synchronized void use() throws ScribbleRuntimeException + protected void use() throws ScribRuntimeException + { + if (this.used) + { + throw new ScribRuntimeException("Linear socket resource already used: " + this.getClass()); + } + this.used = true; + } + + //protected // FIXME: generate API operation + public void wrapClient(Role peer, Callable cons) throws IOException, ScribRuntimeException + { + //use(); // FIXME: should be use for proper API operation + if (this.used) + { + throw new ScribRuntimeException("Linear socket resource already used: " + this.getClass()); + } + try + { + this.se.reregister(peer, cons.call()); + } + catch (Exception e) + { + if (e instanceof IOException) + { + throw (IOException) e; + } + throw new IOException(e); + } + } + + // FIXME: refactor + // FIXME: State supertype of T + public static T wrapClient(T s, Role peer, Callable cons) throws IOException, ScribRuntimeException + { + ((LinearSocket) s).wrapClient(peer, cons); + return s; + } + + protected void wrapServer() + { + throw new RuntimeException("TODO"); + } + + /*// Only triggered by autoclose or explicit close, i.e. not called directly by user + protected synchronized void close() throws ScribbleRuntimeException + { + if (!this.used) + { + this.ep.close(); + throw new ScribbleRuntimeException("Socket resource not used: " + this.getClass()); + } + }*/ + + /*// FIXME: factor out transport parameter + // FIXME: close old socket -- handle old receive thread (consider messsages still arriving -- maybe only support reconnect for states where this is not possible) + // FIXME: synch new receive thread with old one if messages are allowed to still arrive on old one + public void reconnect(Role role, String host, int port) throws ScribbleRuntimeException, UnknownHostException, IOException + { + // Can connect unlimited, as long as not already used via init + if (this.used) + { + throw new ScribbleRuntimeException("Linear socket resource already used: " + this.getClass()); + } + SSLSocketFactory fact = (SSLSocketFactory) SSLSocketFactory.getDefault(); + Socket s1 = this.ep.getSocketEndpoint(role).getSocketWrapper().getSocket(); // FIXME: check already connected + SSLSocket s2 = (SSLSocket) fact.createSocket(s1, s1.getInetAddress().getHostAddress(), s1.getPort(), true); + this.ep.register(role, new SocketWrapper(s2)); // Replaces old SocketEndpoint // FIXME: tidy up + }*/ +} diff --git a/scribble-runtime/src/main/java/org/scribble/runtime/statechans/OutputSocket.java b/scribble-runtime/src/main/java/org/scribble/runtime/statechans/OutputSocket.java new file mode 100644 index 000000000..fb03f76c5 --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/runtime/statechans/OutputSocket.java @@ -0,0 +1,91 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.runtime.statechans; + +import java.io.IOException; +import java.net.UnknownHostException; +import java.util.concurrent.Callable; + +import org.scribble.core.type.name.Op; +import org.scribble.core.type.name.Role; +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.message.ScribMessage; +import org.scribble.runtime.net.BinaryChannelEndpoint; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.session.Session; +import org.scribble.runtime.session.SessionEndpoint; + +public abstract class OutputSocket extends LinearSocket +{ + //protected OutputSocket(MPSTEndpoint ep) + protected OutputSocket(SessionEndpoint ep) + { + super(ep); + } + + protected void writeScribMessage(Role peer, Op op, Object... payload) throws IOException, ScribRuntimeException + { + writeScribMessage(peer, new ScribMessage(op, payload)); + } + + protected void writeScribMessage(Role peer, ScribMessage msg) throws IOException, ScribRuntimeException + { + use(); + /*SocketEndpoint se = this.ep.getSocketEndpoint(peer); + se.writeMessageAndFlush(msg);*/ + this.se.getChannelEndpoint(peer).write(msg); + } + + // FIXME: check if MPST/ExplicitEndpoint + protected void connect(Role role, Callable cons, String host, int port) throws ScribRuntimeException, UnknownHostException, IOException + { + use(); + //this.se.connect(role, cons, host, port); + MPSTEndpoint.request(this.se, role, cons, host, port); + } + + // FIXME: check if MPST/ExplicitEndpoint + protected void disconnect(Role role) throws ScribRuntimeException, UnknownHostException, IOException + { + use(); + //this.se.disconnect(role); + MPSTEndpoint.disconnect(this.se, role); + } + + //public void wrap(Callable cons, Role role, String host, int port) throws ScribbleRuntimeException, UnknownHostException, IOException + + /*// Right to limit reconnect to send state? Or generalise and manually handle pending incoming messages on old connection? + public void reconnect(Callable cons, Role role, String host, int port) throws ScribbleRuntimeException, UnknownHostException, IOException + { + // Following InitSocket.connect + use(); + + ...FIXME: close old and make new + + try + { + BinaryChannelEndpoint c = cons.call(); + c.initClient(se, host, port); + this.se.reregister(role, c); + } + catch (Exception e) + { + if (e instanceof IOException) + { + throw (IOException) e; + } + throw new IOException(e); + } + }*/ +} diff --git a/scribble-runtime/src/main/java/org/scribble/runtime/statechans/ReceiveSocket.java b/scribble-runtime/src/main/java/org/scribble/runtime/statechans/ReceiveSocket.java new file mode 100644 index 000000000..f9919c99a --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/runtime/statechans/ReceiveSocket.java @@ -0,0 +1,69 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.runtime.statechans; + +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; + +import org.scribble.core.type.name.Role; +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.message.ScribMessage; +import org.scribble.runtime.session.Session; +import org.scribble.runtime.session.SessionEndpoint; + +public abstract class ReceiveSocket extends LinearSocket +{ + private CompletableFuture fut; + + protected ReceiveSocket(SessionEndpoint se) + { + super(se); + } + + protected ScribMessage readScribMessage(Role peer) throws ClassNotFoundException, IOException, ScribRuntimeException + { + try + { + //ScribMessage m = this.ep.smf.readMessage(this.ep.getSocketEndpoint(role).dis); + ScribMessage m = getFuture(peer).get(); + + //System.out.println("Read: " + m); + + return m; + } + catch (InterruptedException e) + { + throw new IOException(e); + } + catch (ExecutionException e) + { + // The Future converts the RuntimeScribbleException wrapper for the underlying IOException into an ExecutionException + throw new IOException(e); + } + } + + protected boolean isDone(Role peer) + { + //return !this.ep.getInputQueues().isEmpty(peer); + return (this.fut == null) || (this.fut.isDone()); + } + + protected CompletableFuture getFuture(Role peer) throws ScribRuntimeException + { + use(); + //this.fut = this.ep.getInputQueues().getFuture(peer); + return this.se.getChannelEndpoint(peer).getFuture(); + } +} diff --git a/scribble-runtime/src/main/java/org/scribble/runtime/statechans/ScribSocket.java b/scribble-runtime/src/main/java/org/scribble/runtime/statechans/ScribSocket.java new file mode 100644 index 000000000..ec296ac75 --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/runtime/statechans/ScribSocket.java @@ -0,0 +1,29 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.runtime.statechans; + +import org.scribble.core.type.name.Role; +import org.scribble.runtime.session.Session; +import org.scribble.runtime.session.SessionEndpoint; + +// FIXME: rename package (and class?) to statechans -- cf., handlers package +public abstract class ScribSocket +{ + protected SessionEndpoint se; + + protected ScribSocket(SessionEndpoint ep) + { + this.se = ep; + } +} diff --git a/scribble-runtime/src/main/java/org/scribble/runtime/util/Buf.java b/scribble-runtime/src/main/java/org/scribble/runtime/util/Buf.java new file mode 100644 index 000000000..bd04b02ad --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/runtime/util/Buf.java @@ -0,0 +1,29 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.runtime.util; + +public class Buf +{ + public T val; + + public Buf() + { + + } + + public Buf(T val) + { + this.val = val; + } +} diff --git a/scribble-runtime/src/main/java/org/scribble/runtime/util/ScribFuture.java b/scribble-runtime/src/main/java/org/scribble/runtime/util/ScribFuture.java new file mode 100644 index 000000000..3e2f9a7a2 --- /dev/null +++ b/scribble-runtime/src/main/java/org/scribble/runtime/util/ScribFuture.java @@ -0,0 +1,86 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.runtime.util; + +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; + +import org.scribble.runtime.message.ScribMessage; + +// P is payload type as an array +public abstract class ScribFuture //implements Future

+{ + private CompletableFuture future; + private ScribMessage m; + + public ScribFuture(CompletableFuture future) + { + this.future = future; + } + + // Not synch: can return false while get is blocked + public boolean isDone() + { + return this.m != null; + } + + protected synchronized ScribMessage get() throws IOException + { + try + { + if (isDone()) + { + return this.m; + } + this.m = this.future.get(); + + //System.out.println("Got: " + m); + + return this.m; + } + catch (InterruptedException | ExecutionException e) + { + throw new IOException(e); + } + } + + public abstract ScribFuture sync() throws IOException; //ExecutionException, InterruptedException; // sync returns the Future (cf. get returns the val) + + /*@Override + public P get(long timeout, TimeUnit unit) + throws InterruptedException, ExecutionException, TimeoutException + { + ScribMessage m = this.future.get(timeout, unit); + return (P) m.payload.clone()[0]; // FIXME: exactly one payload + } + + @Override + public boolean cancel(boolean mayInterruptIfRunning) + { + return this.future.cancel(mayInterruptIfRunning); + } + + @Override + public boolean isCancelled() + { + return this.future.isCancelled(); + } + + @Override + public boolean isDone() + { + return this.future.isDone(); + }*/ +} diff --git a/scribble-test/pom.xml b/scribble-test/pom.xml new file mode 100644 index 000000000..49d617a80 --- /dev/null +++ b/scribble-test/pom.xml @@ -0,0 +1,90 @@ + + + 4.0.0 + + + scribble-test + + + + org.scribble + scribble-core + + + org.scribble + scribble-parser + + + + org.scribble + scribble-cli + + + org.scribble + scribble-runtime + + + junit + junit + test + + + + + org.scribble + parent + 0.5.1-SNAPSHOT + ../pom.xml + + + + + + + + + + com.mycila + license-maven-plugin + + + **/*.scr + **/*.java + **/*.policy + **/*.xml + **/*.html + **/stylesheet.css + **/script.js + **/package-list + **/IGNORE + **/*.versionsBackup + + + + + + + + scribble-test + + diff --git a/scribble-test/src/main/java/org/scribble/Dummy.java b/scribble-test/src/main/java/org/scribble/Dummy.java new file mode 100644 index 000000000..3e336c4cf --- /dev/null +++ b/scribble-test/src/main/java/org/scribble/Dummy.java @@ -0,0 +1,5 @@ +package org.scribble; + +// HACK: Dummy file to avoid mvn "empty scribble-test jar" warning +public class Dummy { +} diff --git a/scribble-test/src/test/java/org/scribble/test/ExecUtil.java b/scribble-test/src/test/java/org/scribble/test/ExecUtil.java new file mode 100644 index 000000000..0d4accb1e --- /dev/null +++ b/scribble-test/src/test/java/org/scribble/test/ExecUtil.java @@ -0,0 +1,174 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.test; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.util.Map; +import java.util.TreeMap; +import java.util.concurrent.BrokenBarrierException; +import java.util.concurrent.Callable; +import java.util.concurrent.CyclicBarrier; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; + +import org.apache.commons.io.IOUtils; + + +public class ExecUtil { + /** + * The summary of a process. + * @author Tiago Cogumbreiro (cogumbreiro@users.sf.net) + * + */ + public static class ProcessSummary { + /** + * The standard output. + */ + public final String stdout; + /** + * The standard error output. + */ + public final String stderr; + /** + * The exit value of the process. + */ + public final int exitValue; + public ProcessSummary(String stdout, String stderr, int exitValue) { + this.stdout = stdout; + this.stderr = stderr; + this.exitValue = exitValue; + } + } + public static String joinPath(String ...parts) { + return join(File.separator, parts); + } + public static String joinPath(Iterable parts) { + return join(File.separator, parts); + } + public static String join(String separator, String ...parts) { + int count = 0; + StringBuilder builder = new StringBuilder(); + for (String part : parts) { + if (count > 0) { + builder.append(separator); + } + builder.append(part); + count++; + } + return builder.toString(); + } + public static String join(String separator, Iterable parts) { + int count = 0; + StringBuilder builder = new StringBuilder(); + for (String part : parts) { + if (count > 0) { + builder.append(separator); + } + builder.append(part); + count++; + } + return builder.toString(); + } + + /** + * Runs a process, up to a certain timeout, + * + * @throws IOException + * @throws TimeoutException + * @throws ExecutionException + * @throws InterruptedException + */ + public static ProcessSummary execUntil(long timeout, String... command) + throws IOException, InterruptedException, ExecutionException { + return execUntil(new TreeMap(), timeout, command); + } + + /** + * Runs a process, up to a certain timeout, + * + * @throws IOException + * @throws TimeoutException + * @throws ExecutionException + * @throws InterruptedException + */ + public static ProcessSummary execUntil(Map env, long timeout, String... command) + throws IOException, InterruptedException, ExecutionException { + ProcessBuilder builder = new ProcessBuilder(command); + builder.environment().putAll(env); + Process process = builder.start(); + ExecutorService executorService = Executors.newFixedThreadPool(3); + CyclicBarrier onStart = new CyclicBarrier(3); + Future stderr = executorService.submit(toString(process.getErrorStream(), + onStart)); + Future stdout = executorService.submit(toString(process.getInputStream(), + onStart)); + Future waitFor = executorService.submit(waitFor(process, + onStart)); + ProcessSummary result = null; + try { + waitFor.get(timeout, TimeUnit.MILLISECONDS); + } catch (TimeoutException e) { + // timeouts are ok + } finally { + process.destroy(); + waitFor.get(); + result = new ProcessSummary(stdout.get(), stderr.get(), process.exitValue()); + executorService.shutdown(); + } + return result; + } + + /** + * Waits for a process to terminate. + * + * @param process The process it should wait for. + * @param onStart Notifies others upon starting. + * @return The return code. + */ + public static Callable waitFor(final Process process, + final CyclicBarrier onStart) { + return new Callable() { + public Integer call() throws InterruptedException, BrokenBarrierException { + onStart.await(); + return process.waitFor(); + } + }; + } + + /** + * Converts an input stream to a string as much as possible. It stops + * at IOExceptions, but returns what it read thus far. + * @param in The input stream. + * @param onStart Notify others that it started. + */ + private static Callable toString(final InputStream input, final CyclicBarrier onStart) { + return new Callable() { + public String call() throws InterruptedException, BrokenBarrierException, IOException { + onStart.await(); + try { + return IOUtils.toString(input); + } finally { + IOUtils.closeQuietly(input); + } + } + }; + } + +} diff --git a/scribble-test/src/test/java/org/scribble/test/Harness.java b/scribble-test/src/test/java/org/scribble/test/Harness.java new file mode 100644 index 000000000..e153f17f4 --- /dev/null +++ b/scribble-test/src/test/java/org/scribble/test/Harness.java @@ -0,0 +1,137 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.test; + +import java.io.File; +import java.util.Collection; +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; + +public class Harness +{ + //private static final SuffixFileFilter SCRIBBLE_EXT = new SuffixFileFilter(".scr"); + private static final String SCRIBBLE_EXT = ".scr"; + + protected static final String DIR_IGNORE_FILE = "IGNORE"; + protected static final String TEST_DIR_FLAG = "test.dir"; + + /*/** + * Returns the java builder with the default settings to use JArmus. + * + * @param className + * @return + * / + // Currently unused + @Deprecated + public static JavaProcessBuilder java(String className) + { + JavaProcessBuilder java = new JavaProcessBuilder(className); + // java.appendClasspath("lib/antlr-3.5.2-complete.jar"); + // java.appendClasspath("bin/"); + java.appendClasspath("target/classes/"); + java.appendClasspath("c:/Users/Raymond/.m2/repository/org/antlr/antlr-runtime/3.2/antlr-runtime-3.2.jar/"); + java.appendClasspath("../core/target/classes/"); + java.appendClasspath("../parser/target/classes/"); + /*java.appendClasspath("../validation/target/classes/"); + java.appendClasspath("../projection/target/classes/"); + java.appendClasspath("../trace/target/classes/");*/ + /*java.appendClasspath("C:/Users/Raymond/.m2/repository/org/codehaus/jackson/jackson-mapper-asl/1.9.9/jackson-mapper-asl-1.9.9.jar/"); + java.appendClasspath("C:/Users/Raymond/.m2/repository/org/codehaus/jackson/jackson-core-asl/1.9.9/jackson-core-asl-1.9.9.jar/");* / + // java.appendClasspath("org.scribble2.cli.CommandLine -path modules/validation/src/test/scrib/src modules/validation/src/test/scrib/src/Test.scr/"); + return java; + } + //*/ + + /** + * Returns all Scribble files in a given directory. + * + * @param dir + * @return + */ + private static Collection getScribbleFilePaths(String dir) + { + /* // Broken: somehow interfering with JUnit results (e.g., bad.efsm.grecursion.unfair.Test01) + NameFileFilter ignore = new NameFileFilter("IGNORE"); + TreeSet result = new TreeSet<>(); + FileUtils.listFiles(new File(directory), SCRIBBLE_EXT, new IgnoredDirectoryWhenFilter(ignore)).stream().forEach((file) -> result.add(file.getPath())); + */ + /*return getAllScrFilesUnderDirectory(dir).stream() // Debugging AllTest/BadTest bad.efsm.grecursion.unfair.Test01; problem + .map((f) -> f.getAbsolutePath().toString()) + .collect(Collectors.toList());*/ + List res = new LinkedList<>(); + for (File f : getAllScrFilesUnderDirectory(dir)) + { + res.add(f.getAbsolutePath().toString()); + } + return res; + } + + private static List getAllScrFilesUnderDirectory(String path) + { + List res = new LinkedList<>(); + for (File f : new File(path).listFiles()) + { + if (f.isFile()) + { + if (f.getName().equals(Harness.DIR_IGNORE_FILE)) + { + return Collections.emptyList(); + } + else if (f.getName().endsWith(Harness.SCRIBBLE_EXT)) + { + res.add(f); + } + } + else if (f.isDirectory()) + { + res.addAll(getAllScrFilesUnderDirectory(f.getAbsolutePath())); + } + } + return res; + } + + public static Collection findTests(String path) + { + return getScribbleFilePaths(path); + //return Collections.emptyList(); + } + + // dir should be full path + public static Collection makeTests(boolean isBadTest, String dir) + { + /*return findTests(dir).stream() // Debugging AllTest/BadTest bad.efsm.grecursion.unfair.Test01; problem + .map((e) -> new Object[] { e, isBadTest }) + .collect(Collectors.toList());*/ + List res = new LinkedList<>(); + for (String t : findTests(dir)) + { + res.add(new Object[] { t, isBadTest }); + } + return res; + } + + // root is relative path from cli/src/test/resources + // This is for "Good/BarTest (test.dir)", i.e., running single test from inside Eclipse + // root is used as a default if the test.dir property is not present + public static Collection checkTestDirProperty(boolean isBadTest, String root) + { + String dir = System.getProperty(Harness.TEST_DIR_FLAG); + if (dir == null) + { + dir = ClassLoader.getSystemResource(root).getFile(); + } + return makeTests(isBadTest, dir); + } +} diff --git a/scribble-test/src/test/java/org/scribble/test/IgnoredDirectoryWhenFilter.java b/scribble-test/src/test/java/org/scribble/test/IgnoredDirectoryWhenFilter.java new file mode 100644 index 000000000..8e034c56a --- /dev/null +++ b/scribble-test/src/test/java/org/scribble/test/IgnoredDirectoryWhenFilter.java @@ -0,0 +1,35 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.test; + +import java.io.File; +import java.io.FileFilter; + +import org.apache.commons.io.filefilter.AbstractFileFilter; + +public class IgnoredDirectoryWhenFilter extends AbstractFileFilter { + private final FileFilter filter; + + public IgnoredDirectoryWhenFilter(FileFilter filter) { + this.filter = filter; + } + + @Override + public boolean accept(File file) { + if (!file.isDirectory()) { + return false; + } + return file.listFiles(filter).length == 0; + } +} diff --git a/scribble-test/src/test/java/org/scribble/test/JavaProcessBuilder.java b/scribble-test/src/test/java/org/scribble/test/JavaProcessBuilder.java new file mode 100644 index 000000000..40f35b6bf --- /dev/null +++ b/scribble-test/src/test/java/org/scribble/test/JavaProcessBuilder.java @@ -0,0 +1,134 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.test; + +import java.io.File; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; +import java.util.Map.Entry; + +@Deprecated +public class JavaProcessBuilder { + private String jvm; + private Collection classpath = new ArrayList<>(); + private String javaAgent; + private String javaAgentArgs; + private String program; + private Collection programArgs = new ArrayList<>(); + private Map systemProps = new HashMap<>(); + public JavaProcessBuilder(String jvm, String program) { + this.jvm = jvm; + this.program = program; + } + public JavaProcessBuilder(String program) { + this("java", program); + } + public String getJvm() { + return jvm; + } + public void setJvm(String jvm) { + this.jvm = jvm; + } + public void setProgram(String program) { + this.program = program; + } + public String getProgram() { + return program; + } + public void appendClasspath(String param) { + classpath.add(param); + } + public void appendProgramArgument(String arg) { + programArgs.add(arg); + } + public void setJavaAgent(String param) { + this.javaAgent = param; + } + public String getJavaAgent() { + return javaAgent; + } + public void setJavaAgentArgs(String javaAgentArgs) { + this.javaAgentArgs = javaAgentArgs; + } + public String getJavaAgentArgs() { + return javaAgentArgs; + } + + public void setSystemProperty(String key) { + setSystemProperty(key, null); + } + + public void setSystemProperty(String key, String value) { + systemProps.put(key, value); + } + + public void unsetSystemProperty(String key) { + systemProps.remove(key); + } + + private String buildClasspath() { + return ExecUtil.join(File.pathSeparator, classpath); + } + + private String buildJavaAgent() { + StringBuilder builder = new StringBuilder("-javaagent:"); + builder.append(javaAgent); + if (javaAgentArgs != null) { + builder.append('='); + builder.append(javaAgentArgs); + } + return builder.toString(); + } + + public String[] build() { + Collection result = new ArrayList<>(); + result.add(jvm); + if (classpath.size() > 0) { + result.add("-cp"); + result.add(buildClasspath()); + } + if (javaAgent != null) { + result.add(buildJavaAgent()); + } + buildSystemProperties(result); + result.add(program); + result.addAll(programArgs); + return result.toArray(new String[0]); + } + private void buildSystemProperties(Collection result) { + for (Entry entry : systemProps.entrySet()) { + StringBuilder builder = new StringBuilder(); + builder.append("-D"); + builder.append(entry.getKey()); + if (entry.getValue() != null) { + builder.append("="); + builder.append(entry.getValue()); + } + result.add(builder.toString()); + } + } + public void setSystemProperties(Properties props) { + systemProps.clear(); + for (String key : props.stringPropertyNames()) { + systemProps.put(key, props.getProperty(key)); + } + } + @Override + public String toString() { + return ExecUtil.join(" ", build()); + } +} \ No newline at end of file diff --git a/scribble-test/src/test/java/org/scribble/test/ScribAllTest.java b/scribble-test/src/test/java/org/scribble/test/ScribAllTest.java new file mode 100644 index 000000000..47afda3cf --- /dev/null +++ b/scribble-test/src/test/java/org/scribble/test/ScribAllTest.java @@ -0,0 +1,49 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.test; + +import java.util.Collection; +import java.util.LinkedList; +import java.util.List; + +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.junit.runners.Parameterized.Parameters; + +/** + * Runs all tests under good and bad root directories in Scribble. + * + * N.B. Currently in exclude list of root pom surefire config. + */ +//@RunWith(value = Parameterized.class) +@RunWith(Parameterized.class) +public class ScribAllTest extends ScribTestBase +{ + public ScribAllTest(String example, boolean isBadTest) + { + super(example, isBadTest); + } + + @Parameters(name = "{0}") + public static Collection data() + { + // Test all tests under good and bad root directories + String dir_good = ClassLoader.getSystemResource(ScribGoodTest.GOOD_DIR).getFile(); + String dir_bad = ClassLoader.getSystemResource(ScribBadTest.BAD_DIR).getFile(); + List result = new LinkedList<>(); + result.addAll(Harness.makeTests(ScribTestBase.GOOD_TEST, dir_good)); + result.addAll(Harness.makeTests(ScribTestBase.BAD_TEST, dir_bad)); + return result; + } +} diff --git a/scribble-test/src/test/java/org/scribble/test/ScribBadTest.java b/scribble-test/src/test/java/org/scribble/test/ScribBadTest.java new file mode 100644 index 000000000..ae15719e1 --- /dev/null +++ b/scribble-test/src/test/java/org/scribble/test/ScribBadTest.java @@ -0,0 +1,40 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.test; + +import java.util.Collection; + +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.junit.runners.Parameterized.Parameters; + +// For running all tests under the specified directory as bad tests +// Needs -Dtest.dir=[test root dir] system property -- Eclipse VM arg: -Dtest.dir=${selected_resource_loc} +//@RunWith(value = Parameterized.class) +@RunWith(Parameterized.class) +public class ScribBadTest extends ScribTestBase +{ + protected static final String BAD_DIR = "bad"; + + public ScribBadTest(String example, boolean isBadTest) + { + super(example, isBadTest); + } + + @Parameters(name = "{0}") + public static Collection data() + { + return Harness.checkTestDirProperty(ScribTestBase.BAD_TEST, ScribBadTest.BAD_DIR); + } +} diff --git a/scribble-test/src/test/java/org/scribble/test/ScribGoodTest.java b/scribble-test/src/test/java/org/scribble/test/ScribGoodTest.java new file mode 100644 index 000000000..22203cc43 --- /dev/null +++ b/scribble-test/src/test/java/org/scribble/test/ScribGoodTest.java @@ -0,0 +1,41 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.test; + +import java.util.Collection; + +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.junit.runners.Parameterized.Parameters; + +// For running all tests under the specified directory as good tests +// Needs -Dtest.dir=[test root dir] system property -- Eclipse VM arg: -Dtest.dir=${selected_resource_loc} +@RunWith(value = Parameterized.class) +public class ScribGoodTest extends ScribTestBase +{ + protected static final String GOOD_DIR = "good"; + + public ScribGoodTest(String example, boolean isBadTest) + { + super(example, isBadTest); + } + + @Parameters(name = "{0}") + public static Collection data() + { + //String dir = ClassLoader.getSystemResource(AllTest.GOOD_ROOT).getFile(); // No: checkTestDirProperty does this + String dir = ScribGoodTest.GOOD_DIR; + return Harness.checkTestDirProperty(ScribTestBase.GOOD_TEST, dir); + } +} diff --git a/scribble-test/src/test/java/org/scribble/test/ScribTestBase.java b/scribble-test/src/test/java/org/scribble/test/ScribTestBase.java new file mode 100644 index 000000000..2780a3fbf --- /dev/null +++ b/scribble-test/src/test/java/org/scribble/test/ScribTestBase.java @@ -0,0 +1,122 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package org.scribble.test; + +import java.io.File; +import java.io.IOException; +import java.util.concurrent.ExecutionException; + +import org.junit.Assert; +import org.junit.Test; +import org.scribble.cli.CLFlags; +import org.scribble.cli.CommandLine; +import org.scribble.cli.CommandLineException; +import org.scribble.util.AntlrSourceException; +import org.scribble.util.ScribException; + +/* + * Packaging following pattern of putting tests into same package but different directory as classes being tested: + * (in this case, testing org.scribble.cli.CommandLine -- but this essentially tests most of core/parser) + */ +public abstract class ScribTestBase +{ + protected static int NUM_SKIPPED = 0; // HACK + + protected static final boolean GOOD_TEST = false; + protected static final boolean BAD_TEST = !GOOD_TEST; + + protected final String example; + protected final boolean isBadTest; + + // relative to scribble-test/src/test/resources (or target/test-classes/) + protected static final String TEST_ROOT_DIR = "."; // FIXME: make relative to scribble-java root (for subclasses in extension modules) + + public ScribTestBase(String example, boolean isBadTest) + { + this.example = example; + this.isBadTest = isBadTest; + } + + protected String getTestRootDir() + { + return ScribTestBase.TEST_ROOT_DIR; + } + + protected String[] getSkipList() + { + return new String[0]; + } + + protected boolean checkSkip() + { + String[] SKIP = getSkipList(); + String tmp = this.example.replace("\\", "/"); + for (String skip : SKIP) + { + if (tmp.endsWith(skip)) + { + ScribTestBase.NUM_SKIPPED++; + System.out.println("[scrib-test] Test on skip-list: " + this.example + " (" + ScribTestBase.NUM_SKIPPED + " skipped.)"); + return true; + } + } + return false; + } + + protected void runTest(String dir) throws CommandLineException, AntlrSourceException + { + new CommandLine(this.example, CLFlags.JUNIT_FLAG, CLFlags.IMPORT_PATH_FLAG, dir).run(); + // Added JUNIT flag -- but for some reason only bad DoArgList01.scr was breaking without it... + } + + @Test + public void tests() throws IOException, InterruptedException, ExecutionException + { + if (checkSkip()) + { + return; + } + + // TODO: For now just locate classpath for resources -- later maybe directly execute job + /*URL url = ClassLoader.getSystemResource(AllTest.GOOD_ROOT); // Assume good/bad have same parent + String dir = url.getFile().substring(0, url.getFile().length() - ("/" + AllTest.GOOD_ROOT).length());*/ + String dir = ClassLoader.getSystemResource(getTestRootDir()).getFile(); + if (File.separator.equals("\\")) // HACK: Windows + { + dir = dir.substring(1).replace("/", "\\"); + } + + try + { + // FIXME: read runtime arguments from a config file, e.g. -oldwf, -fair, etc + // Also need a way to specify expected tool output (e.g. projections/EFSMs for good, errors for bad) + //new CommandLine(this.example, CLArgParser.JUNIT_FLAG, CLArgParser.IMPORT_PATH_FLAG, dir).run(); + // Added JUNIT flag -- but for some reason only bad DoArgList01.scr was breaking without it... + runTest(dir); + Assert.assertFalse("Expecting exception", this.isBadTest); + } + catch (ScribException e) + { + Assert.assertTrue("Unexpected exception '" + e.getMessage() + "'", this.isBadTest); + } + catch (CommandLineException e) + { + throw new RuntimeException(e); + } + catch (Exception e) // Includes AntlrSourceExceptions that are not ScribbleExceptions -- hacky? + { + throw new RuntimeException(e); + } + } +} diff --git a/scribble-test/src/test/resources/bad/efsm/grecursion/unfair/Test01.scr b/scribble-test/src/test/resources/bad/efsm/grecursion/unfair/Test01.scr new file mode 100644 index 000000000..42fb6de49 --- /dev/null +++ b/scribble-test/src/test/resources/bad/efsm/grecursion/unfair/Test01.scr @@ -0,0 +1,40 @@ +//$ bin/scribblec.sh -ip scribble-test/src/test/resources scribble-test/src/test/resources/bad/efsm/grecursion/unfair/Test01.scr + +module bad.efsm.grecursion.unfair.Test01; + + +// OK if -fair +// Also tests GraphBuilderUtil addContinueEdge (addEdge vs. addEdgeAux) AllTest/BadTest problem +global protocol Proto1(role A, role B, role C) +{ + rec Y + { + choice at A + { + rec X + { + choice at A + { + 1() from A to B; + continue X; + } + or + { + 2() from A to C; + continue Y; + } + or + { + 3() from A to B; + 3() from A to C; + } + } + } + or + { + 4() from A to B; + continue Y; + } + } +} + diff --git a/scribble-test/src/test/resources/bad/efsm/grecursion/unfair/Test06.scr b/scribble-test/src/test/resources/bad/efsm/grecursion/unfair/Test06.scr new file mode 100644 index 000000000..f2669e6b1 --- /dev/null +++ b/scribble-test/src/test/resources/bad/efsm/grecursion/unfair/Test06.scr @@ -0,0 +1,30 @@ +//$ bin/scribblec.sh scribble-test/src/test/resources/bad/efsm/grecursion/unfair/Test06.scr + +module bad.efsm.grecursion.unfair.Test06; + + +global protocol Proto1(role A, role B, role C) +{ + choice at A // OK if -fair + { + 1() from A to B; + do Proto1Aux1(A, B, C); + } + or + { + do Proto1Aux2(A, B, C); + } +} + +aux global protocol Proto1Aux1(role A, role B, role C) +{ + do Proto1(A, B, C); +} + +aux global protocol Proto1Aux2(role A, role B, role C) +{ + 2() from A to B; + 3() from B to C; + do Proto1(A, B, C); +} + diff --git a/scribble-test/src/test/resources/bad/efsm/grecursion/unfair/Test11b.scr b/scribble-test/src/test/resources/bad/efsm/grecursion/unfair/Test11b.scr new file mode 100644 index 000000000..16750ac7d --- /dev/null +++ b/scribble-test/src/test/resources/bad/efsm/grecursion/unfair/Test11b.scr @@ -0,0 +1,29 @@ +//$ bin/scribblec.sh -ip scribble-test/src/test/resources scribble-test/src/test/resources/bad/efsm/grecursion/unfair/Test11b.scr + +module bad.efsm.grecursion.unfair.Test11b; + + +// OK if -fair +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + choice at B + { + 2() from B to A; + //4() from B to C; // Testing EFSM building + continue X; + } + or + { + 3() from B to A; + 4() from B to C; + continue X; + } + } + } +} + diff --git a/scribble-test/src/test/resources/bad/efsm/grecursion/unfair/Test11c.scr b/scribble-test/src/test/resources/bad/efsm/grecursion/unfair/Test11c.scr new file mode 100644 index 000000000..77b731781 --- /dev/null +++ b/scribble-test/src/test/resources/bad/efsm/grecursion/unfair/Test11c.scr @@ -0,0 +1,24 @@ +module bad.efsm.grecursion.unfair.Test11c; + + +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + choice at B + { + 2() from B to A; + } + or + { + 3() from B to A; + 4() from B to C; + } + continue X; + } + } +} + diff --git a/scribble-test/src/test/resources/bad/liveness/messagelive/Test01.scr b/scribble-test/src/test/resources/bad/liveness/messagelive/Test01.scr new file mode 100644 index 000000000..7090e7ab0 --- /dev/null +++ b/scribble-test/src/test/resources/bad/liveness/messagelive/Test01.scr @@ -0,0 +1,25 @@ +//$ bin/scribblec.sh -ip scribble-test/src/test/resources scribble-test/src/test/resources/bad/liveness/messagelive/Test01.scr + +module bad.liveness.messagelive.Test01; + + +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; // Bad: testing deadlock detection (input blocked -> terminated) + 2() from A to B; // Message liveness -- also counterpart wait-for + 2() from B to C; + } + or + { + 1() from A to B; + rec X + { + // NB: not a role progress problem: A is already done by here + 4() from B to C; + 5() from C to B; + continue X; + } + } +} diff --git a/scribble-test/src/test/resources/bad/liveness/messagelive/Test02.scr b/scribble-test/src/test/resources/bad/liveness/messagelive/Test02.scr new file mode 100644 index 000000000..575283d0f --- /dev/null +++ b/scribble-test/src/test/resources/bad/liveness/messagelive/Test02.scr @@ -0,0 +1,20 @@ +module bad.liveness.messagelive.Test02; + + +global protocol Proto1(role A, role B, role C) +{ + 1() from A to B; + choice at B + { + rec X + { + 2() from B to C; + continue X; + } + } + or + { + 3() from B to C; + } + 4() from A to C; +} diff --git a/scribble-test/src/test/resources/bad/liveness/messagelive/Test03a.scr b/scribble-test/src/test/resources/bad/liveness/messagelive/Test03a.scr new file mode 100644 index 000000000..81381a08b --- /dev/null +++ b/scribble-test/src/test/resources/bad/liveness/messagelive/Test03a.scr @@ -0,0 +1,22 @@ +module bad.liveness.messagelive.Test03a; + + +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + rec X + { + choice at A + { + 1() from A to B; + continue X; + } + } + } + or + { + 2() from A to B; + } + 2() from C to B; +} diff --git a/scribble-test/src/test/resources/bad/liveness/messagelive/unfair/Test03b.scr b/scribble-test/src/test/resources/bad/liveness/messagelive/unfair/Test03b.scr new file mode 100644 index 000000000..3632f5425 --- /dev/null +++ b/scribble-test/src/test/resources/bad/liveness/messagelive/unfair/Test03b.scr @@ -0,0 +1,27 @@ +module bad.liveness.messagelive.unfair.Test03b; + + +// Cf. bad.liveness.messagelive.Test03a +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + rec X + { + choice at A + { + 1() from A to B; + continue X; + } + or + { + () from A to B; + } + } + } + or + { + 2() from A to B; + } + 2() from C to B; // OK if -fair +} diff --git a/scribble-test/src/test/resources/bad/liveness/roleprog/Test01.scr b/scribble-test/src/test/resources/bad/liveness/roleprog/Test01.scr new file mode 100644 index 000000000..c7ae97263 --- /dev/null +++ b/scribble-test/src/test/resources/bad/liveness/roleprog/Test01.scr @@ -0,0 +1,21 @@ +module bad.liveness.roleprog.Test01; + + +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + rec X // Fairness irrelevant + { + 1() from A to B; + //1() from A to C; + continue X; + } + } + or + { + 2() from A to B; + 2() from A to C; // "role liveness" + } +} + diff --git a/scribble-test/src/test/resources/bad/liveness/roleprog/Test02.scr b/scribble-test/src/test/resources/bad/liveness/roleprog/Test02.scr new file mode 100644 index 000000000..9b1b63e27 --- /dev/null +++ b/scribble-test/src/test/resources/bad/liveness/roleprog/Test02.scr @@ -0,0 +1,20 @@ +module bad.liveness.roleprog.Test02; + + +global protocol Proto1(role A, role B, role C) +{ + 1() from A to B; + choice at B + { + rec X + { + 2() from B to C; + continue X; + } + } + or + { + 3() from B to C; + } + 4() from C to A; +} diff --git a/scribble-test/src/test/resources/bad/liveness/roleprog/Test03a.scr b/scribble-test/src/test/resources/bad/liveness/roleprog/Test03a.scr new file mode 100644 index 000000000..7d25a753c --- /dev/null +++ b/scribble-test/src/test/resources/bad/liveness/roleprog/Test03a.scr @@ -0,0 +1,22 @@ +module bad.liveness.roleprog.Test03a; + + +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + rec X + { + choice at A + { + 1() from A to B; + continue X; + } + } + } + or + { + 2() from A to B; + 2() from B to C; // Role progress violation for C + } +} diff --git a/scribble-test/src/test/resources/bad/liveness/roleprog/Test03b.scr b/scribble-test/src/test/resources/bad/liveness/roleprog/Test03b.scr new file mode 100644 index 000000000..80505f481 --- /dev/null +++ b/scribble-test/src/test/resources/bad/liveness/roleprog/Test03b.scr @@ -0,0 +1,26 @@ +module bad.liveness.roleprog.Test03b; + + +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + rec X + { + choice at A + { + 1() from A to B; + continue X; + } + or + { + () from A to B; // Also wait-for error at C -- tests projected choice case pruning (for C) + } + } + } + or + { + 2() from A to B; + 2() from B to C; // Role progress violation for C + } +} diff --git a/scribble-test/src/test/resources/bad/liveness/roleprog/unfair/Test01.scr b/scribble-test/src/test/resources/bad/liveness/roleprog/unfair/Test01.scr new file mode 100644 index 000000000..511a7dfe3 --- /dev/null +++ b/scribble-test/src/test/resources/bad/liveness/roleprog/unfair/Test01.scr @@ -0,0 +1,22 @@ +module bad.liveness.roleprog.unfair.Test01; + + +// OK if -fair +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + 1() from B to C; + } + or + { + 2() from A to B; + //4() from B to C; + continue X; + } + } +} + diff --git a/scribble-test/src/test/resources/bad/liveness/roleprog/unfair/Test02.scr b/scribble-test/src/test/resources/bad/liveness/roleprog/unfair/Test02.scr new file mode 100644 index 000000000..643ba5c8c --- /dev/null +++ b/scribble-test/src/test/resources/bad/liveness/roleprog/unfair/Test02.scr @@ -0,0 +1,24 @@ +module bad.liveness.roleprog.unfair.Test02; + + +// OK if -fair +// Cf. good.wfchoice.gchoice.Choice11; +global protocol Proto1(role A, role B, role C) +{ + rec X + { + 1() from A to C; // bad liveness + choice at A + { + 1() from A to C; + continue X; + } + or + { + 2() from A to B; + 2() from A to C; + } + } +} + + diff --git a/scribble-test/src/test/resources/bad/liveness/roleprog/unfair/Test03a.scr b/scribble-test/src/test/resources/bad/liveness/roleprog/unfair/Test03a.scr new file mode 100644 index 000000000..d76b30397 --- /dev/null +++ b/scribble-test/src/test/resources/bad/liveness/roleprog/unfair/Test03a.scr @@ -0,0 +1,23 @@ +module bad.liveness.roleprog.unfair.Test03a; + + +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + 1() from A to C; + continue X; + } + or + { + 2() from A to B; + continue X; + } + //continue X; + } +} + + diff --git a/scribble-test/src/test/resources/bad/liveness/roleprog/unfair/Test03b.scr b/scribble-test/src/test/resources/bad/liveness/roleprog/unfair/Test03b.scr new file mode 100644 index 000000000..3587efe15 --- /dev/null +++ b/scribble-test/src/test/resources/bad/liveness/roleprog/unfair/Test03b.scr @@ -0,0 +1,23 @@ +module bad.liveness.roleprog.unfair.Test03b; + + +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + 1() from A to C; + //continue X; + } + or + { + 2() from A to B; + //continue X; + } + continue X; + } +} + + diff --git a/scribble-test/src/test/resources/bad/liveness/roleprog/unfair/Test04a.scr b/scribble-test/src/test/resources/bad/liveness/roleprog/unfair/Test04a.scr new file mode 100644 index 000000000..786f171bb --- /dev/null +++ b/scribble-test/src/test/resources/bad/liveness/roleprog/unfair/Test04a.scr @@ -0,0 +1,38 @@ +module bad.liveness.roleprog.unfair.Test04a; + + +global protocol Proto1(role A, role B, role C, role D) +{ + // OK if -fair + choice at A + { + 1() from A to B; + rec X + { + 1() from A to B; + choice at B + { + 2() from B to C; + choice at C + { + 2() from C to A; + continue X; + } + or + { + 3() from C to A; + 3() from C to D; + continue X; + } + } + } + } + or + { + 0() from A to B; + 0() from B to C; + 0() from C to D; + } +} + + diff --git a/scribble-test/src/test/resources/bad/liveness/roleprog/unfair/Test04b.scr b/scribble-test/src/test/resources/bad/liveness/roleprog/unfair/Test04b.scr new file mode 100644 index 000000000..972a82504 --- /dev/null +++ b/scribble-test/src/test/resources/bad/liveness/roleprog/unfair/Test04b.scr @@ -0,0 +1,37 @@ +module bad.liveness.roleprog.unfair.Test04b; + + +global protocol Proto1(role A, role B, role C, role D) +{ + // OK if -fair + choice at A + { + 1() from A to B; + rec X + { + 1() from A to B; + choice at B + { + 2() from B to C; + choice at C + { + 2() from C to A; + } + or + { + 3() from C to A; + 3() from C to D; + } + continue X; + } + } + } + or + { + 0() from A to B; + 0() from B to C; + 0() from C to D; + } +} + + diff --git a/scribble-test/src/test/resources/bad/liveness/roleprog/unfair/Test05.scr b/scribble-test/src/test/resources/bad/liveness/roleprog/unfair/Test05.scr new file mode 100644 index 000000000..85271df0c --- /dev/null +++ b/scribble-test/src/test/resources/bad/liveness/roleprog/unfair/Test05.scr @@ -0,0 +1,26 @@ +module bad.liveness.roleprog.unfair.Test05; + + +global protocol Proto1(role A, role B, role C, role D) +{ + choice at A + { + 1() from A to B; + rec X + { + 2() from B to C; + choice at C + { + 2() from C to A; + } + or + { + () from C to A; + () from C to D; + } + continue X; // OK if -fair + } + } +} + + diff --git a/scribble-test/src/test/resources/bad/liveness/roleprog/unfair/Test06.scr b/scribble-test/src/test/resources/bad/liveness/roleprog/unfair/Test06.scr new file mode 100644 index 000000000..24414f745 --- /dev/null +++ b/scribble-test/src/test/resources/bad/liveness/roleprog/unfair/Test06.scr @@ -0,0 +1,31 @@ +//$ bin/scribblec.sh scribble-test/src/test/resources/bad/liveness/roleprog/unfair/Test06.scr + +module bad.liveness.roleprog.unfair.Test06; + + +// Duplicate of bad.efsm.unfair.Test06 +global protocol Proto1(role A, role B, role C) +{ + choice at A // OK if -fair + { + 1() from A to B; + do Proto1Aux1(A, B, C); + } + or + { + do Proto1Aux2(A, B, C); + } +} + +aux global protocol Proto1Aux1(role A, role B, role C) +{ + do Proto1(A, B, C); +} + +aux global protocol Proto1Aux2(role A, role B, role C) +{ + 2() from A to B; + 3() from B to C; + do Proto1(A, B, C); +} + diff --git a/scribble-test/src/test/resources/bad/reach/globals/gchoice/Test01.scr b/scribble-test/src/test/resources/bad/reach/globals/gchoice/Test01.scr new file mode 100644 index 000000000..fb9ff2271 --- /dev/null +++ b/scribble-test/src/test/resources/bad/reach/globals/gchoice/Test01.scr @@ -0,0 +1,21 @@ +module bad.reach.globals.gchoice.Test01; + + +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + 1() from B to A; + continue X; + } + or + { + // Bad: (empty) case pruned, so reachability fails (no "optional") + } + } + 2() from A to B; + 3() from B to C; +} diff --git a/scribble-test/src/test/resources/bad/reach/globals/gdo/Test01a.scr b/scribble-test/src/test/resources/bad/reach/globals/gdo/Test01a.scr new file mode 100644 index 000000000..0bfd3e9bc --- /dev/null +++ b/scribble-test/src/test/resources/bad/reach/globals/gdo/Test01a.scr @@ -0,0 +1,16 @@ +module bad.reach.globals.gdo.Test01a; + + +global protocol Proto1(role A, role B) +{ + 1() from A to B; + do Proto1(A, B); + 3() from A to B; +} + +aux global protocol Proto2(role C, role D) +{ + 2() from C to D; + do Proto2(C, D); + //2() from C to D; +} diff --git a/scribble-test/src/test/resources/bad/reach/globals/gdo/Test01b.scr b/scribble-test/src/test/resources/bad/reach/globals/gdo/Test01b.scr new file mode 100644 index 000000000..a3965c9ae --- /dev/null +++ b/scribble-test/src/test/resources/bad/reach/globals/gdo/Test01b.scr @@ -0,0 +1,17 @@ +module bad.reach.globals.gdo.Test01b; + + +//aux +global protocol Proto1(role A, role B) +{ + 1() from A to B; + do Proto1(A, B); + 3() from A to B; +} + +global protocol Proto2(role C, role D) +{ + 2() from C to D; + do Proto2(C, D); + //2() from C to D; +} diff --git a/scribble-test/src/test/resources/bad/reach/globals/gdo/Test02a.scr b/scribble-test/src/test/resources/bad/reach/globals/gdo/Test02a.scr new file mode 100644 index 000000000..5f129d9ed --- /dev/null +++ b/scribble-test/src/test/resources/bad/reach/globals/gdo/Test02a.scr @@ -0,0 +1,17 @@ +module bad.reach.globals.gdo.Test02a; + + +global protocol Proto1(role A, role B) +{ + 1() from A to B; + do Proto1(A, B); + //3() from A to B; +} + +//aux +global protocol Proto2(role C, role D) +{ + 2() from C to D; + do Proto2(C, D); + 2() from C to D; +} diff --git a/scribble-test/src/test/resources/bad/reach/globals/gdo/Test02b.scr b/scribble-test/src/test/resources/bad/reach/globals/gdo/Test02b.scr new file mode 100644 index 000000000..37a569197 --- /dev/null +++ b/scribble-test/src/test/resources/bad/reach/globals/gdo/Test02b.scr @@ -0,0 +1,16 @@ +module bad.reach.globals.gdo.Test02b; + + +aux global protocol Proto1(role A, role B) +{ + 1() from A to B; + do Proto1(A, B); + //3() from A to B; +} + +global protocol Proto2(role C, role D) +{ + 2() from C to D; + do Proto2(C, D); + 2() from C to D; +} diff --git a/scribble-test/src/test/resources/bad/reach/globals/gdo/Test03.scr b/scribble-test/src/test/resources/bad/reach/globals/gdo/Test03.scr new file mode 100644 index 000000000..938e92979 --- /dev/null +++ b/scribble-test/src/test/resources/bad/reach/globals/gdo/Test03.scr @@ -0,0 +1,13 @@ +module bad.reach.globals.gdo.Test03; + + +import bad.reach.globals.gdo.pack1.Test03b; + + +global protocol Foo(role A, role B) +{ + 1() from A to B; + do bad.reach.globals.gdo.pack1.Test03b.Bar(A, B); + 2() from A to B; +} + diff --git a/scribble-test/src/test/resources/bad/reach/globals/gdo/Test04.scr b/scribble-test/src/test/resources/bad/reach/globals/gdo/Test04.scr new file mode 100644 index 000000000..82926a113 --- /dev/null +++ b/scribble-test/src/test/resources/bad/reach/globals/gdo/Test04.scr @@ -0,0 +1,16 @@ +module bad.reach.globals.gdo.Test04; + + +global protocol Foo(role A, role B) +{ + choice at A + { + 1() from A to B; + } + or + { + do Foo(A, B); // Unguarded gets unfolded.. + 2() from A to B; // ..becomes unreachable after continue once unfolded + } +} + diff --git a/scribble-test/src/test/resources/bad/reach/globals/gdo/Test04a.scr b/scribble-test/src/test/resources/bad/reach/globals/gdo/Test04a.scr new file mode 100644 index 000000000..18e9c0809 --- /dev/null +++ b/scribble-test/src/test/resources/bad/reach/globals/gdo/Test04a.scr @@ -0,0 +1,16 @@ +module bad.reach.globals.gdo.Test04a; + + +global protocol Foo(role A, role B) +{ + choice at A + { + do Foo(A, B); // Unguarded gets unfolded.. + 2() from A to B; // ..becomes unreachable after continue once unfolded + } + or + { + 1() from A to B; + } +} + diff --git a/scribble-test/src/test/resources/bad/reach/globals/gdo/Test05a.scr b/scribble-test/src/test/resources/bad/reach/globals/gdo/Test05a.scr new file mode 100644 index 000000000..94889b91d --- /dev/null +++ b/scribble-test/src/test/resources/bad/reach/globals/gdo/Test05a.scr @@ -0,0 +1,16 @@ +module bad.reach.globals.gdo.Test05a; + + +global protocol Foo(role A, role B) +{ + choice at A + { + 1() from A to B; + do Foo(A, B); + 3() from A to B; + } or { + 2() from A to B; + 3() from A to B; + } +} + diff --git a/scribble-test/src/test/resources/bad/reach/globals/gdo/Test05b.scr b/scribble-test/src/test/resources/bad/reach/globals/gdo/Test05b.scr new file mode 100644 index 000000000..5cff1758f --- /dev/null +++ b/scribble-test/src/test/resources/bad/reach/globals/gdo/Test05b.scr @@ -0,0 +1,16 @@ +module bad.reach.globals.gdo.Test05b; + + +global protocol Foo(role A, role B) +{ + choice at A + { + 1() from A to B; + do Foo(A, B); + } or { + 2() from A to B; + 3() from A to B; + } + 3() from A to B; +} + diff --git a/scribble-test/src/test/resources/bad/reach/globals/gdo/Test06a.scr b/scribble-test/src/test/resources/bad/reach/globals/gdo/Test06a.scr new file mode 100644 index 000000000..8b95fb77b --- /dev/null +++ b/scribble-test/src/test/resources/bad/reach/globals/gdo/Test06a.scr @@ -0,0 +1,23 @@ +module bad.reach.globals.gdo.Test06a; + + +global protocol Foo(role A, role B) +{ + choice at A + { + 1() from A to B; + do Foo(A, B); + do Bar(A, B); + } + or + { + do Bar(A, B); + } +} + +global protocol Bar(role C, role D) +{ + 5() from C to D; + do Bar(C, D); +} + diff --git a/scribble-test/src/test/resources/bad/reach/globals/gdo/Test06b.scr b/scribble-test/src/test/resources/bad/reach/globals/gdo/Test06b.scr new file mode 100644 index 000000000..30375c45f --- /dev/null +++ b/scribble-test/src/test/resources/bad/reach/globals/gdo/Test06b.scr @@ -0,0 +1,23 @@ +module bad.reach.globals.gdo.Test06b; + + +global protocol Foo(role A, role B) +{ + choice at A + { + 1() from A to B; + do Bar(A, B); + do Foo(A, B); + } + or + { + do Bar(A, B); + } +} + +global protocol Bar(role C, role D) +{ + 5() from C to D; + do Bar(C, D); +} + diff --git a/scribble-test/src/test/resources/bad/reach/globals/gdo/Test06c.scr b/scribble-test/src/test/resources/bad/reach/globals/gdo/Test06c.scr new file mode 100644 index 000000000..e65290b92 --- /dev/null +++ b/scribble-test/src/test/resources/bad/reach/globals/gdo/Test06c.scr @@ -0,0 +1,23 @@ +module bad.reach.globals.gdo.Test06c; + + +global protocol Foo(role A, role B) +{ + choice at A + { + 1() from A to B; + do Foo(A, B); + do Bar(A, B); + } + or + { + do Bar(A, B); + } +} + +global protocol Bar(role C, role D) +{ + 5() from C to D; + do Bar(C, D); +} + diff --git a/scribble-test/src/test/resources/bad/reach/globals/gdo/Test06d.scr b/scribble-test/src/test/resources/bad/reach/globals/gdo/Test06d.scr new file mode 100644 index 000000000..370ae7ffc --- /dev/null +++ b/scribble-test/src/test/resources/bad/reach/globals/gdo/Test06d.scr @@ -0,0 +1,23 @@ +module bad.reach.globals.gdo.Test06d; + + +global protocol Foo(role A, role B) +{ + choice at A + { + 1() from A to B; + do Foo(A, B); + } + or + { + do Bar(A, B); + do Foo(A, B); + } +} + +global protocol Bar(role C, role D) +{ + 5() from C to D; + do Bar(C, D); +} + diff --git a/scribble-test/src/test/resources/bad/reach/globals/gdo/Test06e.scr b/scribble-test/src/test/resources/bad/reach/globals/gdo/Test06e.scr new file mode 100644 index 000000000..ba36b783a --- /dev/null +++ b/scribble-test/src/test/resources/bad/reach/globals/gdo/Test06e.scr @@ -0,0 +1,23 @@ +module bad.reach.globals.gdo.Test06e; + + +global protocol Foo(role A, role B) +{ + choice at A + { + 1() from A to B; + do Foo(A, B); // No continuation after this choice permitted, will become non tail recursive once inlined + } + or + { + 2() from A to B; + } + 3() from A to B; +} + +global protocol Bar(role C, role D) +{ + 5() from C to D; + do Bar(C, D); +} + diff --git a/scribble-test/src/test/resources/bad/reach/globals/gdo/pack1/IGNORE b/scribble-test/src/test/resources/bad/reach/globals/gdo/pack1/IGNORE new file mode 100644 index 000000000..e69de29bb diff --git a/scribble-test/src/test/resources/bad/reach/globals/gdo/pack1/Test03b.scr b/scribble-test/src/test/resources/bad/reach/globals/gdo/pack1/Test03b.scr new file mode 100644 index 000000000..9cb890b48 --- /dev/null +++ b/scribble-test/src/test/resources/bad/reach/globals/gdo/pack1/Test03b.scr @@ -0,0 +1,12 @@ +module bad.reach.globals.gdo.pack1.Test03b; + + +import bad.reach.globals.gdo.Test03; + + +global protocol Bar(role C, role D) +{ + 3() from C to D; + do bad.reach.globals.gdo.Test03.Foo(C, D); +} + diff --git a/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion01b.scr b/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion01b.scr new file mode 100644 index 000000000..7a36ff8c3 --- /dev/null +++ b/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion01b.scr @@ -0,0 +1,16 @@ +module bad.reach.globals.grecursion.Recursion01b; + + +global protocol Recursion1b(role A, role B) +{ + //rec A { } // Currently OK (role/recvar name clash). Disallow? + + rec X + { + l1() from A to B; + continue X; + //continue Y; // Uncomment bad, even if above line is commented + l2() from A to B; // Uncomment bad + } +} + diff --git a/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion01c.scr b/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion01c.scr new file mode 100644 index 000000000..385a55183 --- /dev/null +++ b/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion01c.scr @@ -0,0 +1,20 @@ +module bad.reach.globals.grecursion.Recursion01c; + + +global protocol Recursion1c(role A, role B) +{ + rec X + { + choice at A + { + l1() from A to B; + continue X; + l2() from A to B; + } + or + { + l3() from A to B; + } + } +} + diff --git a/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion03a.scr b/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion03a.scr new file mode 100644 index 000000000..d03aa5c04 --- /dev/null +++ b/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion03a.scr @@ -0,0 +1,19 @@ +module bad.reach.globals.grecursion.Recursion03a; + + +global protocol Recursion3a(role A, role B) +{ + rec X + { + l1() from A to B; + rec Y + { + l2() from B to A; + continue Y; + //continue X; // Uncomment OK if above line is commented + } + l3() from B to A; // Uncommemt bad + } + //l4() from B to A; // Uncomment bad +} + diff --git a/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion03b.scr b/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion03b.scr new file mode 100644 index 000000000..fe80c0509 --- /dev/null +++ b/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion03b.scr @@ -0,0 +1,19 @@ +module bad.reach.globals.grecursion.Recursion03b; + + +global protocol Recursion3b(role A, role B) +{ + rec X + { + l1() from A to B; + rec Y + { + l2() from B to A; + continue Y; + //continue X; // Uncomment OK if above line is commented + } + //l3() from B to A; // Uncommemt bad + } + l4() from B to A; // Uncomment bad +} + diff --git a/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion04b.scr b/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion04b.scr new file mode 100644 index 000000000..98a856f2a --- /dev/null +++ b/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion04b.scr @@ -0,0 +1,18 @@ +module bad.reach.globals.grecursion.Recursion04b; + + +global protocol Recursion4b(role A, role B) +{ + rec X + { + l1() from A to B; + rec Y + //rec X // Uncomment bad, even if above line is commented + { + l2() from B to A; + continue X; + continue Y; // Uncomment OK if the above line is commented + } + } +} + diff --git a/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion05a.scr b/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion05a.scr new file mode 100644 index 000000000..e5b76dddd --- /dev/null +++ b/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion05a.scr @@ -0,0 +1,18 @@ +module bad.reach.globals.grecursion.Recursion05a; + + +global protocol Recursion5a(role A, role B) +{ + rec X + { + l1() from A to B; + continue X; // Uncomment makes the below rec bad + //continue Y; // Uncomment bad + } + rec Y + { + l2() from B to A; + continue Y; // A bad "continue X" here tested in Recursion11 + } +} + diff --git a/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion06a.scr b/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion06a.scr new file mode 100644 index 000000000..dfd631d0e --- /dev/null +++ b/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion06a.scr @@ -0,0 +1,22 @@ +module bad.reach.globals.grecursion.Recursion06a; + + +global protocol Recursion6a(role A, role B) +{ + rec X + { + choice at A + { + l1() from A to B; + continue X; + l1() from A to B; // Uncomment bad + } + or + { + l2() from A to B; + } + //l3() from A to B; // Uncomment bad. "General recursion" issue ("unfold stacking"). Fix is to move inside the second choice block + } + l4() from A to B; +} + diff --git a/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion06b.scr b/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion06b.scr new file mode 100644 index 000000000..ee5e84564 --- /dev/null +++ b/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion06b.scr @@ -0,0 +1,22 @@ +module bad.reach.globals.grecursion.Recursion06b; + + +global protocol Recursion6(role A, role B) +{ + rec X + { + choice at A + { + l1() from A to B; + continue X; + //l1() from A to B; // Uncomment bad + } + or + { + l2() from A to B; + } + l3() from A to B; // Uncomment bad. "General recursion" issue ("unfold stacking"). Fix is to move inside the second choice block + } + l4() from A to B; +} + diff --git a/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion07a.scr b/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion07a.scr new file mode 100644 index 000000000..525c561da --- /dev/null +++ b/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion07a.scr @@ -0,0 +1,21 @@ +module bad.reach.globals.grecursion.Recursion07a; + + +global protocol Recursion7a(role A, role B) +{ + rec X + { + choice at A + { + l1() from A to B; + } + or + { + l2() from A to B; + } + continue X; + l3() from A to B; // Uncomment bad + } + //l3() from A to B; // Uncomment bad +} + diff --git a/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion07b.scr b/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion07b.scr new file mode 100644 index 000000000..fafa65a71 --- /dev/null +++ b/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion07b.scr @@ -0,0 +1,21 @@ +module bad.reach.globals.grecursion.Recursion07b; + + +global protocol Recursion7b(role A, role B) +{ + rec X + { + choice at A + { + l1() from A to B; + } + or + { + l2() from A to B; + } + continue X; + //l3() from A to B; // Uncomment bad + } + l3() from A to B; // Uncomment bad +} + diff --git a/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion08a.scr b/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion08a.scr new file mode 100644 index 000000000..d4ca58747 --- /dev/null +++ b/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion08a.scr @@ -0,0 +1,21 @@ +module bad.reach.globals.grecursion.Recursion08a; + + +global protocol Recursion8a(role A, role B) +{ + rec X + { + choice at A + { + l1() from A to B; + continue X; + } + or + { + l2() from A to B; + continue X; + } + } + l3() from A to B; +} + diff --git a/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion08b.scr b/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion08b.scr new file mode 100644 index 000000000..6ee8fbf15 --- /dev/null +++ b/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion08b.scr @@ -0,0 +1,21 @@ +module bad.reach.globals.grecursion.Recursion08b; + + +global protocol Recursion8b(role A, role B) +{ + rec X + { + choice at A + { + l1() from A to B; + continue X; + } + or + { + l2() from A to B; + continue X; + } + l3() from A to B; + } +} + diff --git a/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion11.scr b/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion11.scr new file mode 100644 index 000000000..4b5c7ccb4 --- /dev/null +++ b/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion11.scr @@ -0,0 +1,17 @@ +module bad.reach.globals.grecursion.Recursion11; + + +global protocol Recursion11(role A, role B) +{ + rec X + { + l1() from A to B; + continue X; + } + rec Y + { + l2() from B to A; + continue X; // Not really a reachability case, caught by name disamb + } +} + diff --git a/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion17a.scr b/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion17a.scr new file mode 100644 index 000000000..7c2ea98a0 --- /dev/null +++ b/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion17a.scr @@ -0,0 +1,26 @@ +module bad.reach.globals.grecursion.Recursion17a; + + +global protocol Foo(role A, role B) +{ + rec Z + { + choice at A + { + rec X + { + 1() from A to B; + continue X; + 4() from A to B; + } + } + or + { + rec Y + { + 2() from A to B; + } + } + } + 3() from A to B; +} diff --git a/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion17b.scr b/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion17b.scr new file mode 100644 index 000000000..f37889257 --- /dev/null +++ b/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion17b.scr @@ -0,0 +1,26 @@ +module good.reach.globals.grecursion.Recursion17b; + + +global protocol Foo(role A, role B) +{ + rec Z + { + choice at A + { + rec X + { + 1() from A to B; + continue X; + } + 4() from A to B; + } + or + { + rec Y + { + 2() from A to B; + } + } + } + 3() from A to B; +} diff --git a/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion17c.scr b/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion17c.scr new file mode 100644 index 000000000..76e48cbd0 --- /dev/null +++ b/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion17c.scr @@ -0,0 +1,26 @@ +module bad.reach.globals.grecursion.Recursion17c; + + +global protocol Foo(role A, role B) +{ + rec Z + { + choice at A + { + rec X + { + 1() from A to B; + continue X; + } + } + or + { + rec Y + { + 2() from A to B; + continue Y; + } + } + } + 3() from A to B; +} diff --git a/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion17d.scr b/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion17d.scr new file mode 100644 index 000000000..ef13445f8 --- /dev/null +++ b/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion17d.scr @@ -0,0 +1,26 @@ +module bad.reach.globals.grecursion.Recursion17d; + + +global protocol Foo(role A, role B) +{ + rec Z + { + choice at A + { + rec X + { + 1() from A to B; + continue X; + } + } + or + { + rec Y + { + 2() from A to B; + continue Z; + } + } + } + 3() from A to B; +} diff --git a/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion17e.scr b/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion17e.scr new file mode 100644 index 000000000..7375025f6 --- /dev/null +++ b/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion17e.scr @@ -0,0 +1,26 @@ +module bad.reach.globals.grecursion.Recursion17e; + + +global protocol Foo(role A, role B) +{ + rec Z + { + choice at A + { + rec X + { + 1() from A to B; + } + } + or + { + rec Y + { + 2() from A to B; + continue Z; + } + } + 4() from A to B; + } + 3() from A to B; +} diff --git a/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion17f.scr b/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion17f.scr new file mode 100644 index 000000000..5a55465d7 --- /dev/null +++ b/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion17f.scr @@ -0,0 +1,26 @@ +module bad.reach.globals.grecursion.Recursion17f; + + +global protocol Foo(role A, role B) +{ + rec Z + { + choice at A + { + rec X + { + 1() from A to B; + } + } + or + { + rec Y + { + 2() from A to B; + continue Z; + } + 4() from A to B; + } + } + 3() from A to B; +} diff --git a/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion18.scr b/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion18.scr new file mode 100644 index 000000000..cd90c4633 --- /dev/null +++ b/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion18.scr @@ -0,0 +1,20 @@ +module bad.reach.globals.grecursion.Recursion18; + + +global protocol Foo(role A, role B) +{ + rec X + { + choice at A + { + 1() from A to B; + } + or + { + 2() from A to B; + continue X; + } + continue X; // Bad reach // Reachability error comes out as a graph building error if not checked first + } +} + diff --git a/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion19a.scr b/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion19a.scr new file mode 100644 index 000000000..e397203cd --- /dev/null +++ b/scribble-test/src/test/resources/bad/reach/globals/grecursion/Recursion19a.scr @@ -0,0 +1,12 @@ +module bad.reach.globals.grecursion.Recursion19a; + + +global protocol Foo(role A, role B, role C) +{ + rec X + { + 1() from A to B; + continue X; + } + 2() from A to C; +} diff --git a/scribble-test/src/test/resources/bad/safety/orphan/threeparty/Test01a.scr b/scribble-test/src/test/resources/bad/safety/orphan/threeparty/Test01a.scr new file mode 100644 index 000000000..8306ff631 --- /dev/null +++ b/scribble-test/src/test/resources/bad/safety/orphan/threeparty/Test01a.scr @@ -0,0 +1,19 @@ +module bad.safety.orphan.threeparty.Test01a; + + +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 2() from B to C; + } + or + { + 1() from A to B; + 2() from B to C; + 3() from B to C; // Also wait-for + } +} + + diff --git a/scribble-test/src/test/resources/bad/safety/orphan/threeparty/Test01b.scr b/scribble-test/src/test/resources/bad/safety/orphan/threeparty/Test01b.scr new file mode 100644 index 000000000..1336c35f3 --- /dev/null +++ b/scribble-test/src/test/resources/bad/safety/orphan/threeparty/Test01b.scr @@ -0,0 +1,19 @@ +module bad.safety.orphan.threeparty.Test01b; + + +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 2() from B to C; + } + or + { + 1() from A to B; + 4() from A to B; // Also wait-for + 2() from B to C; // (Mergeable B-C, no stuck) + } +} + + diff --git a/scribble-test/src/test/resources/bad/safety/orphan/threeparty/Test02.scr b/scribble-test/src/test/resources/bad/safety/orphan/threeparty/Test02.scr new file mode 100644 index 000000000..33e0d75e2 --- /dev/null +++ b/scribble-test/src/test/resources/bad/safety/orphan/threeparty/Test02.scr @@ -0,0 +1,22 @@ +module bad.safety.orphan.threeparty.Test02; + + +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + 3() from A to C; + continue X; // Also wait-for + } + or + { + 1() from A to B; + 4() from A to C; + } + } +} + + diff --git a/scribble-test/src/test/resources/bad/safety/orphan/threeparty/Test03.scr b/scribble-test/src/test/resources/bad/safety/orphan/threeparty/Test03.scr new file mode 100644 index 000000000..ec7832a8b --- /dev/null +++ b/scribble-test/src/test/resources/bad/safety/orphan/threeparty/Test03.scr @@ -0,0 +1,20 @@ +module bad.safety.orphan.threeparty.Test03; + + +global protocol Proto1(role A, role B, role C) +{ + // Wait-for + orphan error counterparts (arise together) + choice at A + { + 1() from A to B; + 1() from A to C; + 2() from B to C; + } + or + { + 1() from A to B; + 1() from A to C; + 2() from C to B; + } +} + diff --git a/scribble-test/src/test/resources/bad/safety/orphan/twoparty/Test01.scr b/scribble-test/src/test/resources/bad/safety/orphan/twoparty/Test01.scr new file mode 100644 index 000000000..6a3bc1219 --- /dev/null +++ b/scribble-test/src/test/resources/bad/safety/orphan/twoparty/Test01.scr @@ -0,0 +1,21 @@ +module bad.safety.orphan.twoparty.Test01; + + +global protocol Proto1(role A, role B) +{ + rec X + { + choice at A + { + 1() from A to B; // (..and counterpart wait-for) + continue X; + } + or + { + 1() from A to B; // Bad: orphans + } + } +} + + + diff --git a/scribble-test/src/test/resources/bad/safety/orphan/twoparty/Test02.scr b/scribble-test/src/test/resources/bad/safety/orphan/twoparty/Test02.scr new file mode 100644 index 000000000..31ed714fd --- /dev/null +++ b/scribble-test/src/test/resources/bad/safety/orphan/twoparty/Test02.scr @@ -0,0 +1,19 @@ +module bad.safety.orphan.twoparty.Test02; + + +global protocol Proto1(role A, role B) +{ + // Wait-for + orphan error counterparts (arise together) + choice at A + { + 1() from A to B; + 1() from B to A; + 2() from A to B; // Orphan (and deadlock) + } + or + { + 1() from A to B; + 1() from B to A; + } +} + diff --git a/scribble-test/src/test/resources/bad/safety/stuckmsg/fourparty/Test01.scr b/scribble-test/src/test/resources/bad/safety/stuckmsg/fourparty/Test01.scr new file mode 100644 index 000000000..f9a4350de --- /dev/null +++ b/scribble-test/src/test/resources/bad/safety/stuckmsg/fourparty/Test01.scr @@ -0,0 +1,38 @@ +module bad.safety.stuckmsg.fourparty.Test01; + + +global protocol Proto1(role A, role B, role C, role D) +{ + choice at A + { + 1() from A to B; + rec X + { + 1() from A to B; + choice at B + { + 2() from B to C; + 2() from C to D; + choice at C + { + 2() from C to A; + } + or + { + () from C to A; + 2() from C to D; // Reception error (but OK if following is commented) + () from C to D; + } + continue X; + } + } + } + or + { + 0() from A to B; + 0() from B to C; + 0() from C to D; + } +} + + diff --git a/scribble-test/src/test/resources/bad/safety/stuckmsg/fourparty/Test02a.scr b/scribble-test/src/test/resources/bad/safety/stuckmsg/fourparty/Test02a.scr new file mode 100644 index 000000000..80732dd17 --- /dev/null +++ b/scribble-test/src/test/resources/bad/safety/stuckmsg/fourparty/Test02a.scr @@ -0,0 +1,23 @@ +module bad.safety.stuckmsg.fourparty.Test02a; + + +global protocol Proto1(role A, role B, role C, role D) +{ + rec X + { + 1() from A to B; + continue X; // Checking safety in non-terminating global model + } + choice at C + { + 2() from C to D; + 3() from D to C; // Stuck messages also manifest as message liveness errors (subsumed? so unnecessary to check safety except for actual terminations? -- but morally, they are local safety errors for the roles, as opposed to global liveness errors for the system) + } + or + { + 2() from C to D; + 4() from D to C; + } +} + + diff --git a/scribble-test/src/test/resources/bad/safety/stuckmsg/fourparty/Test02b.scr b/scribble-test/src/test/resources/bad/safety/stuckmsg/fourparty/Test02b.scr new file mode 100644 index 000000000..a2cbaf56b --- /dev/null +++ b/scribble-test/src/test/resources/bad/safety/stuckmsg/fourparty/Test02b.scr @@ -0,0 +1,22 @@ +module bad.safety.stuckmsg.fourparty.Test02b; + + +global protocol Proto1(role A, role B, role C, role D) +{ + choice at A + { + 1() from A to B; + 2() from B to A; + } + or + { + 1() from A to B; + 3() from B to A; // A not safe (but not a terminal global state) + } + rec X + { + 4() from C to D; + continue X; + } +} + diff --git a/scribble-test/src/test/resources/bad/safety/stuckmsg/payloads/Test01a.scr b/scribble-test/src/test/resources/bad/safety/stuckmsg/payloads/Test01a.scr new file mode 100644 index 000000000..5e48c76b1 --- /dev/null +++ b/scribble-test/src/test/resources/bad/safety/stuckmsg/payloads/Test01a.scr @@ -0,0 +1,24 @@ +module bad.safety.stuckmsg.payloads.Test01a; + + +type "java.lang.Integer" from "rt.jar" as Int1; +type "java.lang.Integer" from "rt.jar" as Int2; + + +global protocol Proto1(role A, role B) +{ + choice at A + { + //1() from A to B; // Uncomment still bad + 1(Int1) from A to B; + 2() from B to A; + } + or + { + 1(Int2) from A to B; // here, payloads aren't considered as distinguishing for labels + // error is the special case of actions that are non-deterministic labels up to payloads + // (Syntactic MPST merge not defined for repeat labels, Cf. -oldwf) + 3() from B to A; + } +} + diff --git a/scribble-test/src/test/resources/bad/safety/stuckmsg/payloads/Test01b.scr b/scribble-test/src/test/resources/bad/safety/stuckmsg/payloads/Test01b.scr new file mode 100644 index 000000000..d25527166 --- /dev/null +++ b/scribble-test/src/test/resources/bad/safety/stuckmsg/payloads/Test01b.scr @@ -0,0 +1,24 @@ +module bad.safety.stuckmsg.payloads.Test01b; + + +type "java.lang.Integer" from "rt.jar" as Int1; +type "java.lang.Integer" from "rt.jar" as Int2; + + +global protocol Proto1(role A, role B) +{ + choice at A + { + 1(Int1) from A to B; + 2() from B to A; // Mergeable continuations, but still bad.. + } + or + { + 1(Int2) from A to B; // B doesn't know to treat as Int1 or Int2 + // here, payloads aren't considered as distinguishing for labels + // error is the special case of actions that are non-deterministic labels up to payloads + // (Syntactic MPST merge not defined for repeat labels) + 2() from B to A; + } +} + diff --git a/scribble-test/src/test/resources/bad/safety/stuckmsg/payloads/Test01c.scr b/scribble-test/src/test/resources/bad/safety/stuckmsg/payloads/Test01c.scr new file mode 100644 index 000000000..72b4c0252 --- /dev/null +++ b/scribble-test/src/test/resources/bad/safety/stuckmsg/payloads/Test01c.scr @@ -0,0 +1,25 @@ +module bad.safety.stuckmsg.payloads.Test01c; + + +type "java.lang.Integer" from "rt.jar" as Int1; +type "java.lang.Integer" from "rt.jar" as Int2; + + +// Cf. bad.safety.stuckmsg.payloads.Test01b +global protocol Proto1(role A, role B) +{ + choice at A + { + 1() from A to B; + 2(Int1) from B to A; + } + or + { + 1() from A to B; + 2(Int2) from B to A; // (Syntactic MPST merge not defined for repeat labels) + // here, payloads are considered as distinguishing (as default) -- whole I/O action used as label + // Cf.\ Test01b, non-deterministic actions of the same state + // here, actions on different states -- error manifests as regular stuck + } +} + diff --git a/scribble-test/src/test/resources/bad/safety/stuckmsg/payloads/Test01d.scr b/scribble-test/src/test/resources/bad/safety/stuckmsg/payloads/Test01d.scr new file mode 100644 index 000000000..9a9116bd1 --- /dev/null +++ b/scribble-test/src/test/resources/bad/safety/stuckmsg/payloads/Test01d.scr @@ -0,0 +1,24 @@ +module bad.safety.stuckmsg.payloads.Test01d; + + +type "java.lang.Integer" from "rt.jar" as Int1; +type "java.lang.Integer" from "rt.jar" as Int2; + + +global protocol Proto1(role A, role B) +{ + choice at A + { + 1() from A to B; // Uncomment still bad + 1(Int1) from A to B; + 2() from B to A; + } + or + { + 1(Int2) from A to B; // here, payloads aren't considered as distinguishing for labels + // error is the special case of actions that are non-deterministic labels up to payloads + // (Syntactic MPST merge not defined for repeat labels, Cf. -oldwf) + 3() from B to A; + } +} + diff --git a/scribble-test/src/test/resources/bad/safety/stuckmsg/payloads/Test01e.scr b/scribble-test/src/test/resources/bad/safety/stuckmsg/payloads/Test01e.scr new file mode 100644 index 000000000..3ad6e6a00 --- /dev/null +++ b/scribble-test/src/test/resources/bad/safety/stuckmsg/payloads/Test01e.scr @@ -0,0 +1,22 @@ +module bad.safety.stuckmsg.payloads.Test01e; + + +type "java.lang.Integer" from "rt.jar" as Int1; +type "java.lang.Integer" from "rt.jar" as Int2; + + +// Three-party +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 2(Int1) from B to C; + } + or + { + 1() from A to B; + 2(Int2) from B to C; // Payload actions deterministic at B (following initial non-det by A), but non-det at C + } +} + diff --git a/scribble-test/src/test/resources/bad/safety/stuckmsg/threeparty/Test01.scr b/scribble-test/src/test/resources/bad/safety/stuckmsg/threeparty/Test01.scr new file mode 100644 index 000000000..75acac56b --- /dev/null +++ b/scribble-test/src/test/resources/bad/safety/stuckmsg/threeparty/Test01.scr @@ -0,0 +1,23 @@ +module bad.safety.stuckmsg.threeparty.Test01; + + +// Cf. good.wfchoice.gchoice.Choice11; +global protocol Proto1(role A, role B, role C) +{ + rec X + { + 2() from A to B; // bad safety + choice at A + { + 1() from A to C; + continue X; + } + or + { + 2() from A to B; + 2() from A to C; + } + } +} + + diff --git a/scribble-test/src/test/resources/bad/safety/stuckmsg/threeparty/Test02.scr b/scribble-test/src/test/resources/bad/safety/stuckmsg/threeparty/Test02.scr new file mode 100644 index 000000000..03a326b38 --- /dev/null +++ b/scribble-test/src/test/resources/bad/safety/stuckmsg/threeparty/Test02.scr @@ -0,0 +1,23 @@ +module bad.safety.stuckmsg.threeparty.Test02; + + +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + 3() from A to C; + continue X; + } + or + { + 1() from A to B; + 2() from A to B; + 4() from A to C; + } + } +} + + diff --git a/scribble-test/src/test/resources/bad/safety/stuckmsg/threeparty/Test03.scr b/scribble-test/src/test/resources/bad/safety/stuckmsg/threeparty/Test03.scr new file mode 100644 index 000000000..f9bd4593a --- /dev/null +++ b/scribble-test/src/test/resources/bad/safety/stuckmsg/threeparty/Test03.scr @@ -0,0 +1,24 @@ +module bad.safety.stuckmsg.threeparty.Test03; + + +global protocol Proto1(role A, role B, role C) +{ + rec X + { + 1() from A to B; + 1() from B to C; + choice at B + { + 2() from B to A; + continue X; + } + or + { + 3() from B to A; + 1() from B to C; + 3() from B to C; + continue X; + } + } +} + diff --git a/scribble-test/src/test/resources/bad/safety/stuckmsg/twoparty/Test01a.scr b/scribble-test/src/test/resources/bad/safety/stuckmsg/twoparty/Test01a.scr new file mode 100644 index 000000000..307f47622 --- /dev/null +++ b/scribble-test/src/test/resources/bad/safety/stuckmsg/twoparty/Test01a.scr @@ -0,0 +1,16 @@ +module bad.safety.stuckmsg.twoparty.Test01a; + + +global protocol Proto1(role A, role B) +{ + choice at A + { + 1() from A to B; + } + or + { + 1() from A to B; + 2() from A to B; + } +} + diff --git a/scribble-test/src/test/resources/bad/safety/stuckmsg/twoparty/Test01b.scr b/scribble-test/src/test/resources/bad/safety/stuckmsg/twoparty/Test01b.scr new file mode 100644 index 000000000..dd584bdbd --- /dev/null +++ b/scribble-test/src/test/resources/bad/safety/stuckmsg/twoparty/Test01b.scr @@ -0,0 +1,20 @@ +module bad.safety.stuckmsg.twoparty.Test01b; + +global protocol Proto1(role A, role B) +{ + rec X + { + choice at A + { + 1() from A to B; + continue X; + } + or + { + 1() from A to B; + 2() from A to B; + continue X; + } + } +} + diff --git a/scribble-test/src/test/resources/bad/safety/stuckmsg/twoparty/Test03.scr b/scribble-test/src/test/resources/bad/safety/stuckmsg/twoparty/Test03.scr new file mode 100644 index 000000000..de77ac42c --- /dev/null +++ b/scribble-test/src/test/resources/bad/safety/stuckmsg/twoparty/Test03.scr @@ -0,0 +1,22 @@ +module bad.safety.stuckmsg.twoparty.Test03; + + +global protocol Foo(role A, role B) +{ + 1() from A to B; + choice at A + { + do Bar(A, B); + } + or + { + 1() from A to B; + 2() from A to B; + } +} + +global protocol Bar(role A, role B) +{ + do Foo(A, B); +} + diff --git a/scribble-test/src/test/resources/bad/safety/stuckmsg/twoparty/Test04.scr b/scribble-test/src/test/resources/bad/safety/stuckmsg/twoparty/Test04.scr new file mode 100644 index 000000000..6ce3cf899 --- /dev/null +++ b/scribble-test/src/test/resources/bad/safety/stuckmsg/twoparty/Test04.scr @@ -0,0 +1,18 @@ +module bad.safety.stuckmsg.twoparty.Test04; + + +// Cf. good.wfchoice.enabling.twoparty.Test02 +global protocol Proto1(role A, role B) +{ + choice at A + { + 1() from A to B; + 2() from B to A; + } + or + { + 1() from A to B; + 3() from B to A; + } +} + diff --git a/scribble-test/src/test/resources/bad/safety/waitfor/threeparty/Test01.scr b/scribble-test/src/test/resources/bad/safety/waitfor/threeparty/Test01.scr new file mode 100644 index 000000000..5faa8e4e0 --- /dev/null +++ b/scribble-test/src/test/resources/bad/safety/waitfor/threeparty/Test01.scr @@ -0,0 +1,19 @@ +module bad.safety.waitfor.threeparty.Test01; + + +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; // C starved without -fair, but irrelevant to deadlock error + continue X; + } + or + { + 2() from A to C; // No reception error, but B can be deadlocked + } + } +} + diff --git a/scribble-test/src/test/resources/bad/safety/waitfor/threeparty/Test02.scr b/scribble-test/src/test/resources/bad/safety/waitfor/threeparty/Test02.scr new file mode 100644 index 000000000..5c07e6d6d --- /dev/null +++ b/scribble-test/src/test/resources/bad/safety/waitfor/threeparty/Test02.scr @@ -0,0 +1,30 @@ +module bad.safety.waitfor.threeparty.Test02; + + +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + choice at A + { + 1() from A to C; + continue X; // ** CHECKME: badly formed (for B) -- empty block bvelow is pruned leaving only the continue case, which leads to deadlock in global model, is this OK as WF algorithm? (any way to be unsound?) or should explicitly detect inconsistent choice block projections? + } + or + { + 3() from A to C; + } + } + or + { + 2() from A to C; + 2() from A to B; + } + } +} +//*/ + + diff --git a/scribble-test/src/test/resources/bad/safety/waitfor/threeparty/Test03.scr b/scribble-test/src/test/resources/bad/safety/waitfor/threeparty/Test03.scr new file mode 100644 index 000000000..03787c300 --- /dev/null +++ b/scribble-test/src/test/resources/bad/safety/waitfor/threeparty/Test03.scr @@ -0,0 +1,19 @@ +module bad.safety.waitfor.threeparty.Test03; + + +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 1() from B to C; + } + or + { + 2() from A to B; + //1() from B to C; // Comment is bad + } + 2() from C to B; +} + + diff --git a/scribble-test/src/test/resources/bad/safety/waitfor/threeparty/Test04.scr b/scribble-test/src/test/resources/bad/safety/waitfor/threeparty/Test04.scr new file mode 100644 index 000000000..e023382ce --- /dev/null +++ b/scribble-test/src/test/resources/bad/safety/waitfor/threeparty/Test04.scr @@ -0,0 +1,20 @@ +module bad.safety.waitfor.threeparty.Test04; + + +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 1() from A to C; + 1() from C to B; + } + or + { + 1() from A to B; // Uncomment is bad + 2() from A to B; + 2() from A to C; + 2() from C to B; // Also potential stuck + } +} + diff --git a/scribble-test/src/test/resources/bad/safety/waitfor/threeparty/Test05.scr b/scribble-test/src/test/resources/bad/safety/waitfor/threeparty/Test05.scr new file mode 100644 index 000000000..58bd3f8aa --- /dev/null +++ b/scribble-test/src/test/resources/bad/safety/waitfor/threeparty/Test05.scr @@ -0,0 +1,16 @@ +module bad.safety.waitfor.threeparty.Test05; + + +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + } + or + { + 2() from A to B; + 4() from A to C; + } +} + diff --git a/scribble-test/src/test/resources/bad/safety/waitfor/twoparty/Test01.scr b/scribble-test/src/test/resources/bad/safety/waitfor/twoparty/Test01.scr new file mode 100644 index 000000000..77c1d96c7 --- /dev/null +++ b/scribble-test/src/test/resources/bad/safety/waitfor/twoparty/Test01.scr @@ -0,0 +1,26 @@ +module bad.safety.waitfor.twoparty.Test01; + + +global protocol Proto1(role A, role B) +{ + choice at A + { + 1() from A to B; + 1() from B to A; + 2() from A to B; // Async. permut. needs to be an asymmetric local feature; done "globally" allows potential deadlock + 2() from A to B; + 3() from B to A; + 3() from B to A; + } + or + { + 1() from A to B; + 1() from B to A; + 3() from B to A; // Potential deadlock + 3() from B to A; + 2() from A to B; + 2() from A to B; + } +} + + diff --git a/scribble-test/src/test/resources/bad/syntax/consistentchoicesubj/Test01.scr b/scribble-test/src/test/resources/bad/syntax/consistentchoicesubj/Test01.scr new file mode 100644 index 000000000..25c79211c --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/consistentchoicesubj/Test01.scr @@ -0,0 +1,18 @@ +module bad.syntax.consistentchoicesubj.Test01; + + +// Maybe refactor as projection +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 1() from A to C; + } + or + { + 2() from A to B; + 2() from B to C; + } +} + diff --git a/scribble-test/src/test/resources/bad/syntax/consistentchoicesubj/Test02.scr b/scribble-test/src/test/resources/bad/syntax/consistentchoicesubj/Test02.scr new file mode 100644 index 000000000..5a99b0b90 --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/consistentchoicesubj/Test02.scr @@ -0,0 +1,15 @@ +module bad.syntax.consistentchoicesubj.Test02; + + +// Maybe refactor as projection +global protocol Proto1(role C, role S) +{ + choice at C + { + choice at S // Fixed peekParentEnv index bug for enabled choice subjs + { + 1() from S to C; + } + } +} + diff --git a/scribble-test/src/test/resources/bad/syntax/consistentchoicesubj/Test04a.scr b/scribble-test/src/test/resources/bad/syntax/consistentchoicesubj/Test04a.scr new file mode 100644 index 000000000..6ca52a1f3 --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/consistentchoicesubj/Test04a.scr @@ -0,0 +1,25 @@ +module bad.syntax.consistentchoicesubj.Test04a; + + +global protocol Proto1(role A, role B, role C) +{ + // Safe (without recursion), but (intentionally) not supported by local choice syntax -- so global model checking incomplete in general (i.e. morally, outside of Scribble syntax restrictions) + // Cf. -nolocalchoicecheck + /*rec X + {*/ + choice at A + { + 1() from A to B; + 3() from B to C; + //continue X; // With recursion, -nolocalchoicecheck under WF_1 is unsound + } + or + { + 2() from A to B; + 4() from A to C; + //continue X; + } + //} +} + + diff --git a/scribble-test/src/test/resources/bad/syntax/consistentchoicesubj/Test04b.scr b/scribble-test/src/test/resources/bad/syntax/consistentchoicesubj/Test04b.scr new file mode 100644 index 000000000..03c94d049 --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/consistentchoicesubj/Test04b.scr @@ -0,0 +1,23 @@ +module bad.syntax.consistentchoicesubj.Test04b; + + +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + 3() from B to C; + continue X; + } + or + { + 2() from A to B; + 4() from A to C; + continue X; + } + } +} + + diff --git a/scribble-test/src/test/resources/bad/syntax/consistentchoicesubj/Test04c.scr b/scribble-test/src/test/resources/bad/syntax/consistentchoicesubj/Test04c.scr new file mode 100644 index 000000000..5429fa500 --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/consistentchoicesubj/Test04c.scr @@ -0,0 +1,22 @@ +module bad.syntax.consistentchoicesubj.Test04c; + + +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + 3() from B to C; + } + or + { + 2() from A to B; + 4() from A to C; + } + continue X; // Would be OK, even ignoring inconsistent choice subjects, because C just needs to receive 3s or 4s with no further consequences + } +} + + diff --git a/scribble-test/src/test/resources/bad/syntax/consistentchoicesubj/Test05a.scr b/scribble-test/src/test/resources/bad/syntax/consistentchoicesubj/Test05a.scr new file mode 100644 index 000000000..801e79a58 --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/consistentchoicesubj/Test05a.scr @@ -0,0 +1,20 @@ +module bad.syntax.consistentchoicesubj.Test05a; + + +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 1() from A to C; // Bad, even.. + 2() from B to C; + 3() from C to B; + } + or + { + 2() from A to B; + 2() from B to C; // ..without local choice subject check + 4() from C to B; + } +} + diff --git a/scribble-test/src/test/resources/bad/syntax/consistentchoicesubj/Test05b.scr b/scribble-test/src/test/resources/bad/syntax/consistentchoicesubj/Test05b.scr new file mode 100644 index 000000000..e73fdbd5f --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/consistentchoicesubj/Test05b.scr @@ -0,0 +1,25 @@ +module bad.syntax.consistentchoicesubj.Test05b; + + +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + 1() from A to C; // Bad, even.. + 2() from B to C; + 3() from C to B; + } + or + { + 2() from A to B; + 2() from B to C; // ..without local choice subject check + 4() from C to B; + } + continue X; + } +} + + diff --git a/scribble-test/src/test/resources/bad/syntax/consistentchoicesubj/Test06a.scr b/scribble-test/src/test/resources/bad/syntax/consistentchoicesubj/Test06a.scr new file mode 100644 index 000000000..f6e8189dc --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/consistentchoicesubj/Test06a.scr @@ -0,0 +1,18 @@ +module bad.syntax.consistentchoicesubj.Test06a; + + +global protocol Proto1(role A, role B, role C) +{ + choice at A // Would be OK without local choice subject checking (and a multi-queue input branch primitive) + { + 1() from A to B; + 2() from B to C; + 3() from C to B; + } + or + { + 4() from A to C; + 5() from C to B; + } +} + diff --git a/scribble-test/src/test/resources/bad/syntax/consistentchoicesubj/Test06b.scr b/scribble-test/src/test/resources/bad/syntax/consistentchoicesubj/Test06b.scr new file mode 100644 index 000000000..845c59d18 --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/consistentchoicesubj/Test06b.scr @@ -0,0 +1,22 @@ +module bad.syntax.consistentchoicesubj.Test06b; + + +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A // Morally bad, even without local choice subject checking (and a multi-queue input branch primitive, etc.) + { + 1() from A to B; + 2() from B to C; + 3() from C to B; + } + or + { + 4() from A to C; + 5() from C to B; + } + continue X; + } +} + diff --git a/scribble-test/src/test/resources/bad/syntax/consistentchoicesubj/Test07a.scr b/scribble-test/src/test/resources/bad/syntax/consistentchoicesubj/Test07a.scr new file mode 100644 index 000000000..e06b40670 --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/consistentchoicesubj/Test07a.scr @@ -0,0 +1,23 @@ +module bad.syntax.consistentchoicesubj.Test07a; + + +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + 1() from A to C; + 4() from C to B; // Bad.. (apart from inconsistent choice subjects) + continue X; + } + or + { + 2() from A to B; + 3() from B to C; + 5() from C to B; + //continue X; // ..but OK if this continue commented -- is that correct? + } + } +} diff --git a/scribble-test/src/test/resources/bad/syntax/consistentchoicesubj/Test07b.scr b/scribble-test/src/test/resources/bad/syntax/consistentchoicesubj/Test07b.scr new file mode 100644 index 000000000..e6cf84254 --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/consistentchoicesubj/Test07b.scr @@ -0,0 +1,23 @@ +module bad.syntax.consistentchoicesubj.Test07b; + + +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + 1() from A to C; + 4() from C to B; + // OK if -nolocalchoicecheck, and morally OK (no recursion, cf. bad.syntax.consistentchoicesubj.Test07a) + } + or + { + 2() from A to B; + 3() from B to C; + 5() from C to B; + } + } +} + diff --git a/scribble-test/src/test/resources/bad/syntax/consistentchoicesubj/Test07c.scr b/scribble-test/src/test/resources/bad/syntax/consistentchoicesubj/Test07c.scr new file mode 100644 index 000000000..256c33c0b --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/consistentchoicesubj/Test07c.scr @@ -0,0 +1,24 @@ +module bad.syntax.consistentchoicesubj.Test07b; + + +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + 1() from A to C; + 4() from C to A; // OK by -nolocalchoicecheck, and also morally OK because A receives from C (no asynchronous "iteration ambiguity" -- cf. 07a/07b) + continue X; + } + or + { + 2() from A to B; + 3() from B to C; + 5() from C to A; + continue X; + } + } +} + diff --git a/scribble-test/src/test/resources/bad/syntax/consistentchoicesubj/Test08.scr b/scribble-test/src/test/resources/bad/syntax/consistentchoicesubj/Test08.scr new file mode 100644 index 000000000..e7c0fa980 --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/consistentchoicesubj/Test08.scr @@ -0,0 +1,22 @@ +module bad.syntax.consistentchoicesubj.Test08; + + +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + 1() from A to C; + 1() from C to B; + } + or + { + 2() from A to C; + 2() from C to B; // B enabled by A/C + } + continue X; + } +} + diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/Test01.scr b/scribble-test/src/test/resources/bad/syntax/disamb/Test01.scr new file mode 100644 index 000000000..70fdc6e08 --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/disamb/Test01.scr @@ -0,0 +1,14 @@ +module bad.syntax.disamb.Test01; + + +sig "foo" from "bar" as M1; + + +global protocol Foo(role A, role B) +{ + () from A to B; + M from A to B; + M1 from A to B; + M2 from A to B; +} + diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/doarglistdel/DoArgList01.scr b/scribble-test/src/test/resources/bad/syntax/disamb/doarglistdel/DoArgList01.scr new file mode 100644 index 000000000..311f987bc --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/disamb/doarglistdel/DoArgList01.scr @@ -0,0 +1,14 @@ +module bad.syntax.disamb.doarglist.DoArgList01; + + +global protocol Foo(role A, role B, role C) +{ + 1() from A to B; + 1() from A to C; + do Bar(A, B, C); +} + +global protocol Bar(role D, role E) +{ + 2() from D to E; +} diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/doarglistdel/DoArgList02.scr b/scribble-test/src/test/resources/bad/syntax/disamb/doarglistdel/DoArgList02.scr new file mode 100644 index 000000000..22bdafca4 --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/disamb/doarglistdel/DoArgList02.scr @@ -0,0 +1,14 @@ +module bad.syntax.disamb.doarglist.DoArgList02; + + +global protocol Foo(role A, role B) +{ + 1() from A to B; + do Bar(A, B); +} + +global protocol Bar(role C, role D, role E) +{ + 1() from C to D; + 2() from D to E; +} diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/doarglistdel/DoArgList03.scr b/scribble-test/src/test/resources/bad/syntax/disamb/doarglistdel/DoArgList03.scr new file mode 100644 index 000000000..9c5e43f42 --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/disamb/doarglistdel/DoArgList03.scr @@ -0,0 +1,14 @@ +module bad.syntax.disamb.doarglist.DoArgList03; + + +global protocol Foo(role A, role B) +{ + 1() from A to B; + do Bar<2()>(A, B); +} + +global protocol Bar(role C, role D) +{ + M1 from C to D; + M2 from D to C; +} diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/doarglistdel/DoArgList04.scr b/scribble-test/src/test/resources/bad/syntax/disamb/doarglistdel/DoArgList04.scr new file mode 100644 index 000000000..dfc6093c7 --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/disamb/doarglistdel/DoArgList04.scr @@ -0,0 +1,13 @@ +module bad.syntax.disamb.doarglist.DoArgList04; + + +global protocol Foo(role A, role B) +{ + 1() from A to B; + do Bar<2(), 3()>(A, B); +} + +global protocol Bar(role C, role D) +{ + M1 from C to D; +} diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/doarglistdel/DoArgList05.scr b/scribble-test/src/test/resources/bad/syntax/disamb/doarglistdel/DoArgList05.scr new file mode 100644 index 000000000..68255b7bf --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/disamb/doarglistdel/DoArgList05.scr @@ -0,0 +1,13 @@ +module bad.syntax.disamb.doarglist.DoArgList05; + + +global protocol Foo(role A, role B) +{ + 1() from A to B; + do Bar<2()>(A, B); +} + +global protocol Bar(role C, role D) +{ + 2() from C to D; +} diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/doarglistdel/DoArgList06.scr b/scribble-test/src/test/resources/bad/syntax/disamb/doarglistdel/DoArgList06.scr new file mode 100644 index 000000000..41098fc49 --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/disamb/doarglistdel/DoArgList06.scr @@ -0,0 +1,13 @@ +module bad.syntax.disamb.doarglist.DoArgList06; + + +global protocol Foo(role A, role B) +{ + 1() from A to B; + do Bar(A, B); +} + +global protocol Bar(role C, role D) +{ + M1 from C to D; +} diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/globals/gmessagetransfer/GMessageTransfer01.scr b/scribble-test/src/test/resources/bad/syntax/disamb/globals/gmessagetransfer/GMessageTransfer01.scr new file mode 100644 index 000000000..ada699bfa --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/disamb/globals/gmessagetransfer/GMessageTransfer01.scr @@ -0,0 +1,7 @@ +module bad.syntax.disamb.globals.gmessagetransfer.GMessageTransfer01; + + +global protocol Foo(role A) +{ + 1() from A to A; // TODO: should be good +} diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/globals/gprotocoldecl/GProtocolDecl01.scr b/scribble-test/src/test/resources/bad/syntax/disamb/globals/gprotocoldecl/GProtocolDecl01.scr new file mode 100644 index 000000000..e7899ed40 --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/disamb/globals/gprotocoldecl/GProtocolDecl01.scr @@ -0,0 +1,7 @@ +module bad.syntax.disamb.globals.gprotocoldecl.GProtocolDecl01; + + +global protocol Foo(role A, role B, role C) +{ + +} diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/globals/gprotocoldecl/GProtocolDecl02.scr b/scribble-test/src/test/resources/bad/syntax/disamb/globals/gprotocoldecl/GProtocolDecl02.scr new file mode 100644 index 000000000..f8e600ae6 --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/disamb/globals/gprotocoldecl/GProtocolDecl02.scr @@ -0,0 +1,7 @@ +module bad.syntax.disamb.globals.gprotocoldecl.GProtocolDecl02; + + +global protocol GProtocolDecl2(role A, role B, role C) +{ + 1() from A to B; +} diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/globals/gprotocoldecl/GProtocolDecl03.scr b/scribble-test/src/test/resources/bad/syntax/disamb/globals/gprotocoldecl/GProtocolDecl03.scr new file mode 100644 index 000000000..8b2bad3d9 --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/disamb/globals/gprotocoldecl/GProtocolDecl03.scr @@ -0,0 +1,12 @@ +module bad.syntax.disamb.globals.protocoldecl.GProtocolDecl03; + + +global protocol GProtocolDecl3a(role D, role E) +{ + do GProtocolDecl3b(D, E); +} + +global protocol GProtocolDecl3b(role D, role E) +{ + do GProtocolDecl3a(D, E); +} diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/globals/gprotocoldecl/GProtocolDecl04.scr b/scribble-test/src/test/resources/bad/syntax/disamb/globals/gprotocoldecl/GProtocolDecl04.scr new file mode 100644 index 000000000..0fabd2a86 --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/disamb/globals/gprotocoldecl/GProtocolDecl04.scr @@ -0,0 +1,18 @@ +module bad.syntax.disamb.globals.protocoldecl.GProtocolDecl04; + + +global protocol GProtocolDecl4(role A, role B, role C) +{ + do GProtocolDecl4a(A, B); +} + +global protocol GProtocolDecl4a(role B, role C) +{ + do GProtocolDecl4b(B, C); +} + +global protocol GProtocolDecl4b(role D, role E) +{ + 1() from D to E; + do GProtocolDecl4a(D, E); +} diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/headerparamdecllist/HeaderParamDeclList03.scr b/scribble-test/src/test/resources/bad/syntax/disamb/headerparamdecllist/HeaderParamDeclList03.scr new file mode 100644 index 000000000..a84d6b509 --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/disamb/headerparamdecllist/HeaderParamDeclList03.scr @@ -0,0 +1,7 @@ +module bad.syntax.disamb.headerparamdecllist.HeaderParamDeclList03; + + +global protocol Foo(role A, role A) +{ + 1() from A to A; +} diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/imports/Import02.scr b/scribble-test/src/test/resources/bad/syntax/disamb/imports/Import02.scr new file mode 100644 index 000000000..0c2d171c6 --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/disamb/imports/Import02.scr @@ -0,0 +1,4 @@ +module bad.syntax.disamb.imports.Import02; + + +import bad.syntax.disamb.imports.Import02; diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/imports/Import03.scr b/scribble-test/src/test/resources/bad/syntax/disamb/imports/Import03.scr new file mode 100644 index 000000000..05c54e1ae --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/disamb/imports/Import03.scr @@ -0,0 +1,4 @@ +module bad.syntax.disamb.imports.Import03; + + +import bad.syntax.disamb.imports.Import03 as Import03; // The simple name Import03 is implicitly visible from moduledecl diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/imports/Import06.scr b/scribble-test/src/test/resources/bad/syntax/disamb/imports/Import06.scr new file mode 100644 index 000000000..e72d3feac --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/disamb/imports/Import06.scr @@ -0,0 +1,9 @@ +//Raymond@HZHL2 ~/code/python/scribble-tools +//$ PYTHONPATH='lib/:bin/' python src/scribble/Main.py -ip test/ test/base/impourt/Import6.scr + +// Possiblty good for testing for potential loops in recursive imports when a module is bad? -- could allow this as a special case? (import self) + +module bad.parsing.imports.Import06; + +import bad.parsing.imports.Import06; + diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/imports/Import17.scr b/scribble-test/src/test/resources/bad/syntax/disamb/imports/Import17.scr new file mode 100644 index 000000000..211903022 --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/disamb/imports/Import17.scr @@ -0,0 +1,7 @@ +//Raymond@HZHL2 ~/code/python/scribble-tools +//$ PYTHONPATH='lib/:bin/' python src/scribble/Main.py -ip test/ test/base/impourt/Import17.scr + +module bad.parsing.imports.Import17; + + +import bad.parsing.imports.Import17; // Old: OK because full name is a "compound" name -- old: if simple and full names coincide for a module, self import is not OK diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/imports/Import18.scr b/scribble-test/src/test/resources/bad/syntax/disamb/imports/Import18.scr new file mode 100644 index 000000000..5e83c0dfa --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/disamb/imports/Import18.scr @@ -0,0 +1,12 @@ +module good.syntax.disamb.imports.Import18; + + +import bad.syntax.disamb.imports.pack1.Import18b as Bar; + + +global protocol Foo(role A, role B) +{ + do good.syntax.disamb.imports.pack1.Import18b.Proto2(A, B); +} + + diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/imports/Import19.scr b/scribble-test/src/test/resources/bad/syntax/disamb/imports/Import19.scr new file mode 100644 index 000000000..92c1cf171 --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/disamb/imports/Import19.scr @@ -0,0 +1,7 @@ +module good.syntax.disamb.imports.Import19; + + +import bad.syntax.disamb.imports.pack1.Import19b; + + + diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/imports/pack1/IGNORE b/scribble-test/src/test/resources/bad/syntax/disamb/imports/pack1/IGNORE new file mode 100644 index 000000000..e69de29bb diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/imports/pack1/Import19b.scr b/scribble-test/src/test/resources/bad/syntax/disamb/imports/pack1/Import19b.scr new file mode 100644 index 000000000..1ecfdc4b8 --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/disamb/imports/pack1/Import19b.scr @@ -0,0 +1,8 @@ +module bad.syntax.disamb.imports.pack1.Import19b; + + +global protocol Proto1(role C, role D) +{ + () from C to A; +} + diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/modules/Modules01.scr b/scribble-test/src/test/resources/bad/syntax/disamb/modules/Modules01.scr new file mode 100644 index 000000000..d83bb4de4 --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/disamb/modules/Modules01.scr @@ -0,0 +1,13 @@ +module bad.syntax.disamb.modules.Modules01; + + +// FIXME: inconsistent classification of diamb tests, e.g. modules vs protocoldecl, imports, etc +global protocol Foo(role A, role B) +{ + +} + +global protocol Foo(role A, role B) +{ + +} diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/modules/Modules02.scr b/scribble-test/src/test/resources/bad/syntax/disamb/modules/Modules02.scr new file mode 100644 index 000000000..30eac000e --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/disamb/modules/Modules02.scr @@ -0,0 +1,5 @@ +module bad.syntax.disamb.modules.Modules02; + + +type "java.lang.String" from "rt.jar" as String; +type "java.lang.String" from "rt.jar" as String; diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/modules/Modules03.scr b/scribble-test/src/test/resources/bad/syntax/disamb/modules/Modules03.scr new file mode 100644 index 000000000..0f02a88f4 --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/disamb/modules/Modules03.scr @@ -0,0 +1,5 @@ +module bad.syntax.disamb.modules.Modules03; + + +type "java.lang.String" from "rt.jar" as String; +sig "java.lang.String" from "rt.jar" as String; diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/modules/Modules04a.scr b/scribble-test/src/test/resources/bad/syntax/disamb/modules/Modules04a.scr new file mode 100644 index 000000000..565880ee3 --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/disamb/modules/Modules04a.scr @@ -0,0 +1,4 @@ +module bad.syntax.disamb.modules.Modules04a; + +import bad.syntax.disamb.modules.Modules04a; + diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/modules/Modules04b.scr b/scribble-test/src/test/resources/bad/syntax/disamb/modules/Modules04b.scr new file mode 100644 index 000000000..b3c2af706 --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/disamb/modules/Modules04b.scr @@ -0,0 +1,4 @@ +module bad.syntax.disamb.modules.Modules04b; + +import bad.syntax.disamb.modules.Modules04b as Modules04b; // Simple name coincides with full name + diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/modules/Modules04c.scr b/scribble-test/src/test/resources/bad/syntax/disamb/modules/Modules04c.scr new file mode 100644 index 000000000..9bd34473f --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/disamb/modules/Modules04c.scr @@ -0,0 +1,11 @@ +module bad.syntax.disamb.modules.Modules04c; + + +import bad.syntax.disamb.modules.pack1.Foo1 as Modules04c; + + +global protocol Proto(role A, role B) +{ + 1() from A to B; + do Modules04c.Proto(A, B); +} diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/modules/Modules04d.scr b/scribble-test/src/test/resources/bad/syntax/disamb/modules/Modules04d.scr new file mode 100644 index 000000000..e2c63fbfe --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/disamb/modules/Modules04d.scr @@ -0,0 +1,7 @@ +module bad.syntax.disamb.modules.Modules04d; + + +import bad.syntax.disamb.modules.pack1.Foo1 as Foo; +import bad.syntax.disamb.modules.pack1.Foo2 as Foo; + + diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/modules/Modules04e.scr b/scribble-test/src/test/resources/bad/syntax/disamb/modules/Modules04e.scr new file mode 100644 index 000000000..73444b86f --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/disamb/modules/Modules04e.scr @@ -0,0 +1,4 @@ +module bad.syntax.disamb.modules.Modules04e; + +import bad.syntax.disamb.modules.pack1.Foo1 as Modules04e; + diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/modules/pack1/Foo1.scr b/scribble-test/src/test/resources/bad/syntax/disamb/modules/pack1/Foo1.scr new file mode 100644 index 000000000..533686da4 --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/disamb/modules/pack1/Foo1.scr @@ -0,0 +1,7 @@ +module bad.syntax.disamb.modules.pack1.Foo1; + + +global protocol Proto(role A, role B) +{ + 2() from A to B; +} diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/modules/pack1/Foo2.scr b/scribble-test/src/test/resources/bad/syntax/disamb/modules/pack1/Foo2.scr new file mode 100644 index 000000000..2d1ac71ab --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/disamb/modules/pack1/Foo2.scr @@ -0,0 +1,7 @@ +module bad.syntax.disamb.modules.pack1.Foo2; + + +global protocol Proto(role A, role B) +{ + 2() from A to B; +} diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/modules/pack1/IGNORE b/scribble-test/src/test/resources/bad/syntax/disamb/modules/pack1/IGNORE new file mode 100644 index 000000000..e69de29bb diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/nonrolearglist/NonRoleArgList01.scr b/scribble-test/src/test/resources/bad/syntax/disamb/nonrolearglist/NonRoleArgList01.scr new file mode 100644 index 000000000..018a05b52 --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/disamb/nonrolearglist/NonRoleArgList01.scr @@ -0,0 +1,15 @@ +module bad.syntax.disamb.rolearglist.NonRoleArgList01; + + +type "..." from "..." as TTT; + + +global protocol Foo(role A, role B) +{ + do Bar(A, B); +} + +global protocol Bar(role C, role D) +{ + M1 from C to D; +} diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/nonrolearglist/NonRoleArgList02.scr b/scribble-test/src/test/resources/bad/syntax/disamb/nonrolearglist/NonRoleArgList02.scr new file mode 100644 index 000000000..8a3149138 --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/disamb/nonrolearglist/NonRoleArgList02.scr @@ -0,0 +1,12 @@ +module bad.syntax.disamb.rolearglist.NonRoleArgList02; + + +global protocol Foo(role A, role B) +{ + do Bar<1()>(A, B); +} + +global protocol Bar(role C, role D) +{ + 2(T) from C to D; +} diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/protocoldecl/Test01.scr b/scribble-test/src/test/resources/bad/syntax/disamb/protocoldecl/Test01.scr new file mode 100644 index 000000000..14074a6f1 --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/disamb/protocoldecl/Test01.scr @@ -0,0 +1,15 @@ +module bad.syntax.disamb.protocoldecl.Test01; + + +global protocol Proto1(role A, role B) +{ + 1() from A to B; + do Proto1(A, B); +} + + +global protocol Proto1(role A, role B) // Testing disamb +{ + 2() from A to B; +} + diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/protocoldecl/Test02.scr b/scribble-test/src/test/resources/bad/syntax/disamb/protocoldecl/Test02.scr new file mode 100644 index 000000000..6bf106d07 --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/disamb/protocoldecl/Test02.scr @@ -0,0 +1,9 @@ +module bad.syntax.disamb.protocoldecl.Test02; + + +global protocol Proto1(role A, role B) +{ + 1() from A to B; + do Proto2(A, B); // Testing disamb +} + diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/recvarnode/Recursion01a.scr b/scribble-test/src/test/resources/bad/syntax/disamb/recvarnode/Recursion01a.scr new file mode 100644 index 000000000..3a7bbeb78 --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/disamb/recvarnode/Recursion01a.scr @@ -0,0 +1,16 @@ +module bad.syntax.disamb.recvarnode.Recursion01a; + + +global protocol Recursion1a(role A, role B) +{ + //rec A { } // Currently OK. Disallow? + + rec X + { + l1() from A to B; + //continue X; + continue Y; // Uncomment bad, even if above line is commented + //l2() from A to B; // Uncomment bad + } +} + diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/recvarnode/Recursion05b.scr b/scribble-test/src/test/resources/bad/syntax/disamb/recvarnode/Recursion05b.scr new file mode 100644 index 000000000..0f7e4adfc --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/disamb/recvarnode/Recursion05b.scr @@ -0,0 +1,18 @@ +module bad.syntax.disamb.recvarnode.Recursion05b; + + +global protocol Recursion5b(role A, role B) +{ + rec X + { + l1() from A to B; + //continue X; // Uncomment makes the below rec bad + continue Y; // Uncomment bad + } + rec Y + { + l2() from B to A; + continue Y; // A bad "continue X" here tested in Recursion11 + } +} + diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/recvarnode/Recursion05c.scr b/scribble-test/src/test/resources/bad/syntax/disamb/recvarnode/Recursion05c.scr new file mode 100644 index 000000000..feecdca7c --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/disamb/recvarnode/Recursion05c.scr @@ -0,0 +1,19 @@ +module bad.syntax.disamb.recvarnode.Recursion05c; + + +global protocol Recursion5c(role A, role B) +{ + rec X + { + l1() from A to B; + //continue X; // Uncomment makes the below rec bad + //continue Y; // Uncomment bad + } + rec Y + { + l2() from B to A; + //continue Y; // A bad "continue X" here tested in Recursion11 + continue X; // A bad "continue X" here tested in Recursion11 + } +} + diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/recvarnode/Recursion11.scr b/scribble-test/src/test/resources/bad/syntax/disamb/recvarnode/Recursion11.scr new file mode 100644 index 000000000..549cbc492 --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/disamb/recvarnode/Recursion11.scr @@ -0,0 +1,17 @@ +module bad.syntax.disamb.recvarnode.Recursion11; + + +global protocol Recursion11(role A, role B) +{ + rec X + { + l1() from A to B; + } + rec Y + { + l2() from B to A; + //continue Y; + continue X; // Uncomment bad, even if above line is commented + } +} + diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/rolearglist/RoleArgList02.scr b/scribble-test/src/test/resources/bad/syntax/disamb/rolearglist/RoleArgList02.scr new file mode 100644 index 000000000..dfbc07b3a --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/disamb/rolearglist/RoleArgList02.scr @@ -0,0 +1,12 @@ +module bad.syntax.disamb.rolearglist.RoleArgList02; + + +global protocol Foo(role A, role B) +{ + do Bar(A, A); +} + +global protocol Bar(role C, role D) +{ + 1() from C to D; +} diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/roledecl/Do13a.scr b/scribble-test/src/test/resources/bad/syntax/disamb/roledecl/Do13a.scr new file mode 100644 index 000000000..5304dfe5b --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/disamb/roledecl/Do13a.scr @@ -0,0 +1,9 @@ +module bad.syntax.disamb.roledecl.Do13a; + + +global protocol Do13a(role A, role B) +{ + //l1() from A to B; // Uncomment is OK + do Do13a(A, B); + //l1() from A to B; // Uncomment is bad +} diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/roledecl/Do23a.scr b/scribble-test/src/test/resources/bad/syntax/disamb/roledecl/Do23a.scr new file mode 100644 index 000000000..c648acf71 --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/disamb/roledecl/Do23a.scr @@ -0,0 +1,22 @@ +module bad.syntax.disamb.roledecl.Do23a; + + +type "java.lang.String" from "rt.jar" as String; + + +// Overlaps with Do25? +global protocol Do23a(role A, role B) +{ + do Do23aux(A, B); +} + +global protocol Do23aux(role C, role D) +{ + do Do23a2(C, D); +} + +global protocol Do23a2(role E, role F) +//global protocol Do23a2(role E, role F) +{ + //X from E to F; // Uncomment OK +} diff --git a/scribble-test/src/test/resources/bad/syntax/disamb/rolenode/Test02.scr b/scribble-test/src/test/resources/bad/syntax/disamb/rolenode/Test02.scr new file mode 100644 index 000000000..13b0ce4da --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/disamb/rolenode/Test02.scr @@ -0,0 +1,17 @@ +module bad.syntax.disamb.rolenode.Test02; + + +global protocol Proto1(role A, role B) +{ + choice at A + { + 1() from A to B; + 1() from A to C; + } + or + { + 2() from A to B; + 2() from B to C; + } +} + diff --git a/scribble-test/src/test/resources/bad/syntax/enabling/Test01.scr b/scribble-test/src/test/resources/bad/syntax/enabling/Test01.scr new file mode 100644 index 000000000..3b87de4a9 --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/enabling/Test01.scr @@ -0,0 +1,21 @@ +module bad.syntax.enabling.Test02; + + +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 1() from B to C; + } + or + { + 2() from A to B; + } + or + { + 1() from B to C; + } +} + + diff --git a/scribble-test/src/test/resources/bad/syntax/enabling/Test02.scr b/scribble-test/src/test/resources/bad/syntax/enabling/Test02.scr new file mode 100644 index 000000000..3dbd21ffe --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/enabling/Test02.scr @@ -0,0 +1,20 @@ +module bad.syntax.enabling.Test01; + + +global protocol Proto1(role A, role B, role C) +{ + //0() from B to C; + choice at A + { + 0() from B to C; + 1() from A to B; + 1() from B to C; + } + or + { + 0() from B to C; + 2() from A to B; + 2() from B to C; + } +} + diff --git a/scribble-test/src/test/resources/bad/syntax/rolecollection/gprotocoldecl/Test01.scr b/scribble-test/src/test/resources/bad/syntax/rolecollection/gprotocoldecl/Test01.scr new file mode 100644 index 000000000..585d1cd00 --- /dev/null +++ b/scribble-test/src/test/resources/bad/syntax/rolecollection/gprotocoldecl/Test01.scr @@ -0,0 +1,15 @@ +module bad.syntax.rolecollection.gprotocoldecl.Test01; + + +global protocol Foo(role A, role B) +{ + 1() from A to B; + do Bar(A, B); + 2() from A to B; +} + +aux global protocol Bar(role A, role B) // Testing bad unused role decls (wrt. subprotocol collected role occurrences) -- actually, allow due to aux? +{ + +} + diff --git a/scribble-test/src/test/resources/bad/todo/Choice07a.scr b/scribble-test/src/test/resources/bad/todo/Choice07a.scr new file mode 100644 index 000000000..3487c422a --- /dev/null +++ b/scribble-test/src/test/resources/bad/todo/Choice07a.scr @@ -0,0 +1,25 @@ +module bad.wfchoice.gchoice.Choice07a; + + +global protocol Choice7a(role A, role B) +{ + choice at A + { + /*// TODO + par + { + l1() from A to B; + } + and + { + l2() from B to A; // Uncomment is bad + l2() from A to B; + }*/ + } + or + { + //l2() from A to B; // Uncomment is bad + l3() from A to B; + } +} + diff --git a/scribble-test/src/test/resources/bad/todo/Choice07b.scr b/scribble-test/src/test/resources/bad/todo/Choice07b.scr new file mode 100644 index 000000000..23d613da7 --- /dev/null +++ b/scribble-test/src/test/resources/bad/todo/Choice07b.scr @@ -0,0 +1,25 @@ +module bad.wfchoice.gchoice.Choice07b; + + +global protocol Choice7b(role A, role B) +{ + choice at A + { + /*//TODO + par + { + l1() from A to B; + } + and + { + //l2() from B to A; // Uncomment is bad + l2() from A to B; + }*/ + } + or + { + l2() from A to B; // Uncomment is bad + l3() from A to B; + } +} + diff --git a/scribble-test/src/test/resources/bad/todo/IGNORE b/scribble-test/src/test/resources/bad/todo/IGNORE new file mode 100644 index 000000000..e69de29bb diff --git a/scribble-test/src/test/resources/bad/todo/Modules02.scr b/scribble-test/src/test/resources/bad/todo/Modules02.scr new file mode 100644 index 000000000..e6414d690 --- /dev/null +++ b/scribble-test/src/test/resources/bad/todo/Modules02.scr @@ -0,0 +1,12 @@ +module bad.syntax.disamb.modules.Modules02; + + +global protocol Foo(role A, role B) +{ + +} + +local protocol Foo(role A, role B) // TODO: local not parsed +{ + +} diff --git a/scribble-test/src/test/resources/bad/todo/Recursion12.scr b/scribble-test/src/test/resources/bad/todo/Recursion12.scr new file mode 100644 index 000000000..6a042547f --- /dev/null +++ b/scribble-test/src/test/resources/bad/todo/Recursion12.scr @@ -0,0 +1,21 @@ +module base.recursion.Recursion12; + + +global protocol Recursion12(role A, role B) +{ + /*// TODO + par + { + rec X + { + l1() from A to B; + continue X; + } + } + and + { + l2() from B to A; + }*/ + l3() from B to A; // Uncommented bad +} + diff --git a/scribble-test/src/test/resources/bad/todo/Recursion14a.scr b/scribble-test/src/test/resources/bad/todo/Recursion14a.scr new file mode 100644 index 000000000..744ae9c2c --- /dev/null +++ b/scribble-test/src/test/resources/bad/todo/Recursion14a.scr @@ -0,0 +1,23 @@ +module base.recursion.Recursion14a; + + +global protocol Recursion14a(role A, role B) +{ + rec X + { + l1() from A to B; + do Y: base.recursion.Recursion14.Recursion14a(A, B); // TODO + do X: base.recursion.Recursion14.Recursion14a(A, B); // Uncomment OK if above line is commented // TODO + //do base.recursion.Recursion14.Recursion14a(A, B); // Uncomment bad, even if above two lines are commented + } +} + +global protocol Recursion14a(role A, role B) +{ + rec X + { + l1() from A to B; + continue X; + } +} + diff --git a/scribble-test/src/test/resources/bad/todo/Recursion19b.scr b/scribble-test/src/test/resources/bad/todo/Recursion19b.scr new file mode 100644 index 000000000..b7568a80b --- /dev/null +++ b/scribble-test/src/test/resources/bad/todo/Recursion19b.scr @@ -0,0 +1,22 @@ +module bad.reach.globals.grecursion.Recursion19b; + + +global protocol Proto1(role A, role B) +{ + rec X + { + choice at A + { + continue X; + // CHECKME: was previously considered bad -- but now, projection implicitly removes this continue so the 1() is not a bad continuation any more... + // TODO: check as global WF instead? unguarded continue? (cf. reachability) + // Or consider good? maybe consistent with, e.g., rec X { continue X; }, already being discarded + } + or + { + 2() from A to B; + } + 1() from A to B; // Reachability error -- comes out as a global model error if that pass is done first (tail recursion needed as syntactic check prior to model checking) // Reachability now done before model check + } +} + diff --git a/scribble-test/src/test/resources/bad/wfchoice/enabling/fourparty/Test01.scr b/scribble-test/src/test/resources/bad/wfchoice/enabling/fourparty/Test01.scr new file mode 100644 index 000000000..e3fcacddb --- /dev/null +++ b/scribble-test/src/test/resources/bad/wfchoice/enabling/fourparty/Test01.scr @@ -0,0 +1,28 @@ +module bad.wfchoice.enabling.fourparty.Test01; + + +// Under -f17, the original choice subject problem is gone, but we get a role-progress error instead (without fairness) +global protocol Proto1(role A, role B, role C, role D) +{ + choice at A + { + 1() from A to B; + rec X + { + 2() from B to C; + choice at C + { + 2() from C to A; + continue X; // Enabling error, with the continue inside this choice scope (continue factored out after choice is not enabling error) + } + or + { + () from C to A; + () from C to D; + continue X; + } + } + } +} + + diff --git a/scribble-test/src/test/resources/bad/wfchoice/enabling/threeparty/Test01.scr b/scribble-test/src/test/resources/bad/wfchoice/enabling/threeparty/Test01.scr new file mode 100644 index 000000000..12e5ab764 --- /dev/null +++ b/scribble-test/src/test/resources/bad/wfchoice/enabling/threeparty/Test01.scr @@ -0,0 +1,17 @@ +module bad.wfchoice.enabling.threeparty.Test01; + + +global protocol Proto1(role A, role B, role C) +{ + 1() from A to B; + 2() from A to C; + choice at A + { + do Proto1(A, B, C); + } + or + { + 2() from A to B; + 2() from A to C; + } +} diff --git a/scribble-test/src/test/resources/bad/wfchoice/enabling/threeparty/Test02.scr b/scribble-test/src/test/resources/bad/wfchoice/enabling/threeparty/Test02.scr new file mode 100644 index 000000000..e8c6a7485 --- /dev/null +++ b/scribble-test/src/test/resources/bad/wfchoice/enabling/threeparty/Test02.scr @@ -0,0 +1,23 @@ +module bad.wfchoice.enabling.threeparty.Test02; + + +// Cf. good.wfchoice.gchoice.Choice11; +global protocol Proto1(role A, role B, role C) +{ + rec X + { + 1() from B to C; // bad enabling + choice at A + { + 1() from A to C; + continue X; + } + or + { + 2() from A to B; + 2() from A to C; + } + } +} + + diff --git a/scribble-test/src/test/resources/bad/wfchoice/enabling/threeparty/Test03a.scr b/scribble-test/src/test/resources/bad/wfchoice/enabling/threeparty/Test03a.scr new file mode 100644 index 000000000..54c18699f --- /dev/null +++ b/scribble-test/src/test/resources/bad/wfchoice/enabling/threeparty/Test03a.scr @@ -0,0 +1,28 @@ +module bad.wfchoice.enabling.threeparty.Test03a; + + +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + choice at B + { + 1() from B to C; + continue X; // choice at A, but A not enabled + } + or + { + 3() from B to C; + } + } + or + { + 2() from A to B; + 2() from B to C; + } + } +} + diff --git a/scribble-test/src/test/resources/bad/wfchoice/enabling/threeparty/Test03b.scr b/scribble-test/src/test/resources/bad/wfchoice/enabling/threeparty/Test03b.scr new file mode 100644 index 000000000..53548657b --- /dev/null +++ b/scribble-test/src/test/resources/bad/wfchoice/enabling/threeparty/Test03b.scr @@ -0,0 +1,31 @@ +module bad.wfchoice.enabling.threeparty.Test03b; + + +// Cf. module good.wfchoice.enabling.threeparty.Test03b; +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + choice at B + { + 1() from B to C; + continue X; + } + or + { + 3() from B to C; + continue X; + } + //continue X; + } + or + { + 2() from A to B; + 2() from B to C; + } + } +} + diff --git a/scribble-test/src/test/resources/bad/wfchoice/enabling/twoparty/Test01a.scr b/scribble-test/src/test/resources/bad/wfchoice/enabling/twoparty/Test01a.scr new file mode 100644 index 000000000..940aec221 --- /dev/null +++ b/scribble-test/src/test/resources/bad/wfchoice/enabling/twoparty/Test01a.scr @@ -0,0 +1,16 @@ +module bad.wfchoice.enabling.twoparty.Test01a; + + +global protocol Proto1(role A, role B, role C, role D) +{ + rec X + { + choice at A + { + 1() from A to B; + continue X; + } + 1() from C to D; // Enabled violation once unfolded + } +} + diff --git a/scribble-test/src/test/resources/bad/wfchoice/enabling/twoparty/Test01b.scr b/scribble-test/src/test/resources/bad/wfchoice/enabling/twoparty/Test01b.scr new file mode 100644 index 000000000..08f86130f --- /dev/null +++ b/scribble-test/src/test/resources/bad/wfchoice/enabling/twoparty/Test01b.scr @@ -0,0 +1,16 @@ +module bad.wfchoice.enabling.twoparty.Test01b; + + +global protocol Proto1(role A, role B, role C, role D) +{ + rec X + { + 1() from C to D; // Enabled violation once unfolded + choice at A + { + 1() from A to B; + continue X; + } + } +} + diff --git a/scribble-test/src/test/resources/bad/wfchoice/enabling/twoparty/Test01c.scr b/scribble-test/src/test/resources/bad/wfchoice/enabling/twoparty/Test01c.scr new file mode 100644 index 000000000..77cfc4127 --- /dev/null +++ b/scribble-test/src/test/resources/bad/wfchoice/enabling/twoparty/Test01c.scr @@ -0,0 +1,21 @@ +module bad.wfchoice.enabling.twoparty.Test01c; + + +global protocol Proto1(role A, role B, role C, role D) +{ + rec X + { + choice at A + { + 1() from A to B; + continue X; + } + or + { + 2() from A to B; + continue X; + } + 3() from C to D; // Enabled violation once unfolded + } +} + diff --git a/scribble-test/src/test/resources/bad/wfchoice/gchoice/Choice01.scr b/scribble-test/src/test/resources/bad/wfchoice/gchoice/Choice01.scr new file mode 100644 index 000000000..aff45c614 --- /dev/null +++ b/scribble-test/src/test/resources/bad/wfchoice/gchoice/Choice01.scr @@ -0,0 +1,14 @@ +module bad.wfchoice.gchoice.Choice01; + +global protocol Choice1(role A, role B) +{ + choice at A + { + l1() from A to B; + } + or + { + l1() from A to B; // Uncomment is bad + l2() from A to B; + } +} diff --git a/scribble-test/src/test/resources/bad/wfchoice/gchoice/Choice02.scr b/scribble-test/src/test/resources/bad/wfchoice/gchoice/Choice02.scr new file mode 100644 index 000000000..a05c1efbb --- /dev/null +++ b/scribble-test/src/test/resources/bad/wfchoice/gchoice/Choice02.scr @@ -0,0 +1,10 @@ +module bad.wfchoice.gchoice.Choice02; + +global protocol Choice2(role A, role B) +{ + choice at A + { + l1() from B to A; // Uncomment is bad + l1() from A to B; + } +} diff --git a/scribble-test/src/test/resources/bad/wfchoice/gchoice/Choice05a.scr b/scribble-test/src/test/resources/bad/wfchoice/gchoice/Choice05a.scr new file mode 100644 index 000000000..1ee8b348a --- /dev/null +++ b/scribble-test/src/test/resources/bad/wfchoice/gchoice/Choice05a.scr @@ -0,0 +1,32 @@ +module bad.wfchoice.gchoice.Choice05a; + + +global protocol Choice5a(role A, role B) +{ + choice at B + { + //l1() from B to A; // Comment is bad + choice at A + { + l1() from A to B; + } + or + { + l2() from A to B; + } + } + or + { + choice at B + { + l2() from B to A; + } + or + { + l3() from B to A; + //l2() from B to A; // Uncomment OK unless l3() is commented + //l1() from B to A; // Uncomment OK unless l3() is commented + } + } +} + diff --git a/scribble-test/src/test/resources/bad/wfchoice/gchoice/Choice05b.scr b/scribble-test/src/test/resources/bad/wfchoice/gchoice/Choice05b.scr new file mode 100644 index 000000000..daf3d5900 --- /dev/null +++ b/scribble-test/src/test/resources/bad/wfchoice/gchoice/Choice05b.scr @@ -0,0 +1,34 @@ +module bad.wfchoice.gchoice.Choice05b; + + +global protocol Choice5b(role A, role B) +{ + choice at B + { + l1() from B to A; // Comment is bad + choice at A + { + l1() from A to B; + } + or + { + l2() from A to B; + } + } + or + { + choice at B + { + l2() from B to A; + l3() from B to A; // Comment is still bad + } + or + { + //l3() from B to A; + l2() from B to A; // Uncomment OK unless l3() is commented + l4() from B to A; + //l1() from B to A; // Uncomment OK unless l3() is commented + } + } +} + diff --git a/scribble-test/src/test/resources/bad/wfchoice/gchoice/Choice05c.scr b/scribble-test/src/test/resources/bad/wfchoice/gchoice/Choice05c.scr new file mode 100644 index 000000000..1557e3fa9 --- /dev/null +++ b/scribble-test/src/test/resources/bad/wfchoice/gchoice/Choice05c.scr @@ -0,0 +1,32 @@ +module bad.wfchoice.gchoice.Choice05c; + + +global protocol Choice5c(role A, role B) +{ + choice at B + { + l1() from B to A; // Comment is bad + choice at A + { + l1() from A to B; + } + or + { + l2() from A to B; + } + } + or + { + choice at B + { + l2() from B to A; + } + or + { + //l3() from B to A; + //l2() from B to A; // Uncomment OK unless l3() is commented + l1() from B to A; // Uncomment OK unless l3() is commented + } + } +} + diff --git a/scribble-test/src/test/resources/bad/wfchoice/gchoice/Choice06.scr b/scribble-test/src/test/resources/bad/wfchoice/gchoice/Choice06.scr new file mode 100644 index 000000000..a8d23ffb3 --- /dev/null +++ b/scribble-test/src/test/resources/bad/wfchoice/gchoice/Choice06.scr @@ -0,0 +1,28 @@ +module bad.wfchoice.gchoice.Choice06; + + +global protocol Choice6(role A, role B) +{ + choice at A + { + l1() from A to B; + } + or + { + () from A to B; + } + l1() from A to B; + () from A to B; + choice at A + { + //l1() from A to B; // Comment is bad + () from A to B; + 2() from A to B; + } + or + { + () from A to B; + 3() from B to A; + } +} + diff --git a/scribble-test/src/test/resources/bad/wfchoice/gchoice/Choice08.scr b/scribble-test/src/test/resources/bad/wfchoice/gchoice/Choice08.scr new file mode 100644 index 000000000..a1261bbbe --- /dev/null +++ b/scribble-test/src/test/resources/bad/wfchoice/gchoice/Choice08.scr @@ -0,0 +1,21 @@ +module bad.wfchoice.gchoice.Choice08; + + +global protocol Choice8(role A, role B, role C) +{ + choice at A + { + l1() from A to B; + l2() from B to C; + //l4() from C to A; // Uncomment makes it OK + } + or + { + l2() from A to B; + //l1() from B to C; // Comment is bad + l2() from B to C; + l4() from C to A; + } + l4() from A to C; +} + diff --git a/scribble-test/src/test/resources/bad/wfchoice/gchoice/Choice09a.scr b/scribble-test/src/test/resources/bad/wfchoice/gchoice/Choice09a.scr new file mode 100644 index 000000000..7f719485a --- /dev/null +++ b/scribble-test/src/test/resources/bad/wfchoice/gchoice/Choice09a.scr @@ -0,0 +1,30 @@ +module bad.wfchoice.gchoice.Choice09a; + + +global protocol Proto1(role A, role B, role C) +{ + 3() from A to C; + rec Y + { + 2() from A to B; // Uncomment is bad (non-enabled B / non-disjoint labels) + 2a() from B to A; + rec X + { + 1() from A to B; + choice at A + { + 2() from A to B; + continue X; // Testing project choice subject "inference", and testing continue-only choice block + } + or + { + continue Y; // Different continue-only-blocks, tests FSM building + } + or + { + 4() from A to B; + } + } + } +} + diff --git a/scribble-test/src/test/resources/bad/wfchoice/gchoice/Choice09b.scr b/scribble-test/src/test/resources/bad/wfchoice/gchoice/Choice09b.scr new file mode 100644 index 000000000..4174eb06d --- /dev/null +++ b/scribble-test/src/test/resources/bad/wfchoice/gchoice/Choice09b.scr @@ -0,0 +1,34 @@ +module bad.wfchoice.gchoice.Choice09b; + + +global protocol Proto1(role A, role B, role C) +{ + 3() from A to C; + rec Y + { + 2() from A to B; // Uncomment is bad (non-enabled B / non-disjoint labels) + 2a() from B to A; + rec X + { + 1() from A to B; + choice at A + { + 2() from A to B; + continue X; // Testing project choice subject "inference", and testing continue-only choice block + } + or + { + continue X; + } + or + { + continue Y; // Different continue-only-blocks, tests FSM building + } + or + { + 4() from A to B; + } + } + } +} + diff --git a/scribble-test/src/test/resources/bad/wfchoice/gchoice/Choice09c.scr b/scribble-test/src/test/resources/bad/wfchoice/gchoice/Choice09c.scr new file mode 100644 index 000000000..c93ea8b2d --- /dev/null +++ b/scribble-test/src/test/resources/bad/wfchoice/gchoice/Choice09c.scr @@ -0,0 +1,34 @@ +module bad.wfchoice.gchoice.Choice09c; + + +global protocol Proto1(role A, role B, role C) +{ + 3() from A to C; + rec Y + { + 2() from A to B; // Uncomment is bad (non-enabled B / non-disjoint labels) + 2a() from B to A; + rec X + { + 1() from A to B; + choice at A + { + continue Y; // Different continue-only-blocks, tests FSM building + } + or + { + 2() from A to B; + continue X; // Testing project choice subject "inference", and testing continue-only choice block + } + or + { + continue X; + } + or + { + 4() from A to B; + } + } + } +} + diff --git a/scribble-test/src/test/resources/bad/wfchoice/gchoice/Choice10a.scr b/scribble-test/src/test/resources/bad/wfchoice/gchoice/Choice10a.scr new file mode 100644 index 000000000..af2cab667 --- /dev/null +++ b/scribble-test/src/test/resources/bad/wfchoice/gchoice/Choice10a.scr @@ -0,0 +1,32 @@ +module bad.wfchoice.gchoice.Choice10a; + + +global protocol Proto1(role A, role B) +{ + rec X + { + 1() from A to B; + choice at A + { + continue X; + } + or + { + rec Y + { + 2() from A to B; + choice at A + { + //continue X; + continue Y; + } + or + { + 2() from A to B; + } + } + } + } +} + + diff --git a/scribble-test/src/test/resources/bad/wfchoice/gchoice/Choice10b.scr b/scribble-test/src/test/resources/bad/wfchoice/gchoice/Choice10b.scr new file mode 100644 index 000000000..714fe692b --- /dev/null +++ b/scribble-test/src/test/resources/bad/wfchoice/gchoice/Choice10b.scr @@ -0,0 +1,31 @@ +module bad.wfchoice.gchoice.Choice10b; + + +global protocol Proto1(role A, role B) +{ + rec X + { + //1() from A to B; + choice at A + { + continue X; + } + or + { + rec Y + { + 2() from A to B; + choice at A + { + continue X; + } + or + { + 2() from A to B; + } + } + } + } +} + + diff --git a/scribble-test/src/test/resources/bad/wfchoice/gdo/params/Test01.scr b/scribble-test/src/test/resources/bad/wfchoice/gdo/params/Test01.scr new file mode 100644 index 000000000..d870c4ec2 --- /dev/null +++ b/scribble-test/src/test/resources/bad/wfchoice/gdo/params/Test01.scr @@ -0,0 +1,23 @@ +module bad.wfchoice.gdo.params.Test01; + + +global protocol Foo(role A, role B) +{ + choice at A + { + M1 from A to B; + 1() from A to B; + } + or + { + do Bar(A, B); + 2() from A to B; + } +} + + +aux global protocol Bar(role C, role D) +{ + M2 from C to D; +} + diff --git a/scribble-test/src/test/resources/bad/wfchoice/gdo/params/Test02.scr b/scribble-test/src/test/resources/bad/wfchoice/gdo/params/Test02.scr new file mode 100644 index 000000000..0d95bbf07 --- /dev/null +++ b/scribble-test/src/test/resources/bad/wfchoice/gdo/params/Test02.scr @@ -0,0 +1,23 @@ +module bad.wfchoice.gdo.params.Test02; + + +global protocol Foo(role A, role B) +{ + choice at A + { + 1() from A to B; + 2() from B to A; + } + or + { + do Bar<1()>(A, B); + 3() from B to A; + } +} + + +aux global protocol Bar(role C, role D) +{ + M from C to D; +} + diff --git a/scribble-test/src/test/resources/bad/wfchoice/gdo/params/Test03.scr b/scribble-test/src/test/resources/bad/wfchoice/gdo/params/Test03.scr new file mode 100644 index 000000000..0ab414bae --- /dev/null +++ b/scribble-test/src/test/resources/bad/wfchoice/gdo/params/Test03.scr @@ -0,0 +1,25 @@ +module bad.wfchoice.gdo.params.Test03; + + +sig "foo" from "bar" as M1; + + +global protocol Foo(role A, role B) +{ + choice at A + { + M1 from A to B; + } + or + { + do Bar(A, B); + do Bar<1()>(A, B); + } +} + + +aux global protocol Bar(role A, role B) +{ + M from A to B; +} +//*/ diff --git a/scribble-test/src/test/resources/bad/wfchoice/merge/Test01.scr b/scribble-test/src/test/resources/bad/wfchoice/merge/Test01.scr new file mode 100644 index 000000000..33640a0c4 --- /dev/null +++ b/scribble-test/src/test/resources/bad/wfchoice/merge/Test01.scr @@ -0,0 +1,21 @@ +module bad.wfchoice.merge.Test01; + + +global protocol Proto1(role A, role B, role C) +{ + // Would be OK with "syntactic merge", but currently bad wrt. basic non-det interpretation + choice at A + { + 1() from A to B; + 2() from B to C; + 4() from A to C; + } + or + { + 3() from A to B; + 2() from B to C; + 5() from A to C; + } +} + + diff --git a/scribble-test/src/test/resources/bad/wfchoice/oldwfchoice/IGNORE b/scribble-test/src/test/resources/bad/wfchoice/oldwfchoice/IGNORE new file mode 100644 index 000000000..e69de29bb diff --git a/scribble-test/src/test/resources/bad/wfchoice/oldwfchoice/globals/gchoice/Choice05b.scr b/scribble-test/src/test/resources/bad/wfchoice/oldwfchoice/globals/gchoice/Choice05b.scr new file mode 100644 index 000000000..0777ac447 --- /dev/null +++ b/scribble-test/src/test/resources/bad/wfchoice/oldwfchoice/globals/gchoice/Choice05b.scr @@ -0,0 +1,35 @@ +module bad.oldwfchoice.gchoice.Choice05b; + + +// Bad only for -oldwf; good by default +global protocol Choice5b(role A, role B) +{ + choice at B + { + l1() from B to A; // Comment is bad + choice at A + { + l1() from A to B; + } + or + { + l2() from A to B; + } + } + or + { + choice at B + { + l2() from B to A; + //l3() from B to A; // Comment is still bad + } + or + { + ////l3() from B to A; + l2() from B to A; // Uncomment OK unless l3() is commented + //l4() from B to A; + ////l1() from B to A; // Uncomment OK unless l3() is commented + } + } +} + diff --git a/scribble-test/src/test/resources/bad/wfchoice/oldwfchoice/globals/gchoice/Choice06.scr b/scribble-test/src/test/resources/bad/wfchoice/oldwfchoice/globals/gchoice/Choice06.scr new file mode 100644 index 000000000..13610941c --- /dev/null +++ b/scribble-test/src/test/resources/bad/wfchoice/oldwfchoice/globals/gchoice/Choice06.scr @@ -0,0 +1,28 @@ +module bad.wfchoice.oldwfchoice.gchoice.Choice06; + + +global protocol Choice6(role A, role B) +{ + choice at A + { + l1() from A to B; + } + or + { + () from A to B; + } + l1() from A to B; + () from A to B; + choice at A + { + ////l1() from A to B; // Comment is bad + () from A to B; + //2() from A to B; + } + or + { + () from A to B; + //3() from B to A; + } +} + diff --git a/scribble-test/src/test/resources/bad/wfchoice/oldwfchoice/globals/gchoice/Choice08.scr b/scribble-test/src/test/resources/bad/wfchoice/oldwfchoice/globals/gchoice/Choice08.scr new file mode 100644 index 000000000..e6b108450 --- /dev/null +++ b/scribble-test/src/test/resources/bad/wfchoice/oldwfchoice/globals/gchoice/Choice08.scr @@ -0,0 +1,21 @@ +module bad.wfchoice.oldwfchoice.gchoice.Choice08; + + +global protocol Choice8(role A, role B, role C) +{ + choice at A + { + l1() from A to B; + l2() from B to C; + ////l4() from C to A; // Uncomment makes it OK + } + or + { + l2() from A to B; + ////l1() from B to C; // Comment is bad + l2() from B to C; + //l4() from C to A; + } + l2() from C to A; +} + diff --git a/scribble-test/src/test/resources/bad/wfchoice/oldwfchoice/globals/gchoice/Choice09.scr b/scribble-test/src/test/resources/bad/wfchoice/oldwfchoice/globals/gchoice/Choice09.scr new file mode 100644 index 000000000..20c262d3f --- /dev/null +++ b/scribble-test/src/test/resources/bad/wfchoice/oldwfchoice/globals/gchoice/Choice09.scr @@ -0,0 +1,19 @@ +module bad.wfchoice.oldwfchoice.gchoice.Choice09; + + +global protocol Foo(role A, role B) +{ + choice at A + { + 1() from A to B; + } + or + { + 2() from A to B; + } + or + { + 2() from A to B; + } +} + diff --git a/scribble-test/src/test/resources/bad/wfchoice/oldwfchoice/globals/gchoice/Choice10.scr b/scribble-test/src/test/resources/bad/wfchoice/oldwfchoice/globals/gchoice/Choice10.scr new file mode 100644 index 000000000..be27df308 --- /dev/null +++ b/scribble-test/src/test/resources/bad/wfchoice/oldwfchoice/globals/gchoice/Choice10.scr @@ -0,0 +1,34 @@ +module bad.wfchoice.oldwfchoice.gchoice.Choice10; + + +global protocol Proto1(role A, role B, role C) +{ + 3() from A to C; + rec Y + { + () from A to B; + 2a() from B to A; + rec X + { + 1() from A to B; + choice at A + { + //2() from A to B; + continue X; // Testing project choice subject "inference", and testing continue-only choice block + } + or + { + continue X; + } + or + { + continue Y; // Different continue-only-blocks, tests FSM building + } + or + { + 4() from A to B; + } + } + } +} + diff --git a/scribble-test/src/test/resources/good/efsm/gchoice/Test02.scr b/scribble-test/src/test/resources/good/efsm/gchoice/Test02.scr new file mode 100644 index 000000000..e9b379c7b --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/gchoice/Test02.scr @@ -0,0 +1,18 @@ +module good.efsm.gchoice.Test02; + + +global protocol Foo(role A, role B) +{ + 0() from A to B; + choice at A + { + 1a() from A to B; + } + or + { + 2a() from A to B; + 2b() from B to A; + } + 3() from B to A; +} + diff --git a/scribble-test/src/test/resources/good/efsm/gchoice/Test03.scr b/scribble-test/src/test/resources/good/efsm/gchoice/Test03.scr new file mode 100644 index 000000000..ebd95ff38 --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/gchoice/Test03.scr @@ -0,0 +1,22 @@ +module good.efsm.gchoice.Test03; + + +global protocol Foo(role A, role B) +{ + choice at A // unary choice with continuation + { + 1() from A to B; + } + rec X + { + choice at A + { + 2() from A to B; + continue X; + } + or + { + 3() from A to B; + } + } +} diff --git a/scribble-test/src/test/resources/good/efsm/gchoice/Test09.scr b/scribble-test/src/test/resources/good/efsm/gchoice/Test09.scr new file mode 100644 index 000000000..c67f743bb --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/gchoice/Test09.scr @@ -0,0 +1,22 @@ +//$ bin/scribblec.sh scribble-test/src/test/resources/good/efsm/gchoice/Test09.scr + +module good.efsm.gchoice.Test09; + + +global protocol Foo(role A, role B) +{ + rec X + { + choice at A + { + 1() from A to B; + } + or + { + 1() from A to B; + } + continue X; // Testing recursion edge replacement cornercase (length 1 non-det choice paths are merged as a single case) + } +} + + diff --git a/scribble-test/src/test/resources/good/efsm/gchoice/Test10.scr b/scribble-test/src/test/resources/good/efsm/gchoice/Test10.scr new file mode 100644 index 000000000..478ad2ac0 --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/gchoice/Test10.scr @@ -0,0 +1,39 @@ +module good.efsm.gchoice.Test10; + + +global protocol Proto1(role A, role B) +{ + rec X + { + choice at A + { + 1() from A to B; + } + or + { + 2() from A to B; + choice at B + { + 2() from B to A; + continue X; + } + or + { + 4a() from B to A; + } + or + { + 4b() from B to A; + } + } + } + choice at A + { + 3a() from A to B; + } + or { + 3b() from A to B; + } +} + + diff --git a/scribble-test/src/test/resources/good/efsm/gchoice/Test11.scr b/scribble-test/src/test/resources/good/efsm/gchoice/Test11.scr new file mode 100644 index 000000000..e7ca4ccd1 --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/gchoice/Test11.scr @@ -0,0 +1,16 @@ +module good.efsm.gchoice.Test11; + + +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + choice at B + { + 2() from B to C; // Graph building (popping choice block into a null parent choice block context) + } + } +} + + diff --git a/scribble-test/src/test/resources/good/efsm/gchoice/Test12a.scr b/scribble-test/src/test/resources/good/efsm/gchoice/Test12a.scr new file mode 100644 index 000000000..d7a3d130a --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/gchoice/Test12a.scr @@ -0,0 +1,20 @@ +module good.efsm.gchoice.Test12a; + + +global protocol Proto1(role A, role B) +{ + rec X + { + choice at A + { + 1() from A to B; + } + or + { + 2() from A to B; + } + continue X; // EFSM building -- multiple predecessors for continue-edge replacement + } +} + + diff --git a/scribble-test/src/test/resources/good/efsm/gchoice/Test12b.scr b/scribble-test/src/test/resources/good/efsm/gchoice/Test12b.scr new file mode 100644 index 000000000..37ef3ac75 --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/gchoice/Test12b.scr @@ -0,0 +1,23 @@ +module good.efsm.gchoice.Test12b; + + +global protocol Proto1(role A, role B, role C) +{ + rec X + { + 0() from A to B; + 0() from B to C; + choice at A + { + 1() from A to B; + 1() from B to C; + } + or + { + 2() from A to B; + 2() from B to C; + } + continue X; // EFSM building -- multiple predecessors for continue-edge replacement + } +} + diff --git a/scribble-test/src/test/resources/good/efsm/gchoice/Test13.scr b/scribble-test/src/test/resources/good/efsm/gchoice/Test13.scr new file mode 100644 index 000000000..46be3d259 --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/gchoice/Test13.scr @@ -0,0 +1,30 @@ +module good.efsm.gchoice.Test13; + + +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + choice at B + { + 1() from B to A; + 1() from A to C; + } + } + or + { + 2() from A to B; + choice at B + { + 2() from B to A; + 2() from A to C; + } + } + continue X; // EFSM building -- multiple predecessors for continue-edge replacement + } +} + + diff --git a/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test01a.scr b/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test01a.scr new file mode 100644 index 000000000..ba6f3a0eb --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test01a.scr @@ -0,0 +1,21 @@ +module good.efsm.gcontinue.choiceunguarded.Test01a; + + +// Cf. -minfsm +global protocol Proto1(role A, role B) +{ + rec X + { + 1() from A to B; + choice at A + { + continue X; // Not "isomorphic" to a single continue X, because (in general) non-det not bisim equiv (cf. language equiv) -- so no "syntatic collapse" to single case + } + or + { + continue X; + } + } +} + + diff --git a/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test01b.scr b/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test01b.scr new file mode 100644 index 000000000..e004a283c --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test01b.scr @@ -0,0 +1,22 @@ +module good.efsm.gcontinue.choiceunguarded.Test01b; + + +// Cf. -minfsm +global protocol Proto1(role A, role B) +{ + rec X + { + 1() from A to B; + choice at A + { + continue X; + } + or + { + 2() from A to B; + continue X; + } + } +} + + diff --git a/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test01c.scr b/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test01c.scr new file mode 100644 index 000000000..ddbbe13b2 --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test01c.scr @@ -0,0 +1,15 @@ +module good.efsm.gcontinue.choiceunguarded.Test01c; + + +global protocol Proto1(role A, role B) +{ + rec X + { + 1() from A to B; + choice at A + { + continue X; + } + } +} + diff --git a/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test02a.scr b/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test02a.scr new file mode 100644 index 000000000..fdd63ed7d --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test02a.scr @@ -0,0 +1,23 @@ +module good.efsm.gcontinue.choiceunguarded.Test02a; + + +global protocol Proto1(role A, role B) +{ + rec Y + { + 0() from A to B; + rec X + { + 1() from A to B; + choice at A // Testing multi-rec enacting states in intermediate continue-edge fixing + { + continue X; + } + or + { + continue Y; + } + } + } +} + diff --git a/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test02b.scr b/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test02b.scr new file mode 100644 index 000000000..22ca333c7 --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test02b.scr @@ -0,0 +1,23 @@ +module good.efsm.gcontinue.choiceunguarded.Test02b; + + +global protocol Proto1(role A, role B) +{ + rec Y + { + 0() from A to B; + rec X + { + 1() from A to B; + choice at A // Testing multi-rec enacting states in intermediate continue-edge fixing + { + continue Y; + } + or + { + continue X; + } + } + } +} + diff --git a/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test02c.scr b/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test02c.scr new file mode 100644 index 000000000..a8baec5ea --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test02c.scr @@ -0,0 +1,27 @@ +module good.efsm.gcontinue.choiceunguarded.Test02c; + + +global protocol Proto1(role A, role B) +{ + rec Y + { + 0() from A to B; + rec X + { + 1() from A to B; + choice at A // Testing multi-rec enacting states in intermediate continue-edge fixing + { + continue X; + } + or + { + continue X; + } + or + { + continue Y; + } + } + } +} + diff --git a/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test02d.scr b/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test02d.scr new file mode 100644 index 000000000..2bc56c1ac --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test02d.scr @@ -0,0 +1,27 @@ +module good.efsm.gcontinue.choiceunguarded.Test02d; + + +global protocol Proto1(role A, role B) +{ + rec Y + { + 0() from A to B; + rec X + { + 1() from A to B; + choice at A // Testing multi-rec enacting states in intermediate continue-edge fixing + { + continue X; + } + or + { + continue Y; + } + or + { + continue X; + } + } + } +} + diff --git a/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test03.scr b/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test03.scr new file mode 100644 index 000000000..393a754ee --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test03.scr @@ -0,0 +1,27 @@ +module good.efsm.gcontinue.choiceunguarded.Test03; + + +global protocol Proto1(role A, role B) +{ + rec Y + { + 0() from A to B; + rec X + { + 1() from A to B; + choice at A + { + continue X; // Check FSM building + } + or + { + 2() from A to B; + } + or + { + continue Y; + } + } + } +} + diff --git a/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test04.scr b/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test04.scr new file mode 100644 index 000000000..178dfa1cc --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test04.scr @@ -0,0 +1,23 @@ +module good.efsm.gcontinue.choiceunguarded.Test04; + + +global protocol Proto1(role A, role B) +{ + rec X + { + 0() from A to B; + choice at A + { + //1() from A to B; + continue X; + } + or + { + 2() from A to B; + //continue X; + } + } + 3() from A to B; +} + + diff --git a/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test05a.scr b/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test05a.scr new file mode 100644 index 000000000..509665050 --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test05a.scr @@ -0,0 +1,23 @@ +module good.efsm.gcontinue.choiceunguarded.Test05a; + + +global protocol Proto1(role A, role B, role C) +{ + rec X + { + 1() from A to B; + 2() from B to C; + choice at C + { + 3() from C to A; + continue X; // Projected as recursive non-det choice for B + } + or + { + 4() from C to A; + continue X; + } + } +} + + diff --git a/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test05b.scr b/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test05b.scr new file mode 100644 index 000000000..d1985ba0a --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test05b.scr @@ -0,0 +1,26 @@ +module good.efsm.gcontinue.choiceunguarded.Test05b; + + +global protocol Proto1(role A, role B, role C) +{ + rec X + { + rec Y + { + 1() from A to B; + 2() from B to C; + choice at C + { + 3() from C to A; + continue X; + } + or + { + 4() from C to A; + continue Y; + } + } + } +} + + diff --git a/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test06.scr b/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test06.scr new file mode 100644 index 000000000..9120b3691 --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test06.scr @@ -0,0 +1,21 @@ +module good.efsm.gcontinue.choiceungaurded.Test06; + + +global protocol Proto1(role A, role B) +{ + 1() from A to B; + rec X + { + 2() from A to B; + 3() from A to B; + choice at A + { + continue X; + } + or + { + 4() from A to B; + } + } +} + diff --git a/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test07a.scr b/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test07a.scr new file mode 100644 index 000000000..6a6edba32 --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test07a.scr @@ -0,0 +1,27 @@ +module good.efsm.gcontinue.choiceungaurded.Test07a; + + +global protocol Proto1(role A, role B) +{ + rec X + { + choice at A // Testing EFSM building rec with multiple "enactings" + { + 3() from A to B; + choice at A + { + //1() from A to B; + continue X; // (and choice-unguarded continue) + } + or + { + 6() from A to B; + } + } + or + { + 4() from A to B; + } + } +} + diff --git a/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test07b.scr b/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test07b.scr new file mode 100644 index 000000000..09f123b1e --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test07b.scr @@ -0,0 +1,35 @@ +module good.efsm.gcontinue.choiceungaurded.Test07b; + + +global protocol Proto1(role A, role B) +{ + rec X + { + choice at A // Testing EFSM building rec with multiple "enactings" + { + 3() from A to B; + choice at A + { + choice at A + { + 1() from A to B; + continue X; + } + or + { + //2() from A to B; + continue X; // (and choice-unguarded continue) + } + } + or + { + 6() from A to B; + } + } + or + { + 4() from A to B; + } + } +} + diff --git a/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test07c.scr b/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test07c.scr new file mode 100644 index 000000000..e07d2042c --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test07c.scr @@ -0,0 +1,35 @@ +module good.efsm.gcontinue.choiceungaurded.Test07c; + + +global protocol Proto1(role A, role B) +{ + rec X + { + choice at A // Testing EFSM building rec with multiple "enactings" + { + 3() from A to B; + choice at A + { + choice at A + { + 1() from A to B; + continue X; + } + or + { + 2() from A to B; + continue X; + } + } + or + { + 6() from A to B; + } + } + or + { + 4() from A to B; + } + } +} + diff --git a/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test08.scr b/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test08.scr new file mode 100644 index 000000000..dc22bfe00 --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/gcontinue/choiceunguarded/Test08.scr @@ -0,0 +1,26 @@ +module good.efsm.gcontinue.choiceungaurded.Test08; + + +global protocol Proto1(role A, role B) +{ + rec X + { + choice at A + { + 1() from A to B; + choice at A + { + continue X; + } + or + { + 3() from A to B; + } + } + or + { + 2() from A to B; // Testing EFSM building: multiple "enacting" + } + } +} + diff --git a/scribble-test/src/test/resources/good/efsm/gdo/Test01.scr b/scribble-test/src/test/resources/good/efsm/gdo/Test01.scr new file mode 100644 index 000000000..1ffe8e88c --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/gdo/Test01.scr @@ -0,0 +1,34 @@ +//$ bin/scribblec.sh -ip modules/core/src/test/scrib/ modules/cli/src/test/resources/good/efsm/gdo/Test01.scr -fsm Bar1 C + +module good.efsm.gdo.Test01; + + +// Test inlined protocol unfolding -- unguarded rec and continue under choice +global protocol Foo(role A, role B) +{ + 1() from A to B; + choice at A + { + do Bar1(A, B); + } + or + { + do Bar2(A, B); + } + or + { + 4() from A to B; + } +} + +global protocol Bar1(role C, role D) // <- As root, check choice inside Foo is unfolded correctly wrt. unguarded continue for Bar1 case +{ + 2() from C to D; + do Foo(C, D); +} + +global protocol Bar2(role C, role D) +{ + 5() from C to D; + do Bar2(C, D); +} diff --git a/scribble-test/src/test/resources/good/efsm/gdo/Test04.scr b/scribble-test/src/test/resources/good/efsm/gdo/Test04.scr new file mode 100644 index 000000000..5c1c00460 --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/gdo/Test04.scr @@ -0,0 +1,24 @@ +module good.efsm.gdo.Test04; + + +global protocol Foo(role A, role B) +{ + 1() from A to B; + choice at A + { + 2() from A to B; + do Bar(A, B); + } + or + { + 4() from A to B; + } +} + + +aux global protocol Bar(role A, role B) +{ + 3() from B to A; + do Foo(B, A); // Roles reversed +} + diff --git a/scribble-test/src/test/resources/good/efsm/gdo/Test06.scr b/scribble-test/src/test/resources/good/efsm/gdo/Test06.scr new file mode 100644 index 000000000..68db9cdb6 --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/gdo/Test06.scr @@ -0,0 +1,26 @@ +module good.efsm.gdo.Test06; + + +global protocol Foo(role A, role B) +{ + 2() from A to B; + choice at A + { + 1() from A to B; + } + or + { + do Foo2(A, B); // Direct result is non-minimal EFSM + } +} + +global protocol Foo2(role A, role B) +{ + do Foo3(A, B); +} + +global protocol Foo3(role A, role B) +{ + do Foo(A, B); +} + diff --git a/scribble-test/src/test/resources/good/efsm/gdo/Test07.scr b/scribble-test/src/test/resources/good/efsm/gdo/Test07.scr new file mode 100644 index 000000000..331f29fb1 --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/gdo/Test07.scr @@ -0,0 +1,36 @@ +module good.efsm.gdo.Test07; + + +// Similar to good.efsm.gdo.Test01 +global protocol Foo(role A, role B) +{ + 1() from A to B; + choice at A + { + do Bar1(A, B); + } + or + { + do Bar2(A, B); // Graph building done on unfolded-inlined (the static unfolding -- here: Bar2 rec is unguarded) // Cf. not the "dynamic" unfolding visiting + } + or + { + 5() from A to B; + } +} + +// The Bar1 inlined rec for root Foo gets "dropped" by unguarded unfolding because no continue for this rec +aux global protocol Bar1(role A, role B) +{ + 2() from A to B; + 3() from B to A; + do Foo(A, B); +} + +// For root Foo, Bar2 inlined as unguarded rec, then gets unfolded +aux global protocol Bar2(role A, role B) +{ + 4() from A to B; + do Bar2(A, B); +} + diff --git a/scribble-test/src/test/resources/good/efsm/gdo/Test08a.scr b/scribble-test/src/test/resources/good/efsm/gdo/Test08a.scr new file mode 100644 index 000000000..555096fc2 --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/gdo/Test08a.scr @@ -0,0 +1,24 @@ +module good.efsm.gdo.Test08a; + + +global protocol Foo(role A, role B) +{ + 1() from A to B; + choice at A + { + 2() from A to B; + do Bar(A, B); + } + or + { + 1() from A to B; + 2() from A to B; + } +} + + +aux global protocol Bar(role A, role B) +{ + //3() from A to B; + do Foo(A, B); +} diff --git a/scribble-test/src/test/resources/good/efsm/gdo/Test08b.scr b/scribble-test/src/test/resources/good/efsm/gdo/Test08b.scr new file mode 100644 index 000000000..b59bf424b --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/gdo/Test08b.scr @@ -0,0 +1,21 @@ +module good.efsm.gdo.Test08b; + + +global protocol Foo(role A, role B) +{ + 1() from A to B; + choice at A + { + do Bar(A, B); + } + or + { + 2() from A to B; + } +} + + +aux global protocol Bar(role A, role B) +{ + do Foo(A, B); +} diff --git a/scribble-test/src/test/resources/good/efsm/gdo/Test10.scr b/scribble-test/src/test/resources/good/efsm/gdo/Test10.scr new file mode 100644 index 000000000..7955f57e7 --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/gdo/Test10.scr @@ -0,0 +1,34 @@ +module good.efsm.gdo.Test10; + + +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + do Proto1Aux1(A, B, C); + } + or + { + do Proto1Aux2(A, B, C); + } +} + +aux global protocol Proto1Aux1(role A, role B, role C) +{ + choice at A + { + 3() from A to B; + 3() from A to C; + do Proto1Aux1(A, B, C); + } +} + +aux global protocol Proto1Aux2(role A, role B, role C) +{ + choice at A + { + 2() from A to B; + do Proto1Aux1(A, B, C); + } +} + diff --git a/scribble-test/src/test/resources/good/efsm/gdo/Test11.scr b/scribble-test/src/test/resources/good/efsm/gdo/Test11.scr new file mode 100644 index 000000000..482f910a5 --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/gdo/Test11.scr @@ -0,0 +1,38 @@ +module good.efsm.gdo.Test11; + + +global protocol Proto1(role A, role B, role C) +{ + 1() from A to B; + do Proto1Aux1(A, B, C); +} + +aux global protocol Proto1Aux1(role A, role B, role C) +{ + choice at A + { + 3() from A to B; + 3() from B to C; + do Proto1Aux2(A, B, C); + } + or + { + 4() from A to B; + 4() from B to C; + } +} + +aux global protocol Proto1Aux2(role A, role B, role C) +{ + choice at A + { + 5() from A to B; + do Proto1Aux1(A, B, C); // Testing graph building (C vs. A/B) + } + or + { + 6() from A to B; + 6() from B to C; + } +} + diff --git a/scribble-test/src/test/resources/good/efsm/gdo/Test12.scr b/scribble-test/src/test/resources/good/efsm/gdo/Test12.scr new file mode 100644 index 000000000..fdb90c64e --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/gdo/Test12.scr @@ -0,0 +1,21 @@ +module good.efsm.gdo.Test12; + + +global protocol Proto1(role A, role B) +{ + 1() from A to B; + do Proto1Aux1(A, B); +} + + +aux global protocol Proto1Aux1(role A, role B) +{ + choice at A + { + do Proto1(A, B); + } + or + { + 2() from A to B; + } +} diff --git a/scribble-test/src/test/resources/good/efsm/gdo/Test13a.scr b/scribble-test/src/test/resources/good/efsm/gdo/Test13a.scr new file mode 100644 index 000000000..625d60a84 --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/gdo/Test13a.scr @@ -0,0 +1,33 @@ +module good.efsm.gdo.Test13a; + + +global protocol Proto1(role A, role B) +{ + 1() from A to B; + choice at B + { + do Proto1Aux1(A, B); + } + or + { + do Proto1Aux2(A, B); + } + or + { + 4() from B to A; + } +} + +global protocol Proto1Aux1(role A, role B) +{ + 2() from B to A; + do Proto1(A, B); +} + +aux global protocol Proto1Aux2(role A, role B) +{ + 3() from B to A; + //do Proto1(A, B); + do Proto1Aux2(A, B); +} + diff --git a/scribble-test/src/test/resources/good/efsm/gdo/Test13b.scr b/scribble-test/src/test/resources/good/efsm/gdo/Test13b.scr new file mode 100644 index 000000000..5228ddf4b --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/gdo/Test13b.scr @@ -0,0 +1,32 @@ +module good.efsm.gdo.Test13b; + + +global protocol Proto1(role A, role B) +{ + 1() from A to B; + choice at B + { + do Proto1Aux1(A, B); + } + or + { + do Proto1Aux2(A, B); + } + or + { + 4() from B to A; + } +} + +global protocol Proto1Aux1(role A, role B) +{ + 2() from B to A; + do Proto1(A, B); +} + +aux global protocol Proto1Aux2(role A, role B) +{ + 3() from B to A; + do Proto1(A, B); +} + diff --git a/scribble-test/src/test/resources/good/efsm/grecursion/Test03.scr b/scribble-test/src/test/resources/good/efsm/grecursion/Test03.scr new file mode 100644 index 000000000..e2b4a2380 --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/grecursion/Test03.scr @@ -0,0 +1,22 @@ +module good.efsm.grecursion.Test03; + + +global protocol Foo(role A, role B) +{ + 0() from A to B; + rec X + { + choice at A + { + 1() from A to B; + 2() from B to A; + continue X; + } + or + { + 3() from A to B; + } + } + 4() from A to B; +} + diff --git a/scribble-test/src/test/resources/good/efsm/grecursion/Test05.scr b/scribble-test/src/test/resources/good/efsm/grecursion/Test05.scr new file mode 100644 index 000000000..be489440d --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/grecursion/Test05.scr @@ -0,0 +1,30 @@ +module good.efsm.grecursion.Test05; + + +global protocol Foo(role A, role B) +{ + 1() from A to B; + 2() from B to A; + choice at B + { + 3() from B to A; + } + or + { + 4() from B to A; + } + rec X + { + choice at A + { + 5() from A to B; + 6() from B to A; + continue X; + } + or + { + 6() from A to B; + } + } +} + diff --git a/scribble-test/src/test/resources/good/efsm/grecursion/Test06b.scr b/scribble-test/src/test/resources/good/efsm/grecursion/Test06b.scr new file mode 100644 index 000000000..f5584dfbc --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/grecursion/Test06b.scr @@ -0,0 +1,24 @@ +module good.efsm.grecursion.Test06b; + + +global protocol Foo(role A, role B) +{ + rec X + { + 1() from A to B; + choice at A + { + 4() from A to B; + rec Y + { + 3() from A to B; + continue X; + } + } + or + { + 2() from A to B; + } + } +} + diff --git a/scribble-test/src/test/resources/good/efsm/grecursion/Test07.scr b/scribble-test/src/test/resources/good/efsm/grecursion/Test07.scr new file mode 100644 index 000000000..70df9b0c6 --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/grecursion/Test07.scr @@ -0,0 +1,40 @@ +module good.efsm.grecursion.Test07; + + +global protocol Foo(role C, role S) +{ + rec XXX + { + choice at C + { + 1() from C to S; + } + or + { + LIST() from C to S; + choice at S + { + OK() from S to C; + rec summary_choice_list + { + choice at S + { + DOT() from S to C; + } + or + { + SUM() from S to C; + continue summary_choice_list; + } + } + } + or + { + ERR() from S to C; + } + continue XXX; // Testing graph building (updating predecessor state, when edges removed to be replaced by actual recursion edge) -- continue sequenced after a nested choice-continue: removing prev edge needs to remove pred state, and adding recursion edge should not add pred state + } + } +} + + diff --git a/scribble-test/src/test/resources/good/efsm/grecursion/Test08.scr b/scribble-test/src/test/resources/good/efsm/grecursion/Test08.scr new file mode 100644 index 000000000..ad96db7bf --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/grecursion/Test08.scr @@ -0,0 +1,23 @@ +module good.efsm.grecursion.Test08; + + +global protocol Foo(role A, role B) +{ + rec X + { + rec Y + { + choice at A + { + 1() from A to B; + } + or + { + 2() from A to B; + continue Y; // Testing graph building (updating predecessor state, when edges removed to be replaced by actual recursion edge) -- continue sequenced after a nested choice-continue: removing prev edge needs to remove pred state, and adding recursion edge should not add pred state + } + } + continue X; + } +} + diff --git a/scribble-test/src/test/resources/good/efsm/grecursion/Test09.scr b/scribble-test/src/test/resources/good/efsm/grecursion/Test09.scr new file mode 100644 index 000000000..901da6aaa --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/grecursion/Test09.scr @@ -0,0 +1,39 @@ +//$ bin/scribblec.sh scribble-test/src/test/resources/good/efsm/grecursion/Test09.scr -project Proto1 C + + +module good.efsm.grecursion.Test09; + + +global protocol Proto1(role A, role B, role C) +{ + 1() from A to B; + 2() from A to C; + rec X + { + choice at A + { + 3() from A to B; + } + choice at A + { + rec Y + { + choice at A + { + 3() from A to B; + continue X; + } + or + { + 4() from A to B; + continue Y; + } + or + { + 5() from A to B; + } + } + } + } +} + diff --git a/scribble-test/src/test/resources/good/efsm/grecursion/Test10.scr b/scribble-test/src/test/resources/good/efsm/grecursion/Test10.scr new file mode 100644 index 000000000..9cbcfbfa0 --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/grecursion/Test10.scr @@ -0,0 +1,16 @@ +module good.efsm.grecursion.Test10; + + +global protocol Proto1(role A, role B) +{ + choice at A + { + 1() from A to B; + rec X // Testing EFSM building, "enabling" stack push/pop for rec inside choice + { + 2() from B to A; + continue X; + } + } +} + diff --git a/scribble-test/src/test/resources/good/efsm/grecursion/Test11a.scr b/scribble-test/src/test/resources/good/efsm/grecursion/Test11a.scr new file mode 100644 index 000000000..f72d61dba --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/grecursion/Test11a.scr @@ -0,0 +1,26 @@ +module good.efsm.grecursion.Test11a; + + +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + choice at B + { + 2() from B to A; + 4() from B to C; // Testing EFSM building + continue X; + } + or + { + 3() from B to A; + 4() from B to C; + continue X; + } + } + } +} + diff --git a/scribble-test/src/test/resources/good/efsm/grecursion/Test12.scr b/scribble-test/src/test/resources/good/efsm/grecursion/Test12.scr new file mode 100644 index 000000000..55463b8b6 --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/grecursion/Test12.scr @@ -0,0 +1,12 @@ +module good.efsm.grecursion.Test12; + + +global protocol Proto1(role A, role B) +{ + rec X + { + 1() from A to B; + continue X; // Test graph building: EndpointGraph null exit (no term) + } +} + diff --git a/scribble-test/src/test/resources/good/efsm/grecursion/choiceunguarded/Test04.scr b/scribble-test/src/test/resources/good/efsm/grecursion/choiceunguarded/Test04.scr new file mode 100644 index 000000000..86671dc16 --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/grecursion/choiceunguarded/Test04.scr @@ -0,0 +1,25 @@ +module good.efsm.grecursion.choiceunguarded.Test04; + + +// Same as good.syntax.inlinedunfolding.grecursion.Test04; +global protocol Proto4(role A, role B) +{ + choice at A + { + rec X + { + choice at A + { + 1() from A to B; + continue X; + } + or + { + 2() from A to B; + continue X; + } + } + } +} + + diff --git a/scribble-test/src/test/resources/good/efsm/grecursion/choiceunguarded/Test06a.scr b/scribble-test/src/test/resources/good/efsm/grecursion/choiceunguarded/Test06a.scr new file mode 100644 index 000000000..fdcafb08c --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/grecursion/choiceunguarded/Test06a.scr @@ -0,0 +1,23 @@ +module good.efsm.grecursion.choiceunguarded.Test06a; + + +global protocol Foo(role A, role B) +{ + rec X + { + 1() from A to B; + choice at A + { + rec Y + { + 3() from A to B; + continue X; + } + } + or + { + 2() from A to B; + } + } +} + diff --git a/scribble-test/src/test/resources/good/efsm/grecursion/choiceunguarded/Test07.scr b/scribble-test/src/test/resources/good/efsm/grecursion/choiceunguarded/Test07.scr new file mode 100644 index 000000000..4f5773ff8 --- /dev/null +++ b/scribble-test/src/test/resources/good/efsm/grecursion/choiceunguarded/Test07.scr @@ -0,0 +1,24 @@ +module good.efsm.grecursion.choiceunguarded.Test07; + + +global protocol Proto1(role A, role B) +{ + rec X + { + 0() from A to B; + choice at A + { + rec X // Checking FSM generation -- unfolding of unguarded shadowed choice-rec + { + 1() from A to B; + continue X; + } + } + or + { + 2() from A to B; + } + } +} + + diff --git a/scribble-test/src/test/resources/good/liveness/Test01.scr b/scribble-test/src/test/resources/good/liveness/Test01.scr new file mode 100644 index 000000000..f590489b2 --- /dev/null +++ b/scribble-test/src/test/resources/good/liveness/Test01.scr @@ -0,0 +1,23 @@ +module good.liveness.Test01; + + +global protocol Proto1(role A, role B, role C, role D) +{ + choice at A + { + 1() from A to B; + 2() from B to A; + } + or + { + 2() from A to B; + 3() from B to A; + } + rec X // Testing terminal set building + { + 4() from C to D; + continue X; + } +} + + diff --git a/scribble-test/src/test/resources/good/liveness/Test02.scr b/scribble-test/src/test/resources/good/liveness/Test02.scr new file mode 100644 index 000000000..46e9addbc --- /dev/null +++ b/scribble-test/src/test/resources/good/liveness/Test02.scr @@ -0,0 +1,14 @@ +module good.liveness.Test02; + + +global protocol Proto1(role A, role B, role C, role D) +{ + rec X // Testing terminal set building + { + 1() from A to B; + 2() from B to A; + continue X; + } + 3() from C to D; +} + diff --git a/scribble-test/src/test/resources/good/liveness/roleprog/Test03.scr b/scribble-test/src/test/resources/good/liveness/roleprog/Test03.scr new file mode 100644 index 000000000..16e2418f8 --- /dev/null +++ b/scribble-test/src/test/resources/good/liveness/roleprog/Test03.scr @@ -0,0 +1,24 @@ +module good.liveness.roleprog.Test03; + + +// Same as good.safety.stuckmsg.threeparty.Test03 +global protocol Proto1(role A, role B, role C) +{ + rec X + { + 1() from A to B; + 1() from B to C; + choice at B + { + 2() from B to A; + continue X; // No C in this choice case, but fine + } + or + { + 3() from B to A; + 1() from B to C; + continue X; + } + } +} + diff --git a/scribble-test/src/test/resources/good/liveness/roleprog/Test10.scr b/scribble-test/src/test/resources/good/liveness/roleprog/Test10.scr new file mode 100644 index 000000000..d31f71b4d --- /dev/null +++ b/scribble-test/src/test/resources/good/liveness/roleprog/Test10.scr @@ -0,0 +1,35 @@ +module good.efsm.gdo.Test10; + + +// Duplicate of good.efsm.gdo.Test10 +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + do Proto1Aux1(A, B, C); + } + or + { + do Proto1Aux2(A, B, C); + } +} + +aux global protocol Proto1Aux1(role A, role B, role C) +{ + choice at A + { + 3() from A to B; + 3() from A to C; + do Proto1Aux1(A, B, C); + } +} + +aux global protocol Proto1Aux2(role A, role B, role C) +{ + choice at A + { + 2() from A to B; + do Proto1Aux1(A, B, C); + } +} + diff --git a/scribble-test/src/test/resources/good/misc/globals/gchoice/Choice01.scr b/scribble-test/src/test/resources/good/misc/globals/gchoice/Choice01.scr new file mode 100644 index 000000000..96c3fa9d3 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/gchoice/Choice01.scr @@ -0,0 +1,15 @@ +module good.misc.globals.gchoice.Choice01; + +// FIXME: not really about parsing, refactor +global protocol Choice1(role A, role B) +{ + choice at A + { + l1() from A to B; + } + or + { + //l1() from A to B; // Uncomment is bad + l2() from A to B; + } +} diff --git a/scribble-test/src/test/resources/good/misc/globals/gchoice/Choice02.scr b/scribble-test/src/test/resources/good/misc/globals/gchoice/Choice02.scr new file mode 100644 index 000000000..ff486bd8f --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/gchoice/Choice02.scr @@ -0,0 +1,11 @@ +module good.misc.globals.gchoice.Choice02; + +global protocol Choice2(role A, role B) +{ + choice at A + { + //l1() from B to A; // Uncomment is bad + l1() from A to B; + } +} + diff --git a/scribble-test/src/test/resources/good/misc/globals/gchoice/Choice03.scr b/scribble-test/src/test/resources/good/misc/globals/gchoice/Choice03.scr new file mode 100644 index 000000000..2cdac2747 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/gchoice/Choice03.scr @@ -0,0 +1,15 @@ +module good.misc.globals.gchoice.Choice03; + +global protocol Choice3(role A, role B) +{ + l1() from A to B; + choice at B + { + l1() from B to A; + } + or + { + l2() from B to A; + } +} + diff --git a/scribble-test/src/test/resources/good/misc/globals/gchoice/Choice04.scr b/scribble-test/src/test/resources/good/misc/globals/gchoice/Choice04.scr new file mode 100644 index 000000000..c8881e533 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/gchoice/Choice04.scr @@ -0,0 +1,17 @@ +module good.misc.globals.gchoice.Choice04; + +global protocol Choice4(role A, role B) +{ + choice at B + { + l1() from B to A; + l2() from A to B; + } + or + { + l2() from B to A; + l1() from A to B; + l2() from A to B; // same label OK because B is the subject (TODO: should be generalised for all roles already enabled) + } +} + diff --git a/scribble-test/src/test/resources/good/misc/globals/gchoice/Choice05a.scr b/scribble-test/src/test/resources/good/misc/globals/gchoice/Choice05a.scr new file mode 100644 index 000000000..ff42e36a6 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/gchoice/Choice05a.scr @@ -0,0 +1,32 @@ +module good.misc.globals.gchoice.Choice05a; + + +global protocol Choice5a(role A, role B) +{ + choice at B + { + l1() from B to A; // Comment is bad + choice at A + { + l1() from A to B; + } + or + { + l2() from A to B; + } + } + or + { + choice at B + { + l2() from B to A; + } + or + { + l3() from B to A; + //l2() from B to A; // Uncomment OK unless l3() is commented + //l1() from B to A; // Uncomment OK unless l3() is commented + } + } +} + diff --git a/scribble-test/src/test/resources/good/misc/globals/gchoice/Choice05b.scr b/scribble-test/src/test/resources/good/misc/globals/gchoice/Choice05b.scr new file mode 100644 index 000000000..1a683ff67 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/gchoice/Choice05b.scr @@ -0,0 +1,32 @@ +module good.misc.globals.gchoice.Choice05b; + + +global protocol Choice5b(role A, role B) +{ + choice at B + { + l1() from B to A; // Comment is bad + choice at A + { + l1() from A to B; + } + or + { + l2() from A to B; + } + } + or + { + choice at B + { + l2() from B to A; + } + or + { + l3() from B to A; + //l2() from B to A; // Uncomment OK unless l3() is commented + //l1() from B to A; // Uncomment OK unless l3() is commented + } + } +} + diff --git a/scribble-test/src/test/resources/good/misc/globals/gchoice/Choice05c.scr b/scribble-test/src/test/resources/good/misc/globals/gchoice/Choice05c.scr new file mode 100644 index 000000000..5b11c1dc8 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/gchoice/Choice05c.scr @@ -0,0 +1,32 @@ +module good.misc.globals.gchoice.Choice05c; + + +global protocol Choice5c(role A, role B) +{ + choice at B + { + l1() from B to A; // Comment is bad + choice at A + { + l1() from A to B; + } + or + { + l2() from A to B; + } + } + or + { + choice at B + { + l2() from B to A; + } + or + { + l3() from B to A; + //l2() from B to A; // Uncomment OK unless l3() is commented + //l1() from B to A; // Uncomment OK unless l3() is commented + } + } +} + diff --git a/scribble-test/src/test/resources/good/misc/globals/gchoice/Choice06.scr b/scribble-test/src/test/resources/good/misc/globals/gchoice/Choice06.scr new file mode 100644 index 000000000..604751a2a --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/gchoice/Choice06.scr @@ -0,0 +1,27 @@ +module good.misc.globals.gchoice.Choice06; + + +global protocol Choice6(role A, role B) +{ + choice at A + { + l1() from A to B; + } + or + { + () from A to B; + } + l1() from A to B; + () from A to B; + choice at A + { + l1() from A to B; // Comment is bad + () from A to B; + } + or + { + () from A to B; + } + 2() from A to B; +} + diff --git a/scribble-test/src/test/resources/good/misc/globals/gchoice/Choice08.scr b/scribble-test/src/test/resources/good/misc/globals/gchoice/Choice08.scr new file mode 100644 index 000000000..d0c2ae850 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/gchoice/Choice08.scr @@ -0,0 +1,19 @@ +module good.misc.globals.gchoice.Choice08; + + +global protocol Choice8(role A, role B, role C) +{ + choice at A + { + l1() from A to B; + l2() from B to C; + } + or + { + l2() from A to B; + l1() from B to C; // Comment is bad + l2() from B to C; + } + l2() from A to C; +} + diff --git a/scribble-test/src/test/resources/good/misc/globals/gdo/Do01a.scr b/scribble-test/src/test/resources/good/misc/globals/gdo/Do01a.scr new file mode 100644 index 000000000..9f34e7453 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/gdo/Do01a.scr @@ -0,0 +1,17 @@ +module good.misc.globals.gdo.Do01a; + + +global protocol Do1a(role A, role B) +{ + do Do1aux(A, B); + //do good.misc.globals.gdo.Do01a.Do1aux(A, B); // Uncomment is OK + //do X: Do1aux(A, B); // Uncomment is OK // TODO + //do Do1aux(A, B); // Uncomment is bad + //do Do1aux(A, A); // Uncomment is bad +} + +global protocol Do1aux(role C, role D) +{ + l1() from C to D; +} + diff --git a/scribble-test/src/test/resources/good/misc/globals/gdo/Do01b.scr b/scribble-test/src/test/resources/good/misc/globals/gdo/Do01b.scr new file mode 100644 index 000000000..c0a423d3c --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/gdo/Do01b.scr @@ -0,0 +1,17 @@ +module good.misc.globals.gdo.Do01b; + + +global protocol Do1b(role A, role B) +{ + do Do1aux(A, B); + do good.misc.globals.gdo.Do01b.Do1aux(A, B); // Uncomment is OK + //do X: Do1aux(A, B); // Uncomment is OK // TODO + //do Do1aux(A, B); // Uncomment is bad + //do Do1aux(A, A); // Uncomment is bad +} + +global protocol Do1aux(role C, role D) +{ + l1() from C to D; +} + diff --git a/scribble-test/src/test/resources/good/misc/globals/gdo/Do02.scr b/scribble-test/src/test/resources/good/misc/globals/gdo/Do02.scr new file mode 100644 index 000000000..8bdf16d9f --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/gdo/Do02.scr @@ -0,0 +1,13 @@ +module good.misc.globals.gdo.Do02; + + +global protocol Do2(role A, role B) +{ + do Do2a(B, A); +} + +global protocol Do2a(role A, role B) +{ + l1() from A to B; +} + diff --git a/scribble-test/src/test/resources/good/misc/globals/gdo/Do03.scr b/scribble-test/src/test/resources/good/misc/globals/gdo/Do03.scr new file mode 100644 index 000000000..a64f10472 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/gdo/Do03.scr @@ -0,0 +1,20 @@ +module good.misc.globals.gdo.Do03; + + +global protocol Do3(role A, role B) +{ + l1() from A to B; + do Do3a(A, B); +} + +global protocol Do3a(role C, role D) +{ + l2() from C to D; + do Do3b(C, D); +} + +global protocol Do3b(role E, role F) +{ + //l3() from A to B; // Uncomment is bad + l3() from E to F; +} diff --git a/scribble-test/src/test/resources/good/misc/globals/gdo/Do04a.scr b/scribble-test/src/test/resources/good/misc/globals/gdo/Do04a.scr new file mode 100644 index 000000000..812f03c7a --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/gdo/Do04a.scr @@ -0,0 +1,27 @@ +module good.misc.globals.gdo.Do04a; + + +global protocol Do4a(role A, role B) +{ + choice at A + { + l1() from A to B; + } + or + { + do Do4_1(A, B); + //do X: Do4_1(A as C, B as D); // Uncomment is OK // TODO + } +} + +global protocol Do4_1(role C, role D) +{ + do Do4_2(C, D); +} + +global protocol Do4_2(role E, role F) +{ + //l1() from E to F; // Uncomment OK for the X-do only, not the unscoped one + l2() from E to F; +} + diff --git a/scribble-test/src/test/resources/good/misc/globals/gdo/Do05.scr b/scribble-test/src/test/resources/good/misc/globals/gdo/Do05.scr new file mode 100644 index 000000000..392efbb41 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/gdo/Do05.scr @@ -0,0 +1,20 @@ +module good.misc.globals.gdo.Do05; + + +global protocol Do5(role A, role B) +{ + choice at A + { + l1() from A to B; + } + or + { + do Do5a(A, B); // Comment is bad + l3() from B to A; + } +} + +global protocol Do5a(role C, role D) +{ + l2() from C to D; +} diff --git a/scribble-test/src/test/resources/good/misc/globals/gdo/Do06a.scr b/scribble-test/src/test/resources/good/misc/globals/gdo/Do06a.scr new file mode 100644 index 000000000..95623cad8 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/gdo/Do06a.scr @@ -0,0 +1,22 @@ +module good.misc.globals.gdo.Do06a; + + +type "java.lang.String" from "rt.jar" as String; + + +global protocol Do6a(role A, role B) +{ + do Do6_1(A, B); + //do Do6_1(A, B); // Uncomment is OK + //do Do6_1<(String)>(A, B); // Uncomment is OK + //do Do6_1<()>(A, B); // Uncomment is OK + //do Do6_1(A, B); // Uncomment is bad + //do Do6_1(A, B); // Uncomment is bad +} + +global protocol Do6_1(role C, role D) +//global protocol Do6_1(role C, role D) // Makes all above bad +{ + X from C to D; +} + diff --git a/scribble-test/src/test/resources/good/misc/globals/gdo/Do06b.scr b/scribble-test/src/test/resources/good/misc/globals/gdo/Do06b.scr new file mode 100644 index 000000000..44366f75a --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/gdo/Do06b.scr @@ -0,0 +1,22 @@ +module good.misc.globals.gdo.Do06b; + + +type "java.lang.String" from "rt.jar" as String; + + +global protocol Do6b(role A, role B) +{ + do Do6_1(A, B); + do Do6_1(A, B); // Uncomment is OK + //do Do6_1<(String)>(A, B); // Uncomment is OK + //do Do6_1<()>(A, B); // Uncomment is OK + //do Do6_1(A, B); // Uncomment is bad + //do Do6_1(A, B); // Uncomment is bad +} + +global protocol Do6_1(role C, role D) +//global protocol Do6_1(role C, role D) // Makes all above bad +{ + X from C to D; +} + diff --git a/scribble-test/src/test/resources/good/misc/globals/gdo/Do06c.scr b/scribble-test/src/test/resources/good/misc/globals/gdo/Do06c.scr new file mode 100644 index 000000000..9ea22f584 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/gdo/Do06c.scr @@ -0,0 +1,22 @@ +module good.misc.globals.gdo.Do06c; + + +type "java.lang.String" from "rt.jar" as String; + + +global protocol Do6c(role A, role B) +{ + do Do6_1(A, B); + do Do6_1(A, B); // Uncomment is OK + do Do6_1<(String)>(A, B); // Uncomment is OK + //do Do6_1<()>(A, B); // Uncomment is OK + //do Do6_1(A, B); // Uncomment is bad + //do Do6_1(A, B); // Uncomment is bad +} + +global protocol Do6_1(role C, role D) +//global protocol Do6_1(role C, role D) // Makes all above bad +{ + X from C to D; +} + diff --git a/scribble-test/src/test/resources/good/misc/globals/gdo/Do06d.scr b/scribble-test/src/test/resources/good/misc/globals/gdo/Do06d.scr new file mode 100644 index 000000000..310e03133 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/gdo/Do06d.scr @@ -0,0 +1,22 @@ +module good.misc.globals.gdo.Do06d; + + +type "java.lang.String" from "rt.jar" as String; + + +global protocol Do6d(role A, role B) +{ + do Do6_1(A, B); + do Do6_1(A, B); // Uncomment is OK + do Do6_1<(String)>(A, B); // Uncomment is OK + do Do6_1<()>(A, B); // Uncomment is OK + //do Do6_1(A, B); // Uncomment is bad + //do Do6_1(A, B); // Uncomment is bad +} + +global protocol Do6_1(role C, role D) +//global protocol Do6_1(role C, role D) // Makes all above bad +{ + X from C to D; +} + diff --git a/scribble-test/src/test/resources/good/misc/globals/gdo/Do07.scr b/scribble-test/src/test/resources/good/misc/globals/gdo/Do07.scr new file mode 100644 index 000000000..13f7e070e --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/gdo/Do07.scr @@ -0,0 +1,16 @@ +module good.misc.globals.gdo.Do07; + + +type "MyExternalType" from "MyExternalType.blah" as MyType; + + +global protocol Do7(role A, role B) +{ + do Do7a(A, B); +} + +global protocol Do7a(role C, role D) +{ + X from C to D; +} + diff --git a/scribble-test/src/test/resources/good/misc/globals/gdo/Do08.scr b/scribble-test/src/test/resources/good/misc/globals/gdo/Do08.scr new file mode 100644 index 000000000..4fd171cea --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/gdo/Do08.scr @@ -0,0 +1,14 @@ +module good.misc.globals.gdo.Do08; + + +global protocol Do8(role A, role B) +{ + do Do8Aux(A, B); + do Do8Aux(B, A); +} + +global protocol Do8Aux(role C, role D) +{ + X from C to D; +} + diff --git a/scribble-test/src/test/resources/good/misc/globals/gdo/Do09.scr b/scribble-test/src/test/resources/good/misc/globals/gdo/Do09.scr new file mode 100644 index 000000000..a3c5ceedf --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/gdo/Do09.scr @@ -0,0 +1,22 @@ +module good.misc.globals.gdo.Do09; + + +global protocol Do9(role A, role B) +{ + choice at A + { + do Do9Aux(A, B); + } + or + { + do Do9Aux(A, B); + //do Do9Aux(B, A); // Uncomment bad if the first line in this block is commented + //do Do9Aux(A, B); // Uncomment bad if the first line in this block is commented + } +} + +global protocol Do9Aux(role C, role D) +{ + X from C to D; +} + diff --git a/scribble-test/src/test/resources/good/misc/globals/gdo/Do10.scr b/scribble-test/src/test/resources/good/misc/globals/gdo/Do10.scr new file mode 100644 index 000000000..08c294ff3 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/gdo/Do10.scr @@ -0,0 +1,15 @@ +module good.misc.globals.gdo.Do10; + + +global protocol Do10(role A, role B) +{ + do Do10a(A, B); + //do Do10a(A, B); // Uncomment is bad +} + +global protocol Do10a(role C, role D) +{ + X from C to D; + //Y from C to D; // Uncomment is bad +} + diff --git a/scribble-test/src/test/resources/good/misc/globals/gdo/Do11.scr b/scribble-test/src/test/resources/good/misc/globals/gdo/Do11.scr new file mode 100644 index 000000000..bd789a828 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/gdo/Do11.scr @@ -0,0 +1,25 @@ +module good.misc.globals.gdo.Do11; + + +global protocol Do11(role A, role B) +{ + /*choice at A // Uncomment (with below) is bad + {*/ + do Do11Aux1(A, B); + /*} + or + { + l1() from A to B; + }*/ +} + +global protocol Do11Aux1(role C, role D) +{ + do Do11Aux2(C, D); +} + +global protocol Do11Aux2(role E, role F) +{ + X from E to F; +} + diff --git a/scribble-test/src/test/resources/good/misc/globals/gdo/Do12a.scr b/scribble-test/src/test/resources/good/misc/globals/gdo/Do12a.scr new file mode 100644 index 000000000..6a00ed933 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/gdo/Do12a.scr @@ -0,0 +1,23 @@ +module good.misc.globals.gdo.Do12a; + + +global protocol Do12a(role A, role B) +{ + choice at A + { + do Do12_1(A, B); + } + or + { + //do Do12_1(A, B); // Uncomment is bad + //do X: Do12_1(A, B); // Uncomment is OK + do Do12_1(A, B); + } +} + +global protocol Do12_1(role C, role D) +{ + X from C to D; +} + + diff --git a/scribble-test/src/test/resources/good/misc/globals/gdo/Do13b.scr b/scribble-test/src/test/resources/good/misc/globals/gdo/Do13b.scr new file mode 100644 index 000000000..9316afbb7 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/gdo/Do13b.scr @@ -0,0 +1,9 @@ +module good.misc.globals.gdo.Do13b; + + +global protocol Do13b(role A, role B) +{ + l1() from A to B; // Uncomment is OK + do Do13b(A, B); + //l1() from A to B; // Uncomment is bad +} diff --git a/scribble-test/src/test/resources/good/misc/globals/gdo/Do14.scr b/scribble-test/src/test/resources/good/misc/globals/gdo/Do14.scr new file mode 100644 index 000000000..bbf7a9c42 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/gdo/Do14.scr @@ -0,0 +1,22 @@ +module good.misc.globals.gdo.Do14; + + +global protocol Do14(role A, role B) +{ + choice at A + { + l1() from A to B; + do Do14a(A, B); + } + or + { + l2() from A to B; + } + //l1() from A to B; // Uncomment is bad +} + +global protocol Do14a(role C, role D) +{ + do Do14(D, C); +} + diff --git a/scribble-test/src/test/resources/good/misc/globals/gdo/Do15.scr b/scribble-test/src/test/resources/good/misc/globals/gdo/Do15.scr new file mode 100644 index 000000000..12b3ea42e --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/gdo/Do15.scr @@ -0,0 +1,17 @@ +module good.misc.globals.gdo.Do15; + + +global protocol Do15(role A, role B) +{ + choice at A + { + l1() from A to B; + do Do15(A, B); + } + or + { + l2() from A to B; + } + //l3() from A to B; // Uncomment is bad +} + diff --git a/scribble-test/src/test/resources/good/misc/globals/gdo/Do17.scr b/scribble-test/src/test/resources/good/misc/globals/gdo/Do17.scr new file mode 100644 index 000000000..bbfec2492 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/gdo/Do17.scr @@ -0,0 +1,21 @@ +module good.misc.globals.gdo.Do17; + + +global protocol Do17(role A, role B) +{ + do Do17a(A, B); + //do Do17a(A, B); // Uncomment is bad +} + +global protocol Do17a(role C, role D) +{ + choice at C + { + X from C to D; + } + or + { + Y from C to D; + } +} + diff --git a/scribble-test/src/test/resources/good/misc/globals/gdo/Do19.scr b/scribble-test/src/test/resources/good/misc/globals/gdo/Do19.scr new file mode 100644 index 000000000..8885481a4 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/gdo/Do19.scr @@ -0,0 +1,18 @@ +module good.misc.globals.gdo.Do19; + + +global protocol Do19(role A, role B) +{ + do Do19a(A, B); + //l1() from A to B; // Uncomment is bad +} + +global protocol Do19a(role C, role D) +{ + rec X + { + l1() from C to D; + continue X; + } +} + diff --git a/scribble-test/src/test/resources/good/misc/globals/gdo/Do21.scr b/scribble-test/src/test/resources/good/misc/globals/gdo/Do21.scr new file mode 100644 index 000000000..37e9b42bb --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/gdo/Do21.scr @@ -0,0 +1,18 @@ +module good.misc.globals.gdo.Do21; + + +type "java.lang.String" from "rt.jar" as String; + + +global protocol Do6(role A, role B) +{ + do Do6a(A, B); + //do Do6a(A, B); // Uncomment is bad +} + +global protocol Do6a(role C, role D) +//global protocol Do6a(role C, role D) +{ + (X) from C to D; +} + diff --git a/scribble-test/src/test/resources/good/misc/globals/gdo/Do23b.scr b/scribble-test/src/test/resources/good/misc/globals/gdo/Do23b.scr new file mode 100644 index 000000000..edbf5f933 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/gdo/Do23b.scr @@ -0,0 +1,23 @@ +module good.misc.globals.gdo.Do23b; + + +type "java.lang.String" from "rt.jar" as String; + + +// Overlaps with Do25 +global protocol Do23b(role A, role B) +{ + do Do23aux(A, B); +} + +global protocol Do23aux(role C, role D) +{ + do Do23a2(C, D); +} + +global protocol Do23a2(role E, role F) +//global protocol Do23a2(role E, role F) +{ + X from E to F; // Uncomment OK +} + diff --git a/scribble-test/src/test/resources/good/misc/globals/gdo/Do25.scr b/scribble-test/src/test/resources/good/misc/globals/gdo/Do25.scr new file mode 100644 index 000000000..b66991357 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/gdo/Do25.scr @@ -0,0 +1,22 @@ +module good.misc.globals.gdo.Do25; + + +type "java.lang.String" from "rt.jar" as String; + + +global protocol Do25(role A, role B) +{ + do Do25a(A, B); + //do Do25a(A, B); // Uncomment is bad + //do Do25a(A, B); // Uncomment is bad + //do Do25a(A, B); // Uncomment is bad + //do Do25a(A, B); // Uncomment is bad + //do Do25a<(), String, ()>(A, B); // Uncomment is bad +} + +global protocol Do25a(role C, role D) +{ + X from C to D; + (Y) from D to C; +} + diff --git a/scribble-test/src/test/resources/good/misc/globals/gdo/Do26.scr b/scribble-test/src/test/resources/good/misc/globals/gdo/Do26.scr new file mode 100644 index 000000000..7cf357db7 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/gdo/Do26.scr @@ -0,0 +1,16 @@ +module good.misc.globals.gdo.Do26; + + +global protocol Do26(role A, role B) +{ + m() from A to B; + choice at A + { + m1() from A to B; // Comment bad (similar to an unguarded continue in a choice in a rec) + do Do26(A, B); + } + or + { + m2() from A to B; + } +} diff --git a/scribble-test/src/test/resources/good/misc/globals/gdo/Do27.scr b/scribble-test/src/test/resources/good/misc/globals/gdo/Do27.scr new file mode 100644 index 000000000..0c249b935 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/gdo/Do27.scr @@ -0,0 +1,26 @@ +module good.misc.globals.gdo.Do27; + + +global protocol Do27(role A, role B) +{ + choice at A + { + m1() from A to B; + } + or + { + m2() from A to B; + //do Do27(A, B); // Uncomment bad + do Do27a(A, B); + } + m3() from A to B; +} + +global protocol Do27a(role C, role D) +{ + rec X + { + m4() from C to D; + //continue X; // Uncomment bad + } +} diff --git a/scribble-test/src/test/resources/good/misc/globals/gprotocoldecl/GProtocolDecl02.scr b/scribble-test/src/test/resources/good/misc/globals/gprotocoldecl/GProtocolDecl02.scr new file mode 100644 index 000000000..03d2b29fd --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/gprotocoldecl/GProtocolDecl02.scr @@ -0,0 +1,13 @@ +module good.misc.globals.protocoldecl.GProtocolDecl02; + + +global protocol GProtocolDecl2(role A, role B, role C) +{ + 1() from A to B; + do GProtocolDecl2a(A, C); +} + +global protocol GProtocolDecl2a(role D, role E) +{ + 2() from D to E; +} \ No newline at end of file diff --git a/scribble-test/src/test/resources/good/misc/globals/gprotocoldecl/GProtocolDecl03.scr b/scribble-test/src/test/resources/good/misc/globals/gprotocoldecl/GProtocolDecl03.scr new file mode 100644 index 000000000..0b6eb7c4d --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/gprotocoldecl/GProtocolDecl03.scr @@ -0,0 +1,18 @@ +module good.misc.globals.protocoldecl.GProtocolDecl03; + + +global protocol GProtocolDecl3(role A, role B, role C) +{ + 1() from A to B; + do GProtocolDecl3a(A, C); +} + +global protocol GProtocolDecl3a(role D, role E) +{ + do GProtocolDecl3b(D, E); +} + +global protocol GProtocolDecl3b(role D, role E) +{ + 2() from D to E; +} diff --git a/scribble-test/src/test/resources/good/misc/globals/gprotocoldecl/GProtocolDecl04.scr b/scribble-test/src/test/resources/good/misc/globals/gprotocoldecl/GProtocolDecl04.scr new file mode 100644 index 000000000..fef370911 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/gprotocoldecl/GProtocolDecl04.scr @@ -0,0 +1,13 @@ +module good.misc.globals.protocoldecl.GProtocolDecl04; + + +global protocol GProtocolDecl4a(role D, role E) +{ + do GProtocolDecl4b(D, E); +} + +global protocol GProtocolDecl4b(role D, role E) +{ + 2() from D to E; + do GProtocolDecl4a(D, E); +} diff --git a/scribble-test/src/test/resources/good/misc/globals/grecursion/Recursion01.scr b/scribble-test/src/test/resources/good/misc/globals/grecursion/Recursion01.scr new file mode 100644 index 000000000..9d5962366 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/grecursion/Recursion01.scr @@ -0,0 +1,16 @@ +module good.misc.globals.grecursion.Recursion01; + + +global protocol Recursion1(role A, role B) +{ + //rec A { } // Currently OK. Disallow? + + rec X + { + l1() from A to B; + continue X; + //continue Y; // Uncomment bad, even if above line is commented + //l2() from A to B; // Uncomment bad + } +} + diff --git a/scribble-test/src/test/resources/good/misc/globals/grecursion/Recursion02.scr b/scribble-test/src/test/resources/good/misc/globals/grecursion/Recursion02.scr new file mode 100644 index 000000000..040bcf51d --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/grecursion/Recursion02.scr @@ -0,0 +1,11 @@ +module good.misc.globals.grecursion.Recursion02; + + +global protocol Recursion2(role A, role B) +{ + rec X + { + l1() from A to B; // Comment is OK + } +} + diff --git a/scribble-test/src/test/resources/good/misc/globals/grecursion/Recursion03.scr b/scribble-test/src/test/resources/good/misc/globals/grecursion/Recursion03.scr new file mode 100644 index 000000000..80015e702 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/grecursion/Recursion03.scr @@ -0,0 +1,19 @@ +module good.misc.globals.grecursion.Recursion03; + + +global protocol Recursion3(role A, role B) +{ + rec X + { + l1() from A to B; + rec Y + { + l2() from B to A; + continue Y; + //continue X; // Uncomment OK if above line is commented + } + //l3() from B to A; // Uncommemt bad + } + //l4() from B to A; // Uncomment bad +} + diff --git a/scribble-test/src/test/resources/good/misc/globals/grecursion/Recursion04.scr b/scribble-test/src/test/resources/good/misc/globals/grecursion/Recursion04.scr new file mode 100644 index 000000000..bc3064f90 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/grecursion/Recursion04.scr @@ -0,0 +1,18 @@ +module good.misc.globals.grecursion.Recursion04; + + +global protocol Recursion4(role A, role B) +{ + rec X + { + l1() from A to B; + rec Y + //rec X // Uncomment bad, even if above line is commented + { + l2() from B to A; + continue X; + //continue Y; // Uncomment OK if the above line is commented + } + } +} + diff --git a/scribble-test/src/test/resources/good/misc/globals/grecursion/Recursion05.scr b/scribble-test/src/test/resources/good/misc/globals/grecursion/Recursion05.scr new file mode 100644 index 000000000..bd56f75ca --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/grecursion/Recursion05.scr @@ -0,0 +1,17 @@ +module good.misc.globals.grecursion.Recursion05; + + +global protocol Recursion5(role A, role B) +{ + rec X + { + l1() from A to B; + //continue X; // Uncomment makes the below rec bad + //continue Y; // Uncomment bad + } + rec Y + { + l2() from B to A; + continue Y; // A bad "continue X" here tested in Recursion11 + } +} diff --git a/scribble-test/src/test/resources/good/misc/globals/grecursion/Recursion06.scr b/scribble-test/src/test/resources/good/misc/globals/grecursion/Recursion06.scr new file mode 100644 index 000000000..1783d13ac --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/grecursion/Recursion06.scr @@ -0,0 +1,22 @@ +module good.misc.globals.grecursion.Recursion06; + + +global protocol Recursion6(role A, role B) +{ + rec X + { + choice at A + { + l1() from A to B; + continue X; + //l1() from A to B; // Uncomment bad + } + or + { + l2() from A to B; + } + //l3() from A to B; // Uncomment bad. "General recursion" issue ("unfold stacking"). Fix is to move inside the second choice block + } + l4() from A to B; +} + diff --git a/scribble-test/src/test/resources/good/misc/globals/grecursion/Recursion07.scr b/scribble-test/src/test/resources/good/misc/globals/grecursion/Recursion07.scr new file mode 100644 index 000000000..3778efcb2 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/grecursion/Recursion07.scr @@ -0,0 +1,21 @@ +module good.misc.globals.grecursion.Recursion07; + + +global protocol Recursion7(role A, role B) +{ + rec X + { + choice at A + { + l1() from A to B; + } + or + { + l2() from A to B; + } + continue X; + //l3() from A to B; // Uncomment bad + } + //l3() from A to B; // Uncomment bad +} + diff --git a/scribble-test/src/test/resources/good/misc/globals/grecursion/Recursion11.scr b/scribble-test/src/test/resources/good/misc/globals/grecursion/Recursion11.scr new file mode 100644 index 000000000..5593b0255 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/grecursion/Recursion11.scr @@ -0,0 +1,17 @@ +module parsing.globals.grecursion.Recursion11; + + +global protocol Recursion11(role A, role B) +{ + rec X + { + l1() from A to B; + } + rec Y + { + l2() from B to A; + continue Y; + //continue X; // Uncomment bad, even if above line is commented + } +} + diff --git a/scribble-test/src/test/resources/good/misc/globals/grecursion/Recursion13.scr b/scribble-test/src/test/resources/good/misc/globals/grecursion/Recursion13.scr new file mode 100644 index 000000000..644821811 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/grecursion/Recursion13.scr @@ -0,0 +1,18 @@ +module parsing.globals.grecursion.Recursion13; + + +global protocol Recursion13(role A, role B) +{ + rec X + { + l1() from A to B; + do parsing.globals.grecursion.Recursion13.Recursion13a(A, B); + continue X; + } +} + +global protocol Recursion13a(role A, role B) +{ + l1() from A to B; +} + diff --git a/scribble-test/src/test/resources/good/misc/globals/grecursion/Recursion15.scr b/scribble-test/src/test/resources/good/misc/globals/grecursion/Recursion15.scr new file mode 100644 index 000000000..69988a1f1 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/grecursion/Recursion15.scr @@ -0,0 +1,19 @@ +module parsing.globals.grecursion.Recursion15; + + +global protocol Recursion15(role A, role B) +{ + rec X + { + m() from A to B; + choice at A + { + m1() from A to B; // Comment bad + continue X; + } + or + { + m2() from A to B; + } + } +} diff --git a/scribble-test/src/test/resources/good/misc/globals/grecursion/Recursion16.scr b/scribble-test/src/test/resources/good/misc/globals/grecursion/Recursion16.scr new file mode 100644 index 000000000..26db78daf --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/globals/grecursion/Recursion16.scr @@ -0,0 +1,19 @@ +module parsing.globals.grecursion.Recursion16; + + +global protocol Recursion16(role A, role B) +{ + choice at A + { + m1() from A to B; + } + or + { + rec X + { + m2() from A to B; + //continue X; // Uncomment (currently) bad + } + } + m3() from A to B; +} diff --git a/scribble-test/src/test/resources/good/misc/imports/Import01.scr b/scribble-test/src/test/resources/good/misc/imports/Import01.scr new file mode 100644 index 000000000..6a483c7d4 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/imports/Import01.scr @@ -0,0 +1,11 @@ +//Raymond@HZHL2 ~/code/python/scribble-tools +//$ PYTHONPATH='lib/:bin/' python src/scribble/Main.py -ip test/ test/base/impourt/Import1.scr + +//$ bin/scribblec.sh -ip scribble-test/src/test/resources scribble-test/src/test/resources/good/misc/imports/Import01.scr + +module good.misc.imports.Import01; + + +import good.misc.imports.pack1.Pack01; +//import good.misc.imports.pack1.Pack1; + diff --git a/scribble-test/src/test/resources/good/misc/imports/Import02.scr b/scribble-test/src/test/resources/good/misc/imports/Import02.scr new file mode 100644 index 000000000..2cb33ed2e --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/imports/Import02.scr @@ -0,0 +1,8 @@ +//Raymond@HZHL2 ~/code/python/scribble-tools +//$ PYTHONPATH='lib/:bin/' python src/scribble/Main.py -ip test/ test/base/impourt/Import2.scr + +module good.misc.imports.Import02; + + +import good.misc.imports.pack1.Pack02; + diff --git a/scribble-test/src/test/resources/good/misc/imports/Import03.scr b/scribble-test/src/test/resources/good/misc/imports/Import03.scr new file mode 100644 index 000000000..6741bb146 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/imports/Import03.scr @@ -0,0 +1,8 @@ +//Raymond@HZHL2 ~/code/python/scribble-tools +//$ PYTHONPATH='lib/:bin/' python src/scribble/Main.py -ip test/ test/base/impourt/Import3.scr + +module good.misc.imports.Import03; + +import good.misc.imports.pack1.Pack03; +import good.misc.imports.pack1.Pack01; + diff --git a/scribble-test/src/test/resources/good/misc/imports/Import04.scr b/scribble-test/src/test/resources/good/misc/imports/Import04.scr new file mode 100644 index 000000000..62bbb529c --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/imports/Import04.scr @@ -0,0 +1,7 @@ +//Raymond@HZHL2 ~/code/python/scribble-tools +//$ PYTHONPATH='lib/:bin/' python src/scribble/Main.py -ip test/ test/base/impourt/Import4.scr + +module good.misc.imports.Import04; + +import good.misc.imports.pack1.Pack04a; +import good.misc.imports.pack1.Pack04b; diff --git a/scribble-test/src/test/resources/good/misc/imports/Import05.scr b/scribble-test/src/test/resources/good/misc/imports/Import05.scr new file mode 100644 index 000000000..21c078990 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/imports/Import05.scr @@ -0,0 +1,8 @@ +//Raymond@HZHL2 ~/code/python/scribble-tools +//$ PYTHONPATH='lib/:bin/' python src/scribble/Main.py -ip test/ test/base/impourt/Import5.scr + +module good.misc.imports.Import05; + +import good.misc.imports.pack1.Pack05; +import good.misc.imports.pack2.Pack05; + diff --git a/scribble-test/src/test/resources/good/misc/imports/Import07.scr b/scribble-test/src/test/resources/good/misc/imports/Import07.scr new file mode 100644 index 000000000..fafbcfd3e --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/imports/Import07.scr @@ -0,0 +1,11 @@ +//Raymond@HZHL2 ~/code/python/scribble-tools +//$ PYTHONPATH='lib/:bin/' python src/scribble/Main.py -ip test/ test/base/impourt/Import7.scr + +module good.misc.imports.Import07; + +import good.misc.imports.pack1.Pack07; + +import good.misc.imports.Import01; + +//import good.misc.imports.pack1.Pack1; // Uncomment is OK + diff --git a/scribble-test/src/test/resources/good/misc/imports/Import08.scr b/scribble-test/src/test/resources/good/misc/imports/Import08.scr new file mode 100644 index 000000000..18c60d80d --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/imports/Import08.scr @@ -0,0 +1,15 @@ +//Raymond@HZHL2 ~/code/python/scribble-tools +//$ PYTHONPATH='lib/:bin/' python src/scribble/Main.py -ip test/ test/base/impourt/Import8.scr + +//$ bin/scribblec.sh -ip scribble-test/src/test/resources scribble-test/src/test/resources/good/misc/imports/Import08.scr + +module good.misc.imports.Import08; + +import good.misc.imports.pack1.Pack08; + + +global protocol Import8(role A, role B) +{ + do good.misc.imports.pack1.Pack08.Pack8(A, B); +} + diff --git a/scribble-test/src/test/resources/good/misc/imports/Import09.scr b/scribble-test/src/test/resources/good/misc/imports/Import09.scr new file mode 100644 index 000000000..7e63332fc --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/imports/Import09.scr @@ -0,0 +1,21 @@ +//Raymond@HZHL2 ~/code/python/scribble-tools +//$ PYTHONPATH='lib/:bin/' python src/scribble/Main.py -ip test/ test/base/impourt/Import9.scr + +module good.misc.imports.Import09; + +import good.misc.imports.pack1.Pack09; + + +global protocol Import9(role A, role B) +{ + choice at A + { + do good.misc.imports.pack1.Pack09.Pack9(A, B); + } + or + { + l2() from A to B; + //l1() from A to B; + } +} + diff --git a/scribble-test/src/test/resources/good/misc/imports/Import10.scr b/scribble-test/src/test/resources/good/misc/imports/Import10.scr new file mode 100644 index 000000000..e629de4dc --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/imports/Import10.scr @@ -0,0 +1,32 @@ +//Raymond@HZHL2 ~/code/python/scribble-tools +//$ PYTHONPATH='lib/:bin/' python src/scribble/Main.py -ip test/ test/base/impourt/Import10.scr + +module good.misc.imports.Import10; + +import good.misc.imports.pack1.Pack10; +import good.misc.imports.pack2.Pack10; + + +global protocol Import10(role A, role B) +{ + choice at A + { + do good.misc.imports.pack1.Pack10.Pack10(A, B); + } + or + { + do good.misc.imports.pack2.Pack10.Pack10(A, B); + } + or + { + do Pack10(A, B); + } +} + +global protocol Pack10(role C, role D) +{ + l3() from C to D; + //l1() from C to D; // Bad if above line is commented + //l2() from C to D; +} + diff --git a/scribble-test/src/test/resources/good/misc/imports/Import11.scr b/scribble-test/src/test/resources/good/misc/imports/Import11.scr new file mode 100644 index 000000000..baf60d2ef --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/imports/Import11.scr @@ -0,0 +1,26 @@ +//Raymond@HZHL2 ~/code/python/scribble-tools +//$ PYTHONPATH='lib/:bin/' python src/scribble/Main.py -ip test/ test/base/impourt/Import11.scr + +module good.misc.imports.Import11; + +import good.misc.imports.pack1.Pack11; + + +global protocol Import11(role A, role B) +{ + choice at A + { + do good.misc.imports.pack1.Pack11.Pack11(A, B); + } + or + { + l2() from A to B; + } +} + +global protocol Import11Aux(role E, role F) +{ + l1() from E to F; + //l2() from E to F; +} + diff --git a/scribble-test/src/test/resources/good/misc/imports/Import12.scr b/scribble-test/src/test/resources/good/misc/imports/Import12.scr new file mode 100644 index 000000000..2b6c9193a --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/imports/Import12.scr @@ -0,0 +1,15 @@ +//Raymond@HZHL2 ~/code/python/scribble-tools +//$ PYTHONPATH='lib/:bin/' python src/scribble/Main.py -ip test/ test/base/impourt/Import12.scr + +module good.misc.imports.Import12; + +import good.misc.imports.pack1.Pack12; + + +global protocol Import12(role A, role B) +{ + do good.misc.imports.pack1.Pack12.Pack12(A, B); + //do good.misc.imports.pack1.Pack12.Pack12(A, B); // Uncomment is OK + //do good.misc.imports.pack1.Pack12.Pack12(A, B); +} + diff --git a/scribble-test/src/test/resources/good/misc/imports/Import13.scr b/scribble-test/src/test/resources/good/misc/imports/Import13.scr new file mode 100644 index 000000000..7042dec95 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/imports/Import13.scr @@ -0,0 +1,26 @@ +//Raymond@HZHL2 ~/code/python/scribble-tools +//$ PYTHONPATH='lib/:bin/' python src/scribble/Main.py -ip test/ test/base/impourt/Import13.scr + +module good.misc.imports.Import13; + +import good.misc.imports.pack1.Pack13; + + +global protocol Import13(role A, role B) +{ + choice at A + { + do good.misc.imports.pack1.Pack13.Pack13(A, B); + } + or + { + do Import13Aux(A, B); + //do Import13Aux(A, B); + } +} + +global protocol Import13Aux(role A, role B) +{ + X from A to B; +} + diff --git a/scribble-test/src/test/resources/good/misc/imports/Import14.scr b/scribble-test/src/test/resources/good/misc/imports/Import14.scr new file mode 100644 index 000000000..713e6c460 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/imports/Import14.scr @@ -0,0 +1,26 @@ +//Raymond@HZHL2 ~/code/python/scribble-tools +//$ PYTHONPATH='lib/:bin/' python src/scribble/Main.py -ip test/ test/base/impourt/Import14.scr + +module good.misc.imports.Import14; + +import good.misc.imports.pack1.Pack14; + + +global protocol Import14(role A, role B) +{ + choice at A + { + do good.misc.imports.pack1.Pack14.Pack14(A, B); + } + or + { + do Import14Aux(A, B); + //do Import14Aux(A, B); + } +} + +global protocol Import14Aux(role A, role B) +{ + X from A to B; +} + diff --git a/scribble-test/src/test/resources/good/misc/imports/Import15.scr b/scribble-test/src/test/resources/good/misc/imports/Import15.scr new file mode 100644 index 000000000..12f5e316e --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/imports/Import15.scr @@ -0,0 +1,7 @@ +//Raymond@HZHL2 ~/code/python/scribble-tools +//$ PYTHONPATH='lib/:bin/' python src/scribble/Main.py -ip test/ test/base/impourt/Import15.scr + +module good.misc.imports.Import15; + +//import Import15; // FIXME: check if simplename should be allowed here (currently implementation doesn't allow) + diff --git a/scribble-test/src/test/resources/good/misc/imports/Import16.scr b/scribble-test/src/test/resources/good/misc/imports/Import16.scr new file mode 100644 index 000000000..3e24c75bc --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/imports/Import16.scr @@ -0,0 +1,14 @@ +//Raymond@HZHL2 ~/code/python/scribble-tools +//$ PYTHONPATH='lib/:bin/' python src/scribble/Main.py -ip test/ test/base/impourt/Import16.scr + +module good.misc.imports.Import16; + +import good.misc.imports.pack1.Pack16 as Pack16; +import good.misc.imports.pack1.Pack16 as Foo; + + +global protocol Import16(role A, role B) +{ + do Pack16.Pack16(A, B); + do Foo.Pack16(A, B); +} diff --git a/scribble-test/src/test/resources/good/misc/imports/pack1/IGNORE b/scribble-test/src/test/resources/good/misc/imports/pack1/IGNORE new file mode 100644 index 000000000..e69de29bb diff --git a/scribble-test/src/test/resources/good/misc/imports/pack1/Pack01.scr b/scribble-test/src/test/resources/good/misc/imports/pack1/Pack01.scr new file mode 100644 index 000000000..b58921b19 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/imports/pack1/Pack01.scr @@ -0,0 +1,14 @@ +//Raymond@HZHL2 ~/code/python/scribble-tools +//$ PYTHONPATH='lib/:bin/' python src/scribble/Main.py test/base/impourt/pack1/Pack1.scr + +module good.misc.imports.pack1.Pack01; +//package good.misc.imports.pack1.X; +//package good.misc.imports.X.Pack1; + + +global protocol Pack1(role A, role B) +{ + l1() from A to B; + //l1() from A to C; +} + diff --git a/scribble-test/src/test/resources/good/misc/imports/pack1/Pack02.scr b/scribble-test/src/test/resources/good/misc/imports/pack1/Pack02.scr new file mode 100644 index 000000000..ea7bfe99e --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/imports/pack1/Pack02.scr @@ -0,0 +1,17 @@ +//Raymond@HZHL2 ~/code/python/scribble-tools +//$ PYTHONPATH='lib/:bin/' python src/scribble/Main.py test/base/impourt/pack1/Pack2.scr + +module good.misc.imports.pack1.Pack02; + + +global protocol Pack2a(role A, role B) +{ + l1() from A to B; +} + +global protocol Pack2b(role A, role B) +//global protocol Pack2a(role A, role B) +{ + l1() from A to B; +} + diff --git a/scribble-test/src/test/resources/good/misc/imports/pack1/Pack03.scr b/scribble-test/src/test/resources/good/misc/imports/pack1/Pack03.scr new file mode 100644 index 000000000..94d45bc33 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/imports/pack1/Pack03.scr @@ -0,0 +1,10 @@ +//Raymond@HZHL2 ~/code/python/scribble-tools +//$ PYTHONPATH='lib/:bin/' python src/scribble/Main.py test/base/impourt/pack1/Pack3.scr + +module good.misc.imports.pack1.Pack03; + +global protocol Pack1(role A, role B) +{ + l1() from A to B; +} + diff --git a/scribble-test/src/test/resources/good/misc/imports/pack1/Pack04a.scr b/scribble-test/src/test/resources/good/misc/imports/pack1/Pack04a.scr new file mode 100644 index 000000000..536faebbf --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/imports/pack1/Pack04a.scr @@ -0,0 +1,13 @@ +//Raymond@HZHL2 ~/code/python/scribble-tools +//$ PYTHONPATH='lib/:bin/' python src/scribble/Main.py test/base/impourt/pack1/Pack4a.scr + +module good.misc.imports.pack1.Pack04a; + +import good.misc.imports.pack1.Pack04b; + + +global protocol Pack4(role A, role B) +{ + l1() from A to B; +} + diff --git a/scribble-test/src/test/resources/good/misc/imports/pack1/Pack04b.scr b/scribble-test/src/test/resources/good/misc/imports/pack1/Pack04b.scr new file mode 100644 index 000000000..c9122edef --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/imports/pack1/Pack04b.scr @@ -0,0 +1,13 @@ +//Raymond@HZHL2 ~/code/python/scribble-tools +//$ PYTHONPATH='lib/:bin/' python src/scribble/Main.py test/base/impourt/pack1/Pack4b.scr + +module good.misc.imports.pack1.Pack04b; + +import good.misc.imports.pack1.Pack04a; + + +global protocol Pack4(role A, role B) +{ + l1() from A to B; +} + diff --git a/scribble-test/src/test/resources/good/misc/imports/pack1/Pack05.scr b/scribble-test/src/test/resources/good/misc/imports/pack1/Pack05.scr new file mode 100644 index 000000000..c2935c206 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/imports/pack1/Pack05.scr @@ -0,0 +1,13 @@ +//Raymond@HZHL2 ~/code/python/scribble-tools +//$ PYTHONPATH='lib/:bin/' python src/scribble/Main.py test/base/impourt/pack1/Pack5.scr + +module good.misc.imports.pack1.Pack05; + +import good.misc.imports.pack2.Pack05; + + +global protocol Pack5(role A, role B) +{ + l1() from A to B; +} + diff --git a/scribble-test/src/test/resources/good/misc/imports/pack1/Pack07.scr b/scribble-test/src/test/resources/good/misc/imports/pack1/Pack07.scr new file mode 100644 index 000000000..d13ee27f2 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/imports/pack1/Pack07.scr @@ -0,0 +1,11 @@ +//Raymond@HZHL2 ~/code/python/scribble-tools +//$ PYTHONPATH='lib/:bin/' python src/scribble/Main.py test/base/impourt/pack1/Pack7.scr + +module good.misc.imports.pack1.Pack07; + + +global protocol Pack7(role A, role B) +{ + l1() from A to B; +} + diff --git a/scribble-test/src/test/resources/good/misc/imports/pack1/Pack08.scr b/scribble-test/src/test/resources/good/misc/imports/pack1/Pack08.scr new file mode 100644 index 000000000..51343c7e8 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/imports/pack1/Pack08.scr @@ -0,0 +1,12 @@ +//Raymond@HZHL2 ~/code/python/scribble-tools +//$ PYTHONPATH='lib/:bin/' python src/scribble/Main.py test/base/impourt/pack1/Pack8.scr + +module good.misc.imports.pack1.Pack08; + + +global protocol Pack8(role C, role D) +{ + l1() from C to D; + //l1() from A to D; +} + diff --git a/scribble-test/src/test/resources/good/misc/imports/pack1/Pack09.scr b/scribble-test/src/test/resources/good/misc/imports/pack1/Pack09.scr new file mode 100644 index 000000000..094b3d166 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/imports/pack1/Pack09.scr @@ -0,0 +1,12 @@ +//Raymond@HZHL2 ~/code/python/scribble-tools +//$ PYTHONPATH='lib/:bin/' python src/scribble/Main.py test/base/impourt/pack1/Pack9.scr + +module good.misc.imports.pack1.Pack09; + + +global protocol Pack9(role C, role D) +{ + l1() from C to D; + //l2() from C to D; // Uncomment is OK; with above commented not OK +} + diff --git a/scribble-test/src/test/resources/good/misc/imports/pack1/Pack10.scr b/scribble-test/src/test/resources/good/misc/imports/pack1/Pack10.scr new file mode 100644 index 000000000..30848a913 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/imports/pack1/Pack10.scr @@ -0,0 +1,10 @@ +//Raymond@HZHL2 ~/code/python/scribble-tools +//$ PYTHONPATH='lib/:bin/' python src/scribble/Main.py test/base/impourt/pack1/Pack10.scr + +module good.misc.imports.pack1.Pack10; + +global protocol Pack10(role C, role D) +{ + l1() from C to D; +} + diff --git a/scribble-test/src/test/resources/good/misc/imports/pack1/Pack11.scr b/scribble-test/src/test/resources/good/misc/imports/pack1/Pack11.scr new file mode 100644 index 000000000..351d52762 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/imports/pack1/Pack11.scr @@ -0,0 +1,15 @@ +//Raymond@HZHL2 ~/code/python/scribble-tools +//$ PYTHONPATH='lib/:bin/' python src/scribble/Main.py -ip test/ test/base/impourt/pack1/Pack11.scr + +module good.misc.imports.pack1.Pack11; + +import good.misc.imports.pack2.Pack11; +//import good.misc.imports.Import11; // OK + + +global protocol Pack11(role C, role D) +{ + do good.misc.imports.pack2.Pack11.Pack11(C, D); + //do good.misc.imports.Import11.Import11Aux(C, D); // OK +} + diff --git a/scribble-test/src/test/resources/good/misc/imports/pack1/Pack12.scr b/scribble-test/src/test/resources/good/misc/imports/pack1/Pack12.scr new file mode 100644 index 000000000..c97285164 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/imports/pack1/Pack12.scr @@ -0,0 +1,11 @@ +//Raymond@HZHL2 ~/code/python/scribble-tools +//$ PYTHONPATH='lib/:bin/' python src/scribble/Main.py test/base/impourt/pack1/Pack12.scr + +module good.misc.imports.pack1.Pack12; + + +global protocol Pack12(role C, role D) +{ + X from C to D; +} + diff --git a/scribble-test/src/test/resources/good/misc/imports/pack1/Pack13.scr b/scribble-test/src/test/resources/good/misc/imports/pack1/Pack13.scr new file mode 100644 index 000000000..bb2c2da6d --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/imports/pack1/Pack13.scr @@ -0,0 +1,20 @@ +//Raymond@HZHL2 ~/code/python/scribble-tools +//$ PYTHONPATH='lib/:bin/' python src/scribble/Main.py -ip test/ test/base/impourt/pack1/Pack13.scr + +module good.misc.imports.pack1.Pack13; + +import good.misc.imports.Import13; + + +global protocol Pack13(role C, role D) +{ + do good.misc.imports.Import13.Import13Aux(C, D); + //do Import13Aux(C, D); + //do ImportAux(C, D); // Uncomment is OK (with below declaration) +} + +/*global protocol ImportAux(role A, role B) // TODO: make separate test for visibility building for do-target +{ + X from A to B; +}*/ + diff --git a/scribble-test/src/test/resources/good/misc/imports/pack1/Pack14.scr b/scribble-test/src/test/resources/good/misc/imports/pack1/Pack14.scr new file mode 100644 index 000000000..367523ddf --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/imports/pack1/Pack14.scr @@ -0,0 +1,13 @@ +//Raymond@HZHL2 ~/code/python/scribble-tools +//$ PYTHONPATH='lib/:bin/' python src/scribble/Main.py -ip test/ test/base/impourt/pack1/Pack14.scr + +module good.misc.imports.pack1.Pack14; + +import good.misc.imports.Import14; + + +global protocol Pack14(role C, role D) +{ + do good.misc.imports.Import14.Import14Aux(C, D); +} + diff --git a/scribble-test/src/test/resources/good/misc/imports/pack1/Pack16.scr b/scribble-test/src/test/resources/good/misc/imports/pack1/Pack16.scr new file mode 100644 index 000000000..9de4f9581 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/imports/pack1/Pack16.scr @@ -0,0 +1,11 @@ +//Raymond@HZHL2 ~/code/python/scribble-tools +//$ PYTHONPATH='lib/:bin/' python src/scribble/Main.py -ip test/ test/base/impourt/pack1/Pack16.scr + +module good.misc.imports.pack1.Pack16; + + +global protocol Pack16(role C, role D) +{ + l1() from C to D; +} + diff --git a/scribble-test/src/test/resources/good/misc/imports/pack2/IGNORE b/scribble-test/src/test/resources/good/misc/imports/pack2/IGNORE new file mode 100644 index 000000000..e69de29bb diff --git a/scribble-test/src/test/resources/good/misc/imports/pack2/Pack05.scr b/scribble-test/src/test/resources/good/misc/imports/pack2/Pack05.scr new file mode 100644 index 000000000..7e23c9d64 --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/imports/pack2/Pack05.scr @@ -0,0 +1,14 @@ +//Raymond@HZHL2 ~/code/python/scribble-tools +//$ PYTHONPATH='lib/:bin/' python src/scribble/Main.py test/base/impourt/pack2/Pack5.scr + +module good.misc.imports.pack2.Pack05; + +import good.misc.imports.pack1.Pack05; + + +global protocol Pack5(role A, role B) +{ + l1() from A to B; + //l1() from B to C; +} + diff --git a/scribble-test/src/test/resources/good/misc/imports/pack2/Pack10.scr b/scribble-test/src/test/resources/good/misc/imports/pack2/Pack10.scr new file mode 100644 index 000000000..1659787bc --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/imports/pack2/Pack10.scr @@ -0,0 +1,11 @@ +//Raymond@HZHL2 ~/code/python/scribble-tools +//$ PYTHONPATH='lib/:bin/' python src/scribble/Main.py test/base/impourt/pack2/Pack10.scr + +module good.misc.imports.pack2.Pack10; + +global protocol Pack10(role C, role D) +{ + l2() from C to D; + //l1() from C to D; // Bad if above line is commented +} + diff --git a/scribble-test/src/test/resources/good/misc/imports/pack2/Pack11.scr b/scribble-test/src/test/resources/good/misc/imports/pack2/Pack11.scr new file mode 100644 index 000000000..a34a765ca --- /dev/null +++ b/scribble-test/src/test/resources/good/misc/imports/pack2/Pack11.scr @@ -0,0 +1,13 @@ +//Raymond@HZHL2 ~/code/python/scribble-tools +//$ PYTHONPATH='lib/:bin/' python src/scribble/Main.py -ip test/ test/base/impourt/pack2/Pack11.scr + +module good.misc.imports.pack2.Pack11; + +import good.misc.imports.Import11; + + +global protocol Pack11(role C, role D) +{ + do good.misc.imports.Import11.Import11Aux(C, D); +} + diff --git a/scribble-test/src/test/resources/good/reach/globals/gdo/Test06a.scr b/scribble-test/src/test/resources/good/reach/globals/gdo/Test06a.scr new file mode 100644 index 000000000..bfff8c206 --- /dev/null +++ b/scribble-test/src/test/resources/good/reach/globals/gdo/Test06a.scr @@ -0,0 +1,22 @@ +module good.reach.globals.gdo.Test06a; + + +global protocol Foo(role A, role B) +{ + choice at A + { + 1() from A to B; + do Foo(A, B); + } + or + { + do Bar(A, B); + } +} + +global protocol Bar(role C, role D) +{ + 5() from C to D; + do Bar(C, D); +} + diff --git a/scribble-test/src/test/resources/good/reach/globals/gdo/Test06b.scr b/scribble-test/src/test/resources/good/reach/globals/gdo/Test06b.scr new file mode 100644 index 000000000..e96dd06e2 --- /dev/null +++ b/scribble-test/src/test/resources/good/reach/globals/gdo/Test06b.scr @@ -0,0 +1,22 @@ +module good.reach.globals.gdo.Test06b; + + +global protocol Foo(role A, role B) +{ + choice at A + { + 1() from A to B; + do Bar(A, B); + } + or + { + do Bar(A, B); + } +} + +global protocol Bar(role C, role D) +{ + 5() from C to D; + do Bar(C, D); +} + diff --git a/scribble-test/src/test/resources/good/reach/globals/gdo/Test06c.scr b/scribble-test/src/test/resources/good/reach/globals/gdo/Test06c.scr new file mode 100644 index 000000000..652e70ad6 --- /dev/null +++ b/scribble-test/src/test/resources/good/reach/globals/gdo/Test06c.scr @@ -0,0 +1,23 @@ +module good.reach.globals.gdo.Test06c; + + +global protocol Foo(role A, role B) +{ + choice at A + { + 1() from A to B; + do Bar(A, B); + } + or + { + 2() from A to B; + } + 3() from A to B; +} + +global protocol Bar(role C, role D) +{ + 5() from C to D; + do Bar(C, D); +} + diff --git a/scribble-test/src/test/resources/good/reach/globals/grecursion/Recursion08a.scr b/scribble-test/src/test/resources/good/reach/globals/grecursion/Recursion08a.scr new file mode 100644 index 000000000..bee832f00 --- /dev/null +++ b/scribble-test/src/test/resources/good/reach/globals/grecursion/Recursion08a.scr @@ -0,0 +1,20 @@ +module good.reach.globals.grecursion.Recursion08a; + + +global protocol Recursion8a(role A, role B, role C, role D) +{ + rec X + { + choice at A + { + l1() from A to B; + continue X; + } + or + { + l2() from A to B; + continue X; + } + } + l3() from C to D; +} diff --git a/scribble-test/src/test/resources/good/reach/globals/grecursion/Recursion15.scr b/scribble-test/src/test/resources/good/reach/globals/grecursion/Recursion15.scr new file mode 100644 index 000000000..83d1ca6bb --- /dev/null +++ b/scribble-test/src/test/resources/good/reach/globals/grecursion/Recursion15.scr @@ -0,0 +1,19 @@ +module good.reach.globals.grecursion.Recursion15; + + +global protocol Recursion15(role A, role B) +{ + rec X + { + m() from A to B; + choice at A + { + //m1() from A to B; + continue X; + } + or + { + m2() from A to B; + } + } +} diff --git a/scribble-test/src/test/resources/good/reach/globals/grecursion/Recursion16.scr b/scribble-test/src/test/resources/good/reach/globals/grecursion/Recursion16.scr new file mode 100644 index 000000000..09ed53c3c --- /dev/null +++ b/scribble-test/src/test/resources/good/reach/globals/grecursion/Recursion16.scr @@ -0,0 +1,19 @@ +module good.reach.globals.grecursion.Recursion16; + + +global protocol Recursion16(role A, role B) +{ + choice at A + { + m1() from A to B; + } + or + { + rec X + { + m2() from A to B; + continue X; // Uncomment (currently) bad + } + } + m3() from A to B; +} diff --git a/scribble-test/src/test/resources/good/reach/globals/grecursion/Recursion17a.scr b/scribble-test/src/test/resources/good/reach/globals/grecursion/Recursion17a.scr new file mode 100644 index 000000000..cbffaec9a --- /dev/null +++ b/scribble-test/src/test/resources/good/reach/globals/grecursion/Recursion17a.scr @@ -0,0 +1,25 @@ +module good.reach.globals.grecursion.Recursion17a; + + +global protocol Foo(role A, role B) +{ + rec Z + { + choice at A + { + rec X + { + 1() from A to B; + continue X; + } + } + or + { + rec Y + { + 2() from A to B; + } + } + } + 3() from A to B; +} diff --git a/scribble-test/src/test/resources/good/reach/globals/grecursion/Recursion17b.scr b/scribble-test/src/test/resources/good/reach/globals/grecursion/Recursion17b.scr new file mode 100644 index 000000000..76cae73f0 --- /dev/null +++ b/scribble-test/src/test/resources/good/reach/globals/grecursion/Recursion17b.scr @@ -0,0 +1,25 @@ +module good.reach.globals.grecursion.Recursion17b; + + +global protocol Foo(role A, role B) +{ + rec Z + { + choice at A + { + rec X + { + 1() from A to B; + } + } + or + { + rec Y + { + 2() from A to B; + continue Y; + } + } + } + 3() from A to B; +} diff --git a/scribble-test/src/test/resources/good/reach/globals/grecursion/Recursion17e.scr b/scribble-test/src/test/resources/good/reach/globals/grecursion/Recursion17e.scr new file mode 100644 index 000000000..22b911c58 --- /dev/null +++ b/scribble-test/src/test/resources/good/reach/globals/grecursion/Recursion17e.scr @@ -0,0 +1,26 @@ +module good.reach.globals.grecursion.Recursion17e; + + +global protocol Foo(role A, role B) +{ + rec Z + { + choice at A + { + rec X + { + 1() from A to B; + } + } + or + { + rec Y + { + 2() from A to B; + continue Y; + } + } + 4() from A to B; + } + 3() from A to B; +} diff --git a/scribble-test/src/test/resources/good/reach/globals/grecursion/Recursion19.scr b/scribble-test/src/test/resources/good/reach/globals/grecursion/Recursion19.scr new file mode 100644 index 000000000..35fb689ea --- /dev/null +++ b/scribble-test/src/test/resources/good/reach/globals/grecursion/Recursion19.scr @@ -0,0 +1,12 @@ +module good.reach.globals.grecursion.Recursion19; + + +global protocol Foo(role A, role B, role C, role D) +{ + rec X + { + 1() from A to B; + continue X; + } + 2() from C to D; +} diff --git a/scribble-test/src/test/resources/good/reach/globals/grecursion/Recursion20.scr b/scribble-test/src/test/resources/good/reach/globals/grecursion/Recursion20.scr new file mode 100644 index 000000000..b5bcf9680 --- /dev/null +++ b/scribble-test/src/test/resources/good/reach/globals/grecursion/Recursion20.scr @@ -0,0 +1,20 @@ +module good.reach.globals.grecursion.Recursion20; + + +global protocol Proto1(role A, role B) +{ + rec X + { + choice at A + { + 1() from A to B; + continue X; + } + or + { + 2() from A to B; + } + } + 3() from B to A; // Good: choice has an exit path +} + diff --git a/scribble-test/src/test/resources/good/safety/orphan/twoparty/Test01.scr b/scribble-test/src/test/resources/good/safety/orphan/twoparty/Test01.scr new file mode 100644 index 000000000..8382809f8 --- /dev/null +++ b/scribble-test/src/test/resources/good/safety/orphan/twoparty/Test01.scr @@ -0,0 +1,22 @@ +module good.safety.orphan.twoparty.Test01; + + +global protocol Proto1(role A, role B) +{ + rec X + { + choice at A + { + 1() from A to B; + continue X; + } + or + { + 1() from A to B; + 1() from A to B; + continue X; + } + } +} + + diff --git a/scribble-test/src/test/resources/good/safety/stuckmsg/fourparty/Test01.scr b/scribble-test/src/test/resources/good/safety/stuckmsg/fourparty/Test01.scr new file mode 100644 index 000000000..5053cdeec --- /dev/null +++ b/scribble-test/src/test/resources/good/safety/stuckmsg/fourparty/Test01.scr @@ -0,0 +1,38 @@ +module good.safety.stuckmsg.fourparty.Test01; + + +global protocol Proto1(role A, role B, role C, role D) +{ + choice at A + { + 1() from A to B; + rec X + { + 1() from A to B; + choice at B + { + 2() from B to C; + 2() from C to D; + choice at C + { + 2() from C to A; + } + or + { + () from C to A; + 2() from C to D; // Reception error if following is uncommented + //() from C to D; // OK because D only receives 2's + } + continue X; + } + } + } + or + { + 0() from A to B; + 0() from B to C; + 0() from C to D; + } +} + + diff --git a/scribble-test/src/test/resources/good/safety/stuckmsg/threeparty/Test01.scr b/scribble-test/src/test/resources/good/safety/stuckmsg/threeparty/Test01.scr new file mode 100644 index 000000000..0ac3f362d --- /dev/null +++ b/scribble-test/src/test/resources/good/safety/stuckmsg/threeparty/Test01.scr @@ -0,0 +1,18 @@ +module good.safety.stuckmsg.threeparty.Test01; + + +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; // Non-det "choice direction message", cf. standard branch/select syntax + 1() from B to C; + } + or + { + 1() from A to B; + 2() from B to C; + } +} + + diff --git a/scribble-test/src/test/resources/good/safety/stuckmsg/threeparty/Test03.scr b/scribble-test/src/test/resources/good/safety/stuckmsg/threeparty/Test03.scr new file mode 100644 index 000000000..829e48bcc --- /dev/null +++ b/scribble-test/src/test/resources/good/safety/stuckmsg/threeparty/Test03.scr @@ -0,0 +1,25 @@ +module good.safety.stuckmsg.threeparty.Test03; + + +// Similar to good.wfchoice.merge.Test04 +global protocol Proto1(role A, role B, role C) +{ + rec X + { + 1() from A to B; + 1() from B to C; + choice at B + { + 2() from B to A; + continue X; + } + or + { + 3() from B to A; + 1() from B to C; + //3() from B to C; + continue X; + } + } +} + diff --git a/scribble-test/src/test/resources/good/safety/stuckmsg/twoparty/Test02.scr b/scribble-test/src/test/resources/good/safety/stuckmsg/twoparty/Test02.scr new file mode 100644 index 000000000..ca0140deb --- /dev/null +++ b/scribble-test/src/test/resources/good/safety/stuckmsg/twoparty/Test02.scr @@ -0,0 +1,15 @@ +module good.safety.stuckmsg.twoparty.Test02; + + +global protocol Proto1(role A, role B) +{ + choice at A + { + 1() from A to B; + } + or + { + 1() from A to B; + } +} + diff --git a/scribble-test/src/test/resources/good/syntax/consistentchoicesubj/Test02.scr b/scribble-test/src/test/resources/good/syntax/consistentchoicesubj/Test02.scr new file mode 100644 index 000000000..43d60af22 --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/consistentchoicesubj/Test02.scr @@ -0,0 +1,16 @@ +module good.syntax.consistentchoicesubj.Test02; + + +// Maybe refactor as projection +global protocol Proto1(role C, role S) +{ + choice at C + { + 0() from C to S; + choice at S // Fixed peekParentEnv index bug for enabled choice subjs + { + 1() from S to C; + } + } +} + diff --git a/scribble-test/src/test/resources/good/syntax/consistentchoicesubj/Test03.scr b/scribble-test/src/test/resources/good/syntax/consistentchoicesubj/Test03.scr new file mode 100644 index 000000000..930976b01 --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/consistentchoicesubj/Test03.scr @@ -0,0 +1,19 @@ +module good.syntax.consistentchoicesubj.Test03; + + +// Maybe refactor as projection +global protocol Proto1(role C, role S) +{ + rec X + { + choice at C + { + 0() from C to S; + rec Y + { + 1() from S to C; + } + } + } +} + diff --git a/scribble-test/src/test/resources/good/syntax/disamb/Test01.scr b/scribble-test/src/test/resources/good/syntax/disamb/Test01.scr new file mode 100644 index 000000000..7eccc8639 --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/disamb/Test01.scr @@ -0,0 +1,14 @@ +module good.syntax.disamb.Test01; + + +sig "foo" from "bar" as M1; + + +global protocol Foo(role A, role B) +{ + () from A to B; + M from A to B; + M1 from A to B; + //M2 from A to B; +} + diff --git a/scribble-test/src/test/resources/good/syntax/disamb/imports/Import01.scr b/scribble-test/src/test/resources/good/syntax/disamb/imports/Import01.scr new file mode 100644 index 000000000..fb8d1507c --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/disamb/imports/Import01.scr @@ -0,0 +1,15 @@ +//$ bin/scribblec.sh -ip scribble-test/src/test/resources scribble-test/src/test/resources/good/syntax/disamb/imports/Import01.scr + +module good.syntax.disamb.imports.Import01; + + +import good.syntax.disamb.imports.Import01a; +import good.syntax.disamb.imports.pack1.Import01b as Test4; // <- "Test3" as Test4 + + +global protocol Import1(role A, role B) +{ + 1() from A to B; + do good.syntax.disamb.imports.Import01a.Import1a(A, B); + do Test4.Import1b(A, B); +} diff --git a/scribble-test/src/test/resources/good/syntax/disamb/imports/Import01a.scr b/scribble-test/src/test/resources/good/syntax/disamb/imports/Import01a.scr new file mode 100644 index 000000000..6d565efcc --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/disamb/imports/Import01a.scr @@ -0,0 +1,16 @@ +// bin/scribblec.sh scribble-test/src/test/resources/good/syntax/disamb/imports/Import01a.scr -ip scribble-test/src/test/resources -project Import1a C + +module good.syntax.disamb.imports.Import01a; + +import good.syntax.disamb.imports.pack1.Import01b as Test3; +import good.syntax.disamb.imports.Import01c; +import good.syntax.disamb.imports.Import01c as T4; + +global protocol Import1a(role C, role D) +{ + 2(Test3.TTT) from C to D; + 2() from C to D; + do Test3.Import1b(C, D); + do good.syntax.disamb.imports.Import01c.Import1c(C, D); + do T4.Import1c(C, D); +} diff --git a/scribble-test/src/test/resources/good/syntax/disamb/imports/Import01c.scr b/scribble-test/src/test/resources/good/syntax/disamb/imports/Import01c.scr new file mode 100644 index 000000000..075f02be9 --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/disamb/imports/Import01c.scr @@ -0,0 +1,7 @@ +module good.syntax.disamb.imports.Import01c; + + +global protocol Import1c(role C, role D) +{ + 4() from C to D; +} diff --git a/scribble-test/src/test/resources/good/syntax/disamb/imports/Import02.scr b/scribble-test/src/test/resources/good/syntax/disamb/imports/Import02.scr new file mode 100644 index 000000000..afb6c13b4 --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/disamb/imports/Import02.scr @@ -0,0 +1,25 @@ +module good.syntax.disamb.imports.Import02; + + +import good.syntax.disamb.imports.pack1.Import02b; + + +global protocol Foo(role A, role B) +{ + choice at A + { + 1() from A to B; + } + or + { + do good.syntax.disamb.imports.pack1.Import02b.Bar(A, B); + do Bar(A, B); + } +} + + +global protocol Bar(role C, role D) +{ + 2() from C to D; +} + diff --git a/scribble-test/src/test/resources/good/syntax/disamb/imports/Import03.scr b/scribble-test/src/test/resources/good/syntax/disamb/imports/Import03.scr new file mode 100644 index 000000000..cfccdd3c7 --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/disamb/imports/Import03.scr @@ -0,0 +1,13 @@ +module good.syntax.disamb.imports.Import03; + + +import good.syntax.disamb.imports.pack1.Import02b; + + +global protocol Foo(role A, role B) +{ + 1() from A to B; + do good.syntax.disamb.imports.pack1.Import02b.Bar(A, B); + 2() from A to B; +} + diff --git a/scribble-test/src/test/resources/good/syntax/disamb/imports/Import04.scr b/scribble-test/src/test/resources/good/syntax/disamb/imports/Import04.scr new file mode 100644 index 000000000..7a72abaa7 --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/disamb/imports/Import04.scr @@ -0,0 +1,11 @@ +module good.syntax.disamb.imports.Import04; + + +import good.syntax.disamb.imports.pack1.Import04b as Bar; + + +global protocol Foo(role A, role B) +{ + do Bar.Proto2(A, B); +} + diff --git a/scribble-test/src/test/resources/good/syntax/disamb/imports/Import05.scr b/scribble-test/src/test/resources/good/syntax/disamb/imports/Import05.scr new file mode 100644 index 000000000..32398d6cc --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/disamb/imports/Import05.scr @@ -0,0 +1,16 @@ +module good.syntax.disamb.imports.Import05; + + +import good.syntax.disamb.imports.pack1.Test2; +import good.syntax.disamb.imports.pack1.Test3 as Test3; // The name Test3 is test3.Test3 in Test2 +import good.syntax.disamb.imports.pack1.test3.Test3 as Test4; // The name Test4 is actually Test4 in Test2 + + +global protocol Proto1(role A, role B) +{ + 1() from A to B; + do good.syntax.disamb.imports.pack1.Test2.Proto2(A, B); + do Test3.Foo3(A, B); + do Test4.Bar3(A, B); +} + diff --git a/scribble-test/src/test/resources/good/syntax/disamb/imports/pack1/IGNORE b/scribble-test/src/test/resources/good/syntax/disamb/imports/pack1/IGNORE new file mode 100644 index 000000000..e69de29bb diff --git a/scribble-test/src/test/resources/good/syntax/disamb/imports/pack1/Import01b.scr b/scribble-test/src/test/resources/good/syntax/disamb/imports/pack1/Import01b.scr new file mode 100644 index 000000000..6e5f8c283 --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/disamb/imports/pack1/Import01b.scr @@ -0,0 +1,10 @@ +module good.syntax.disamb.imports.pack1.Import01b; + + +type "..." from "..." as TTT; + + +global protocol Import1b(role A, role B) +{ + 3() from A to B; +} diff --git a/scribble-test/src/test/resources/good/syntax/disamb/imports/pack1/Import02b.scr b/scribble-test/src/test/resources/good/syntax/disamb/imports/pack1/Import02b.scr new file mode 100644 index 000000000..50a9ed5a3 --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/disamb/imports/pack1/Import02b.scr @@ -0,0 +1,18 @@ +module good.syntax.disamb.imports.pack1.Import02b; + + +import good.syntax.disamb.imports.Import02; + + +global protocol Bar(role C, role D) +{ + 3() from C to D; + do Foo(C, D); +} + + +global protocol Foo(role A, role B) +{ + 4() from A to B; + do good.syntax.disamb.imports.Import02.Bar(B, A); +} diff --git a/scribble-test/src/test/resources/good/syntax/disamb/imports/pack1/Import04b.scr b/scribble-test/src/test/resources/good/syntax/disamb/imports/pack1/Import04b.scr new file mode 100644 index 000000000..e1607d3e6 --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/disamb/imports/pack1/Import04b.scr @@ -0,0 +1,8 @@ +module good.syntax.disamb.imports.pack1.Import04b; + + +global protocol Proto2(role C, role D) +{ + Import04b() from C to D; +} + diff --git a/scribble-test/src/test/resources/good/syntax/disamb/imports/pack1/Test2.scr b/scribble-test/src/test/resources/good/syntax/disamb/imports/pack1/Test2.scr new file mode 100644 index 000000000..2096388cb --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/disamb/imports/pack1/Test2.scr @@ -0,0 +1,16 @@ +module good.syntax.disamb.imports.pack1.Test2; + + +import good.syntax.disamb.imports.pack1.test3.Test3 as Test3; // The name Test3 is Test3 in Test1 +import good.syntax.disamb.imports.pack1.Test4 as Test4; // The name Test4 is test3.Test3 in Test1 +import good.syntax.disamb.imports.pack1.Test4 as T4; + + +global protocol Proto2(role C, role D) +{ + 2(Test3.TTT) from C to D; + do Test3.Bar3(C, D); + do Test4.Proto4(C, D); + do T4.Proto4(C, D); +} + diff --git a/scribble-test/src/test/resources/good/syntax/disamb/imports/pack1/Test3.scr b/scribble-test/src/test/resources/good/syntax/disamb/imports/pack1/Test3.scr new file mode 100644 index 000000000..7a6e414d6 --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/disamb/imports/pack1/Test3.scr @@ -0,0 +1,8 @@ +module good.syntax.disamb.imports.pack1.Test3; + + +global protocol Foo3(role C, role D) +{ + foo3() from C to D; +} + diff --git a/scribble-test/src/test/resources/good/syntax/disamb/imports/pack1/Test4.scr b/scribble-test/src/test/resources/good/syntax/disamb/imports/pack1/Test4.scr new file mode 100644 index 000000000..0f75024eb --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/disamb/imports/pack1/Test4.scr @@ -0,0 +1,8 @@ +module good.syntax.disamb.imports.pack1.Test4; + + +global protocol Proto4(role C, role D) +{ + 4() from C to D; +} + diff --git a/scribble-test/src/test/resources/good/syntax/disamb/imports/pack1/test3/IGNORE b/scribble-test/src/test/resources/good/syntax/disamb/imports/pack1/test3/IGNORE new file mode 100644 index 000000000..e69de29bb diff --git a/scribble-test/src/test/resources/good/syntax/disamb/imports/pack1/test3/Test3.scr b/scribble-test/src/test/resources/good/syntax/disamb/imports/pack1/test3/Test3.scr new file mode 100644 index 000000000..d74e9c577 --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/disamb/imports/pack1/test3/Test3.scr @@ -0,0 +1,11 @@ +module good.syntax.disamb.imports.pack1.test3.Test3; + + +type "..." from "..." as TTT; + + +global protocol Bar3(role A, role B) +{ + bar3() from A to B; +} + diff --git a/scribble-test/src/test/resources/good/syntax/disamb/payloads/Test01.scr b/scribble-test/src/test/resources/good/syntax/disamb/payloads/Test01.scr new file mode 100644 index 000000000..a49640676 --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/disamb/payloads/Test01.scr @@ -0,0 +1,27 @@ +module good.syntax.disamb.payloads.Test01; + + +type "java.lang.String" from "rt.jar" as String; +type "java.lang.String" from "rt.jar" as String2; + + +global protocol Foo(role A, role B) +{ + choice at A + { + 1(String) from A to B; + 2(good.syntax.disamb.payloads.Test01.String) from A to B; + } + or + { + 3(good.syntax.disamb.payloads.Test01.String2) from A to B; + } + do Bar(A, B); + do Bar(A, B); +} + + +aux global protocol Bar(role A, role B) +{ + (T) from A to B; +} diff --git a/scribble-test/src/test/resources/good/syntax/disamb/recvarnode/Recursion01.scr b/scribble-test/src/test/resources/good/syntax/disamb/recvarnode/Recursion01.scr new file mode 100644 index 000000000..bd8b1ac12 --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/disamb/recvarnode/Recursion01.scr @@ -0,0 +1,11 @@ +module good.syntax.disamb.recvarnode.Recursion01; + + +global protocol Proto1(role A, role B) +{ + rec A // RecVars and roles different kinds of names + { + 1() from A to B; + } +} + diff --git a/scribble-test/src/test/resources/good/syntax/disamb/recvarnode/Recursion04a.scr b/scribble-test/src/test/resources/good/syntax/disamb/recvarnode/Recursion04a.scr new file mode 100644 index 000000000..163fd4f1d --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/disamb/recvarnode/Recursion04a.scr @@ -0,0 +1,18 @@ +module good.syntax.disamb.recvarnode.Recursion04a; + + +global protocol Recursion4a(role A, role B) +{ + rec X + { + l1() from A to B; + //rec Y + rec X // Uncomment bad, even if above line is commented + { + l2() from B to A; + continue X; + //continue Y; // Uncomment OK if the above line is commented + } + } +} + diff --git a/scribble-test/src/test/resources/good/syntax/disamb/recvarnode/Recursion14b.scr b/scribble-test/src/test/resources/good/syntax/disamb/recvarnode/Recursion14b.scr new file mode 100644 index 000000000..aa2ec09f7 --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/disamb/recvarnode/Recursion14b.scr @@ -0,0 +1,22 @@ +module good.syntax.disamb.recvarnode.Recursion14b; + + +global protocol Recursion14b(role A, role B) +{ + rec X + { + l1() from A to B; + //do Y: base.recursion.Recursion14.Recursion14a(A, B); + //do X: base.recursion.Recursion14.Recursion14a(A, B); // Uncomment OK if above line is commented + do good.syntax.disamb.recvarnode.Recursion14b.Recursion14a(A, B); // Uncomment bad, even if above two lines are commented + } +} + +global protocol Recursion14a(role A, role B) +{ + rec X + { + l1() from A to B; + continue X; + } +} diff --git a/scribble-test/src/test/resources/good/syntax/inlinedunfolding/gcontinue/Test03.scr b/scribble-test/src/test/resources/good/syntax/inlinedunfolding/gcontinue/Test03.scr new file mode 100644 index 000000000..4598c2715 --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/inlinedunfolding/gcontinue/Test03.scr @@ -0,0 +1,21 @@ +module good.syntax.inlinedunfolding.gcontinue.Test03; + + +global protocol Proto1(role A, role B) +{ + rec X + { + 1() from A to B; + choice at A + { + continue X; + } + or + { + 2() from A to B; + continue X; + } + } +} + + diff --git a/scribble-test/src/test/resources/good/syntax/inlinedunfolding/gcontinue/Test05.scr b/scribble-test/src/test/resources/good/syntax/inlinedunfolding/gcontinue/Test05.scr new file mode 100644 index 000000000..4334e8c80 --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/inlinedunfolding/gcontinue/Test05.scr @@ -0,0 +1,19 @@ +module good.syntax.inlinedunfolding.gcontinue.Test05; + + +global protocol Proto1(role A, role B) +{ + rec X + { + 1() from A to B; + choice at A + { + continue X; + } + or + { + 2() from A to B; + } + } +} + diff --git a/scribble-test/src/test/resources/good/syntax/inlinedunfolding/gdo/Test01a.scr b/scribble-test/src/test/resources/good/syntax/inlinedunfolding/gdo/Test01a.scr new file mode 100644 index 000000000..8166eb0ef --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/inlinedunfolding/gdo/Test01a.scr @@ -0,0 +1,18 @@ +module good.syntax.inlinedunfolding.gdo.Test01a; + + +global protocol Foo(role A, role B) +{ + choice at A + { + do Bar(A, B); + } +} + +// The Bar inlined rec for root Foo gets "dropped" by unguarded unfolding because no continue for this rec +aux global protocol Bar(role A, role B) +{ + 1() from A to B; + do Foo(A, B); +} + diff --git a/scribble-test/src/test/resources/good/syntax/inlinedunfolding/gdo/Test01b.scr b/scribble-test/src/test/resources/good/syntax/inlinedunfolding/gdo/Test01b.scr new file mode 100644 index 000000000..682c5dc74 --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/inlinedunfolding/gdo/Test01b.scr @@ -0,0 +1,18 @@ +module good.syntax.inlinedunfolding.gdo.Test01b; + + +global protocol Foo(role A, role B) +{ + choice at A + { + do Bar(A, B); + } +} + +// For root Foo, Bar inlined as unguarded rec, then gets unfolded +aux global protocol Bar(role A, role B) +{ + 4() from A to B; + do Bar(A, B); +} + diff --git a/scribble-test/src/test/resources/good/syntax/inlinedunfolding/gdo/Test02.scr b/scribble-test/src/test/resources/good/syntax/inlinedunfolding/gdo/Test02.scr new file mode 100644 index 000000000..56e2353c3 --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/inlinedunfolding/gdo/Test02.scr @@ -0,0 +1,43 @@ +module good.syntax.inlinedunfolding.gdo.Test02; + + +import good.syntax.inlinedunfolding.gdo.pack1.Test2 as Test2; + + +global protocol Foo(role A, role B) +{ + do Test2.Proto2(A, B); + 1() from A to B; + choice at A + { + //1() from A to B; + do Bar1(A, B); + //1() from A to B; + //do Foo(A, B); + } + or + { + //5() from A to B; + do Bar2(A, B); + } + or + { + //2() from A to B; + 4() from A to B; + } +} + +global protocol Bar1(role C, role D) +{ + 2() from C to D; + 3() from C to D; + do Foo(C, D); + //do Foo(D, C); +} + +global protocol Bar2(role C, role D) +{ + 5() from C to D; + do Bar2(C, D); +} + diff --git a/scribble-test/src/test/resources/good/syntax/inlinedunfolding/gdo/Test03.scr b/scribble-test/src/test/resources/good/syntax/inlinedunfolding/gdo/Test03.scr new file mode 100644 index 000000000..252d6d02e --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/inlinedunfolding/gdo/Test03.scr @@ -0,0 +1,16 @@ +module good.syntax.inlinedunfolding.gdo.Test03; + + +global protocol Proto1(role A, role B) +{ + choice at A + { + do Proto1Aux1(A, B); // Inlined as rec, then rec "dropped" by unfolding (no continue) + } +} + +aux global protocol Proto1Aux1(role A, role B) +{ + 1() from A to B; +} + diff --git a/scribble-test/src/test/resources/good/syntax/inlinedunfolding/gdo/pack1/IGNORE b/scribble-test/src/test/resources/good/syntax/inlinedunfolding/gdo/pack1/IGNORE new file mode 100644 index 000000000..e69de29bb diff --git a/scribble-test/src/test/resources/good/syntax/inlinedunfolding/gdo/pack1/Test2.scr b/scribble-test/src/test/resources/good/syntax/inlinedunfolding/gdo/pack1/Test2.scr new file mode 100644 index 000000000..995584bed --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/inlinedunfolding/gdo/pack1/Test2.scr @@ -0,0 +1,16 @@ +module good.syntax.inlinedunfolding.gdo.pack1.Test2; + + +import good.syntax.inlinedunfolding.gdo.pack1.test3.Test3 as Test3; // The name Test3 is Test3 in Test1 +import good.syntax.inlinedunfolding.gdo.pack1.Test4 as Test4; // The name Test4 is test3.Test3 in Test1 +import good.syntax.inlinedunfolding.gdo.pack1.Test4 as T4; + + +global protocol Proto2(role C, role D) +{ + 2(Test3.TTT) from C to D; + do Test3.Bar3(C, D); + do Test4.Proto4(C, D); + do T4.Proto4(C, D); +} + diff --git a/scribble-test/src/test/resources/good/syntax/inlinedunfolding/gdo/pack1/Test3.scr b/scribble-test/src/test/resources/good/syntax/inlinedunfolding/gdo/pack1/Test3.scr new file mode 100644 index 000000000..383d71f1b --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/inlinedunfolding/gdo/pack1/Test3.scr @@ -0,0 +1,8 @@ +module good.syntax.inlinedunfolding.gdo.pack1.Test3; + + +global protocol Foo3(role C, role D) +{ + foo3() from C to D; +} + diff --git a/scribble-test/src/test/resources/good/syntax/inlinedunfolding/gdo/pack1/Test4.scr b/scribble-test/src/test/resources/good/syntax/inlinedunfolding/gdo/pack1/Test4.scr new file mode 100644 index 000000000..e32912ce9 --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/inlinedunfolding/gdo/pack1/Test4.scr @@ -0,0 +1,8 @@ +module good.syntax.inlinedunfolding.gdo.pack1.Test4; + + +global protocol Proto4(role C, role D) +{ + 4() from C to D; +} + diff --git a/scribble-test/src/test/resources/good/syntax/inlinedunfolding/gdo/pack1/test3/IGNORE b/scribble-test/src/test/resources/good/syntax/inlinedunfolding/gdo/pack1/test3/IGNORE new file mode 100644 index 000000000..e69de29bb diff --git a/scribble-test/src/test/resources/good/syntax/inlinedunfolding/gdo/pack1/test3/Test3.scr b/scribble-test/src/test/resources/good/syntax/inlinedunfolding/gdo/pack1/test3/Test3.scr new file mode 100644 index 000000000..b8fa4e5f7 --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/inlinedunfolding/gdo/pack1/test3/Test3.scr @@ -0,0 +1,11 @@ +module good.syntax.inlinedunfolding.gdo.pack1.test3.Test3; + + +type "..." from "..." as TTT; + + +global protocol Bar3(role A, role B) +{ + bar3() from A to B; +} + diff --git a/scribble-test/src/test/resources/good/syntax/inlinedunfolding/grecursion/Test01.scr b/scribble-test/src/test/resources/good/syntax/inlinedunfolding/grecursion/Test01.scr new file mode 100644 index 000000000..a1299129e --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/inlinedunfolding/grecursion/Test01.scr @@ -0,0 +1,18 @@ +module good.syntax.inlinedunfolding.grecursion.Test01; + + +global protocol Foo(role A, role B) +{ + choice at A + { + rec X // Unguarded rec gets unfolded + { + 1() from A to B; + continue X; + } + } + or + { + 2() from A to B; + } +} diff --git a/scribble-test/src/test/resources/good/syntax/inlinedunfolding/grecursion/Test02a.scr b/scribble-test/src/test/resources/good/syntax/inlinedunfolding/grecursion/Test02a.scr new file mode 100644 index 000000000..cef817c1b --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/inlinedunfolding/grecursion/Test02a.scr @@ -0,0 +1,23 @@ +module good.syntax.inlinedunfolding.grecursion.Test02a; + + +global protocol Proto1(role A, role B) +{ + rec X + { + 1() from A to B; + choice at A + { + continue X; + } + or + { + rec Y // Testing nested InlinedProtocolUnfolding case + { + 2() from A to B; + continue Y; + } + } + } +} + diff --git a/scribble-test/src/test/resources/good/syntax/inlinedunfolding/grecursion/Test02b.scr b/scribble-test/src/test/resources/good/syntax/inlinedunfolding/grecursion/Test02b.scr new file mode 100644 index 000000000..904028914 --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/inlinedunfolding/grecursion/Test02b.scr @@ -0,0 +1,23 @@ +module good.syntax.inlinedunfolding.grecursion.Test02b; + + +global protocol Proto1(role A, role B) +{ + rec X + { + choice at A + { + 3() from A to B; + continue X; + } + or + { + rec Y // Testing nested InlinedProtocolUnfolding case + { + 2() from A to B; + continue Y; + } + } + } +} + diff --git a/scribble-test/src/test/resources/good/syntax/inlinedunfolding/grecursion/Test02c.scr b/scribble-test/src/test/resources/good/syntax/inlinedunfolding/grecursion/Test02c.scr new file mode 100644 index 000000000..66f64810e --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/inlinedunfolding/grecursion/Test02c.scr @@ -0,0 +1,24 @@ +module good.syntax.inlinedunfolding.grecursion.Test02c; + + +global protocol Proto1(role A, role B) +{ + rec X + { + 1() from A to B; + choice at A + { + 3() from A to B; + continue X; + } + or + { + rec Y // Testing nested InlinedProtocolUnfolding case + { + 2() from A to B; + continue Y; + } + } + } +} + diff --git a/scribble-test/src/test/resources/good/syntax/inlinedunfolding/grecursion/Test02d.scr b/scribble-test/src/test/resources/good/syntax/inlinedunfolding/grecursion/Test02d.scr new file mode 100644 index 000000000..c490f433e --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/inlinedunfolding/grecursion/Test02d.scr @@ -0,0 +1,23 @@ +module good.syntax.inlinedunfolding.grecursion.Test02d; + + +global protocol Proto1(role A, role B) +{ + rec X + { + 1() from A to B; + choice at A + { + continue X; + } + or + { + rec Y // Testing nested InlinedProtocolUnfolding case + { + 2() from A to B; + continue X; + } + } + } +} + diff --git a/scribble-test/src/test/resources/good/syntax/inlinedunfolding/grecursion/Test02e.scr b/scribble-test/src/test/resources/good/syntax/inlinedunfolding/grecursion/Test02e.scr new file mode 100644 index 000000000..54c669477 --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/inlinedunfolding/grecursion/Test02e.scr @@ -0,0 +1,23 @@ +module good.syntax.inlinedunfolding.grecursion.Test02e; + + +global protocol Proto1(role A, role B) +{ + rec X + { + choice at A + { + 3() from A to B; + continue X; + } + or + { + rec Y // Testing nested InlinedProtocolUnfolding case + { + 2() from A to B; + continue X; + } + } + } +} + diff --git a/scribble-test/src/test/resources/good/syntax/inlinedunfolding/grecursion/Test02f.scr b/scribble-test/src/test/resources/good/syntax/inlinedunfolding/grecursion/Test02f.scr new file mode 100644 index 000000000..c0fd36e4b --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/inlinedunfolding/grecursion/Test02f.scr @@ -0,0 +1,24 @@ +module good.syntax.inlinedunfolding.grecursion.Test02f; + + +global protocol Proto1(role A, role B) +{ + rec X + { + 1() from A to B; + choice at A + { + 3() from A to B; + continue X; + } + or + { + rec Y // Testing nested InlinedProtocolUnfolding case + { + 2() from A to B; + continue X; + } + } + } +} + diff --git a/scribble-test/src/test/resources/good/syntax/inlinedunfolding/grecursion/Test04.scr b/scribble-test/src/test/resources/good/syntax/inlinedunfolding/grecursion/Test04.scr new file mode 100644 index 000000000..9d3358e85 --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/inlinedunfolding/grecursion/Test04.scr @@ -0,0 +1,24 @@ +module good.syntax.inlinedunfolding.grecursion.Test04; + + +global protocol Proto4(role A, role B) +{ + choice at A + { + rec X + { + choice at A + { + 1() from A to B; + continue X; + } + or + { + 2() from A to B; + continue X; + } + } + } +} + + diff --git a/scribble-test/src/test/resources/good/syntax/projchoicesubjfix/Test01.scr b/scribble-test/src/test/resources/good/syntax/projchoicesubjfix/Test01.scr new file mode 100644 index 000000000..a2aee86f3 --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/projchoicesubjfix/Test01.scr @@ -0,0 +1,30 @@ +module good.syntax.projchoicesubjfix.Test01; + + +// Test transitive dependency collection and doarg name subs for projected choice subj inference +global protocol Foo(role A, role B) +{ + 1() from A to B; + choice at A + { + //1() from A to B; + do Bar1(A, B); + } + or + { + do Bar2(A, B); + } +} + +global protocol Bar1(role C, role D) // Test output all projections for transitive dependency collection +{ + 2() from C to D; + do Foo(C, D); +} + +global protocol Bar2(role E, role F) +{ + 3() from E to F; + //do Foo(E, F); +} + diff --git a/scribble-test/src/test/resources/good/syntax/projection/Test01.scr b/scribble-test/src/test/resources/good/syntax/projection/Test01.scr new file mode 100644 index 000000000..c02c6a440 --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/projection/Test01.scr @@ -0,0 +1,31 @@ +module good.syntax.projection.Test01; + + +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + choice at A // Testing projection (e.g. B) + { + 2() from A to C; + } + or + { + rec X + { + 3() from A to C; + } + } + } + or + { + rec Y + { + 2() from A to B; + } + 4() from A to C; + } +} + + diff --git a/scribble-test/src/test/resources/good/syntax/projection/grecursion/Test01.scr b/scribble-test/src/test/resources/good/syntax/projection/grecursion/Test01.scr new file mode 100644 index 000000000..4f3ca7248 --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/projection/grecursion/Test01.scr @@ -0,0 +1,13 @@ +module good.syntax.projection.grecursion.Test01; + + +global protocol Proto1(role A, role B) +{ + 1() from A to B; + rec X + { + continue X; // Discarded + } + 2() from B to A; +} + diff --git a/scribble-test/src/test/resources/good/syntax/projection/grecursion/Test02a.scr b/scribble-test/src/test/resources/good/syntax/projection/grecursion/Test02a.scr new file mode 100644 index 000000000..6900df9e2 --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/projection/grecursion/Test02a.scr @@ -0,0 +1,27 @@ +module good.syntax.projection.grecursion.Test02a; + + +global protocol Proto1(role A, role B) +{ + choice at A + { + rec X // Testing unguarded choice-rec at root... + { + //1() from A to B; + choice at A + { + 2() from A to B; + } + or + { + continue X; // ..in conjunction with unguarded choice-continue -- continue pruned + } + } + } + or + { + 3() from A to B; + } +} + + diff --git a/scribble-test/src/test/resources/good/syntax/projection/grecursion/Test02b.scr b/scribble-test/src/test/resources/good/syntax/projection/grecursion/Test02b.scr new file mode 100644 index 000000000..96de550c5 --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/projection/grecursion/Test02b.scr @@ -0,0 +1,27 @@ +module good.syntax.projection.grecursion.Test02b; + + +global protocol Proto1(role A, role B) +{ + choice at A + { + rec X // Testing unguarded choice-rec at root.. + { + 1() from A to B; + choice at A + { + 2() from A to B; + } + or + { + continue X; // ..and unfolding + } + } + } + or + { + 3() from A to B; + } +} + + diff --git a/scribble-test/src/test/resources/good/syntax/projection/grecursion/Test03.scr b/scribble-test/src/test/resources/good/syntax/projection/grecursion/Test03.scr new file mode 100644 index 000000000..c70fc142c --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/projection/grecursion/Test03.scr @@ -0,0 +1,20 @@ +module good.syntax.projection.grecursion.Test03; + + +global protocol Proto1(role A, role B) +{ + rec X + { + m1() from A to B; + choice at A + { + continue X; // Not pruned because not first statement in rec body + // Will be pruned if m1() is commented + } + or + { + m2() from A to B; + } + } +} + diff --git a/scribble-test/src/test/resources/good/syntax/projection/grecursion/Test04a.scr b/scribble-test/src/test/resources/good/syntax/projection/grecursion/Test04a.scr new file mode 100644 index 000000000..345cc51de --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/projection/grecursion/Test04a.scr @@ -0,0 +1,18 @@ +module good.syntax.projection.grecursion.Test04a; + + +global protocol Proto1(role A, role B) +{ + choice at A + { + 1() from A to B; + rec X + { + choice at A + { + continue X; + } + } + } +} + diff --git a/scribble-test/src/test/resources/good/syntax/projection/grecursion/Test04b.scr b/scribble-test/src/test/resources/good/syntax/projection/grecursion/Test04b.scr new file mode 100644 index 000000000..79ff752c8 --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/projection/grecursion/Test04b.scr @@ -0,0 +1,26 @@ +module good.syntax.projection.grecursion.Test04b; + + +global protocol Proto1(role A, role B) +{ + choice at A + { + 1() from A to B; + rec Y + { + rec X + { + choice at A + { + continue X; + } + or + { + continue Y; + } + } + } + } +} + + diff --git a/scribble-test/src/test/resources/good/syntax/projection/grecursion/fair/IGNORE b/scribble-test/src/test/resources/good/syntax/projection/grecursion/fair/IGNORE new file mode 100644 index 000000000..e69de29bb diff --git a/scribble-test/src/test/resources/good/syntax/projection/grecursion/fair/Test03.scr b/scribble-test/src/test/resources/good/syntax/projection/grecursion/fair/Test03.scr new file mode 100644 index 000000000..43769a69d --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/projection/grecursion/fair/Test03.scr @@ -0,0 +1,34 @@ +module good.syntax.projection.grecursion.fair.Test03; + + +// Needs -fair +global protocol Proto1(role A, role B, role C) +{ + rec Y + { + rec Z + { + 0() from A to C; + rec X + { + choice at A + { + 1() from A to B; + continue X; // Testing "pruning" of irrelevant (wrt. role) continue cases in nested recs (e.g. C) + } + or + { + 2() from A to B; + continue Y; + } + or + { + 3a() from A to B; + 3b() from A to C; + } + } + } + } + 4() from B to C; +} + diff --git a/scribble-test/src/test/resources/good/syntax/projroledeclfix/Test01.scr b/scribble-test/src/test/resources/good/syntax/projroledeclfix/Test01.scr new file mode 100644 index 000000000..10cff809e --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/projroledeclfix/Test01.scr @@ -0,0 +1,19 @@ +//$ bin/scribblec.sh scribble-test/src/test/resources/good/syntax/projroledeclfix/Test01.scr -project Bar F + + +module good.syntax.projroledeclfix.Test01; + + +// Test unused roledecl filtering in projections +global protocol Foo(role A, role B, role C) +{ + 1() from A to B; + do Bar(A, B, C); +} + +global protocol Bar(role D, role E, role F) +{ + 2() from D to F; + do Foo(D, E, F); +} + diff --git a/scribble-test/src/test/resources/good/syntax/projroledeclfix/Test02.scr b/scribble-test/src/test/resources/good/syntax/projroledeclfix/Test02.scr new file mode 100644 index 000000000..2ca5d4e6f --- /dev/null +++ b/scribble-test/src/test/resources/good/syntax/projroledeclfix/Test02.scr @@ -0,0 +1,11 @@ +module good.syntax.projroledeclfix.Test02; + + +global protocol Proto1(role A, role B, role C, role D) +{ + 1() from A to B; + 2() from C to D; + do Proto1(A, B, C, D); // Testing projections +} + + diff --git a/scribble-test/src/test/resources/good/todo/Choice07.scr b/scribble-test/src/test/resources/good/todo/Choice07.scr new file mode 100644 index 000000000..f7b13a763 --- /dev/null +++ b/scribble-test/src/test/resources/good/todo/Choice07.scr @@ -0,0 +1,25 @@ +module good.misc.globals.gchoice.Choice07; + + +global protocol Choice7(role A, role B) +{ + /*// TODO + choice at A + { + par + { + l1() from A to B; + } + and + { + //l2() from B to A; // Uncomment is bad + l2() from A to B; + } + } + or + { + //l2() from A to B; // Uncomment is bad + l3() from A to B; + }*/ +} + diff --git a/scribble-test/src/test/resources/good/todo/Do01c.scr b/scribble-test/src/test/resources/good/todo/Do01c.scr new file mode 100644 index 000000000..dea59b3e5 --- /dev/null +++ b/scribble-test/src/test/resources/good/todo/Do01c.scr @@ -0,0 +1,17 @@ +module good.misc.globals.gdo.Do01c; + + +global protocol Do1c(role A, role B) +{ + do Do1aux(A, B); + do good.misc.globals.gdo.Do01c.Do1aux(A, B); // Uncomment is OK + do X: Do1aux(A, B); // Uncomment is OK // TODO + //do Do1aux(A, B); // Uncomment is bad + //do Do1aux(A, A); // Uncomment is bad +} + +global protocol Do1aux(role C, role D) +{ + l1() from C to D; +} + diff --git a/scribble-test/src/test/resources/good/todo/Do04b.scr b/scribble-test/src/test/resources/good/todo/Do04b.scr new file mode 100644 index 000000000..34589b050 --- /dev/null +++ b/scribble-test/src/test/resources/good/todo/Do04b.scr @@ -0,0 +1,27 @@ +module good.misc.globals.gdo.Do04b; + + +global protocol Do4b(role A, role B) +{ + choice at A + { + l1() from A to B; + } + or + { + do Do4_1(A as C, B as D); + do X: Do4_1(A as C, B as D); // Uncomment is OK // TODO + } +} + +global protocol Do4_1(role C, role D) +{ + do Do4_2(C as E, D as F); +} + +global protocol Do4_2(role E, role F) +{ + //l1() from E to F; // Uncomment OK for the X-do only, not the unscoped one + l2() from E to F; +} + diff --git a/scribble-test/src/test/resources/good/todo/Do04c.scr b/scribble-test/src/test/resources/good/todo/Do04c.scr new file mode 100644 index 000000000..dab51c326 --- /dev/null +++ b/scribble-test/src/test/resources/good/todo/Do04c.scr @@ -0,0 +1,27 @@ +module good.misc.globals.gdo.Do04c; + + +global protocol Do4c(role A, role B) +{ + choice at A + { + l1() from A to B; + } + or + { + //do Do4_1(A as C, B as D); + do X: Do4_1(A as C, B as D); // Uncomment is OK // TODO + } +} + +global protocol Do4_1(role C, role D) +{ + do Do4_2(C as E, D as F); +} + +global protocol Do4_2(role E, role F) +{ + l1() from E to F; // Uncomment OK for the X-do only, not the unscoped one + l2() from E to F; +} + diff --git a/scribble-test/src/test/resources/good/todo/Do12b.scr b/scribble-test/src/test/resources/good/todo/Do12b.scr new file mode 100644 index 000000000..9a7fa4b6e --- /dev/null +++ b/scribble-test/src/test/resources/good/todo/Do12b.scr @@ -0,0 +1,23 @@ +module good.misc.globals.gdo.Do12b; + + +global protocol Do12b(role A, role B) +{ + choice at A + { + do Do12_1(A, B); + } + or + { + //do Do12_1(A, B); // Uncomment is bad + do X: Do12_1(A, B); // Uncomment is OK // TODO + do Do12_1(A, B); + } +} + +global protocol Do12_1(role C, role D) +{ + X from C to D; +} + + diff --git a/scribble-test/src/test/resources/good/todo/Do16.scr b/scribble-test/src/test/resources/good/todo/Do16.scr new file mode 100644 index 000000000..0aa8135b1 --- /dev/null +++ b/scribble-test/src/test/resources/good/todo/Do16.scr @@ -0,0 +1,33 @@ +module good.misc.globals.gdo.Do16; + + +global protocol Do16(role A, role B) +{ + /*// TODO + par + { + l1() from A to B; + do Do16a(A, B); + //do Do16(A, B); // Uncomment is bad, inlcuding if above line is commented + } + and + { + l2() from A to B; + }*/ +} + +global protocol Do16a(role A, role B) +{ + choice at A + { + l3() from A to B; + do Do16a(A, B); + //do Do16(A, B); // Uncomment is bad, including if above line is commented + } + or + { + l4() from A to B; + //l2() from A to B; // Uncomment is bad + } +} + diff --git a/scribble-test/src/test/resources/good/todo/Do18.scr b/scribble-test/src/test/resources/good/todo/Do18.scr new file mode 100644 index 000000000..bf6c9bf1a --- /dev/null +++ b/scribble-test/src/test/resources/good/todo/Do18.scr @@ -0,0 +1,22 @@ +module good.misc.globals.gdo.Do18; + + +global protocol Do18(role A, role B) +{ + do Do18a(A, B); + //do Do18a(A, B); // Uncomment is bad +} + +global protocol Do18a(role C, role D) +{ + /*// TODO + par + { + X from C to D; + } + and + { + Y from C to D; + }*/ +} + diff --git a/scribble-test/src/test/resources/good/todo/Do20.scr b/scribble-test/src/test/resources/good/todo/Do20.scr new file mode 100644 index 000000000..a62f0dd90 --- /dev/null +++ b/scribble-test/src/test/resources/good/todo/Do20.scr @@ -0,0 +1,22 @@ +module good.misc.globals.gdo.Do20; + + +global protocol Do20(role A, role B) +{ + do Do20Aux(A, B); +} + +global protocol Do20Aux(role C, role D) +{ + /*// TODO + interruptible + { + X from C to D; + } + with + { + //Y by C; // FIXME: interrupt parameter + l2() by C; + }*/ +} + diff --git a/scribble-test/src/test/resources/good/todo/Do22.scr b/scribble-test/src/test/resources/good/todo/Do22.scr new file mode 100644 index 000000000..b7bc76705 --- /dev/null +++ b/scribble-test/src/test/resources/good/todo/Do22.scr @@ -0,0 +1,22 @@ +module good.misc.globals.gdo.Do22; + + +// Maybe subsumed by Do12 +global protocol Do22(role A, role B) +{ + choice at A + { + do X: Do22a(A, B); // TODO + //do Do22a(A, B); // Uncomment not OK if above line is commented + } + or + { + l1() from A to B; + } +} + +global protocol Do22a(role C, role D) +{ + l1() from C to D; +} + diff --git a/scribble-test/src/test/resources/good/todo/Do24.scr b/scribble-test/src/test/resources/good/todo/Do24.scr new file mode 100644 index 000000000..5e9db3cb5 --- /dev/null +++ b/scribble-test/src/test/resources/good/todo/Do24.scr @@ -0,0 +1,24 @@ +module good.misc.globals.gdo.Do24; + + +global protocol Do24(role A, role B) +{ + /*// TODO + interruptible + { + l1() from A to B; + do Do24a(A, B); + //do Do24(A, B); // Uncomment bad + } + with + { + + }*/ +} + +global protocol Do24a(role C, role D) +{ + l1() from C to D; + do Do24a(C, D); + //do Do24(C, D); // Uncomment bad even if above line is commented +} diff --git a/scribble-test/src/test/resources/good/todo/Do28.scr b/scribble-test/src/test/resources/good/todo/Do28.scr new file mode 100644 index 000000000..7aae6865c --- /dev/null +++ b/scribble-test/src/test/resources/good/todo/Do28.scr @@ -0,0 +1,20 @@ +module good.misc.globals.gdo.Do28; + + +global protocol Do28(role A, role B) +{ + choice at A + { + m1() from A to B; + } + or + { + //do Do28a(A, B); // Uncomment bad + do X: Do28a(A, B); // TODO + } +} + +global protocol Do28a(role C, role D) +{ + m1() from C to D; +} diff --git a/scribble-test/src/test/resources/good/todo/IGNORE b/scribble-test/src/test/resources/good/todo/IGNORE new file mode 100644 index 000000000..e69de29bb diff --git a/scribble-test/src/test/resources/good/todo/Recursion08.scr b/scribble-test/src/test/resources/good/todo/Recursion08.scr new file mode 100644 index 000000000..1bcdf1f5a --- /dev/null +++ b/scribble-test/src/test/resources/good/todo/Recursion08.scr @@ -0,0 +1,20 @@ +module good.misc.globals.grecursion.Recursion08; + + +global protocol Recursion8(role A, role B) +{ + rec X + { + /*// TODO: + par + { + l1() from A to B; + } + and + { + l2() from A to B; + }*/ + continue X; + } +} + diff --git a/scribble-test/src/test/resources/good/todo/Recursion09.scr b/scribble-test/src/test/resources/good/todo/Recursion09.scr new file mode 100644 index 000000000..e88c022c9 --- /dev/null +++ b/scribble-test/src/test/resources/good/todo/Recursion09.scr @@ -0,0 +1,20 @@ +module good.misc.globals.grecursion.Recursion09; + + +global protocol Recursion9(role A, role B) +{ + rec X + { + /*// TODO: + par + { + l1() from A to B; + } + and + { + l2() from B to A; // "potential deadlock" warning (not related to recursion) + }*/ + continue X; + } +} + diff --git a/scribble-test/src/test/resources/good/todo/Recursion10.scr b/scribble-test/src/test/resources/good/todo/Recursion10.scr new file mode 100644 index 000000000..23f3be483 --- /dev/null +++ b/scribble-test/src/test/resources/good/todo/Recursion10.scr @@ -0,0 +1,20 @@ +module parsing.globals.grecursion.Recursion10; + + +global protocol Recursion10(role A, role B, role C) +{ + rec X + { + /* // TODO: + par + { + l1() from A to B; + } + and + { + l2() from C to A; + }*/ + continue X; + } +} + diff --git a/scribble-test/src/test/resources/good/todo/Recursion12.scr b/scribble-test/src/test/resources/good/todo/Recursion12.scr new file mode 100644 index 000000000..c9b686d65 --- /dev/null +++ b/scribble-test/src/test/resources/good/todo/Recursion12.scr @@ -0,0 +1,21 @@ +module parsing.globals.grecursion.Recursion12; + + +global protocol Recursion12(role A, role B) +{ + /*// TODO: + par + { + rec X + { + l1() from A to B; + continue X; + } + } + and + { + l2() from B to A; + }*/ + //l3() from B to A; // Uncommented bad +} + diff --git a/scribble-test/src/test/resources/good/todo/Recursion14.scr b/scribble-test/src/test/resources/good/todo/Recursion14.scr new file mode 100644 index 000000000..0d2a5db94 --- /dev/null +++ b/scribble-test/src/test/resources/good/todo/Recursion14.scr @@ -0,0 +1,23 @@ +module parsing.globals.grecursion.Recursion14; + + +global protocol Recursion14(role A, role B) +{ + rec X + { + l1() from A to B; + /*// TODO: + do Y: base.recursion.Recursion14.Recursion14a(A, B); + //do X: base.recursion.Recursion14.Recursion14a(A, B); // Uncomment OK if above line is commented + //do base.recursion.Recursion14.Recursion14a(A, B); // Uncomment bad, even if above two lines are commented*/ + } +} + +global protocol Recursion14a(role A, role B) +{ + rec X + { + l1() from A to B; + continue X; + } +} diff --git a/scribble-test/src/test/resources/good/wfchoice/enabling/threeparty/Test01.scr b/scribble-test/src/test/resources/good/wfchoice/enabling/threeparty/Test01.scr new file mode 100644 index 000000000..c4e6e5d75 --- /dev/null +++ b/scribble-test/src/test/resources/good/wfchoice/enabling/threeparty/Test01.scr @@ -0,0 +1,17 @@ +module good.wfchoice.enabling.threeparty.Test01; + + +global protocol Proto1(role A, role B, role C) +{ + 1() from A to B; + 1() from A to C; + choice at A + { + do Proto1(A, B, C); + } + or + { + 2() from A to B; + 2() from A to C; + } +} diff --git a/scribble-test/src/test/resources/good/wfchoice/enabling/threeparty/Test03b.scr b/scribble-test/src/test/resources/good/wfchoice/enabling/threeparty/Test03b.scr new file mode 100644 index 000000000..a685f6b0b --- /dev/null +++ b/scribble-test/src/test/resources/good/wfchoice/enabling/threeparty/Test03b.scr @@ -0,0 +1,30 @@ +module good.wfchoice.enabling.threeparty.Test03b; + + +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + choice at B + { + 1() from B to C; + //continue X; // Non-enabled A under this choice at B + } + or + { + 3() from B to C; + //continue X; + } + continue X; // Scribble needs "sequencing" + } + or + { + 2() from A to B; + 2() from B to C; + } + } +} + diff --git a/scribble-test/src/test/resources/good/wfchoice/enabling/twoparty/Test01.scr b/scribble-test/src/test/resources/good/wfchoice/enabling/twoparty/Test01.scr new file mode 100644 index 000000000..5dad7dda5 --- /dev/null +++ b/scribble-test/src/test/resources/good/wfchoice/enabling/twoparty/Test01.scr @@ -0,0 +1,30 @@ +module good.wfchoice.enabling.twoparty.Test01; + + +global protocol Proto1(role A, role B) +{ + choice at A + { + 1() from A to B; + 2() from B to A; + choice at A // Nested choice: check for distinct enabling messages in path collection is not broken for the two paths in this choice induced by nested choice + { + 3a() from A to B; + } + or + { + 3b() from A to B; + } + } + 4() from B to A; + choice at A + { + 5a() from A to B; + } + or + { + 5b() from A to B; + } + // Check path collection // Deprecated +} + diff --git a/scribble-test/src/test/resources/good/wfchoice/enabling/twoparty/Test02.scr b/scribble-test/src/test/resources/good/wfchoice/enabling/twoparty/Test02.scr new file mode 100644 index 000000000..37b19e865 --- /dev/null +++ b/scribble-test/src/test/resources/good/wfchoice/enabling/twoparty/Test02.scr @@ -0,0 +1,38 @@ +module good.wfchoice.enabling.twoparty.Test02; + + +//* +global protocol Proto1(role A, role B) +{ + choice at A + { + 1() from A to B; + choice at B + { + 2() from B to A; + } + or + { + 3() from B to A; + } + } +} +/*/ +//Standard problem of basic path/trace based WF choice checking: non-equiv (e.g. bisim) nested choice structures get conflated (as set of all traces), when looking downstream (not just enabling message) +//checking enabling only via global model is easy, difficulty is merge +//* +global protocol Proto1(role A, role B) +{ + choice at A + { + 1() from A to B; + 2() from B to A; + } + or + { + 1() from A to B; + 3() from B to A; + } +} +//*/ + diff --git a/scribble-test/src/test/resources/good/wfchoice/gchoice/Choice09b.scr b/scribble-test/src/test/resources/good/wfchoice/gchoice/Choice09b.scr new file mode 100644 index 000000000..8dd30fd7e --- /dev/null +++ b/scribble-test/src/test/resources/good/wfchoice/gchoice/Choice09b.scr @@ -0,0 +1,34 @@ +module good.wfchoice.gchoice.Choice09b; + + +global protocol Proto1(role A, role B, role C) +{ + 3() from A to C; + rec Y + { + () from A to B; // Uncomment is bad (non-enabled B / non-disjoint labels) + 2a() from B to A; + rec X + { + 1() from A to B; + choice at A + { + 2() from A to B; + continue X; // Testing project choice subject "inference", and testing continue-only choice block + } + or + { + continue X; + } + or + { + continue Y; // Different continue-only-blocks, tests FSM building + } + or + { + 4() from A to B; + } + } + } +} + diff --git a/scribble-test/src/test/resources/good/wfchoice/gchoice/Choice09c.scr b/scribble-test/src/test/resources/good/wfchoice/gchoice/Choice09c.scr new file mode 100644 index 000000000..3f4f495f6 --- /dev/null +++ b/scribble-test/src/test/resources/good/wfchoice/gchoice/Choice09c.scr @@ -0,0 +1,33 @@ +module good.wfchoice.gchoice.Choice09c; + + +global protocol Proto1(role A, role B, role C) +{ + 3() from A to C; + rec Y + { + () from A to B; + 2a() from B to A; + rec X + { + 1() from A to B; + choice at A + { + continue X; // Testing project choice subject "inference", and testing continue-only choice block + } + or + { + continue X; + } + or + { + continue Y; // Different continue-only-blocks, tests FSM building + } + or + { + 4() from A to B; + } + } + } +} + diff --git a/scribble-test/src/test/resources/good/wfchoice/gchoice/Choice09d.scr b/scribble-test/src/test/resources/good/wfchoice/gchoice/Choice09d.scr new file mode 100644 index 000000000..0c2cfb8aa --- /dev/null +++ b/scribble-test/src/test/resources/good/wfchoice/gchoice/Choice09d.scr @@ -0,0 +1,33 @@ +module good.wfchoice.gchoice.Choice09d; + + +global protocol Proto1(role A, role B, role C) +{ + 3() from A to C; + rec Y + { + () from A to B; + 2a() from B to A; + rec X + { + 1() from A to B; + choice at A + { + continue X; // Testing project choice subject "inference", and testing continue-only choice block + } + or + { + continue Y; // Different continue-only-blocks, tests FSM building + } + or + { + continue X; + } + or + { + 4() from A to B; + } + } + } +} + diff --git a/scribble-test/src/test/resources/good/wfchoice/gchoice/Choice09e.scr b/scribble-test/src/test/resources/good/wfchoice/gchoice/Choice09e.scr new file mode 100644 index 000000000..948cff727 --- /dev/null +++ b/scribble-test/src/test/resources/good/wfchoice/gchoice/Choice09e.scr @@ -0,0 +1,33 @@ +module good.wfchoice.gchoice.Choice09e; + + +global protocol Proto1(role A, role B, role C) +{ + 3() from A to C; + rec Y + { + () from A to B; + 2a() from B to A; + rec X + { + 1() from A to B; + choice at A + { + continue Y; // Different continue-only-blocks, tests FSM building + } + or + { + continue X; // Testing project choice subject "inference", and testing continue-only choice block + } + or + { + continue X; + } + or + { + 4() from A to B; + } + } + } +} + diff --git a/scribble-test/src/test/resources/good/wfchoice/gchoice/Choice10.scr b/scribble-test/src/test/resources/good/wfchoice/gchoice/Choice10.scr new file mode 100644 index 000000000..ea8e0ca6b --- /dev/null +++ b/scribble-test/src/test/resources/good/wfchoice/gchoice/Choice10.scr @@ -0,0 +1,35 @@ +module good.wfchoice.gchoice.Choice10; + + +global protocol Proto1(role A, role B) +{ + rec X + { + 1() from A to B; + choice at A + { + continue X; + } + or + { + rec Y + { + 2() from A to B; + choice at A + { + continue X; + } + or + { + 2() from A to B; // OK to be 2, because the above continue-X does 1() first + } + or + { + 3() from A to B; + continue Y; + } + } + } + } +} + diff --git a/scribble-test/src/test/resources/good/wfchoice/gchoice/Choice11.scr b/scribble-test/src/test/resources/good/wfchoice/gchoice/Choice11.scr new file mode 100644 index 000000000..9735a71a1 --- /dev/null +++ b/scribble-test/src/test/resources/good/wfchoice/gchoice/Choice11.scr @@ -0,0 +1,25 @@ +module good.wfchoice.gchoice.Choice11; + + +global protocol Proto1(role A, role B, role C) +{ + rec X + { + 1() from A to B; + //1() from B to C; // bad enabling + //2() from A to B; // bad safety + //1() from A to C; // bad liveness + choice at A + { + 1() from A to C; + continue X; + } + or + { + 2() from A to B; + 2() from A to C; + } + } +} + + diff --git a/scribble-test/src/test/resources/good/wfchoice/gdo/Test01.scr b/scribble-test/src/test/resources/good/wfchoice/gdo/Test01.scr new file mode 100644 index 000000000..1974a00bc --- /dev/null +++ b/scribble-test/src/test/resources/good/wfchoice/gdo/Test01.scr @@ -0,0 +1,17 @@ +module good.wfchoice.gdo.Test01; + + +global protocol Foo(role A, role B) +{ + do Bar(A, B); +} + + +aux global protocol Bar(role A, role B) +{ + choice at A + { + 1() from A to B; // Enabling message recursive subproto + do Bar(B, A); + } +} diff --git a/scribble-test/src/test/resources/good/wfchoice/gdo/Test02.scr b/scribble-test/src/test/resources/good/wfchoice/gdo/Test02.scr new file mode 100644 index 000000000..459132c13 --- /dev/null +++ b/scribble-test/src/test/resources/good/wfchoice/gdo/Test02.scr @@ -0,0 +1,22 @@ +module good.wfchoice.gdo.Test02; + + +global protocol Foo(role A, role B) +{ + 1() from A to B; + choice at A + { + 2() from A to B; + } + or + { + do Bar(A, B); + } +} + + +global protocol Bar(role A, role B) +{ + do Foo(A, B); +} + diff --git a/scribble-test/src/test/resources/good/wfchoice/gdo/params/Test01.scr b/scribble-test/src/test/resources/good/wfchoice/gdo/params/Test01.scr new file mode 100644 index 000000000..81ec8788e --- /dev/null +++ b/scribble-test/src/test/resources/good/wfchoice/gdo/params/Test01.scr @@ -0,0 +1,23 @@ +module good.wfchoice.gdo.params.Test01; + + +global protocol Foo(role A, role B) +{ + choice at A + { + M1 from A to B; + 3() from B to A; + } + or + { + do Bar<1()>(A, B); + 4() from B to A; + } +} + + +aux global protocol Bar(role C, role D) +{ + M2 from C to D; +} + diff --git a/scribble-test/src/test/resources/good/wfchoice/gdo/params/Test02.scr b/scribble-test/src/test/resources/good/wfchoice/gdo/params/Test02.scr new file mode 100644 index 000000000..8f63e0657 --- /dev/null +++ b/scribble-test/src/test/resources/good/wfchoice/gdo/params/Test02.scr @@ -0,0 +1,25 @@ +//$ bin/scribblec.sh scribble-test/src/test/resources/good/wfchoice/gdo/Test02.scr -project Foo A + + +module good.wfchoice.gdo.params.Test02; + + +global protocol Foo(role A, role B) +{ + choice at A + { + do Bar<1()>(A, B); + 1() from B to A; + } + or + { + do Bar<2()>(A, B); + 2() from B to A; + } +} + +aux global protocol Bar(role C, role D) +{ + M from C to D; +} + diff --git a/scribble-test/src/test/resources/good/wfchoice/merge/Test01.scr b/scribble-test/src/test/resources/good/wfchoice/merge/Test01.scr new file mode 100644 index 000000000..6b3429bf0 --- /dev/null +++ b/scribble-test/src/test/resources/good/wfchoice/merge/Test01.scr @@ -0,0 +1,17 @@ +module good.wfchoice.merge.Test01; + + +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 3() from B to C; + } + or + { + 2() from A to B; + 3() from B to C; // Testing same continuation for C (mergability, rather than just factoring out) + } +} + diff --git a/scribble-test/src/test/resources/good/wfchoice/merge/Test02.scr b/scribble-test/src/test/resources/good/wfchoice/merge/Test02.scr new file mode 100644 index 000000000..8fe9ea4f4 --- /dev/null +++ b/scribble-test/src/test/resources/good/wfchoice/merge/Test02.scr @@ -0,0 +1,20 @@ +module good.wfchoice.merge.Test02; + + +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 2() from B to C; // Needs "merge", cannot be factored out + 4() from A to B; + } + or + { + 3() from A to B; + 2() from B to C; + 5() from A to B; + } +} + + diff --git a/scribble-test/src/test/resources/good/wfchoice/merge/Test03.scr b/scribble-test/src/test/resources/good/wfchoice/merge/Test03.scr new file mode 100644 index 000000000..cdc7fb627 --- /dev/null +++ b/scribble-test/src/test/resources/good/wfchoice/merge/Test03.scr @@ -0,0 +1,19 @@ +module good.wfchoice.merge.Test03; + + +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 1() from B to C; + } + or + { + 2() from A to B; + 1() from B to C; // Comment is bad + } + 2() from C to B; +} + + diff --git a/scribble-test/src/test/resources/good/wfchoice/merge/Test04a.scr b/scribble-test/src/test/resources/good/wfchoice/merge/Test04a.scr new file mode 100644 index 000000000..be7e95fe4 --- /dev/null +++ b/scribble-test/src/test/resources/good/wfchoice/merge/Test04a.scr @@ -0,0 +1,27 @@ +module good.wfchoice.merge.Test04a; + + +// Similar to good.safety.stuckmsg.threeparty.Test03 +global protocol Proto1(role A, role B, role C) +{ + rec X + { + 1() from A to B; + 2() from B to C; + 3() from B to C; + choice at A // Not mergeable by, e.g., ICALP13 + { + 4() from A to B; + continue X; + } + or + { + 5() from A to B; + 2() from B to C; // An "extra iteration" between B-C (but not A-B), but fine // Generates non-det B?2's for C to different states, but OK (cf. -minfsm) + 3() from B to C; + continue X; + } + } +} + + diff --git a/scribble-test/src/test/resources/good/wfchoice/merge/Test04b.scr b/scribble-test/src/test/resources/good/wfchoice/merge/Test04b.scr new file mode 100644 index 000000000..a4e0ec404 --- /dev/null +++ b/scribble-test/src/test/resources/good/wfchoice/merge/Test04b.scr @@ -0,0 +1,28 @@ +module good.wfchoice.merge.Test04b; + + +global protocol Proto1(role A, role B, role C) +{ + rec X + { + rec Y + { + 1() from A to B; + 2() from A to C; + choice at C + { + 3() from C to A; + continue X; + } + or + { + 4() from C to A; + 1() from A to B; // B only receives 1's, so mergeable + 1() from A to B; + continue Y; + } + } + } +} + + diff --git a/scribble-test/src/test/resources/good/wfchoice/merge/Test05.scr b/scribble-test/src/test/resources/good/wfchoice/merge/Test05.scr new file mode 100644 index 000000000..1d4946150 --- /dev/null +++ b/scribble-test/src/test/resources/good/wfchoice/merge/Test05.scr @@ -0,0 +1,20 @@ +module good.wfchoice.merge.Test05; + + +global protocol Proto1(role A, role B) +{ + choice at A // Not syntactically allowed or mergeable by standard MPST, plain syntactic equality of cases + { + 1() from A to B; + 1() from B to A; + 2() from A to B; + } + or + { + 1() from A to B; + 1() from B to A; + 2() from A to B; + } +} + + diff --git a/scribble-test/src/test/resources/good/wfchoice/merge/Test06.scr b/scribble-test/src/test/resources/good/wfchoice/merge/Test06.scr new file mode 100644 index 000000000..8e33d5bed --- /dev/null +++ b/scribble-test/src/test/resources/good/wfchoice/merge/Test06.scr @@ -0,0 +1,25 @@ +module good.wfchoice.merge.Test06; + + +type "java.lang.String" from "rt.jar" as String; +type "java.lang.Integer" from "rt.jar" as Int; +type "java.lang.Boolean" from "rt.jar" as Bool; +type "java.lang.Float" from "rt.jar" as Float; + + +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + Msg1a(String) from A to B; + Msg2(Int) from B to C; + Msg3(Bool) from C to A; + } + or + { + Msg1b(Float) from A to B; + Msg2(Int) from B to C; + Msg3(Bool) from C to A; + } +} + diff --git a/scribble-test/src/test/resources/scribble/examples/GMessage.scr b/scribble-test/src/test/resources/scribble/examples/GMessage.scr new file mode 100644 index 000000000..c2644017f --- /dev/null +++ b/scribble-test/src/test/resources/scribble/examples/GMessage.scr @@ -0,0 +1,9 @@ +module scribble.examples.GMessage; + +type "{http://www.acme.com/financial}Order" from "http://www.acme.com/schemas/Order.xsd" as Order; +type "{http://www.acme.com/financial}Customer" from "http://www.acme.com/schemas/Customer.xsd" as Customer; + +global protocol GMessageProtocol(role Buyer, role Seller) { + buy(Order, Customer) from Buyer to Seller; + buy(Order) from Buyer to Seller; +} diff --git a/scribble-test/src/test/resources/scribble/examples/Imports.scr b/scribble-test/src/test/resources/scribble/examples/Imports.scr new file mode 100644 index 000000000..ec23f7934 --- /dev/null +++ b/scribble-test/src/test/resources/scribble/examples/Imports.scr @@ -0,0 +1,7 @@ +module scribble.examples.Imports; + +import scribble.examples.GMessage; + +global protocol ImportsProtocol(role Buyer, role Seller) { + do GMessage.GMessageProtocol(Buyer, Seller); +} diff --git a/scribble-test/src/test/scrib/demo/fase17/intro/FirstL.scr b/scribble-test/src/test/scrib/demo/fase17/intro/FirstL.scr new file mode 100644 index 000000000..36df81a49 --- /dev/null +++ b/scribble-test/src/test/scrib/demo/fase17/intro/FirstL.scr @@ -0,0 +1,18 @@ +module demo.fase17.intro.FirstL; + + +global protocol P1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + } + or + { + 2() from A to C; + } + continue X; + } +} diff --git a/scribble-test/src/test/scrib/demo/fase17/intro/FirstR.scr b/scribble-test/src/test/scrib/demo/fase17/intro/FirstR.scr new file mode 100644 index 000000000..d9d063f26 --- /dev/null +++ b/scribble-test/src/test/scrib/demo/fase17/intro/FirstR.scr @@ -0,0 +1,20 @@ +module demo.fase17.intro.FirstR; + + +explicit global protocol P2(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() connect A to B; + disconnect A and B; + } + or + { + 2() connect A to C; + disconnect A and C; + } + continue X; + } +} diff --git a/scribble-test/src/test/scrib/demo/fase17/overview/P1.scr b/scribble-test/src/test/scrib/demo/fase17/overview/P1.scr new file mode 100644 index 000000000..26ecd3387 --- /dev/null +++ b/scribble-test/src/test/scrib/demo/fase17/overview/P1.scr @@ -0,0 +1,14 @@ +module demo.fase17.overview.P1; + + +global protocol P1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + } + or + { + 2() from A to C; + } +} diff --git a/scribble-test/src/test/scrib/demo/fase17/travel/TravelA.java b/scribble-test/src/test/scrib/demo/fase17/travel/TravelA.java new file mode 100644 index 000000000..ce758b1da --- /dev/null +++ b/scribble-test/src/test/scrib/demo/fase17/travel/TravelA.java @@ -0,0 +1,79 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package demo.fase17.travel; + +import static demo.fase17.travel.TravelAgent.TravelAgent.TravelAgent.A; +import static demo.fase17.travel.TravelAgent.TravelAgent.TravelAgent.C; +import static demo.fase17.travel.TravelAgent.TravelAgent.TravelAgent.query; +import static demo.fase17.travel.TravelAgent.TravelAgent.TravelAgent.quote; +import static demo.fase17.travel.TravelAgent.TravelAgent.TravelAgent.accpt; +import static demo.fase17.travel.TravelAgent.TravelAgent.TravelAgent.reject; + +import java.io.IOException; + +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.util.Buf; +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.net.SocketChannelServer; +import org.scribble.runtime.session.ExplicitEndpoint; + +import demo.fase17.travel.TravelAgent.TravelAgent.TravelAgent; +import demo.fase17.travel.TravelAgent.TravelAgent.statechans.A.EndSocket; +import demo.fase17.travel.TravelAgent.TravelAgent.statechans.A.TravelAgent_A_1; +import demo.fase17.travel.TravelAgent.TravelAgent.statechans.A.TravelAgent_A_2_Cases; +import demo.fase17.travel.TravelAgent.TravelAgent.roles.A; + +public class TravelA +{ + public void run() throws Exception + { + try (ScribServerSocket ss = new SocketChannelServer(8888)) + { + while (true) + { + TravelAgent sess = new TravelAgent(); + try (ExplicitEndpoint se = new ExplicitEndpoint<>(sess, A, new ObjectStreamFormatter())) + { + run( + new TravelAgent_A_1(se) + .accept(C, ss) + .branch(C)); + } + catch (ScribRuntimeException | IOException | ClassNotFoundException e) + { + e.printStackTrace(); + } + } + } + } + + private EndSocket run(TravelAgent_A_2_Cases A2) throws Exception + { + Buf b = new Buf<>(); + switch (A2.op) + { + case query: A2 = A2.receive(query, b).send(C, quote, 1234).branch(C); System.out.println("(A) query: " + b.val); return run(A2); + case accpt: EndSocket end = A2.receive(accpt, b); System.out.println("(A) yes: " + b.val); return end; + case reject: return A2.receive(reject); + default: throw new RuntimeException("Shouldn't get in here: " + A2.op); + } + } + + public static void main(String[] args) throws Exception + { + new TravelA().run(); + } +} diff --git a/scribble-test/src/test/scrib/demo/fase17/travel/TravelAgent.scr b/scribble-test/src/test/scrib/demo/fase17/travel/TravelAgent.scr new file mode 100644 index 000000000..042e563e7 --- /dev/null +++ b/scribble-test/src/test/scrib/demo/fase17/travel/TravelAgent.scr @@ -0,0 +1,45 @@ +//$ bin/scribblec.sh scribble-test/src/test/scrib/demo/fase17/travel/TravelAgent.scr -ip scribble-test/src/test/scrib/ -d scribble-test/src/test/scrib -api TravelAgent C -v +//$ javadoc -cp scribble-core/target/classes:scribble-runtime/target/classes:scribble-test/src/test/scrib -subpackages demo.fase17.travel.TravelAgent.TravelAgent -d scribble-test/javadoc/fase17/travel + + +module demo.fase17.travel.TravelAgent; + +type "java.lang.Integer" from "rt.jar" as Int; +type "java.lang.String" from "rt.jar" as String; + + +explicit global protocol TravelAgent(role C, role A, role S) +{ + connect C to A; + do Nego(C, A, S); +} + +aux global protocol Nego(role C, role A, role S) +{ + choice at C + { + query(String) from C to A; + quote(Int) from A to C; + do Nego(C, A, S); + } + or + { + do Pay(C, A, S); + } +} + +// has to be aux (if default, then C/S duplicate connection; if explicit, C/A not connected) +aux global protocol Pay(role C, role A, role S) +{ + choice at C + { + connect C to S; + payment(String) from C to S; + confirm(Int) from S to C; + accpt(Int) from C to A; + } + or + { + reject() from C to A; + } +} diff --git a/scribble-test/src/test/scrib/demo/fase17/travel/TravelC.java b/scribble-test/src/test/scrib/demo/fase17/travel/TravelC.java new file mode 100644 index 000000000..bd6d62444 --- /dev/null +++ b/scribble-test/src/test/scrib/demo/fase17/travel/TravelC.java @@ -0,0 +1,71 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package demo.fase17.travel; + +import static demo.fase17.travel.TravelAgent.TravelAgent.TravelAgent.A; +import static demo.fase17.travel.TravelAgent.TravelAgent.TravelAgent.C; +import static demo.fase17.travel.TravelAgent.TravelAgent.TravelAgent.S; +import static demo.fase17.travel.TravelAgent.TravelAgent.TravelAgent.confirm; +import static demo.fase17.travel.TravelAgent.TravelAgent.TravelAgent.payment; +import static demo.fase17.travel.TravelAgent.TravelAgent.TravelAgent.query; +import static demo.fase17.travel.TravelAgent.TravelAgent.TravelAgent.quote; +import static demo.fase17.travel.TravelAgent.TravelAgent.TravelAgent.accpt; + +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.util.Buf; +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.net.SocketChannelServer; +import org.scribble.runtime.session.ExplicitEndpoint; + +import demo.fase17.travel.TravelAgent.TravelAgent.TravelAgent; +import demo.fase17.travel.TravelAgent.TravelAgent.statechans.C.TravelAgent_C_1; +import demo.fase17.travel.TravelAgent.TravelAgent.statechans.C.TravelAgent_C_2; +import demo.fase17.travel.TravelAgent.TravelAgent.roles.C; + +public class TravelC +{ + public void run() throws Exception + { + String[] queries = { "aaa", "bbb", "ccc" }; + + TravelAgent sess = new TravelAgent(); + try (ExplicitEndpoint se = new ExplicitEndpoint<>(sess, C, new ObjectStreamFormatter())) + { + Buf b = new Buf<>(); + TravelAgent_C_2 C2 = new TravelAgent_C_1(se) + .request(A, SocketChannelEndpoint::new, "localhost", 8888); + + //Stream.of(queries).forEach((q) -> C2.send(A, query, q).receive(A, quote, b)); // C2 not reassigned; exceptions not handled + for (int i = 0; i < queries.length; i++) + { + C2 = C2.send(A, query, queries[i]).receive(A, quote, b); + } + + C2.request(S, SocketChannelEndpoint::new, "localhost", 9999) + .send(S, payment, "efgh") + .receive(S, confirm, b) + .send(A, accpt, b.val); // Forward payment ref number + + System.out.println("(C) confirm: " + b.val); + } + } + + public static void main(String[] args) throws Exception + { + new TravelC().run(); + } +} diff --git a/scribble-test/src/test/scrib/demo/fase17/travel/TravelS.java b/scribble-test/src/test/scrib/demo/fase17/travel/TravelS.java new file mode 100644 index 000000000..3bcf5d94a --- /dev/null +++ b/scribble-test/src/test/scrib/demo/fase17/travel/TravelS.java @@ -0,0 +1,68 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package demo.fase17.travel; + +import static demo.fase17.travel.TravelAgent.TravelAgent.TravelAgent.C; +import static demo.fase17.travel.TravelAgent.TravelAgent.TravelAgent.S; +import static demo.fase17.travel.TravelAgent.TravelAgent.TravelAgent.confirm; +import static demo.fase17.travel.TravelAgent.TravelAgent.TravelAgent.payment; + +import java.io.IOException; + +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.util.Buf; +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.net.SocketChannelServer; +import org.scribble.runtime.session.ExplicitEndpoint; + +import demo.fase17.travel.TravelAgent.TravelAgent.TravelAgent; +import demo.fase17.travel.TravelAgent.TravelAgent.statechans.S.TravelAgent_S_1; +import demo.fase17.travel.TravelAgent.TravelAgent.roles.S; +import org.scribble.runtime.util.Buf; + +public class TravelS +{ + public void run() throws Exception + { + try (ScribServerSocket ss = new SocketChannelServer(9999)) + { + Buf b = new Buf<>(); + + while (true) + { + TravelAgent sess = new TravelAgent(); + try (ExplicitEndpoint se = new ExplicitEndpoint<>(sess, S, new ObjectStreamFormatter())) + { + new TravelAgent_S_1(se) + .accept(C, ss) + .receive(C, payment, b) + .send(C, confirm, 4567); + + System.out.println("(S) payment: " + b.val); + } + catch (ScribRuntimeException | IOException | ClassNotFoundException e) + { + e.printStackTrace(); + } + } + } + } + + public static void main(String[] args) throws Exception + { + new TravelS().run(); + } +} diff --git a/scribble-test/src/test/scrib/demo/fase17/travel2/Travel2A.java b/scribble-test/src/test/scrib/demo/fase17/travel2/Travel2A.java new file mode 100644 index 000000000..65a28fb63 --- /dev/null +++ b/scribble-test/src/test/scrib/demo/fase17/travel2/Travel2A.java @@ -0,0 +1,85 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package demo.fase17.travel2; + +import static demo.fase17.travel2.TravelAgent2.TravelAgent2.TravelAgent2.A; +import static demo.fase17.travel2.TravelAgent2.TravelAgent2.TravelAgent2.C; +import static demo.fase17.travel2.TravelAgent2.TravelAgent2.TravelAgent2.S; +import static demo.fase17.travel2.TravelAgent2.TravelAgent2.TravelAgent2.accpt; +import static demo.fase17.travel2.TravelAgent2.TravelAgent2.TravelAgent2.port; +import static demo.fase17.travel2.TravelAgent2.TravelAgent2.TravelAgent2.query; +import static demo.fase17.travel2.TravelAgent2.TravelAgent2.TravelAgent2.quote; +import static demo.fase17.travel2.TravelAgent2.TravelAgent2.TravelAgent2.reject; + +import java.io.IOException; + +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.util.Buf; +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.net.SocketChannelServer; +import org.scribble.runtime.session.ExplicitEndpoint; + +import demo.fase17.travel2.TravelAgent2.TravelAgent2.TravelAgent2; +import demo.fase17.travel2.TravelAgent2.TravelAgent2.statechans.A.EndSocket; +import demo.fase17.travel2.TravelAgent2.TravelAgent2.statechans.A.TravelAgent2_A_1; +import demo.fase17.travel2.TravelAgent2.TravelAgent2.statechans.A.TravelAgent2_A_2_Cases; +import demo.fase17.travel2.TravelAgent2.TravelAgent2.roles.A; + +public class Travel2A +{ + public void run() throws Exception + { + try (ScribServerSocket ss = new SocketChannelServer(8888)) + { + while (true) + { + TravelAgent2 sess = new TravelAgent2(); + try (ExplicitEndpoint se = new ExplicitEndpoint<>(sess, A, new ObjectStreamFormatter())) + { + run( + new TravelAgent2_A_1(se) + .accept(C, ss) + .branch(C)); + } + catch (ScribRuntimeException | IOException | ClassNotFoundException e) + { + e.printStackTrace(); + } + } + } + } + + private EndSocket run(TravelAgent2_A_2_Cases A2) throws Exception + { + Buf b = new Buf<>(); + switch (A2.op) + { + case query: A2 = A2.receive(query, b).send(C, quote, 1234).branch(C); System.out.println("(A) query: " + b.val); return run(A2); + case accpt: + //EndSocket end = A2.receive(accpt, b); System.out.println("(A) yes: " + b.val); return end; + return A2.receive(accpt).request(S, SocketChannelEndpoint::new, "localhost", 9999) + .receive(S, port, b).send(C, port, (Integer) b.val); + case reject: return A2.receive(reject); + default: throw new RuntimeException("Shouldn't get in here: " + A2.op); + } + } + + public static void main(String[] args) throws Exception + { + new Travel2A().run(); + } +} diff --git a/scribble-test/src/test/scrib/demo/fase17/travel2/Travel2C.java b/scribble-test/src/test/scrib/demo/fase17/travel2/Travel2C.java new file mode 100644 index 000000000..90ad27439 --- /dev/null +++ b/scribble-test/src/test/scrib/demo/fase17/travel2/Travel2C.java @@ -0,0 +1,70 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package demo.fase17.travel2; + +import static demo.fase17.travel2.TravelAgent2.TravelAgent2.TravelAgent2.A; +import static demo.fase17.travel2.TravelAgent2.TravelAgent2.TravelAgent2.C; +import static demo.fase17.travel2.TravelAgent2.TravelAgent2.TravelAgent2.S; +import static demo.fase17.travel2.TravelAgent2.TravelAgent2.TravelAgent2.confirm; +import static demo.fase17.travel2.TravelAgent2.TravelAgent2.TravelAgent2.query; +import static demo.fase17.travel2.TravelAgent2.TravelAgent2.TravelAgent2.quote; +import static demo.fase17.travel2.TravelAgent2.TravelAgent2.TravelAgent2.accpt; +import static demo.fase17.travel2.TravelAgent2.TravelAgent2.TravelAgent2.port; + +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.util.Buf; +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.net.SocketChannelServer; +import org.scribble.runtime.session.ExplicitEndpoint; + +import demo.fase17.travel2.TravelAgent2.TravelAgent2.TravelAgent2; +import demo.fase17.travel2.TravelAgent2.TravelAgent2.statechans.C.TravelAgent2_C_1; +import demo.fase17.travel2.TravelAgent2.TravelAgent2.statechans.C.TravelAgent2_C_2; +import demo.fase17.travel2.TravelAgent2.TravelAgent2.roles.C; + +public class Travel2C +{ + public void run() throws Exception + { + String[] queries = { "aaa", "bbb", "ccc" }; + + TravelAgent2 sess = new TravelAgent2(); + try (ExplicitEndpoint se = new ExplicitEndpoint<>(sess, C, new ObjectStreamFormatter())) + { + Buf b = new Buf<>(); + TravelAgent2_C_2 C2 = new TravelAgent2_C_1(se) + .request(A, SocketChannelEndpoint::new, "localhost", 8888); + + for (int i = 0; i < queries.length; i++) + { + C2 = C2.send(A, query, queries[i]).receive(A, quote, b); + } + + C2.send(A, accpt) + .receive(A, port, b) + .request(S, SocketChannelEndpoint::new, "localhost", (Integer) b.val) // FIXME: connect message + .receive(S, confirm, b); + + System.out.println("(C) confirm: " + b.val); + } + } + + public static void main(String[] args) throws Exception + { + new Travel2C().run(); + } +} diff --git a/scribble-test/src/test/scrib/demo/fase17/travel2/Travel2S.java b/scribble-test/src/test/scrib/demo/fase17/travel2/Travel2S.java new file mode 100644 index 000000000..6b684cd74 --- /dev/null +++ b/scribble-test/src/test/scrib/demo/fase17/travel2/Travel2S.java @@ -0,0 +1,70 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package demo.fase17.travel2; + +import static demo.fase17.travel2.TravelAgent2.TravelAgent2.TravelAgent2.C; +import static demo.fase17.travel2.TravelAgent2.TravelAgent2.TravelAgent2.S; +import static demo.fase17.travel2.TravelAgent2.TravelAgent2.TravelAgent2.A; +import static demo.fase17.travel2.TravelAgent2.TravelAgent2.TravelAgent2.confirm; +import static demo.fase17.travel2.TravelAgent2.TravelAgent2.TravelAgent2.port; + +import java.io.IOException; + +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.util.Buf; +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.net.SocketChannelServer; +import org.scribble.runtime.session.ExplicitEndpoint; + +import demo.fase17.travel2.TravelAgent2.TravelAgent2.TravelAgent2; +import demo.fase17.travel2.TravelAgent2.TravelAgent2.statechans.S.TravelAgent2_S_1; +import demo.fase17.travel2.TravelAgent2.TravelAgent2.roles.S; + +public class Travel2S +{ + public void run() throws Exception + { + try (ScribServerSocket ss = new SocketChannelServer(9999); + ScribServerSocket ss2 = new SocketChannelServer(7777)) + { + Buf b = new Buf<>(); + + while (true) + { + TravelAgent2 sess = new TravelAgent2(); + try (ExplicitEndpoint se = new ExplicitEndpoint<>(sess, S, new ObjectStreamFormatter())) + { + new TravelAgent2_S_1(se) + .accept(A, ss) + .send(A, port, 7777) + .accept(C, ss2) // TODO: API gen accept message/payload ("payment") + .send(C, confirm, 4567); + + System.out.println("(S) payment: " + b.val); + } + catch (ScribRuntimeException | IOException e) + { + e.printStackTrace(); + } + } + } + } + + public static void main(String[] args) throws Exception + { + new Travel2S().run(); + } +} diff --git a/scribble-test/src/test/scrib/demo/fase17/travel2/TravelAgent2.scr b/scribble-test/src/test/scrib/demo/fase17/travel2/TravelAgent2.scr new file mode 100644 index 000000000..11803dcd5 --- /dev/null +++ b/scribble-test/src/test/scrib/demo/fase17/travel2/TravelAgent2.scr @@ -0,0 +1,52 @@ +//$ bin/scribblec.sh scribble-test/src/test/scrib/demo/fase17/travel2/TravelAgent2.scr -ip scribble-test/src/test/scrib/ -d scribble-test/src/test/scrib -nocorrelation +//$ javadoc -cp scribble-core/target/classes:scribble-runtime/target/classes:scribble-test/src/test/scrib -subpackages demo.fase17.travel2.TravelAgent2.TravelAgent2 -d scribble-test/javadoc/fase17/travel2 + + +module demo.fase17.travel2.TravelAgent2; + +type "java.lang.Integer" from "rt.jar" as Int; +type "java.lang.String" from "rt.jar" as String; + + +explicit global protocol TravelAgent2(role C, role A, role S) +{ + connect C to A; + do Nego(C, A, S); +} + +aux global protocol Nego(role C, role A, role S) +{ + choice at C + { + query(String) from C to A; + quote(Int) from A to C; + do Nego(C, A, S); + } + or + { + do Pay(C, A, S); + } +} + +aux global protocol Pay(role C, role A, role S) +{ + choice at C + { + accpt() from C to A; + connect A to S; + + port(Int) from S to A; + port(Int) from A to C; // A should forward prev Int to C + payment(String) connect C to S; // C should connect to S at prev Int port // FIXME: connect/accept message + +// port(p:Int) from S to A; +// port(p) from A to C; +// payment(String) connect C to S; @port=p + + confirm(Int) from S to C; + } + or + { + reject() from C to A; + } +} diff --git a/scribble-test/src/test/scrib/demo/highlow/HighLow.scr b/scribble-test/src/test/scrib/demo/highlow/HighLow.scr new file mode 100644 index 000000000..3cab42cda --- /dev/null +++ b/scribble-test/src/test/scrib/demo/highlow/HighLow.scr @@ -0,0 +1,35 @@ +//$ bin/scribblec.sh scribble-test/src/test/scrib/demo/highlow/HighLow.scr -d scribble-test/src/test/scrib/demo -api HighLow A +//$ bin/scribblec.sh scribble-test/src/test/scrib/demo/highlow/HighLow.scr -d scribble-test/src/test/scrib/demo -cbapi HighLow A +//$ javadoc -cp scribble-core/target/classes:scribble-runtime/target/classes:scribble-test/src/test/scrib/demo -subpackages highlow.HighLow.HighLow -d scribble-test/javadoc/highlow + +module highlow.HighLow; + +type "java.lang.Integer" from "runtime.jar" as int; + +global protocol HighLow(role A, role B, role C) { + secret(int) from A to B; //@'0<=n0 && n0<100' + tries(int) from A to B; //@'0x && t>1' + higher() from B to A; + do Aux(A, B, C); //@'B[n, t-1]' + } or { + lower() from B to C; //@'n1' + lower() from B to A; + do Aux(A, B, C); //@'B[n, t-1]' + } or { + lose() from B to C; //@'!(n1=x) && t1=1' + win() from B to A; + } +} + diff --git a/scribble-test/src/test/scrib/demo/highlow/HighLowA.java b/scribble-test/src/test/scrib/demo/highlow/HighLowA.java new file mode 100644 index 000000000..32c7f23e5 --- /dev/null +++ b/scribble-test/src/test/scrib/demo/highlow/HighLowA.java @@ -0,0 +1,68 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package highlow; + +import highlow.HighLow.HighLow.HighLow; +import highlow.HighLow.HighLow.ops.secret; +import highlow.HighLow.HighLow.roles.A; +import highlow.HighLow.HighLow.statechans.A.EndSocket; +import highlow.HighLow.HighLow.statechans.A.HighLow_A_1; +import highlow.HighLow.HighLow.statechans.A.HighLow_A_3; +import highlow.HighLow.HighLow.statechans.A.HighLow_A_3_Cases; +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.session.MPSTEndpoint; + +import java.io.IOException; + +import static highlow.HighLow.HighLow.HighLow.*; + +public class HighLowA { + public void run() throws Exception { + HighLow proto = new HighLow(); + try (MPSTEndpoint se + = new MPSTEndpoint<>(proto, A, new ObjectStreamFormatter())) { + se.request(B, SocketChannelEndpoint::new, "localhost", 8888); + highLow(new HighLow_A_1(se)); + } catch (ScribRuntimeException | IOException | ClassNotFoundException e) { + e.printStackTrace(); + } + } + + private EndSocket highLow(HighLow_A_1 a1) throws Exception { + return aux(a1.send(B, secret, 42).send(B, tries, 5)); + } + + private EndSocket aux(HighLow_A_3 a3) throws Exception { + HighLow_A_3_Cases a3Cases = a3.branch(B); + switch (a3Cases.op) { + case higher: + return aux(a3Cases.receive(higher)); + case lose: + return a3Cases.receive(lose); + case lower: + return aux(a3Cases.receive(lower)); + case win: + return a3Cases.receive(win); + default: + throw new RuntimeException("Won't get in here: " + a3Cases.op); + } + } + + public static void main(String[] args) throws Exception { + new HighLowA().run(); + } +} diff --git a/scribble-test/src/test/scrib/demo/highlow/HighLowB.java b/scribble-test/src/test/scrib/demo/highlow/HighLowB.java new file mode 100644 index 000000000..8580a6551 --- /dev/null +++ b/scribble-test/src/test/scrib/demo/highlow/HighLowB.java @@ -0,0 +1,76 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package highlow; + +import highlow.HighLow.HighLow.HighLow; +import highlow.HighLow.HighLow.roles.B; +import highlow.HighLow.HighLow.statechans.B.EndSocket; +import highlow.HighLow.HighLow.statechans.B.HighLow_B_1; +import highlow.HighLow.HighLow.statechans.B.HighLow_B_3; +import highlow.HighLow.HighLow.statechans.B.HighLow_B_4; +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.net.SocketChannelServer; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import java.io.IOException; + +import static highlow.HighLow.HighLow.HighLow.*; + +public class HighLowB { + public void run() throws Exception { + try (ScribServerSocket ssA = new SocketChannelServer(8888); + ScribServerSocket ssC = new SocketChannelServer(9999); + ) { + while (true) { + HighLow proto = new HighLow(); + try (MPSTEndpoint se + = new MPSTEndpoint<>(proto, B, new ObjectStreamFormatter())) { + se.accept(ssA, A); + se.accept(ssC, C); + highLow(new HighLow_B_1(se)); + } catch (ScribRuntimeException | IOException | ClassNotFoundException e) { + e.printStackTrace(); + } + } + } + } + + private EndSocket highLow(HighLow_B_1 b1) throws Exception { + Buf s = new Buf<>(); + Buf l = new Buf<>(); + return aux(b1.receive(A, secret, s).receive(A, tries, l), s.val, l.val); + } + + private EndSocket aux(HighLow_B_3 b3, int secret, int tries) throws Exception { + Buf g = new Buf<>(); + HighLow_B_4 b4 = b3.receive(C, guess, g); + if (g.val == secret) { + return b4.send(C, win).send(A, lose); + } else if (tries <= 1) { + return b4.send(C, lose).send(A, win); + } else if (g.val < secret) { + return aux(b4.send(C, higher).send(A, higher), secret, tries - 1); + } else { + return aux(b4.send(C, lower).send(A, lower), secret, tries - 1); + } + } + + public static void main(String[] args) throws Exception { + new HighLowB().run(); + } +} diff --git a/scribble-test/src/test/scrib/demo/highlow/HighLowC.java b/scribble-test/src/test/scrib/demo/highlow/HighLowC.java new file mode 100644 index 000000000..046e5b379 --- /dev/null +++ b/scribble-test/src/test/scrib/demo/highlow/HighLowC.java @@ -0,0 +1,72 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package highlow; + +import highlow.HighLow.HighLow.HighLow; +import highlow.HighLow.HighLow.roles.C; +import highlow.HighLow.HighLow.statechans.C.EndSocket; +import highlow.HighLow.HighLow.statechans.C.HighLow_C_1; +import highlow.HighLow.HighLow.statechans.C.HighLow_C_2_Cases; +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.session.MPSTEndpoint; + +import java.io.IOException; + +import static highlow.HighLow.HighLow.HighLow.*; + +public class HighLowC { + public void run() throws Exception { + HighLow proto = new HighLow(); + + try (MPSTEndpoint se + = new MPSTEndpoint<>(proto, C, new ObjectStreamFormatter())) { + se.request(B, SocketChannelEndpoint::new, "localhost", 9999); + + + highLow(new HighLow_C_1(se)); + } catch (ScribRuntimeException | IOException | ClassNotFoundException e) { + e.printStackTrace(); + } + } + + private EndSocket highLow(HighLow_C_1 c1) throws Exception { + return aux(c1, 50); + } + + private EndSocket aux(HighLow_C_1 c1, int g) throws Exception { + System.out.println("Guessing " + g); + HighLow_C_2_Cases c2Cases = c1.send(B, guess, g).branch(B); + switch (c2Cases.op) { + case higher: + return aux(c2Cases.receive(B, higher), g + 1); + case win: + System.out.println("We win!"); + return c2Cases.receive(B, win); + case lower: + return aux(c2Cases.receive(B, lower), g - 1); + case lose: + System.out.println("We lose..."); + return c2Cases.receive(B, lose); + default: + throw new RuntimeException("Won't get in here: " + c2Cases.op); + } + } + + public static void main(String[] args) throws Exception { + new HighLowC().run(); + } +} diff --git a/scribble-test/src/test/scrib/demo/highlow/cb/MyA.java b/scribble-test/src/test/scrib/demo/highlow/cb/MyA.java new file mode 100644 index 000000000..9dd323dfc --- /dev/null +++ b/scribble-test/src/test/scrib/demo/highlow/cb/MyA.java @@ -0,0 +1,78 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package highlow.cb; + +import highlow.HighLow.HighLow.HighLow; +import highlow.HighLow.HighLow.callbacks.A.HighLow_A; +import highlow.HighLow.HighLow.callbacks.A.HighLow_A_3_Branch; +import highlow.HighLow.HighLow.callbacks.A.states.HighLow_A_1; +import highlow.HighLow.HighLow.callbacks.A.states.HighLow_A_2; +import highlow.HighLow.HighLow.callbacks.A.states.HighLow_A_3; +import highlow.HighLow.HighLow.ops.higher; +import highlow.HighLow.HighLow.ops.lose; +import highlow.HighLow.HighLow.ops.lower; +import highlow.HighLow.HighLow.ops.win; +import highlow.HighLow.HighLow.roles.B; +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.SocketChannelEndpoint; + +import java.io.IOException; +import java.util.concurrent.Future; + +import static highlow.HighLow.HighLow.HighLow.A; +import static highlow.HighLow.HighLow.HighLow.B; + +public class MyA { + public void run() throws Exception { + HighLow proto = new HighLow(); + + try (HighLow_A c = new HighLow_A<>(proto, A, new ObjectStreamFormatter(), null)) { + c.icallback(HighLow_A_1.id, (data) -> new HighLow_A_1.B.secret(42)); + c.icallback(HighLow_A_2.id, (data) -> new HighLow_A_2.B.tries(5)); + c.icallback(HighLow_A_3.id, new MyHandlerA()); + + c.request(B, SocketChannelEndpoint::new, "localhost", 8888); + Future f = c.run(); + f.get(); + } catch (ScribRuntimeException | IOException e) { + e.printStackTrace(); + } + } + + public static void main(String[] args) throws Exception { + new MyA().run(); + } +} + +class MyHandlerA extends HighLow_A_3_Branch { + @Override + public void receive(Void data, highlow.HighLow.HighLow.roles.B peer, higher op) { + } + + @Override + public void receive(Void data, B peer, lose op) { + System.out.println("We lose..."); + } + + @Override + public void receive(Void data, B peer, lower op) { + } + + @Override + public void receive(Void data, B peer, win op) { + System.out.println("We win!"); + } +} diff --git a/scribble-test/src/test/scrib/demo/highlow/cb/MyB.java b/scribble-test/src/test/scrib/demo/highlow/cb/MyB.java new file mode 100644 index 000000000..61d469e24 --- /dev/null +++ b/scribble-test/src/test/scrib/demo/highlow/cb/MyB.java @@ -0,0 +1,110 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package highlow.cb; + +import highlow.HighLow.HighLow.HighLow; +import highlow.HighLow.HighLow.callbacks.B.HighLow_B; +import highlow.HighLow.HighLow.callbacks.B.HighLow_B_1_Branch; +import highlow.HighLow.HighLow.callbacks.B.HighLow_B_2_Branch; +import highlow.HighLow.HighLow.callbacks.B.HighLow_B_3_Branch; +import highlow.HighLow.HighLow.callbacks.B.states.*; +import highlow.HighLow.HighLow.ops.guess; +import highlow.HighLow.HighLow.ops.secret; +import highlow.HighLow.HighLow.ops.tries; +import highlow.HighLow.HighLow.roles.A; +import highlow.HighLow.HighLow.roles.C; +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.net.SocketChannelServer; + +import java.io.IOException; +import java.util.concurrent.Future; + +import static highlow.HighLow.HighLow.HighLow.A; +import static highlow.HighLow.HighLow.HighLow.B; +import static highlow.HighLow.HighLow.HighLow.C; + +public class MyB { + public void run() throws Exception { + + try (ScribServerSocket ssA = new SocketChannelServer(8888); + ScribServerSocket ssC = new SocketChannelServer(9999) + ) { + while (true) { + HighLow proto = new HighLow(); + try (HighLow_B b = new HighLow_B<>(proto, B, new ObjectStreamFormatter(), new MyStateB())) { + b.icallback(HighLow_B_1.id, new MyHandlerB1()); + b.icallback(HighLow_B_2.id, new MyHandlerB2()); + b.icallback(HighLow_B_3.id, new MyHandlerB3()); + b.icallback(HighLow_B_4.id, (data) -> { + if (data.secret == data.guess) { + return new HighLow_B_4.C.win(); + } else if (data.tries == 0) { + return new HighLow_B_4.C.lose(); + } else { + data.tries--; + return (data.secret > data.guess) + ? new HighLow_B_4.C.higher() + : new HighLow_B_4.C.lower(); + } + }); + b.icallback(HighLow_B_5.id, (data) -> new HighLow_B_5.A.lose()); + b.icallback(HighLow_B_6.id, (data) -> new HighLow_B_6.A.higher()); + b.icallback(HighLow_B_7.id, (data) -> new HighLow_B_7.A.lower()); + b.icallback(HighLow_B_8.id, (data) -> new HighLow_B_8.A.win()); + + b.accept(ssA, A); + b.accept(ssC, C); + Future f = b.run(); + f.get(); + } catch (ScribRuntimeException | IOException e) { + e.printStackTrace(); + } + } + } + } + + public static void main(String[] args) throws Exception { + new MyB().run(); + } +} + +class MyStateB { + public int secret; + public int tries; + public int guess; +} + +class MyHandlerB1 extends HighLow_B_1_Branch { + @Override + public void receive(MyStateB data, A peer, secret op, Integer arg1) { + data.secret = arg1; + } +} + +class MyHandlerB2 extends HighLow_B_2_Branch { + @Override + public void receive(MyStateB data, A peer, tries op, Integer arg1) { + data.tries = arg1; + } +} + +class MyHandlerB3 extends HighLow_B_3_Branch { + @Override + public void receive(MyStateB data, C peer, guess op, Integer arg1) { + data.guess = arg1; + } +} diff --git a/scribble-test/src/test/scrib/demo/highlow/cb/MyC.java b/scribble-test/src/test/scrib/demo/highlow/cb/MyC.java new file mode 100644 index 000000000..ac412ff17 --- /dev/null +++ b/scribble-test/src/test/scrib/demo/highlow/cb/MyC.java @@ -0,0 +1,85 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package highlow.cb; + +import highlow.HighLow.HighLow.HighLow; +import highlow.HighLow.HighLow.callbacks.C.HighLow_C; +import highlow.HighLow.HighLow.callbacks.C.HighLow_C_2_Branch; +import highlow.HighLow.HighLow.callbacks.C.states.HighLow_C_1; +import highlow.HighLow.HighLow.callbacks.C.states.HighLow_C_2; +import highlow.HighLow.HighLow.ops.higher; +import highlow.HighLow.HighLow.ops.lose; +import highlow.HighLow.HighLow.ops.lower; +import highlow.HighLow.HighLow.ops.win; +import highlow.HighLow.HighLow.roles.B; +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.SocketChannelEndpoint; + +import java.io.IOException; +import java.util.concurrent.Future; + +import static highlow.HighLow.HighLow.HighLow.B; +import static highlow.HighLow.HighLow.HighLow.C; + +public class MyC { + public void run() throws Exception { + HighLow proto = new HighLow(); + + try (HighLow_C c = new HighLow_C<>(proto, C, new ObjectStreamFormatter(), new MyStateC())) { + c.icallback(HighLow_C_1.id, (data) -> { + System.out.println("Guessing " + data.guess); + return new HighLow_C_1.B.guess(data.guess); + }); + c.icallback(HighLow_C_2.id, new MyHandlerC()); + + c.request(B, SocketChannelEndpoint::new, "localhost", 9999); + Future f = c.run(); + f.get(); + } catch (ScribRuntimeException | IOException e) { + e.printStackTrace(); + } + } + + public static void main(String[] args) throws Exception { + new MyC().run(); + } +} + +class MyStateC { + public int guess = 50; +} + +class MyHandlerC extends HighLow_C_2_Branch { + @Override + public void receive(MyStateC data, B peer, higher op) { + data.guess++; + } + + @Override + public void receive(MyStateC data, B peer, lose op) { + System.out.println("We lose..."); + } + + @Override + public void receive(MyStateC data, B peer, lower op) { + data.guess--; + } + + @Override + public void receive(MyStateC data, B peer, win op) { + System.out.println("We win!"); + } +} diff --git a/scribble-test/src/test/scrib/demo/supplierinfo/SupplierInfoExplicit.scr b/scribble-test/src/test/scrib/demo/supplierinfo/SupplierInfoExplicit.scr new file mode 100644 index 000000000..f431eb65f --- /dev/null +++ b/scribble-test/src/test/scrib/demo/supplierinfo/SupplierInfoExplicit.scr @@ -0,0 +1,147 @@ +//$ bin/scribblec.sh scribble-core/src/test/scrib/demo/supplierinfo/SupplierInfoExplicit.scr -fsm InfoAuth Client + + +module src.SupplierInfoExplicit; + + +type "UserName" from "AUTH.xsd" as username; +type "Password" from "AUTH.xsd" as password; +type "UUID" from "AUTH.xsd" as uuid; +type "/retailhub/supplierdetails" from "Retailer.xsd" as supplierdetails; +type "/retailhub/contractdetails" from "Retailer.xsd" as contractdetails; + +type "..." from "...xsd" as usercontext; +type "..." from "...xsd" as filters; + + +// Needs -fair -- cf. SupplierInfoNoFair +explicit global protocol InfoAuth +( + role Client, + role LoginSvc, + role AuthSvc, + role FilterSvc, + role SupplierSvc, + role ContractSvc +) +{ + connect Client to LoginSvc; + login(username, password) from Client to LoginSvc; + choice at LoginSvc + { + //loginsuccess() from LoginSvc to Client; // Not an error if the following line commented (and fairness assumed) + loginfailure() from LoginSvc to Client; + /*connect Client to AuthSvc; + getsuppliers(uuid) from Client to AuthSvc; // Error: orphans*/ + disconnect Client and LoginSvc; + } + or + { + loginsuccess() from LoginSvc to Client; + //disconnect Client and LoginSvc; + connect Client to AuthSvc; + connect AuthSvc to FilterSvc; + connect AuthSvc to SupplierSvc; + connect AuthSvc to ContractSvc; + do Main(Client, AuthSvc, FilterSvc, SupplierSvc, ContractSvc); + } +} + + +aux global protocol Main +( + role Client, + role AuthSvc, + role FilterSvc, + role SupplierSvc, + role ContractSvc +) +{ + choice at Client + { + // GET SUPPLIER INFO + getsuppliers(uuid) from Client to AuthSvc; + //1() from AuthSvc to ContractSvc; + do SuppInfo(Client, AuthSvc, FilterSvc, SupplierSvc); + } + or + { + // GET CONTRACT INFO + getcontracts() from Client to AuthSvc; + //2() from AuthSvc to SupplierSvc; + do ContractInfo(Client, AuthSvc, FilterSvc, ContractSvc); + //do ContractInfo(Client, AuthSvc, FilterSvc, SupplierSvc); // Error + } + do Main(Client, AuthSvc, FilterSvc, SupplierSvc, ContractSvc); +} + + +aux global protocol SuppInfo +( + role Client, + role AuthSvc, + role FilterSvc, + role SupplierSvc +) +{ + choice at AuthSvc + { + // DENIED + deny() from AuthSvc to Client; + } + or + { + // PREPARE FILTERED SUPPLIER INFO FOR Client + getsuppliers() from AuthSvc to SupplierSvc; + suppliers() from SupplierSvc to AuthSvc; + do FilterInfo + + (AuthSvc, FilterSvc); + suppliers() from AuthSvc to Client; + } +} + + +aux global protocol ContractInfo +( + role Client, + role AuthSvc, + role FilterSvc, + role ContractSvc +) +{ + choice at AuthSvc + { + // DENIED + deny() from AuthSvc to Client; + } + or + { + // PREPARE FILTERED SUPPLIER INFO FOR Client + getcontracts() from AuthSvc to ContractSvc; + contracts() from ContractSvc to AuthSvc; + do FilterInfo + + // // OK (merge) + // // Error + (AuthSvc, FilterSvc); + contracts() from AuthSvc to Client; + } +} + + +//aux global protocol FilterInfo( // Bad non-det. payload +aux global protocol FilterInfo +< + sig Query +> +( + role AuthSvc, + role FilterSvc +) +{ + //filter(usercontext, filters, details) from AuthSvc to FilterSvc; + Query from AuthSvc to FilterSvc; + filtered() from FilterSvc to AuthSvc; +} + diff --git a/scribble-test/src/test/scrib/demo/supplierinfo/SupplierInfoNoFair.scr b/scribble-test/src/test/scrib/demo/supplierinfo/SupplierInfoNoFair.scr new file mode 100644 index 000000000..ea093745d --- /dev/null +++ b/scribble-test/src/test/scrib/demo/supplierinfo/SupplierInfoNoFair.scr @@ -0,0 +1,141 @@ +//$ bin/scribblec.sh scribble-core/src/test/scrib/demo/supplierinfo/SupplierInfoNoFair.scr -fsm InfoAuth Client + + +module src.SupplierInfoNoFair; + + +data "UserName" from "AUTH.xsd" as username; +data "Password" from "AUTH.xsd" as password; +data "UUID" from "AUTH.xsd" as uuid; +data "/retailhub/supplierdetails" from "Retailer.xsd" as supplierdetails; +data "/retailhub/contractdetails" from "Retailer.xsd" as contractdetails; + +data "..." from "...xsd" as usercontext; +data "..." from "...xsd" as filters; + + +explicit global protocol InfoAuth +( + role Client, + role LoginSvc, + role AuthSvc, + role FilterSvc, + role SupplierSvc, + role ContractSvc +) +{ + connect Client to LoginSvc; + login(username, password) from Client to LoginSvc; + choice at LoginSvc + { + loginfailure() from LoginSvc to Client; + //disconnect Client and LoginSvc; // Increases state space somewhat + } + or + { + loginsuccess() from LoginSvc to Client; + //disconnect Client and LoginSvc; + connect Client to AuthSvc; + do Main(Client, AuthSvc, FilterSvc, SupplierSvc, ContractSvc); + } +} + + +aux global protocol Main +( + role Client, + role AuthSvc, + role FilterSvc, + role SupplierSvc, + role ContractSvc +) +{ + choice at Client + { + // GET SUPPLIER INFO + getsuppliers(uuid) from Client to AuthSvc; + do SuppInfo(Client, AuthSvc, FilterSvc, SupplierSvc); + } + or + { + // GET CONTRACT INFO + getcontracts() from Client to AuthSvc; + do ContractInfo(Client, AuthSvc, FilterSvc, ContractSvc); + } + do Main(Client, AuthSvc, FilterSvc, SupplierSvc, ContractSvc); +} + + +aux global protocol SuppInfo +( + role Client, + role AuthSvc, + role FilterSvc, + role SupplierSvc +) +{ + choice at AuthSvc + { + // DENIED + deny() from AuthSvc to Client; + } + or + { + connect AuthSvc to SupplierSvc; + // PREPARE FILTERED SUPPLIER INFO FOR Client + getsuppliers() from AuthSvc to SupplierSvc; + suppliers() from SupplierSvc to AuthSvc; + //disconnect AuthSvc and SupplierSvc; + do FilterInfo + + // + (AuthSvc, FilterSvc); + disconnect AuthSvc and SupplierSvc; + suppliers() from AuthSvc to Client; + } +} + + +aux global protocol ContractInfo +( + role Client, + role AuthSvc, + role FilterSvc, + role ContractSvc +) +{ + choice at AuthSvc + { + // DENIED + deny() from AuthSvc to Client; + } + or + { + connect AuthSvc to ContractSvc; + // PREPARE FILTERED SUPPLIER INFO FOR Client + getcontracts() from AuthSvc to ContractSvc; + contracts() from ContractSvc to AuthSvc; + //disconnect AuthSvc and ContractSvc; + do FilterInfo + + (AuthSvc, FilterSvc); + disconnect AuthSvc and ContractSvc; + contracts() from AuthSvc to Client; + } +} + + +aux global protocol FilterInfo +< + sig Query +> +( + role AuthSvc, + role FilterSvc +) +{ + Query connect AuthSvc to FilterSvc; + filtered() from FilterSvc to AuthSvc; + disconnect AuthSvc and FilterSvc; +} + diff --git a/scribble-test/src/test/scrib/demo/supplierinfo/old/SupplierInfo.scr b/scribble-test/src/test/scrib/demo/supplierinfo/old/SupplierInfo.scr new file mode 100644 index 000000000..c75888fde --- /dev/null +++ b/scribble-test/src/test/scrib/demo/supplierinfo/old/SupplierInfo.scr @@ -0,0 +1,76 @@ +module src.SupplierInfo; + +type "UserName" from "AUTH.xsd" as username; +type "Password" from "AUTH.xsd" as password; +type "UUID" from "AUTH.xsd" as uuid; +type "/retailhub/supplierdetails" from "Retailer.xsd" as supplierdetails; +type "/retailhub/contractdetails" from "Retailer.xsd" as contractdetails; + +type "UserContext" from "AUTH.xsd" as usercontext; +type "FilterSet" from "AUTH.xsd" as filters; + + +explicit global protocol Partners( + role LOGINsvc, + role REQuestor, + role AUTHsvc, + //role usersvc, + role FILTERsvc, + role SUPPLIERsvc, + role CONTRACTsvc) +{ + connect REQuestor to LOGINsvc; + + login(username, password) from REQuestor to LOGINsvc; + choice at LOGINsvc + { + loginsuccess() from LOGINsvc to REQuestor; + //loginfailure() from LOGINsvc to REQuestor; + } or { + loginsuccess() from LOGINsvc to REQuestor; + + connect REQuestor to AUTHsvc; + connect AUTHsvc to SUPPLIERsvc; + connect AUTHsvc to CONTRACTsvc; + connect AUTHsvc to FILTERsvc; + + rec MAIN + { + choice at REQuestor + { + // GET SUPPLIER INFO + getsuppliers(uuid) from REQuestor to AUTHsvc; + choice at AUTHsvc + { + // DENIED + deny() from AUTHsvc to REQuestor; + } or { + // PREPARE FILTERED SUPPLIER INFO FOR REQuestor + getsuppliers() from AUTHsvc to SUPPLIERsvc; + suppliers() from SUPPLIERsvc to AUTHsvc; + filterSuppliers(usercontext, filters, supplierdetails) from AUTHsvc to FILTERsvc; + filtered() from FILTERsvc to AUTHsvc; + suppliers() from AUTHsvc to REQuestor; + } + continue MAIN; + } or { + // GET CONTRACT INFO + getcontracts() from REQuestor to AUTHsvc; + choice at AUTHsvc + { + // DENIED + deny() from AUTHsvc to REQuestor; + } or { + // PREPARE FILTERED SUPPLIER INFO FOR REQuestor + getcontracts() from AUTHsvc to CONTRACTsvc; + contracts() from CONTRACTsvc to AUTHsvc; + filterContracts(usercontext, filters, contractdetails) from AUTHsvc to FILTERsvc; + filtered() from FILTERsvc to AUTHsvc; + contracts() from AUTHsvc to REQuestor; + } + continue MAIN; + } + } + } +} + diff --git a/scribble-test/src/test/scrib/demo/supplierinfo/old/SupplierInfoBasic.scr b/scribble-test/src/test/scrib/demo/supplierinfo/old/SupplierInfoBasic.scr new file mode 100644 index 000000000..0cbb57bd4 --- /dev/null +++ b/scribble-test/src/test/scrib/demo/supplierinfo/old/SupplierInfoBasic.scr @@ -0,0 +1,100 @@ +module src.SupplierInfoBasic; + +type "UserName" from "AUTH.xsd" as username; +type "Password" from "AUTH.xsd" as password; +type "UUID" from "AUTH.xsd" as uuid; +type "/retailhub/supplierdetails" from "Retailer.xsd" as supplierdetails; +type "/retailhub/contractdetails" from "Retailer.xsd" as contractdetails; + +type "..." from "...xsd" as usercontext; +type "..." from "...xsd" as filters; + + +global protocol PartnershipSupplier( + role loginsvc, + role requestor, + role authorisersvc, + role filtersvc, + role suppliersvc, + role contractsvc) +{ + login(username, password) from requestor to loginsvc; + choice at loginsvc + { + //loginsuccess() from loginsvc to requestor // Error if below is commented + loginfailure() from loginsvc to requestor; + + //getsuppliers(uuid) from requestor to authorisersvc; // Error + + 0() from requestor to authorisersvc; + 0() from authorisersvc to filtersvc; + 0() from authorisersvc to suppliersvc; + 0() from authorisersvc to contractsvc; + } + or + { + loginsuccess() from loginsvc to requestor; + rec mainBlock + { + choice at requestor + { + // GET SUPPLIER INFO + getsuppliers(uuid) from requestor to authorisersvc; + + 1() from authorisersvc to contractsvc; // Cheaper here than below + + choice at authorisersvc + { + // DENIED + deny() from authorisersvc to requestor; + + 1() from authorisersvc to suppliersvc; + 1() from authorisersvc to filtersvc; + } + or + { + // PREPARE FILTERED SUPPLIER INFO FOR REQUESTOR + getsuppliers() from authorisersvc to suppliersvc; + suppliers() from suppliersvc to authorisersvc; + + filterSuppliers(usercontext, filters, supplierdetails) from authorisersvc to filtersvc; + filtered() from filtersvc to authorisersvc; + suppliers() from authorisersvc to requestor; + } + + //1() from authorisersvc to contractsvc; + continue mainBlock; + } + or + { + // GET CONTRACT INFO + getcontracts() from requestor to authorisersvc; + + 2() from authorisersvc to suppliersvc; + + choice at authorisersvc + { + // DENIED + deny() from authorisersvc to requestor; + + 2() from authorisersvc to contractsvc; + 2() from authorisersvc to filtersvc; + } + or + { + // PREPARE FILTERED SUPPLIER INFO FOR REQUESTOR + getcontracts() from authorisersvc to contractsvc; + contracts() from contractsvc to authorisersvc; + + filterContracts(usercontext, filters, contractdetails) from authorisersvc to filtersvc; + filtered() from filtersvc to authorisersvc; + contracts() from authorisersvc to requestor; + } + + //2() from authorisersvc to suppliersvc; + continue mainBlock; + } + } + } +} + diff --git a/scribble-test/src/test/scrib/demo/supplierinfo/old/SupplierInfoDemo.scr b/scribble-test/src/test/scrib/demo/supplierinfo/old/SupplierInfoDemo.scr new file mode 100644 index 000000000..aa6ee3675 --- /dev/null +++ b/scribble-test/src/test/scrib/demo/supplierinfo/old/SupplierInfoDemo.scr @@ -0,0 +1,68 @@ +module src.SupplierInfoDemo; + +type "UserName" from "AUTH.xsd" as username; +type "Password" from "AUTH.xsd" as password; +type "UUID" from "AUTH.xsd" as uuid; +type "/retailhub/supplierdetails" from "Retailer.xsd" as supplierdetails; +type "/retailhub/contractdetails" from "Retailer.xsd" as contractdetails; + +//type "UserContext" from "AUTH.xsd" as usercontext; +//type "FilterSet" from "AUTH.xsd" as filters; + + +global protocol Partners( + role LOGINsvc, + role REQUESTOR, + role AUTHsvc, + role usersvc, + role FILTERsvc, + role SUPPLIERsvc, + role CONTRACTsvc) +{ + login(username, password) from REQUESTOR to LOGINsvc; + choice at LOGINsvc + { + loginfailure() from LOGINsvc to REQUESTOR; + } or { + loginsuccess() from LOGINsvc to REQUESTOR; + + rec MAIN + { + choice at REQUESTOR + { + // GET SUPPLIER INFO + getsuppliers(uuid) from REQUESTOR to AUTHsvc; + choice at AUTHsvc + { + // DENIED + deny() from AUTHsvc to REQUESTOR; + } or { + // PREPARE FILTERED SUPPLIER INFO FOR REQUESTOR + getsuppliers() from AUTHsvc to SUPPLIERsvc; + suppliers() from SUPPLIERsvc to AUTHsvc; + filterSuppliers(usercontext, filters, supplierdetails) from AUTHsvc to FILTERsvc; + filtered() from FILTERsvc to AUTHsvc; + suppliers() from AUTHsvc to REQUESTOR; + } + continue MAIN; + } or { + // GET CONTRACT INFO + getcontracts() from REQUESTOR to AUTHsvc; + choice at authoriser + { + // DENIED + deny() from AUTHsvc to REQUESTOR; + } or { + // PREPARE FILTERED SUPPLIER INFO FOR REQUESTOR + getcontracts() from AUTHsvc to CONTRACTsvc; + contracts() from CONTRACTsvc to AUTHsvc; + filterContracts(usercontext, filters, contractdetails) from AUTHsvc to FILTERsvc; + filtered() from FILTERsvc to AUTHsvc; + contracts() from AUTHsvc to REQUESTOR; + } + continue MAIN; + } + } + } +} + diff --git a/scribble-test/src/test/scrib/demo/supplierinfo/old/SupplierInfoExper.scr b/scribble-test/src/test/scrib/demo/supplierinfo/old/SupplierInfoExper.scr new file mode 100644 index 000000000..a7a9863ea --- /dev/null +++ b/scribble-test/src/test/scrib/demo/supplierinfo/old/SupplierInfoExper.scr @@ -0,0 +1,86 @@ +module src.SupplierInfoExper; + +type "UserName" from "AUTH.xsd" as username; +type "Password" from "AUTH.xsd" as password; +type "UUID" from "AUTH.xsd" as uuid; +type "/retailhub/supplierdetails" from "Retailer.xsd" as supplierdetails; +type "/retailhub/contractdetails" from "Retailer.xsd" as contractdetails; + +type "..." from "...xsd" as usercontext; +type "..." from "...xsd" as filters; + +type "java.lang.Integer" from "rt.jar" as int; + + +global protocol PartnershipSupplier( + role loginsvc, + role requestor) +{ + login(username, password) from requestor to loginsvc; + choice at loginsvc + { + loginfailure() from loginsvc to requestor; + } + or + { + loginsuccess() from loginsvc to requestor; + do Main(loginsvc, requestor); + } +} + +global protocol Main( + role loginsvc, + role requestor) +{ + loginsvc connects( // connect/disconnect now done as explicit statements + role authorisersvc, + role filtersvc, + role suppliersvc, + role contractsvc) + { + rec mainBlock + { + choice at requestor + { + // GET SUPPLIER INFO + getsuppliers(uuid) from requestor to authorisersvc; + choice at authorisersvc + { + // DENIED + deny() from authorisersvc to requestor, suppliersvc; + } + or + { + // PREPARE FILTERED SUPPLIER INFO FOR REQUESTOR + getsuppliers() from authorisersvc to suppliersvc; + suppliers() from suppliersvc to authorisersvc; + filter1(usercontext, filters, supplierdetails) from authorisersvc to filtersvc; + filtered1() from filtersvc to authorisersvc; + suppliers() from authorisersvc to requestor; + } + } + or + { + // GET CONTRACT INFO + getcontracts() from requestor to authorisersvc; + //choice at authoriser + choice at authorisersvc + { + // DENIED + deny() from authorisersvc to requestor, contractsvc; + } + or + { + // PREPARE FILTERED SUPPLIER INFO FOR REQUESTOR + getcontracts() from authorisersvc to contractsvc; + suppliers() from contractsvc to authorisersvc; + filter2(usercontext, filters, supplierdetails) from authorisersvc to filtersvc; + filtered2() from filtersvc to authorisersvc; + contracts() from authorisersvc to requestor; + } + } + continue mainBlock; + } + } +} + diff --git a/scribble-test/src/test/scrib/demo/supplierinfo/old/SupplierInfoNoFairBeta.scr b/scribble-test/src/test/scrib/demo/supplierinfo/old/SupplierInfoNoFairBeta.scr new file mode 100644 index 000000000..b2adfda38 --- /dev/null +++ b/scribble-test/src/test/scrib/demo/supplierinfo/old/SupplierInfoNoFairBeta.scr @@ -0,0 +1,140 @@ +module src.SupplierInfoNoFairBeta; + + +type "UserName" from "AUTH.xsd" as username; +type "Password" from "AUTH.xsd" as password; +type "UUID" from "AUTH.xsd" as uuid; +type "/retailhub/supplierdetails" from "Retailer.xsd" as supplierdetails; +type "/retailhub/contractdetails" from "Retailer.xsd" as contractdetails; + +type "..." from "...xsd" as usercontext; +type "..." from "...xsd" as filters; + + +explicit global protocol PartnershipSupplier +( + role loginsvc, + role requestor, + role authorisersvc, + role filtersvc, + role suppliersvc, + role contractsvc +) +{ + connect requestor to loginsvc; + login(username, password) from requestor to loginsvc; + choice at loginsvc + { + loginfailure() from loginsvc to requestor; + disconnect requestor and loginsvc; + } + or + { + loginsuccess() from loginsvc to requestor; + connect requestor to authorisersvc; + connect authorisersvc to filtersvc; + do Main(requestor, authorisersvc, filtersvc, suppliersvc, contractsvc); + } +} + + +aux global protocol Main +( + role requestor, + role authorisersvc, + role filtersvc, + role suppliersvc, + role contractsvc +) +{ + choice at requestor + { + // GET SUPPLIER INFO + getsuppliers(uuid) from requestor to authorisersvc; + do SuppInfo(requestor, authorisersvc, filtersvc, suppliersvc); + } + or + { + // GET CONTRACT INFO + getcontracts() from requestor to authorisersvc; + do ContractInfo(requestor, authorisersvc, filtersvc, contractsvc); + } + do Main(requestor, authorisersvc, filtersvc, suppliersvc, contractsvc); +} + + +aux global protocol SuppInfo +( + role requestor, + role authorisersvc, + role filtersvc, + role suppliersvc +) +{ + choice at authorisersvc + { + // DENIED + deny() from authorisersvc to requestor; + + 0() from authorisersvc to filtersvc; // FIXME: need accept+message branching, to factor out non-fair filter subproto + } + or + { + connect authorisersvc to suppliersvc; + // PREPARE FILTERED SUPPLIER INFO FOR REQUESTOR + getsuppliers() from authorisersvc to suppliersvc; + suppliers() from suppliersvc to authorisersvc; + do FilterInfo + + (authorisersvc, filtersvc); + disconnect authorisersvc and suppliersvc; + suppliers() from authorisersvc to requestor; + } +} + + +aux global protocol ContractInfo +( + role requestor, + role authorisersvc, + role filtersvc, + role contractsvc +) +{ + choice at authorisersvc + { + // DENIED + deny() from authorisersvc to requestor; + + 0() from authorisersvc to filtersvc; + } + or + { + connect authorisersvc to contractsvc; + // PREPARE FILTERED SUPPLIER INFO FOR REQUESTOR + getcontracts() from authorisersvc to contractsvc; + contracts() from contractsvc to authorisersvc; + do FilterInfo + + (authorisersvc, filtersvc); + disconnect authorisersvc and contractsvc; + contracts() from authorisersvc to requestor; + } +} + + +//aux global protocol FilterInfo( // Bad non-det. payload +aux global protocol FilterInfo +< + sig Query +> +( + role authorisersvc, + role filtersvc +) +{ + //filter(usercontext, filters, details) from authorisersvc to filtersvc; + Query from authorisersvc to filtersvc; + filtered() from filtersvc to authorisersvc; +} + diff --git a/scribble-test/src/test/scrib/demo/supplierinfo/old/SupplierInfoOrig.scr b/scribble-test/src/test/scrib/demo/supplierinfo/old/SupplierInfoOrig.scr new file mode 100644 index 000000000..91d44e26e --- /dev/null +++ b/scribble-test/src/test/scrib/demo/supplierinfo/old/SupplierInfoOrig.scr @@ -0,0 +1,59 @@ +module src.SupplierInfoOrig; + +type "UserName" from "AUTH.xsd" as username; +type "Password" from "AUTH.xsd" as password; +type "UUID" from "AUTH.xsd" as uuid; +type "/retailhub/supplierdetails" from "Retailer.xsd" as supplierdetails; +type "/retailhub/contractdetails" from "Retailer.xsd" as contractdetails; + +type "java.lang.Integer" from "rt.jar" as int; + + +global protocol PartnershipSupplier( role loginsvc, + role requestor, + role authorisersvc, + role usersvc, + role filtersvc, + role suppliersvc, + role contractsvc) +{ + login(username, password) from requestor to loginsvc; + choice at loginsvc + { + loginfailure() from loginsvc to requestor; + } or { + loginsuccess() from loginsvc to requestor; + rec mainBlock + { + choice at requestor + { // GET SUPPLIER INFO + getsuppliers(uuid) from requestor to authorisersvc; + choice at authorisersvc + { // DENIED + deny() from authorisersvc to requestor; + } or { // PREPARE FILTERED SUPPLIER INFO FOR REQUESTOR + getsuppliers() from authorisersvc to suppliersvc; + suppliers() from suppliersvc to authorisersvc; + filter(usercontext, filters, supplierdetails) from authorisersvc to filtersvc; + filtered() from filtersvc to authorisersvc; + suppliers() from authorisersvc to requestor; + } + continue mainBlock; + } or { // GET CONTRACT INFO + getcontracts() from requestor to authorisersvc; + choice at authoriser + { // DENIED + deny() from authorisersvc to requestor; + } or {// PREPARE FILTERED SUPPLIER INFO FOR REQUESTOR + getcontracts() from authorisersvc to contractsvc; + suppliers() from contractsvc to authorisersvc; + filter(usercontext, filters, contractdetails) from authorisersvc to filtersvc; + filtered() from filtersvc to authorisersvc; + contracts() from authorisersvc to requestor; + } + continue mainBlock; + } + } + } +} + diff --git a/scribble-test/src/test/scrib/demo/supplierinfo/old/SupplierInfoSubprot.scr b/scribble-test/src/test/scrib/demo/supplierinfo/old/SupplierInfoSubprot.scr new file mode 100644 index 000000000..46a567f32 --- /dev/null +++ b/scribble-test/src/test/scrib/demo/supplierinfo/old/SupplierInfoSubprot.scr @@ -0,0 +1,137 @@ +module src.SupplierInfoSubprot; + +type "UserName" from "AUTH.xsd" as username; +type "Password" from "AUTH.xsd" as password; +type "UUID" from "AUTH.xsd" as uuid; +type "/retailhub/supplierdetails" from "Retailer.xsd" as supplierdetails; +type "/retailhub/contractdetails" from "Retailer.xsd" as contractdetails; + +type "..." from "...xsd" as usercontext; +type "..." from "...xsd" as filters; + + +global protocol PartnershipSupplier( + role loginsvc, + role requestor, + role authorisersvc, + role filtersvc, + role suppliersvc, + role contractsvc) +{ + login(username, password) from requestor to loginsvc; + choice at loginsvc + { + //loginsuccess() from loginsvc to requestor; // Only an error if the following line remains uncommented + loginfailure() from loginsvc to requestor; + //getsuppliers(uuid) from requestor to authorisersvc; + 0() from requestor to authorisersvc; + 0() from authorisersvc to filtersvc; + 0() from authorisersvc to suppliersvc; + 0() from authorisersvc to contractsvc; + } + or + { + loginsuccess() from loginsvc to requestor; + do Main(requestor, authorisersvc, filtersvc, suppliersvc, contractsvc); + } +} + +aux global protocol Main( + role requestor, + role authorisersvc, + role filtersvc, + role suppliersvc, + role contractsvc) +{ + choice at requestor + { + // GET SUPPLIER INFO + getsuppliers(uuid) from requestor to authorisersvc; + //1() from authorisersvc to contractsvc; // FIXME: big state explosion? + //do SuppInfo(requestor, authorisersvc, filtersvc, suppliersvc); // FIXME: non-WF subprotocol + choice at authorisersvc + { + // DENIED + deny() from authorisersvc to requestor; + } + or + { + // PREPARE FILTERED SUPPLIER INFO FOR REQUESTOR + getsuppliers() from authorisersvc to suppliersvc; + do FilterInfo + + (authorisersvc, filtersvc); + suppliers() from suppliersvc to authorisersvc; + suppliers() from authorisersvc to requestor; + } + } + or + { + // GET CONTRACT INFO + getcontracts() from requestor to authorisersvc; + //2() from authorisersvc to suppliersvc; + choice at authorisersvc + { + // DENIED + deny() from authorisersvc to requestor; + } + or + { + // PREPARE FILTERED SUPPLIER INFO FOR REQUESTOR + getcontracts() from authorisersvc to contractsvc; + suppliers() from contractsvc to authorisersvc; + do FilterInfo + + // // OK (merge) + // // Error + (authorisersvc, filtersvc); + contracts() from authorisersvc to requestor; + } + } + + do Main(requestor, authorisersvc, filtersvc, suppliersvc, contractsvc); +} + + +//aux global protocol FilterInfo( // Bad non-det. payload +aux global protocol FilterInfo +< + sig Query +> +( + role authorisersvc, + role filtersvc +) +{ + //filter(usercontext, filters, details) from authorisersvc to filtersvc; + Query from authorisersvc to filtersvc; + filtered() from filtersvc to authorisersvc; +} + + +// FIXME: don't want WF validation on this (sub)protocol by itself +/* +global protocol SuppInfo( + role requestor, + role authorisersvc, + role filtersvc, + role suppliersvc) +{ + choice at authorisersvc + { + // DENIED + deny() from authorisersvc to requestor; + } + or + { + // PREPARE FILTERED SUPPLIER INFO FOR REQUESTOR + getsuppliers() from authorisersvc to suppliersvc; + suppliers() from suppliersvc to authorisersvc; + + filter(usercontext, filters, supplierdetails) from authorisersvc to filtersvc; + filtered() from filtersvc to authorisersvc; + suppliers() from authorisersvc to requestor; + } +} +//*/ + diff --git a/scribble-test/src/test/scrib/exercise/calculator/Client.java b/scribble-test/src/test/scrib/exercise/calculator/Client.java new file mode 100644 index 000000000..c9e376751 --- /dev/null +++ b/scribble-test/src/test/scrib/exercise/calculator/Client.java @@ -0,0 +1,48 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package exercise.calculator; + +import java.io.IOException; +import java.util.concurrent.ExecutionException; + +import org.scribble.main.ScribbleRuntimeException; +import org.scribble.net.ObjectStreamFormatter; +import org.scribble.net.session.MPSTEndpoint; +import org.scribble.net.session.SocketChannelEndpoint; + +import exercise.calculator.EProtocol.Calc.Calc; +import exercise.calculator.EProtocol.Calc.channels.C.Calc_C_1; +import exercise.calculator.EProtocol.Calc.roles.C; + +public class Client +{ + public static void main(String[] args) throws IOException, ScribbleRuntimeException, ExecutionException, InterruptedException, ClassNotFoundException + { + Calc calculator = new Calc(); + try (MPSTEndpoint se = new MPSTEndpoint<>(calculator, Calc.C, new ObjectStreamFormatter())) + { + se.connect(Calc.C, SocketChannelEndpoint::new, "localhost", 8888); + + Calc_C_1 s1 = new Calc_C_1(se); + + // toto: Implement the rest ... + + System.out.println("Done:"); + + } catch (Exception e) + { + e.printStackTrace(); + } + } +} diff --git a/scribble-test/src/test/scrib/exercise/calculator/EProtocol.scr b/scribble-test/src/test/scrib/exercise/calculator/EProtocol.scr new file mode 100644 index 000000000..c2bf7489f --- /dev/null +++ b/scribble-test/src/test/scrib/exercise/calculator/EProtocol.scr @@ -0,0 +1,25 @@ +//$ bin/scribblec.sh -d modules/core/src/test/scrib/ modules/core/src/test/scrib/exercise/calculator/EProtocol.scr -api Calc C + +module exercise.calculator.EProtocol; + +type "java.lang.Integer" from "rt.jar" as int; +type "java.lang.String" from "rt.jar" as string; + + +global protocol Calc(role S , role C ) { + rec Loop { + choice at C { + sum (int, int) from C to S ; + result (int) from S to C ; + continue Loop ; + } or { + multiply (int, int) from C to S ; + result (int) from S to C ; + continue Loop ; + } or { + quit () from C to S ; + terminate () from S to C ; + } + } +} + diff --git a/scribble-test/src/test/scrib/exercise/calculator/Server.java b/scribble-test/src/test/scrib/exercise/calculator/Server.java new file mode 100644 index 000000000..dfbdd7451 --- /dev/null +++ b/scribble-test/src/test/scrib/exercise/calculator/Server.java @@ -0,0 +1,46 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package exercise.calculator; + +import java.io.IOException; +import java.util.concurrent.ExecutionException; + +import org.scribble.main.ScribbleRuntimeException; +import org.scribble.net.ObjectStreamFormatter; +import org.scribble.net.session.MPSTEndpoint; +import org.scribble.net.session.SocketChannelEndpoint; + +import exercise.calculator.EProtocol.Calc.Calc; +import exercise.calculator.EProtocol.Calc.channels.S.Calc_S_1; +import exercise.calculator.EProtocol.Calc.roles.S; + + +public class Server +{ + public static void main(String[] args) throws IOException, ScribbleRuntimeException, ExecutionException, InterruptedException, ClassNotFoundException + { + Calc calculator = new Calc(); + try (MPSTEndpoint se = new MPSTEndpoint<>(calculator, Calc.S, new ObjectStreamFormatter())) + { + se.connect(Calc.S, SocketChannelEndpoint::new, "localhost", 8888); + Calc_S_1 s1 = new Calc_S_1(se); + + // toto: Implement the rest ... + + } catch (Exception e) + { + e.printStackTrace(); + } + } +} diff --git a/scribble-test/src/test/scrib/exercise/voting/EProtocol.scr b/scribble-test/src/test/scrib/exercise/voting/EProtocol.scr new file mode 100644 index 000000000..b0ab16f03 --- /dev/null +++ b/scribble-test/src/test/scrib/exercise/voting/EProtocol.scr @@ -0,0 +1,24 @@ +//$ bin/scribblec.sh -d modules/core/src/test/scrib/ modules/core/src/test/scrib/exercise/voting/EProtocol.scr -api EVoting C + +module exercise.voting.EProtocol; + +type "java.lang.Integer" from "rt.jar" as Int; +type "java.lang.String" from "rt.jar" as String; + + +global protocol EVoting(role V, role S){ + Authenticate(String ) from V to S; + choice at S { + Ok(String) from S to V; + + choice at V { + Yes(String) from V to S; + } or { + No(String) from V to S; + } + Result(Int) from S to V; + } or { + Reject(String ) from S to V; + } +} + diff --git a/scribble-test/src/test/scrib/exercise/voting/Server.java b/scribble-test/src/test/scrib/exercise/voting/Server.java new file mode 100644 index 000000000..f9400addc --- /dev/null +++ b/scribble-test/src/test/scrib/exercise/voting/Server.java @@ -0,0 +1,62 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package exercise.voting; + +import java.io.IOException; +import java.util.concurrent.ExecutionException; + +import org.scribble.main.ScribbleRuntimeException; +import org.scribble.net.Buf; +import org.scribble.net.ObjectStreamFormatter; +import org.scribble.net.session.MPSTEndpoint; +import org.scribble.net.session.SocketChannelEndpoint; + +import exercise.voting.EProtocol.EVoting.EVoting; +import exercise.voting.EProtocol.EVoting.channels.S.EVoting_S_1; +import exercise.voting.EProtocol.EVoting.channels.S.EVoting_S_3_Cases; +import exercise.voting.EProtocol.EVoting.channels.S.EVoting_S_4; +import exercise.voting.EProtocol.EVoting.roles.S; + +public class Server +{ + public static void main(String[] args) throws IOException, ScribbleRuntimeException, ExecutionException, InterruptedException, ClassNotFoundException + { + EVoting vp = new EVoting(); + try (MPSTEndpoint se = new MPSTEndpoint<>(vp, EVoting.S, new ObjectStreamFormatter())) + { + se.connect(EVoting.S, SocketChannelEndpoint::new, "localhost", 8888); + EVoting_S_1 s1 = new EVoting_S_1(se); + Buf name = new Buf<>(); + + EVoting_S_3_Cases cases = s1.receive(EVoting.V, EVoting.Authenticate, name) + .send(EVoting.V, EVoting.Ok, name.val).branch(EVoting.V); + + Buf vote = new Buf<>(); + + EVoting_S_4 s2 = null; + switch(cases.op){ + case No: s2 = cases.receive(EVoting.V, EVoting.No, vote); break; + case Yes: s2 = cases.receive(EVoting.V, EVoting.No, vote); break; + } + + s2.send(EVoting.V, EVoting.Result, new Integer(1)); + + System.out.printf("Done: ~s", vote.val); + + } catch (Exception e) + { + e.printStackTrace(); + } + } +} diff --git a/scribble-test/src/test/scrib/exercise/voting/Voter.java b/scribble-test/src/test/scrib/exercise/voting/Voter.java new file mode 100644 index 000000000..39777f82a --- /dev/null +++ b/scribble-test/src/test/scrib/exercise/voting/Voter.java @@ -0,0 +1,72 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package exercise.voting; + +import java.io.IOException; +import java.util.concurrent.ExecutionException; + +import org.scribble.main.ScribbleRuntimeException; +import org.scribble.net.Buf; +import org.scribble.net.ObjectStreamFormatter; +import org.scribble.net.session.MPSTEndpoint; +import org.scribble.net.session.SocketChannelEndpoint; + +import exercise.voting.EProtocol.EVoting.EVoting; +import exercise.voting.EProtocol.EVoting.channels.V.EVoting_V_1; +import exercise.voting.EProtocol.EVoting.channels.V.EVoting_V_2_Cases; +import exercise.voting.EProtocol.EVoting.channels.V.EVoting_V_4; +import exercise.voting.EProtocol.EVoting.roles.V; + + +public class Voter +{ + public static void main(String[] args) throws IOException, ScribbleRuntimeException, ExecutionException, InterruptedException, ClassNotFoundException + { + EVoting vp = new EVoting(); + try (MPSTEndpoint se = new MPSTEndpoint<>(vp, EVoting.V, new ObjectStreamFormatter())) + { + se.connect(EVoting.V, SocketChannelEndpoint::new, "localhost", 8888); + String name = "my name"; + EVoting_V_1 s1 = new EVoting_V_1(se); + + /* + EVoting_V_2_Cases cases = s1.receive(EVoting.S, EVoting.Authenticate, name) + .branch(EVoting.S);; + + EVoting_V_4 s3 = null; + + switch(cases.op){ + case Ok: Buf token = new Buf<>(); + s3 = cases.receive(EVoting.Ok, token) + .send(EVoting.S, EVoting.Maybe, token); + break; + case Reject: + Buf reason = new Buf<>(); + s3 = cases.receive(EVoting.S, EVoting.Reject,reason) + .send(EVoting.S, EVoting.Yes, name); + break; + + } + Buf results = new Buf<>(); + s3.receive(EVoting.S, EVoting.Result, results); + */ + + System.out.println("Done:"); + + } catch (Exception e) + { + e.printStackTrace(); + } + } +} diff --git a/scribble-test/src/test/scrib/scratch/scratch1/MyC.java b/scribble-test/src/test/scrib/scratch/scratch1/MyC.java new file mode 100644 index 000000000..5720d3b1b --- /dev/null +++ b/scribble-test/src/test/scrib/scratch/scratch1/MyC.java @@ -0,0 +1,82 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +//$ java -cp modules/cli/target/classes/';'modules/core/target/classes';'modules/trace/target/classes';'modules/parser/target/classes';c:\Users\Raymond\.m2\repository\org\antlr\antlr-runtime\3.2\antlr-runtime-3.2.jar;'modules/validation/target/classes/';'modules/projection/target/classes/';C:\Users\Raymond\.m2\repository\org\codehaus\jackson\jackson-mapper-asl\1.9.9\jackson-mapper-asl-1.9.9.jar;C:\Users\Raymond\.m2\repository\org\codehaus\jackson\jackson-core-asl\1.9.9\jackson-core-asl-1.9.9.jar' org.scribble2.cli.CommandLine -path modules/validation/src/test/scrib/src modules/validation/src/test/scrib/src/Test.scr -session Foo -d modules/validation/src/main/java +//$ java -cp modules/cli/target/classes/';'modules/core/target/classes';'modules/trace/target/classes';'modules/parser/target/classes';c:\Users\Raymond\.m2\repository\org\antlr\antlr-runtime\3.2\antlr-runtime-3.2.jar;'modules/validation/target/classes/';'modules/projection/target/classes/';C:\Users\Raymond\.m2\repository\org\codehaus\jackson\jackson-mapper-asl\1.9.9\jackson-mapper-asl-1.9.9.jar;C:\Users\Raymond\.m2\repository\org\codehaus\jackson\jackson-core-asl\1.9.9\jackson-core-asl-1.9.9.jar' org.scribble2.cli.CommandLine -path modules/validation/src/test/scrib/src modules/validation/src/test/scrib/src/Test.scr -api Foo A -d modules/validation/src/main/java + +package scratch.scratch1; + +import java.io.IOException; + +import org.scribble.main.ScribbleRuntimeException; +import org.scribble.net.ObjectStreamFormatter; +import org.scribble.net.session.MPSTEndpoint; +import org.scribble.net.session.SocketChannelEndpoint; + +import scratch.scratch1.Scratch1.Proto1.Proto1; +import scratch.scratch1.Scratch1.Proto1.channels.C.Proto1_C_1; +import scratch.scratch1.Scratch1.Proto1.channels.C.Proto1_C_2; +import scratch.scratch1.Scratch1.Proto1.channels.C.ioifaces.Receive_C_S_3_Int; +import scratch.scratch1.Scratch1.Proto1.channels.C.ioifaces.Select_C_S_1; +import scratch.scratch1.Scratch1.Proto1.channels.C.ioifaces.Select_C_S_2_Int__S_4a; +import scratch.scratch1.Scratch1.Proto1.channels.C.ioifaces.Select_C_S_4b; +import scratch.scratch1.Scratch1.Proto1.channels.C.ioifaces.Succ_Out_S_4a; +import scratch.scratch1.Scratch1.Proto1.roles.C; + + +public class MyC +{ + // refactor separate io iface generators + // fix action string canonical ordering + // subtype hierarchy / io iface for handler iface + + public static void main(String[] args) throws Exception + { + Proto1 adder = new Proto1(); + try (MPSTEndpoint se = new MPSTEndpoint<>(adder, Proto1.C, new ObjectStreamFormatter())) + { + se.connect(Proto1.S, SocketChannelEndpoint::new, "localhost", 8888); + + Proto1_C_2 s2 = new Proto1_C_1(se).send(Proto1.S, Proto1._1); + /*for (int i = 0; i < 3; i++) + { + s2 = + s2.send(Proto1.S, Proto1._2, 123) + .async(Proto1.S, Proto1._3) + .send(Proto1.S, Proto1._1); + } + s2.send(Proto1.S, Proto1._4).end();*/ + + /*for (int i = 0; i < 3; i++) + { + s1 = + s1.send(Proto1.S, Proto1._1) + .send(Proto1.S, Proto1._2, 123) + .receive(Proto1.S, Proto1._3, new Buff<>()); + } + s1.send(Proto1.S, Proto1._1).send(Proto1.S, Proto1._4).end();*/ + + foo(s2, 0).to(Select_C_S_4b.cast).send(Proto1.S, Proto1._4b); + } + } + + static Succ_Out_S_4a foo(Select_C_S_2_Int__S_4a s, int i) throws ScribbleRuntimeException, IOException + { + return (i < 3) + ? foo( + s.send(Proto1.S, Proto1._2, 123) + .to(Receive_C_S_3_Int.cast).async(Proto1.S, Proto1._3) + .to(Select_C_S_1.cast).send(Proto1.S, Proto1._1).to(Select_C_S_2_Int__S_4a.cast), i + 1) //Select_C_S_2_Int__S_4.cast + : s.send(Proto1.S, Proto1._4a); + } +} diff --git a/scribble-test/src/test/scrib/scratch/scratch1/MyS.java b/scribble-test/src/test/scrib/scratch/scratch1/MyS.java new file mode 100644 index 000000000..bd90e35cf --- /dev/null +++ b/scribble-test/src/test/scrib/scratch/scratch1/MyS.java @@ -0,0 +1,155 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package scratch.scratch1; + +import java.io.IOException; + +import org.scribble.main.ScribbleRuntimeException; +import org.scribble.net.Buf; +import org.scribble.net.ObjectStreamFormatter; +import org.scribble.net.scribsock.ScribServerSocket; +import org.scribble.net.scribsock.SocketChannelServer; +import org.scribble.net.session.MPSTEndpoint; + +import scratch.scratch1.Scratch1.Proto1.Proto1; +import scratch.scratch1.Scratch1.Proto1.channels.S.EndSocket; +import scratch.scratch1.Scratch1.Proto1.channels.S.Proto1_S_1; +import scratch.scratch1.Scratch1.Proto1.channels.S.ioifaces.Branch_S_C_2_Int__C_4a; +import scratch.scratch1.Scratch1.Proto1.channels.S.ioifaces.Handle_S_C_2_Int__C_4a; +import scratch.scratch1.Scratch1.Proto1.channels.S.ioifaces.Receive_S_C_1; +import scratch.scratch1.Scratch1.Proto1.channels.S.ioifaces.Receive_S_C_4b; +import scratch.scratch1.Scratch1.Proto1.channels.S.ioifaces.Select_S_C_3_Int; +import scratch.scratch1.Scratch1.Proto1.channels.S.ioifaces.Succ_In_C_2_Int; +import scratch.scratch1.Scratch1.Proto1.channels.S.ioifaces.Succ_In_C_4a; +import scratch.scratch1.Scratch1.Proto1.ops._2; +import scratch.scratch1.Scratch1.Proto1.ops._4a; +import scratch.scratch1.Scratch1.Proto1.roles.S; + +public class MyS +{ + public static void main(String[] args) throws IOException, ScribbleRuntimeException + { + try (ScribServerSocket ss = new SocketChannelServer(8888)) + { + //Buf i1 = new Buf<>(); + //Buf i2 = new Buf<>(); + + while (true) + { + Proto1 foo = new Proto1(); + //SessionEndpoint se = foo.project(Proto1.S, new ObjectStreamFormatter(), ss); + try (MPSTEndpoint se = new MPSTEndpoint<>(foo, Proto1.S, new ObjectStreamFormatter())) + { + se.accept(ss, Proto1.C); + + new Proto1_S_1(se).async(Proto1.C, Proto1._1) + //.branch(Proto1.C, new Handler()); + .handle(Proto1.C, new Handler2()); + //.branch(Proto1.C, new Handler3<>()); + } + catch (Exception e)//ScribbleRuntimeException | IOException | ExecutionException | InterruptedException | ClassNotFoundException e) + { + e.printStackTrace(); + } + } + } + } +} + +/*class Handler implements Proto1_S_2_Handler +{ + @Override + public void receive(EndSocket schan, _4 op) throws ScribbleRuntimeException, IOException + { + System.out.println("Done1-4"); + schan.end(); + } + + @Override + public void receive(Proto1_S_3 schan, _2 op, Buf b) throws ScribbleRuntimeException, IOException + { + System.out.println("Redo: " + b.val); + try + { + schan.send(Proto1.C, Proto1._3, 456).async(Proto1.C, Proto1._1) + .branch(Proto1.C, this); + //.handle(Proto1.C, this); // "this" handler is not generic enough + } + catch (ClassNotFoundException e) + { + throw new IOException(e); + } + } + + //@Override // Re-generated State I/O handler won't have the deprecated callback + public void receive(EndSocket schan, _5 op) throws ScribbleRuntimeException, IOException, ClassNotFoundException + { + System.out.println("Done1-5"); + } +} +//*/ + +//class Handler2 implements Handle_S_C_2_Int__C_4 +class Handler2 implements Handle_S_C_2_Int__C_4a +{ + @Override + //public void receive(Proto1_S_3 schan, _2 op, Buf b) throws ScribbleRuntimeException, IOException, ClassNotFoundException + //public void receive(Select_S_C_3_Int schan, _2 op, Buf b) throws ScribbleRuntimeException, IOException, ClassNotFoundException + //public void receive(Succ_In_C_2_Int schan, _2 op, Buf b) throws ScribbleRuntimeException, IOException, ClassNotFoundException + public void receive(Succ_In_C_2_Int schan, _2 op, Buf b) throws ScribbleRuntimeException, IOException, ClassNotFoundException + { + System.out.println("Redo: " + b.val); + schan.to(Select_S_C_3_Int.cast).send(Proto1.C, Proto1._3, 356).to(Receive_S_C_1.cast).async(Proto1.C, Proto1._1).to(Branch_S_C_2_Int__C_4a.cast).handle(Proto1.C, this); + } + + @Override + public void receive(Succ_In_C_4a schan, _4a op) throws ScribbleRuntimeException, IOException, ClassNotFoundException + { + schan.to(Receive_S_C_4b.cast).receive(Proto1.C, Proto1._4b).to(EndSocket.cast).end(); + System.out.println("Done2-4"); + } + + /*@Override + public void receive(Succ_In_C_5 schan, _5 op) throws ScribbleRuntimeException, IOException, ClassNotFoundException + { + System.out.println("Done2-5"); + }*/ +} + +/*class Handler3 implements Handle_S_C_2_Int__C_4__C_5 +{ + @Override + public void receive(Succ1 schan, _2 op, Buf b) throws ScribbleRuntimeException, IOException, ClassNotFoundException + { + System.out.println("Redo: " + b.val); + ((Branch_S_C_2_Int__C_4__C_5) schan.to(Select_S_C_3_Int.cast).send(Proto1.C, Proto1._3, 356).to(Receive_S_C_1.cast).async(Proto1.C, Proto1._1)).branch(Proto1.C, this); + //schan.to(Select_S_C_3_Int.cast).send(Proto1.C, Proto1._3, 356).to(Receive_S_C_1.cast).async(Proto1.C, Proto1._1).to(Branch_S_C_2_Int__C_4.cast).branch(Proto1.C, this); + //((Branch_S_C_2_Int__C_4) schan.to(Select_S_C_3_Int.cast).send(Proto1.C, Proto1._3, 356).to(Receive_S_C_1.cast).async(Proto1.C, Proto1._1)).branch(Proto1.C, this); + //schan.to(Select_S_C_3_Int.cast).send(Proto1.C, Proto1._3, 356).to(Receive_S_C_1.cast).async(Proto1.C, Proto1._1).to(Branch_S_C_2_Int__C_4.cast).branch(Proto1.C, this); + } + + @Override + public void receive(Succ2 schan, _4 op) throws ScribbleRuntimeException, IOException + { + schan.to(EndSocket.cast).end(); + System.out.println("Done3-4"); + } + + @Override + public void receive(Succ3 schan, _5 op) throws ScribbleRuntimeException, IOException, ClassNotFoundException + { + System.out.println("Done3-5"); + } +} +//*/ diff --git a/scribble-test/src/test/scrib/scratch/scratch1/Scratch1.scr b/scribble-test/src/test/scrib/scratch/scratch1/Scratch1.scr new file mode 100644 index 000000000..77141c5e2 --- /dev/null +++ b/scribble-test/src/test/scrib/scratch/scratch1/Scratch1.scr @@ -0,0 +1,65 @@ +//http://sandbox.kidstrythisathome.com/erdos/ + +//$ bin/scribblec.sh modules/core/src/test/scrib/scratch/scratch1/Scratch1.scr -ip modules/core/src/test/scrib/ -d modules/core/src/test/scrib/ -api Proto1 C -subtypes +//$ javadoc -cp modules/cli/target/classes/';'modules/core/target/classes';'modules/trace/target/classes';'modules/parser/target/classes';c:\Users\Raymond\.m2\repository\org\antlr\antlr-runtime\3.2\antlr-runtime-3.2.jar;'modules/validation/target/classes/';'modules/projection/target/classes/';C:\Users\Raymond\.m2\repository\org\codehaus\jackson\jackson-mapper-asl\1.9.9\jackson-mapper-asl-1.9.9.jar;C:\Users\Raymond\.m2\repository\org\codehaus\jackson\jackson-core-asl\1.9.9\jackson-core-asl-1.9.9.jar;'modules/core/src/test/scrib modules/core/src/test/scrib/scratch/scratch1/Proto1*.java -d test/doc/scratch/scratch1 + +module scratch.scratch1.Scratch1; + +type "java.lang.Integer" from "rt.jar" as Int; + +global protocol Proto1(role C, role S) +{ + rec X + { + 1() from C to S; + choice at C + { + 2(Int) from C to S; + 3(Int) from S to C; + continue X; + } + or + { + 4a() from C to S; + 4b() from C to S; + } + or + { + 4a() from C to S; // Currently needs -minfsm + 4b() from C to S; + } + } +} + +global protocol Proto2(role C, role S) +{ + 1() from C to S; + //2() from C to S; + choice at C + { + 3() from C to S; + do Proto2(C, S); + } + or + { + 2() from C to S; + } +} + +global protocol Proto3(role C, role S) +{ + rec X + { + 1() from C to S; + choice at C + { + 2(Int) from C to S; + 3(Int) from S to C; + continue X; + } + or + { + 4() from C to S; + } + } +} \ No newline at end of file diff --git a/scribble-test/src/test/scrib/test/foo/Foo.scr b/scribble-test/src/test/scrib/test/foo/Foo.scr new file mode 100644 index 000000000..63f6966ac --- /dev/null +++ b/scribble-test/src/test/scrib/test/foo/Foo.scr @@ -0,0 +1,27 @@ +//Raymond@HZHL3 ~/code/scribble-java/scribble-java +//$ java -cp modules/cli/target/classes/';'modules/core/target/classes';'modules/trace/target/classes';'modules/parser/target/classes';c:\Users\Raymond\.m2\repository\org\antlr\antlr-runtime\3.2\antlr-runtime-3.2.jar;'modules/validation/target/classes/';'modules/projection/target/classes/';C:\Users\Raymond\.m2\repository\org\codehaus\jackson\jackson-mapper-asl\1.9.9\jackson-mapper-asl-1.9.9.jar;C:\Users\Raymond\.m2\repository\org\codehaus\jackson\jackson-core-asl\1.9.9\jackson-core-asl-1.9.9.jar' org.scribble.cli.CommandLine -path modules/core/src/test/scrib modules/core/src/test/scrib/test/foo/Foo.scr -session Foo -d modules/core/src/test/scrib +//$ java -cp modules/cli/target/classes/';'modules/core/target/classes';'modules/trace/target/classes';'modules/parser/target/classes';c:\Users\Raymond\.m2\repository\org\antlr\antlr-runtime\3.2\antlr-runtime-3.2.jar;'modules/validation/target/classes/';'modules/projection/target/classes/';C:\Users\Raymond\.m2\repository\org\codehaus\jackson\jackson-mapper-asl\1.9.9\jackson-mapper-asl-1.9.9.jar;C:\Users\Raymond\.m2\repository\org\codehaus\jackson\jackson-core-asl\1.9.9\jackson-core-asl-1.9.9.jar' org.scribble.cli.CommandLine -path modules/core/src/test/scrib modules/core/src/test/scrib/test/foo/Foo.scr -api Foo A -d modules/core/src/test/scrib + +//$ javadoc -cp modules/cli/target/classes/';'modules/core/target/classes';'modules/trace/target/classes';'modules/parser/target/classes';c:\Users\Raymond\.m2\repository\org\antlr\antlr-runtime\3.2\antlr-runtime-3.2.jar;'modules/validation/target/classes/';'modules/projection/target/classes/';C:\Users\Raymond\.m2\repository\org\codehaus\jackson\jackson-mapper-asl\1.9.9\jackson-mapper-asl-1.9.9.jar;C:\Users\Raymond\.m2\repository\org\codehaus\jackson\jackson-core-asl\1.9.9\jackson-core-asl-1.9.9.jar;'modules/core/src/test/scrib modules/core/src/test/scrib/test/foo/Foo*.java -d test/javadoc/test + +//$ bin/scribblec.sh modules/core/src/test/scrib/test/foo/Foo.scr -ip modules/core/src/test/scrib/ -d modules/core/src/test/scrib/ -session Foo -api Foo A -V + +module test.foo.Foo; + + +//type "java.lang.Integer" from "rt.jar" as Integer; + + +global protocol Foo(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 2() from A to C; + } + or + { + 1() from A to C; + 2() from A to B; + } +} diff --git a/scribble-test/src/test/scrib/test/foo/MyA.java b/scribble-test/src/test/scrib/test/foo/MyA.java new file mode 100644 index 000000000..9910a2b03 --- /dev/null +++ b/scribble-test/src/test/scrib/test/foo/MyA.java @@ -0,0 +1,46 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +//$ java -cp modules/cli/target/classes/';'modules/core/target/classes';'modules/trace/target/classes';'modules/parser/target/classes';c:\Users\Raymond\.m2\repository\org\antlr\antlr-runtime\3.2\antlr-runtime-3.2.jar;'modules/validation/target/classes/';'modules/projection/target/classes/';C:\Users\Raymond\.m2\repository\org\codehaus\jackson\jackson-mapper-asl\1.9.9\jackson-mapper-asl-1.9.9.jar;C:\Users\Raymond\.m2\repository\org\codehaus\jackson\jackson-core-asl\1.9.9\jackson-core-asl-1.9.9.jar' org.scribble2.cli.CommandLine -path modules/validation/src/test/scrib/src modules/validation/src/test/scrib/src/Test.scr -session Foo -d modules/validation/src/main/java +//$ java -cp modules/cli/target/classes/';'modules/core/target/classes';'modules/trace/target/classes';'modules/parser/target/classes';c:\Users\Raymond\.m2\repository\org\antlr\antlr-runtime\3.2\antlr-runtime-3.2.jar;'modules/validation/target/classes/';'modules/projection/target/classes/';C:\Users\Raymond\.m2\repository\org\codehaus\jackson\jackson-mapper-asl\1.9.9\jackson-mapper-asl-1.9.9.jar;C:\Users\Raymond\.m2\repository\org\codehaus\jackson\jackson-core-asl\1.9.9\jackson-core-asl-1.9.9.jar' org.scribble2.cli.CommandLine -path modules/validation/src/test/scrib/src modules/validation/src/test/scrib/src/Test.scr -api Foo A -d modules/validation/src/main/java + +package test.foo; + +import org.scribble.runtime.net.ObjectStreamFormatter; +import org.scribble.runtime.net.session.MPSTEndpoint; +import org.scribble.runtime.net.session.SocketChannelEndpoint; + +import test.foo.Foo.Foo.Foo; +import test.foo.Foo.Foo.channels.A.Foo_A_1; +import test.foo.Foo.Foo.roles.A; + + +public class MyA +{ + public static void main(String[] args) throws Exception + { + //Buff i1 = new Buff<>(0); + + Foo foo = new Foo(); + try (MPSTEndpoint se = new MPSTEndpoint<>(foo, Foo.A, new ObjectStreamFormatter())) + { + se.connect(Foo.B, SocketChannelEndpoint::new, "localhost", 8888); + se.connect(Foo.C, SocketChannelEndpoint::new, "localhost", 9999); + + Foo_A_1 s1 = new Foo_A_1(se); + s1 + //.send(Foo.C, Foo._1).send(Foo.B, Foo._2); + .send(Foo.B, Foo._1).send(Foo.C, Foo._2); + } + } +} diff --git a/scribble-test/src/test/scrib/test/foo/MyBC.java b/scribble-test/src/test/scrib/test/foo/MyBC.java new file mode 100644 index 000000000..e8ad5a23c --- /dev/null +++ b/scribble-test/src/test/scrib/test/foo/MyBC.java @@ -0,0 +1,116 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package test.foo; + +import java.io.IOException; + +import org.scribble.main.ScribbleRuntimeException; +import org.scribble.runtime.net.ObjectStreamFormatter; +import org.scribble.runtime.net.scribsock.ScribServerSocket; +import org.scribble.runtime.net.scribsock.SocketChannelServer; +import org.scribble.runtime.net.session.MPSTEndpoint; + +import test.foo.Foo.Foo.Foo; +import test.foo.Foo.Foo.channels.B.Foo_B_1; +import test.foo.Foo.Foo.channels.B.Foo_B_1_Cases; +import test.foo.Foo.Foo.channels.C.Foo_C_1; +import test.foo.Foo.Foo.channels.C.Foo_C_1_Cases; +import test.foo.Foo.Foo.roles.B; +import test.foo.Foo.Foo.roles.C; + +public class MyBC +{ + public static void main(String[] args) throws IOException, ScribbleRuntimeException, InterruptedException + { + try (ScribServerSocket ss_B = new SocketChannelServer(8888); + ScribServerSocket ss_C = new SocketChannelServer(9999)) + { + //Buff s = new Buff<>(); + + while (true) + { + Foo foo = new Foo(); + + Thread B = new Thread() + { + public void run() + { + try (MPSTEndpoint se_B = new MPSTEndpoint<>(foo, Foo.B, new ObjectStreamFormatter())) + { + se_B.accept(ss_B, Foo.A); + Foo_B_1 s1_B = new Foo_B_1(se_B); + + Foo_B_1_Cases s1cases_B = s1_B.branch(Foo.A); + switch (s1cases_B.op) + { + case _1: + { + s1cases_B.receive(Foo._1); + System.out.println("B first!"); + break; + } + case _2: + { + s1cases_B.receive(Foo._2); + break; + } + } + } + catch (ScribbleRuntimeException | IOException | ClassNotFoundException e) + { + e.printStackTrace(); + } + } + }; + + Thread C = new Thread() + { + public void run() + { + try (MPSTEndpoint se_C = new MPSTEndpoint<>(foo, Foo.C, new ObjectStreamFormatter())) + { + se_C.accept(ss_C, Foo.A); + + Foo_C_1 s1_C = new Foo_C_1(se_C); + Foo_C_1_Cases s1cases_C = s1_C.branch(Foo.A); + switch (s1cases_C.op) + { + case _1: + { + s1cases_C.receive(Foo._1); + System.out.println("C first!"); + break; + } + case _2: + { + s1cases_C.receive(Foo._2); + break; + } + } + } + catch (ScribbleRuntimeException | IOException | ClassNotFoundException e) + { + e.printStackTrace(); + } + } + }; + + B.start(); + C.start(); + B.join(); + C.join(); + } + } + } +} diff --git a/scribble-test/src/test/scrib/test/test1/MyC.java b/scribble-test/src/test/scrib/test/test1/MyC.java new file mode 100644 index 000000000..094129aa5 --- /dev/null +++ b/scribble-test/src/test/scrib/test/test1/MyC.java @@ -0,0 +1,59 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +//$ java -cp modules/cli/target/classes/';'modules/core/target/classes';'modules/trace/target/classes';'modules/parser/target/classes';c:\Users\Raymond\.m2\repository\org\antlr\antlr-runtime\3.2\antlr-runtime-3.2.jar;'modules/validation/target/classes/';'modules/projection/target/classes/';C:\Users\Raymond\.m2\repository\org\codehaus\jackson\jackson-mapper-asl\1.9.9\jackson-mapper-asl-1.9.9.jar;C:\Users\Raymond\.m2\repository\org\codehaus\jackson\jackson-core-asl\1.9.9\jackson-core-asl-1.9.9.jar' org.scribble2.cli.CommandLine -path modules/validation/src/test/scrib/src modules/validation/src/test/scrib/src/Test.scr -session Foo -d modules/validation/src/main/java +//$ java -cp modules/cli/target/classes/';'modules/core/target/classes';'modules/trace/target/classes';'modules/parser/target/classes';c:\Users\Raymond\.m2\repository\org\antlr\antlr-runtime\3.2\antlr-runtime-3.2.jar;'modules/validation/target/classes/';'modules/projection/target/classes/';C:\Users\Raymond\.m2\repository\org\codehaus\jackson\jackson-mapper-asl\1.9.9\jackson-mapper-asl-1.9.9.jar;C:\Users\Raymond\.m2\repository\org\codehaus\jackson\jackson-core-asl\1.9.9\jackson-core-asl-1.9.9.jar' org.scribble2.cli.CommandLine -path modules/validation/src/test/scrib/src modules/validation/src/test/scrib/src/Test.scr -api Foo A -d modules/validation/src/main/java + +package test.test1; + +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import test.test1.Test1.Proto1.Proto1; +import test.test1.Test1.Proto1.roles.C; +import test.test1.Test1.Proto1.statechans.C.Proto1_C_1; +import test.test1.Test1.Proto1.statechans.C.Proto1_C_2; + +public class MyC +{ + public static void main(String[] args) throws Exception + { + Proto1 adder = new Proto1(); + try (MPSTEndpoint se = new MPSTEndpoint<>(adder, Proto1.C, + new ObjectStreamFormatter())) + { + se.request(Proto1.S, SocketChannelEndpoint::new, "localhost", 8888); + + Proto1_C_2 s2 = new Proto1_C_1(se).send(Proto1.S, Proto1._1); + for (int i = 0; i < 3; i++) + { + s2 = + s2.send(Proto1.S, Proto1._2, 123) + .receive(Proto1.S, Proto1._3, new Buf<>()) + .send(Proto1.S, Proto1._1); + } + s2.send(Proto1.S, Proto1._4).end(); + + /*for (int i = 0; i < 3; i++) + { + s1 = + s1.send(Proto1.S, Proto1._1) + .send(Proto1.S, Proto1._2, 123) + .receive(Proto1.S, Proto1._3, new Buff<>()); + } + s1.send(Proto1.S, Proto1._1).send(Proto1.S, Proto1._4).end();*/ + } + } +} diff --git a/scribble-test/src/test/scrib/test/test1/MyS.java b/scribble-test/src/test/scrib/test/test1/MyS.java new file mode 100644 index 000000000..a88b7daf6 --- /dev/null +++ b/scribble-test/src/test/scrib/test/test1/MyS.java @@ -0,0 +1,121 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package test.test1; + +import java.io.IOException; + +import org.scribble.main.ScribRuntimeException; +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.net.SocketChannelServer; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import test.test1.Test1.Proto1.Proto1; +import test.test1.Test1.Proto1.ops._2; +import test.test1.Test1.Proto1.ops._4; +import test.test1.Test1.Proto1.roles.S; +import test.test1.Test1.Proto1.statechans.S.EndSocket; +import test.test1.Test1.Proto1.statechans.S.Proto1_S_1; +import test.test1.Test1.Proto1.statechans.S.Proto1_S_2_Handler; +import test.test1.Test1.Proto1.statechans.S.Proto1_S_3; +import test.test1.Test1.Proto1.statechans.S.ioifaces.Branch_S_C_2_Integer__C_4; +import test.test1.Test1.Proto1.statechans.S.ioifaces.Handle_S_C_2_Integer__C_4; +import test.test1.Test1.Proto1.statechans.S.ioifaces.Receive_S_C_1; +import test.test1.Test1.Proto1.statechans.S.ioifaces.Select_S_C_3_Integer; +import test.test1.Test1.Proto1.statechans.S.ioifaces.Succ_In_C_2_Integer; +import test.test1.Test1.Proto1.statechans.S.ioifaces.Succ_In_C_4; + +public class MyS +{ + public static void main(String[] args) + throws IOException, ScribRuntimeException + { + try (ScribServerSocket ss = new SocketChannelServer(8888)) + { + //Buf i1 = new Buf<>(); + //Buf i2 = new Buf<>(); + + while (true) + { + Proto1 foo = new Proto1(); + //SessionEndpoint se = foo.project(Proto1.S, new ObjectStreamFormatter(), ss); + try (MPSTEndpoint se = new MPSTEndpoint<>(foo, Proto1.S, + new ObjectStreamFormatter())) + { + se.accept(ss, Proto1.C); + + new Proto1_S_1(se).async(Proto1.C, Proto1._1) + //.branch(Proto1.C, new Handler()); + .handle(Proto1.C, new Handler2()); + } + catch (Exception e)//ScribbleRuntimeException | IOException | ExecutionException | InterruptedException | ClassNotFoundException e) + { + e.printStackTrace(); + } + } + } + } +} + +class Handler implements Proto1_S_2_Handler +{ + @Override + public void receive(EndSocket schan, _4 op) + throws ScribRuntimeException, IOException + { + System.out.println("Done"); + schan.end(); + } + + @Override + public void receive(Proto1_S_3 schan, _2 op, Buf b) + throws ScribRuntimeException, IOException + { + System.out.println("Redo: " + b.val); + try + { + schan.send(Proto1.C, Proto1._3, 456).async(Proto1.C, Proto1._1) + .branch(Proto1.C, this); + } + catch (ClassNotFoundException e) + { + throw new IOException(e); + } + } +} + +class Handler2 + implements Handle_S_C_2_Integer__C_4 +{ + @Override + public void receive(Succ_In_C_2_Integer schan, _2 op, + Buf b) + throws ScribRuntimeException, IOException, ClassNotFoundException + { + System.out.println("Redo: " + b.val); + schan + .to(Select_S_C_3_Integer.cast).send(Proto1.C, Proto1._3, 123) + .to(Receive_S_C_1.cast).async(Proto1.C, Proto1._1) + .to(Branch_S_C_2_Integer__C_4.cast).handle(Proto1.C, this); + } + + @Override + public void receive(Succ_In_C_4 schan, _4 op) + throws ScribRuntimeException, IOException, ClassNotFoundException + { + schan.to(EndSocket.cast).end(); + System.out.println("Done"); + } +} diff --git a/scribble-test/src/test/scrib/test/test1/Test1.scr b/scribble-test/src/test/scrib/test/test1/Test1.scr new file mode 100644 index 000000000..3c11f8f03 --- /dev/null +++ b/scribble-test/src/test/scrib/test/test1/Test1.scr @@ -0,0 +1,32 @@ +//http://sandbox.kidstrythisathome.com/erdos/ + +//$ bin/scribblec.sh scribble-test/src/test/scrib/test/test1/Test1.scr -ip scribble-test/src/test/scrib/ -d scribble-test/src/test/scrib/ -api Proto1 C -V +//$ javadoc -cp modules/cli/target/classes/';'modules/core/target/classes';'modules/trace/target/classes';'modules/parser/target/classes';c:\Users\Raymond\.m2\repository\org\antlr\antlr-runtime\3.2\antlr-runtime-3.2.jar;'modules/validation/target/classes/';'modules/projection/target/classes/';C:\Users\Raymond\.m2\repository\org\codehaus\jackson\jackson-mapper-asl\1.9.9\jackson-mapper-asl-1.9.9.jar;C:\Users\Raymond\.m2\repository\org\codehaus\jackson\jackson-core-asl\1.9.9\jackson-core-asl-1.9.9.jar;'modules/core/src/test/scrib modules/core/src/test/scrib/test/test1/Proto1*.java -d test/doc/test1 + +module test.test1.Test1; + +type "java.lang.Integer" from "rt.jar" as Integer; + +global protocol Proto1(role C, role S) +{ + rec X + { + 1() from C to S; + choice at C + { + 2(Integer) from C to S; + 3(Integer) from S to C; + continue X; + } + or + { + 4() from C to S; + } + } +} + +global protocol Proto2(role C, role S) +{ + 1() from C to S; + 2() from C to S; +} diff --git a/scribble-test/src/test/scrib/test/test2/MyA.java b/scribble-test/src/test/scrib/test/test2/MyA.java new file mode 100644 index 000000000..72a1e4072 --- /dev/null +++ b/scribble-test/src/test/scrib/test/test2/MyA.java @@ -0,0 +1,106 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package test.test2; + +import static test.test2.Test2.Proto1.Proto1.A; +import static test.test2.Test2.Proto1.Proto1.B; +import static test.test2.Test2.Proto1.Proto1._1; + +import java.io.IOException; +import java.util.concurrent.Future; + +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.session.MPSTEndpoint; + +import test.test2.Test2.Proto1.Proto1; +import test.test2.Test2.Proto1.callbacks.A.Proto1_A; +import test.test2.Test2.Proto1.callbacks.A.states.Proto1_A_1; +import test.test2.Test2.Proto1.roles.A; + +// TODO: test interop between ED API and SC API (also for sig messages) +public class MyA +{ + public static void main(String[] args) throws IOException + { + //foo1(); + foo3(); + } + + public static void foo3() throws IOException + { + Proto1 P1 = new Proto1(); + try (Proto1_A a = new Proto1_A<>(P1, A, new ObjectStreamFormatter(), null)) + { + a.request(B, SocketChannelEndpoint::new, "localhost", 8888); + + //TODO: test choice at A { 1() from A to B; 2() from A to C; } or { 1() from A to C; 3() from A to B; } + + a.icallback(Proto1_A_1.id, x -> + new Proto1_A_1.B._1(123) + //new Proto1_A_5.B._2("abc") + ); + // new IntPay<>(B, _1, 123)); // IntPay -- or StrPay + + Future f = a.run(); // Even if registration checks still dynamic, much better to check at "session init" than partway through session after potential side effects + f.get(); + + System.out.println("(A) end"); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + + /*public static void foo2() throws IOException, ScribbleRuntimeException + { + Proto1 P1 = new Proto1(); + try (Proto1_A a = new Proto1_A(P1, A, new ObjectStreamFormatter())) + { + a.request(B, SocketChannelEndpoint::new, "localhost", 8888); + //a.register(Proto1_A_5.id, x -> new ScribEvent(B, _1)); + a.register(Proto1_A_5.id, x -> new ScribEvent(B, _2)); + // FIXME: type by Op (state-specific op enum for state-specific scribevent?); sort out session object + + Future f = a.run(); + f.get(); + + System.out.println("A done"); + } + catch (Exception e) + { + e.printStackTrace(); + } + }*/ + + public static void foo1() + { + Proto1 P1 = new Proto1(); + try (MPSTEndpoint a = new MPSTEndpoint<>(P1, A, new ObjectStreamFormatter())) + { + a.request(B, SocketChannelEndpoint::new, "localhost", 8888); + + test.test2.Test2.Proto1.statechans.A.Proto1_A_1 s + = new test.test2.Test2.Proto1.statechans.A.Proto1_A_1(a); + s.send(B, _1, 123); + + //new Proto1_A_1(a).send(B, _2, "abc"); + } + catch (Exception e) + { + e.printStackTrace(); + } + } +} diff --git a/scribble-test/src/test/scrib/test/test2/MyB.java b/scribble-test/src/test/scrib/test/test2/MyB.java new file mode 100644 index 000000000..8f5ea4cf0 --- /dev/null +++ b/scribble-test/src/test/scrib/test/test2/MyB.java @@ -0,0 +1,152 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package test.test2; + +import static test.test2.Test2.Proto1.Proto1.A; +import static test.test2.Test2.Proto1.Proto1.B; + +import java.io.IOException; +import java.util.concurrent.Future; + +import org.scribble.main.ScribbleRuntimeException; +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.net.SocketChannelServer; +import org.scribble.runtime.session.MPSTEndpoint; +import org.scribble.runtime.util.Buf; + +import test.test2.Test2.Proto1.Proto1; +import test.test2.Test2.Proto1.callbacks.B.Proto1_B; +import test.test2.Test2.Proto1.callbacks.B.Proto1_B_1_Branch; +import test.test2.Test2.Proto1.callbacks.B.states.Proto1_B_1; +import test.test2.Test2.Proto1.ops._1; +import test.test2.Test2.Proto1.ops._2; +import test.test2.Test2.Proto1.roles.A; +import test.test2.Test2.Proto1.roles.B; +import test.test2.Test2.Proto1.statechans.B.EndSocket; +import test.test2.Test2.Proto1.statechans.B.Proto1_B_1_Handler; + +public class MyB +{ + public static void main(String[] args) throws IOException, ScribbleRuntimeException + { + foo3(); + //foo1(); + } + + public static void foo3() throws IOException + { + class MyHandler extends Proto1_B_1_Branch + { + @Override + public void receive(Void data, A peer, _1 op, Integer arg1) + { + System.out.println("(B) received 1: " + arg1); + } + + @Override + public void receive(Void data, A peer, _2 op, String arg1) + { + System.out.println("(B) received 2: " + arg1); + } + } + + try (ScribServerSocket ss = new SocketChannelServer(8888)) + { + while (true) + { + Proto1 P1 = new Proto1(); + try (Proto1_B b = new Proto1_B<>(P1, B, new ObjectStreamFormatter(), null)) + { + b.accept(ss, A); + + b.icallback(Proto1_B_1.id, new MyHandler()); + + Future f = b.run(); + f.get(); + + System.out.println("(B) end"); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + } + } + + /*public static void foo2() throws IOException, ScribbleRuntimeException + { + try (ScribServerSocket ss = new SocketChannelServer(8888)) + { + while (true) + { + Proto1 P1 = new Proto1(); + try (Proto1_B b = new Proto1_B(P1, B, new ObjectStreamFormatter())) + { + b.accept(ss, A); + b.register(Proto1_B_10.id, + (op, sess) -> { System.out.println("Done 1"); return null; }, + (op, sess) -> { System.out.println("Done 2"); return null; }); + // FIXME: branch handler objects and payloads + + Future f = b.run(); + f.get(); + + System.out.println("B done"); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + } + }*/ + + public static void foo1() throws IOException, ScribbleRuntimeException + { + class MyHandler implements Proto1_B_1_Handler + { + @Override + public void receive(EndSocket schan, _1 op, Buf arg1) throws ScribbleRuntimeException, IOException, ClassNotFoundException + { + System.out.println("Done 1"); + } + + @Override + public void receive(EndSocket schan, _2 op, Buf arg1) throws ScribbleRuntimeException, IOException, ClassNotFoundException + { + System.out.println("Done 2"); + } + } + + try (ScribServerSocket ss = new SocketChannelServer(8888)) + { + while (true) + { + Proto1 P1 = new Proto1(); + try (MPSTEndpoint b = new MPSTEndpoint<>(P1, B, new ObjectStreamFormatter())) + { + b.accept(ss, A); + + new test.test2.Test2.Proto1.statechans.B.Proto1_B_1(b).branch(A, new MyHandler()); + } + catch (Exception e)//ScribbleRuntimeException | IOException | ExecutionException | InterruptedException | ClassNotFoundException e) + { + e.printStackTrace(); + } + } + } + } +} diff --git a/scribble-test/src/test/scrib/test/test2/Test2.scr b/scribble-test/src/test/scrib/test/test2/Test2.scr new file mode 100644 index 000000000..33fda4133 --- /dev/null +++ b/scribble-test/src/test/scrib/test/test2/Test2.scr @@ -0,0 +1,19 @@ +//$ bin/scribblec.sh scribble-test/src/test/scrib/test/test2/Test2.scr -d scribble-test/src/test/scrib/ -cbapi Proto1 A -cbapi Proto1 B +//$ javadoc -cp scribble-cli/target/classes/';'scribble-test/target/classes';'scribble-parser/target/classes';'scribble-parser/lib/antlr-3.5.2-complete.jar';'scrib-core/src/test/scrib scrib-core/src/test/scrib/test/test2/Proto1*.java -d test/doc/test2 + +module test.test2.Test2; + +type "java.lang.Integer" from "rt.jar" as Int; +type "java.lang.String" from "rt.jar" as Str; + +global protocol Proto1(role A, role B) +{ + choice at A + { + 1(Int) from A to B; + } + or + { + 2(Str) from A to B; + } +} diff --git a/scribble-test/src/test/scrib/test/test3/MyA.java b/scribble-test/src/test/scrib/test/test3/MyA.java new file mode 100644 index 000000000..e13d1b4f1 --- /dev/null +++ b/scribble-test/src/test/scrib/test/test3/MyA.java @@ -0,0 +1,55 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package test.test3; + +import static test.test3.Test3.Proto1.Proto1.A; +import static test.test3.Test3.Proto1.Proto1.B; + +import java.io.IOException; +import java.util.concurrent.Future; + +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.SocketChannelEndpoint; + +import test.test3.Test3.Proto1.Proto1; +import test.test3.Test3.Proto1.callbacks.A.Proto1_A; +import test.test3.Test3.Proto1.callbacks.A.states.Proto1_A_1; + +public class MyA +{ + public static void main(String[] args) throws IOException + { + Proto1 P1 = new Proto1(); + try (Proto1_A aep + = new Proto1_A<>(P1, A, new ObjectStreamFormatter(), new int[1])) + { + aep.request(B, SocketChannelEndpoint::new, "localhost", 8888); + + aep.icallback(Proto1_A_1.id, + x -> (x[0]++ < 3) + ? new Proto1_A_1.B._1(123) + : new Proto1_A_1.B._3("abc") + ); + + Future f = aep.run(); + f.get(); + + System.out.println("(A) end"); + } + catch (Exception e) + { + e.printStackTrace(); + } + } +} diff --git a/scribble-test/src/test/scrib/test/test3/MyB.java b/scribble-test/src/test/scrib/test/test3/MyB.java new file mode 100644 index 000000000..9b893d3e6 --- /dev/null +++ b/scribble-test/src/test/scrib/test/test3/MyB.java @@ -0,0 +1,87 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package test.test3; + +import static test.test3.Test3.Proto1.Proto1.A; +import static test.test3.Test3.Proto1.Proto1.B; +import static test.test3.Test3.Proto1.Proto1.C; + +import java.io.IOException; +import java.util.concurrent.Future; + +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.net.SocketChannelEndpoint; +import org.scribble.runtime.net.SocketChannelServer; + +import test.test3.Test3.Proto1.Proto1; +import test.test3.Test3.Proto1.callbacks.B.Proto1_B; +import test.test3.Test3.Proto1.callbacks.B.Proto1_B_1_Branch; +import test.test3.Test3.Proto1.callbacks.B.states.Proto1_B_1; +import test.test3.Test3.Proto1.callbacks.B.states.Proto1_B_2; +import test.test3.Test3.Proto1.callbacks.B.states.Proto1_B_3; +import test.test3.Test3.Proto1.ops._1; +import test.test3.Test3.Proto1.ops._3; +import test.test3.Test3.Proto1.roles.A; + +public class MyB +{ + public static void main(String[] args) throws IOException + { + class MyHandler extends Proto1_B_1_Branch + { + @Override + public void receive(int[] data, A peer, _1 op, Integer x) + { + data[0]++; + System.out.println("(B) received 1: " + data[0] + ", " + x); + } + + @Override + public void receive(int[] data, A peer, _3 op, String x) + { + data[0]++; + System.out.println("(B) received 3: " + data[0] + ", " + x); + } + } + + try (ScribServerSocket ss = new SocketChannelServer(8888)) + { + while (true) + { + Proto1 P1 = new Proto1(); + try (Proto1_B b = new Proto1_B<>(P1, B, new ObjectStreamFormatter(), new int[1])) + { + b.accept(ss, A); + b.request(C, SocketChannelEndpoint::new, "localhost", 9999); + + b.icallback(Proto1_B_1.id, new MyHandler()) + .icallback(Proto1_B_2.id, x -> new Proto1_B_2.C._2(456)) + .icallback(Proto1_B_3.id, x -> new Proto1_B_3.C._4("def")); + + //b.icallback(Proto1_B_2.id, x -> new Proto1_B_3.C._4("def")); + + Future f = b.run(); + f.get(); + + System.out.println("(B) end"); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + } + } +} diff --git a/scribble-test/src/test/scrib/test/test3/MyC.java b/scribble-test/src/test/scrib/test/test3/MyC.java new file mode 100644 index 000000000..2ccd7339d --- /dev/null +++ b/scribble-test/src/test/scrib/test/test3/MyC.java @@ -0,0 +1,76 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package test.test3; + +import static test.test3.Test3.Proto1.Proto1.B; +import static test.test3.Test3.Proto1.Proto1.C; + +import java.io.IOException; +import java.util.concurrent.Future; + +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.net.SocketChannelServer; + +import test.test3.Test3.Proto1.Proto1; +import test.test3.Test3.Proto1.callbacks.C.Proto1_C; +import test.test3.Test3.Proto1.callbacks.C.Proto1_C_1_Branch; +import test.test3.Test3.Proto1.callbacks.C.states.Proto1_C_1; +import test.test3.Test3.Proto1.ops._2; +import test.test3.Test3.Proto1.ops._4; +import test.test3.Test3.Proto1.roles.B; + +public class MyC +{ + public static void main(String[] args) throws IOException + { + class MyHandler extends Proto1_C_1_Branch + { + @Override + public void receive(Void data, B peer, _2 op, Integer x) + { + System.out.println("(C) received 2: " + x); + } + + @Override + public void receive(Void data, B peer, _4 op, String x) + { + System.out.println("(C) received 4: " + x); + } + } + + try (ScribServerSocket ss = new SocketChannelServer(9999)) + { + while (true) + { + Proto1 P1 = new Proto1(); + try (Proto1_C cep = new Proto1_C<>(P1, C, new ObjectStreamFormatter(), null)) + { + cep.accept(ss, B); + + cep.icallback(Proto1_C_1.id, new MyHandler()); + + Future f = cep.run(); + f.get(); + + System.out.println("(C) end"); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + } + } +} diff --git a/scribble-test/src/test/scrib/test/test3/Test3.scr b/scribble-test/src/test/scrib/test/test3/Test3.scr new file mode 100644 index 000000000..ad9e614cb --- /dev/null +++ b/scribble-test/src/test/scrib/test/test3/Test3.scr @@ -0,0 +1,22 @@ +//$ bin/scribblec.sh scribble-test/src/test/scrib/test/test3/Test3.scr -d scribble-test/src/test/scrib/ -cbapi Proto1 A -cbapi Proto1 B -cbapi Proto1 C +//$ javadoc -cp scribble-cli/target/classes/';'scribble-test/target/classes';'scribble-parser/target/classes';'scribble-parser/lib/antlr-3.5.2-complete.jar';'scrib-core/src/test/scrib scrib-core/src/test/scrib/test/test3/Proto1*.java -d test/doc/test3 + +module test.test3.Test3; + +type "java.lang.Integer" from "rt.jar" as Int; +type "java.lang.String" from "rt.jar" as Str; + +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1(Int) from A to B; + 2(Int) from B to C; + do Proto1(A, B, C); + } + or + { + 3(Str) from A to B; + 4(Str) from B to C; + } +} diff --git a/scribble-test/src/test/scrib/test/test4/MyA.java b/scribble-test/src/test/scrib/test/test4/MyA.java new file mode 100644 index 000000000..9c5d0e835 --- /dev/null +++ b/scribble-test/src/test/scrib/test/test4/MyA.java @@ -0,0 +1,55 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package test.test4; + +import static test.test4.Test4.Proto1.Proto1.A; +import static test.test4.Test4.Proto1.Proto1.B; + +import java.io.IOException; +import java.util.concurrent.Future; + +import org.scribble.runtime.net.SocketChannelEndpoint; + +import test.test4.Test4.Proto1.Proto1; +import test.test4.Test4.Proto1.callbacks.A.Proto1_A; +import test.test4.Test4.Proto1.callbacks.A.states.Proto1_A_1; +import test.test4.sig.Bar; +import test.test4.sig.Foo; +import test.test4.sig.Test4Formatter;; + +public class MyA +{ + public static void main(String[] args) throws IOException + { + Proto1 P1 = new Proto1(); + try (Proto1_A a = new Proto1_A<>(P1, A, new Test4Formatter(), new int[1])) + { + a.request(B, SocketChannelEndpoint::new, "localhost", 8888); + + a.icallback(Proto1_A_1.id, + x -> (x[0]++ < 5) ? new Proto1_A_1.B.Foo(new Foo("abc" + x[0])) : new Proto1_A_1.B.Bar(new Bar(123)) + ); + // FIXME: "inline" Sig class constructor args directly as Op class constructor args -- maybe by reflection + + Future f = a.run(); + f.get(); + + System.out.println("(A) end"); + } + catch (Exception e) + { + e.printStackTrace(); + } + } +} diff --git a/scribble-test/src/test/scrib/test/test4/MyB.java b/scribble-test/src/test/scrib/test/test4/MyB.java new file mode 100644 index 000000000..98b4490a3 --- /dev/null +++ b/scribble-test/src/test/scrib/test/test4/MyB.java @@ -0,0 +1,78 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package test.test4; + +import static test.test4.Test4.Proto1.Proto1.A; +import static test.test4.Test4.Proto1.Proto1.B; + +import java.io.IOException; +import java.util.concurrent.Future; + +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.net.SocketChannelServer; + +import test.test4.Test4.Proto1.Proto1; +import test.test4.Test4.Proto1.callbacks.B.Proto1_B; +import test.test4.Test4.Proto1.callbacks.B.Proto1_B_1_Branch; +import test.test4.Test4.Proto1.callbacks.B.states.Proto1_B_1; +import test.test4.Test4.Proto1.roles.A; +import test.test4.sig.Bar; +import test.test4.sig.Foo; +import test.test4.sig.Test4Formatter; + +public class MyB +{ + public static void main(String[] args) throws IOException + { + class MyHandler extends Proto1_B_1_Branch + { + @Override + public void receive(int[] data, A peer, Foo m) + { + data[0]++; + System.out.println("(B) received Foo: " + m.getBody() + ", " + data[0]); + } + + @Override + public void receive(int[] data, A peer, Bar m) + { + data[0]++; + System.out.println("(B) received Bar: " + m.getBody() + ", " + data[0]); + } + } + + try (ScribServerSocket ss = new SocketChannelServer(8888)) + { + while (true) + { + Proto1 P1 = new Proto1(); + try (Proto1_B b = new Proto1_B<>(P1, B, new Test4Formatter(), new int[1])) + { + b.accept(ss, A); + + b.icallback(Proto1_B_1.id, new MyHandler()); + + Future f = b.run(); + f.get(); + + System.out.println("(B) end"); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + } + } +} diff --git a/scribble-test/src/test/scrib/test/test4/Test4.scr b/scribble-test/src/test/scrib/test/test4/Test4.scr new file mode 100644 index 000000000..2c729455a --- /dev/null +++ b/scribble-test/src/test/scrib/test/test4/Test4.scr @@ -0,0 +1,20 @@ +//$ bin/scribblec.sh scribble-test/src/test/scrib/test/test4/Test4.scr -d scribble-test/src/test/scrib/ -cbapi Proto1 A -cbapi Proto1 B +//$ javadoc -cp scribble-cli/target/classes/';'scribble-test/target/classes';'scribble-parser/target/classes';'scribble-parser/lib/antlr-3.5.2-complete.jar';'scrib-core/src/test/scrib scrib-core/src/test/scrib/test/test4/Proto1*.java -d test/doc/test4 + +module test.test4.Test4; + +sig "test.test4.sig.Foo" from "test/test4/sig/Foo.java" as Foo; +sig "test.test4.sig.Bar" from "test/test4/sig/Bar.java" as Bar; + +global protocol Proto1(role A, role B) +{ + choice at A + { + Foo from A to B; + do Proto1(A, B); + } + or + { + Bar from A to B; + } +} diff --git a/scribble-test/src/test/scrib/test/test4/sig/Bar.java b/scribble-test/src/test/scrib/test/test4/sig/Bar.java new file mode 100644 index 000000000..717a2e36c --- /dev/null +++ b/scribble-test/src/test/scrib/test/test4/sig/Bar.java @@ -0,0 +1,32 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package test.test4.sig; + +import test.test4.Test4.Proto1.Proto1; + +public class Bar extends Test4Message +{ + private static final long serialVersionUID = 1L; + + public Bar(int body) + { + super(Proto1.Bar, body); + } + + @Override + public Integer getBody() + { + return (Integer) this.payload[0]; + } +} diff --git a/scribble-test/src/test/scrib/test/test4/sig/Foo.java b/scribble-test/src/test/scrib/test/test4/sig/Foo.java new file mode 100644 index 000000000..bd52d0700 --- /dev/null +++ b/scribble-test/src/test/scrib/test/test4/sig/Foo.java @@ -0,0 +1,32 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package test.test4.sig; + +import test.test4.Test4.Proto1.Proto1; + +public class Foo extends Test4Message +{ + private static final long serialVersionUID = 1L; + + public Foo(String body) + { + super(Proto1.Foo, body); + } + + @Override + public String getBody() + { + return (String) this.payload[0]; + } +} diff --git a/scribble-test/src/test/scrib/test/test4/sig/Test4Formatter.java b/scribble-test/src/test/scrib/test/test4/sig/Test4Formatter.java new file mode 100644 index 000000000..603c62acd --- /dev/null +++ b/scribble-test/src/test/scrib/test/test4/sig/Test4Formatter.java @@ -0,0 +1,109 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package test.test4.sig; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; + +import org.scribble.runtime.message.ScribMessage; +import org.scribble.runtime.message.ScribMessageFormatter; + +public class Test4Formatter implements ScribMessageFormatter +{ + public static Charset cs = Charset.forName("UTF8"); + + public Test4Formatter() + { + + } + + @Override + public byte[] toBytes(ScribMessage m) throws IOException + { + return ((Test4Message) m).toBytes(); + } + + @Override + public ScribMessage fromBytes(ByteBuffer bb) throws IOException, ClassNotFoundException + { + bb.flip(); + int rem = bb.remaining(); + if (rem < 3) + { + bb.compact(); + return null; + } + + int pos = bb.position(); + String m = new String(new byte[] { bb.get(pos), bb.get(pos + 1), bb.get(pos + 2) }, Test4Formatter.cs); + switch (m) + { + case "Foo": + { + String body = readLine(bb, pos + 3).trim(); // Whitespace already built into the message classes + bb.compact(); + if (body == null) + { + return null; + } + return new Foo(body); + } + case "Bar": + { + String body = readLine(bb, pos + 3).trim(); // Whitespace already built into the message classes + bb.compact(); + if (body == null) + { + return null; + } + return new Bar(Integer.parseInt(body)); + } + default: throw new RuntimeException("Deserialization error: " + m); + } + } + + private static String readLine(ByteBuffer bb, int i) throws IOException + { + StringBuilder sb = new StringBuilder(); + for (int limit = bb.limit(); i <= limit; ) + { + char c = (char) bb.get(i++); + sb.append(c); + if (c == '\n') + { + bb.position(i); + return sb.substring(0, sb.length() - 1).toString(); + } + } + return null; + } + + + @Deprecated + @Override + public void writeMessage(DataOutputStream dos, ScribMessage m) throws IOException + { + throw new RuntimeException("Deprecated: " + m); + } + + @Deprecated + @Override + public Test4Message readMessage(DataInputStream dis) throws IOException + { + throw new RuntimeException("Deprecated: "); + } +} diff --git a/scribble-test/src/test/scrib/test/test4/sig/Test4Message.java b/scribble-test/src/test/scrib/test/test4/sig/Test4Message.java new file mode 100644 index 000000000..d430b679c --- /dev/null +++ b/scribble-test/src/test/scrib/test/test4/sig/Test4Message.java @@ -0,0 +1,47 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package test.test4.sig; + +import org.scribble.runtime.message.ScribMessage; +import org.scribble.type.name.Op; + +public abstract class Test4Message extends ScribMessage +{ + private static final long serialVersionUID = 1L; + + /*public Test4Message(Op op) + { + super(op); + }*/ + + public Test4Message(Op op, Object body) + { + super(op, body); + } + + public abstract Object getBody(); + + public byte[] toBytes() + { + // op is 3-char header (Foo/Bar) + byte[] bs = (this.op.toString() + getBody() + "\n").getBytes(Test4Formatter.cs); + return bs; + } + + @Override + public String toString() + { + return new String(toBytes()); + } +} diff --git a/scribble-test/src/test/scrib/test/test5/MyA.java b/scribble-test/src/test/scrib/test/test5/MyA.java new file mode 100644 index 000000000..7492cdfb4 --- /dev/null +++ b/scribble-test/src/test/scrib/test/test5/MyA.java @@ -0,0 +1,56 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package test.test5; + +import static test.test5.Test5.Proto1.Proto1.A; +import static test.test5.Test5.Proto1.Proto1.B; +import static test.test5.Test5.Proto1.Proto1.C; + +import java.io.IOException; +import java.util.concurrent.Future; + +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.SocketChannelEndpoint; + +import test.test5.Test5.Proto1.Proto1; +import test.test5.Test5.Proto1.callbacks.A.Proto1_A; +import test.test5.Test5.Proto1.callbacks.A.states.Proto1_A_1; +import test.test5.Test5.Proto1.callbacks.A.states.Proto1_A_2; +import test.test5.Test5.Proto1.callbacks.A.states.Proto1_A_3; + +public class MyA +{ + public static void main(String[] args) throws IOException + { + Proto1 P1 = new Proto1(); + try (Proto1_A a = new Proto1_A<>(P1, A, new ObjectStreamFormatter(), new int[1])) + { + a.request(B, SocketChannelEndpoint::new, "localhost", 8888); + a.request(C, SocketChannelEndpoint::new, "localhost", 9999); + + a.icallback(Proto1_A_1.id, x -> (x[0]++ < 3) ? new Proto1_A_1.B._1(123) : new Proto1_A_1.C._3("abc")) + .icallback(Proto1_A_2.id, x -> new Proto1_A_2.C._2(456)) + .icallback(Proto1_A_3.id, x -> new Proto1_A_3.B._4("def")); + + Future f = a.run(); + f.get(); + + System.out.println("(A) end"); + } + catch (Exception e) + { + e.printStackTrace(); + } + } +} diff --git a/scribble-test/src/test/scrib/test/test5/MyB.java b/scribble-test/src/test/scrib/test/test5/MyB.java new file mode 100644 index 000000000..fa72ab187 --- /dev/null +++ b/scribble-test/src/test/scrib/test/test5/MyB.java @@ -0,0 +1,78 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package test.test5; + +import static test.test5.Test5.Proto1.Proto1.A; +import static test.test5.Test5.Proto1.Proto1.B; + +import java.io.IOException; +import java.util.concurrent.Future; + +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.net.SocketChannelServer; + +import test.test5.Test5.Proto1.Proto1; +import test.test5.Test5.Proto1.callbacks.B.Proto1_B; +import test.test5.Test5.Proto1.callbacks.B.Proto1_B_1_Branch; +import test.test5.Test5.Proto1.callbacks.B.states.Proto1_B_1; +import test.test5.Test5.Proto1.ops._1; +import test.test5.Test5.Proto1.ops._4; +import test.test5.Test5.Proto1.roles.A; + +public class MyB +{ + public static void main(String[] args) throws IOException + { + class MyHandler extends Proto1_B_1_Branch + { + @Override + public void receive(int[] data, A peer, _1 op, Integer x) + { + data[0]++; + System.out.println("(B) received 1: " + data[0] + ", " + x); + } + + @Override + public void receive(int[] data, A peer, _4 op, String x) + { + data[0]++; + System.out.println("(B) received 4: " + data[0] + ", " + x); + } + } + + try (ScribServerSocket ss = new SocketChannelServer(8888)) + { + while (true) + { + Proto1 P1 = new Proto1(); + try (Proto1_B b = new Proto1_B<>(P1, B, new ObjectStreamFormatter(), new int[1])) + { + b.accept(ss, A); + + b.icallback(Proto1_B_1.id, new MyHandler()); + + Future f = b.run(); + f.get(); + + System.out.println("(B) end"); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + } + } +} diff --git a/scribble-test/src/test/scrib/test/test5/MyC.java b/scribble-test/src/test/scrib/test/test5/MyC.java new file mode 100644 index 000000000..e3bb9d01b --- /dev/null +++ b/scribble-test/src/test/scrib/test/test5/MyC.java @@ -0,0 +1,76 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package test.test5; + +import static test.test5.Test5.Proto1.Proto1.A; +import static test.test5.Test5.Proto1.Proto1.C; + +import java.io.IOException; +import java.util.concurrent.Future; + +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.net.SocketChannelServer; + +import test.test5.Test5.Proto1.Proto1; +import test.test5.Test5.Proto1.callbacks.C.Proto1_C; +import test.test5.Test5.Proto1.callbacks.C.Proto1_C_1_Branch; +import test.test5.Test5.Proto1.callbacks.C.states.Proto1_C_1; +import test.test5.Test5.Proto1.ops._2; +import test.test5.Test5.Proto1.ops._3; +import test.test5.Test5.Proto1.roles.A; + +public class MyC +{ + public static void main(String[] args) throws IOException + { + class MyHandler extends Proto1_C_1_Branch + { + @Override + public void receive(Void data, A peer, _2 op, Integer x) + { + System.out.println("(C) received 2: " + x); + } + + @Override + public void receive(Void data, A peer, _3 op, String x) + { + System.out.println("(C) received 4: " + x); + } + } + + try (ScribServerSocket ss = new SocketChannelServer(9999)) + { + while (true) + { + Proto1 P1 = new Proto1(); + try (Proto1_C b = new Proto1_C<>(P1, C, new ObjectStreamFormatter(), null)) + { + b.accept(ss, A); + + b.icallback(Proto1_C_1.id, new MyHandler()); + + Future f = b.run(); + f.get(); + + System.out.println("(C) end"); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + } + } +} diff --git a/scribble-test/src/test/scrib/test/test5/Test5.scr b/scribble-test/src/test/scrib/test/test5/Test5.scr new file mode 100644 index 000000000..79b33211d --- /dev/null +++ b/scribble-test/src/test/scrib/test/test5/Test5.scr @@ -0,0 +1,22 @@ +//$ bin/scribblec.sh scribble-test/src/test/scrib/test/test5/Test5.scr -d scribble-test/src/test/scrib/ -cbapi Proto1 A -cbapi Proto1 B -cbapi Proto1 C +//$ javadoc -cp scribble-cli/target/classes/';'scribble-test/target/classes';'scribble-parser/target/classes';'scribble-parser/lib/antlr-3.5.2-complete.jar';'scrib-core/src/test/scrib scrib-core/src/test/scrib/test/test5/Proto1*.java -d test/doc/test5 + +module test.test5.Test5; + +type "java.lang.Integer" from "rt.jar" as Int; +type "java.lang.String" from "rt.jar" as Str; + +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1(Int) from A to B; + 2(Int) from A to C; + do Proto1(A, B, C); + } + or + { + 3(Str) from A to C; + 4(Str) from A to B; + } +} diff --git a/scribble-test/src/test/scrib/test/test6/MyA.java b/scribble-test/src/test/scrib/test/test6/MyA.java new file mode 100644 index 000000000..ba94cedd7 --- /dev/null +++ b/scribble-test/src/test/scrib/test/test6/MyA.java @@ -0,0 +1,72 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package test.test6; + +import static test.test6.Test6.Proto1.Proto1.A; +import static test.test6.Test6.Proto1.Proto1.B; + +import java.io.IOException; +import java.util.concurrent.Future; +import java.util.function.Function; + +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.SocketChannelEndpoint; + +import test.test6.Test6.Proto1.Proto1; +import test.test6.Test6.Proto1.callbacks.A.Proto1_A; +import test.test6.Test6.Proto1.callbacks.A.Proto1_A_2_Branch; +import test.test6.Test6.Proto1.callbacks.A.states.Proto1_A_1; +import test.test6.Test6.Proto1.callbacks.A.states.Proto1_A_2; +import test.test6.Test6.Proto1.callbacks.A.states.Proto1_A_3; +import test.test6.Test6.Proto1.callbacks.A.states.Proto1_A_4; +import test.test6.Test6.Proto1.ops._2; +import test.test6.Test6.Proto1.roles.B;; + +public class MyA +{ + public static void main(String[] args) throws IOException + { + class MyHandler extends Proto1_A_2_Branch + { + @Override + public void receive(int[] data, B peer, _2 op, String arg1) + { + System.out.println("(A) received 2: " + arg1 + ", " + data[0]++); + } + } + + Proto1 P1 = new Proto1(); + try (Proto1_A a = new Proto1_A<>(P1, A, new ObjectStreamFormatter(), new int[1])) + { + a.request(B, SocketChannelEndpoint::new, "localhost", 8888); + + Function h1 = x -> new Proto1_A_1.B._1(x[0]++); + MyHandler h2 = new MyHandler(); + + a.icallback(Proto1_A_1.id, h1) + .icallback(Proto1_A_2.id, h2) + .icallback(Proto1_A_3.id, h1) + .icallback(Proto1_A_4.id, h2); + + Future f = a.run(); + f.get(); + + System.out.println("(A) end"); + } + catch (Exception e) + { + e.printStackTrace(); + } + } +} diff --git a/scribble-test/src/test/scrib/test/test6/MyB.java b/scribble-test/src/test/scrib/test/test6/MyB.java new file mode 100644 index 000000000..029b3ab2a --- /dev/null +++ b/scribble-test/src/test/scrib/test/test6/MyB.java @@ -0,0 +1,79 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package test.test6; + +import static test.test6.Test6.Proto1.Proto1.A; +import static test.test6.Test6.Proto1.Proto1.B; + +import java.io.IOException; +import java.util.concurrent.Future; +import java.util.function.Function; + +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.net.SocketChannelServer; + +import test.test6.Test6.Proto1.Proto1; +import test.test6.Test6.Proto1.callbacks.B.Proto1_B; +import test.test6.Test6.Proto1.callbacks.B.Proto1_B_3_Branch; +import test.test6.Test6.Proto1.callbacks.B.states.Proto1_B_1; +import test.test6.Test6.Proto1.callbacks.B.states.Proto1_B_2; +import test.test6.Test6.Proto1.callbacks.B.states.Proto1_B_3; +import test.test6.Test6.Proto1.callbacks.B.states.Proto1_B_4; + +public class MyB +{ + public static void main(String[] args) throws IOException + { + class MyHandler extends Proto1_B_3_Branch + { + @Override + public void receive(String[] data, test.test6.Test6.Proto1.roles.A peer, test.test6.Test6.Proto1.ops._1 op, Integer arg1) + { + System.out.println("(B) received 1: " + arg1 + ", " + (data[0] += "a")); + + } + } + + try (ScribServerSocket ss = new SocketChannelServer(8888)) + { + while (true) + { + Proto1 P1 = new Proto1(); + String[] data = new String[] { "" }; + try (Proto1_B b = new Proto1_B<>(P1, B, new ObjectStreamFormatter(), data)) + { + b.accept(ss, A); + + MyHandler h1 = new MyHandler(); + Function h2 = x -> new Proto1_B_4.A._2(x[0] += "a"); + + b.icallback(Proto1_B_1.id, h1) + .icallback(Proto1_B_2.id, h2) + .icallback(Proto1_B_3.id, h1) + .icallback(Proto1_B_4.id, h2); + + Future f = b.run(); + f.get(); + + System.out.println("(B) end"); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + } + } +} diff --git a/scribble-test/src/test/scrib/test/test6/Test6.scr b/scribble-test/src/test/scrib/test/test6/Test6.scr new file mode 100644 index 000000000..e375d4651 --- /dev/null +++ b/scribble-test/src/test/scrib/test/test6/Test6.scr @@ -0,0 +1,15 @@ +//$ bin/scribblec.sh scribble-test/src/test/scrib/test/test6/Test6.scr -d scribble-test/src/test/scrib/ -cbapi Proto1 A -cbapi Proto1 B +//$ javadoc -cp scribble-cli/target/classes/';'scribble-test/target/classes';'scribble-parser/target/classes';'scribble-parser/lib/antlr-3.5.2-complete.jar';'scrib-core/src/test/scrib scrib-core/src/test/scrib/test/test6/Proto1*.java -d test/doc/test6 + +module test.test6.Test6; + +type "java.lang.Integer" from "rt.jar" as Int; +type "java.lang.String" from "rt.jar" as Str; + +global protocol Proto1(role A, role B) +{ + 1(Int) from A to B; + 2(Str) from B to A; + 1(Int) from A to B; + 2(Str) from B to A; +} diff --git a/scribble-test/src/test/scrib/test/test7/MyA.java b/scribble-test/src/test/scrib/test/test7/MyA.java new file mode 100644 index 000000000..8358ae5da --- /dev/null +++ b/scribble-test/src/test/scrib/test/test7/MyA.java @@ -0,0 +1,56 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package test.test7; + +import static test.test7.Test7.Proto1.Proto1.A; +import static test.test7.Test7.Proto1.Proto1.B; + +import java.io.IOException; +import java.util.concurrent.Future; +import java.util.function.Function; + +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.SocketChannelEndpoint; + +import test.test7.Test7.Proto1.Proto1; +import test.test7.Test7.Proto1.callbacks.A.Proto1_A; +import test.test7.Test7.Proto1.callbacks.A.states.Proto1_A_1; +import test.test7.Test7.Proto1.callbacks.A.states.Proto1_A_2; + +public class MyA +{ + public static void main(String[] args) throws IOException + { + Proto1 P1 = new Proto1(); + String[] data = new String[] { "" }; + try (Proto1_A a = new Proto1_A<>(P1, A, new ObjectStreamFormatter(), data)) + { + a.request(B, SocketChannelEndpoint::new, "localhost", 8888); + + Function h = x -> new Proto1_A_1.B._2((x[0] += "a")); + + a.icallback(Proto1_A_1.id, h) + .icallback(Proto1_A_2.id, h); + + Future f = a.run(); + f.get(); + + System.out.println("(A) end"); + } + catch (Exception e) + { + e.printStackTrace(); + } + } +} diff --git a/scribble-test/src/test/scrib/test/test7/MyB.java b/scribble-test/src/test/scrib/test/test7/MyB.java new file mode 100644 index 000000000..65afb87d4 --- /dev/null +++ b/scribble-test/src/test/scrib/test/test7/MyB.java @@ -0,0 +1,79 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package test.test7; + +import static test.test7.Test7.Proto1.Proto1.A; +import static test.test7.Test7.Proto1.Proto1.B; + +import java.io.IOException; +import java.util.concurrent.Future; + +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.net.SocketChannelServer; + +import test.test7.Test7.Proto1.Proto1; +import test.test7.Test7.Proto1.callbacks.B.Proto1_B; +import test.test7.Test7.Proto1.callbacks.B.Proto1_B_1_Branch; +import test.test7.Test7.Proto1.callbacks.B.states.Proto1_B_1; +import test.test7.Test7.Proto1.callbacks.B.states.Proto1_B_2; +import test.test7.Test7.Proto1.ops._1; +import test.test7.Test7.Proto1.ops._2; +import test.test7.Test7.Proto1.roles.A; + +public class MyB +{ + public static void main(String[] args) throws IOException + { + class MyHandler extends Proto1_B_1_Branch + { + @Override + public void receive(int[] data, A peer, _1 op, Integer arg1) + { + System.out.println("(B) received 1: " + arg1 + ", " + data[0]++); + } + + @Override + public void receive(int[] data, A peer, _2 op, String arg1) + { + System.out.println("(B) received 1: " + arg1 + ", " + data[0]++); + } + } + + try (ScribServerSocket ss = new SocketChannelServer(8888)) + { + while (true) + { + Proto1 P1 = new Proto1(); + try (Proto1_B b = new Proto1_B<>(P1, B, new ObjectStreamFormatter(), new int[1])) + { + b.accept(ss, A); + + MyHandler h = new MyHandler(); + b.icallback(Proto1_B_1.id, h) + .icallback(Proto1_B_2.id, h); + + Future f = b.run(); + f.get(); + + System.out.println("(B) end"); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + } + } +} diff --git a/scribble-test/src/test/scrib/test/test7/Test7.scr b/scribble-test/src/test/scrib/test/test7/Test7.scr new file mode 100644 index 000000000..197730008 --- /dev/null +++ b/scribble-test/src/test/scrib/test/test7/Test7.scr @@ -0,0 +1,27 @@ +//$ bin/scribblec.sh scribble-test/src/test/scrib/test/test7/Test7.scr -d scribble-test/src/test/scrib/ -cbapi Proto1 A -cbapi Proto1 B +//$ javadoc -cp scribble-cli/target/classes/';'scribble-test/target/classes';'scribble-parser/target/classes';'scribble-parser/lib/antlr-3.5.2-complete.jar';'scrib-core/src/test/scrib scrib-core/src/test/scrib/test/test7/Proto1*.java -d test/doc/test7 + +module test.test7.Test7; + +type "java.lang.Integer" from "rt.jar" as Int; +type "java.lang.String" from "rt.jar" as Str; + +global protocol Proto1(role A, role B) +{ + choice at A + { + 1(Int) from A to B; + } + or + { + 2(Str) from A to B; + } + choice at A + { + 1(Int) from A to B; + } + or + { + 2(Str) from A to B; + } +} diff --git a/scribble-test/src/test/scrib/test/test8/MyA.java b/scribble-test/src/test/scrib/test/test8/MyA.java new file mode 100644 index 000000000..ff54d0a73 --- /dev/null +++ b/scribble-test/src/test/scrib/test/test8/MyA.java @@ -0,0 +1,80 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package test.test8; + +import static test.test8.Test8.Proto1.Proto1.A; +import static test.test8.Test8.Proto1.Proto1.B; +import static test.test8.Test8.Proto1.Proto1.C; + +import java.io.IOException; +import java.util.concurrent.Future; + +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.SocketChannelEndpoint; + +import test.test8.Test8.Proto1.Proto1; +import test.test8.Test8.Proto1.callbacks.A.Proto1_A; +import test.test8.Test8.Proto1.callbacks.A.states.Proto1_A_1; +import test.test8.Test8.Proto1.callbacks.A.states.Proto1_A_2; +import test.test8.Test8.Proto1.callbacks.A.states.Proto1_A_3; +import test.test8.Test8.Proto1.callbacks.A.states.Proto1_A_4; +import test.test8.Test8.Proto1.callbacks.A.states.Proto1_A_5; + +public class MyA +{ + public static void main(String[] args) throws IOException + { + foo(); + } + + public static void foo() throws IOException + { + Proto1 P1 = new Proto1(); + try (Proto1_A a = new Proto1_A<>(P1, A, new ObjectStreamFormatter(), new int[] { 0 })) + { + a.request(B, SocketChannelEndpoint::new, "localhost", 8888); + a.request(C, SocketChannelEndpoint::new, "localhost", 9999); + + a.icallback(Proto1_A_1.id, + x -> (x[0]++ < 3) ? new Proto1_A_1.B._1(x[0]) : new Proto1_A_1.C._4("abc") + ); + a.icallback(Proto1_A_2.id, x -> new Proto1_A_2.B._1(123)); + a.icallback(Proto1_A_3.id, x -> new Proto1_A_3.C._3()); + a.icallback(Proto1_A_4.id, x -> new Proto1_A_4.B._3(456)); + a.icallback(Proto1_A_5.id, x -> new Proto1_A_5.B._4("def")); + + /*a.callback(Proto1_A_1.id, x -> new Proto1_A_1.B._1("abc")); + a.callback(Proto1_A_1.id, x -> new Proto1_A_1.B._2(123)); + a.callback(Proto1_A_1.id, x -> new Proto1_A_1.C._1(123)); + a.callback(Proto1_A_1.id, x -> new Proto1_A_5.B._4("def")); + + a.icallback(Proto1_A_1.id, x -> new Proto1_A_1.B._1("abc")); + a.icallback(Proto1_A_1.id, x -> new Proto1_A_1.B._2(123)); + a.icallback(Proto1_A_1.id, x -> new Proto1_A_1.C._1(123)); + a.icallback(Proto1_A_1.id, x -> new Proto1_A_5.B._4("def"));*/ + + //a.callback(Proto1_A_2.id, x -> new Proto1_A_1.B._1(123)); + a.icallback(Proto1_A_2.id, x -> new Proto1_A_1.B._1(123)); + + Future f = a.run(); + f.get(); + + System.out.println("(A) end"); + } + catch (Exception e) + { + e.printStackTrace(); + } + } +} diff --git a/scribble-test/src/test/scrib/test/test8/MyB.java b/scribble-test/src/test/scrib/test/test8/MyB.java new file mode 100644 index 000000000..1cc3c9561 --- /dev/null +++ b/scribble-test/src/test/scrib/test/test8/MyB.java @@ -0,0 +1,92 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package test.test8; + +import static test.test8.Test8.Proto1.Proto1.A; +import static test.test8.Test8.Proto1.Proto1.B; + +import java.io.IOException; +import java.util.concurrent.Future; + +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.net.SocketChannelServer; + +import test.test8.Test8.Proto1.Proto1; +import test.test8.Test8.Proto1.callbacks.B.Proto1_B; +import test.test8.Test8.Proto1.callbacks.B.Proto1_B_1_Branch; +import test.test8.Test8.Proto1.callbacks.B.states.Proto1_B_1; +import test.test8.Test8.Proto1.callbacks.B.states.Proto1_B_2; +import test.test8.Test8.Proto1.ops._1; +import test.test8.Test8.Proto1.ops._3; +import test.test8.Test8.Proto1.ops._4; +import test.test8.Test8.Proto1.roles.A; + +public class MyB +{ + public static void main(String[] args) throws IOException + { + foo(); + } + + public static void foo() throws IOException + { + class MyHandler extends Proto1_B_1_Branch + { + @Override + public void receive(Void data, A peer, _1 op, Integer arg1) + { + System.out.println("(B) received 1: " + arg1); + } + + @Override + public void receive(Void data, A peer, _3 op, Integer arg1) + { + System.out.println("(B) received 3: " + arg1); + } + + @Override + public void receive(Void data, A peer, _4 op, String arg1) + { + System.out.println("(B) received 4: " + arg1); + } + } + + try (ScribServerSocket ss = new SocketChannelServer(8888)) + { + while (true) + { + Proto1 P1 = new Proto1(); + try (Proto1_B b = new Proto1_B<>(P1, B, new ObjectStreamFormatter(), null)) + { + b.accept(ss, A); + + MyHandler h = new MyHandler(); + b.icallback(Proto1_B_1.id, h); + //b.callback(Proto1_B_2.id, h); + b.icallback(Proto1_B_2.id, h); + + Future f = b.run(); + f.get(); + + System.out.println("(B) end"); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + } + } +} diff --git a/scribble-test/src/test/scrib/test/test8/MyC.java b/scribble-test/src/test/scrib/test/test8/MyC.java new file mode 100644 index 000000000..2984de63d --- /dev/null +++ b/scribble-test/src/test/scrib/test/test8/MyC.java @@ -0,0 +1,89 @@ +/** + * Copyright 2008 The Scribble Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ +package test.test8; + +import static test.test8.Test8.Proto1.Proto1.A; +import static test.test8.Test8.Proto1.Proto1.C; + +import java.io.IOException; +import java.util.concurrent.Future; + +import org.scribble.runtime.message.ObjectStreamFormatter; +import org.scribble.runtime.net.ScribServerSocket; +import org.scribble.runtime.net.SocketChannelServer; + +import test.test8.Test8.Proto1.Proto1; +import test.test8.Test8.Proto1.callbacks.C.Proto1_C; +import test.test8.Test8.Proto1.callbacks.C.Proto1_C_1_Branch; +import test.test8.Test8.Proto1.callbacks.C.states.Proto1_C_1; +import test.test8.Test8.Proto1.ops._2; +import test.test8.Test8.Proto1.ops._3; +import test.test8.Test8.Proto1.ops._4; +import test.test8.Test8.Proto1.roles.A; + +public class MyC +{ + public static void main(String[] args) throws IOException + { + foo(); + } + + public static void foo() throws IOException + { + class MyHandler extends Proto1_C_1_Branch + { + @Override + public void receive(Void data, A peer, _3 op) + { + System.out.println("(C) received 3: "); + } + + @Override + public void receive(Void data, A peer, _2 op, Integer arg1) + { + System.out.println("(C) received 2: " + arg1); + } + + @Override + public void receive(Void data, A peer, _4 op, String arg1) + { + System.out.println("(C) received 4: " + arg1); + } + } + + try (ScribServerSocket ss = new SocketChannelServer(9999)) + { + while (true) + { + Proto1 P1 = new Proto1(); + try (Proto1_C b = new Proto1_C<>(P1, C, new ObjectStreamFormatter(), null)) + { + b.accept(ss, A); + + MyHandler h = new MyHandler(); + b.icallback(Proto1_C_1.id, h); + + Future f = b.run(); + f.get(); + + System.out.println("(C) end"); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + } + } +} diff --git a/scribble-test/src/test/scrib/test/test8/Test8.scr b/scribble-test/src/test/scrib/test/test8/Test8.scr new file mode 100644 index 000000000..0f77b4e3d --- /dev/null +++ b/scribble-test/src/test/scrib/test/test8/Test8.scr @@ -0,0 +1,28 @@ +//$ bin/scribblec.sh scribble-test/src/test/scrib/test/test8/Test8.scr -d scribble-test/src/test/scrib/ -cbapi Proto1 A -cbapi Proto1 B -cbapi Proto1 C +//$ javadoc -cp scribble-cli/target/classes/';'scribble-test/target/classes';'scribble-parser/target/classes';'scribble-parser/lib/antlr-3.5.2-complete.jar';'scrib-core/src/test/scrib scrib-core/src/test/scrib/test/test8/Proto1*.java -d test/doc/test8 + +module test.test8.Test8; + +type "java.lang.Integer" from "rt.jar" as Int; +type "java.lang.String" from "rt.jar" as Str; + +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1(Int) from A to B; + 1(Int) from A to B; + 3() from A to C; + //1(Int) from A to C; + } + or + { + 2(Int) from A to C; + 3(Int) from A to B; + } + or + { + 4(Str) from A to C; + 4(Str) from A to B; + } +} diff --git a/scribble-test/src/test/scrib/tmp/Betty.scr b/scribble-test/src/test/scrib/tmp/Betty.scr new file mode 100644 index 000000000..9ae24dbc8 --- /dev/null +++ b/scribble-test/src/test/scrib/tmp/Betty.scr @@ -0,0 +1,362 @@ +module Betty; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +/* +type "test.nego.SAP" from "test/nego/SAP.java" as SAP; + +global protocol Negotiate(role C, role P) { + propose(SAP) from C to P; + rec X { + choice at P { + accpt() from P to C; + confirm() from C to P; + } or { + reject() from P to C; + } or { + propose(SAP) from P to C; + choice at C { + accpt() from C to P; + confirm() from P to C; + } or { + reject() from C to P; + } or { + propose(SAP) from C to P; + continue X; + } + } + } +} +//*/ + + +/* +type "java.lang.Integer" from "rt.jar" as Int; +type "java.lang.String" from "rt.jar" as String; + +global protocol Proto1(role A, role B) { + 123(Int, String) from A to B; +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) { + choice at A { + 1() from A to B; + 2() from A to C; + } or { + 3() from A to B; + 4() from A to C; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) { + choice at A { + 1() from A to B; + 2() from A to C; + } or { + 4() from A to C; + 3() from A to B; + } +} +//*/ + + +/* +type "java.lang.Integer" from "rt.jar" as Int; + +global protocol Proto1(role A, role B, role C) { + choice at A { + buyer1(Int) from A to B; // Total + (Int) from B to A; // B will pay this much + buyer2(Int) from A to C; // C will pay remainder + } or { + buyer1(Int) from A to C; // Total + (Int) from C to A; // C will pay this much + buyer2(Int) from A to B; // B will pay remainder + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) { + choice at A { + 1() from A to B; + 1() from B to C; + } or { + //2() from A to B; + 2() from B to A; + choice at B { + 3() from B to C; + } or { + 4() from B to C; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) { + choice at A { + 1() from A to B; + 3() from B to C; + 4() from C to A; + } or { + 2() from A to B; + 3() from B to C; + 5() from C to A; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) { + choice at A { + 1() from A to B; + 3() from B to C; + 4() from C to A; + } or { + 2() from A to B; + 3() from B to C; + 4() from C to A; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) { + choice at A { + 1() from A to B; + 3() from B to C; + do Merge(A, C); + } or { + 2() from A to B; + 3() from B to C; + do Merge(A, C); + } +} + +aux global protocol Merge(role A, role C) { + 4() from A to C; +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) { + choice at A { + 1() from A to B; + 3() from B to C; + do Merge(A, C); + } or { + 2() from A to B; + 3() from B to C; + do Merge(A, C); + } +} + +aux global protocol Merge(role A, role C) { + 4() from C to A; +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) { + choice at A { + 1() from A to B; + 3() from B to C; + do Merge(A, C); + } or { + 2() from A to B; + 3() from B to C; + do Merge(A, C); + } +} + +aux global protocol Merge(role A, role C) { + choice at A { + 4() from A to C; + } or { + 5() from A to C; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) { + choice at A { + 1() from A to B; + 2() from A to C; + 3() from B to C; + 4() from C to A; + } or { + 1b() from A to B; + 3() from B to C; // -nolocalchoicecheck to show orphans + 4() from C to A; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) { + choice at A { + 1() from A to B; + 2() from A to C; + } or { + 3() from A to B; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) { + rec X { + choice at A { + 1() from A to B; + continue X; + 2() from A to B; + } or { + 3() from A to B; + } + 4() from A to B; + } + 5() from A to B; +} +//*/ + + +/* +global protocol Proto1(role A, role B) { + rec X { + 1() from A to B; + continue X; + } + 2() from A to B; +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C, role D) { + rec X { + 1() from A to B; + continue X; + } + 2() from C to D; +} +//*/ + + +/* +global protocol Proto1(role A, role B) { + rec X { + choice at A { + 1() from A to B; + continue X; + } or { + 1() from A to B; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) { + choice at A { + rec X { + 1() from A to B; + 1() from B to C; + continue X; + } + } or { + 2() from A to B; + 2() from B to C; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) { + choice at A { + rec X { + 1() from A to B; + continue X; + } + } or { + 2() from A to B; + 2() from B to C; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) { + choice at A { + rec X { + 1() from A to B; + continue X; + } + } or { + 2() from A to B; + } + 2() from C to B; +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) { + rec X { + choice at A { + 1() from A to B; + continue X; + } or { + 2() from A to B; + 2() from B to C; + } + } +} +//*/ + diff --git a/scribble-test/src/test/scrib/tmp/Demo.scr b/scribble-test/src/test/scrib/tmp/Demo.scr new file mode 100644 index 000000000..f7b23b9cc --- /dev/null +++ b/scribble-test/src/test/scrib/tmp/Demo.scr @@ -0,0 +1,220 @@ +//$ bin/scribblec.sh modules/core/src/test/scrib/Test.scr -ip modules/core/src/test/scrib/ -d modules/core/src/test/scrib/ + + +module Demo; + + +/** + * Stuck message + */ + +/* +global protocol Proto(role A, role B) +{ + choice at A + { + 1() from A to B; + 2() from B to A; + } + or + { + 1() from A to B; + 3() from B to A; + //2() from B to A; + } +} +//*/ + + +/** + * Wait-for + */ + +/* +global protocol Proto(role A, role B, role C) +{ + //rec X { + choice at A + { + 1() from A to B; + //continue X; + } + or + { + 2() from A to B; + 2() from B to C; + } + } +} +//*/ + +/* +explicit global protocol Proto(role A, role B, role C) +{ + connect A to B; + //connect B to C; + choice at A + { + 1() from A to B; + //connect A to C; // Sync-blocked (cf. input-blocked, terminated) + 1() from A to C; + } + or + { + 2() from A to B; + } +} +//*/ + +/* +explicit global protocol Proto(role A, role B, role C) +{ + connect A to B; + rec X + { + choice at A + { + 1() from A to B; + connect A to C; + 1() from A to C; + //continue X; + } + or + { + 2() from A to B; + } + } +} +//*/ + +/* +global protocol Proto(role A, role B) +{ + choice at A + { + 1() from A to B; + 2() from A to B; + 3() from B to A; + } + or + { + 1() from A to B; + 3() from B to A; + 2() from A to B; + } +} +//*/ + + +/** + * Orphans + */ + +/* +global protocol Proto(role A, role B) +{ + choice at A + { + 1() from A to B; + } + or + { + 1() from A to B; + 2() from A to B; + } +} +//*/ + + +/** + * "Role liveness" + */ + +/* +global protocol Proto(role A, role B, role C) +{ + choice at B + { + rec X + { + 1() from B to C; + continue X; + } + } + or + { + 2() from B to C; + //3() from C to A; + } + 3() from C to A; +} +//*/ + + +/** + * "Message liveness" + */ + +/* +global protocol Proto(role A, role B, role C) +{ + choice at B + { + rec X + { + 1() from B to C; + continue X; + } + } + or + { + 2() from B to C; + } + 3() from A to C; + //3() from A to C; // WF_1 will raise an "incorrect" role-progress violation for A (but safely conservative? i.e. just incompleteness of WF?) + //... // Dragons: won't be visited via 1() ...but will be visited via 2()? is that enough? +} +//*/ + + +/** + * + */ + +/* +global protocol Proto(role A, role B, role C) +{ + 1() from A to B; + do ProtoAux1(A, B, C); +} + +aux global protocol ProtoAux1(role A, role B, role C) +{ + choice at A + { + 2() from A to B; + 2() from B to C; + do ProtoAux2(A, B, C); + } + or + { + 3() from A to B; + 3() from B to C; + } +} + +aux global protocol ProtoAux2(role A, role B, role C) +{ + choice at A + { + 4() from A to B; + do ProtoAux1(A, B, C); + } + or + { + 5() from A to B; + 5() from B to C; + } +} +//*/ + diff --git a/scribble-test/src/test/scrib/tmp/ExpConn.scr b/scribble-test/src/test/scrib/tmp/ExpConn.scr new file mode 100644 index 000000000..35f310624 --- /dev/null +++ b/scribble-test/src/test/scrib/tmp/ExpConn.scr @@ -0,0 +1,3534 @@ +module ExpConn; + + +/* +global protocol Proto1(role A, role B) +{ + rec X + { + 1() from A to B; + choice at A + { + continue X; + } + or + { + 2() from A to B; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + // CHECKME: orphans currently detected on local termination, not full system termination (same for stuck and deadlock) + choice at A { + 1() from A to B; + 2() from A to C; + 3() from B to C; + 4() from C to A; + } or { + 1b() from A to B; + 3() from B to C; // -nolocalchoicecheck to show orphans + 4() from C to A; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + rec X + { + 1() from A to B; + do Proto1Aux(A, B); // Testing recvar name disambiguation + } +} + +global protocol Proto1Aux(role A, role B) +{ + rec X + { + 2() from A to B; + choice at A + { + continue X; + } + or + { + 3() from A to B; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + rec X + { + 1() from A to B; + rec X + { + choice at A + { + 2() from A to B; + choice at A + { + continue X; + } + or + { + 3() from A to B; + } + } + or + { + //4() from A to B; + continue X; // Testing unguarded shadowed recvars at different nestings + } + or + { + 5() from A to B; + } + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + rec X + { + 1() from A to B; + choice at A + { + rec X + { + 2() from A to B; + continue X; + } + } + or + { + rec X // Testing shadowed unguarded recs + { + 3() from A to B; + continue X; + } + } + or + { + 4() from A to B; + continue X; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + rec X + { + 1() from A to B; + rec X + { + 2() from A to B; + choice at A + { + continue X; // Testing inlined-unfolding for shadowed recs + } + or + { + 3() from A to B; + } + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + rec X + { + choice at A + { + 1() from A to B; + 2() from B to A; + continue X; + } or { + 1() from A to B; + 3() from B to A; // Testing non-det unfair-transform ("unfairness" has the power to enforce a single case out of non-det options) + continue X; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + rec X + { + choice at A + { + 1() from A to B; + 2() from B to A; + continue X; // Testing non-det unfair-transform + } or { + 1() from A to B; + 3() from B to A; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + rec X + { + choice at A + { + 1() from A to B; + continue X; // Testing non-det unfair-transform + } or { + 1() from A to B; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + disconnect A and B; + do Proto1Aux(A, B); +} + +// Trivial test for "expressiveness" of aux -- but could just make explicit.. // CHECKME example where "aux" is fully needed +aux global protocol Proto1Aux(role A, role B) +{ + connect A to B; +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + //1() from A to C; + continue X; // Testing fairness + } + or + { + 2() from A to B; + 2() from A to C; + continue X; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 3() from B to C; + 4() from C to B; + 5() from B to C; + } + or + { + 2() from A to B; + 3() from B to C; // Syntactic merge means: non-det "squashed" so original choice path now ambiguous, so we need to act conservatively -- conservatively means squashed role needs to accept any incoming messages as a branch (to handle ambiguity) while not being allowed to make any output choices (only unary send allowed, so must be identical in all possibilities) + // EFSM transform has to follow this intuition, full continuations after a non-det input choice have to be convservatively squashed (and if not squashable, then check model using unsquashed version) -- or implement as syntactic merge, and use original if not mergeable + 4() from C to B; + 6() from B to C; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C, role D) +{ + choice at A + { + 1() from A to B; + 3() from B to C; + 3() from B to D; + 4() from C to D; + } + or + { + 2() from A to B; + 3() from B to C; + 3() from B to D; + 5() from C to D; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C, role D) +{ + choice at A + { + 1() from A to B; + 3() from B to C; + 4() from C to D; + } + or + { + 2() from A to B; + 3() from B to C; + 5() from C to D; // Not mergeable by ICALP13 + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 3() from B to C; + 4() from C to B; + } + or + { + 2() from A to B; + 3() from B to C; + 4() from C to B; + 5() from C to B; // Tricky to check, e.g., output state sub-EFSMs are the same (cf. syntactic equality) for terminating the merge, maybe need strict isomorphism (without renaming) + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + rec X + { + 0() from B to C; + choice at A + { + 1() from A to B; + 3() from B to C; + 4() from B to C; + } + or + { + 2() from A to B; + 3() from B to C; + 5() from B to C; // Consider EFSM of C for merging -- do non-det input squashing inductively, and only if no recursive edges back to original or preceding state? -- difficult to confirm, e.g., output state sub-EFSMs are the same (cf. syntactic equality) for terminating the merge, maybe need isomorphism + continue X; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 3() from B to C; + 4() from B to C; + } + or + { + 2() from A to B; + 3() from B to C; + //5() from B to C; // Makes merge easier + rec X + { + 5() from B to C; // Consider EFSM of C for merging + continue X; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 3() from B to C; + 3() from B to C; + 4() from B to C; + } + or + { + 2() from A to B; + 3() from B to C; // Merging (non-det input state "squashing") first messages only not enough (cf. inductive syntactic merge) + 3() from B to C; + 5() from B to C; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + rec X + { + 1() from A to B; + choice at A + //choice at B + { + continue X; + } + or + { + 2() from A to B; + //2() from B to A; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + choice at A + { + 1a() from A to B; + 1a() from A to C; + } + or + { + 1b() from A to B; + 1b() from A to C; + } + } + or + { + 2() from A to B; + choice at A + { + 2a() from A to B; + 2a() from B to C; + } + or + { + 2b() from A to B; + 2b() from B to C; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + rec X + { + 1() from A to B; + continue X; + } + } + or + { + 2() from A to B; + } + 3() from C to A; + 3() from C to A; // Role-progress violation for C under WF_1 + choice at A + { + 4() from A to B; + 5() from B to A; + } + or + { + 4() from A to B; + 6() from B to A; + } +} +//*/ + + +/* +// Counter example to completeness of safety for current WF +global protocol Proto1(role A, role B, role C) { + choice at A { + 1() from A to B; + 3() from B to C; + 4() from A to C; + } or { + 2() from A to B; + 3() from B to C; + 5() from A to C; // FIXME: should be mergable as a branch at C? (yes, by ICALP13) -- but requires treating non-det as det (i.e. language equiv. vs. bisim? -- local language minimisation wrt. inputs only?) -- in general, consider subsequent B and C interactions; but this exact example should be safe + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + 1() from A t B; // Testing Antlr error display overriding +} +//*/ + + +/* +type "java.lang.Integer" from "rt.jar" as Int; + +global protocol Proto1(role A, role B) +{ + choice at A + { + 1() from A to B; + } + or + { + 1(Int) from A to B; // Testing bad payloads + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 2() from B to C; + 3() from C to A; + } + or + { + 4() + from A to B; + 5() from B to C; // "Standard merge" (ICALP13) -- 2/5 cases merged for input choice at C // but is it actually mergable in ICALP13/WADFEST? because only defined on branch, not select as needed for C here -- it's fine, only merging the top level branches (distinct labels) + 6() from C to A; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 2() from B to C; + 3() from C to A; + } + or + { + 4() from A to B; + 2() from B to C; + 3() from C to A; // Not mergeable by WADFEST, because continuations of C to be merged are not input-branches (but WAFDEST could probably be extended easily -- most simply by just allowing TmergeT for any T, not just branch -- more generally, would have to inductively coerce non-branches into branches, which is what the below example (i.e. WADFEST) is a special case of) + // However, mergeable by ICALP13 (just a typo by WADFEST) + // (WADFEST merges also only defined on branches, not receives, but receive can be easily converted to singleton branches? -- a point of directed branches is that they have no payloads, and receives have no labels, which Scribble needs to consider) + } +} +//*/ + + +/* +// Counter example to completeness of safety for current WF -- this notion of completeness is wrt. a global semantics, but not wrt. specific definition of Scribble projection/EFSM? (i.e. if we project/build a subsequent input choice at C from A, not just the initial one from B -- this is essentially mixing a ``non-choice'' (pre-determined flow) at A with an external choice at C -- i.e. ICALP13/WADFEST merge: convert non-det external choice into det non-choice followed by inductively merged (external choice) continuations) -- actually not necessarily, can consider still non-det, but just that the continuation branches are safe (but this view is more like inferring non-directly specified cases for nested branches) +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 2() from B to C; + //choice at A { // better for merging? + 3() from A to C; + //} + } + or + { + 1b() from A to B; + 2() from B to C; + 4() from A to C; // FIXME: "merge/coerce" branches for C -- implement as some king of variant of "determinisation"? i.e. 2.3+2.4 -> 2.(3+4) (issue is it's not bisim preserving -- is local language minimisation a sound general principle? well, not for the minimal non-det branch example (or actually, yes? see below), but somehow only for "nested" external choices? i.e. same-label mergability?) + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + choice at A + { + 1() from A to B; + 2() from B to A; // FIXME: should we just language-equiv minimise endpoints? implicitly take that as the CFSM meaning of this global protocol? depends on global semantics -- but would make general projection/graphbuilding and mergability more uniform? -- uniformity should be the aim, see below -- no: not just independent EFSM minimisation, but should consider the whole CFSM system, see below + } + or + { + 1() from A to B; + 3() from B to A; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + choice at A + { + 1() from A to B; + 3() from B to C; + 4() from C to A; + } + or + { + 2() from A to B; + 3() from B to C; + 5() from C to A; // FIXME: language minimising at C will determinise, but minimising at A has no effect: minimising makes (non-det) external choice at C into internal choice, which is incompatible with original internal choice at A -- so independent language minimising is not sound -- basically syntactic branch-only merging restricts "determinising" to external choices only -- so do independent EFSM language-minimisation applied to inputs only? (but sometimes non-det outputs can be safely minimised -- but just leave them as is for global model checking?) + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + } + or + { + 1() from A to B; // Simply syntactically not representable with directed choice, but safe under the same intuition as mergability -- in this case, independent endpoint minimisation modifies both A and B consistently + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 2() from B to C; + //choice at A + //{ + // 4() from A to C; + //} + //or + //{ + // 3() from A to C; + //} + do Proto1Aux(A, C); // WADFEST merge -- morally: WADFEST merge "infers" safe branche cases for nested branches -- can factor out by subprotos + // NO: WADFEST prevents internal choice 4/5 by A, only allows external choice by C + } + or + { + 1b() from A to B; + 2() from B to C; + //choice at A + //{ + // 4() from A to C; + //} + //or + //{ + // 3() from A to C; + //} + do Proto1Aux(A, C); + } +} + +// Makes clear that TmergeT for any T should be OK +aux global protocol Proto1Aux(role A, role C) +{ + choice at A + { + 3() from A to C; + } + or + { + 4() from A to C; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 2() from B to C; + 3() from C to A; + } + or + { + 4() from A to B; + 2() from B to C; + 5() from C to A; // TODO: most general merge: coerce an external choice for A here -- less morally clear than, e.g., WADFEST restriction to branch-only merge though + } +} +//*/ + + +/* +type "java.lang.Integer" from "rt.jar" as Int; + +global protocol Proto1(role A, role B, role C) +{ + choice at A { + buyer1(Int) from A to B; // Total + (Int) from B to A; // B will pay this much + buyer2(Int) from A to C; // C will pay remainder + } or { + buyer1(Int) from A to C; // Total + (Int) from C to A; // C will pay this much + buyer2(Int) from A to B; // B will pay remainder + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C, role D) +{ + ..(syntactic) reachability tests +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 1() from A to C; + } + or + { + 2() from A to B; + } + 3() from A to C; // TODO: "optional": needs empty actions and "empty-removal" transformation +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + 1() from B to A; + 3() from A to C; // Trying to find an unfair-transformation problem wrt. not visiting "2" case after "1" transitions + continue X; + } + or + { + 2() from A to B; + 2() from B to A; + 3() from A to C; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + 1() from A to B; + 2() from B to C; // Testing CommandLine with, e.g., -fsm(dot) arg (disamb error before projection passes means graph cannot be built) +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A // -oldwf, default, -fair + { + 1() from A to B; + continue X; + } + or + { + 2() from A to B; + //2() from A to C; + 2() from B to C; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + rec X + { + 1() from A to B; + continue X; + } + } + or + { + 2() from A to B; + } + 3() from B to C; +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + () from B to C; + 1() from B to A; + } + or + { + 2() from A to B; + () from B to C; // Classic mergeability (no "equiv." protocol by sequencing -- unless maybe a generous async. equiv.) + 2() from B to A; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 2() from B to C; + //3() from C to A; + 3() from C to B; + } + or + { + 1() from A to B; + 5() from B to C; + //6() from C to A; + 5() from C to B; // Mergeable -- A not involved downstream + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + rec X + { + 1() from A to B; + 1() from B to C; + continue X; + } + } + or + { + 2() from A to B; + 2() from B to C; + } + 3() from A to B; // Sequencing after recursive-choice + 3() from B to C; +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + 1(Proto2@A) from A to B; // Testing delegation payload projection +} + +global protocol Proto2(role A, role B) +{ + 2() from A to B; +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + (Proto1@A) from A to B; // Testing recursive protocoldecls +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + (Proto2@A) from A to B; // Testing recursive protocoldecls +} + +global protocol Proto2(role A, role B) +{ + //(Proto1@A) from A to B; + (Proto3@A) from A to B; + //do Proto3(A, B); +} + +global protocol Proto3(role A, role B) +{ + 1() from A to B; + //(Proto1@A) from A to B; + //(Proto2@A) from A to B; + //do Proto1(A, B); +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 4() from B to C; + } + or + { + 2() from A to B; + 5() from B to C; // Mergeable subset of choice cases (cf. syntactic merge? + 5() from C to B; + } + or + { + 3() from A to B; + 5() from B to C; + 5() from C to B; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + do Game(A, B, C); + } + or + { + 2() from A to B; + 2() from B to C; + } +} + +aux global protocol Game(role A, role B, role C) +{ + () from A to B; + () from B to C; +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + rec X + { + 1() from A to B; + rec X + { + 2() from A to B; + //do Proto1Aux(A, B); + } + } +} + +aux global protocol Proto1Aux(role A, role B) +{ + continue X; // Still checked for aux +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + do Proto1Aux(A, B); +} + +aux global protocol Proto1Aux(role A, role B) +{ + M from A to B; +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + (Test.Foo) from A to B; // Testing DataType disamb +} +//*/ + + +/* +type "java.lang.Integer" from "rt.jar" as Int; + +global protocol Proto1(role A, role B) +{ + Int from A to B; // Testing disamb (and AST visitChild) +} +//*/ + + +/* +sig "..." from "..." as M; + +global protocol Proto1(role A, role B) +{ + (M) from A to B; // Testing disamb (and AST visitChild) +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + connect A to C; + rec X + { + choice at A + { + 1() from A to B; // Testing "fair"/"unfair" liveness -- issue of global liveness vs. local subtyping) -- generating "unfair output subtyped" global model (can it be done simply by terminal set role check?) + continue X; + } + or + { + 2() from A to B; + } + } + 3() from A to C; +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + continue X; + } + or + { + 1() from A to B; // Testing non-det unfairClone -- uninteresting test because non-det single-action-edge choice-merges get implicitly minimised (by graph building) + continue X; + } + or + { + 2() from A to B; + 2() from B to C; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + 3() from B to A; + continue X; + } + or + { + 1() from A to B; // Testing non-det unfairClone + 3() from B to A; + //4() from B to A; + continue X; + } + or + { + 2() from A to B; + 2() from B to C; + } + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + connect B to C; + connect A to C; // How does C "correlate" A/B connections to sessions -- introduces? -- need to study real examples +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + rec X + { + 1() from A to B; + connect B to C; // C doesn't care whether each connection is new or old session? + 2() from B to C; + disconnect B and C; + continue X; + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B) +{ + connect A to B; + disconnect A and B; + connect A to B; // What does it mean for B to leave the session and rejoin? Need some condition like if fully leave, then rejoining should be same as new session? (i.e. this case bad) -- Consider implementability + disconnect A and B; +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + rec X + { + choice at A + { + 1() from A to B; + 1() connect A to C; + disconnect A and C; + continue X; + } + or + { + 2() from A to B; + 2() connect A to C; + disconnect A and C; + continue X + } + } + connect A to C; // Good until here, now bad because C already fully left? + 3() from A to C; +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B) +{ + rec X + { + connect A to B; // What does this mean in terms of a "session"? (should consider the implementation, session id, ...) -- distinction between initial accept and in-session accepts? + //1() from A to B; + //1() from B to A; + disconnect A and B; // Shouldn't allow continuation after a certain point? no session structure left? + continue X; + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + choice at A + { + 1() from A to B; + connect B to C; + connect A to C; + 1() from A to C; + } + or + { + 2() from A to B; + connect A to C; // Inconsistent choice connect subjects + } +} +//*/ + +//*** + + + +/* +explicit global protocol Proto1(role A, role B) +{ + connect A to B; + choice at A + { + 1() from A to B; + } + or + { + disconnect A and B; // CHECKME: disconnect shouldn't have asymmetric src/dest -- check enabling conditions wrt. choices, projection, etc + } +} +//*/ + + +/* +type "java.lang.Integer" from "rt.jar" as Int; + +explicit global protocol Proto1(role A, role B) +{ + choice at A + { + 1(Int) connect A to B; // Testing non-det payloads for message-connects + } + or + { + 1() connect A to B; + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + rec X + { + choice at A + { + 1() from A to B; + } + or + { + 2() from A to B; + 2() connect B to C; + 2() from B to C; + disconnect B and C; + } + or + { + 3() from A to B; + 3() connect B to C; // Cf. PartnershipSupplier filter subproto + 3() from B to C; + disconnect B and C; + } + continue X; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + 1() from B to C; + rec Y + { + choice at B + { + 3() from B to A; + continue X; + } + or + { + 4() from B to A; + continue Y; // Needs fairness + } + } + } + or + { + 2() from A to B; + 2() from B to C; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + 1() from B to C; + choice at B // C not involved, but still live (without fairness) + { + 3() from B to A; + continue X; + } + or + { + 4() from B to A; + continue X; + } + } + or + { + 2() from A to B; + 2() from B to C; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + 1() from B to C; + choice at B + { + 3() from B to A; + continue X; + } + or + { + rec Y // Bad (fair or not) + { + 4() from B to A; + continue Y; + } + } + } + or + { + 2() from A to B; + 2() from B to C; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + 1() from B to C; // Live, without fairness + continue X; + } + or + { + 2() from A to B; + 2() from B to C; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + rec X + { + 1() from A to B; + 1() from B to C; + continue X; + } + } + or + { + 2() from A to B; + 2() from B to C; // CHECKME: bad sequence if commented, correct? -- bad sequence because C not in block so projection pruned, then only rec-block left -- is this satisfactory? (consider standalone global semantics vs. global as syntactic sugar for locals) -- however, "bad sequence" restriction probably does not hurt expressiveness + } + 3() from B to C; +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + choice at A + { + 1() from A to B; + } + or + { + 2() from A to B; + } + rec X // Testing non-fair EFSM generation + { + choice at B + { + 3() from B to A; + continue X; + } + or + { + 4() from B to A; + } + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B) +{ + connect A to B; + choice at A + { + 1() from A to B; + wrap B to A; + } + or + { + wrap A to B; + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B) +{ + connect A to B; + choice at A + { + 1() from A to B; + } + or + { + 2() from A to B; + disconnect A and B; // Testing unfairClone terminal state reconcilliation -- FIXME: this example doesn't actually test this, cf. SupplierInfoExplicit for requestor + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + continue X; + } + or + { + 2() from A to B; + } + } + //3() from A to C; // Testing fair/unfair liveness for C + 3() from C to A; // Message liveness also subject to fair/unfair +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + () from B to C; + 3() from B to A; + } + or + { + 2() from A to B; + () from B to C; // choice + sequencing not the same as just syntactic sugar for factoring out a common branch continuation, i.e. cannot factor out "() from B" as a continuation without either losing causality for output to A or changing output order at B -- arguable that changing order at B is equivalent (for some equivalence), but not equivalent under basic bisimilarity + 4() from B to A; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; // CHECKME: empty case for C discarded by projection, but do we need tau for correctness? this example works because it ends up as stuck error -- a point is generating tau and then bisim-minimising doesn't remove the tau, whereas the current projection does remove the tau (so current projection is not equiv to bisim-minimisation intuition) + // should be OK: intiution: an input-state endpoint cannot choose to not receive a message, i.e. input states should never have tau -- so whole system must satisfy properties when modelling "partial" local branches as a "complete" branch for just the involved choice cases (i.e. ignore any non-involved cases) + } + or + { + 2() from A to B; + 2() from A to C; + } + 3() from A to C; +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + continue X; + } + or + { + 2() from A to B; + } + } + 3() from A to C; // Not "strongly" live for C -- by subtyping, an implementation of A may never terminate -- strongly live probably means all roles have to be involved in every choice path -- not quite: it all depends on definition of subtyping, could make a "live" notion of subtyping that doesn't allow a non-live subset of choices -- this also depends on the select primitives and typing rules (it could come down to decidability of if-conditions...) -- problem is, even without subtyping, select primitive is always about selecting just one case, can't really make a "live" typing on top of that... -- could be positioned as basic session typing needs strong liveness, while weak liveness can be aimed at assuming a more general program verification -- or maybe a more powerful "imperative style" typing system could work, e.g. while (...) { ..non-live choice on s..} ..live choice on s.., i.e. it is ok to select a non-live case if the while will terminate to eventually lead us to a live case.. -- this fairness/liveness issue is another "bondary" issue between modelling/types/practice, bit like linearity +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +//explicit global protocol Proto1(role A, role B) +{ + connect A to B; + choice at A + { + 1() from A to B; + } + or + { + 1() from A to B; + connect A to C; // Testing API gen (without I/O i/f gen) + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + choice at A // Testing minfsm + { + 1() from A to B; + 2() from B to A; + } + or + { + 1() from A to B; + 2() from B to A; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + 2() from A to B; + rec X + { + choice at A + { + 1() from A to B; + 1() from A to B; + } + or + { + 1() from A to B; // Testing minfsm + 1() from A to B; + } + continue X; +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + 2() from A to B; + rec X + { + choice at A + { + 1() from A to B; // Testing minfsm + } + or + { + 1() from A to B; + 1() from A to B; + } + continue X; +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + connect A to C; // Bad + disconnect A and C; + choice at A + { + 1() from A to B; + } + or + { + 1() from A to B; + connect B to C; + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + connect A to C; + choice at A + { + 1() from A to B; + 1() from A to C; + connect B to C; + 2() from A to B; + } + or + { + 1() from A to B; + 1() from A to C; + connect B to C; // Good: mergeable + 2() from A to B; + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + connect A to C; + choice at A + { + 1() from A to B; + 1() from A to C; + connect B to C; + 2() from A to B; + } + or + { + 1() from A to B; + 1() from A to C; + connect C to B; // If A and C are in above, 2() can be stuck at B's connect/accept here -- but stuck error not directly detected, error manifests as B/C deadlock + 2() from A to B; // Mergeable if B/C connection not deadlocked + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + choice at A + { + 1() from A to B; + connect B to C; + } + or + { + 1() from A to B; + } + 2() from B to C; // Trying to make an unconnected orphan from B to C, but currently will always get a connectedness error first -- model building semantics shouldn't/won't allow explicit unnconnected orphans, message cannot be sent if not connected +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to C; + connect C to B; + choice at A + { + 1() from A to C; + connect A to B; + } + or + { + 2() from A to C; + 2() from C to B; // Bad: connect and msg from different choice subjects + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B) +{ + rec X + { + choice at A + { + connect A to B; // Good: tests recursion pruning for connection actions + } + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B) +{ + rec X + { + choice at A // ** using old WF, this breaks connectedness checking -- WFChoiceChecker is an UnfoldingVisitor, but it is prunes the visit on entering the unfolded choice + { + connect A to B; + continue X; // Bad + } + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + rec X + { + choice at A + { + 1() from A to B; + connect B to C; + disconnect B and C; // Comment is bad + continue X; + } + or + { + 2() from A to B; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 2() from A to C; + 1() from A to B; + } + or + { + 2() from A to C; + 2() from C to A; + 2() from A to B; + } + continue X; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + // Disable local choice subject inference + rec X + { + // Testing getTrace? + choice at A + { + 1() from A to B; + //1() from A to B; + 1() from A to C; + 3() from B to C; + continue X; + } + or + { + 1() from A to B; + 2() from B to C; + 3() from C to B; + continue X; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + // Disable local choice subject inference + rec X + { + // Testing getTrace? + choice at A + { + 1() from A to B; + continue X; + } + or + { + 1() from A to B; + 1() from A to C; + 2() from C to B; + continue X; + } + or + { + 3() from A to C; + 3() from C to B; + continue X; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + rec X + { + choice at A + { + 1() from A to B; // Testing graph building + } + or + { + 1() from A to B; + } + continue X; + } +} +//*/ + + +/* +global protocol Partners( + role LOGINsvc, + role REQUESTOR, + role AUTHsvc, + role FILTERsvc, + role SUPPLIERsvc, + role CONTRACTsvc) +{ + login() from REQUESTOR to LOGINsvc; + choice at LOGINsvc + { + loginfailure() from LOGINsvc to REQUESTOR; + 0() from REQUESTOR to AUTHsvc; + 0() from AUTHsvc to FILTERsvc; + 0() from AUTHsvc to SUPPLIERsvc; + 0() from AUTHsvc to CONTRACTsvc; + } or { + loginsuccess() from LOGINsvc to REQUESTOR; + rec MAIN + { + choice at REQUESTOR + { + getsuppliers() from REQUESTOR to AUTHsvc; + choice at AUTHsvc + { + getsuppliers() from AUTHsvc to SUPPLIERsvc; // Bad: testing getTrace performance + deny() from AUTHsvc to REQUESTOR; + } or { + getsuppliers() from AUTHsvc to SUPPLIERsvc; + suppliers() from SUPPLIERsvc to AUTHsvc; + filterSuppliers() from AUTHsvc to FILTERsvc; + filtered() from FILTERsvc to AUTHsvc; + suppliers() from AUTHsvc to REQUESTOR; + } + } or { + getcontracts() from REQUESTOR to AUTHsvc; + choice at AUTHsvc + { + deny() from AUTHsvc to REQUESTOR; + } or { + getcontracts() from AUTHsvc to CONTRACTsvc; + contracts() from CONTRACTsvc to AUTHsvc; + filterContracts() from AUTHsvc to FILTERsvc; + filtered() from FILTERsvc to AUTHsvc; + contracts() from AUTHsvc to REQUESTOR; + } + } + continue MAIN; + } + } +} +//*/ + + +/* +global protocol Proto1 +( + role REQuestor, + role AUTHsvc, + role SUPPLIERsvc, + role CONTRACTsvc) +{ + rec MAIN + { + choice at REQuestor + { + getsuppliers() from REQuestor to AUTHsvc; + choice at AUTHsvc + { + getsuppliers() from AUTHsvc to SUPPLIERsvc; // Bad: testing getTrace + deny() from AUTHsvc to REQuestor; + } or { + getsuppliers() from AUTHsvc to SUPPLIERsvc; + suppliers() from SUPPLIERsvc to AUTHsvc; + suppliers() from AUTHsvc to REQuestor; + } + } or { + getcontracts() from REQuestor to AUTHsvc; + choice at AUTHsvc + { + deny() from AUTHsvc to REQuestor; + } or { + getcontracts() from AUTHsvc to CONTRACTsvc; + contracts() from CONTRACTsvc to AUTHsvc; + contracts() from AUTHsvc to REQuestor; + } + } + continue MAIN; + } +} +//*/ + + + +/* +global protocol Proto(role A, role B) +{ + choice at A + { + 1() from A to B; + disconnect A and B; + } + or + { + 1() from A to B; + 2() from B to A; // B can still send even if A disconnects (async) -- so not wait-for from that situation + } +} +//*/ + + +/*/ +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + + 1() from A to C; + 1() from A to C; + + 3() from C to B; + } + or + { + 1() from A to B; + + () from B to C; // Trying to get A into above block while C is in here, such that WF1 forces C also into the above -- so that WF1 becomes unsound + 2() from A to C; + + 4() from C to B; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at C + { + 1() from C to B; + 1() from C to A; + } + or + { + 1() from C to B; + 2() from C to A; + + 2() from A to B; + 2() from A to B; + + 2() from A to C; + + 2() from C to B; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + rec X + { + choice at A + { + 1() from A to B; + continue X; + } + } + } + or + { + 2() from A to B; + } + + 2() from C to B; // TODO: investigate: WF_1 won't get past here, is it OK? + 2() from C to B; // ..becomes "fake" role liveness problem because of WF1 -- not live even assuming fairness + // ..dragons + + // TODO: investigate reachability of local states in global model +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at B + { + 0() from B to C; + 0() from B to A; + 2() from C to B; + choice at A + { + rec X + { + choice at A + { + 1() from A to B; + continue X; + } + } + } + or + { + 2() from A to B; + } + } + or + { + 0() from B to C; + 1() from B to A; + 2() from C to B; // Good + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at B + { + 0() from B to C; + 0() from B to A; + + //2() from C to B; + //2() from C to B; + + choice at A + { + rec X + { + choice at A + { + 1() from A to B; + //2() from C to B; + continue X; + } + } + } + or + { + 2() from A to B; + } + } + or + { + 0() from B to C; + 1() from B to A; + } + + 2() from C to B; // TODO: investigate: WF_1 won't get past here, is it OK? + 2() from C to B; // ..becomes "fake" role liveness problem because of WF1 + // ... + + // TODO: investigate reachability of local states in global model +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + // Trying to construct a counterexample for WF1 soundness.. + // ..need to find an error state that is unreachable by WF1 but reachable by e.g. WF2 + // Try to find a choice where B is falsely committed to a branch due to WF1 (so state space of model is unsoundly restricted) + choice at A + { + 1() from A to B; + 1() from A to B; + 2() from A to C; // A cannot do this in WF1 unless B receives a 1() first + } + or + { + 3() from A to C; + //2() from A to B; + // Local choice subjects require B to also receive from A in this block + // Two cases: same or different label + // If different label, then no possibility of false branch commitment + // If same label, then non-det always allows B to enter this block, even under WF1 + // Therefore: false choice commitment not possible + 1() from A to B; + 1() from A to B; + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + choice at A + { + 1() from A to B // Good non-det EFSM for A (including minimisation) + connect A to C; + } + or + { + 1() from A to B; + //connect A to C; // Tests -minfsm + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + // Needs local choice subject disabled, though the point is it's still bad + choice at A + { + a() from A to B; + //d() from C to B; // Moved down to make C enabled + cprime() from A to C; + d() from C to B; + b() from B to A; + y() from A to B; // Orphan + } + or + { + c() from A to C; + d() from C to B; // ..point is B could get in this case, while A (and C) are in the other + b() from B to A; + a() from A to B; // (..not stuck msg error because the a() from above is consumed here) + x() from B to A; // Orphan + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + // Counterexample for WF1 if local choice subject disabled + choice at A + { + a() from A to B; + a() from A to B; // WF1 unnaturally resolves the non-det choice at B by forcing B to commit to this branch before C is enabled + cprime() from A to C; + d() from C to B; + b() from B to A; + + //y() from A to B; // Potential orphan + } + or + { + c() from A to C; + d() from C to B; + b() from B to A; // Must come before a's, to prevent reverse choice race + a() from A to B; + a() from A to B; + + //x() from B to A; // Potential orphan + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + // Disable local choice subject inference -- mergeable + choice at A + { + 1() from A to B; + 1() from A to B; + 1() from A to C; + 2() from C to B; + } + or + { + 2() from A to C; + 2() from C to B; + 1() from A to B; + 1() from A to B; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 1() from A to B; + 1() from A to C; + 2() from C to B; + + 3() from B to C; + } + or + { + 2() from A to C; + 2() from C to B; + 1() from A to B; + 1() from A to B; + + //3() from B to C; + 4() from B to C; // Bad + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 1() from A to B; + 1() from A to C; + 2() from C to B; + 2() from C to B; + + 3() from B to C; // Should be potential stuck + } + or + { + 2() from A to C; + 2() from C to B; + 2() from C to B; + () from C to A; // Another counterexample to WF1 (B falsely committed to here when A/C are) + 1() from A to B; + 1() from A to B; + + 4() from B to C; // Should be potential stuck + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + rec X + { + 1() from A to B; + continue X; // Test graph building: EndpointGraph null exit + } +} +*/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + choice at A + { + 1() from A to B; + connect from B to C; + 1() from B to C; + } + or + { + 2() from A to B; + connect from B to C; + 2() from B to C; // Not mergeable (connect/accept is unit message) + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + // Good + connect A to B; + connect A to C; + connect B to C; // Test wait-for error detection: C is non-initial accept, but B is a corresponding connect +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + // Bad + connect A to B; + connect A to C; + 0() from A to C; + choice at A + { + 1() from A to B; + } + or + { + 2() from A to B; + connect B to C; // Test safe termination check for non-initial accept states + 3() from B to C; + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + // Good + connect A to B; + connect A to C; + 0() from A to C; + choice at A + { + 1() from A to B; + } + or + { + 2() from A to B; + } + connect B to C; + 3() from B to C; +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + connect A to C; + 0() from A to C; + choice at A + { + rec X + { + 1() from A to B; + continue X; + } + } + or + { + 2() from A to B; + } + connect B to C; // Tests role liveness check for non-terminal (accept) states + 3() from B to C; +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B) +{ + connect A to B; // Basic test for connection deadlock detection + 1() from A to B; +} +//*/ + + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + choice at A + { + 1() from A to B; + } + or + { + 2() from A to B; + connect B to C; // Good because C is initial + 2() from B to C; + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + connect A to C; + choice at A + { + 1() from A to B; + 1() from A to C; + connect B to C; + } + or + { + 1() from A to B; + 1() from A to C; + connect C to B; // Deadlock + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + connect A to C; + choice at A + { + 1() from A to B; + 1() from A to C; + connect B to C; + 2() from B to C; + } + or + { + 1() from A to B; + 1() from A to C; + connect B to C; // Good + 2() from B to C; + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C, role D) +{ + connect A to B; + connect A to C; + connect A to D; + choice at A + { + 1() from A to B; + 1() from A to C; + 1() from A to D; + connect B to C; + } + or + { + 1() from A to B; + 1() from A to C; + 1() from A to D; + connect C to D; + } + or + { + 1() from A to B; + 1() from A to C; + 1() from A to D; + connect D to B; + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C, role D) +{ + connect A to B; + connect A to C; + connect A to D; + // Good + choice at A + { + 1() from A to B; + 1() from A to C; + 1() from A to D; + connect B to C; + connect C to D; + connect D to B; + } + or + { + 1() from A to B; + 1() from A to C; + 1() from A to D; + connect B to C; + connect C to D; + connect D to B; + } + or + { + 1() from A to B; + 1() from A to C; + 1() from A to D; + connect B to C; + connect C to D; + connect D to B; + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + choice at A + { + 1() from A to B; + connect A to C; + 3() from A to C; + } + or + { + connect A to C; // Mixed send/connect state at A + 2() from A to B; + 3() from A to C; + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect from A to B; + choice at A + { + rec X + { + choice at A + { + 1() from A to B; + continue X; + } + or + { + //3() from A to B; // Uncomment is fix + } + } + } + or + { + 2() from A to B; + } + connect from C to B; // Not role live: connect is a sync action + 3() from C to B; +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect from A to B; + choice at A + { + rec X + { + choice at A + { + 1() from A to B; + continue X; + } + } + } + or + { + 2() from A to B; + } + connect from B to C; // Good: connect is a sync action, but "asymmetric" + 3() from C to B; +} +//*/ + + +/* // disconnect +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 1() from B to C; + disconnect B and C; + rec X + { + 1() from A to B; + continue X; + } + } + or + { + 2() from A to B; + 2() from B to C; + } + 3() from A to B; + //3() from B to C; // Uncomment is bad +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + // Good + connect A to B; + connect A to C; + choice at A + { + 1() from A to B; + 1() from A to C; + } + or + { + 2() from A to B; + 2() from A to C; + connect B to C; + disconnect B and C; + } + connect B to C; + 2() from B to C; +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B) +{ + connect A to B; + 1() from A to B; + choice at A + { + 1() from A to B; + disconnect A and B; + } + or + { + 2() from A to B; + disconnect A and B; + } + 3() from A to B; +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B) +{ + connect A to B; + 1() from A to B; + choice at A + { + 1() from A to B; + disconnect A and B; + } + or + { + 2() from A to B; + } + 3() from A to B; +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + do Proto1Aux(A, B, C); +} + +aux global protocol Proto1Aux(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + //connect B to C; // Bad if non-det + 1() connect B to C; + 1() from B to C; + disconnect B and C; + do Proto1Aux(A, B, C); // FIXME: guarded do has same subprotsig has an unguarded one (and ProjectedSubprotPruner is using subprotsigs...) -- but current problem is actually ambiguous connect enabling of C by B -- anyway to have explicit protocol with multiple instances of the same do-subprotsig with and without choice-guards? + // TODO: this doesn't just break subprot pruning, but affects whole subprot visiting framework because using current subprot "cycles" may not provide coverage of all "full recursive loops" (cf. unfolding/unrolling all rec/continues) -- current framework gives coverage only if recursive subprots are only called from a single "location" -- maybe fixable by generalising subprotsigs record more than just the immediate proto+args context -- luckily some analyses like enabling check are OK despite this + // basically: current subprotocolsigs do identify a common "state" entry, but cannot be used to identify "specific" cycle paths or "maximal recursion paths" + } + or + { + 4() from A to B; + do Proto1Aux(A, B, C); + } + or + { + 2() from A to B; + //connect B to C; // Bad if non-det + 2() connect B to C; + 2() from B to C; + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + // Good + connect A to B; + connect B to C; + 1() from A to B; + do Proto1Aux1(A, B, C); +} + +aux global protocol Proto1Aux1(role A, role B, role C) +{ + choice at A + { + 3() from A to B; + 3() from B to C; + do Proto1Aux2(A, B, C); + } + or + { + 4() from A to B; + 4() from B to C; + //do Proto1Aux2(A, B, C); + } +} + +aux global protocol Proto1Aux2(role A, role B, role C) +{ + choice at A + { + 5() from A to B; + do Proto1Aux1(A, B, C); // Testing graph building (C vs. A/B) + //do Proto1Aux2(A, B, C); + } + or + { + 6() from A to B; + //connect B to C; + 6() from B to C; + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + connect B to C; + 1() from A to B; + do Proto1Aux1(A, B, C); +} + +aux global protocol Proto1Aux1(role A, role B, role C) +{ + choice at A + { + 3() from A to B; + //3() from B to C; + do Proto1Aux2(A, B, C); // Testing mutually choice-unguarded "prunable" do's + } +} + +aux global protocol Proto1Aux2(role A, role B, role C) +{ + choice at A + { + 5() from A to B; + do Proto1Aux1(A, B, C); + //do Proto1Aux2(A, B, C); + } + or + { + 6() from A to B; + //connect B to C; + 6() from B to C; + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + 1() from A to B; + do Proto1Aux1(A, B, C); +} + +aux global protocol Proto1Aux1(role A, role B, role C) +{ + do Proto1Aux2(A, B, C); +} + +aux global protocol Proto1Aux2(role A, role B, role C) +{ + choice at A + { + 2() from A to B; + do Proto1Aux1(A, B, C); + } + or + { + 3() from A to B; + connect B to C; + 4() from B to C; + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + connect B to C; + 1() from A to B; + //1() from B to C; + do Proto1Aux1(A, B, C); +} + +aux global protocol Proto1Aux1(role A, role B, role C) +{ + () from A to B; + //() from B to C; + do Proto1Aux2(A, B, C); +} + +aux global protocol Proto1Aux2(role A, role B, role C) +{ + choice at A + { + 2() from A to B; + do Proto1Aux1(A, B, C); + //do Proto1Aux2(A, B, C); + } + or + { + 3() from A to B; + //connect B to C; + 4() from B to C; + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + do Proto1Aux(A, B, C); +} + +aux global protocol Proto1Aux(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + do Proto1Aux(A, B, C); // ProjectedSubprotocolPruner + } + or + { + 2() from A to B; + connect B to C; + 3() from B to C; + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + choice at A + { + rec X + { + 2() from A to B; + continue X; + } + } + or + { + 3() from A to B; + } + connect A to C; // Good + 4() from A to C; +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + connect B to C; + 1() from A to B; + choice at B + { + rec X + { + 2() from B to C; + continue X; + } + } + or + { + 3() from B to C; + } + connect A to C; // Bad: role liveness + 4() from A to C; +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + choice at A + { + 1() from A to B; + //2() from A to B; // Uncomment bad + } + or + { + 1() from A to B; + rec X + { + connect B to C; + 4() from B to C; + 5() from C to B; + disconnect B and C; + continue X; + } + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C, role D) +{ + connect A to B; + choice at A + { + 1() from A to B; + 1() from B to A; + connect B to C; + connect C to D; + } + or + { + 1() from A to B; + 1() from B to A; + connect B to D; + connect D to C; + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + choice at A + { + connect A to B; + //connect B to C; // Uncomment bad + } + or + { + connect A to C; + } +} +//*/ + + +/* +type "java.lang.Integer" from "rt.jar" as Int1; +type "java.lang.Integer" from "rt.jar" as Int2; + +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + do Proto1Aux1(A, B, C); +} + +aux global protocol Proto1Aux1(role A, role B, role C) +{ + choice at B + { + 1() from B to A; + do Proto1Aux2(A, C); + } + or + { + 2() from B to A; + do Proto1Aux2(A, C); + } + do Proto1Aux1(A, B, C); +} + +aux global protocol Proto1Aux2(role A, role C) +{ + // Bad: non-det connect followed by distinct payloads + connect A to C; + 3(T) from A to C; + 4() from C to A; + disconnect A and C; +} +//*/ + + +/* +type "java.lang.Integer" from "rt.jar" as Int1; +type "java.lang.Integer" from "rt.jar" as Int2; + +explicit global protocol Proto1(role A, role B, role C) +{ + // Good by basic model checking, but.. + connect A to B; + connect A to C; + do Proto1Aux1(A, B, C); +} + +aux global protocol Proto1Aux1(role A, role B, role C) +{ + choice at B + { + 1() from B to A; + do Proto1Aux2(A, C); + } + or + { + 2() from B to A; + do Proto1Aux2(A, C); // Bad: payload + } + do Proto1Aux1(A, B, C); +} + +aux global protocol Proto1Aux2(role A, role C) +{ + 3(T) from A to C; + 4() from C to A; +} +//*/ + + +/* +// Good: same payload +type "java.lang.Integer" from "rt.jar" as Int1; + +explicit global protocol Proto1(role A, role B, role C) +{ + // Good + connect A to B; + do Proto1Aux1(A, B, C); +} + +aux global protocol Proto1Aux1(role A, role B, role C) +{ + choice at B + { + 1() from B to A; + do Proto1Aux2(A, C); + } + or + { + 2() from B to A; + do Proto1Aux2(A, C); + } + do Proto1Aux1(A, B, C); +} + +aux global protocol Proto1Aux2(role A, role C) +{ + connect A to C; + 3(T) from A to C; + 4() from C to A; + disconnect A and C; +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B) +{ + connect from A to B; + do Proto1Aux(A, B); +} + +aux explicit global protocol Proto1Aux(role A, role B) +{ + 1() from A to B; +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B) +{ + // Basic connectedness tests + connect A to B; + //connect B to A; + disconnect A and B; + //1() from A to B; + //disconnect A and B; +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + rec X + { + choice at A + { + 1() from A to B; + connect B to C; + 2() from B to C; + connect C to A; + 3() from C to A; + //3() from A to B; // Uncomment OK + disconnect B and C; + disconnect C and A; // Comment bad + continue X; + } + or + { + 4() from A to B; + } + } + //disconnect A and C; // Uncomment bad + disconnect A and B; +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + rec X + { + choice at B + { + // Good, even though A not involved here + connect B to C + 2() from B to C; + 3() from C to B; + disconnect B and C; + continue X; + } + or + { + 4() from B to A; + } + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B) +{ + rec X + { + connect A to B + 1() from A to B; + 2() from B to A; + disconnect A and B; + connect B to A + 3() from A to B; + 4() from B to A; + disconnect B and A; + continue X; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + disconnect A and B; +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B) +{ + rec X + { + connect A to B; + choice at A + { + 1() from A to B; + //continue X; // Uncomment bad + } + or + { + 2() from A to B; + } + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + choice at A + { + 1() from A to B; + rec X + { + connect B to C; + 1() from B to C; + //continue X; // Uncomment bad + } + } + or + { + 2() from A to B; + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C, role D) +{ + connect A to B; + 1() from A to B; + //connect D to C; // Uncomment OK + 1() from C to D; +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B) +{ + connect A to B; // Comment bad + 1() from A to B; +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B) +{ + choice at A + { + connect A to B; + 1() from A to B; + } + or + { + 2() from A to B; // Bad: caught syntactically -- this blocked choice case won't manifest as an error state in the presence of a non-blocked co-case + // FIXME: could add implicit error actions (e.g. unconncted message passing) to model building, to make error states explicit + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B) +{ + choice at A + { + connect A to B; + 1() from A to B; + } + or + { + connect A to B; + 2() from A to B; + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B) +{ + // Good + connect A to B; + choice at B + { + 1() from B to A; + } + or + { + 2() from B to A; + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B) +{ + choice at B + { + connect A to B; // Bad + 1() from B to A; + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B) +{ + choice at A + { + connect A to B; + 1() from B to A; // Good + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B) +{ + connect A to B; + choice at B // Good + { + 1() from B to A; + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + choice at A + { + 1() from A to B; + rec X + { + connect B to C; + 1() from B to C; + //continue X; // Uncomment bad + } + } + or + { + 2() from A to B; + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B) +{ + connect A to B; + //connect A to B; // Uncomment bad + //connect B to A; // Uncomment bad +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + 1() from A to B; + //connect A to C; // Uncomment OK + 2() from A to C; +} +//*/ + diff --git a/scribble-test/src/test/scrib/tmp/Fixme.scr b/scribble-test/src/test/scrib/tmp/Fixme.scr new file mode 100644 index 000000000..53f6bea62 --- /dev/null +++ b/scribble-test/src/test/scrib/tmp/Fixme.scr @@ -0,0 +1,137 @@ +//$ bin/scribblec.sh modules/core/src/test/scrib/Fixme.scr -ip modules/core/src/test/scrib/ -d modules/core/src/test/scrib/ + +//http://sandbox.kidstrythisathome.com/erdos/ + + +module Fixme; + + + // TODO: (re)connect/wrap, e.g. SMTP + + // TODO: "introduces" well-formedness? + // e.g. "A from B to C;" + // e.g. "a from A to B; A[a] from B to C;" + // e.g. connect A to B; connect B to C; connect C to A; // connect A to C would be bad + //.. expliconn+introduces vs. delegation -- MPST with explicit (shared/sess) channels + + // TODO: API gen + // - connect/disconnect -- need to make backwards compatible with non-explicit + // -- non-explicit just has implicit initial connects -- just need to make sure no deadlock + // -- consider accept for callbacks? + // - factor out Scribble abstract transport wrappers with language-specific plugins; take as parameter for "wrap" action + // - non-det EFSMs -- minimisation will remove all mergeable non-det actions, but non-mergeable non-det actions can exist due to explicit connect + + +//.. output and connect can be mixed in a state... check where getStateKind used for any problems +// -- getTakeable in WFConfig for model building (but maybe ends up OK, just treat connect/accept the same way?) +// -- main approach should be generally consier mixed send/connect states, but differentiate connect for input blocking detection +//.. check orphan messages wrt connect/accept states -- maybe OK, orphan check does consider connectedness + + +// - scrib assertions for model checker -- check state visited? +// - parameterise subprotos on protos? + + +// FIXME: .. refactor interfaces for model building/checking/minimising/etc into state classes (make subclasses of Model/EndpointState -- cf. ast/del) + + +// ..is branching on accept+message more expressive than accept followed by branch? i.e. can connect always be "factored up" before the choice? -- maybe depends on interplay with select fairness (want to use connect to nest role scope inside choice case to avoid assuming fairness, but this can conflict with non-det accept?) + +//*** TODO introduces -- or explicit shared channel/port creation and passing ("open") + +// DONE: delete noLive or add to fair check +// DONE: decouple branch API gen from I/O i/f's -- duplicate enum in concrrete states? -- removed dependencies on I/O i/f's for Branch APIs where I/O i/f generation is disabled +// DONE: I/O i/f name max length -- 255 Linux/Windows/etc max file name length + +// CHECKME: check for (not yet supported) deleg actions in API gen +// CHECKME: delegation type payload projection +// CHECKME: '.' in Name constructor args -- no: rename constructor arg to simpname (cf SessionTypeFactory) +// MainContext.newJob -- move MainContext to core? + +// FIXME: Module.getGlobal/LocalProtocolDecl + + +// TODO: test API gen for (fair) SupplierInfo +// TODO: test connect/wrap API gen for SMTP +// TODO: MT/EDP server examples + + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 3() from B to C; + 4() from A to C; // TODO: standard syntactic merge + } + or + { + 2() from A to B; + 3() from B to C; + 5() from A to C; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + (Proto2@C) from A to B; // FIXME: should not be aux? (or if aux should check WF as root?) +} + +aux global protocol Proto2(role C, role D) +{ + 1() from C to D; +} +//*/ + + +/* +explicit global protocol Proto(role A, role B, role C, role D) +{ + connect A to B; + connect C to D; + //... A, B // FIXME: investigate + //... C, D +} +//*/ + + +/* +explicit global protocol Proto(role A, role B, role C, role D) +{ + connect A to B; + connect A to C; + connect A to D; + connect C to D; + disconnect A and C; // FIXME: investigate + disconnect A and D; +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C, role D) +{ + rec X + { + choice at A + { + m1(Int) from A to B; + continue X; + //m4(int) from A to B; + } + or + { + m2(Int) from A to B; + //m3(int) from A to B; + } + 1() from C to D; // FIXME: wrong enabled check result -- maybe not? under unfolding it is captured inside the choice + } + //* / +} +//*/ + diff --git a/scribble-test/src/test/scrib/tmp/Quirk.scr b/scribble-test/src/test/scrib/tmp/Quirk.scr new file mode 100644 index 000000000..0e6d04e75 --- /dev/null +++ b/scribble-test/src/test/scrib/tmp/Quirk.scr @@ -0,0 +1,143 @@ +module Quirk; + + +/* +global protocol Proto1(role A, role B, role C, role D) +{ + rec X + { + 1() from C to D; // Enabling violation once unfolded + choice at A + { + 1() from A to B; + continue X; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C, role D) +{ + choice at A + { + 1() from A to B; + 3() from B to C; // Not standard mergeable -- and cannot factor out syntactically + 4() from C to D; + 5() from B to A; + } + or + { + 2() from A to B; + 3() from B to C; + 6() from C to D; + 7() from B to A; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + choice at B + { + 1() from B to C; + //continue X; // Non-enabled A under this choice at B + } + or + { + 3() from B to C; + //continue X; + } + continue X; // Scribble needs "sequencing" + } + or + { + 2() from A to B; + 2() from B to C; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + rec X + { + 1() from A to B; + 2() from B to C; + 3() from B to C; + choice at A // Not mergeable by, e.g., ICALP13 + { + 4() from A to B; + continue X; + } + or + { + 5() from A to B; + 2() from B to C; // An "extra iteration" between B-C (but not A-B), but fine // Generates non-det B?2's for C to different states, but OK + 3() from B to C; + continue X; + } + } +} +//*/ + + +/* +type "java.lang.Integer" from "rt.jar" as Int1; +type "java.lang.Integer" from "rt.jar" as Int2; + + +global protocol Proto1(role A, role B) +{ + choice at A + { + //1() from A to B; // Uncomment still bad + 1(Int1) from A to B; + 2() from B to A; + } + or + { + 1(Int2) from A to B; // here, payloads aren't considered as distinguishing for labels + // error is the special case of actions that are non-deterministic labels up to payloads + // (Syntactic MPST merge not defined for repeat labels, Cf. -oldwf) + 3() from B to A; + } +} +//*/ + + +/* +type "java.lang.Integer" from "rt.jar" as Int1; +type "java.lang.Integer" from "rt.jar" as Int2; + + +// Cf. bad.safety.stuckmsg.payloads.Test01b +global protocol Proto1(role A, role B) +{ + choice at A + { + 1() from A to B; + 2(Int1) from B to A; + } + or + { + 1() from A to B; + 2(Int2) from B to A; // (Syntactic MPST merge not defined for repeat labels) + // here, payloads are considered as distinguishing (as default) -- whole I/O action used as label + // Cf.\ Test01b, non-deterministic actions of the same state + // here, actions on different states -- error manifests as regular stuck + } +} +//*/ + diff --git a/scribble-test/src/test/scrib/tmp/Test.scr b/scribble-test/src/test/scrib/tmp/Test.scr new file mode 100644 index 000000000..667109c1a --- /dev/null +++ b/scribble-test/src/test/scrib/tmp/Test.scr @@ -0,0 +1,4561 @@ +//Raymond@HZHL3 ~/code/scribble-java/scribble-java +//$ bin/scribblec.sh -ip scribble-test/src/test/scrib/ -d scribble-test/src/test/scrib/tmp/ scribble-test/src/test/scrib/tmp/Test.scr +//$ bin/scribblec.sh -ip scribble-test/src/test/scrib/ -d scribble-test/src/test/scrib/tmp/ scribble-test/src/test/scrib/tmp/Test.scr -api Proto1 B + +// OLD: +//$ java -cp modules/cli/target/classes/';'modules/core/target/classes';'modules/trace/target/classes';'modules/parser/target/classes';c:\Users\Raymond\.m2\repository\org\antlr\antlr-runtime\3.2\antlr-runtime-3.2.jar;'modules/validation/target/classes/';'modules/projection/target/classes/';C:\Users\Raymond\.m2\repository\org\codehaus\jackson\jackson-mapper-asl\1.9.9\jackson-mapper-asl-1.9.9.jar;C:\Users\Raymond\.m2\repository\org\codehaus\jackson\jackson-core-asl\1.9.9\jackson-core-asl-1.9.9.jar' org.scribble.cli.CommandLine -path modules/core/src/test/scrib/ modules/core/src/test/scrib/Test.scr +//$ java -cp modules/cli/target/classes/';'modules/core/target/classes';'modules/trace/target/classes';'modules/parser/target/classes';c:\Users\Raymond\.m2\repository\org\antlr\antlr-runtime\3.2\antlr-runtime-3.2.jar;'modules/validation/target/classes/';'modules/projection/target/classes/';C:\Users\Raymond\.m2\repository\org\codehaus\jackson\jackson-mapper-asl\1.9.9\jackson-mapper-asl-1.9.9.jar;C:\Users\Raymond\.m2\repository\org\codehaus\jackson\jackson-core-asl\1.9.9\jackson-core-asl-1.9.9.jar' org.scribble2.cli.CommandLine -path modules/validation/src/test/scrib/src modules/validation/src/test/scrib/src/Test.scr + + +//http://sandbox.kidstrythisathome.com/erdos/ + + +module tmp.Test; + +// TODO: replace a lot of FACTORY name calls by clone +// FIXME: -minlts states IDs don't match validation output + +// CHECKME: playing multiple roles in the same session instance (but what is the concrete notion of "process id"? -- if actually try to use, e.g., ThreadID, then have to track ownership of endpoints) + +// - API gen for connection-with-message +// - API gen for wrap (SMTP) +// - API gen for shared channel passing +// - callback API needs generic session-state arg + +// - Redo HTTP/SMTP message deserialization (and maybe ScribMsgFormatter i/f) -- deserialization routines should be per-message + +// Job modes (full/default, fase17, oldscrib, MPST, etc.) -- factor out GMConfig interface + +// FIXME: demo.bettybook.math.MathC cancelledkey exception + +// Add a unit test for validation to bypass aux + + +// TODO: port forwarding version of P2 -- funny case of "session" persisting over full disconnect, should/how to correlate? +// FIXME: good.liveness.Test02, reachability check (empty rec projection) + + + + + + + +//------------- +//- drop unused recs -- partly done by inlining, but not done yet for subprotos + +//- projection dependencies (projections as modules?) +//- check projected role/choice/do pruning/fixing? -- applies only to above proj? (i.e., proto decls) -- CHECKME: can do role fixing by getting roles from iproj? similarly do-pruning? + +//- connections +//- refactor ast to parser, refactor lang to type? -- separate protocol classes? +//- or: ast/del to new lang -- core lang to type, except protocol +//- remove unused visitors and del code -- move new visitors there? +//- shorten class names (e.g., Protocol->Proto), rename parser constants, revise ScribTreeAdaptor and DelDecorator +//- refactor model building +//- refactor do param/arg ast classes -- generally clean up AST class hierarchy +//- refactor parsing and CL +//- check demos + + // TODO make test framework to check proj->inline matches inline->proj + // TODO make test framework to check global-"proj"-via-taus matches actual proj -- matches mean language acceptance? + // could also test once-unfold-all against model + + +// Done: -- parser/ast refactoring + // change parsed to in jobcontext to record original roledecls (for GDo::project) -- and change getInlined on proto to prune (via getRoles on def) + // separate Job into core and lang parts (mainly parsed Module) + // move ast/del, old visit and new frontend to lang + // integrate new frontend with MainContext? + // move lang types to type.sess, and move new visit + // try modulecontextvisitor by "static lookup" + // try move antlrwrapper to parser again + //for isSingleConts (and project, buildGraph), make T visitWith(STypeReducer v) ? -- roleenabling and extchoicecons are more like reducers? + // refactor scribble.g, simplify ast/del/etc class names and deprecated class code + //...remove Token args from af constructors -- removed, and re-added + //refactor reconstructs to use af? -- refactored af and reconstruct to use addChildren1 -- FIXME + //...fix simp node constructors and af (no IdNode child) --- fix ambignodel to use af -- separate af methods +// done: For model build/check refactoring: + // add exp conn checks to model validation, maybe just as estatevisitor? (cf. prev syntactic connection checks) -- now done as global syntax visitor + // ...refactor -spin as an ext -- dropped -spin from master + +// parser/ast re-refactoring + // split mf to global/local subcomps, make protected constrs -- done + // check G/LType casts vs. SType (favour latter) -- done: simplified Seq elems, removed Do.proto N param + // ...store unfoldings in Context -- done + // use stypefactory in core -- also make visitorfactorys (both core and ast) -- done + // factor out all config factory methods more centrally? -- done a bit: mainly general factory method refactoring above + // rename addChildren1 -- done: addScribChildren + // ...make ad hoc ScribNode constructions go through af properly -- done + // rename ProtoMod, ProtocolMod -- rename core Protocol? -- done: ast renamed ProtoModNode + // explicit self roles/decls (core and ast) -- currently, self decls in protocols (in core) are purely cosmetic in toString -- done: just lselfdecl, basically for printing + // fix *imed*-projection (Job) choice subjects -- inlined-projection is a single proto with all roles -- done in core for now (and needs tidying) + // refactor doarg pruning, do pruning and extchoicesubj-fixing vistor passes (cf., entry methods into LProjection) -- done: for current uniformity, but TODO: actually should do the opposite + // fix self in ast locals, astfactory -- done: "self" rolenode is just a constant instance, only LSelfDecl is a special subclass + // wrap base class, more global base classes (maybe in del's) -- done: just wrap base classes -- TODO: further factoring, e.g., LDirectedInteraction getSelf/Peer + // Job Module projection, projected imports/nonprotodecls -- locals import globals for nonprotos? (better for "projects" clause?) -- done: basic, but nonprotos "copied" from globals -- TODO: import global? + + // Outstanding: + // refactor Core pass printing on pass entry + // test self comm + // ...disallow/check for reserved __ -- do in gtype translation? is mainly for codegen though? maybe also inlining? + // FIXME: qualifed sig name as non-role do-arg + // CHECKME: duplicate proto mods (unit tests) + + // refactor Set to Map -- Map to Set (HashSet is just a HashMap anyway) + // fully refactor imed/module projection to Job: old style subproto visitor for imed-projection do-pruning -- move imed-projs from Core to Job ? + // refactor imed projection role pruning? currently done once for globals, which is done for locals once and then pruning done again for do-args + // no? now only pruned? + // CHECKME: TODO: proto-param and do-nonrole-arg pruning? + +// Job/codegen refactoring: + // refactor G/LProtocol visitor entry methods back into visitors + // Check (minimise) Maven deps + // choice-specific fairness annotations + // fix codegen when -fair + // CHECKME: accept branching on messages (and safety properties) -- connection should not be established if message stuck? (cf. reception error) -- issue is implementation: what is a realistic semantics for sync-connect-branching (i.e., prevent client from async progressing after messaging) -- consider reversing client/server branching side? i.e. client requests, but then receives? (and consider serverside-branching a sugar?) + // fix state numbering? also numbering mismatch between outputs, e.g., minlts + // wrap API gen (and refactor wrap AST hierarchy, e.g., base classes) + // CHECKME: req/accept API with message -- accept branch API? + +// Later: + // re-check disamb pass -- e.g., do-target disamb done by translation (CHECKME: DoDel disamb -- should use af?) -- check, e.g., message transfer message disamb (signames, payloads) + // sort out full name expansion between disamb and translation -- fix modulecontextcollector for imported module member fullnames + // refactor additional disamb syntactic checks into core? e.g., do-calls, distinct roledecls, protodecls, etc. + // -- otoh, ast errors give source feedback -- maybe implement both + // Refactor PayElemNameNode + +// Test refactoring: + // refactor test to use main instead of cli + // add checking between projected-inlined against inlined-projected-imeds, graph building, etc. + // add finer-grained result verification + +// Multisend -- inference of multisend -- per-choice projection? + + + + + +data "..." from "..." as T; + + +//* +global protocol Proto1(role A, role B) +{ + 1(T) from A to B; +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + do Proto1Aux(A, B); +} + +aux global protocol Proto1Aux(role C, role D) +{ + 2() from C to D; // Testing LDoArgPruner, do role pruning + //do Proto1(C, D); + do Proto1(D, C); // Testing -project output, proto deps +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + 1() from A to B; + do Proto1Aux(B, A); +} + +aux global protocol Proto1Aux(role A, role B) +{ + 2() from A to B; + do Proto1(B, A); // Testing LDoArgPruner, this.self vs. target.self + //do Proto1(A, B); +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + do Proto1Aux(A, B); + } + or + { + 2() from A to B; + } + 4() from A to C; +} + +aux global protocol Proto1Aux(role A, role B) +{ + 3() from A to B; +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + 1() from A to B; + 1() from B to C; + choice at A + { + 2() from A to B; + 2() from B to C; + } + or + { + do Proto1Aux(A, B, C); // Testing SubprotoExtChoiceSubjFixer, both "forwards" and "reverse" do-refs + } +} + +aux global protocol Proto1Aux(role A, role B, role C) +{ + do Proto1(A, B, C); +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 1() from B to C; + } + or + { + do Proto1Aux(A, B, C); // Testing SubprotoExtChoiceSubjFixer, "forward" do-ref + } +} + +aux global protocol Proto1Aux(role A, role B, role C) +{ + do Proto1Aux1(A, B, C); +} + +aux global protocol Proto1Aux1(role A, role B, role C) +{ + 2() from A to B; + 2() from B to C; +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 1() from B to C; + } + or + { + do Proto1(A, B, C); // Testing SubprotoExtChoiceSubjFixer, need do-pruning as pre-req -- TODO: add unit test (cf. bad.liveness.roleprog.unfair.Test06) + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + 1() from A to B; + 1() from B to C; + choice at A + { + 2() from A to B; + 2() from B to C; + } + or + { + do Proto1(A, B, C); // Testing SubprotoExtChoiceSubjFixer, "reverse" do-ref + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C, role D) +{ + rec X + { + 5() from C to D; + continue X; + } + + choice at A + { + 1() from A to B; + 2() from A to B; + } + or + { + 1() from A to B; + 3() from B to A; // Testing wait-for cycle detection // Also tests eventual reception + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + choice at A + { + 1() from A to B; // Testing global model building, non-det edges (identical configs collapsed) + 2() from A to B; // Un/comment, test combinations + } + or + { + 1() from A to B; + //3() from B to A; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + connect A to B; // Testing SGraph.getTraceFromInit, error in init state (empty trace) +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + } + or + { + 1() from A to C; // Same message OK + } + do Proto1(A, B, C); +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + choice at A + { + connect A to B; + 1() from A to B; + disconnect A and B; + } + or + { + connect A to C; + 1() from A to C; // Same message OK + disconnect A and C; + } + do Proto1(A, B, C); +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; // TODO: junit tests for explicit + rec X + { + choice at A + { + 1() from A to B; + continue X; + } + or + { + 2() from A to B; + connect A to C; + 3() from A to C; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + rec X + { + choice at A + { + 1() from A to B; + continue X; + } + or + { + 3() from A to B; + } + } + choice at B // Testing this.collections remove in EGraphBuilderUtil + { + 2() from B to A; + } +} +//*/ + +/* +global protocol Proto1(role A, role B, role C) +{ + rec X + { + 1() from A to B; + 2() from B to C; + choice at A + { + continue X; // TODO: add junit test, testing inlined choice subj fixing + } + or + { + continue X; + } + } +} +//*/ + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + rec X + { + 1() from A to B; + } + } + or + { + 2() from A to B; + 3() from A to C; + } +} +//*/ + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A // TODO: add junit test, testing core inlined projection choice subjects (for C) -- test already exists? // Also testing imed projections + { + 1() from A to B; + 1() from B to C; + } + or + { + 2() from A to B; + 2() from B to C; + } +} +//*/ + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; // TODO: add junit, testing -project C [-fair] -- basically, Travel Agent + do Proto1(A, B, C); + } + or + { + 2() from A to B; + 2() from A to C; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + choice at A + { + 1() from A to B; + //2() from A to B; + } + or + { + 1() from A to B; + //3() from A to B; + } + //4() from B to A; + do Proto1(A, B); +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + choice at A + { + 1() from A to B; + } + or + { + 1() from A to B; + } // CHECKME: gives a non-det global model, correct/intended? + //4() from B to A; + do Proto1(A, B); +} +//*/ + + +/* +global protocol Proto1<>(role A, role B) // TODO: add unit test, testing empty paramdecls +{ + () from A to B; + do Proto1<>(A, B); // TODO: add unit test, testing empty nonroleargs +} +//*/ + +/* +sig "..." from "..." as M; + +global protocol Proto1(role A, role B) +{ + MM from A to B; + do Proto1(A, B); // TODO: add unit test, testing qualified sig name as nonrole arg +} +//*/ + + +/* +explicit global protocol Proto1(role A__, role B) +{ + () connect A__ to B; + rec X + { + () from A__ to B; // TODO: add double underscore check (e.g., translation) + continue X; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + rec X { + //1() from A to B; + //1(Test.T) from A to B; + 1(T) from A to B; + M from B to A; + //do Proto1(A, B); + continue X; + } +} +//*/ + + +/* +explicit global protocol Foo(role A, role B, role C) +{ + connect A to B; + do FooAux(A, B, C); +} + +aux explicit global protocol FooAux(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + do FooAux(A, B, C); + } + or + { + 2() from A to B; + connect A to C; + 3() from A to C; + } +} +//*/ + + +/* +explicit global protocol Foo(role A, role B, role C) +{ + connect A to B; + choice at A + { + 1() from A to B; + } + or + { + 2() from A to B; + connect A to C; + 3() from A to C; + } +} +//*/ + + +/* +explicit global protocol Foo(role A, role B) +{ + //connect A to B; + 1() from A to B; + disconnect A and B; + connect A to B; + 1() from A to B; +} +//*/ + + +/* +global protocol Foo(role A, role B, role C) +{ + 1() from A to B; // Testing LProjectionTranslator, onto B + do Bar(A, C); +} + +aux global protocol Bar(role D, role E) +{ + 2() from D to E; +} +//*/ + + +/* +explicit global protocol Foo(role A, role B, role C) +{ + 0() connect A to B; + choice at A + { + 1() from A to B; + //disconnect A and B; + do Foo(A, B, C); + } + or + { + 2() from A to B; + foo() connect A to C; + 3() from A to C; + } +} +//*/ + + + +/*// Add unit test -- testing: inlining of shadowed recvars +global protocol Foo(role A, role B) +{ + rec X + { + rec X + { + 1() from A to B; + continue X; + } + } +} +//*/ + + +/* // Add unit test -- testing: repeat rec sigs in inlining due to multilple do's, w.r.t. unfolding +global protocol Foo(role A, role B) +{ + do Bar(A, B); + do Bar(A, B); +} + +aux global protocol Bar(role A, role B) +{ + 1() from A to B; +} +//*/ + + +/* // Add unit test -- testing: repeat rec sigs in inlining due to multilple do's, w.r.t. unfolding +global protocol Foo(role A, role B) +{ + choice at A + { + do Bar(A, B); + } + or + { + do Bar(A, B); + } +} + +aux global protocol Bar(role C, role D) +{ + 3() from C to D; + do Bar(C, D); +} + + +/* +global protocol Proto1(role A, role B) +{ + rec X + { + 1() from A to B; + choice at A + { + continue X; + } + or + { + 2() from A to B; + continue X; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + rec X + { + 1() from A to B; + choice at A + { + rec Y + { + 0() from A to B; + //do Proto1(A, B); + continue X; + } + } + } +} +//*/ + + + +/* +global protocol Proto1(role A, role B) +{ + choice at A + { + rec X + { + 1() from A to B; + continue X; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + 1() from A to B; + choice at A + { + do Proto1Aux(A, B); + //do Proto1(A, B); + } + or + { + do Proto1Aux2(A, B); + } + or + { + 2() from A to B; + } +} + +aux global protocol Proto1Aux(role A, role B) +{ + 0() from A to B; + do Proto1(A, B); + //do Proto1Aux(A, B); +} + +global protocol Proto1Aux2(role A, role B) +{ + 3() from A to B; + do Proto1Aux2(A, B); +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + rec X + { + 0() from A to B; + choice at A + { + 1() from A to B; + //do Proto1(A, B); + continue X; + //3() from A to B; + } + or + { + 2() from A to B; + } + //4() from A to B; + } + 5() from A to B; +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + //1() from A to B; + 1() from A to C; + } + or + { + //2() from C to A; + //2() from A to B; + 2() from A to C; + //2() from B to C; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + do Proto1Aux(A, B); +} + +global protocol Proto1Aux(role AA, role BB) +{ + () from AA to BB; +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + 0() from A to B; + choice at A + { + 1() from A to B; + do Proto1(A, B); + } + or + { + 2() from A to B; + 3() from A to B; + } + 4() from A to B; +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + choice at A + { + rec X + { + 1() from A to B; + continue X; + } + } + or + { + 2() from A to B; + } +} +//*/ + +/* +global protocol Proto1(role A, role B) +{ + 1() from A to B; + choice at A + { + do Proto1(A, B); + } + or + { + 2() from A to B; + } +} +//*/ + +/* +global protocol Proto1(role A, role B) +{ + rec X + { + choice at A + { + 1() from A to B; + } + or + { + 2() from A to B; + 3() from B to A; + //do Proto1(A, B); + //continue X; + do Proto1(B, A); + } + } +} +//*/ + + +/* +//type "System.UInt32" from "..." as int; + +global protocol Proto1(role A, role B) +{ + Foo() from A to B; + /*choice at A + { + 1() from A to B; + } + or + { + 2() from A to B; + }* / +} +//*/ + + + + + +/* +type "System.UInt32" from "..." as int; + +global protocol SH(role P, role R, role C) +{ + plane(int, int, int, int) from P to R; + do Loop(P, R, C); +} + +aux global protocol Loop(role P, role R, role C) +{ + choice at P + { + Above(int) from P to R; + Res(int) from R to P; + Above(int) from P to R; + Res(int) from R to P; + choice at P + { + BothIn() from P to R; + BothIn(int) from P to C; + do Loop(P, R, C); + } + or + { + BothOut() from P to R; + BothOut() from P to C; + do Loop(P, R, C); + } + or + { + Intersect() from P to R; + Res(int) from R to P; + choice at P + { + One(int) from P to C; + do Loop(P, R, C); + } + or + { + Two(int, int) from P to C; + do Loop(P, R, C); + } + } + //do Loop(P, R, C); // FIXME: -spin fail if commented + } + or + { + Close() from P to R; + Close() from P to C; + } +} +//*/ + +/* +global protocol SH2(role P, role R, role C) +{ + plane(x1:int, x2:int, x3:int, x4:int) from P to R; + do Loop2(P, R, C); +} + +aux global protocol Loop2(role P, role R, role C) +{ + choice at P + { + Above(v1:int) from P to R; + Res(b1:int) from R to P; + Above(v2:int) from P to R; + Res(b2:int) from R to P; + choice at P + { + BothIn() from P to R; + BothIn(r1:int) from P to C; + do Loop2(P, R, C); + } + or + { + BothOut() from P to R; + BothOut() from P to C; + do Loop2(P, R, C); + } + or + { + Intersect() from P to R; + Res(i:int) from R to P; + choice at P + { + One(r2:int) from P to C; + do Loop2(P, R, C); + } + or + { + Two(r3:int, r4:int) from P to C; + do Loop2(P, R, C); + } + } + } + or + { + Close() from P to R; + Close() from P to C; + } +} +//*/ + + + + + + + + +/* +global protocol Proto1(role A, role B, role C) +{ + rec X { + choice at A { + a() from A to B; + b() from B to C; + continue X; + } or { + c() from A to B; + d() from B to C; + } + } +} +//*/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +/* +explicit global protocol Proto1(role A, role B) +{ + choice at A + { + 1() connect A to B; + } + or + { + 2() connect A to B; + } + 2() connect A to B; +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + rec X + { + connect B to C; + choice at B + { + 1() from B to C; + disconnect B and C; + continue X; + } + or + { + 2() from B to C; + 3() from C to B; + } + } + //3() from C to B; // Testing unconnected errors -- error by syntactic check; but should *not* by -f17 if seq comp supported + 4() from B to A; +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + 1() from A to B; + 1() from A to B; + choice at A + { + 1() from A to B; + choice at A + { + 1() from A to B; + } + } + or + { + 2() from A to B; + rec X + { + rec Y + { + 2() from A to B; + continue X; + } + } + } +} +//*/ + + + +/* +global protocol Proto1(role A, role B, role C) +{ + 1() from A to B; + rec X // Testing: projecting-pruning (for B) -- cf., syntactic merge (cannot merge X and end) + { + choice at A + { + 2() from A to C; + continue X; + } + or + { + 3() from A to C; + } + } +} +//*/ + +/* +global protocol Proto1(role A, role B, role C) +{ + rec X // Testing: projecting-pruning (for B) -- X not pruned (becomes single "unguarded" X case) with safety errors + { + 1() from A to B; + choice at A + { + 2() from A to C; + continue X; + } + or + { + 3() from A to C; + //continue X; // OK if uncommented + } + } +} +//*/ + +/* +global protocol Proto1(role A, role B, role C) +{ + 1() from A to B; + rec X // Testing: projecting-pruning (for B) + { + choice at A + { + 2() from A to C; + continue X; + } + or + { + 3() from A to C; + continue X; + } + } +} +//*/ + +/* +global protocol Proto1(role A, role B, role C) +{ + rec Y + { + 1() from A to B; + rec X + { + choice at A + { + 2() from A to C; + continue Y; + } + or + { + 3() from A to C; + continue X; // Testing: projecting-pruning (for B) -- role progress violation for B + } + } + } +} +//*/ + +/* +global protocol Proto1(role A, role B, role C) +{ + 1() from A to B; + rec Y // Testing: projecting-pruning (for B) + { + rec X + { + choice at A + { + 2() from A to C; + continue Y; + } + or + { + 3() from A to C; + continue X; + } + } + } +} +//*/ + +/* +global protocol Proto1(role A, role B, role C) +{ + rec X + { + 1() from A to B; + rec Y + { + 2() from A to C; + continue X; // Testing projection-pruning (for B) -- not pruned + } + } +} +//*/ + +/* +global protocol Proto1(role A, role B, role C) +{ + 1() from A to B; + rec X + { + rec Y + { + 2() from A to C; + continue X; // Testing projection-pruning (for B) -- pruned + } + } +} +//*/ + + + +/* +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + 1() from A to C; + } + or + { + 2() from A to C; + continue X; + } + or + { + 2() from A to B; // Bad: C may be stuck waiting for 1/2 + } + } + 3() from A to C; +} +//*/ + +/* +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + 1() from B to C; + } + or + { + 4() from A to B; + continue X; + } + or + { + 2() from A to B; // Bad: C stuck waiting for 1 + } + } + 3() from A to C; +} +//*/ + +/* +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + 1() from B to C; + } + or + { + 2() from A to B; + continue X; + } + } + 3() from A to C; // Testing -fair and sequencing +} +//*/ + +/* +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + 1() from B to C; + } + or + { + 2() from A to B; + } + 3() from A to C; + // TESTING: from some global perspectives, this could be seen as a mixed-role choice for C between B and A + // Any way to create an unsound mixed-role choice using sequencing? And taking the mixed-role choice view + // What fixes this may be that Scribble actually projects this as sequencing, not choice? + // -- N.B. comes out as unfinished error, not deadlock (A is in output state) + // -- In this way, bounded channels actually helpful for detecting stuck messages? -- or would just come out as role-progress violation, in the worse case? + // -- As opposed to "inlining the continuation" (or projecting a tau?) + // At least, not having sequencing probably safe backup? + continue X; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + rec X + { + 1() from B to A; + choice at B // Testing projection, A not syntactically in this choice but cannot discard the X -- handled by UnfoldingVisitor(?) + { + 2() from B to C; + continue X; + } +// or // Testing +// { +// 3() from B to C; +// } + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + 1() connect A to B; + 1() connect B to C; + 1() connect C to A; // Testing accept-correlation check +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + rec X + { + choice at A + { + continue X; + } + or + { + 2() from A to B; + } + } +// rec X +// { +// 1() from A to B; +// 1() from B to C; +// choice at A +// { +// 2() from A to B; // Testing projection -- just X for C, but under a non-empty recursive prefix +// continue X; +// } +// or +// { +// 3() from A to B; +// 3() from B to C; +// } +// } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + // Testing unfair transform + rec X + { + choice at A + { + 1() from A to B; + choice at A + { + 1a() from A to B; + } + or + { + 1b() from A to B; + continue X; + } + } + or + { + 1c() from A to B; + continue X; + } + or + { + 2() from A to B; + choice at A + { + 2a() from A to B; + continue X; + } + or + { + 2b() from A to B; + continue X; + } + } + or + { + choice at A + { + 3() from A to B; + } + or + { + 4() from A to B; + } + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + rec X + { + choice at A // Testing unfair transform of recursive non-det choice + { + 1() from A to B; + choice at A + { + 2() from A to B; + } + or + { + 3() from A to B; + } + } + or + { + 1() from A to B; + 4() from A to B; + } + continue X; + } +} +//*/ + + +/* // TODO: more unfinished (and accept-correlation) role tests +global protocol Proto1(role A, role B) +{ + choice at A + { + 1() from A to B; + 1() from A to B; // FIXME unfinished term not reported -- FIXME: still need to check good terms (taking accept-guarded states into account) + 1() from A to B; + 2() from B to A; + } + or + { + 1() from A to B; + 1() from B to A; + 1() from B to A; + 2() from A to B; + } +} +//*/ + + +/* Testing aux protocol as CommandLine root protocol +aux global protocol Proto1(role A, role B) +{ + 1() from A to B; +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 5() from A to C; // A "non-det merge" that cannot be refactored by prefixing/sequencing + 3() from B to A; + } + or + { + 2() from A to B; + 5() from A to C; + 4() from B to A; + } +} +//*/ + + +//--- correlation + +/* +explicit global protocol Proto1(role A, role B) +//explicit global protocol Proto1(role A, role B, role C) +{ +// 1() connect A to B; // Bad +// disconnect A and B; +// 1() connect A to B; +// 2() from A to B; +// disconnect A and B; + +// 1() connect A to B; // Bad +// disconnect A and B; +// 2() connect A to B; +// disconnect A and B; + +// 1() connect A to B; // OK: this is what theabove should be intuitively +// disconnect A and B; +// 2() connect A to C; +// disconnect A and C; + +// 1() connect A to B; // Morally OK -- but conservatively rule out by syntactic condition -- do via modelling? endpoint transformations? (B should actually be a branch 1 or 2) -- or global model based on two concurent instances of each endpoint? (two enough?) -- mergeability of all accepts +// disconnect A and B; +// 1() connect A to B; +// disconnect A and B; +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + 1() connect A to B; // FIXME: correlation + 2() connect A to C; + 3() connect B to C; +} +//*/ + + +/*/ +explicit global protocol Proto1(role A, role B, role C) +{ + // OK + choice at A + { + 1() connect A to C; + choice at A + { + 1() connect A to B; + } + } + or + { + 2() connect A to C; + choice at A + { + 2() connect A to B; + } + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B) +{ + 1() connect A to B; + disconnect A and B; + 1() connect A to B; +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B) +{ + choice at A + { + 1() connect A to B; + disconnect A and B; + } + or + { + 2() connect A to B; + disconnect A and B; + } + 3() connect A to B; +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B) +{ + connect A to B; + do Proto1Aux(A, B); +} + +aux global protocol Proto1Aux(role A, role B) +{ + disconnect A and B; + //connect A to B; // Bad +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B) +{ + 1() connect A to B; + disconnect A and B; + 1() connect A to B; +} +//*/ + +//---correlation + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 1() from A to C; + } + or // Not OK: projection treats C?A:1 as single-case choice + { + 2() from A to B; + } + 3() from A to C; +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + // CHECKME: orphans currently detected on local termination, not full system termination (same for stuck and deadlock) + choice at A { + 1() from A to B; + 2() from A to C; + 3() from B to C; + 4() from C to A; + } or { + 1b() from A to B; + 3() from B to C; // -nolocalchoicecheck to show orphans + 4() from C to A; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + rec X + { + 1() from A to B; + do Proto1Aux(A, B); // Testing recvar name disambiguation + } +} + + +global protocol Proto1Aux(role A, role B) +{ + rec X + { + 2() from A to B; + choice at A + { + continue X; + } + or + { + 3() from A to B; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + rec X + { + 1() from A to B; + rec X + { + choice at A + { + 2() from A to B; + choice at A + { + continue X; + } + or + { + 3() from A to B; + } + } + or + { + //4() from A to B; + continue X; // Testing unguarded shadowed recvars at different nestings + } + or + { + 5() from A to B; + } + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + rec X + { + 1() from A to B; + choice at A + { + rec X + { + 2() from A to B; + continue X; + } + } + or + { + rec X // Testing shadowed unguarded recs + { + 3() from A to B; + continue X; + } + } + or + { + 4() from A to B; + continue X; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + rec X + { + 1() from A to B; + rec X + { + 2() from A to B; + choice at A + { + continue X; // Testing inlined-unfolding for shadowed recs + } + or + { + 3() from A to B; + } + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + rec X + { + choice at A + { + 1() from A to B; + 2() from B to A; + continue X; + } or { + 1() from A to B; + 3() from B to A; // Testing non-det unfair-transform ("unfairness" has the power to enforce a single case out of non-det options) + continue X; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + rec X + { + choice at A + { + 1() from A to B; + 2() from B to A; + continue X; // Testing non-det unfair-transform + } or { + 1() from A to B; + 3() from B to A; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + rec X + { + choice at A + { + 1() from A to B; + continue X; // Testing non-det unfair-transform + } or { + 1() from A to B; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + disconnect A and B; + do Proto1Aux(A, B); +} + +// Trivial test for "expressiveness" of aux -- but could just make explicit.. // CHECKME example where "aux" is fully needed +aux global protocol Proto1Aux(role A, role B) +{ + connect A to B; +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + //1() from A to C; + continue X; // Testing fairness + } + or + { + 2() from A to B; + 2() from A to C; + continue X; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 3() from B to C; + 4() from C to B; + 5() from B to C; + } + or + { + 2() from A to B; + 3() from B to C; // Syntactic merge means: non-det "squashed" so original choice path now ambiguous, so we need to act conservatively -- conservatively means squashed role needs to accept any incoming messages as a branch (to handle ambiguity) while not being allowed to make any output choices (only unary send allowed, so must be identical in all possibilities) + // EFSM transform has to follow this intuition, full continuations after a non-det input choice have to be convservatively squashed (and if not squashable, then check model using unsquashed version) -- or implement as syntactic merge, and use original if not mergeable + 4() from C to B; + 6() from B to C; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C, role D) +{ + choice at A + { + 1() from A to B; + 3() from B to C; + 3() from B to D; + 4() from C to D; + } + or + { + 2() from A to B; + 3() from B to C; + 3() from B to D; + 5() from C to D; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C, role D) +{ + choice at A + { + 1() from A to B; + 3() from B to C; + 4() from C to D; + } + or + { + 2() from A to B; + 3() from B to C; + 5() from C to D; // Not mergeable by ICALP13 + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 3() from B to C; + 4() from C to B; + } + or + { + 2() from A to B; + 3() from B to C; + 4() from C to B; + 5() from C to B; // Tricky to check, e.g., output state sub-EFSMs are the same (cf. syntactic equality) for terminating the merge, maybe need strict isomorphism (without renaming) + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + rec X + { + 0() from B to C; + choice at A + { + 1() from A to B; + 3() from B to C; + 4() from B to C; + } + or + { + 2() from A to B; + 3() from B to C; + 5() from B to C; // Consider EFSM of C for merging -- do non-det input squashing inductively, and only if no recursive edges back to original or preceding state? -- difficult to confirm, e.g., output state sub-EFSMs are the same (cf. syntactic equality) for terminating the merge, maybe need isomorphism + continue X; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 3() from B to C; + 4() from B to C; + } + or + { + 2() from A to B; + 3() from B to C; + //5() from B to C; // Makes merge easier + rec X + { + 5() from B to C; // Consider EFSM of C for merging + continue X; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 3() from B to C; + 3() from B to C; + 4() from B to C; + } + or + { + 2() from A to B; + 3() from B to C; // Merging (non-det input state "squashing") first messages only not enough (cf. inductive syntactic merge) + 3() from B to C; + 5() from B to C; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + rec X + { + 1() from A to B; + choice at A + //choice at B + { + continue X; + } + or + { + 2() from A to B; + //2() from B to A; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + choice at A + { + 1a() from A to B; + 1a() from A to C; + } + or + { + 1b() from A to B; + 1b() from A to C; + } + } + or + { + 2() from A to B; + choice at A + { + 2a() from A to B; + 2a() from B to C; + } + or + { + 2b() from A to B; + 2b() from B to C; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + rec X + { + 1() from A to B; + continue X; + } + } + or + { + 2() from A to B; + } + 3() from C to A; + 3() from C to A; // Role-progress violation for C under WF_1 + choice at A + { + 4() from A to B; + 5() from B to A; + } + or + { + 4() from A to B; + 6() from B to A; + } +} +//*/ + + +/* +// Counter example to completeness of safety for current WF +global protocol Proto1(role A, role B, role C) { + choice at A { + 1() from A to B; + 3() from B to C; + 4() from A to C; + } or { + 2() from A to B; + 3() from B to C; + 5() from A to C; // FIXME: should be mergable as a branch at C? (yes, by ICALP13) -- but requires treating non-det as det (i.e. language equiv. vs. bisim? -- local language minimisation wrt. inputs only?) -- in general, consider subsequent B and C interactions; but this exact example should be safe + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + 1() from A t B; // Testing Antlr error display overriding +} +//*/ + + +/* +type "java.lang.Integer" from "rt.jar" as Int; + +global protocol Proto1(role A, role B) +{ + choice at A + { + 1() from A to B; + } + or + { + 1(Int) from A to B; // Testing bad payloads + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 2() from B to C; + 3() from C to A; + } + or + { + 4() + from A to B; + 5() from B to C; // "Standard merge" (ICALP13) -- 2/5 cases merged for input choice at C // but is it actually mergable in ICALP13/WADFEST? because only defined on branch, not select as needed for C here -- it's fine, only merging the top level branches (distinct labels) + 6() from C to A; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 2() from B to C; + 3() from C to A; + } + or + { + 4() from A to B; + 2() from B to C; + 3() from C to A; // Not mergeable by WADFEST, because continuations of C to be merged are not input-branches (but WAFDEST could probably be extended easily -- most simply by just allowing TmergeT for any T, not just branch -- more generally, would have to inductively coerce non-branches into branches, which is what the below example (i.e. WADFEST) is a special case of) + // However, mergeable by ICALP13 (just a typo by WADFEST) + // (WADFEST merges also only defined on branches, not receives, but receive can be easily converted to singleton branches? -- a point of directed branches is that they have no payloads, and receives have no labels, which Scribble needs to consider) + } +} +//*/ + + +/* +// Counter example to completeness of safety for current WF -- this notion of completeness is wrt. a global semantics, but not wrt. specific definition of Scribble projection/EFSM? (i.e. if we project/build a subsequent input choice at C from A, not just the initial one from B -- this is essentially mixing a ``non-choice'' (pre-determined flow) at A with an external choice at C -- i.e. ICALP13/WADFEST merge: convert non-det external choice into det non-choice followed by inductively merged (external choice) continuations) -- actually not necessarily, can consider still non-det, but just that the continuation branches are safe (but this view is more like inferring non-directly specified cases for nested branches) +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 2() from B to C; + //choice at A { // better for merging? + 3() from A to C; + //} + } + or + { + 1b() from A to B; + 2() from B to C; + 4() from A to C; // FIXME: "merge/coerce" branches for C -- implement as some king of variant of "determinisation"? i.e. 2.3+2.4 -> 2.(3+4) (issue is it's not bisim preserving -- is local language minimisation a sound general principle? well, not for the minimal non-det branch example (or actually, yes? see below), but somehow only for "nested" external choices? i.e. same-label mergability?) + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + choice at A + { + 1() from A to B; + 2() from B to A; // FIXME: should we just language-equiv minimise endpoints? implicitly take that as the CFSM meaning of this global protocol? depends on global semantics -- but would make general projection/graphbuilding and mergability more uniform? -- uniformity should be the aim, see below -- no: not just independent EFSM minimisation, but should consider the whole CFSM system, see below + } + or + { + 1() from A to B; + 3() from B to A; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + choice at A + { + 1() from A to B; + 3() from B to C; + 4() from C to A; + } + or + { + 2() from A to B; + 3() from B to C; + 5() from C to A; // FIXME: language minimising at C will determinise, but minimising at A has no effect: minimising makes (non-det) external choice at C into internal choice, which is incompatible with original internal choice at A -- so independent language minimising is not sound -- basically syntactic branch-only merging restricts "determinising" to external choices only -- so do independent EFSM language-minimisation applied to inputs only? (but sometimes non-det outputs can be safely minimised -- but just leave them as is for global model checking?) + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + } + or + { + 1() from A to B; // Simply syntactically not representable with directed choice, but safe under the same intuition as mergability -- in this case, independent endpoint minimisation modifies both A and B consistently + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 2() from B to C; + //choice at A + //{ + // 4() from A to C; + //} + //or + //{ + // 3() from A to C; + //} + do Proto1Aux(A, C); // WADFEST merge -- morally: WADFEST merge "infers" safe branche cases for nested branches -- can factor out by subprotos + // NO: WADFEST prevents internal choice 4/5 by A, only allows external choice by C + } + or + { + 1b() from A to B; + 2() from B to C; + //choice at A + //{ + // 4() from A to C; + //} + //or + //{ + // 3() from A to C; + //} + do Proto1Aux(A, C); + } +} + +// Makes clear that TmergeT for any T should be OK +aux global protocol Proto1Aux(role A, role C) +{ + choice at A + { + 3() from A to C; + } + or + { + 4() from A to C; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 2() from B to C; + 3() from C to A; + } + or + { + 4() from A to B; + 2() from B to C; + 5() from C to A; // TODO: most general merge: coerce an external choice for A here -- less morally clear than, e.g., WADFEST restriction to branch-only merge though + } +} +//*/ + + +/* +type "java.lang.Integer" from "rt.jar" as Int; + +global protocol Proto1(role A, role B, role C) +{ + choice at A { + buyer1(Int) from A to B; // Total + (Int) from B to A; // B will pay this much + buyer2(Int) from A to C; // C will pay remainder + } or { + buyer1(Int) from A to C; // Total + (Int) from C to A; // C will pay this much + buyer2(Int) from A to B; // B will pay remainder + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C, role D) +{ + ..(syntactic) reachability tests +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 1() from A to C; + } + or + { + 2() from A to B; + } + 3() from A to C; // TODO: "optional": needs empty actions and "empty-removal" transformation +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + 1() from B to A; + 3() from A to C; // Trying to find an unfair-transformation problem wrt. not visiting "2" case after "1" transitions + continue X; + } + or + { + 2() from A to B; + 2() from B to A; + 3() from A to C; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + 1() from A to B; + 2() from B to C; // Testing CommandLine with, e.g., -fsm(dot) arg (disamb error before projection passes means graph cannot be built) +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A // -oldwf, default, -fair + { + 1() from A to B; + continue X; + } + or + { + 2() from A to B; + //2() from A to C; + 2() from B to C; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + rec X + { + 1() from A to B; + continue X; + } + } + or + { + 2() from A to B; + } + 3() from B to C; +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + () from B to C; + 1() from B to A; + } + or + { + 2() from A to B; + () from B to C; // Classic mergeability (no "equiv." protocol by sequencing -- unless maybe a generous async. equiv.) + 2() from B to A; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 2() from B to C; + //3() from C to A; + 3() from C to B; + } + or + { + 1() from A to B; + 5() from B to C; + //6() from C to A; + 5() from C to B; // Mergeable -- A not involved downstream + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + rec X + { + 1() from A to B; + 1() from B to C; + continue X; + } + } + or + { + 2() from A to B; + 2() from B to C; + } + 3() from A to B; // Sequencing after recursive-choice + 3() from B to C; +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + 1(Proto2@A) from A to B; // Testing delegation payload projection +} + +global protocol Proto2(role A, role B) +{ + 2() from A to B; +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + (Proto1@A) from A to B; // Testing recursive protocoldecls +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + (Proto2@A) from A to B; // Testing recursive protocoldecls +} + +global protocol Proto2(role A, role B) +{ + //(Proto1@A) from A to B; + (Proto3@A) from A to B; + //do Proto3(A, B); +} + +global protocol Proto3(role A, role B) +{ + 1() from A to B; + //(Proto1@A) from A to B; + //(Proto2@A) from A to B; + //do Proto1(A, B); +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 4() from B to C; + } + or + { + 2() from A to B; + 5() from B to C; // Mergeable subset of choice cases (cf. syntactic merge? + 5() from C to B; + } + or + { + 3() from A to B; + 5() from B to C; + 5() from C to B; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + do Game(A, B, C); + } + or + { + 2() from A to B; + 2() from B to C; + } +} + +aux global protocol Game(role A, role B, role C) +{ + () from A to B; + () from B to C; +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + rec X + { + 1() from A to B; + rec X + { + 2() from A to B; + //do Proto1Aux(A, B); + } + } +} + +aux global protocol Proto1Aux(role A, role B) +{ + continue X; // Still checked for aux +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + do Proto1Aux(A, B); +} + +aux global protocol Proto1Aux(role A, role B) +{ + M from A to B; +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + (Test.Foo) from A to B; // Testing DataType disamb +} +//*/ + + +/* +type "java.lang.Integer" from "rt.jar" as Int; + +global protocol Proto1(role A, role B) +{ + Int from A to B; // Testing disamb (and AST visitChild) +} +//*/ + + +/* +sig "..." from "..." as M; + +global protocol Proto1(role A, role B) +{ + (M) from A to B; // Testing disamb (and AST visitChild) +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + connect A to C; + rec X + { + choice at A + { + 1() from A to B; // Testing "fair"/"unfair" liveness -- issue of global liveness vs. local subtyping) -- generating "unfair output subtyped" global model (can it be done simply by terminal set role check?) + continue X; + } + or + { + 2() from A to B; + } + } + 3() from A to C; +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + continue X; + } + or + { + 1() from A to B; // Testing non-det unfairClone -- uninteresting test because non-det single-action-edge choice-merges get implicitly minimised (by graph building) + continue X; + } + or + { + 2() from A to B; + 2() from B to C; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + 3() from B to A; + continue X; + } + or + { + 1() from A to B; // Testing non-det unfairClone + 3() from B to A; + //4() from B to A; + continue X; + } + or + { + 2() from A to B; + 2() from B to C; + } + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + connect B to C; + connect A to C; // How does C "correlate" A/B connections to sessions -- introduces? -- need to study real examples +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + rec X + { + 1() from A to B; + connect B to C; // C doesn't care whether each connection is new or old session? + 2() from B to C; + disconnect B and C; + continue X; + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B) +{ + connect A to B; + disconnect A and B; + connect A to B; // What does it mean for B to leave the session and rejoin? Need some condition like if fully leave, then rejoining should be same as new session? (i.e. this case bad) -- Consider implementability + disconnect A and B; +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + rec X + { + choice at A + { + 1() from A to B; + 1() connect A to C; + disconnect A and C; + continue X; + } + or + { + 2() from A to B; + 2() connect A to C; + disconnect A and C; + continue X + } + } + connect A to C; // Good until here, now bad because C already fully left? + 3() from A to C; +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B) +{ + rec X + { + connect A to B; // What does this mean in terms of a "session"? (should consider the implementation, session id, ...) -- distinction between initial accept and in-session accepts? + //1() from A to B; + //1() from B to A; + disconnect A and B; // Shouldn't allow continuation after a certain point? no session structure left? + continue X; + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + choice at A + { + 1() from A to B; + connect B to C; + connect A to C; + 1() from A to C; + } + or + { + 2() from A to B; + connect A to C; // Inconsistent choice connect subjects + } +} +//*/ + +//*** + + + +/* +explicit global protocol Proto1(role A, role B) +{ + connect A to B; + choice at A + { + 1() from A to B; + } + or + { + disconnect A and B; // CHECKME: disconnect shouldn't have asymmetric src/dest -- check enabling conditions wrt. choices, projection, etc + } +} +//*/ + + +/* +type "java.lang.Integer" from "rt.jar" as Int; + +explicit global protocol Proto1(role A, role B) +{ + choice at A + { + 1(Int) connect A to B; // Testing non-det payloads for message-connects + } + or + { + 1() connect A to B; + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + rec X + { + choice at A + { + 1() from A to B; + } + or + { + 2() from A to B; + 2() connect B to C; + 2() from B to C; + disconnect B and C; + } + or + { + 3() from A to B; + 3() connect B to C; // Cf. PartnershipSupplier filter subproto + 3() from B to C; + disconnect B and C; + } + continue X; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + 1() from B to C; + rec Y + { + choice at B + { + 3() from B to A; + continue X; + } + or + { + 4() from B to A; + continue Y; // Needs fairness + } + } + } + or + { + 2() from A to B; + 2() from B to C; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + 1() from B to C; + choice at B // C not involved, but still live (without fairness) + { + 3() from B to A; + continue X; + } + or + { + 4() from B to A; + continue X; + } + } + or + { + 2() from A to B; + 2() from B to C; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + 1() from B to C; + choice at B + { + 3() from B to A; + continue X; + } + or + { + rec Y // Bad (fair or not) + { + 4() from B to A; + continue Y; + } + } + } + or + { + 2() from A to B; + 2() from B to C; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + 1() from B to C; // Live, without fairness + continue X; + } + or + { + 2() from A to B; + 2() from B to C; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + rec X + { + 1() from A to B; + 1() from B to C; + continue X; + } + } + or + { + 2() from A to B; + 2() from B to C; // CHECKME: bad sequence if commented, correct? -- bad sequence because C not in block so projection pruned, then only rec-block left -- is this satisfactory? (consider standalone global semantics vs. global as syntactic sugar for locals) -- however, "bad sequence" restriction probably does not hurt expressiveness + } + 3() from B to C; +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + choice at A + { + 1() from A to B; + } + or + { + 2() from A to B; + } + rec X // Testing non-fair EFSM generation + { + choice at B + { + 3() from B to A; + continue X; + } + or + { + 4() from B to A; + } + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B) +{ + connect A to B; + choice at A + { + 1() from A to B; + wrap B to A; + } + or + { + wrap A to B; + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B) +{ + connect A to B; + choice at A + { + 1() from A to B; + } + or + { + 2() from A to B; + disconnect A and B; // Testing unfairClone terminal state reconcilliation -- FIXME: this example doesn't actually test this, cf. SupplierInfoExplicit for requestor + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + continue X; + } + or + { + 2() from A to B; + } + } + //3() from A to C; // Testing fair/unfair liveness for C + 3() from C to A; // Message liveness also subject to fair/unfair +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + () from B to C; + 3() from B to A; + } + or + { + 2() from A to B; + () from B to C; // choice + sequencing not the same as just syntactic sugar for factoring out a common branch continuation, i.e. cannot factor out "() from B" as a continuation without either losing causality for output to A or changing output order at B -- arguable that changing order at B is equivalent (for some equivalence), but not equivalent under basic bisimilarity + 4() from B to A; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; // CHECKME: empty case for C discarded by projection, but do we need tau for correctness? this example works because it ends up as stuck error -- a point is generating tau and then bisim-minimising doesn't remove the tau, whereas the current projection does remove the tau (so current projection is not equiv to bisim-minimisation intuition) + // should be OK: intiution: an input-state endpoint cannot choose to not receive a message, i.e. input states should never have tau -- so whole system must satisfy properties when modelling "partial" local branches as a "complete" branch for just the involved choice cases (i.e. ignore any non-involved cases) + } + or + { + 2() from A to B; + 2() from A to C; + } + 3() from A to C; +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + continue X; + } + or + { + 2() from A to B; + } + } + 3() from A to C; // Not "strongly" live for C -- by subtyping, an implementation of A may never terminate -- strongly live probably means all roles have to be involved in every choice path -- not quite: it all depends on definition of subtyping, could make a "live" notion of subtyping that doesn't allow a non-live subset of choices -- this also depends on the select primitives and typing rules (it could come down to decidability of if-conditions...) -- problem is, even without subtyping, select primitive is always about selecting just one case, can't really make a "live" typing on top of that... -- could be positioned as basic session typing needs strong liveness, while weak liveness can be aimed at assuming a more general program verification -- or maybe a more powerful "imperative style" typing system could work, e.g. while (...) { ..non-live choice on s..} ..live choice on s.., i.e. it is ok to select a non-live case if the while will terminate to eventually lead us to a live case.. -- this fairness/liveness issue is another "bondary" issue between modelling/types/practice, bit like linearity +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +//explicit global protocol Proto1(role A, role B) +{ + connect A to B; + choice at A + { + 1() from A to B; + } + or + { + 1() from A to B; + connect A to C; // Testing API gen (without I/O i/f gen) + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + choice at A // Testing minfsm + { + 1() from A to B; + 2() from B to A; + } + or + { + 1() from A to B; + 2() from B to A; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + 2() from A to B; + rec X + { + choice at A + { + 1() from A to B; + 1() from A to B; + } + or + { + 1() from A to B; // Testing minfsm + 1() from A to B; + } + continue X; +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + 2() from A to B; + rec X + { + choice at A + { + 1() from A to B; // Testing minfsm + } + or + { + 1() from A to B; + 1() from A to B; + } + continue X; +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + connect A to C; // Bad + disconnect A and C; + choice at A + { + 1() from A to B; + } + or + { + 1() from A to B; + connect B to C; + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + connect A to C; + choice at A + { + 1() from A to B; + 1() from A to C; + connect B to C; + 2() from A to B; + } + or + { + 1() from A to B; + 1() from A to C; + connect B to C; // Good: mergeable + 2() from A to B; + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + connect A to C; + choice at A + { + 1() from A to B; + 1() from A to C; + connect B to C; + 2() from A to B; + } + or + { + 1() from A to B; + 1() from A to C; + connect C to B; // If A and C are in above, 2() can be stuck at B's connect/accept here -- but stuck error not directly detected, error manifests as B/C deadlock + 2() from A to B; // Mergeable if B/C connection not deadlocked + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + choice at A + { + 1() from A to B; + connect B to C; + } + or + { + 1() from A to B; + } + 2() from B to C; // Trying to make an unconnected orphan from B to C, but currently will always get a connectedness error first -- model building semantics shouldn't/won't allow explicit unnconnected orphans, message cannot be sent if not connected +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to C; + connect C to B; + choice at A + { + 1() from A to C; + connect A to B; + } + or + { + 2() from A to C; + 2() from C to B; // Bad: connect and msg from different choice subjects + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B) +{ + rec X + { + choice at A + { + connect A to B; // Good: tests recursion pruning for connection actions + } + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B) +{ + rec X + { + choice at A // ** using old WF, this breaks connectedness checking -- WFChoiceChecker is an UnfoldingVisitor, but it is prunes the visit on entering the unfolded choice + { + connect A to B; + continue X; // Bad + } + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + rec X + { + choice at A + { + 1() from A to B; + connect B to C; + disconnect B and C; // Comment is bad + continue X; + } + or + { + 2() from A to B; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 2() from A to C; + 1() from A to B; + } + or + { + 2() from A to C; + 2() from C to A; + 2() from A to B; + } + continue X; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + // Disable local choice subject inference + rec X + { + // Testing getTrace? + choice at A + { + 1() from A to B; + //1() from A to B; + 1() from A to C; + 3() from B to C; + continue X; + } + or + { + 1() from A to B; + 2() from B to C; + 3() from C to B; + continue X; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + // Disable local choice subject inference + rec X + { + // Testing getTrace? + choice at A + { + 1() from A to B; + continue X; + } + or + { + 1() from A to B; + 1() from A to C; + 2() from C to B; + continue X; + } + or + { + 3() from A to C; + 3() from C to B; + continue X; + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + rec X + { + choice at A + { + 1() from A to B; // Testing graph building + } + or + { + 1() from A to B; + } + continue X; + } +} +//*/ + + +/* +global protocol Partners( + role LOGINsvc, + role REQUESTOR, + role AUTHsvc, + role FILTERsvc, + role SUPPLIERsvc, + role CONTRACTsvc) +{ + login() from REQUESTOR to LOGINsvc; + choice at LOGINsvc + { + loginfailure() from LOGINsvc to REQUESTOR; + 0() from REQUESTOR to AUTHsvc; + 0() from AUTHsvc to FILTERsvc; + 0() from AUTHsvc to SUPPLIERsvc; + 0() from AUTHsvc to CONTRACTsvc; + } or { + loginsuccess() from LOGINsvc to REQUESTOR; + rec MAIN + { + choice at REQUESTOR + { + getsuppliers() from REQUESTOR to AUTHsvc; + choice at AUTHsvc + { + getsuppliers() from AUTHsvc to SUPPLIERsvc; // Bad: testing getTrace performance + deny() from AUTHsvc to REQUESTOR; + } or { + getsuppliers() from AUTHsvc to SUPPLIERsvc; + suppliers() from SUPPLIERsvc to AUTHsvc; + filterSuppliers() from AUTHsvc to FILTERsvc; + filtered() from FILTERsvc to AUTHsvc; + suppliers() from AUTHsvc to REQUESTOR; + } + } or { + getcontracts() from REQUESTOR to AUTHsvc; + choice at AUTHsvc + { + deny() from AUTHsvc to REQUESTOR; + } or { + getcontracts() from AUTHsvc to CONTRACTsvc; + contracts() from CONTRACTsvc to AUTHsvc; + filterContracts() from AUTHsvc to FILTERsvc; + filtered() from FILTERsvc to AUTHsvc; + contracts() from AUTHsvc to REQUESTOR; + } + } + continue MAIN; + } + } +} +//*/ + + +/* +global protocol Proto1 +( + role REQuestor, + role AUTHsvc, + role SUPPLIERsvc, + role CONTRACTsvc) +{ + rec MAIN + { + choice at REQuestor + { + getsuppliers() from REQuestor to AUTHsvc; + choice at AUTHsvc + { + getsuppliers() from AUTHsvc to SUPPLIERsvc; // Bad: testing getTrace + deny() from AUTHsvc to REQuestor; + } or { + getsuppliers() from AUTHsvc to SUPPLIERsvc; + suppliers() from SUPPLIERsvc to AUTHsvc; + suppliers() from AUTHsvc to REQuestor; + } + } or { + getcontracts() from REQuestor to AUTHsvc; + choice at AUTHsvc + { + deny() from AUTHsvc to REQuestor; + } or { + getcontracts() from AUTHsvc to CONTRACTsvc; + contracts() from CONTRACTsvc to AUTHsvc; + contracts() from AUTHsvc to REQuestor; + } + } + continue MAIN; + } +} +//*/ + + + +/* +global protocol Proto(role A, role B) +{ + choice at A + { + 1() from A to B; + disconnect A and B; + } + or + { + 1() from A to B; + 2() from B to A; // B can still send even if A disconnects (async) -- so not wait-for from that situation + } +} +//*/ + + +/*/ +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + + 1() from A to C; + 1() from A to C; + + 3() from C to B; + } + or + { + 1() from A to B; + + () from B to C; // Trying to get A into above block while C is in here, such that WF1 forces C also into the above -- so that WF1 becomes unsound + 2() from A to C; + + 4() from C to B; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at C + { + 1() from C to B; + 1() from C to A; + } + or + { + 1() from C to B; + 2() from C to A; + + 2() from A to B; + 2() from A to B; + + 2() from A to C; + + 2() from C to B; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + rec X + { + choice at A + { + 1() from A to B; + continue X; + } + } + } + or + { + 2() from A to B; + } + + 2() from C to B; // TODO: investigate: WF_1 won't get past here, is it OK? + 2() from C to B; // ..becomes "fake" role liveness problem because of WF1 -- not live even assuming fairness + // ..dragons + + // TODO: investigate reachability of local states in global model +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at B + { + 0() from B to C; + 0() from B to A; + 2() from C to B; + choice at A + { + rec X + { + choice at A + { + 1() from A to B; + continue X; + } + } + } + or + { + 2() from A to B; + } + } + or + { + 0() from B to C; + 1() from B to A; + 2() from C to B; // Good + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at B + { + 0() from B to C; + 0() from B to A; + + //2() from C to B; + //2() from C to B; + + choice at A + { + rec X + { + choice at A + { + 1() from A to B; + //2() from C to B; + continue X; + } + } + } + or + { + 2() from A to B; + } + } + or + { + 0() from B to C; + 1() from B to A; + } + + 2() from C to B; // TODO: investigate: WF_1 won't get past here, is it OK? + 2() from C to B; // ..becomes "fake" role liveness problem because of WF1 + // ... + + // TODO: investigate reachability of local states in global model +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + // Trying to construct a counterexample for WF1 soundness.. + // ..need to find an error state that is unreachable by WF1 but reachable by e.g. WF2 + // Try to find a choice where B is falsely committed to a branch due to WF1 (so state space of model is unsoundly restricted) + choice at A + { + 1() from A to B; + 1() from A to B; + 2() from A to C; // A cannot do this in WF1 unless B receives a 1() first + } + or + { + 3() from A to C; + //2() from A to B; + // Local choice subjects require B to also receive from A in this block + // Two cases: same or different label + // If different label, then no possibility of false branch commitment + // If same label, then non-det always allows B to enter this block, even under WF1 + // Therefore: false choice commitment not possible + 1() from A to B; + 1() from A to B; + } +} +//*/ + + +/* +explicit global protocol Proto1(role A, role B, role C) +{ + connect A to B; + choice at A + { + 1() from A to B // Good non-det EFSM for A (including minimisation) + connect A to C; + } + or + { + 1() from A to B; + //connect A to C; // Tests -minfsm + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + // Needs local choice subject disabled, though the point is it's still bad + choice at A + { + a() from A to B; + //d() from C to B; // Moved down to make C enabled + cprime() from A to C; + d() from C to B; + b() from B to A; + y() from A to B; // Orphan + } + or + { + c() from A to C; + d() from C to B; // ..point is B could get in this case, while A (and C) are in the other + b() from B to A; + a() from A to B; // (..not stuck msg error because the a() from above is consumed here) + x() from B to A; // Orphan + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + // Counterexample for WF1 if local choice subject disabled + choice at A + { + a() from A to B; + a() from A to B; // WF1 unnaturally resolves the non-det choice at B by forcing B to commit to this branch before C is enabled + cprime() from A to C; + d() from C to B; + b() from B to A; + + //y() from A to B; // Potential orphan + } + or + { + c() from A to C; + d() from C to B; + b() from B to A; // Must come before a's, to prevent reverse choice race + a() from A to B; + a() from A to B; + + //x() from B to A; // Potential orphan + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + // Disable local choice subject inference -- mergeable + choice at A + { + 1() from A to B; + 1() from A to B; + 1() from A to C; + 2() from C to B; + } + or + { + 2() from A to C; + 2() from C to B; + 1() from A to B; + 1() from A to B; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 1() from A to B; + 1() from A to C; + 2() from C to B; + + 3() from B to C; + } + or + { + 2() from A to C; + 2() from C to B; + 1() from A to B; + 1() from A to B; + + //3() from B to C; + 4() from B to C; // Bad + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 1() from A to B; + 1() from A to C; + 2() from C to B; + 2() from C to B; + + 3() from B to C; // Should be potential stuck + } + or + { + 2() from A to C; + 2() from C to B; + 2() from C to B; + () from C to A; // Another counterexample to WF1 (B falsely committed to here when A/C are) + 1() from A to B; + 1() from A to B; + + 4() from B to C; // Should be potential stuck + } +} +//*/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +/* +global protocol Proto1(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + 1() from B to C; + } + or + { + 2() from A to B; // TODO: link model check errors to source code? -- though this protocol is syntactically bad... + } + or + { + 1() from B to C; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + // Testing one-slot asynchrony + rec X + { + choice at A + { + 1() from A to B; + 1() from A to C; + 1() from C to B; // Bad... but the point is one-slot asynchrony prevents exploring the global state where A!B:1 done twice without B?A:1 at least once, i.e. A cannot loop round first block twice without B also following into the first block... can something like this make WF unsound? -- is recursive mixed-role poly-inputs the only context for this problem? + } + or + { + 2() from A to C; + 2() from C to B; + } + continue X; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C, role D) +{ + rec X + { + 1() from A to B; + continue X; // Checking safety in non-terminating global model + } + choice at C + { + 2() from C to D; + 3() from D to C; // Stuck messages also manifest as message liveness violations (CHECKME: subsumed? so unnecessary to check safety except for actual terminations? -- but morally, they are local safety errors for the roles, as opposed to global liveness errors for the system) + } + or + { + 2() from C to D; + 4() from D to C; + } +} +//*/ + + +/* +global protocol Proto1(role A, role B, role C) +{ + rec X + { + choice at A + { + 1() from A to B; + choice at A + { + 1() from A to C; + continue X; // ** CHECKME: badly formed (for B) -- empty block bvelow is pruned leaving only the continue case, which leads to deadlock in global model, is this OK as WF algorithm? (any way to be unsound?) or should explicitly detect inconsistent choice block projections? + } + or + { + 3() from A to C; + } + } + or + { + 2() from A to C; + 2() from A to B; + } + } +} +//*/ + + +/* // TODO: test "transitive" intermediate continue-edge fixing? +global protocol Proto1(role A, role B) +{ + rec Y + { + 0() from A to B; + rec X + { + 1() from A to B; + choice at A + { + continue X; + } + or + { + continue Y; + } + } + } +} +//*/ + + +/* // Cf. -oldwf (non disjoint enabling) +global protocol Proto1(role A, role B) +{ + rec X + { + rec Y + { + choice at A + { + 1() from A to B; + } + or + { + 2() from A to B; + } + choice at A // EFSM state blowup -- FIXME: syntactic unfolding still necessary with global model checking? (for enabling?) or minimise before model checking? + { + continue X; + } + or + { + //2() from A to B; + //continue X; + continue Y; + } + } + } +} +//*/ + + +/* +global protocol Proto1(role A, role B) +{ + rec Y + { + rec X + { + 1() from A to B; + choice at A + { + continue X; // FIXME: non-fair is just slow, or non-terminating? + } + or + { + continue X; + } + or + { + continue Y; + } + or + { + 2() from A to B; + } + } + } +} +//*/ + + +/* // ?? +import Test2; + +type "java.lang.String" from "rt.jar" as String; +//*/ + + +/* // Simple name coincides with full name + // Some corner cases related to simple/full name overlap for default pa +module Test; + +import Test; +//*/ + +/* +module Test; + +import Test as Test; +//*/ + +/* +module Test; + +import Test2 as Test; // Good or bad? + +global protocol Proto(role A, role B) +{ + 1() from A to B; + do Test.Proto(A, B); +} +//*/ + + +/* // Some corner cases related to simple/full name overlap for default package Modules not tested in test suite (all Modules packaged) +import Test2; +import Test3 as Test3; // The name Test3 is test3.Test3 in Test2 +import test3.Test3 as Test4; // The name Test4 is actually Test4 in Test2 +//import test3.Test3 as Test3; + +global protocol Proto1(role A, role B) +{ + 1() from A to B; + do Test2.Proto2(A, B); + do Test3.Foo3(A, B); + do Test4.Bar3(A, B); +} +//*/ + + +/* +global protocol Foo(role A, role B) +{ + 1() from A to B; + do Bar(A, B); + 2() from A to B; +} + +aux global protocol Bar(role A, role B) // Testing bad unused role decls (wrt. subprotocol collected role occurrences) -- allow as aux? +{ + +} +//*/ + + +/* +global protocol Foo(role A, role B) // Project for A +{ + do Bar1<1(), 2()>(A, B); + do Bar1<3(), 4()>(A, B); +} + +global protocol Bar1(role A, role B) +{ + do Bar2(A, B, A); // TODO: duplicate role args +} + +global protocol Bar2(role A, role B, role C) +{ + M1 from A to B; + M2 from B to C; +} +//*/ + + diff --git a/scribble-test/src/test/scrib/tmp/Test2.scr b/scribble-test/src/test/scrib/tmp/Test2.scr new file mode 100644 index 000000000..17b1ec2e9 --- /dev/null +++ b/scribble-test/src/test/scrib/tmp/Test2.scr @@ -0,0 +1,78 @@ +//Raymond@HZHL3 ~/code/scribble-java/scribble-java +//$ java -cp modules/cli/target/classes/';'modules/core/target/classes';'modules/trace/target/classes';'modules/parser/target/classes';c:\Users\Raymond\.m2\repository\org\antlr\antlr-runtime\3.2\antlr-runtime-3.2.jar;'modules/validation/target/classes/';'modules/projection/target/classes/';C:\Users\Raymond\.m2\repository\org\codehaus\jackson\jackson-mapper-asl\1.9.9\jackson-mapper-asl-1.9.9.jar;C:\Users\Raymond\.m2\repository\org\codehaus\jackson\jackson-core-asl\1.9.9\jackson-core-asl-1.9.9.jar' org.scribble.cli.CommandLine -path modules/validation/src/test/scrib/src/ -validate Test + +module Test2; + + +import Test; + + +/*global protocol Proto(role C, role D) +{ + 2() from C to D; +}*/ + + +/*type "java.lang.String" from "rt.jar" as String2; + +//* +global protocol Proto2(role C, role D) +{ + Test2() from C to D; +} +//*/ + + +//* +import test3.Test3 as Test3; // The name Test3 is Test3 in Test1 +import Test4; // The name Test4 is test3.Test3 in Test1 +import Test4 as T4; + +global protocol Proto2(role C, role D) +{ + 2(Test3.TTT) from C to D; + do Test3.Bar3(C, D); + do Test4.Proto4(C, D); + do T4.Proto4(C, D); +} +//*/ + + +/*/ +global protocol Foo(role A, role B, role C) +{ + choice at A + { + 1() from A to B; + //do Bar(A, B); + choice at A + { + 3() from A to C; + } + } + or + { + 2() from A to B; + choice at A + { + 4() from A to C; + } + } +} +//*/ + + +/* +global protocol Bar(role C, role D) +{ + 3() from C to D; + do Test.Foo(C, D); +} + +//global protocol Foo2(role A, role B) +global protocol Foo(role A, role B) +{ + 4() from A to B; +} +//*/ + diff --git a/tools/cli/pom.xml b/tools/cli/pom.xml deleted file mode 100644 index 5d29f9522..000000000 --- a/tools/cli/pom.xml +++ /dev/null @@ -1,125 +0,0 @@ - - 4.0.0 - cli - pom - Scribble::Tools::CLI - - - org.scribble - tools - 0.3.2-SNAPSHOT - - - - - org.scribble - scribble-core - ${project.version} - - - org.scribble - scribble-cli - ${project.version} - - - org.scribble - scribble-parser - ${project.version} - - - org.scribble - scribble-validation - ${project.version} - - - org.scribble - scribble-projection - ${project.version} - - - org.scribble - scribble-trace - ${project.version} - - - org.scribble - scribble-monitor - ${project.version} - - - - org.antlr - antlr-runtime - - - org.codehaus.jackson - jackson-core-asl - - - org.codehaus.jackson - jackson-mapper-asl - - - - - org.scribble.docs - scribble-userguide - jdocbook - - - org.scribble.docs - scribble-developerguide - jdocbook - - - org.scribble.docs - javadoc - javadoc - - - - - - - - src/main/java - - **/* - - - - - - maven-assembly-plugin - - - - org.jboss.maven.plugins - maven-jdocbook-plugin - 2.3.8 - - - - - bin - process-resources - - single - - - scribble-${project.version} - false - - src/main/assembly/bin.xml - - - - - - - - - - diff --git a/tools/cli/src/main/assembly/bin.xml b/tools/cli/src/main/assembly/bin.xml deleted file mode 100644 index 54d69fd2e..000000000 --- a/tools/cli/src/main/assembly/bin.xml +++ /dev/null @@ -1,96 +0,0 @@ - - - - bin - true - - zip - - - - - src/main/release - / - 0755 - - - - - - lib - false - - org.scribble:scribble-core - org.scribble:scribble-cli - org.scribble:scribble-parser - org.scribble:scribble-validation - org.scribble:scribble-projection - org.scribble:scribble-trace - org.scribble:scribble-monitor - org.codehaus.jackson:jackson-core-asl - org.codehaus.jackson:jackson-mapper-asl - org.antlr:antlr-runtime - - ${artifact.artifactId}.${artifact.extension} - - - - docs/userguide - - org.scribble.docs:scribble-userguide:jdocbook - - false - false - false - false - 0755 - 0755 - true - - - **/META-INF/** - - - - - - docs/developerguide - - org.scribble.docs:scribble-developerguide:jdocbook - - false - false - false - false - 0755 - 0755 - true - - - **/META-INF/** - - - - - - docs/javadoc - - org.scribble.docs:javadoc:javadoc - - false - false - false - false - 0755 - 0755 - true - - - **/META-INF/** - - - - - - - diff --git a/tools/cli/src/main/release/Readme.txt b/tools/cli/src/main/release/Readme.txt deleted file mode 100644 index fb6ca9b73..000000000 --- a/tools/cli/src/main/release/Readme.txt +++ /dev/null @@ -1,22 +0,0 @@ -Scribble README -=============== - -This distribution contains the following information: - -- bin - -This folder contains the scripts for running the Scribble tooling from the command line. - -- docs - -This folder contains user and developer guides, as well as javadocs for the Java classes. - -- lib - -This folder contains the libraries (scribble and third party) that are required to run the tooling. - -- samples - -Some example scribble protocols and trace files to help you get started. - - diff --git a/tools/cli/src/main/release/bin/scribble.bat b/tools/cli/src/main/release/bin/scribble.bat deleted file mode 100755 index d9d1c3cd6..000000000 --- a/tools/cli/src/main/release/bin/scribble.bat +++ /dev/null @@ -1,5 +0,0 @@ -@set CP=%CLASSPATH%;..\lib\scribble-core.jar;..\lib\scribble-cli.jar;..\lib\scribble-parser.jar;..\lib\scribble-validation.jar;..\lib\scribble-projection.jar;..\lib\scribble-trace.jar;..\lib\scribble-monitor.jar;..\lib\jackson-core-asl.jar;..\lib\jackson-mapper-asl.jar;..\lib\antlr-runtime.jar - - - -@java -classpath %CP% org.scribble.cli.CommandLine %* diff --git a/tools/cli/src/main/release/bin/scribble.sh b/tools/cli/src/main/release/bin/scribble.sh deleted file mode 100644 index 58501117a..000000000 --- a/tools/cli/src/main/release/bin/scribble.sh +++ /dev/null @@ -1,3 +0,0 @@ -CP=$CLASSPATH:../lib/scribble-core.jar:../lib/scribble-cli.jar:../lib/scribble-parser.jar:../lib/scribble-validation.jar:../lib/scribble-projection.jar:../lib/scribble-trace.jar:../lib/scribble-monitor.jar:../lib/jackson-core-asl.jar:../lib/jackson-mapper-asl.jar:../lib/antlr-runtime.jar - -java -classpath $CP org.scribble.cli.CommandLine $* diff --git a/tools/cli/src/main/release/samples/scribble/examples/Choice.scr b/tools/cli/src/main/release/samples/scribble/examples/Choice.scr deleted file mode 100644 index 3c58d2411..000000000 --- a/tools/cli/src/main/release/samples/scribble/examples/Choice.scr +++ /dev/null @@ -1,18 +0,0 @@ -module scribble.examples.Choice; - -type "{http://scribble.org/example}M1" from "http://scribble.org/schema/Example.xsd" as M1; -type "{http://scribble.org/example}M2" from "http://scribble.org/schema/Example.xsd" as M2; -type "{http://scribble.org/example}M3" from "http://scribble.org/schema/Example.xsd" as M3; -type "{http://scribble.org/example}M4" from "http://scribble.org/schema/Example.xsd" as M4; - -global protocol First(role Buyer, role Seller) { - op1(M1) from Buyer to Seller; - - choice at Seller { - op2(M2) from Seller to Buyer; - } or { - op3(M3) from Seller to Buyer; - } - - op4(M4) from Buyer to Seller; -} \ No newline at end of file diff --git a/tools/cli/src/main/release/samples/scribble/examples/Choice_Buyer-1.trace b/tools/cli/src/main/release/samples/scribble/examples/Choice_Buyer-1.trace deleted file mode 100644 index b8fce851d..000000000 --- a/tools/cli/src/main/release/samples/scribble/examples/Choice_Buyer-1.trace +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name":"Choice@Buyer-1", - "steps":[{ - "type":"MessageTransfer", - "message":{ - "operator":"op1", - "types":["{http://scribble.org/example}M1"], - "values":[""] - }, - "fromRole":"Buyer", - "toRoles":["Seller"] - },{ - "type":"MessageTransfer", - "message":{ - "operator":"op2", - "types":["{http://scribble.org/example}M2"], - "values":[""] - }, - "fromRole":"Seller", - "toRoles":["Buyer"] - },{ - "type":"MessageTransfer", - "message":{ - "operator":"op4", - "types":["{http://scribble.org/example}M4"], - "values":[""] - }, - "fromRole":"Buyer", - "toRoles":["Seller"] - }], - "roles":[{ - "name":"Buyer", - "simulator":{ - "type":"MonitorRoleSimulator", - "module":"scribble.examples.Choice", - "role":"Buyer", - "protocol":"First" - } - }] -} diff --git a/tools/cli/src/main/release/samples/scribble/examples/Choice_Buyer-2.trace b/tools/cli/src/main/release/samples/scribble/examples/Choice_Buyer-2.trace deleted file mode 100644 index fe4246269..000000000 --- a/tools/cli/src/main/release/samples/scribble/examples/Choice_Buyer-2.trace +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name":"Choice@Buyer-2", - "steps":[{ - "type":"MessageTransfer", - "message":{ - "operator":"op1", - "types":["{http://scribble.org/example}M1"], - "values":[""] - }, - "fromRole":"Buyer", - "toRoles":["Seller"] - },{ - "type":"MessageTransfer", - "message":{ - "operator":"op3", - "types":["{http://scribble.org/example}M3"], - "values":[""] - }, - "fromRole":"Seller", - "toRoles":["Buyer"] - },{ - "type":"MessageTransfer", - "message":{ - "operator":"op4", - "types":["{http://scribble.org/example}M4"], - "values":[""] - }, - "fromRole":"Buyer", - "toRoles":["Seller"] - }], - "roles":[{ - "name":"Buyer", - "simulator":{ - "type":"MonitorRoleSimulator", - "module":"scribble.examples.Choice", - "role":"Buyer", - "protocol":"First" - } - }] -} diff --git a/tools/eclipse/features/org.scribble.feature/LICENSE.txt b/tools/eclipse/features/org.scribble.feature/LICENSE.txt deleted file mode 100644 index 29f81d812..000000000 --- a/tools/eclipse/features/org.scribble.feature/LICENSE.txt +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/tools/eclipse/features/org.scribble.feature/build.properties b/tools/eclipse/features/org.scribble.feature/build.properties deleted file mode 100644 index 64f93a9f0..000000000 --- a/tools/eclipse/features/org.scribble.feature/build.properties +++ /dev/null @@ -1 +0,0 @@ -bin.includes = feature.xml diff --git a/tools/eclipse/features/org.scribble.feature/feature.xml b/tools/eclipse/features/org.scribble.feature/feature.xml deleted file mode 100644 index 741b0da4c..000000000 --- a/tools/eclipse/features/org.scribble.feature/feature.xml +++ /dev/null @@ -1,258 +0,0 @@ - - - - - The Scribble Protocol Tools. - - - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - - - - - - - - - - - - - diff --git a/tools/eclipse/features/org.scribble.feature/pom.xml b/tools/eclipse/features/org.scribble.feature/pom.xml deleted file mode 100644 index 8f5ccaee1..000000000 --- a/tools/eclipse/features/org.scribble.feature/pom.xml +++ /dev/null @@ -1,16 +0,0 @@ - - 4.0.0 - org.scribble.tools.eclipse.features - org.scribble.feature - 0.3.2-SNAPSHOT - eclipse-feature - Scribble::Tools::Eclipse::Features::Scribble - - - org.scribble.tools.eclipse - features - 0.3.2-SNAPSHOT - - - diff --git a/tools/eclipse/features/pom.xml b/tools/eclipse/features/pom.xml deleted file mode 100644 index 0760232fb..000000000 --- a/tools/eclipse/features/pom.xml +++ /dev/null @@ -1,22 +0,0 @@ - - 4.0.0 - org.scribble.tools.eclipse - features - 0.3.2-SNAPSHOT - pom - Scribble::Tools::Eclipse::Features - - - org.scribble.tools - eclipse - 0.3.2-SNAPSHOT - - - - org.scribble.feature - - - - - diff --git a/tools/eclipse/plugins/org.scribble.editor.tests/META-INF/MANIFEST.MF b/tools/eclipse/plugins/org.scribble.editor.tests/META-INF/MANIFEST.MF deleted file mode 100644 index 4e621c467..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.tests/META-INF/MANIFEST.MF +++ /dev/null @@ -1,22 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: org.scribble.editor.tests -Bundle-Vendor: My Company -Bundle-Version: 1.0.0.qualifier -Bundle-SymbolicName: org.scribble.editor.tests; singleton:=true -Bundle-ActivationPolicy: lazy -Require-Bundle: org.scribble.editor, - org.scribble.editor.ui, - org.eclipse.core.runtime, - org.eclipse.xtext.junit4, - org.eclipse.ui.workbench;resolution:=optional -Import-Package: org.apache.log4j, - org.junit;version="4.5.0", - org.junit.runner;version="4.5.0", - org.junit.runner.manipulation;version="4.5.0", - org.junit.runner.notification;version="4.5.0", - org.junit.runners;version="4.5.0", - org.junit.runners.model;version="4.5.0", - org.hamcrest.core -Bundle-RequiredExecutionEnvironment: J2SE-1.5 -Export-Package: org.scribble.editor.dsl diff --git a/tools/eclipse/plugins/org.scribble.editor.tests/README.txt b/tools/eclipse/plugins/org.scribble.editor.tests/README.txt deleted file mode 100644 index 49e5e47c1..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.tests/README.txt +++ /dev/null @@ -1,2 +0,0 @@ -NOTE: This test plugin is only present as a generation target for the XText Eclipse plugins. If it is removed, then -it would not possible to regenerate the XText editor for Scribble. diff --git a/tools/eclipse/plugins/org.scribble.editor.tests/build.properties b/tools/eclipse/plugins/org.scribble.editor.tests/build.properties deleted file mode 100644 index c22eebe28..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.tests/build.properties +++ /dev/null @@ -1,5 +0,0 @@ -source.. = src/,\ - src-gen/,\ - xtend-gen/ -bin.includes = META-INF/,\ - . diff --git a/tools/eclipse/plugins/org.scribble.editor.tests/org.scribble.editor.tests.launch b/tools/eclipse/plugins/org.scribble.editor.tests/org.scribble.editor.tests.launch deleted file mode 100644 index 1549ebe23..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.tests/org.scribble.editor.tests.launch +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/tools/eclipse/plugins/org.scribble.editor.tests/src-gen/org/scribble/editor/dsl/ScribbleDslInjectorProvider.java b/tools/eclipse/plugins/org.scribble.editor.tests/src-gen/org/scribble/editor/dsl/ScribbleDslInjectorProvider.java deleted file mode 100644 index 3bede28cf..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.tests/src-gen/org/scribble/editor/dsl/ScribbleDslInjectorProvider.java +++ /dev/null @@ -1,45 +0,0 @@ -/* -* generated by Xtext -*/ -package org.scribble.editor.dsl; - -import org.eclipse.xtext.junit4.GlobalRegistries; -import org.eclipse.xtext.junit4.GlobalRegistries.GlobalStateMemento; -import org.eclipse.xtext.junit4.IInjectorProvider; -import org.eclipse.xtext.junit4.IRegistryConfigurator; - -import com.google.inject.Injector; - -public class ScribbleDslInjectorProvider implements IInjectorProvider, IRegistryConfigurator { - - protected GlobalStateMemento stateBeforeInjectorCreation; - protected GlobalStateMemento stateAfterInjectorCreation; - protected Injector injector; - - static { - GlobalRegistries.initializeDefaults(); - } - - public Injector getInjector() - { - if (injector == null) { - stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState(); - this.injector = internalCreateInjector(); - stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState(); - } - return injector; - } - - protected Injector internalCreateInjector() { - return new ScribbleDslStandaloneSetup().createInjectorAndDoEMFRegistration(); - } - - public void restoreRegistry() { - stateBeforeInjectorCreation.restoreGlobalState(); - } - - public void setupRegistry() { - getInjector(); - stateAfterInjectorCreation.restoreGlobalState(); - } -} diff --git a/tools/eclipse/plugins/org.scribble.editor.tests/src-gen/org/scribble/editor/dsl/ScribbleDslUiInjectorProvider.java b/tools/eclipse/plugins/org.scribble.editor.tests/src-gen/org/scribble/editor/dsl/ScribbleDslUiInjectorProvider.java deleted file mode 100644 index 600cef945..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.tests/src-gen/org/scribble/editor/dsl/ScribbleDslUiInjectorProvider.java +++ /dev/null @@ -1,16 +0,0 @@ -/* -* generated by Xtext -*/ -package org.scribble.editor.dsl; - -import org.eclipse.xtext.junit4.IInjectorProvider; - -import com.google.inject.Injector; - -public class ScribbleDslUiInjectorProvider implements IInjectorProvider { - - public Injector getInjector() { - return org.scribble.editor.dsl.ui.internal.ScribbleDslActivator.getInstance().getInjector("org.scribble.editor.dsl.ScribbleDsl"); - } - -} diff --git a/tools/eclipse/plugins/org.scribble.editor.tools/LICENSE.txt b/tools/eclipse/plugins/org.scribble.editor.tools/LICENSE.txt deleted file mode 100644 index 29f81d812..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.tools/LICENSE.txt +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/tools/eclipse/plugins/org.scribble.editor.tools/META-INF/MANIFEST.MF b/tools/eclipse/plugins/org.scribble.editor.tools/META-INF/MANIFEST.MF deleted file mode 100644 index c56482433..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.tools/META-INF/MANIFEST.MF +++ /dev/null @@ -1,42 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Scribble::Tools::Eclipse::Plugins::Editor Tools -Bundle-SymbolicName: org.scribble.editor.tools;singleton:=true -Bundle-Version: 0.3.2.qualifier -Bundle-Activator: org.scribble.editor.tools.osgi.Activator -Require-Bundle: org.eclipse.ui, - org.eclipse.core.runtime, - org.eclipse.core.resources, - org.eclipse.jface.text, - org.eclipse.debug.core, - org.eclipse.debug.ui, - org.eclipse.jdt.launching, - org.eclipse.jdt.core, - org.eclipse.ui.views, - org.eclipse.ui.editors, - org.eclipse.ui.workbench.texteditor, - org.eclipse.ltk.core.refactoring, - org.eclipse.ui.ide, - org.eclipse.osgi.services, - org.eclipse.equinox.ds, - org.eclipse.equinox.util -Bundle-ActivationPolicy: lazy -Bundle-Vendor: www.scribble.org -Scribble-Extensions: org.scribble.designer.editor.ScribbleEditorManager -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 -Bundle-ClassPath: ., - lib/antlr-runtime.jar, - lib/antlr.jar, - lib/scribble-core.jar, - lib/scribble-parser.jar, - lib/scribble-projection.jar, - lib/scribble-monitor.jar, - lib/scribble-trace.jar, - lib/scribble-validation.jar, - lib/jackson-core-asl.jar, - lib/jackson-mapper-asl.jar, - lib/stringtemplate.jar -Export-Package: org.scribble.editor.tools.logger, - org.scribble.monitor, - org.scribble.trace.model, - org.scribble.trace.util diff --git a/tools/eclipse/plugins/org.scribble.editor.tools/build.properties b/tools/eclipse/plugins/org.scribble.editor.tools/build.properties deleted file mode 100644 index d2d7f028e..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.tools/build.properties +++ /dev/null @@ -1,11 +0,0 @@ -source.. = src/main/java/,\ - src/main/resources/ -output.. = classes/,\ - bin/ -bin.includes = plugin.xml,\ - META-INF/,\ - .,\ - lib/*.jar,\ - LICENSE.txt,\ - icons/ - diff --git a/tools/eclipse/plugins/org.scribble.editor.tools/icons/scribble.png b/tools/eclipse/plugins/org.scribble.editor.tools/icons/scribble.png deleted file mode 100644 index 7662497ef..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor.tools/icons/scribble.png and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor.tools/plugin.xml b/tools/eclipse/plugins/org.scribble.editor.tools/plugin.xml deleted file mode 100644 index 1a2d2d0ba..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.tools/plugin.xml +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - - - New Scribble Protocol Description - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tools/eclipse/plugins/org.scribble.editor.tools/pom.xml b/tools/eclipse/plugins/org.scribble.editor.tools/pom.xml deleted file mode 100644 index 6b75a6044..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.tools/pom.xml +++ /dev/null @@ -1,174 +0,0 @@ - - 4.0.0 - org.scribble.tools.eclipse.plugins - org.scribble.editor.tools - eclipse-plugin - Scribble::Tools::Eclipse::Plugins::Editor Tools - - - org.scribble.tools.eclipse - plugins - 0.3.2-SNAPSHOT - - - - - org.scribble - scribble-core - ${project.version} - - - org.scribble - scribble-parser - ${project.version} - - - org.scribble - scribble-projection - ${project.version} - - - org.scribble - scribble-validation - ${project.version} - - - org.scribble - scribble-monitor - ${project.version} - - - org.scribble - scribble-trace - ${project.version} - - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - copy-scribble-core - process-sources - - copy - - - true - lib - - - org.scribble - scribble-core - ${project.version} - - - org.scribble - scribble-parser - ${project.version} - - - org.scribble - scribble-projection - ${project.version} - - - org.scribble - scribble-monitor - ${project.version} - - - org.scribble - scribble-trace - ${project.version} - - - org.scribble - scribble-validation - ${project.version} - - - org.antlr - antlr - ${antlr.version} - - - org.antlr - antlr-runtime - ${antlr.version} - - - org.antlr - stringtemplate - ${antlr.version} - - - org.codehaus.jackson - jackson-core-asl - - - org.codehaus.jackson - jackson-mapper-asl - - - - - - - - org.apache.maven.plugins - maven-clean-plugin - - - - lib - - **/* - - - - - - - - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - - org.apache.maven.plugins - - - maven-dependency-plugin - - - [2.1,) - - - copy - - - - - - - - - - - - - - - diff --git a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/java/org/scribble/editor/tools/actions/ProjectionAction.java b/tools/eclipse/plugins/org.scribble.editor.tools/src/main/java/org/scribble/editor/tools/actions/ProjectionAction.java deleted file mode 100644 index 7b63b8c5b..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/java/org/scribble/editor/tools/actions/ProjectionAction.java +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Copyright 2009-11 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.editor.tools.actions; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.MessageBox; -import org.eclipse.ui.IObjectActionDelegate; -import org.eclipse.ui.IWorkbenchPart; -import org.scribble.logging.ConsoleIssueLogger; -import org.scribble.resources.InputStreamResource; -import org.scribble.resources.Resource; -import org.scribble.resources.ResourceLocator; -import org.scribble.context.DefaultModuleContext; -import org.scribble.editor.tools.osgi.Activator; -import org.scribble.model.Module; -import org.scribble.parser.ProtocolModuleLoader; -import org.scribble.parser.ProtocolParser; -import org.scribble.projection.ProtocolProjector; - -/** -* This class implements the action to project a global model. -*/ -public class ProjectionAction implements IObjectActionDelegate { - - private ISelection _selection; - private IWorkbenchPart _targetPart; - - /** - * Default constructor. - */ - public ProjectionAction() { - } - - /** - * {@inheritDoc} - */ - public void run(IAction action) { - if (_selection instanceof StructuredSelection) { - StructuredSelection sel=(StructuredSelection)_selection; - final IResource res=(IResource)sel.getFirstElement(); - - if (res instanceof IFile) { - ConsoleIssueLogger logger= - new ConsoleIssueLogger(); - - try { - InputStreamResource isr = new InputStreamResource(res.getLocation().toPortableString(), - ((IFile)res).getContents()); - - // Create a locator based on the Eclipse project root - ResourceLocator locator=new ResourceLocator() { - - public Resource getResource(String name) { - String filename=name.replace('.', java.io.File.separatorChar)+".scr"; - - IFile file=res.getProject().getFile(filename); - - if (file != null) { - try { - return (new InputStreamResource(filename, file.getContents())); - } catch (Exception e) { - e.printStackTrace(); - } - } - - return null; - } - }; - - ProtocolParser pp=new ProtocolParser(); - - ProtocolModuleLoader loader=new ProtocolModuleLoader(pp, locator, logger); - - Module module=pp.parse(isr, loader, logger); - - if (module != null) { - ProtocolProjector projector=new ProtocolProjector(); - - DefaultModuleContext context=new DefaultModuleContext(isr, module, loader); - - java.util.Set projections=projector.project(context, module, logger); - - for (Module lm : projections) { - String filename=lm.getName().replace('.', - java.io.File.separatorChar)+".scr"; - - IFile file=res.getProject().getFile(filename); - - if (file.exists() == false) { - file.create(null, true, - new org.eclipse.core.runtime.NullProgressMonitor()); - } - - java.io.InputStream is=new java.io.ByteArrayInputStream(lm.toString().getBytes()); - - file.setContents(is, true, false, - new org.eclipse.core.runtime.NullProgressMonitor()); - - is.close(); - - file.refreshLocal(IResource.DEPTH_ONE, - new org.eclipse.core.runtime.NullProgressMonitor()); - } - } - } catch (Throwable e) { - Activator.logError("Failed to record issue on resource '"+res+"'", e); - } - } - } - } - - /** - * {@inheritDoc} - */ - public void selectionChanged(IAction action, ISelection selection) { - _selection = selection; - action.setEnabled(true); - - /* - if (_selection instanceof StructuredSelection) { - StructuredSelection sel=(StructuredSelection)_selection; - IResource res=(IResource)sel.getFirstElement(); - - if (res instanceof IFile) { - IFile file=(IFile)res; - - // Check not a local scribble protocol - if (file.getName().indexOf('@') == -1) { - action.setEnabled(true); - } - } - } - */ - } - - /** - * {@inheritDoc} - */ - public void setActivePart(IAction action, IWorkbenchPart targetPart) { - _targetPart = targetPart; - } - - /** - * This method is used to report a warning. - * - * @param mesg The warning message - */ - public void warn(String mesg) { - MessageBox mbox=new MessageBox(_targetPart.getSite().getShell(), - SWT.ICON_WARNING|SWT.OK); - mbox.setMessage(mesg); - mbox.open(); - } -} \ No newline at end of file diff --git a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/java/org/scribble/editor/tools/logger/EclipseIssueLogger.java b/tools/eclipse/plugins/org.scribble.editor.tools/src/main/java/org/scribble/editor/tools/logger/EclipseIssueLogger.java deleted file mode 100644 index 6e3ff8f5e..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/java/org/scribble/editor/tools/logger/EclipseIssueLogger.java +++ /dev/null @@ -1,377 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.editor.tools.logger; - -import java.util.logging.Logger; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IMarker; -import org.scribble.model.ModelObject; -import org.scribble.logging.IssueLogger; - -/** - * The Eclipse implementation of the journal. - * - */ -public class EclipseIssueLogger implements IssueLogger { - - private static final Logger LOG=Logger.getLogger(EclipseIssueLogger.class.getName()); - - private IFile _file=null; - private boolean _finished=false; - private boolean _errorOccurred=false; - private java.util.Vector _entries=new java.util.Vector(); - private java.util.Vector _reported=new java.util.Vector(); - - /** - * The constructor. - * - * @param file The file - */ - public EclipseIssueLogger(IFile file) { - _file = file; - } - - /** - * {@inheritDoc} - */ - public void error(String issue, java.util.Map props) { - reportIssue(issue, ReportEntry.ERROR_TYPE, props); - _errorOccurred = true; - } - - /** - * {@inheritDoc} - */ - public void error(String issue, ModelObject mobj) { - reportIssue(issue, ReportEntry.ERROR_TYPE, mobj.getProperties()); - _errorOccurred = true; - } - - /** - * Has an error occurred. - * - * @return Whether an error has occurred - */ - public boolean hasErrorOccurred() { - return (_errorOccurred); - } - - /** - * {@inheritDoc} - */ - public void info(String issue, java.util.Map props) { - reportIssue(issue, ReportEntry.INFORMATION_TYPE, props); - } - - /** - * {@inheritDoc} - */ - public void info(String issue, ModelObject mobj) { - reportIssue(issue, ReportEntry.INFORMATION_TYPE, mobj.getProperties()); - } - - /** - * {@inheritDoc} - */ - public void warning(String issue, java.util.Map props) { - reportIssue(issue, ReportEntry.WARNING_TYPE, props); - } - - /** - * {@inheritDoc} - */ - public void warning(String issue, ModelObject mobj) { - reportIssue(issue, ReportEntry.WARNING_TYPE, mobj.getProperties()); - } - - /** - * This method reports an issue. - * - * @param issue The issue - * @param issueType The issue type - * @param props The properties - */ - protected void reportIssue(String issue, int issueType, java.util.Map props) { - - if (_file != null) { - - synchronized (_entries) { - _entries.add(new ReportEntry(issue, issueType, props)); - } - - if (_finished) { - // Publish immediately - finished(); - } - } - } - - /** - * {@inheritDoc} - */ - public void finished() { - org.eclipse.swt.widgets.Display.getDefault().asyncExec(new Runnable() { - public void run() { - - if (_file != null && _file.exists()) { - - // Clear current markers - try { - synchronized (_entries) { - - if (!_finished) { - _file.deleteMarkers(ScribbleMarker.SCRIBBLE_PROBLEM, true, - IFile.DEPTH_INFINITE); - _finished = true; - } - - // Update the markers - for (int i=0; i < _entries.size(); i++) { - ReportEntry re=(ReportEntry)_entries.get(i); - - if (!_reported.contains(re)) { - createMarker(re.getIssue(), re.getType(), - re.getProperties()); - - _reported.add(re); - } - } - - _entries.clear(); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - } - }); - } - - /** - * This method creates a marker. - * - * @param mesg The message - * @param type The type - * @param props The properties - */ - protected void createMarker(String mesg, int type, - java.util.Map props) { - - // Create marker for message - try { - IMarker marker=_file.createMarker(ScribbleMarker.SCRIBBLE_PROBLEM); - - // Initialize the attributes on the marker - marker.setAttribute(IMarker.MESSAGE, mesg); - - if (type == ReportEntry.ERROR_TYPE) { - marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR); - } else if (type == ReportEntry.WARNING_TYPE) { - marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_WARNING); - } else if (type == ReportEntry.INFORMATION_TYPE) { - marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_INFO); - } - - derivePosition(_file, marker, props); - - } catch (Exception e) { - - // TODO: report error - e.printStackTrace(); - } - } - - /** - * This method derives the position. - * - * @param file The file - * @param marker The marker - * @param props The properties - * @throws Exception Failed to derive position - */ - protected void derivePosition(IFile file, IMarker marker, java.util.Map props) - throws Exception { - int endMarkerAfter=-1; - String contents=null; - - if (props == null) { - LOG.severe("Unable to derive position associated with marker as not properties provided"); - return; - } - - if (props.containsKey(ModelObject.START_POSITION)) { - marker.setAttribute(IMarker.CHAR_START, (Integer)props.get(ModelObject.START_POSITION)); - - if (props.containsKey(ModelObject.END_POSITION)) { - marker.setAttribute(IMarker.CHAR_END, (Integer)props.get(ModelObject.END_POSITION)); - } else { - endMarkerAfter = (Integer)props.get(ModelObject.START_POSITION); - } - } else if (props.containsKey(ModelObject.START_LINE)) { - int pos=-1; - - contents = getContents(file); - - if (contents != null) { - pos = 0; - - int curline=1; - int line=(Integer)props.get(ModelObject.START_LINE); - - while (curline < line) { - // Find next end of line - int nextPos=contents.indexOf('\n', pos); - - curline++; - pos = nextPos+1; - } - - if (props.containsKey(ModelObject.START_COLUMN)) { - pos += (Integer)props.get(ModelObject.START_COLUMN); - } - } - - marker.setAttribute(IMarker.CHAR_START, pos); - - if (props.containsKey(ModelObject.END_LINE)) { - if (contents != null) { - pos = 0; - - int curline=1; - int line=(Integer)props.get(ModelObject.END_LINE); - - while (curline < line) { - // Find next end of line - int nextPos=contents.indexOf('\n', pos); - - curline++; - pos = nextPos+1; - } - - if (props.containsKey(ModelObject.END_COLUMN)) { - pos += (Integer)props.get(ModelObject.END_COLUMN); - } - - marker.setAttribute(IMarker.CHAR_END, pos); - } - } else { - endMarkerAfter = pos; - } - } - - if (endMarkerAfter != -1) { - if (contents == null) { - contents = getContents(file); - } - - // Find next whitespace after this position - int nextPos=endMarkerAfter; - - while (nextPos < contents.length() && !Character.isWhitespace(contents.charAt(nextPos))) { - nextPos++; - } - - if (nextPos != -1) { - marker.setAttribute(IMarker.CHAR_END, nextPos); - } - } - } - - /** - * This method returns the file contents. - * - * @param file The file - * @return The contents - * @throws Exception Failed to get contents - */ - protected String getContents(IFile file) throws Exception { - java.io.InputStream is=file.getContents(); - byte[] b=new byte[is.available()]; - is.read(b); - is.close(); - - return (new String(b)); - } - - /** - * This is a simple data container class to hold the - * information reported during validation. - * - */ - public class ReportEntry { - - /** - * Error type. - */ - public static final int ERROR_TYPE=0; - - /** - * Warning type. - */ - public static final int WARNING_TYPE=1; - - /** - * Information type. - */ - public static final int INFORMATION_TYPE=2; - - private String _issue=null; - private int _type=0; - private java.util.Map _properties=null; - - /** - * Constructor. - * - * @param issue The issue - * @param type The type - * @param props The properties - */ - public ReportEntry(String issue, int type, - java.util.Map props) { - _issue = issue; - _type = type; - _properties = props; - } - - /** - * This method returns the issue. - * - * @return The issue - */ - public String getIssue() { - return (_issue); - } - - /** - * This method returns the type. - * - * @return The type - */ - public int getType() { - return (_type); - } - - /** - * This method returns the properties. - * - * @return The properties - */ - public java.util.Map getProperties() { - return (_properties); - } - } -} diff --git a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/java/org/scribble/editor/tools/logger/ScribbleMarker.java b/tools/eclipse/plugins/org.scribble.editor.tools/src/main/java/org/scribble/editor/tools/logger/ScribbleMarker.java deleted file mode 100644 index e3804188d..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/java/org/scribble/editor/tools/logger/ScribbleMarker.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.editor.tools.logger; - -/** - * This class contains Scribble Marker definitions. - */ -public final class ScribbleMarker { - - /** - * Private constructor. - */ - private ScribbleMarker() { - } - - /** - * Scribble problem. - */ - public static final String SCRIBBLE_PROBLEM = "org.scribble.ScribbleProblem"; - -} diff --git a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/java/org/scribble/editor/tools/osgi/Activator.java b/tools/eclipse/plugins/org.scribble.editor.tools/src/main/java/org/scribble/editor/tools/osgi/Activator.java deleted file mode 100644 index d6106080b..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/java/org/scribble/editor/tools/osgi/Activator.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.editor.tools.osgi; - -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceChangeEvent; -import org.eclipse.core.resources.IResourceChangeListener; -import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.resources.IResourceDeltaVisitor; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; -import org.scribble.editor.tools.validator.ProtocolValidationManager; -import org.scribble.parser.ProtocolDefinitions; - -/** - * The activator class controls the plug-in life cycle. - */ -public class Activator extends AbstractUIPlugin { - - private static Logger logger = Logger.getLogger("org.scribble.eclipse.tools"); - - private ProtocolValidationManager _validator=new ProtocolValidationManager(); - - /** - * Plugin id. - */ - public static final String PLUGIN_ID = "org.scribble.editor.tools"; - - // The shared instance - private static Activator plugin; - - /** - * The constructor. - */ - public Activator() { - } - - /** - * {@inheritDoc} - */ - public void start(final BundleContext context) throws Exception { - super.start(context); - plugin = this; - - // Register resource change listener - IResourceChangeListener rcl=new IResourceChangeListener() { - public void resourceChanged(IResourceChangeEvent evt) { - try { - evt.getDelta().accept(new IResourceDeltaVisitor() { - public boolean visit(IResourceDelta delta) { - boolean ret=true; - IResource res = delta.getResource(); - // Determine if the change is relevant - if (isChangeRelevant(res, delta)) { - // Validate the resource - _validator.validateResource(res); - } - return (ret); - } - }); - } catch (Exception e) { - logger.log(Level.SEVERE, "Failed to process resource change event", e); - } - } - }; - - // Register the resource change listener - ResourcesPlugin.getWorkspace().addResourceChangeListener(rcl, - IResourceChangeEvent.POST_CHANGE); - } - - /** - * This method determines if the change is relevant. - * - * @param res The resource - * @param delta The delta - * @return Whether the change is relevant - */ - protected boolean isChangeRelevant(IResource res, IResourceDelta delta) { - return (res instanceof IFile - && ((IFile)res).getFileExtension().equals(ProtocolDefinitions.PROTOCOL_EXTENSION) - && (((delta.getFlags() & IResourceDelta.CONTENT) != 0) - || delta.getKind() == IResourceDelta.ADDED)); - } - - /** - * {@inheritDoc} - */ - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance. - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - - /** - * This method logs an error against the plugin. - * - * @param mesg The error message - * @param t The optional exception - */ - public static void logError(String mesg, Throwable t) { - - if (getDefault() != null) { - Status status=new Status(IStatus.ERROR, - PLUGIN_ID, 0, mesg, t); - - getDefault().getLog().log(status); - } - - logger.severe("LOG ERROR: "+mesg+(t == null ? "" : ": "+t)); - } - -} diff --git a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/java/org/scribble/editor/tools/simulation/JUnitSimulatorMain.java b/tools/eclipse/plugins/org.scribble.editor.tools/src/main/java/org/scribble/editor/tools/simulation/JUnitSimulatorMain.java deleted file mode 100644 index b92de4f81..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/java/org/scribble/editor/tools/simulation/JUnitSimulatorMain.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * Yolassu may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.editor.tools.simulation; - -import org.scribble.resources.DirectoryResourceLocator; -import org.scribble.trace.simulation.junit.JUnitSimulator; - -/** - * This class provides the Eclipse extended version of the JUnit based - * simulator. - */ -public class JUnitSimulatorMain extends JUnitSimulator { - - public static final String UPDATED_XML_NOTIFICATION = "UPDATED XML"; - - /** - * This main method is invoked with the path of a single - * trace file, or a folder containing zero or more trace - * files. - * - * @param args The path - */ - public static void main(String args[]) { - if (args.length != 2) { - System.err.println("Usage: JUnitSimulator path junitXmlFile"); - System.exit(1); - } - - if (System.getProperty("MODULE_PATH") == null) { - System.err.println("'MODULE_PATH' envionment parameter has not been set"); - System.exit(2); - } - - JUnitSimulatorMain sim=new JUnitSimulatorMain(); - - try { - DirectoryResourceLocator locator=new DirectoryResourceLocator(System.getProperty("MODULE_PATH")); - - sim.setResourceLocator(locator); - - sim.simulate(args[0], args[1]); - - synchronized (sim) { - sim.wait(2000); - } - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } -} diff --git a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/java/org/scribble/editor/tools/simulation/SimulationLaunchConfigurationConstants.java b/tools/eclipse/plugins/org.scribble.editor.tools/src/main/java/org/scribble/editor/tools/simulation/SimulationLaunchConfigurationConstants.java deleted file mode 100644 index 0dbbf733c..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/java/org/scribble/editor/tools/simulation/SimulationLaunchConfigurationConstants.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.editor.tools.simulation; - -/** - * This interface defines the constants for the scenario test - * launch configuration. - */ -public interface SimulationLaunchConfigurationConstants { - - public static final String ATTR_PROJECT_NAME="project"; - - public static final String ATTR_PATH="path"; - - public static final String LAUNCH_CONFIG_TYPE= - "org.scribble.editor.tools.simulation.SimulationLauncher"; -} diff --git a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/java/org/scribble/editor/tools/simulation/SimulationLauncher.java b/tools/eclipse/plugins/org.scribble.editor.tools/src/main/java/org/scribble/editor/tools/simulation/SimulationLauncher.java deleted file mode 100644 index bb825a5e9..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/java/org/scribble/editor/tools/simulation/SimulationLauncher.java +++ /dev/null @@ -1,400 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.editor.tools.simulation; - -import java.io.File; -import java.text.MessageFormat; -import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Platform; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.ILaunch; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.model.IProcess; -import org.eclipse.jdt.launching.AbstractJavaLaunchConfigurationDelegate; -import org.eclipse.jdt.launching.ExecutionArguments; -import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants; -import org.eclipse.jdt.launching.IVMInstall; -import org.eclipse.jdt.launching.IVMRunner; -import org.eclipse.jdt.launching.VMRunnerConfiguration; -import org.eclipse.osgi.util.ManifestElement; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.part.FileEditorInput; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.resources.IFile; -import org.osgi.framework.Bundle; -import org.osgi.framework.Constants; -import org.scribble.editor.tools.osgi.Activator; -import org.scribble.trace.simulation.junit.JUnitSimulator; - -/** - * This class is responsible for launching a scenario test against - * a test scenario. - */ -public class SimulationLauncher - extends AbstractJavaLaunchConfigurationDelegate { - - private static final String JUNIT_RESULT_EDITOR = "org.eclipse.jdt.junit.JUnitResultEditor"; - - private static Logger logger = Logger.getLogger(SimulationLauncher.class.getName()); - - private String _xmlFile=null; - - /** - * This is the default constructor. - * - */ - public SimulationLauncher() { - } - - /** - * This method launches the scenario test. - * - * @param configuration The launch configuration - * @param mode The mode (run or debug) - * @param launch The launch object - * @param monitor The optional progress monitor - */ - public void launch(ILaunchConfiguration configuration, - String mode, ILaunch launch, IProgressMonitor monitor) - throws CoreException { - if (monitor == null) { - monitor = new NullProgressMonitor(); - } - - monitor.beginTask(MessageFormat.format("{0}...", new Object[]{configuration.getName()}), 3); //$NON-NLS-1$ - // check for cancellation - if (monitor.isCanceled()) { - return; - } - - monitor.subTask("Verifying launch configuration...."); - - String mainTypeName = JUnitSimulatorMain.class.getName(); - - IVMInstall vm = verifyVMInstall(configuration); - - IVMRunner runner = vm.getVMRunner(mode); - if (runner == null) { - abort("VM runner does not exist", - null, IJavaLaunchConfigurationConstants.ERR_VM_RUNNER_DOES_NOT_EXIST); //$NON-NLS-1$ - } - - File workingDir = verifyWorkingDirectory(configuration); - String workingDirName = null; - if (workingDir != null) { - workingDirName = workingDir.getAbsolutePath(); - } - - // Environment variables - String[] envp= DebugPlugin.getDefault().getLaunchManager().getEnvironment(configuration); - - String projname = configuration.getAttribute( - SimulationLaunchConfigurationConstants.ATTR_PROJECT_NAME, ""); - - IProject project= - ResourcesPlugin.getWorkspace().getRoot().getProject(projname); - - // Program & VM args - String simulationPath=configuration.getAttribute(SimulationLaunchConfigurationConstants.ATTR_PATH, - ""); - - IResource res=project.findMember(simulationPath); - - _xmlFile = project.getLocation().toOSString()+java.io.File.separator+".trace" - +java.io.File.separator+"results"+System.currentTimeMillis()+".xml"; - - // Initialize the file - try { - JUnitSimulator.initResultsFile(new java.io.File(_xmlFile)); - } catch (Exception e) { - logger.log(Level.SEVERE, "Failed to initialize simulator trace", e); - } - - String pgmArgs="\""+res.getLocation().toOSString()+"\" \""+_xmlFile+"\""; - - logger.fine("Launching scenario test with args: "+pgmArgs); - - String vmArgs = getVMArguments(configuration); - vmArgs += " -DMODULE_PATH="+project.getLocation().toOSString(); - - ExecutionArguments execArgs = new ExecutionArguments(vmArgs, pgmArgs); - - // VM-specific attributes - Map vmAttributesMap = getVMSpecificAttributesMap(configuration); - - // Classpath - String[] classpath = getClasspath(configuration); - - // Create VM config - VMRunnerConfiguration runConfig = new VMRunnerConfiguration(mainTypeName, classpath); - runConfig.setProgramArguments(execArgs.getProgramArgumentsArray()); - runConfig.setEnvironment(envp); - runConfig.setVMArguments(execArgs.getVMArgumentsArray()); - runConfig.setWorkingDirectory(workingDirName); - runConfig.setVMSpecificAttributesMap(vmAttributesMap); - - // Bootpath - runConfig.setBootClassPath(getBootpath(configuration)); - - // check for cancellation - if (monitor.isCanceled()) { - return; - } - - // stop in main - prepareStopInMain(configuration); - - // done the verification phase - monitor.worked(1); - - // Launch the configuration - 1 unit of work - runner.run(runConfig, launch, monitor); - - IProcess[] processes=launch.getProcesses(); - if (processes.length > 0) { - final IFile file=ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(new org.eclipse.core.runtime.Path(_xmlFile)); - - @SuppressWarnings("restriction") - Display display=org.eclipse.ui.internal.Workbench.getInstance().getDisplay(); - - while (!processes[0].isTerminated()) { - try { - synchronized (this) { - wait(1000); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - display.syncExec(new Runnable() { - @SuppressWarnings("restriction") - public void run() { - try { - file.refreshLocal(0, null); - - org.eclipse.ui.internal.Workbench.getInstance().getActiveWorkbenchWindow().getActivePage(). - openEditor(new FileEditorInput(file), - JUNIT_RESULT_EDITOR); - } catch (Throwable t) { - t.printStackTrace(); - } - } - }); - - file.delete(true, null); - } - - // check for cancellation - if (monitor.isCanceled()) { - return; - } - - monitor.done(); - } - - /** - * This method derives the classpath required to run the - * ScenarioTester utility. - * - * @param configuration The launch configuation - * @return The list of classpath entries - */ - public String[] getClasspath(ILaunchConfiguration configuration) { - String[] ret=null; - java.util.Vector classpathEntries=new java.util.Vector(); - - Bundle bundle=Platform.getBundle(Activator.PLUGIN_ID); - - buildClassPath(bundle, classpathEntries); - - ret = new String[classpathEntries.size()]; - classpathEntries.copyInto(ret); - - if (logger.isLoggable(Level.FINEST)) { - logger.finest("Simulation Classpath:"); - for (int i=0; i < ret.length; i++) { - logger.finest(" ["+i+"] "+ret[i]); - } - } - - return(ret); - } - - protected void buildClassPath(Bundle bundle, java.util.List entries) { - java.net.URL installLocation= bundle.getEntry("/"); - java.net.URL local= null; - try { - local= Platform.asLocalURL(installLocation); - } catch (java.io.IOException e) { - e.printStackTrace(); - } - - String baseLocation = local.getFile(); - - try { - String projectClassPath=getProjectClasspath(baseLocation); - - // TODO: If classpath has been set, but the items are not available, - // then resort to the .classpath file. Issue - how to resolve variables? - - String requires = (String)bundle.getHeaders().get(Constants.BUNDLE_CLASSPATH); - ManifestElement[] elements = ManifestElement.parseHeader(Constants.BUNDLE_CLASSPATH, requires); - - for (int i=0; elements != null && i < elements.length; i++) { - - String path=baseLocation+elements[i].getValue(); - - // Check if path is for a Jar and that the - // file exists - if not see if a classes - // directory exists - if (path.endsWith(".jar")) { - - if ((new File(path)).exists() == false) { - String jarPath=null; - - // Check if .classpath file exists - may be running in test workbench - // and need to access local maven repo - if (projectClassPath != null) { - jarPath = getJarPath(projectClassPath, elements[i].getValue()); - } - - if (jarPath != null) { - path = jarPath; - } else { - if ((new File(baseLocation+"classes")).exists()) { - path = baseLocation+"classes"+File.separatorChar+elements[i].getValue(); - } else if ((new File(baseLocation+"target"+File.separatorChar+"classes")).exists()) { - path = baseLocation+"target"+File.separatorChar+"classes"+File.separatorChar+elements[i].getValue(); - } else if ((new File(baseLocation+"bin")).exists()) { - path = baseLocation+"bin"+File.separatorChar+elements[i].getValue(); - } else { - path = baseLocation; - } - } - } - } else if (elements[i].getValue().equals(".")) { - if ((new File(baseLocation+"classes")).exists()) { - path = baseLocation+"classes"; - } else if ((new File(baseLocation+"target"+File.separatorChar+"classes")).exists()) { - path = baseLocation+"target"+File.separatorChar+"classes"; - } else if ((new File(baseLocation+"bin")).exists()) { - path = baseLocation+"bin"; - } else { - path = baseLocation; - } - } - - if (entries.contains(path) == false) { - if (logger.isLoggable(Level.FINE)) { - logger.fine("Adding classpath entry '"+ - path+"'"); - } - entries.add(path); - - if (elements[i].getValue().equals(".")) { - if ((new File(baseLocation+"classes")).exists()) { - path = baseLocation+"classes"; - - entries.add(path); - } - } - } - } - - if (elements == null) { - if (logger.isLoggable(Level.FINE)) { - logger.fine("Adding classpath entry '"+ - baseLocation+"'"); - } - - if ((new File(baseLocation+"classes")).exists()) { - entries.add(baseLocation+"classes"); - } else if ((new File(baseLocation+"target"+File.separatorChar+"classes")).exists()) { - entries.add(baseLocation+"target"+File.separatorChar+"classes"); - } else if ((new File(baseLocation+"bin")).exists()) { - entries.add(baseLocation+"bin"); - } else { - - entries.add(baseLocation); - } - } - - } catch(Exception e) { - logger.severe("Failed to construct classpath: "+e); - e.printStackTrace(); - } - } - - protected String getProjectClasspath(String baseLocation) { - String ret=null; - - File cppath=new File(baseLocation+".classpath"); - if (cppath.exists()) { - try { - java.io.FileInputStream fis=new java.io.FileInputStream(cppath); - - byte[] b=new byte[fis.available()]; - - fis.read(b); - - fis.close(); - - ret = new String(b); - } catch(Exception e) { - e.printStackTrace(); - } - } - - return(ret); - } - - protected String getJarPath(String projectClassPath, String element) { - String ret=null; - - // Extract the jar name (without preceding folders or the file suffix) - int startindex=element.lastIndexOf('/'); - int endindex=element.lastIndexOf('.'); - - String jarName=element.substring(startindex+1, endindex); - - String locator="/"+jarName+"/"; - - int index=projectClassPath.indexOf(locator); - - if (index != -1) { - int startpos=index; - for (; projectClassPath.charAt(startpos) != '"'; startpos--); - - int endpos=projectClassPath.indexOf('"', index); - - String newpath=projectClassPath.substring(startpos+1, endpos); - - ret=newpath.replaceAll("M2_REPO", System.getenv("HOME")+"/.m2/repository"); - } - - return(ret); - } -} \ No newline at end of file diff --git a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/java/org/scribble/editor/tools/simulation/SimulationLauncherShortcut.java b/tools/eclipse/plugins/org.scribble.editor.tools/src/main/java/org/scribble/editor/tools/simulation/SimulationLauncherShortcut.java deleted file mode 100644 index bd6903616..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/java/org/scribble/editor/tools/simulation/SimulationLauncherShortcut.java +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.editor.tools.simulation; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationType; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.debug.core.ILaunchManager; -import org.eclipse.debug.ui.DebugUITools; -import org.eclipse.debug.ui.IDebugModelPresentation; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.window.Window; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.dialogs.ElementListSelectionDialog; - -/** - * This class is responsible for launching a trace simulation. - */ -public class SimulationLauncherShortcut implements org.eclipse.debug.ui.ILaunchShortcut { - - /** - * {@inheritDoc} - */ - public void launch(IEditorPart editor, String mode) { - } - - /** - * {@inheritDoc} - */ - public void launch(ISelection selection, String mode) { - if (selection instanceof IStructuredSelection) { - IStructuredSelection ss = (IStructuredSelection) selection; - if (ss.size() == 1) { - Object element = ss.getFirstElement(); - if (element instanceof IFile || element instanceof IFolder - || element instanceof IProject) { - IResource res=(IResource)element; - ILaunchConfiguration configuration = getConfiguration(res); - if (configuration != null) { - DebugUITools.launch(configuration, mode); - } - } - } - } - } - - /** - * Returns a MIDI configuration to use for the given file or - * null to cancel. Creates a new configuration - * if required. - * - * @param res The resource - * @return associated launch configuration or null - */ - private ILaunchConfiguration getConfiguration(IResource res) { - List candiates = new ArrayList(); - try { - ILaunchConfiguration[] configurations = getLaunchManager().getLaunchConfigurations(getLaunchType()); - for (int i = 0; i < configurations.length; i++) { - ILaunchConfiguration configuration = configurations[i]; - IResource[] resources = configuration.getMappedResources(); - if (resources != null && resources.length == 1 && - resources[0].equals(res)) { - candiates.add(configuration); - } - } - } catch (CoreException e) { - } - if (!candiates.isEmpty()) { - return chooseConfiguration(candiates); - } - return newConfiguration(res); - } - - /** - * Returns the MIDI launch configuration type. - * - * @return the MIDI launch configuration type - */ - private ILaunchConfigurationType getLaunchType() { - ILaunchManager manager = getLaunchManager(); - ILaunchConfigurationType type = manager.getLaunchConfigurationType(SimulationLaunchConfigurationConstants.LAUNCH_CONFIG_TYPE); - return type; - } - - /** - * Returns the launch manager. - * - * @return launch manager - */ - private ILaunchManager getLaunchManager() { - ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager(); - return manager; - } - - /** - * Returns a configuration from the given collection of configurations that should be launched, - * or null to cancel. - * - * @param configList list of configurations to choose from - * @return configuration to launch or null to cancel - */ - private ILaunchConfiguration chooseConfiguration(List configList) { - if (configList.size() == 1) { - return (ILaunchConfiguration) configList.get(0); - } - IDebugModelPresentation labelProvider = DebugUITools.newDebugModelPresentation(); - - ElementListSelectionDialog dialog= new ElementListSelectionDialog(Display.getCurrent().getActiveShell(), - labelProvider); - dialog.setElements(configList.toArray()); - dialog.setTitle("Select Configuraiton"); //$NON-NLS-1$ - dialog.setMessage("&Select an existing configuration:"); //$NON-NLS-1$ - dialog.setMultipleSelection(false); - int result = dialog.open(); - labelProvider.dispose(); - if (result == Window.OK) { - return (ILaunchConfiguration) dialog.getFirstResult(); - } - return null; - } - - /** - * Creates and returns a new simulation launch configuration for the - * given resource. - * - * @param res The resource - * @return The new launch configuration - */ - private ILaunchConfiguration newConfiguration(IResource res) { - ILaunchConfigurationType type = getLaunchType(); - try { - ILaunchConfigurationWorkingCopy workingCopy = type.newInstance(null, - getLaunchManager().generateLaunchConfigurationName( - "Simulate [" + res.getProject().getName() + "] " + res.getName())); //$NON-NLS-1$ //$NON-NLS-2$ - workingCopy.setAttribute(SimulationLaunchConfigurationConstants.ATTR_PROJECT_NAME, - res.getProject().getName()); - workingCopy.setAttribute(SimulationLaunchConfigurationConstants.ATTR_PATH, - res.getProjectRelativePath().toString()); - workingCopy.setMappedResources(new IResource[]{res}); - return workingCopy.doSave(); - } catch (CoreException e) { - e.printStackTrace(); - } - return null; - } -} \ No newline at end of file diff --git a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/java/org/scribble/editor/tools/simulation/SimulationMainTab.java b/tools/eclipse/plugins/org.scribble.editor.tools/src/main/java/org/scribble/editor/tools/simulation/SimulationMainTab.java deleted file mode 100644 index ae39a76dd..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/java/org/scribble/editor/tools/simulation/SimulationMainTab.java +++ /dev/null @@ -1,512 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * Yolassu may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.editor.tools.simulation; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.debug.ui.AbstractLaunchConfigurationTab; -import org.eclipse.debug.ui.ILaunchConfigurationTab; -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.jface.window.Window; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.dialogs.ElementListSelectionDialog; - -/** - * This class represents the main tab within the tab group - * associated with the simulation launch configuration. - */ -public class SimulationMainTab extends AbstractLaunchConfigurationTab { - - private static final String TRACE_EXTENSION = "trace"; - private Label _projectLabel=null; - private Text _project=null; - private Button _projectButton=null; - private Label _pathLabel=null; - private Text _path=null; - private Button _pathButton=null; - - /** - * @see ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite) - */ - public void createControl(Composite parent) { - Composite comp = new Composite(parent, SWT.NONE); - setControl(comp); - - GridLayout topLayout = new GridLayout(); - topLayout.numColumns= 3; - comp.setLayout(topLayout); - - Label label = new Label(comp, SWT.NONE); - GridData gd = new GridData(); - gd.horizontalSpan = 3; - label.setLayoutData(gd); - - createSimulationSection(comp); - - label = new Label(comp, SWT.NONE); - gd = new GridData(); - gd.horizontalSpan = 3; - label.setLayoutData(gd); - - Dialog.applyDialogFont(comp); - validatePage(); - } - - /** - * This method creates the GUI components for the - * simulation tab. - * - * @param comp The composite - */ - protected void createSimulationSection(Composite comp) { - GridData gd = new GridData(); - gd.horizontalSpan = 3; - - _projectLabel = new Label(comp, SWT.NONE); - _projectLabel.setText("Project"); - gd= new GridData(); - gd.horizontalIndent = 25; - _projectLabel.setLayoutData(gd); - - _project= new Text(comp, SWT.SINGLE | SWT.BORDER); - _project.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - _project.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent evt) { - validatePage(); - updateLaunchConfigurationDialog(); - _pathButton.setEnabled(_project.getText().length() > 0); - } - }); - - _projectButton = new Button(comp, SWT.PUSH); - _projectButton.setText("Browse"); - _projectButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent evt) { - handleProjectButtonSelected(); - } - }); - setButtonGridData(_projectButton); - - _pathLabel = new Label(comp, SWT.NONE); - gd = new GridData(); - gd.horizontalIndent = 25; - _pathLabel.setLayoutData(gd); - _pathLabel.setText("Simulation Path"); - - _path = new Text(comp, SWT.SINGLE | SWT.BORDER); - _path.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - _path.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent evt) { - validatePage(); - updateLaunchConfigurationDialog(); - } - }); - - _pathButton = new Button(comp, SWT.PUSH); - _pathButton.setEnabled(_project.getText().length() > 0); - _pathButton.setText("Search"); - _pathButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent evt) { - handleSearchButtonSelected(); - } - }); - setButtonGridData(_pathButton); - } - - protected static Image createImage(String path) { - return null; - } - - - /** - * @see ILaunchConfigurationTab#initializeFrom(ILaunchConfiguration) - */ - public void initializeFrom(ILaunchConfiguration config) { - String projectName= ""; - String scenario= ""; - - try { - projectName = config.getAttribute(SimulationLaunchConfigurationConstants.ATTR_PROJECT_NAME, ""); //$NON-NLS-1$ - } catch (CoreException ce) { - } - _project.setText(projectName); - - try { - scenario = config.getAttribute(SimulationLaunchConfigurationConstants.ATTR_PATH, ""); //$NON-NLS-1$ - } catch (CoreException ce) { - } - _path.setText(scenario); - } - - /** - * @see ILaunchConfigurationTab#performApply(ILaunchConfigurationWorkingCopy) - */ - public void performApply(ILaunchConfigurationWorkingCopy config) { - } - - /** - * @see ILaunchConfigurationTab#dispose() - */ - public void dispose() { - super.dispose(); - } - - /** - * @see AbstractLaunchConfigurationTab#getImage() - */ - public Image getImage() { - return(null); - } - - /** - * This method sets the grid data for the button. - * - * @param button The button - */ - protected void setButtonGridData(Button button) { - GridData gridData= new GridData(); - button.setLayoutData(gridData); - //SWTUtil.setButtonDimensionHint(button); - } - - /** - * Show a dialog that lists all trace files within the - * selected project - */ - protected void handleSearchButtonSelected() { - - IProject project = getProject(); - - ILabelProvider labelProvider=new LabelProvider() { - public String getText(Object obj) { - String ret=""; - if (obj instanceof IResource) { - String filename=((IResource)obj).getName(); - if (filename.endsWith(TRACE_EXTENSION)) { - filename = filename.substring(0, filename.length()- - TRACE_EXTENSION.length()-1); - } - ret = filename+" ["+ - ((IResource)obj).getParent(). - getProjectRelativePath()+"]"; - } - return(ret); - } - }; - - IResource[] traces=null; - - if (project.exists() == false) { - traces = new IResource[0]; - } else { - traces = getTraces(project); - } - - ElementListSelectionDialog dialog= new ElementListSelectionDialog(getShell(), labelProvider); - dialog.setTitle("Traces"); - dialog.setMessage("Select the relevant trace"); - dialog.setElements(traces); - - if (dialog.open() == Window.OK) { - IResource file=(IResource)dialog.getFirstResult(); - _path.setText(file.getProjectRelativePath().toString()); - } - } - - /** - * This method returns the list of scenario resource files within - * the supplied project. - * - * @param project The project - * @return The list of scenario resource files - */ - protected IResource[] getTraces(IProject project) { - IResource[] ret=null; - final java.util.Vector list=new java.util.Vector(); - - try { - project.accept(new org.eclipse.core.resources.IResourceVisitor() { - public boolean visit(IResource res) { - - if (res.getFileExtension() != null && - res.getFileExtension().equals(TRACE_EXTENSION)) { - list.add(res); - } - - return(true); - } - }); - - ret = new IResource[list.size()]; - list.copyInto(ret); - - } catch(Exception e) { - e.printStackTrace(); - } - - return(ret); - } - - /** - * Show a dialog that lets the user select a project. This in turn provides - * context for the main type, allowing the user to key a main type name, or - * constraining the search for main types to the specified project. - */ - protected void handleProjectButtonSelected() { - IProject project = chooseProject(); - if (project == null) { - return; - } - - String projectName = project.getName(); - _project.setText(projectName); - } - - /** - * Realize a Java Project selection dialog and return the first selected project, - * or null if there was none. - */ - protected IProject chooseProject() { - IProject[] projects; - try { - projects= getWorkspaceRoot().getProjects(); - } catch (Exception e) { - projects= new IProject[0]; - } - - ILabelProvider labelProvider=new LabelProvider() { - public String getText(Object obj) { - String ret=""; - if (obj instanceof IResource) { - ret = ((IResource)obj).getName(); - } - return(ret); - } - }; - - ElementListSelectionDialog dialog= new ElementListSelectionDialog(getShell(), labelProvider); - dialog.setTitle("Projects"); - dialog.setMessage("Select the relevant project"); - dialog.setElements(projects); - - IProject project = getProject(); - if (project != null) { - dialog.setInitialSelections(new Object[] { project }); - } - if (dialog.open() == Window.OK) { - return (IProject) dialog.getFirstResult(); - } - return null; - } - - /** - * Return the IProject corresponding to the project name in the project name - * text field, or null if the text does not match a project name. - */ - protected IProject getProject() { - String projectName = _project.getText().trim(); - if (projectName.length() < 1) { - return null; - } - return(getWorkspaceRoot().getProject(projectName)); - } - - /** - * Convenience method to get the workspace root. - */ - private IWorkspaceRoot getWorkspaceRoot() { - return ResourcesPlugin.getWorkspace().getRoot(); - } - - /** - * @see ILaunchConfigurationTab#isValid(ILaunchConfiguration) - */ - public boolean isValid(ILaunchConfiguration config) { - return getErrorMessage() == null; - } - - /** - * This method validates the page. - * - */ - private void validatePage() { - setErrorMessage(null); - setMessage(null); - - String projectName = _project.getText().trim(); - if (projectName.length() == 0) { - setErrorMessage("Project name not specified"); - return; - } - - IProject project = getWorkspaceRoot().getProject(projectName); - if (!project.exists()) { - setErrorMessage("Project '"+projectName+"' does not exist"); - return; - } - - try { - String traceName = _path.getText().trim(); - if (traceName.length() == 0) { - setErrorMessage("Trace has not been defined"); - return; - } - IResource resource = project.findMember(traceName); - if (resource == null) { - setErrorMessage("Could not find trace '"+traceName+"'"); - } else { - - // TODO: Check is valid trace model - } - } catch (Exception e) { - } - } - - /** - * @see ILaunchConfigurationTab#setDefaults(ILaunchConfigurationWorkingCopy) - */ - public void setDefaults(ILaunchConfigurationWorkingCopy config) { - - IResource resource = getContext(); - if (resource != null) { - initializeProject(resource, config); - } else { - config.setAttribute(SimulationLaunchConfigurationConstants.ATTR_PROJECT_NAME, ""); - config.setAttribute(SimulationLaunchConfigurationConstants.ATTR_PATH, ""); - } - initializeTestAttributes(resource, config); - } - - /** - * This method identifies the context associated with the - * service test. - * - * @return The context resource - */ - protected IResource getContext() { - IResource ret=null; - IWorkbenchPage page = - org.eclipse.ui.PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); - - if (page != null) { - ISelection selection = page.getSelection(); - if (selection instanceof IStructuredSelection) { - IStructuredSelection ss = (IStructuredSelection)selection; - if (!ss.isEmpty()) { - Object obj = ss.getFirstElement(); - if (obj instanceof IResource) { - ret = (IResource)obj; - } - } - } - - if (ret == null) { - IEditorPart part = page.getActiveEditor(); - if (part != null) { - IEditorInput input = part.getEditorInput(); - ret =(IResource)input.getAdapter(IResource.class); - } - } - } - - return(ret); - } - - /** - * This method initializes the project details. - * - * @param resource The resource - * @param config The configuration - */ - protected void initializeProject(IResource resource, ILaunchConfigurationWorkingCopy config) { - IProject project = resource.getProject(); - String name = null; - if (project != null && project.exists()) { - name = project.getName(); - } - config.setAttribute(SimulationLaunchConfigurationConstants.ATTR_PROJECT_NAME, name); - } - - /** - * This method initializes the trace details. - * - * @param resource The selected resource - * @param config The configuration - */ - private void initializeTestAttributes(IResource resource, ILaunchConfigurationWorkingCopy config) { - if (resource != null && (resource.getType() == IResource.FOLDER || - (resource.getType() == IResource.FILE && - resource.getFileExtension().equals(TRACE_EXTENSION)))) { - - config.setAttribute(SimulationLaunchConfigurationConstants.ATTR_PATH, - resource.getProjectRelativePath().toString()); - - initializeName(config, resource.getName()); - } - } - - /** - * This method initializes the launch configuration name. - * - * @param config The configuration - * @param name The name - */ - private void initializeName(ILaunchConfigurationWorkingCopy config, String name) { - if (name == null) { - name= ""; - } - if (name.length() > 0) { - - int index = name.lastIndexOf('.'); - if (index > 0) { - name = name.substring(0, index); - } - name= getLaunchConfigurationDialog().generateName(name); - config.rename(name); - } - } - - /** - * @see ILaunchConfigurationTab#getName() - */ - public String getName() { - return("Simulation"); - } -} diff --git a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/java/org/scribble/editor/tools/simulation/SimulationTabGroup.java b/tools/eclipse/plugins/org.scribble.editor.tools/src/main/java/org/scribble/editor/tools/simulation/SimulationTabGroup.java deleted file mode 100644 index 4809c0e57..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/java/org/scribble/editor/tools/simulation/SimulationTabGroup.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * Yolassu may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.editor.tools.simulation; - -import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup; -import org.eclipse.debug.ui.CommonTab; -import org.eclipse.debug.ui.ILaunchConfigurationDialog; -import org.eclipse.debug.ui.ILaunchConfigurationTab; - -/** - * This class represents the UI tab group for the simulation - * launcher. - */ -public class SimulationTabGroup extends - AbstractLaunchConfigurationTabGroup { - - /** - * The default constructor for the scenario type tab group. - */ - public SimulationTabGroup() { - } - - /** - * This method creates the tabs for the scenario test launch - * configuration. - * - * @param dialog The launch configuration dialog - * @param mode The mode - */ - public void createTabs(ILaunchConfigurationDialog dialog, String mode) { - ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] { - //new SimulationMainTab(), - new CommonTab() - }; - setTabs(tabs); - } -} diff --git a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/java/org/scribble/editor/tools/ui/NewProtocolWizard.java b/tools/eclipse/plugins/org.scribble.editor.tools/src/main/java/org/scribble/editor/tools/ui/NewProtocolWizard.java deleted file mode 100644 index 8ab653287..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/java/org/scribble/editor/tools/ui/NewProtocolWizard.java +++ /dev/null @@ -1,352 +0,0 @@ -/* - * Copyright 2009 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.editor.tools.ui; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.wizard.Wizard; -import org.eclipse.ui.INewWizard; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.actions.WorkspaceModifyOperation; -import org.eclipse.ui.dialogs.WizardNewFileCreationPage; -import org.eclipse.ui.part.FileEditorInput; -import org.eclipse.ui.part.ISetSelectionTarget; -import org.scribble.parser.ProtocolDefinitions; - -/** - * This class provides the wizard responsible for creating - * new Protocol Global definitions. - */ -public class NewProtocolWizard extends Wizard implements INewWizard { - - /** - * Located reference separator. - */ - public static final String LOCATED_REFERENCE_SEPARATOR="@"; - - private IWorkbench _workbench=null; - private IStructuredSelection _selection=null; - private ScribbleNewFileCreationPage _newFileCreationPage=null; - - /** - * This method initializes the wizard. - * - * @param workbench The workbench - * @param selection The selected resource - */ - public void init(IWorkbench workbench, IStructuredSelection selection) { - _workbench = workbench; - _selection = selection; - setWindowTitle("New Scribble Wizard"); - } - - /** - * {@inheritDoc} - */ - public boolean performFinish() { - try { - // Remember the file. - // - final IFile modelFile = getModelFile(); - - // Do the work within an operation. - // - WorkspaceModifyOperation operation = - new WorkspaceModifyOperation() { - protected void execute(IProgressMonitor progressMonitor) { - try { - // Identify the model reference from the resource - org.eclipse.core.runtime.IPath path=modelFile.getFullPath(); - org.eclipse.core.runtime.IPath fqnPath=path.removeFirstSegments(1); - - String[] segments=fqnPath.segments(); - - String local=segments[segments.length-1]; - - String namespace=""; - - for (int i=0; i < segments.length-1; i++) { - if (i > 0) { - namespace += "."; - } - namespace += segments[i]; - } - - //String type=null; - String located=null; - - if (local != null) { - int nindex=local.lastIndexOf('.'); - if (nindex != -1) { - //type = local.substring(nindex+1); - local = local.substring(0, nindex); - - int pindex=local.lastIndexOf(LOCATED_REFERENCE_SEPARATOR); - if (pindex != -1) { - located = local.substring(pindex+1); - local = local.substring(0, pindex); - } - } - } - - String name=namespace; - - if (name.length() > 0) { - name += '.'; - } - - name += local; - - if (located != null) { - name += LOCATED_REFERENCE_SEPARATOR + located; - } - - StringBuffer text=new StringBuffer("module "+namespace+"."+local+";\r\n\r\n"); - - if (located == null) { - text.append("global protocol ProtocolName(role Role1"); - } else { - text.append("local protocol ProtocolName at "+located+"(role "+located); - } - - text.append(", role Role2) {\r\n}\r\n"); - - java.io.ByteArrayInputStream bis=new java.io.ByteArrayInputStream(text.toString().getBytes()); - - modelFile.create(bis, true, progressMonitor); - - bis.close(); - - } catch (Exception e) { - org.scribble.editor.tools.osgi.Activator.logError(e.getMessage(), e); - } finally { - progressMonitor.done(); - } - } - }; - - getContainer().run(false, false, operation); - - // Select the new file resource in the current view. - // - IWorkbenchWindow workbenchWindow = - _workbench.getActiveWorkbenchWindow(); - IWorkbenchPage page = workbenchWindow.getActivePage(); - final IWorkbenchPart activePart = page.getActivePart(); - if (activePart instanceof ISetSelectionTarget) { - final ISelection targetSelection = new StructuredSelection(modelFile); - getShell().getDisplay().asyncExec( - new Runnable() { - public void run() { - ((ISetSelectionTarget)activePart).selectReveal(targetSelection); - } - }); - } - - // Open an editor on the new file. - // - try { - org.eclipse.ui.IEditorDescriptor ed= - _workbench.getEditorRegistry().getDefaultEditor(modelFile.getFullPath().toString()); - - if (ed != null) { - page.openEditor(new FileEditorInput(modelFile), - ed.getId()); - } - } catch (PartInitException exception) { - MessageDialog.openError(workbenchWindow.getShell(), - "Open Error", exception.getMessage()); - return false; - } - - return true; - } catch (Exception e) { - e.printStackTrace(); - org.scribble.editor.tools.osgi.Activator.logError(e.getMessage(), e); - return false; - } - } - - /** - * This method returns the initial description. - * - * @return The initial description - */ - protected String getInitialDescription() { - String ret=""; - - // TODO: Add default description - - return (ret); - } - - /** - * Get the file from the page. - * - * - * @generated - * @return The model file - */ - public IFile getModelFile() { - return _newFileCreationPage.getModelFile(); - } - - /** - * The framework calls this to create the contents of the wizard. - * - * - * @generated - */ - public void addPages() { - - _newFileCreationPage = new ScribbleNewFileCreationPage("Whatever", _selection); - _newFileCreationPage.setTitle("Protocol"); - _newFileCreationPage.setDescription("Create a new Protocol"); - - addPage(_newFileCreationPage); - - initFileCreationPage(); - } - - /** - * {@inheritDoc} - */ - protected void initFileCreationPage() { - String defaultModelBaseFilename = "My"; - - String defaultModelFilenameExtension = ProtocolDefinitions.PROTOCOL_EXTENSION; - String modelFilename = defaultModelBaseFilename + "." + defaultModelFilenameExtension; - - // Create a page, set the title, and the initial model file name. - // - _newFileCreationPage.setFileName(modelFilename); - - // Try and get the resource selection to determine a current directory for the file dialog. - // - if (_selection != null && !_selection.isEmpty()) { - // Get the resource... - // - Object selectedElement = _selection.iterator().next(); - if (selectedElement instanceof IResource) { - // Get the resource parent, if its a file. - // - IResource selectedResource = (IResource)selectedElement; - if (selectedResource.getType() == IResource.FILE) { - selectedResource = selectedResource.getParent(); - } - - // This gives us a directory... - // - if (selectedResource instanceof IFolder || selectedResource instanceof IProject) { - // Set this for the container. - // - _newFileCreationPage.setContainerFullPath(selectedResource.getFullPath()); - - // Make up a unique new name here. - // - for (int i = 1; ((IContainer)selectedResource).findMember(modelFilename) != null; ++i) { - modelFilename = defaultModelBaseFilename + i + "." + defaultModelFilenameExtension; - } - _newFileCreationPage.setFileName(modelFilename); - } - } - } - } - - /** - * This is the one page of the wizard. - * - * - * @generated - */ - public class ScribbleNewFileCreationPage extends WizardNewFileCreationPage { - /** - * Remember the model file. - * - * - * @generated - */ - private IFile _modelFile; - - /** - * Constructor. - * - * @param pageId The page id - * @param selection The selection - */ - public ScribbleNewFileCreationPage(String pageId, IStructuredSelection selection) { - super(pageId, selection); - } - - /** - * The framework calls this to see if the file is correct. - * - * @return Whether the page is valid - */ - protected boolean validatePage() { - if (super.validatePage()) { - String requiredExt = ProtocolDefinitions.PROTOCOL_EXTENSION; - - String enteredExt = new Path(getFileName()).getFileExtension(); - if (enteredExt == null || !enteredExt.equals(requiredExt)) { - setErrorMessage("The filename must end in: "+requiredExt); - return false; - } else { - return true; - } - } else { - return false; - } - } - - /** - * Store the dialog field settings upon completion. - * - * @return Whether finished - */ - public boolean performFinish() { - _modelFile = getModelFile(); - return true; - } - - /** - * Return the model file. - * - * @return The model file - */ - public IFile getModelFile() { - return _modelFile == null - ? ResourcesPlugin.getWorkspace().getRoot().getFile(getContainerFullPath().append(getFileName())) - : _modelFile; - } - } - -} diff --git a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/java/org/scribble/editor/tools/validator/ProtocolValidationManager.java b/tools/eclipse/plugins/org.scribble.editor.tools/src/main/java/org/scribble/editor/tools/validator/ProtocolValidationManager.java deleted file mode 100644 index 2a8cc9736..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/java/org/scribble/editor/tools/validator/ProtocolValidationManager.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright 2009-10 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.editor.tools.validator; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.scribble.editor.tools.logger.EclipseIssueLogger; -import org.scribble.editor.tools.osgi.Activator; -import org.scribble.model.Module; -import org.scribble.parser.ProtocolModuleLoader; -import org.scribble.parser.ProtocolParser; -import org.scribble.logging.ConsoleIssueLogger; -import org.scribble.context.DefaultModuleContext; -import org.scribble.resources.InputStreamResource; -import org.scribble.resources.Resource; -import org.scribble.resources.ResourceLocator; - -/** - * Protocol validator. - * - */ -public class ProtocolValidationManager { - //extends org.eclipse.wst.validation.AbstractValidator { - - /** - * Default constructor. - */ - public ProtocolValidationManager() { - } - - /** - * This method validates the resource. - * - * @param res The resource - */ - public void validateResource(final IResource res) { - EclipseIssueLogger logger= - new EclipseIssueLogger((IFile)res); - - try { - InputStreamResource isr = new InputStreamResource(res.getProjectRelativePath().toPortableString(), - ((IFile)res).getContents()); - - // Create a locator based on the Eclipse project root - ResourceLocator locator=new ResourceLocator() { - - public Resource getResource(String name) { - String filename=name.replace('.', java.io.File.separatorChar)+".scr"; - - IFile file=res.getProject().getFile(filename); - - if (file != null) { - try { - return (new InputStreamResource(filename, file.getContents())); - } catch (Exception e) { - e.printStackTrace(); - } - } - - return null; - } - }; - - ProtocolParser pp=new ProtocolParser(); - - ProtocolModuleLoader loader=new ProtocolModuleLoader(pp, locator, logger); - - // Use console logger, to 'ignore' parser errors, as these will be detected and - // reported by the XText generated Scribble editor. However the validation errors - // should be reported via the Eclipse based logger - Module module=pp.parse(isr, loader, new ConsoleIssueLogger()); - - if (module != null) { - // Validate - org.scribble.validation.ProtocolValidator pv=new org.scribble.validation.ProtocolValidator(); - - DefaultModuleContext context=new DefaultModuleContext(isr, module, loader); - - pv.validate(context, module, logger); - } - - } catch (Exception e) { - Activator.logError("Failed to record validation issue on resource '"+res+"'", e); - } finally { - logger.finished(); - } - } -} diff --git a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/resources/org/scribble/editor/tools/ui/Messages.properties b/tools/eclipse/plugins/org.scribble.editor.tools/src/main/resources/org/scribble/editor/tools/ui/Messages.properties deleted file mode 100644 index 4cb5dcd73..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/resources/org/scribble/editor/tools/ui/Messages.properties +++ /dev/null @@ -1,50 +0,0 @@ -#/* -# * Copyright 2009 www.scribble.org -# * -# * Licensed under the Apache License, Version 2.0 (the "License"); -# * you may not use this file except in compliance with the License. -# * You may obtain a copy of the License at -# * -# * http://www.apache.org/licenses/LICENSE-2.0 -# * -# * Unless required by applicable law or agreed to in writing, software -# * distributed under the License is distributed on an "AS IS" BASIS, -# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# * See the License for the specific language governing permissions and -# * limitations under the License. -# * -# */ - -## Actions ## - -ContentAssistProposal.label=Content Assist@Ctrl+SPACE -ContentAssistProposal.tooltip=Content Assist -ContentAssistProposal.image= -ContentAssistProposal.description=Content Assist - -ContentAssistTip.label=Content Tip@Ctrl+SHIFT+SPACE -ContentAssistTip.tooltip=Content Tip -ContentAssistTip.image= -ContentAssistTip.description=Content Tip - -DefineFoldingRegion.label=Define Folding Region -DefineFoldingRegion.tooltip=Define Folding Region -DefineFoldingRegion.image= -DefineFoldingRegion.description=Define Folding Region - -TogglePresentation.label=Change Presentation -TogglePresentation.tooltip=Enable/Disable Segmented Source Viewer -TogglePresentation.image=togglepresentation.gif -TogglePresentation.description=Enable/Disable Segmented Source Viewer - -OutlinePage.segment.title_pattern=position {0} - -AutoIndent.error.bad_location_1=JavaAutoIndentStrategy.getAutoIndentString: BadLocationException -AutoIndent.error.bad_location_2=JavaAutoIndentStrategy.calcShiftBackReplace: BadLocationException - -CompletionProcessor.ContextInfo.display.pattern=proposal {0} at position {1} -CompletionProcessor.ContextInfo.value.pattern=proposal {0} valid from {1} to {2} -CompletionProcessor.Proposal.ContextInfo.pattern={0} valid 5 characters around insertion point -CompletionProcessor.Proposal.hoverinfo.pattern=Java keyword: {0} - -JavaTextHover.emptySelection=empty selection diff --git a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/resources/org/scribble/editor/tools/ui/images/activity.png b/tools/eclipse/plugins/org.scribble.editor.tools/src/main/resources/org/scribble/editor/tools/ui/images/activity.png deleted file mode 100644 index 847aaecd0..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/resources/org/scribble/editor/tools/ui/images/activity.png and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/resources/org/scribble/editor/tools/ui/images/declaration.png b/tools/eclipse/plugins/org.scribble.editor.tools/src/main/resources/org/scribble/editor/tools/ui/images/declaration.png deleted file mode 100644 index b1eacf5ff..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/resources/org/scribble/editor/tools/ui/images/declaration.png and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/resources/org/scribble/editor/tools/ui/images/import.png b/tools/eclipse/plugins/org.scribble.editor.tools/src/main/resources/org/scribble/editor/tools/ui/images/import.png deleted file mode 100644 index a5727bad3..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/resources/org/scribble/editor/tools/ui/images/import.png and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/resources/org/scribble/editor/tools/ui/images/namespace.png b/tools/eclipse/plugins/org.scribble.editor.tools/src/main/resources/org/scribble/editor/tools/ui/images/namespace.png deleted file mode 100644 index a4dd204d8..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/resources/org/scribble/editor/tools/ui/images/namespace.png and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/resources/org/scribble/editor/tools/ui/images/protocol.png b/tools/eclipse/plugins/org.scribble.editor.tools/src/main/resources/org/scribble/editor/tools/ui/images/protocol.png deleted file mode 100644 index 6788a962a..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/resources/org/scribble/editor/tools/ui/images/protocol.png and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/resources/org/scribble/editor/tools/ui/images/role.png b/tools/eclipse/plugins/org.scribble.editor.tools/src/main/resources/org/scribble/editor/tools/ui/images/role.png deleted file mode 100644 index f53a359e7..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/resources/org/scribble/editor/tools/ui/images/role.png and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/resources/org/scribble/editor/tools/ui/images/scribble.png b/tools/eclipse/plugins/org.scribble.editor.tools/src/main/resources/org/scribble/editor/tools/ui/images/scribble.png deleted file mode 100644 index 7662497ef..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/resources/org/scribble/editor/tools/ui/images/scribble.png and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/resources/org/scribble/editor/tools/ui/images/scribble_error.png b/tools/eclipse/plugins/org.scribble.editor.tools/src/main/resources/org/scribble/editor/tools/ui/images/scribble_error.png deleted file mode 100644 index d3f181713..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/resources/org/scribble/editor/tools/ui/images/scribble_error.png and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/resources/org/scribble/editor/tools/ui/images/scribble_warning.png b/tools/eclipse/plugins/org.scribble.editor.tools/src/main/resources/org/scribble/editor/tools/ui/images/scribble_warning.png deleted file mode 100644 index 639e84b41..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/resources/org/scribble/editor/tools/ui/images/scribble_warning.png and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/resources/org/scribble/editor/tools/ui/togglepresentation.gif b/tools/eclipse/plugins/org.scribble.editor.tools/src/main/resources/org/scribble/editor/tools/ui/togglepresentation.gif deleted file mode 100644 index a0831f04b..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor.tools/src/main/resources/org/scribble/editor/tools/ui/togglepresentation.gif and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor.trace/META-INF/MANIFEST.MF b/tools/eclipse/plugins/org.scribble.editor.trace/META-INF/MANIFEST.MF deleted file mode 100644 index bbd344fa5..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.trace/META-INF/MANIFEST.MF +++ /dev/null @@ -1,18 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: org.scribble.editor.trace -Bundle-Vendor: Scribble.org -Bundle-Version: 0.3.2.qualifier -Bundle-SymbolicName: org.scribble.editor.trace;singleton:=true -Bundle-ActivationPolicy: lazy -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 -Require-Bundle: org.eclipse.ui, - org.eclipse.ui.forms, - org.eclipse.core.runtime, - org.eclipse.core.resources, - org.eclipse.jface.text, - org.eclipse.ui.editors, - org.eclipse.ui.ide, - org.eclipse.swt, - org.scribble.editor.tools -Bundle-Activator: org.scribble.editor.trace.osgi.TraceEditorActivator diff --git a/tools/eclipse/plugins/org.scribble.editor.trace/build.properties b/tools/eclipse/plugins/org.scribble.editor.trace/build.properties deleted file mode 100644 index 33edfab60..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.trace/build.properties +++ /dev/null @@ -1,6 +0,0 @@ -source.. = src/main/java/ -bin.includes = plugin.xml,\ - META-INF/,\ - .,\ - icons/ - diff --git a/tools/eclipse/plugins/org.scribble.editor.trace/icons/close_view.gif b/tools/eclipse/plugins/org.scribble.editor.trace/icons/close_view.gif deleted file mode 100644 index 1aca259db..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor.trace/icons/close_view.gif and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor.trace/icons/file_obj.gif b/tools/eclipse/plugins/org.scribble.editor.trace/icons/file_obj.gif deleted file mode 100644 index 6b86d0797..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor.trace/icons/file_obj.gif and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor.trace/icons/form_banner.gif b/tools/eclipse/plugins/org.scribble.editor.trace/icons/form_banner.gif deleted file mode 100644 index aebc0b2a3..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor.trace/icons/form_banner.gif and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor.trace/icons/help_topic.gif b/tools/eclipse/plugins/org.scribble.editor.trace/icons/help_topic.gif deleted file mode 100644 index 9bdd51682..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor.trace/icons/help_topic.gif and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor.trace/icons/large_image.gif b/tools/eclipse/plugins/org.scribble.editor.trace/icons/large_image.gif deleted file mode 100644 index c5c94ee9a..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor.trace/icons/large_image.gif and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor.trace/icons/linkto_help.gif b/tools/eclipse/plugins/org.scribble.editor.trace/icons/linkto_help.gif deleted file mode 100644 index 86550fe9f..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor.trace/icons/linkto_help.gif and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor.trace/icons/newprj_wiz.gif b/tools/eclipse/plugins/org.scribble.editor.trace/icons/newprj_wiz.gif deleted file mode 100644 index dc7d3a73f..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor.trace/icons/newprj_wiz.gif and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor.trace/icons/sample.gif b/tools/eclipse/plugins/org.scribble.editor.trace/icons/sample.gif deleted file mode 100644 index 34fb3c9d8..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor.trace/icons/sample.gif and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor.trace/icons/scribble.png b/tools/eclipse/plugins/org.scribble.editor.trace/icons/scribble.png deleted file mode 100644 index 7662497ef..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor.trace/icons/scribble.png and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor.trace/icons/th_horizontal.gif b/tools/eclipse/plugins/org.scribble.editor.trace/icons/th_horizontal.gif deleted file mode 100644 index f4c14a4e3..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor.trace/icons/th_horizontal.gif and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor.trace/icons/th_vertical.gif b/tools/eclipse/plugins/org.scribble.editor.trace/icons/th_vertical.gif deleted file mode 100644 index f68583982..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor.trace/icons/th_vertical.gif and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor.trace/plugin.xml b/tools/eclipse/plugins/org.scribble.editor.trace/plugin.xml deleted file mode 100644 index f8d18c1d9..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.trace/plugin.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - New Scribble Trace - - - - - diff --git a/tools/eclipse/plugins/org.scribble.editor.trace/pom.xml b/tools/eclipse/plugins/org.scribble.editor.trace/pom.xml deleted file mode 100644 index 7a7044ee9..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.trace/pom.xml +++ /dev/null @@ -1,23 +0,0 @@ - - 4.0.0 - org.scribble.tools.eclipse.plugins - org.scribble.editor.trace - eclipse-plugin - Scribble::Tools::Eclipse::Plugins::Editor Trace - - - org.scribble.tools.eclipse - plugins - 0.3.2-SNAPSHOT - - - - - org.scribble - scribble-trace - ${project.version} - - - - diff --git a/tools/eclipse/plugins/org.scribble.editor.trace/src/main/java/org/scribble/editor/trace/Messages.java b/tools/eclipse/plugins/org.scribble.editor.trace/src/main/java/org/scribble/editor/trace/Messages.java deleted file mode 100644 index 875dd8e2a..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.trace/src/main/java/org/scribble/editor/trace/Messages.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.editor.trace; - -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -public class Messages { - private static final String BUNDLE_NAME = "org.scribble.editor.trace.messages"; //$NON-NLS-1$ - - private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle - .getBundle(BUNDLE_NAME); - - private Messages() { - } - - public static String getString(String key) { - // TODO Auto-generated method stub - try { - return RESOURCE_BUNDLE.getString(key); - } catch (MissingResourceException e) { - return '!' + key + '!'; - } - } -} diff --git a/tools/eclipse/plugins/org.scribble.editor.trace/src/main/java/org/scribble/editor/trace/messages.properties b/tools/eclipse/plugins/org.scribble.editor.trace/src/main/java/org/scribble/editor/trace/messages.properties deleted file mode 100644 index f73c19bf6..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.trace/src/main/java/org/scribble/editor/trace/messages.properties +++ /dev/null @@ -1,16 +0,0 @@ -MainPage.label=Main -MainPage.title=Trace -MainPage.roleSection=Roles -MainPage.simulatorSection=Simulator Details -MainPage.add=Add... -MainPage.remove=Remove... -MainPage.roleDesc=The list of roles involved in the trace -MainPage.simulatorDesc=The simulator details for a selected role -StepsPage.label=Steps -StepsPage.title=Trace Steps -StepsPage.firstSection=First Table Section -StepsPage.secondSection=Second Table Section -StepsPage.addMessageTransfer=Add... -StepsPage.addMessageTransferParameter=Add Parameter... -StepsPage.remove=Remove... -StepsPage.desc=This section has a tree and a button. diff --git a/tools/eclipse/plugins/org.scribble.editor.trace/src/main/java/org/scribble/editor/trace/osgi/ExamplesPluginResources.properties b/tools/eclipse/plugins/org.scribble.editor.trace/src/main/java/org/scribble/editor/trace/osgi/ExamplesPluginResources.properties deleted file mode 100644 index baee6a417..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.trace/src/main/java/org/scribble/editor/trace/osgi/ExamplesPluginResources.properties +++ /dev/null @@ -1,10 +0,0 @@ -############################################################################### -# Copyright (c) 2003, 2004 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Common Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/cpl-v10.html -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### diff --git a/tools/eclipse/plugins/org.scribble.editor.trace/src/main/java/org/scribble/editor/trace/osgi/TraceEditorActivator.java b/tools/eclipse/plugins/org.scribble.editor.trace/src/main/java/org/scribble/editor/trace/osgi/TraceEditorActivator.java deleted file mode 100644 index bdbbb20c6..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.trace/src/main/java/org/scribble/editor/trace/osgi/TraceEditorActivator.java +++ /dev/null @@ -1,175 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.editor.trace.osgi; - -import java.net.URL; -import java.util.MissingResourceException; -import java.util.ResourceBundle; -import java.util.logging.Logger; - -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Status; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.resource.ImageRegistry; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.forms.FormColors; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator. - */ -public class TraceEditorActivator extends AbstractUIPlugin { - - private static final Logger LOG = Logger.getLogger(TraceEditorActivator.class.getName()); - - //The shared instance. - private static TraceEditorActivator plugin; - //Resource bundle. - private ResourceBundle resourceBundle; - private FormColors formColors; - public static final String IMG_FORM_BG = "formBg"; //$NON-NLS-1$ - public static final String IMG_LARGE = "large"; //$NON-NLS-1$ - public static final String IMG_HORIZONTAL = "horizontal"; //$NON-NLS-1$ - public static final String IMG_VERTICAL = "vertical"; //$NON-NLS-1$ - public static final String IMG_SAMPLE = "sample"; //$NON-NLS-1$ - public static final String IMG_WIZBAN = "wizban"; //$NON-NLS-1$ - public static final String IMG_LINKTO_HELP = "linkto_help"; //$NON-NLS-1$ - public static final String IMG_HELP_TOPIC = "help_topic"; //$NON-NLS-1$ - public static final String IMG_CLOSE = "close"; //$NON-NLS-1$ - - /** - * Plugin id. - */ - public static final String PLUGIN_ID = "org.scribble.editor.trace"; - - /** - * The constructor. - */ - public TraceEditorActivator() { - plugin = this; - try { - resourceBundle = ResourceBundle - .getBundle("org.scribble.editor.trace.osgi.ExamplesPluginResources"); //$NON-NLS-1$ - } catch (MissingResourceException x) { - resourceBundle = null; - } - } - - protected void initializeImageRegistry(ImageRegistry registry) { - registerImage(registry, IMG_FORM_BG, "form_banner.gif"); //$NON-NLS-1$ - registerImage(registry, IMG_LARGE, "large_image.gif"); //$NON-NLS-1$ - registerImage(registry, IMG_HORIZONTAL, "th_horizontal.gif"); //$NON-NLS-1$ - registerImage(registry, IMG_VERTICAL, "th_vertical.gif"); //$NON-NLS-1$ - registerImage(registry, IMG_SAMPLE, "sample.gif"); //$NON-NLS-1$ - registerImage(registry, IMG_WIZBAN, "newprj_wiz.gif"); //$NON-NLS-1$ - registerImage(registry, IMG_LINKTO_HELP, "linkto_help.gif"); //$NON-NLS-1$ - registerImage(registry, IMG_HELP_TOPIC, "help_topic.gif"); //$NON-NLS-1$ - registerImage(registry, IMG_CLOSE, "close_view.gif"); //$NON-NLS-1$ - } - - private void registerImage(ImageRegistry registry, String key, - String fileName) { - try { - IPath path = new Path("icons/" + fileName); //$NON-NLS-1$ - URL url = find(path); - if (url!=null) { - ImageDescriptor desc = ImageDescriptor.createFromURL(url); - registry.put(key, desc); - } - } catch (Exception e) { - } - } - - public FormColors getFormColors(Display display) { - if (formColors == null) { - formColors = new FormColors(display); - formColors.markShared(); - } - return formColors; - } - /** - * Returns the shared instance. - */ - public static TraceEditorActivator getDefault() { - return plugin; - } - /** - * Returns the workspace instance. - */ - public static IWorkspace getWorkspace() { - return ResourcesPlugin.getWorkspace(); - } - /** - * Returns the string from the plugin's resource bundle, or 'key' if not - * found. - */ - public static String getResourceString(String key) { - ResourceBundle bundle = TraceEditorActivator.getDefault().getResourceBundle(); - try { - return (bundle != null ? bundle.getString(key) : key); - } catch (MissingResourceException e) { - return key; - } - } - /** - * Returns the plugin's resource bundle, - */ - public ResourceBundle getResourceBundle() { - return resourceBundle; - } - public void stop(BundleContext context) throws Exception { - try { - if (formColors != null) { - formColors.dispose(); - formColors = null; - } - } finally { - super.stop(context); - } - } - public Image getImage(String key) { - return getImageRegistry().get(key); - } - public ImageDescriptor getImageDescriptor(String key) { - return getImageRegistry().getDescriptor(key); - } - - /** - * This method logs an error against the plugin. - * - * @param mesg The error message - * @param t The optional exception - */ - public static void logError(String mesg, Throwable t) { - - if (getDefault() != null) { - Status status=new Status(IStatus.ERROR, - PLUGIN_ID, 0, mesg, t); - - getDefault().getLog().log(status); - } - - LOG.severe("LOG ERROR: "+mesg+(t == null ? "" : ": "+t)); - } - -} \ No newline at end of file diff --git a/tools/eclipse/plugins/org.scribble.editor.trace/src/main/java/org/scribble/editor/trace/ui/NewTraceWizard.java b/tools/eclipse/plugins/org.scribble.editor.trace/src/main/java/org/scribble/editor/trace/ui/NewTraceWizard.java deleted file mode 100644 index aedf58fc0..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.trace/src/main/java/org/scribble/editor/trace/ui/NewTraceWizard.java +++ /dev/null @@ -1,311 +0,0 @@ -/* - * Copyright 2009-14 www.scribble.org - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ -package org.scribble.editor.trace.ui; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.wizard.Wizard; -import org.eclipse.ui.INewWizard; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.actions.WorkspaceModifyOperation; -import org.eclipse.ui.dialogs.WizardNewFileCreationPage; -import org.eclipse.ui.part.FileEditorInput; -import org.eclipse.ui.part.ISetSelectionTarget; -import org.scribble.trace.model.Trace; -import org.scribble.trace.util.TraceUtil; - -/** - * This class provides the wizard responsible for creating - * new Trace definitions. - */ -public class NewTraceWizard extends Wizard implements INewWizard { - - private static final String TRACE_FILE_EXTENSION = "trace"; - private IWorkbench _workbench=null; - private IStructuredSelection _selection=null; - private ScribbleNewFileCreationPage _newFileCreationPage=null; - - /** - * This method initializes the wizard. - * - * @param workbench The workbench - * @param selection The selected resource - */ - public void init(IWorkbench workbench, IStructuredSelection selection) { - _workbench = workbench; - _selection = selection; - setWindowTitle("New Trace Wizard"); - } - - /** - * {@inheritDoc} - */ - public boolean performFinish() { - try { - // Remember the file. - // - final IFile modelFile = getModelFile(); - - // Do the work within an operation. - // - WorkspaceModifyOperation operation = - new WorkspaceModifyOperation() { - protected void execute(IProgressMonitor progressMonitor) { - try { - // Identify the model reference from the resource - org.eclipse.core.runtime.IPath path=modelFile.getFullPath(); - org.eclipse.core.runtime.IPath fqnPath=path.removeFirstSegments(1); - - String[] segments=fqnPath.segments(); - - String filename=segments[segments.length-1]; - int ind=filename.lastIndexOf('.'); - - if (ind != -1) { - filename = filename.substring(0, ind); - } - - Trace trace=new Trace(); - trace.setName(filename); - - byte[] b=TraceUtil.serializeTrace(trace); - - java.io.ByteArrayInputStream bis=new java.io.ByteArrayInputStream(b); - - modelFile.create(bis, true, progressMonitor); - - bis.close(); - - } catch (Exception e) { - org.scribble.editor.trace.osgi.TraceEditorActivator.logError(e.getMessage(), e); - } finally { - progressMonitor.done(); - } - } - }; - - getContainer().run(false, false, operation); - - // Select the new file resource in the current view. - // - IWorkbenchWindow workbenchWindow = - _workbench.getActiveWorkbenchWindow(); - IWorkbenchPage page = workbenchWindow.getActivePage(); - final IWorkbenchPart activePart = page.getActivePart(); - if (activePart instanceof ISetSelectionTarget) { - final ISelection targetSelection = new StructuredSelection(modelFile); - getShell().getDisplay().asyncExec( - new Runnable() { - public void run() { - ((ISetSelectionTarget)activePart).selectReveal(targetSelection); - } - }); - } - - // Open an editor on the new file. - // - try { - org.eclipse.ui.IEditorDescriptor ed= - _workbench.getEditorRegistry().getDefaultEditor(modelFile.getFullPath().toString()); - - if (ed != null) { - page.openEditor(new FileEditorInput(modelFile), - ed.getId()); - } - } catch (PartInitException exception) { - MessageDialog.openError(workbenchWindow.getShell(), - "Open Error", exception.getMessage()); - return false; - } - - return true; - } catch (Exception e) { - e.printStackTrace(); - org.scribble.editor.trace.osgi.TraceEditorActivator.logError(e.getMessage(), e); - return false; - } - } - - /** - * This method returns the initial description. - * - * @return The initial description - */ - protected String getInitialDescription() { - String ret=""; - - // TODO: Add default description - - return (ret); - } - - /** - * Get the file from the page. - * - * - * @generated - * @return The model file - */ - public IFile getModelFile() { - return _newFileCreationPage.getModelFile(); - } - - /** - * The framework calls this to create the contents of the wizard. - * - * - * @generated - */ - public void addPages() { - - _newFileCreationPage = new ScribbleNewFileCreationPage("Whatever", _selection); - _newFileCreationPage.setTitle("Protocol"); - _newFileCreationPage.setDescription("Create a new Protocol"); - - addPage(_newFileCreationPage); - - initFileCreationPage(); - } - - /** - * {@inheritDoc} - */ - protected void initFileCreationPage() { - String defaultModelBaseFilename = "My"; - - String defaultModelFilenameExtension = TRACE_FILE_EXTENSION; - String modelFilename = defaultModelBaseFilename + "." + defaultModelFilenameExtension; - - // Create a page, set the title, and the initial model file name. - // - _newFileCreationPage.setFileName(modelFilename); - - // Try and get the resource selection to determine a current directory for the file dialog. - // - if (_selection != null && !_selection.isEmpty()) { - // Get the resource... - // - Object selectedElement = _selection.iterator().next(); - if (selectedElement instanceof IResource) { - // Get the resource parent, if its a file. - // - IResource selectedResource = (IResource)selectedElement; - if (selectedResource.getType() == IResource.FILE) { - selectedResource = selectedResource.getParent(); - } - - // This gives us a directory... - // - if (selectedResource instanceof IFolder || selectedResource instanceof IProject) { - // Set this for the container. - // - _newFileCreationPage.setContainerFullPath(selectedResource.getFullPath()); - - // Make up a unique new name here. - // - for (int i = 1; ((IContainer)selectedResource).findMember(modelFilename) != null; ++i) { - modelFilename = defaultModelBaseFilename + i + "." + defaultModelFilenameExtension; - } - _newFileCreationPage.setFileName(modelFilename); - } - } - } - } - - /** - * This is the one page of the wizard. - * - * - * @generated - */ - public class ScribbleNewFileCreationPage extends WizardNewFileCreationPage { - /** - * Remember the model file. - * - * - * @generated - */ - private IFile _modelFile; - - /** - * Constructor. - * - * @param pageId The page id - * @param selection The selection - */ - public ScribbleNewFileCreationPage(String pageId, IStructuredSelection selection) { - super(pageId, selection); - } - - /** - * The framework calls this to see if the file is correct. - * - * @return Whether the page is valid - */ - protected boolean validatePage() { - if (super.validatePage()) { - String requiredExt = TRACE_FILE_EXTENSION; - - String enteredExt = new Path(getFileName()).getFileExtension(); - if (enteredExt == null || !enteredExt.equals(requiredExt)) { - setErrorMessage("The filename must end in: "+requiredExt); - return false; - } else { - return true; - } - } else { - return false; - } - } - - /** - * Store the dialog field settings upon completion. - * - * @return Whether finished - */ - public boolean performFinish() { - _modelFile = getModelFile(); - return true; - } - - /** - * Return the model file. - * - * @return The model file - */ - public IFile getModelFile() { - return _modelFile == null - ? ResourcesPlugin.getWorkspace().getRoot().getFile(getContainerFullPath().append(getFileName())) - : _modelFile; - } - } - -} diff --git a/tools/eclipse/plugins/org.scribble.editor.ui/META-INF/MANIFEST.MF b/tools/eclipse/plugins/org.scribble.editor.ui/META-INF/MANIFEST.MF deleted file mode 100644 index 6e054b313..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.ui/META-INF/MANIFEST.MF +++ /dev/null @@ -1,28 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: org.scribble.editor.ui -Bundle-Vendor: Scribble.org -Bundle-Version: 0.3.2.qualifier -Bundle-SymbolicName: org.scribble.editor.ui; singleton:=true -Bundle-ActivationPolicy: lazy -Require-Bundle: org.scribble.editor;visibility:=reexport, - org.scribble.editor.tools, - org.eclipse.xtext.ui, - org.eclipse.ui.editors, - org.eclipse.ui.ide, - org.eclipse.xtext.ui.shared, - org.eclipse.ui, - org.eclipse.swt, - org.eclipse.xtext.builder, - org.antlr.runtime, - org.eclipse.xtext.common.types.ui, - org.eclipse.xtext.ui.codetemplates.ui, - org.eclipse.compare -Import-Package: org.apache.log4j, - org.eclipse.xtext.xbase.lib -Bundle-RequiredExecutionEnvironment: JavaSE-1.6 -Export-Package: org.scribble.editor.dsl.ui.quickfix, - org.scribble.editor.dsl.ui.contentassist, - org.scribble.editor.dsl.ui.contentassist.antlr, - org.scribble.editor.dsl.ui.internal -Bundle-Activator: org.scribble.editor.dsl.ui.internal.ScribbleDslActivator diff --git a/tools/eclipse/plugins/org.scribble.editor.ui/build.properties b/tools/eclipse/plugins/org.scribble.editor.ui/build.properties deleted file mode 100644 index 50405f6c2..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.ui/build.properties +++ /dev/null @@ -1,8 +0,0 @@ -source.. = src/,\ - src-gen/,\ - xtend-gen/ -bin.includes = META-INF/,\ - .,\ - plugin.xml,\ - icons/ - diff --git a/tools/eclipse/plugins/org.scribble.editor.ui/icons/close_view.gif b/tools/eclipse/plugins/org.scribble.editor.ui/icons/close_view.gif deleted file mode 100644 index 1aca259db..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor.ui/icons/close_view.gif and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor.ui/icons/file_obj.gif b/tools/eclipse/plugins/org.scribble.editor.ui/icons/file_obj.gif deleted file mode 100644 index 6b86d0797..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor.ui/icons/file_obj.gif and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor.ui/icons/form_banner.gif b/tools/eclipse/plugins/org.scribble.editor.ui/icons/form_banner.gif deleted file mode 100644 index aebc0b2a3..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor.ui/icons/form_banner.gif and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor.ui/icons/help_topic.gif b/tools/eclipse/plugins/org.scribble.editor.ui/icons/help_topic.gif deleted file mode 100644 index 9bdd51682..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor.ui/icons/help_topic.gif and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor.ui/icons/large_image.gif b/tools/eclipse/plugins/org.scribble.editor.ui/icons/large_image.gif deleted file mode 100644 index c5c94ee9a..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor.ui/icons/large_image.gif and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor.ui/icons/linkto_help.gif b/tools/eclipse/plugins/org.scribble.editor.ui/icons/linkto_help.gif deleted file mode 100644 index 86550fe9f..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor.ui/icons/linkto_help.gif and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor.ui/icons/newprj_wiz.gif b/tools/eclipse/plugins/org.scribble.editor.ui/icons/newprj_wiz.gif deleted file mode 100644 index dc7d3a73f..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor.ui/icons/newprj_wiz.gif and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor.ui/icons/sample.gif b/tools/eclipse/plugins/org.scribble.editor.ui/icons/sample.gif deleted file mode 100644 index 34fb3c9d8..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor.ui/icons/sample.gif and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor.ui/icons/scribble.png b/tools/eclipse/plugins/org.scribble.editor.ui/icons/scribble.png deleted file mode 100644 index 7662497ef..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor.ui/icons/scribble.png and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor.ui/icons/th_horizontal.gif b/tools/eclipse/plugins/org.scribble.editor.ui/icons/th_horizontal.gif deleted file mode 100644 index f4c14a4e3..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor.ui/icons/th_horizontal.gif and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor.ui/icons/th_vertical.gif b/tools/eclipse/plugins/org.scribble.editor.ui/icons/th_vertical.gif deleted file mode 100644 index f68583982..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor.ui/icons/th_vertical.gif and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor.ui/plugin.xml b/tools/eclipse/plugins/org.scribble.editor.ui/plugin.xml deleted file mode 100644 index 6732770e4..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.ui/plugin.xml +++ /dev/null @@ -1,397 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tools/eclipse/plugins/org.scribble.editor.ui/plugin.xml_gen b/tools/eclipse/plugins/org.scribble.editor.ui/plugin.xml_gen deleted file mode 100644 index b8d44f60b..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.ui/plugin.xml_gen +++ /dev/null @@ -1,396 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tools/eclipse/plugins/org.scribble.editor.ui/pom.xml b/tools/eclipse/plugins/org.scribble.editor.ui/pom.xml deleted file mode 100644 index a36048b72..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.ui/pom.xml +++ /dev/null @@ -1,17 +0,0 @@ - - 4.0.0 - org.scribble.tools.eclipse.plugins - org.scribble.editor.ui - 0.3.2-SNAPSHOT - eclipse-plugin - Scribble::Tools::Eclipse::Plugins::Editor UI - - - org.scribble.tools.eclipse - plugins - 0.3.2-SNAPSHOT - - - - diff --git a/tools/eclipse/plugins/org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/AbstractScribbleDslUiModule.java b/tools/eclipse/plugins/org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/AbstractScribbleDslUiModule.java deleted file mode 100644 index aa57b420c..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/AbstractScribbleDslUiModule.java +++ /dev/null @@ -1,242 +0,0 @@ - -/* - * generated by Xtext - */ -package org.scribble.editor.dsl.ui; - -import org.eclipse.xtext.ui.DefaultUiModule; -import org.eclipse.ui.plugin.AbstractUIPlugin; - -/** - * Manual modifications go to {org.scribble.editor.dsl.ui.ScribbleDslUiModule} - */ -@SuppressWarnings("all") -public abstract class AbstractScribbleDslUiModule extends DefaultUiModule { - - public AbstractScribbleDslUiModule(AbstractUIPlugin plugin) { - super(plugin); - } - - - // contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment - public com.google.inject.Provider provideIAllContainersState() { - return org.eclipse.xtext.ui.shared.Access.getJavaProjectsState(); - } - - // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment - public Class bindIProposalConflictHelper() { - return org.eclipse.xtext.ui.editor.contentassist.antlr.AntlrProposalConflictHelper.class; - } - - // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment - public void configureHighlightingLexer(com.google.inject.Binder binder) { - binder.bind(org.eclipse.xtext.parser.antlr.Lexer.class).annotatedWith(com.google.inject.name.Names.named(org.eclipse.xtext.ui.LexerUIBindings.HIGHLIGHTING)).to(org.scribble.editor.dsl.parser.antlr.internal.InternalScribbleDslLexer.class); - } - - // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment - public void configureHighlightingTokenDefProvider(com.google.inject.Binder binder) { - binder.bind(org.eclipse.xtext.parser.antlr.ITokenDefProvider.class).annotatedWith(com.google.inject.name.Names.named(org.eclipse.xtext.ui.LexerUIBindings.HIGHLIGHTING)).to(org.eclipse.xtext.parser.antlr.AntlrTokenDefProvider.class); - } - - // contributed by org.eclipse.xtext.generator.exporting.QualifiedNamesFragment - public Class bindIDependentElementsCalculator() { - return org.eclipse.xtext.ui.refactoring.impl.DefaultDependentElementsCalculator.class; - } - - // contributed by org.eclipse.xtext.generator.builder.BuilderIntegrationFragment - public void configureIResourceDescriptionsBuilderScope(com.google.inject.Binder binder) { - binder.bind(org.eclipse.xtext.resource.IResourceDescriptions.class).annotatedWith(com.google.inject.name.Names.named(org.eclipse.xtext.resource.impl.ResourceDescriptionsProvider.NAMED_BUILDER_SCOPE)).to(org.eclipse.xtext.builder.clustering.CurrentDescriptions.ResourceSetAware.class); - } - - // contributed by org.eclipse.xtext.generator.builder.BuilderIntegrationFragment - public Class bindIXtextEditorCallback() { - return org.eclipse.xtext.builder.nature.NatureAddingEditorCallback.class; - } - - // contributed by org.eclipse.xtext.generator.builder.BuilderIntegrationFragment - public void configureIResourceDescriptionsPersisted(com.google.inject.Binder binder) { - binder.bind(org.eclipse.xtext.resource.IResourceDescriptions.class).annotatedWith(com.google.inject.name.Names.named(org.eclipse.xtext.builder.impl.PersistentDataAwareDirtyResource.PERSISTED_DESCRIPTIONS)).to(org.eclipse.xtext.builder.builderState.IBuilderState.class); - } - - // contributed by org.eclipse.xtext.generator.builder.BuilderIntegrationFragment - public Class bindDocumentBasedDirtyResource() { - return org.eclipse.xtext.builder.impl.PersistentDataAwareDirtyResource.class; - } - - // contributed by org.eclipse.xtext.generator.generator.GeneratorFragment - public Class bindIXtextBuilderParticipant() { - return org.eclipse.xtext.builder.BuilderParticipant.class; - } - - // contributed by org.eclipse.xtext.generator.generator.GeneratorFragment - public org.eclipse.core.resources.IWorkspaceRoot bindIWorkspaceRootToInstance() { - return org.eclipse.core.resources.ResourcesPlugin.getWorkspace().getRoot(); - } - - // contributed by org.eclipse.xtext.generator.generator.GeneratorFragment - public void configureBuilderPreferenceStoreInitializer(com.google.inject.Binder binder) { - binder.bind(org.eclipse.xtext.ui.editor.preferences.IPreferenceStoreInitializer.class).annotatedWith(com.google.inject.name.Names.named("builderPreferenceInitializer")).to(org.eclipse.xtext.builder.preferences.BuilderPreferenceAccess.Initializer.class); - } - - // contributed by org.eclipse.xtext.ui.generator.labeling.LabelProviderFragment - public Class bindILabelProvider() { - return org.scribble.editor.dsl.ui.labeling.ScribbleDslLabelProvider.class; - } - - // contributed by org.eclipse.xtext.ui.generator.labeling.LabelProviderFragment - public void configureResourceUIServiceLabelProvider(com.google.inject.Binder binder) { - binder.bind(org.eclipse.jface.viewers.ILabelProvider.class).annotatedWith(org.eclipse.xtext.ui.resource.ResourceServiceDescriptionLabelProvider.class).to(org.scribble.editor.dsl.ui.labeling.ScribbleDslDescriptionLabelProvider.class); - } - - // contributed by org.eclipse.xtext.ui.generator.outline.OutlineTreeProviderFragment - public Class bindIOutlineTreeProvider() { - return org.scribble.editor.dsl.ui.outline.ScribbleDslOutlineTreeProvider.class; - } - - // contributed by org.eclipse.xtext.ui.generator.outline.OutlineTreeProviderFragment - public Class bindIOutlineTreeStructureProvider() { - return org.scribble.editor.dsl.ui.outline.ScribbleDslOutlineTreeProvider.class; - } - - // contributed by org.eclipse.xtext.ui.generator.quickfix.QuickfixProviderFragment - public Class bindIssueResolutionProvider() { - return org.scribble.editor.dsl.ui.quickfix.ScribbleDslQuickfixProvider.class; - } - - // contributed by org.eclipse.xtext.ui.generator.contentAssist.ContentAssistFragment - public Class bindIContentProposalProvider() { - return org.scribble.editor.dsl.ui.contentassist.ScribbleDslProposalProvider.class; - } - - // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrUiGeneratorFragment - public Class bindContentAssistContext$Factory() { - return org.eclipse.xtext.ui.editor.contentassist.antlr.ParserBasedContentAssistContextFactory.class; - } - - // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrUiGeneratorFragment - public Class bindIContentAssistParser() { - return org.scribble.editor.dsl.ui.contentassist.antlr.ScribbleDslParser.class; - } - - // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrUiGeneratorFragment - public void configureContentAssistLexerProvider(com.google.inject.Binder binder) { - binder.bind(org.scribble.editor.dsl.ui.contentassist.antlr.internal.InternalScribbleDslLexer.class).toProvider(org.eclipse.xtext.parser.antlr.LexerProvider.create(org.scribble.editor.dsl.ui.contentassist.antlr.internal.InternalScribbleDslLexer.class)); - } - - // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrUiGeneratorFragment - public void configureContentAssistLexer(com.google.inject.Binder binder) { - binder.bind(org.eclipse.xtext.ui.editor.contentassist.antlr.internal.Lexer.class).annotatedWith(com.google.inject.name.Names.named(org.eclipse.xtext.ui.LexerUIBindings.CONTENT_ASSIST)).to(org.scribble.editor.dsl.ui.contentassist.antlr.internal.InternalScribbleDslLexer.class); - } - - // contributed by org.eclipse.xtext.ui.generator.refactoring.RefactorElementNameFragment - public Class bindIRenameStrategy() { - return org.eclipse.xtext.ui.refactoring.impl.DefaultRenameStrategy.class; - } - - // contributed by org.eclipse.xtext.ui.generator.refactoring.RefactorElementNameFragment - public Class bindIReferenceUpdater() { - return org.eclipse.xtext.ui.refactoring.impl.DefaultReferenceUpdater.class; - } - - // contributed by org.eclipse.xtext.ui.generator.refactoring.RefactorElementNameFragment - public void configureIPreferenceStoreInitializer(com.google.inject.Binder binder) { - binder.bind(org.eclipse.xtext.ui.editor.preferences.IPreferenceStoreInitializer.class).annotatedWith(com.google.inject.name.Names.named("RefactoringPreferences")).to(org.eclipse.xtext.ui.refactoring.ui.RefactoringPreferences.Initializer.class); - } - - // contributed by org.eclipse.xtext.ui.generator.refactoring.RefactorElementNameFragment - public Class bindIRenameRefactoringProvider() { - return org.eclipse.xtext.ui.refactoring.impl.DefaultRenameRefactoringProvider.class; - } - - // contributed by org.eclipse.xtext.ui.generator.refactoring.RefactorElementNameFragment - public Class bindIRenameSupport$Factory() { - return org.eclipse.xtext.ui.refactoring.ui.DefaultRenameSupport.Factory.class; - } - - // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment - public java.lang.ClassLoader bindClassLoaderToInstance() { - return getClass().getClassLoader(); - } - - // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment - public Class bindIJvmTypeProvider$Factory() { - return org.eclipse.xtext.common.types.access.jdt.JdtTypeProviderFactory.class; - } - - // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment - public Class bindAbstractTypeScopeProvider() { - return org.eclipse.xtext.common.types.xtext.ui.JdtBasedSimpleTypeScopeProvider.class; - } - - // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment - public Class bindITypesProposalProvider() { - return org.eclipse.xtext.common.types.xtext.ui.JdtTypesProposalProvider.class; - } - - // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment - public Class bindIJavaProjectProvider() { - return org.eclipse.xtext.common.types.xtext.ui.XtextResourceSetBasedProjectProvider.class; - } - - // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment - public Class bindIHyperlinkHelper() { - return org.eclipse.xtext.common.types.xtext.ui.TypeAwareHyperlinkHelper.class; - } - - // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment - public Class bindPrefixMatcher() { - return org.eclipse.xtext.ui.editor.contentassist.FQNPrefixMatcher.class; - } - - // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment - public Class bindAbstractJavaBasedContentProposalProvider$ReferenceProposalCreator() { - return org.eclipse.xtext.common.types.xtext.ui.TypeAwareReferenceProposalCreator.class; - } - - // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment - public Class bindIValidationJobScheduler() { - return org.eclipse.xtext.common.types.xtext.ui.JdtValidationJobScheduler.class; - } - - // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment - public Class bindRefactoringResourceSetProvider() { - return org.eclipse.xtext.common.types.ui.refactoring.JvmRefactoringResourceSetProvider.class; - } - - // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment - public Class bindIJavaSearchParticipation() { - return org.eclipse.xtext.common.types.ui.query.IJavaSearchParticipation.Yes.class; - } - - // contributed by org.eclipse.xtext.ui.generator.templates.CodetemplatesGeneratorFragment - public com.google.inject.Provider provideTemplatesLanguageConfiguration() { - return org.eclipse.xtext.ui.codetemplates.ui.AccessibleCodetemplatesActivator.getTemplatesLanguageConfigurationProvider(); - } - - // contributed by org.eclipse.xtext.ui.generator.templates.CodetemplatesGeneratorFragment - public com.google.inject.Provider provideLanguageRegistry() { - return org.eclipse.xtext.ui.codetemplates.ui.AccessibleCodetemplatesActivator.getLanguageRegistry(); - } - - // contributed by org.eclipse.xtext.ui.generator.templates.CodetemplatesGeneratorFragment - @org.eclipse.xtext.service.SingletonBinding(eager=true) public Class bindLanguageRegistrar() { - return org.eclipse.xtext.ui.codetemplates.ui.registry.LanguageRegistrar.class; - } - - // contributed by org.eclipse.xtext.ui.generator.templates.CodetemplatesGeneratorFragment - public Class bindXtextTemplatePreferencePage() { - return org.eclipse.xtext.ui.codetemplates.ui.preferences.AdvancedTemplatesPreferencePage.class; - } - - // contributed by org.eclipse.xtext.ui.generator.templates.CodetemplatesGeneratorFragment - public Class bindIPartialContentAssistParser() { - return org.scribble.editor.dsl.ui.contentassist.antlr.PartialScribbleDslContentAssistParser.class; - } - - // contributed by org.eclipse.xtext.ui.generator.compare.CompareFragment - public Class bindIViewerCreator() { - return org.eclipse.xtext.ui.compare.DefaultViewerCreator.class; - } - - -} diff --git a/tools/eclipse/plugins/org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/ScribbleDslExecutableExtensionFactory.java b/tools/eclipse/plugins/org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/ScribbleDslExecutableExtensionFactory.java deleted file mode 100644 index 99d6f8a31..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/ScribbleDslExecutableExtensionFactory.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * generated by Xtext - */ -package org.scribble.editor.dsl.ui; - -import org.eclipse.xtext.ui.guice.AbstractGuiceAwareExecutableExtensionFactory; -import org.osgi.framework.Bundle; - -import com.google.inject.Injector; - -import org.scribble.editor.dsl.ui.internal.ScribbleDslActivator; - -/** - * This class was generated. Customizations should only happen in a newly - * introduced subclass. - */ -public class ScribbleDslExecutableExtensionFactory extends AbstractGuiceAwareExecutableExtensionFactory { - - @Override - protected Bundle getBundle() { - return ScribbleDslActivator.getInstance().getBundle(); - } - - @Override - protected Injector getInjector() { - return ScribbleDslActivator.getInstance().getInjector(ScribbleDslActivator.ORG_SCRIBBLE_EDITOR_DSL_SCRIBBLEDSL); - } - -} diff --git a/tools/eclipse/plugins/org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/AbstractScribbleDslProposalProvider.java b/tools/eclipse/plugins/org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/AbstractScribbleDslProposalProvider.java deleted file mode 100644 index e40302600..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/AbstractScribbleDslProposalProvider.java +++ /dev/null @@ -1,389 +0,0 @@ -/* -* generated by Xtext -*/ -package org.scribble.editor.dsl.ui.contentassist; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.xtext.*; -import org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor; -import org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext; - -/** - * Represents a generated, default implementation of superclass {@link org.eclipse.xtext.common.ui.contentassist.TerminalsProposalProvider}. - * Methods are dynamically dispatched on the first parameter, i.e., you can override them - * with a more concrete subtype. - */ -@SuppressWarnings("all") -public class AbstractScribbleDslProposalProvider extends org.eclipse.xtext.common.ui.contentassist.TerminalsProposalProvider { - - public void completeModule_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeModule_Imports(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeModule_Types(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeModule_Globals(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeModule_Locals(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeImportModule_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeImportModule_Alias(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeImportMember_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeImportMember_Member(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeImportMember_Alias(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completePayloadTypeDecl_Schema(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completePayloadTypeDecl_Type(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completePayloadTypeDecl_Location(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completePayloadTypeDecl_Alias(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeMessageSignature_Operator(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeMessageSignature_Types(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completePayloadElement_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completePayloadElement_Type(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeGlobalProtocolDecl_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeGlobalProtocolDecl_Parameters(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeGlobalProtocolDecl_Roles(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeGlobalProtocolDecl_Block(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeGlobalProtocolDecl_Instantiates(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeGlobalProtocolDecl_Arguments(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeGlobalProtocolDecl_RoleInstantiations(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeRoleDecl_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeRoleDecl_Alias(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeParameterDecl_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeParameterDecl_Alias(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeRoleInstantiation_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeRoleInstantiation_Alias(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeArgument_Signature(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeArgument_Alias(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeArgument_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeGlobalProtocolBlock_Activities(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeGlobalMessageTransfer_Message(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeGlobalMessageTransfer_FromRole(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeGlobalMessageTransfer_ToRoles(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeMessage_Signature(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeMessage_Parameter(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeGlobalChoice_Role(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeGlobalChoice_Blocks(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeGlobalRecursion_Label(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeGlobalRecursion_Block(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeGlobalContinue_Label(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeGlobalParallel_Blocks(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeGlobalInterruptible_Scope(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeGlobalInterruptible_Block(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeGlobalInterruptible_Interrupts(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeGlobalInterrupt_Messages(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeGlobalInterrupt_Role(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeGlobalDo_Scope(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeGlobalDo_Member(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeGlobalDo_Arguments(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeGlobalDo_Roles(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeLocalProtocolDecl_Name(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeLocalProtocolDecl_Role(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeLocalProtocolDecl_Parameters(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeLocalProtocolDecl_Roles(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeLocalProtocolDecl_Block(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeLocalProtocolDecl_Instantiates(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeLocalProtocolDecl_Arguments(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeLocalProtocolDecl_RoleInstantiations(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeLocalProtocolBlock_Activities(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeLocalSend_Message(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeLocalSend_ToRoles(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeLocalReceive_Message(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeLocalReceive_FromRole(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeLocalChoice_Role(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeLocalChoice_Blocks(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeLocalRecursion_Label(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeLocalRecursion_Block(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeLocalContinue_Label(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeLocalParallel_Blocks(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeLocalInterruptible_Scope(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeLocalInterruptible_Block(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeLocalInterruptible_Throw(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeLocalInterruptible_Catches(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeLocalThrow_Messages(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeLocalThrow_ToRoles(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeLocalCatch_Messages(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeLocalCatch_FromRole(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeLocalDo_Scope(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeLocalDo_Member(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeLocalDo_Arguments(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeLocalDo_Roles(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - - public void complete_Module(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_ModuleName(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_ImportDecl(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_ImportModule(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_ImportMember(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_PayloadTypeDecl(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_MessageSignature(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_PayloadElement(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_GlobalProtocolDecl(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_RoleDecl(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_ParameterDecl(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_RoleInstantiation(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_Argument(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_GlobalProtocolBlock(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_GlobalInteraction(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_GlobalMessageTransfer(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_Message(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_GlobalChoice(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_GlobalRecursion(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_GlobalContinue(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_GlobalParallel(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_GlobalInterruptible(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_GlobalInterrupt(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_GlobalDo(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_LocalProtocolDecl(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_LocalProtocolBlock(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_LlobalInteraction(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_LocalSend(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_LocalReceive(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_LocalChoice(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_LocalRecursion(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_LocalContinue(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_LocalParallel(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_LocalInterruptible(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_LocalThrow(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_LocalCatch(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_LocalDo(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } -} diff --git a/tools/eclipse/plugins/org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/PartialScribbleDslContentAssistParser.java b/tools/eclipse/plugins/org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/PartialScribbleDslContentAssistParser.java deleted file mode 100644 index 819059570..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/PartialScribbleDslContentAssistParser.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * generated by Xtext - */ -package org.scribble.editor.dsl.ui.contentassist.antlr; - -import java.util.Collection; -import java.util.Collections; - -import org.eclipse.xtext.AbstractRule; -import org.eclipse.xtext.ui.codetemplates.ui.partialEditing.IPartialContentAssistParser; -import org.eclipse.xtext.ui.editor.contentassist.antlr.FollowElement; -import org.eclipse.xtext.ui.editor.contentassist.antlr.internal.AbstractInternalContentAssistParser; -import org.eclipse.xtext.util.PolymorphicDispatcher; - -/** - * @author Sebastian Zarnekow - Initial contribution and API - */ -@SuppressWarnings("restriction") -public class PartialScribbleDslContentAssistParser extends ScribbleDslParser implements IPartialContentAssistParser { - - private AbstractRule rule; - - public void initializeFor(AbstractRule rule) { - this.rule = rule; - } - - @Override - protected Collection getFollowElements(AbstractInternalContentAssistParser parser) { - if (rule == null || rule.eIsProxy()) - return Collections.emptyList(); - String methodName = "entryRule" + rule.getName(); - PolymorphicDispatcher> dispatcher = - new PolymorphicDispatcher>(methodName, 0, 0, Collections.singletonList(parser)); - dispatcher.invoke(); - return parser.getFollowElements(); - } - -} diff --git a/tools/eclipse/plugins/org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/ScribbleDslParser.java b/tools/eclipse/plugins/org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/ScribbleDslParser.java deleted file mode 100644 index 6ca1baa46..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/ScribbleDslParser.java +++ /dev/null @@ -1,271 +0,0 @@ -/* -* generated by Xtext -*/ -package org.scribble.editor.dsl.ui.contentassist.antlr; - -import java.util.Collection; -import java.util.Map; -import java.util.HashMap; - -import org.antlr.runtime.RecognitionException; -import org.eclipse.xtext.AbstractElement; -import org.eclipse.xtext.ui.editor.contentassist.antlr.AbstractContentAssistParser; -import org.eclipse.xtext.ui.editor.contentassist.antlr.FollowElement; -import org.eclipse.xtext.ui.editor.contentassist.antlr.internal.AbstractInternalContentAssistParser; - -import com.google.inject.Inject; - -import org.scribble.editor.dsl.services.ScribbleDslGrammarAccess; - -public class ScribbleDslParser extends AbstractContentAssistParser { - - @Inject - private ScribbleDslGrammarAccess grammarAccess; - - private Map nameMappings; - - @Override - protected org.scribble.editor.dsl.ui.contentassist.antlr.internal.InternalScribbleDslParser createParser() { - org.scribble.editor.dsl.ui.contentassist.antlr.internal.InternalScribbleDslParser result = new org.scribble.editor.dsl.ui.contentassist.antlr.internal.InternalScribbleDslParser(null); - result.setGrammarAccess(grammarAccess); - return result; - } - - @Override - protected String getRuleName(AbstractElement element) { - if (nameMappings == null) { - nameMappings = new HashMap() { - private static final long serialVersionUID = 1L; - { - put(grammarAccess.getModuleAccess().getAlternatives_5(), "rule__Module__Alternatives_5"); - put(grammarAccess.getImportDeclAccess().getAlternatives(), "rule__ImportDecl__Alternatives"); - put(grammarAccess.getGlobalProtocolDeclAccess().getAlternatives_8(), "rule__GlobalProtocolDecl__Alternatives_8"); - put(grammarAccess.getParameterDeclAccess().getAlternatives(), "rule__ParameterDecl__Alternatives"); - put(grammarAccess.getArgumentAccess().getAlternatives(), "rule__Argument__Alternatives"); - put(grammarAccess.getGlobalInteractionAccess().getAlternatives(), "rule__GlobalInteraction__Alternatives"); - put(grammarAccess.getMessageAccess().getAlternatives(), "rule__Message__Alternatives"); - put(grammarAccess.getLocalProtocolDeclAccess().getAlternatives_10(), "rule__LocalProtocolDecl__Alternatives_10"); - put(grammarAccess.getLlobalInteractionAccess().getAlternatives(), "rule__LlobalInteraction__Alternatives"); - put(grammarAccess.getModuleAccess().getGroup(), "rule__Module__Group__0"); - put(grammarAccess.getModuleNameAccess().getGroup(), "rule__ModuleName__Group__0"); - put(grammarAccess.getModuleNameAccess().getGroup_1(), "rule__ModuleName__Group_1__0"); - put(grammarAccess.getImportModuleAccess().getGroup(), "rule__ImportModule__Group__0"); - put(grammarAccess.getImportModuleAccess().getGroup_2(), "rule__ImportModule__Group_2__0"); - put(grammarAccess.getImportMemberAccess().getGroup(), "rule__ImportMember__Group__0"); - put(grammarAccess.getImportMemberAccess().getGroup_4(), "rule__ImportMember__Group_4__0"); - put(grammarAccess.getPayloadTypeDeclAccess().getGroup(), "rule__PayloadTypeDecl__Group__0"); - put(grammarAccess.getMessageSignatureAccess().getGroup(), "rule__MessageSignature__Group__0"); - put(grammarAccess.getMessageSignatureAccess().getGroup_3(), "rule__MessageSignature__Group_3__0"); - put(grammarAccess.getMessageSignatureAccess().getGroup_3_1(), "rule__MessageSignature__Group_3_1__0"); - put(grammarAccess.getPayloadElementAccess().getGroup(), "rule__PayloadElement__Group__0"); - put(grammarAccess.getPayloadElementAccess().getGroup_0(), "rule__PayloadElement__Group_0__0"); - put(grammarAccess.getGlobalProtocolDeclAccess().getGroup(), "rule__GlobalProtocolDecl__Group__0"); - put(grammarAccess.getGlobalProtocolDeclAccess().getGroup_3(), "rule__GlobalProtocolDecl__Group_3__0"); - put(grammarAccess.getGlobalProtocolDeclAccess().getGroup_3_2(), "rule__GlobalProtocolDecl__Group_3_2__0"); - put(grammarAccess.getGlobalProtocolDeclAccess().getGroup_6(), "rule__GlobalProtocolDecl__Group_6__0"); - put(grammarAccess.getGlobalProtocolDeclAccess().getGroup_8_1(), "rule__GlobalProtocolDecl__Group_8_1__0"); - put(grammarAccess.getGlobalProtocolDeclAccess().getGroup_8_1_2(), "rule__GlobalProtocolDecl__Group_8_1_2__0"); - put(grammarAccess.getGlobalProtocolDeclAccess().getGroup_8_1_2_2(), "rule__GlobalProtocolDecl__Group_8_1_2_2__0"); - put(grammarAccess.getGlobalProtocolDeclAccess().getGroup_8_1_5(), "rule__GlobalProtocolDecl__Group_8_1_5__0"); - put(grammarAccess.getRoleDeclAccess().getGroup(), "rule__RoleDecl__Group__0"); - put(grammarAccess.getRoleDeclAccess().getGroup_2(), "rule__RoleDecl__Group_2__0"); - put(grammarAccess.getParameterDeclAccess().getGroup_0(), "rule__ParameterDecl__Group_0__0"); - put(grammarAccess.getParameterDeclAccess().getGroup_0_2(), "rule__ParameterDecl__Group_0_2__0"); - put(grammarAccess.getParameterDeclAccess().getGroup_1(), "rule__ParameterDecl__Group_1__0"); - put(grammarAccess.getParameterDeclAccess().getGroup_1_2(), "rule__ParameterDecl__Group_1_2__0"); - put(grammarAccess.getRoleInstantiationAccess().getGroup(), "rule__RoleInstantiation__Group__0"); - put(grammarAccess.getRoleInstantiationAccess().getGroup_1(), "rule__RoleInstantiation__Group_1__0"); - put(grammarAccess.getArgumentAccess().getGroup_0(), "rule__Argument__Group_0__0"); - put(grammarAccess.getArgumentAccess().getGroup_0_1(), "rule__Argument__Group_0_1__0"); - put(grammarAccess.getArgumentAccess().getGroup_1(), "rule__Argument__Group_1__0"); - put(grammarAccess.getArgumentAccess().getGroup_1_1(), "rule__Argument__Group_1_1__0"); - put(grammarAccess.getGlobalProtocolBlockAccess().getGroup(), "rule__GlobalProtocolBlock__Group__0"); - put(grammarAccess.getGlobalMessageTransferAccess().getGroup(), "rule__GlobalMessageTransfer__Group__0"); - put(grammarAccess.getGlobalMessageTransferAccess().getGroup_5(), "rule__GlobalMessageTransfer__Group_5__0"); - put(grammarAccess.getGlobalChoiceAccess().getGroup(), "rule__GlobalChoice__Group__0"); - put(grammarAccess.getGlobalChoiceAccess().getGroup_4(), "rule__GlobalChoice__Group_4__0"); - put(grammarAccess.getGlobalRecursionAccess().getGroup(), "rule__GlobalRecursion__Group__0"); - put(grammarAccess.getGlobalContinueAccess().getGroup(), "rule__GlobalContinue__Group__0"); - put(grammarAccess.getGlobalParallelAccess().getGroup(), "rule__GlobalParallel__Group__0"); - put(grammarAccess.getGlobalParallelAccess().getGroup_2(), "rule__GlobalParallel__Group_2__0"); - put(grammarAccess.getGlobalInterruptibleAccess().getGroup(), "rule__GlobalInterruptible__Group__0"); - put(grammarAccess.getGlobalInterruptibleAccess().getGroup_1(), "rule__GlobalInterruptible__Group_1__0"); - put(grammarAccess.getGlobalInterruptAccess().getGroup(), "rule__GlobalInterrupt__Group__0"); - put(grammarAccess.getGlobalInterruptAccess().getGroup_1(), "rule__GlobalInterrupt__Group_1__0"); - put(grammarAccess.getGlobalDoAccess().getGroup(), "rule__GlobalDo__Group__0"); - put(grammarAccess.getGlobalDoAccess().getGroup_1(), "rule__GlobalDo__Group_1__0"); - put(grammarAccess.getGlobalDoAccess().getGroup_3(), "rule__GlobalDo__Group_3__0"); - put(grammarAccess.getGlobalDoAccess().getGroup_3_2(), "rule__GlobalDo__Group_3_2__0"); - put(grammarAccess.getGlobalDoAccess().getGroup_6(), "rule__GlobalDo__Group_6__0"); - put(grammarAccess.getLocalProtocolDeclAccess().getGroup(), "rule__LocalProtocolDecl__Group__0"); - put(grammarAccess.getLocalProtocolDeclAccess().getGroup_5(), "rule__LocalProtocolDecl__Group_5__0"); - put(grammarAccess.getLocalProtocolDeclAccess().getGroup_5_2(), "rule__LocalProtocolDecl__Group_5_2__0"); - put(grammarAccess.getLocalProtocolDeclAccess().getGroup_8(), "rule__LocalProtocolDecl__Group_8__0"); - put(grammarAccess.getLocalProtocolDeclAccess().getGroup_10_1(), "rule__LocalProtocolDecl__Group_10_1__0"); - put(grammarAccess.getLocalProtocolDeclAccess().getGroup_10_1_2(), "rule__LocalProtocolDecl__Group_10_1_2__0"); - put(grammarAccess.getLocalProtocolDeclAccess().getGroup_10_1_2_2(), "rule__LocalProtocolDecl__Group_10_1_2_2__0"); - put(grammarAccess.getLocalProtocolDeclAccess().getGroup_10_1_5(), "rule__LocalProtocolDecl__Group_10_1_5__0"); - put(grammarAccess.getLocalProtocolBlockAccess().getGroup(), "rule__LocalProtocolBlock__Group__0"); - put(grammarAccess.getLocalSendAccess().getGroup(), "rule__LocalSend__Group__0"); - put(grammarAccess.getLocalSendAccess().getGroup_3(), "rule__LocalSend__Group_3__0"); - put(grammarAccess.getLocalReceiveAccess().getGroup(), "rule__LocalReceive__Group__0"); - put(grammarAccess.getLocalChoiceAccess().getGroup(), "rule__LocalChoice__Group__0"); - put(grammarAccess.getLocalChoiceAccess().getGroup_4(), "rule__LocalChoice__Group_4__0"); - put(grammarAccess.getLocalRecursionAccess().getGroup(), "rule__LocalRecursion__Group__0"); - put(grammarAccess.getLocalContinueAccess().getGroup(), "rule__LocalContinue__Group__0"); - put(grammarAccess.getLocalParallelAccess().getGroup(), "rule__LocalParallel__Group__0"); - put(grammarAccess.getLocalParallelAccess().getGroup_2(), "rule__LocalParallel__Group_2__0"); - put(grammarAccess.getLocalInterruptibleAccess().getGroup(), "rule__LocalInterruptible__Group__0"); - put(grammarAccess.getLocalInterruptibleAccess().getGroup_1(), "rule__LocalInterruptible__Group_1__0"); - put(grammarAccess.getLocalThrowAccess().getGroup(), "rule__LocalThrow__Group__0"); - put(grammarAccess.getLocalThrowAccess().getGroup_2(), "rule__LocalThrow__Group_2__0"); - put(grammarAccess.getLocalThrowAccess().getGroup_5(), "rule__LocalThrow__Group_5__0"); - put(grammarAccess.getLocalCatchAccess().getGroup(), "rule__LocalCatch__Group__0"); - put(grammarAccess.getLocalCatchAccess().getGroup_2(), "rule__LocalCatch__Group_2__0"); - put(grammarAccess.getLocalDoAccess().getGroup(), "rule__LocalDo__Group__0"); - put(grammarAccess.getLocalDoAccess().getGroup_1(), "rule__LocalDo__Group_1__0"); - put(grammarAccess.getLocalDoAccess().getGroup_3(), "rule__LocalDo__Group_3__0"); - put(grammarAccess.getLocalDoAccess().getGroup_3_2(), "rule__LocalDo__Group_3_2__0"); - put(grammarAccess.getLocalDoAccess().getGroup_6(), "rule__LocalDo__Group_6__0"); - put(grammarAccess.getModuleAccess().getNameAssignment_1(), "rule__Module__NameAssignment_1"); - put(grammarAccess.getModuleAccess().getImportsAssignment_3(), "rule__Module__ImportsAssignment_3"); - put(grammarAccess.getModuleAccess().getTypesAssignment_4(), "rule__Module__TypesAssignment_4"); - put(grammarAccess.getModuleAccess().getGlobalsAssignment_5_0(), "rule__Module__GlobalsAssignment_5_0"); - put(grammarAccess.getModuleAccess().getLocalsAssignment_5_1(), "rule__Module__LocalsAssignment_5_1"); - put(grammarAccess.getImportModuleAccess().getNameAssignment_1(), "rule__ImportModule__NameAssignment_1"); - put(grammarAccess.getImportModuleAccess().getAliasAssignment_2_1(), "rule__ImportModule__AliasAssignment_2_1"); - put(grammarAccess.getImportMemberAccess().getNameAssignment_1(), "rule__ImportMember__NameAssignment_1"); - put(grammarAccess.getImportMemberAccess().getMemberAssignment_3(), "rule__ImportMember__MemberAssignment_3"); - put(grammarAccess.getImportMemberAccess().getAliasAssignment_4_1(), "rule__ImportMember__AliasAssignment_4_1"); - put(grammarAccess.getPayloadTypeDeclAccess().getSchemaAssignment_2(), "rule__PayloadTypeDecl__SchemaAssignment_2"); - put(grammarAccess.getPayloadTypeDeclAccess().getTypeAssignment_4(), "rule__PayloadTypeDecl__TypeAssignment_4"); - put(grammarAccess.getPayloadTypeDeclAccess().getLocationAssignment_6(), "rule__PayloadTypeDecl__LocationAssignment_6"); - put(grammarAccess.getPayloadTypeDeclAccess().getAliasAssignment_8(), "rule__PayloadTypeDecl__AliasAssignment_8"); - put(grammarAccess.getMessageSignatureAccess().getOperatorAssignment_1(), "rule__MessageSignature__OperatorAssignment_1"); - put(grammarAccess.getMessageSignatureAccess().getTypesAssignment_3_0(), "rule__MessageSignature__TypesAssignment_3_0"); - put(grammarAccess.getMessageSignatureAccess().getTypesAssignment_3_1_1(), "rule__MessageSignature__TypesAssignment_3_1_1"); - put(grammarAccess.getPayloadElementAccess().getNameAssignment_0_0(), "rule__PayloadElement__NameAssignment_0_0"); - put(grammarAccess.getPayloadElementAccess().getTypeAssignment_1(), "rule__PayloadElement__TypeAssignment_1"); - put(grammarAccess.getGlobalProtocolDeclAccess().getNameAssignment_2(), "rule__GlobalProtocolDecl__NameAssignment_2"); - put(grammarAccess.getGlobalProtocolDeclAccess().getParametersAssignment_3_1(), "rule__GlobalProtocolDecl__ParametersAssignment_3_1"); - put(grammarAccess.getGlobalProtocolDeclAccess().getParametersAssignment_3_2_1(), "rule__GlobalProtocolDecl__ParametersAssignment_3_2_1"); - put(grammarAccess.getGlobalProtocolDeclAccess().getRolesAssignment_5(), "rule__GlobalProtocolDecl__RolesAssignment_5"); - put(grammarAccess.getGlobalProtocolDeclAccess().getRolesAssignment_6_1(), "rule__GlobalProtocolDecl__RolesAssignment_6_1"); - put(grammarAccess.getGlobalProtocolDeclAccess().getBlockAssignment_8_0(), "rule__GlobalProtocolDecl__BlockAssignment_8_0"); - put(grammarAccess.getGlobalProtocolDeclAccess().getInstantiatesAssignment_8_1_1(), "rule__GlobalProtocolDecl__InstantiatesAssignment_8_1_1"); - put(grammarAccess.getGlobalProtocolDeclAccess().getArgumentsAssignment_8_1_2_1(), "rule__GlobalProtocolDecl__ArgumentsAssignment_8_1_2_1"); - put(grammarAccess.getGlobalProtocolDeclAccess().getArgumentsAssignment_8_1_2_2_1(), "rule__GlobalProtocolDecl__ArgumentsAssignment_8_1_2_2_1"); - put(grammarAccess.getGlobalProtocolDeclAccess().getRoleInstantiationsAssignment_8_1_4(), "rule__GlobalProtocolDecl__RoleInstantiationsAssignment_8_1_4"); - put(grammarAccess.getGlobalProtocolDeclAccess().getRoleInstantiationsAssignment_8_1_5_1(), "rule__GlobalProtocolDecl__RoleInstantiationsAssignment_8_1_5_1"); - put(grammarAccess.getRoleDeclAccess().getNameAssignment_1(), "rule__RoleDecl__NameAssignment_1"); - put(grammarAccess.getRoleDeclAccess().getAliasAssignment_2_1(), "rule__RoleDecl__AliasAssignment_2_1"); - put(grammarAccess.getParameterDeclAccess().getNameAssignment_0_1(), "rule__ParameterDecl__NameAssignment_0_1"); - put(grammarAccess.getParameterDeclAccess().getAliasAssignment_0_2_1(), "rule__ParameterDecl__AliasAssignment_0_2_1"); - put(grammarAccess.getParameterDeclAccess().getNameAssignment_1_1(), "rule__ParameterDecl__NameAssignment_1_1"); - put(grammarAccess.getParameterDeclAccess().getAliasAssignment_1_2_1(), "rule__ParameterDecl__AliasAssignment_1_2_1"); - put(grammarAccess.getRoleInstantiationAccess().getNameAssignment_0(), "rule__RoleInstantiation__NameAssignment_0"); - put(grammarAccess.getRoleInstantiationAccess().getAliasAssignment_1_1(), "rule__RoleInstantiation__AliasAssignment_1_1"); - put(grammarAccess.getArgumentAccess().getSignatureAssignment_0_0(), "rule__Argument__SignatureAssignment_0_0"); - put(grammarAccess.getArgumentAccess().getAliasAssignment_0_1_1(), "rule__Argument__AliasAssignment_0_1_1"); - put(grammarAccess.getArgumentAccess().getNameAssignment_1_0(), "rule__Argument__NameAssignment_1_0"); - put(grammarAccess.getArgumentAccess().getAliasAssignment_1_1_1(), "rule__Argument__AliasAssignment_1_1_1"); - put(grammarAccess.getGlobalProtocolBlockAccess().getActivitiesAssignment_2(), "rule__GlobalProtocolBlock__ActivitiesAssignment_2"); - put(grammarAccess.getGlobalMessageTransferAccess().getMessageAssignment_0(), "rule__GlobalMessageTransfer__MessageAssignment_0"); - put(grammarAccess.getGlobalMessageTransferAccess().getFromRoleAssignment_2(), "rule__GlobalMessageTransfer__FromRoleAssignment_2"); - put(grammarAccess.getGlobalMessageTransferAccess().getToRolesAssignment_4(), "rule__GlobalMessageTransfer__ToRolesAssignment_4"); - put(grammarAccess.getGlobalMessageTransferAccess().getToRolesAssignment_5_1(), "rule__GlobalMessageTransfer__ToRolesAssignment_5_1"); - put(grammarAccess.getMessageAccess().getSignatureAssignment_0(), "rule__Message__SignatureAssignment_0"); - put(grammarAccess.getMessageAccess().getParameterAssignment_1(), "rule__Message__ParameterAssignment_1"); - put(grammarAccess.getGlobalChoiceAccess().getRoleAssignment_2(), "rule__GlobalChoice__RoleAssignment_2"); - put(grammarAccess.getGlobalChoiceAccess().getBlocksAssignment_3(), "rule__GlobalChoice__BlocksAssignment_3"); - put(grammarAccess.getGlobalChoiceAccess().getBlocksAssignment_4_1(), "rule__GlobalChoice__BlocksAssignment_4_1"); - put(grammarAccess.getGlobalRecursionAccess().getLabelAssignment_1(), "rule__GlobalRecursion__LabelAssignment_1"); - put(grammarAccess.getGlobalRecursionAccess().getBlockAssignment_2(), "rule__GlobalRecursion__BlockAssignment_2"); - put(grammarAccess.getGlobalContinueAccess().getLabelAssignment_1(), "rule__GlobalContinue__LabelAssignment_1"); - put(grammarAccess.getGlobalParallelAccess().getBlocksAssignment_1(), "rule__GlobalParallel__BlocksAssignment_1"); - put(grammarAccess.getGlobalParallelAccess().getBlocksAssignment_2_1(), "rule__GlobalParallel__BlocksAssignment_2_1"); - put(grammarAccess.getGlobalInterruptibleAccess().getScopeAssignment_1_0(), "rule__GlobalInterruptible__ScopeAssignment_1_0"); - put(grammarAccess.getGlobalInterruptibleAccess().getBlockAssignment_2(), "rule__GlobalInterruptible__BlockAssignment_2"); - put(grammarAccess.getGlobalInterruptibleAccess().getInterruptsAssignment_5(), "rule__GlobalInterruptible__InterruptsAssignment_5"); - put(grammarAccess.getGlobalInterruptAccess().getMessagesAssignment_0(), "rule__GlobalInterrupt__MessagesAssignment_0"); - put(grammarAccess.getGlobalInterruptAccess().getMessagesAssignment_1_1(), "rule__GlobalInterrupt__MessagesAssignment_1_1"); - put(grammarAccess.getGlobalInterruptAccess().getRoleAssignment_3(), "rule__GlobalInterrupt__RoleAssignment_3"); - put(grammarAccess.getGlobalDoAccess().getScopeAssignment_1_0(), "rule__GlobalDo__ScopeAssignment_1_0"); - put(grammarAccess.getGlobalDoAccess().getMemberAssignment_2(), "rule__GlobalDo__MemberAssignment_2"); - put(grammarAccess.getGlobalDoAccess().getArgumentsAssignment_3_1(), "rule__GlobalDo__ArgumentsAssignment_3_1"); - put(grammarAccess.getGlobalDoAccess().getArgumentsAssignment_3_2_1(), "rule__GlobalDo__ArgumentsAssignment_3_2_1"); - put(grammarAccess.getGlobalDoAccess().getRolesAssignment_5(), "rule__GlobalDo__RolesAssignment_5"); - put(grammarAccess.getGlobalDoAccess().getRolesAssignment_6_1(), "rule__GlobalDo__RolesAssignment_6_1"); - put(grammarAccess.getLocalProtocolDeclAccess().getNameAssignment_2(), "rule__LocalProtocolDecl__NameAssignment_2"); - put(grammarAccess.getLocalProtocolDeclAccess().getRoleAssignment_4(), "rule__LocalProtocolDecl__RoleAssignment_4"); - put(grammarAccess.getLocalProtocolDeclAccess().getParametersAssignment_5_1(), "rule__LocalProtocolDecl__ParametersAssignment_5_1"); - put(grammarAccess.getLocalProtocolDeclAccess().getParametersAssignment_5_2_1(), "rule__LocalProtocolDecl__ParametersAssignment_5_2_1"); - put(grammarAccess.getLocalProtocolDeclAccess().getRolesAssignment_7(), "rule__LocalProtocolDecl__RolesAssignment_7"); - put(grammarAccess.getLocalProtocolDeclAccess().getRolesAssignment_8_1(), "rule__LocalProtocolDecl__RolesAssignment_8_1"); - put(grammarAccess.getLocalProtocolDeclAccess().getBlockAssignment_10_0(), "rule__LocalProtocolDecl__BlockAssignment_10_0"); - put(grammarAccess.getLocalProtocolDeclAccess().getInstantiatesAssignment_10_1_1(), "rule__LocalProtocolDecl__InstantiatesAssignment_10_1_1"); - put(grammarAccess.getLocalProtocolDeclAccess().getArgumentsAssignment_10_1_2_1(), "rule__LocalProtocolDecl__ArgumentsAssignment_10_1_2_1"); - put(grammarAccess.getLocalProtocolDeclAccess().getArgumentsAssignment_10_1_2_2_1(), "rule__LocalProtocolDecl__ArgumentsAssignment_10_1_2_2_1"); - put(grammarAccess.getLocalProtocolDeclAccess().getRoleInstantiationsAssignment_10_1_4(), "rule__LocalProtocolDecl__RoleInstantiationsAssignment_10_1_4"); - put(grammarAccess.getLocalProtocolDeclAccess().getRoleInstantiationsAssignment_10_1_5_1(), "rule__LocalProtocolDecl__RoleInstantiationsAssignment_10_1_5_1"); - put(grammarAccess.getLocalProtocolBlockAccess().getActivitiesAssignment_2(), "rule__LocalProtocolBlock__ActivitiesAssignment_2"); - put(grammarAccess.getLocalSendAccess().getMessageAssignment_0(), "rule__LocalSend__MessageAssignment_0"); - put(grammarAccess.getLocalSendAccess().getToRolesAssignment_2(), "rule__LocalSend__ToRolesAssignment_2"); - put(grammarAccess.getLocalSendAccess().getToRolesAssignment_3_1(), "rule__LocalSend__ToRolesAssignment_3_1"); - put(grammarAccess.getLocalReceiveAccess().getMessageAssignment_0(), "rule__LocalReceive__MessageAssignment_0"); - put(grammarAccess.getLocalReceiveAccess().getFromRoleAssignment_2(), "rule__LocalReceive__FromRoleAssignment_2"); - put(grammarAccess.getLocalChoiceAccess().getRoleAssignment_2(), "rule__LocalChoice__RoleAssignment_2"); - put(grammarAccess.getLocalChoiceAccess().getBlocksAssignment_3(), "rule__LocalChoice__BlocksAssignment_3"); - put(grammarAccess.getLocalChoiceAccess().getBlocksAssignment_4_1(), "rule__LocalChoice__BlocksAssignment_4_1"); - put(grammarAccess.getLocalRecursionAccess().getLabelAssignment_1(), "rule__LocalRecursion__LabelAssignment_1"); - put(grammarAccess.getLocalRecursionAccess().getBlockAssignment_2(), "rule__LocalRecursion__BlockAssignment_2"); - put(grammarAccess.getLocalContinueAccess().getLabelAssignment_1(), "rule__LocalContinue__LabelAssignment_1"); - put(grammarAccess.getLocalParallelAccess().getBlocksAssignment_1(), "rule__LocalParallel__BlocksAssignment_1"); - put(grammarAccess.getLocalParallelAccess().getBlocksAssignment_2_1(), "rule__LocalParallel__BlocksAssignment_2_1"); - put(grammarAccess.getLocalInterruptibleAccess().getScopeAssignment_1_0(), "rule__LocalInterruptible__ScopeAssignment_1_0"); - put(grammarAccess.getLocalInterruptibleAccess().getBlockAssignment_2(), "rule__LocalInterruptible__BlockAssignment_2"); - put(grammarAccess.getLocalInterruptibleAccess().getThrowAssignment_5(), "rule__LocalInterruptible__ThrowAssignment_5"); - put(grammarAccess.getLocalInterruptibleAccess().getCatchesAssignment_6(), "rule__LocalInterruptible__CatchesAssignment_6"); - put(grammarAccess.getLocalThrowAccess().getMessagesAssignment_1(), "rule__LocalThrow__MessagesAssignment_1"); - put(grammarAccess.getLocalThrowAccess().getMessagesAssignment_2_1(), "rule__LocalThrow__MessagesAssignment_2_1"); - put(grammarAccess.getLocalThrowAccess().getToRolesAssignment_4(), "rule__LocalThrow__ToRolesAssignment_4"); - put(grammarAccess.getLocalThrowAccess().getToRolesAssignment_5_1(), "rule__LocalThrow__ToRolesAssignment_5_1"); - put(grammarAccess.getLocalCatchAccess().getMessagesAssignment_1(), "rule__LocalCatch__MessagesAssignment_1"); - put(grammarAccess.getLocalCatchAccess().getMessagesAssignment_2_1(), "rule__LocalCatch__MessagesAssignment_2_1"); - put(grammarAccess.getLocalCatchAccess().getFromRoleAssignment_4(), "rule__LocalCatch__FromRoleAssignment_4"); - put(grammarAccess.getLocalDoAccess().getScopeAssignment_1_0(), "rule__LocalDo__ScopeAssignment_1_0"); - put(grammarAccess.getLocalDoAccess().getMemberAssignment_2(), "rule__LocalDo__MemberAssignment_2"); - put(grammarAccess.getLocalDoAccess().getArgumentsAssignment_3_1(), "rule__LocalDo__ArgumentsAssignment_3_1"); - put(grammarAccess.getLocalDoAccess().getArgumentsAssignment_3_2_1(), "rule__LocalDo__ArgumentsAssignment_3_2_1"); - put(grammarAccess.getLocalDoAccess().getRolesAssignment_5(), "rule__LocalDo__RolesAssignment_5"); - put(grammarAccess.getLocalDoAccess().getRolesAssignment_6_1(), "rule__LocalDo__RolesAssignment_6_1"); - } - }; - } - return nameMappings.get(element); - } - - @Override - protected Collection getFollowElements(AbstractInternalContentAssistParser parser) { - try { - org.scribble.editor.dsl.ui.contentassist.antlr.internal.InternalScribbleDslParser typedParser = (org.scribble.editor.dsl.ui.contentassist.antlr.internal.InternalScribbleDslParser) parser; - typedParser.entryRuleModule(); - return typedParser.getFollowElements(); - } catch(RecognitionException ex) { - throw new RuntimeException(ex); - } - } - - @Override - protected String[] getInitialHiddenTokens() { - return new String[] { "RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT" }; - } - - public ScribbleDslGrammarAccess getGrammarAccess() { - return this.grammarAccess; - } - - public void setGrammarAccess(ScribbleDslGrammarAccess grammarAccess) { - this.grammarAccess = grammarAccess; - } -} diff --git a/tools/eclipse/plugins/org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g b/tools/eclipse/plugins/org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g deleted file mode 100644 index 581135c89..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g +++ /dev/null @@ -1,12204 +0,0 @@ -/* -* generated by Xtext -*/ -grammar InternalScribbleDsl; - -options { - superClass=AbstractInternalContentAssistParser; - -} - -@lexer::header { -package org.scribble.editor.dsl.ui.contentassist.antlr.internal; - -// Hack: Use our own Lexer superclass by means of import. -// Currently there is no other way to specify the superclass for the lexer. -import org.eclipse.xtext.ui.editor.contentassist.antlr.internal.Lexer; -} - -@parser::header { -package org.scribble.editor.dsl.ui.contentassist.antlr.internal; - -import java.io.InputStream; -import org.eclipse.xtext.*; -import org.eclipse.xtext.parser.*; -import org.eclipse.xtext.parser.impl.*; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.xtext.parser.antlr.XtextTokenStream; -import org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens; -import org.eclipse.xtext.ui.editor.contentassist.antlr.internal.AbstractInternalContentAssistParser; -import org.eclipse.xtext.ui.editor.contentassist.antlr.internal.DFA; -import org.scribble.editor.dsl.services.ScribbleDslGrammarAccess; - -} - -@parser::members { - - private ScribbleDslGrammarAccess grammarAccess; - - public void setGrammarAccess(ScribbleDslGrammarAccess grammarAccess) { - this.grammarAccess = grammarAccess; - } - - @Override - protected Grammar getGrammar() { - return grammarAccess.getGrammar(); - } - - @Override - protected String getValueForTokenName(String tokenName) { - return tokenName; - } - -} - - - - -// Entry rule entryRuleModule -entryRuleModule -: -{ before(grammarAccess.getModuleRule()); } - ruleModule -{ after(grammarAccess.getModuleRule()); } - EOF -; - -// Rule Module -ruleModule - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getModuleAccess().getGroup()); } -(rule__Module__Group__0) -{ after(grammarAccess.getModuleAccess().getGroup()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRuleModuleName -entryRuleModuleName -: -{ before(grammarAccess.getModuleNameRule()); } - ruleModuleName -{ after(grammarAccess.getModuleNameRule()); } - EOF -; - -// Rule ModuleName -ruleModuleName - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getModuleNameAccess().getGroup()); } -(rule__ModuleName__Group__0) -{ after(grammarAccess.getModuleNameAccess().getGroup()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRuleImportDecl -entryRuleImportDecl -: -{ before(grammarAccess.getImportDeclRule()); } - ruleImportDecl -{ after(grammarAccess.getImportDeclRule()); } - EOF -; - -// Rule ImportDecl -ruleImportDecl - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getImportDeclAccess().getAlternatives()); } -(rule__ImportDecl__Alternatives) -{ after(grammarAccess.getImportDeclAccess().getAlternatives()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRuleImportModule -entryRuleImportModule -: -{ before(grammarAccess.getImportModuleRule()); } - ruleImportModule -{ after(grammarAccess.getImportModuleRule()); } - EOF -; - -// Rule ImportModule -ruleImportModule - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getImportModuleAccess().getGroup()); } -(rule__ImportModule__Group__0) -{ after(grammarAccess.getImportModuleAccess().getGroup()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRuleImportMember -entryRuleImportMember -: -{ before(grammarAccess.getImportMemberRule()); } - ruleImportMember -{ after(grammarAccess.getImportMemberRule()); } - EOF -; - -// Rule ImportMember -ruleImportMember - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getImportMemberAccess().getGroup()); } -(rule__ImportMember__Group__0) -{ after(grammarAccess.getImportMemberAccess().getGroup()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRulePayloadTypeDecl -entryRulePayloadTypeDecl -: -{ before(grammarAccess.getPayloadTypeDeclRule()); } - rulePayloadTypeDecl -{ after(grammarAccess.getPayloadTypeDeclRule()); } - EOF -; - -// Rule PayloadTypeDecl -rulePayloadTypeDecl - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getPayloadTypeDeclAccess().getGroup()); } -(rule__PayloadTypeDecl__Group__0) -{ after(grammarAccess.getPayloadTypeDeclAccess().getGroup()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRuleMessageSignature -entryRuleMessageSignature -: -{ before(grammarAccess.getMessageSignatureRule()); } - ruleMessageSignature -{ after(grammarAccess.getMessageSignatureRule()); } - EOF -; - -// Rule MessageSignature -ruleMessageSignature - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getMessageSignatureAccess().getGroup()); } -(rule__MessageSignature__Group__0) -{ after(grammarAccess.getMessageSignatureAccess().getGroup()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRulePayloadElement -entryRulePayloadElement -: -{ before(grammarAccess.getPayloadElementRule()); } - rulePayloadElement -{ after(grammarAccess.getPayloadElementRule()); } - EOF -; - -// Rule PayloadElement -rulePayloadElement - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getPayloadElementAccess().getGroup()); } -(rule__PayloadElement__Group__0) -{ after(grammarAccess.getPayloadElementAccess().getGroup()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRuleGlobalProtocolDecl -entryRuleGlobalProtocolDecl -: -{ before(grammarAccess.getGlobalProtocolDeclRule()); } - ruleGlobalProtocolDecl -{ after(grammarAccess.getGlobalProtocolDeclRule()); } - EOF -; - -// Rule GlobalProtocolDecl -ruleGlobalProtocolDecl - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getGroup()); } -(rule__GlobalProtocolDecl__Group__0) -{ after(grammarAccess.getGlobalProtocolDeclAccess().getGroup()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRuleRoleDecl -entryRuleRoleDecl -: -{ before(grammarAccess.getRoleDeclRule()); } - ruleRoleDecl -{ after(grammarAccess.getRoleDeclRule()); } - EOF -; - -// Rule RoleDecl -ruleRoleDecl - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getRoleDeclAccess().getGroup()); } -(rule__RoleDecl__Group__0) -{ after(grammarAccess.getRoleDeclAccess().getGroup()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRuleParameterDecl -entryRuleParameterDecl -: -{ before(grammarAccess.getParameterDeclRule()); } - ruleParameterDecl -{ after(grammarAccess.getParameterDeclRule()); } - EOF -; - -// Rule ParameterDecl -ruleParameterDecl - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getParameterDeclAccess().getAlternatives()); } -(rule__ParameterDecl__Alternatives) -{ after(grammarAccess.getParameterDeclAccess().getAlternatives()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRuleRoleInstantiation -entryRuleRoleInstantiation -: -{ before(grammarAccess.getRoleInstantiationRule()); } - ruleRoleInstantiation -{ after(grammarAccess.getRoleInstantiationRule()); } - EOF -; - -// Rule RoleInstantiation -ruleRoleInstantiation - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getRoleInstantiationAccess().getGroup()); } -(rule__RoleInstantiation__Group__0) -{ after(grammarAccess.getRoleInstantiationAccess().getGroup()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRuleArgument -entryRuleArgument -: -{ before(grammarAccess.getArgumentRule()); } - ruleArgument -{ after(grammarAccess.getArgumentRule()); } - EOF -; - -// Rule Argument -ruleArgument - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getArgumentAccess().getAlternatives()); } -(rule__Argument__Alternatives) -{ after(grammarAccess.getArgumentAccess().getAlternatives()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRuleGlobalProtocolBlock -entryRuleGlobalProtocolBlock -: -{ before(grammarAccess.getGlobalProtocolBlockRule()); } - ruleGlobalProtocolBlock -{ after(grammarAccess.getGlobalProtocolBlockRule()); } - EOF -; - -// Rule GlobalProtocolBlock -ruleGlobalProtocolBlock - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getGlobalProtocolBlockAccess().getGroup()); } -(rule__GlobalProtocolBlock__Group__0) -{ after(grammarAccess.getGlobalProtocolBlockAccess().getGroup()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRuleGlobalInteraction -entryRuleGlobalInteraction -: -{ before(grammarAccess.getGlobalInteractionRule()); } - ruleGlobalInteraction -{ after(grammarAccess.getGlobalInteractionRule()); } - EOF -; - -// Rule GlobalInteraction -ruleGlobalInteraction - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getGlobalInteractionAccess().getAlternatives()); } -(rule__GlobalInteraction__Alternatives) -{ after(grammarAccess.getGlobalInteractionAccess().getAlternatives()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRuleGlobalMessageTransfer -entryRuleGlobalMessageTransfer -: -{ before(grammarAccess.getGlobalMessageTransferRule()); } - ruleGlobalMessageTransfer -{ after(grammarAccess.getGlobalMessageTransferRule()); } - EOF -; - -// Rule GlobalMessageTransfer -ruleGlobalMessageTransfer - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getGlobalMessageTransferAccess().getGroup()); } -(rule__GlobalMessageTransfer__Group__0) -{ after(grammarAccess.getGlobalMessageTransferAccess().getGroup()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRuleMessage -entryRuleMessage -: -{ before(grammarAccess.getMessageRule()); } - ruleMessage -{ after(grammarAccess.getMessageRule()); } - EOF -; - -// Rule Message -ruleMessage - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getMessageAccess().getAlternatives()); } -(rule__Message__Alternatives) -{ after(grammarAccess.getMessageAccess().getAlternatives()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRuleGlobalChoice -entryRuleGlobalChoice -: -{ before(grammarAccess.getGlobalChoiceRule()); } - ruleGlobalChoice -{ after(grammarAccess.getGlobalChoiceRule()); } - EOF -; - -// Rule GlobalChoice -ruleGlobalChoice - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getGlobalChoiceAccess().getGroup()); } -(rule__GlobalChoice__Group__0) -{ after(grammarAccess.getGlobalChoiceAccess().getGroup()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRuleGlobalRecursion -entryRuleGlobalRecursion -: -{ before(grammarAccess.getGlobalRecursionRule()); } - ruleGlobalRecursion -{ after(grammarAccess.getGlobalRecursionRule()); } - EOF -; - -// Rule GlobalRecursion -ruleGlobalRecursion - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getGlobalRecursionAccess().getGroup()); } -(rule__GlobalRecursion__Group__0) -{ after(grammarAccess.getGlobalRecursionAccess().getGroup()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRuleGlobalContinue -entryRuleGlobalContinue -: -{ before(grammarAccess.getGlobalContinueRule()); } - ruleGlobalContinue -{ after(grammarAccess.getGlobalContinueRule()); } - EOF -; - -// Rule GlobalContinue -ruleGlobalContinue - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getGlobalContinueAccess().getGroup()); } -(rule__GlobalContinue__Group__0) -{ after(grammarAccess.getGlobalContinueAccess().getGroup()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRuleGlobalParallel -entryRuleGlobalParallel -: -{ before(grammarAccess.getGlobalParallelRule()); } - ruleGlobalParallel -{ after(grammarAccess.getGlobalParallelRule()); } - EOF -; - -// Rule GlobalParallel -ruleGlobalParallel - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getGlobalParallelAccess().getGroup()); } -(rule__GlobalParallel__Group__0) -{ after(grammarAccess.getGlobalParallelAccess().getGroup()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRuleGlobalInterruptible -entryRuleGlobalInterruptible -: -{ before(grammarAccess.getGlobalInterruptibleRule()); } - ruleGlobalInterruptible -{ after(grammarAccess.getGlobalInterruptibleRule()); } - EOF -; - -// Rule GlobalInterruptible -ruleGlobalInterruptible - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getGlobalInterruptibleAccess().getGroup()); } -(rule__GlobalInterruptible__Group__0) -{ after(grammarAccess.getGlobalInterruptibleAccess().getGroup()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRuleGlobalInterrupt -entryRuleGlobalInterrupt -: -{ before(grammarAccess.getGlobalInterruptRule()); } - ruleGlobalInterrupt -{ after(grammarAccess.getGlobalInterruptRule()); } - EOF -; - -// Rule GlobalInterrupt -ruleGlobalInterrupt - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getGlobalInterruptAccess().getGroup()); } -(rule__GlobalInterrupt__Group__0) -{ after(grammarAccess.getGlobalInterruptAccess().getGroup()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRuleGlobalDo -entryRuleGlobalDo -: -{ before(grammarAccess.getGlobalDoRule()); } - ruleGlobalDo -{ after(grammarAccess.getGlobalDoRule()); } - EOF -; - -// Rule GlobalDo -ruleGlobalDo - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getGlobalDoAccess().getGroup()); } -(rule__GlobalDo__Group__0) -{ after(grammarAccess.getGlobalDoAccess().getGroup()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRuleLocalProtocolDecl -entryRuleLocalProtocolDecl -: -{ before(grammarAccess.getLocalProtocolDeclRule()); } - ruleLocalProtocolDecl -{ after(grammarAccess.getLocalProtocolDeclRule()); } - EOF -; - -// Rule LocalProtocolDecl -ruleLocalProtocolDecl - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getGroup()); } -(rule__LocalProtocolDecl__Group__0) -{ after(grammarAccess.getLocalProtocolDeclAccess().getGroup()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRuleLocalProtocolBlock -entryRuleLocalProtocolBlock -: -{ before(grammarAccess.getLocalProtocolBlockRule()); } - ruleLocalProtocolBlock -{ after(grammarAccess.getLocalProtocolBlockRule()); } - EOF -; - -// Rule LocalProtocolBlock -ruleLocalProtocolBlock - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getLocalProtocolBlockAccess().getGroup()); } -(rule__LocalProtocolBlock__Group__0) -{ after(grammarAccess.getLocalProtocolBlockAccess().getGroup()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRuleLlobalInteraction -entryRuleLlobalInteraction -: -{ before(grammarAccess.getLlobalInteractionRule()); } - ruleLlobalInteraction -{ after(grammarAccess.getLlobalInteractionRule()); } - EOF -; - -// Rule LlobalInteraction -ruleLlobalInteraction - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getLlobalInteractionAccess().getAlternatives()); } -(rule__LlobalInteraction__Alternatives) -{ after(grammarAccess.getLlobalInteractionAccess().getAlternatives()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRuleLocalSend -entryRuleLocalSend -: -{ before(grammarAccess.getLocalSendRule()); } - ruleLocalSend -{ after(grammarAccess.getLocalSendRule()); } - EOF -; - -// Rule LocalSend -ruleLocalSend - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getLocalSendAccess().getGroup()); } -(rule__LocalSend__Group__0) -{ after(grammarAccess.getLocalSendAccess().getGroup()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRuleLocalReceive -entryRuleLocalReceive -: -{ before(grammarAccess.getLocalReceiveRule()); } - ruleLocalReceive -{ after(grammarAccess.getLocalReceiveRule()); } - EOF -; - -// Rule LocalReceive -ruleLocalReceive - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getLocalReceiveAccess().getGroup()); } -(rule__LocalReceive__Group__0) -{ after(grammarAccess.getLocalReceiveAccess().getGroup()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRuleLocalChoice -entryRuleLocalChoice -: -{ before(grammarAccess.getLocalChoiceRule()); } - ruleLocalChoice -{ after(grammarAccess.getLocalChoiceRule()); } - EOF -; - -// Rule LocalChoice -ruleLocalChoice - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getLocalChoiceAccess().getGroup()); } -(rule__LocalChoice__Group__0) -{ after(grammarAccess.getLocalChoiceAccess().getGroup()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRuleLocalRecursion -entryRuleLocalRecursion -: -{ before(grammarAccess.getLocalRecursionRule()); } - ruleLocalRecursion -{ after(grammarAccess.getLocalRecursionRule()); } - EOF -; - -// Rule LocalRecursion -ruleLocalRecursion - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getLocalRecursionAccess().getGroup()); } -(rule__LocalRecursion__Group__0) -{ after(grammarAccess.getLocalRecursionAccess().getGroup()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRuleLocalContinue -entryRuleLocalContinue -: -{ before(grammarAccess.getLocalContinueRule()); } - ruleLocalContinue -{ after(grammarAccess.getLocalContinueRule()); } - EOF -; - -// Rule LocalContinue -ruleLocalContinue - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getLocalContinueAccess().getGroup()); } -(rule__LocalContinue__Group__0) -{ after(grammarAccess.getLocalContinueAccess().getGroup()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRuleLocalParallel -entryRuleLocalParallel -: -{ before(grammarAccess.getLocalParallelRule()); } - ruleLocalParallel -{ after(grammarAccess.getLocalParallelRule()); } - EOF -; - -// Rule LocalParallel -ruleLocalParallel - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getLocalParallelAccess().getGroup()); } -(rule__LocalParallel__Group__0) -{ after(grammarAccess.getLocalParallelAccess().getGroup()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRuleLocalInterruptible -entryRuleLocalInterruptible -: -{ before(grammarAccess.getLocalInterruptibleRule()); } - ruleLocalInterruptible -{ after(grammarAccess.getLocalInterruptibleRule()); } - EOF -; - -// Rule LocalInterruptible -ruleLocalInterruptible - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getLocalInterruptibleAccess().getGroup()); } -(rule__LocalInterruptible__Group__0) -{ after(grammarAccess.getLocalInterruptibleAccess().getGroup()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRuleLocalThrow -entryRuleLocalThrow -: -{ before(grammarAccess.getLocalThrowRule()); } - ruleLocalThrow -{ after(grammarAccess.getLocalThrowRule()); } - EOF -; - -// Rule LocalThrow -ruleLocalThrow - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getLocalThrowAccess().getGroup()); } -(rule__LocalThrow__Group__0) -{ after(grammarAccess.getLocalThrowAccess().getGroup()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRuleLocalCatch -entryRuleLocalCatch -: -{ before(grammarAccess.getLocalCatchRule()); } - ruleLocalCatch -{ after(grammarAccess.getLocalCatchRule()); } - EOF -; - -// Rule LocalCatch -ruleLocalCatch - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getLocalCatchAccess().getGroup()); } -(rule__LocalCatch__Group__0) -{ after(grammarAccess.getLocalCatchAccess().getGroup()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRuleLocalDo -entryRuleLocalDo -: -{ before(grammarAccess.getLocalDoRule()); } - ruleLocalDo -{ after(grammarAccess.getLocalDoRule()); } - EOF -; - -// Rule LocalDo -ruleLocalDo - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getLocalDoAccess().getGroup()); } -(rule__LocalDo__Group__0) -{ after(grammarAccess.getLocalDoAccess().getGroup()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - -rule__Module__Alternatives_5 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getModuleAccess().getGlobalsAssignment_5_0()); } -(rule__Module__GlobalsAssignment_5_0) -{ after(grammarAccess.getModuleAccess().getGlobalsAssignment_5_0()); } -) - - |( -{ before(grammarAccess.getModuleAccess().getLocalsAssignment_5_1()); } -(rule__Module__LocalsAssignment_5_1) -{ after(grammarAccess.getModuleAccess().getLocalsAssignment_5_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__ImportDecl__Alternatives - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getImportDeclAccess().getImportModuleParserRuleCall_0()); } - ruleImportModule -{ after(grammarAccess.getImportDeclAccess().getImportModuleParserRuleCall_0()); } -) - - |( -{ before(grammarAccess.getImportDeclAccess().getImportMemberParserRuleCall_1()); } - ruleImportMember -{ after(grammarAccess.getImportDeclAccess().getImportMemberParserRuleCall_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__Alternatives_8 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getBlockAssignment_8_0()); } -(rule__GlobalProtocolDecl__BlockAssignment_8_0) -{ after(grammarAccess.getGlobalProtocolDeclAccess().getBlockAssignment_8_0()); } -) - - |( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getGroup_8_1()); } -(rule__GlobalProtocolDecl__Group_8_1__0) -{ after(grammarAccess.getGlobalProtocolDeclAccess().getGroup_8_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__ParameterDecl__Alternatives - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getParameterDeclAccess().getGroup_0()); } -(rule__ParameterDecl__Group_0__0) -{ after(grammarAccess.getParameterDeclAccess().getGroup_0()); } -) - - |( -{ before(grammarAccess.getParameterDeclAccess().getGroup_1()); } -(rule__ParameterDecl__Group_1__0) -{ after(grammarAccess.getParameterDeclAccess().getGroup_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__Argument__Alternatives - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getArgumentAccess().getGroup_0()); } -(rule__Argument__Group_0__0) -{ after(grammarAccess.getArgumentAccess().getGroup_0()); } -) - - |( -{ before(grammarAccess.getArgumentAccess().getGroup_1()); } -(rule__Argument__Group_1__0) -{ after(grammarAccess.getArgumentAccess().getGroup_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalInteraction__Alternatives - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalInteractionAccess().getGlobalMessageTransferParserRuleCall_0()); } - ruleGlobalMessageTransfer -{ after(grammarAccess.getGlobalInteractionAccess().getGlobalMessageTransferParserRuleCall_0()); } -) - - |( -{ before(grammarAccess.getGlobalInteractionAccess().getGlobalChoiceParserRuleCall_1()); } - ruleGlobalChoice -{ after(grammarAccess.getGlobalInteractionAccess().getGlobalChoiceParserRuleCall_1()); } -) - - |( -{ before(grammarAccess.getGlobalInteractionAccess().getGlobalRecursionParserRuleCall_2()); } - ruleGlobalRecursion -{ after(grammarAccess.getGlobalInteractionAccess().getGlobalRecursionParserRuleCall_2()); } -) - - |( -{ before(grammarAccess.getGlobalInteractionAccess().getGlobalContinueParserRuleCall_3()); } - ruleGlobalContinue -{ after(grammarAccess.getGlobalInteractionAccess().getGlobalContinueParserRuleCall_3()); } -) - - |( -{ before(grammarAccess.getGlobalInteractionAccess().getGlobalParallelParserRuleCall_4()); } - ruleGlobalParallel -{ after(grammarAccess.getGlobalInteractionAccess().getGlobalParallelParserRuleCall_4()); } -) - - |( -{ before(grammarAccess.getGlobalInteractionAccess().getGlobalInterruptibleParserRuleCall_5()); } - ruleGlobalInterruptible -{ after(grammarAccess.getGlobalInteractionAccess().getGlobalInterruptibleParserRuleCall_5()); } -) - - |( -{ before(grammarAccess.getGlobalInteractionAccess().getGlobalDoParserRuleCall_6()); } - ruleGlobalDo -{ after(grammarAccess.getGlobalInteractionAccess().getGlobalDoParserRuleCall_6()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__Message__Alternatives - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getMessageAccess().getSignatureAssignment_0()); } -(rule__Message__SignatureAssignment_0) -{ after(grammarAccess.getMessageAccess().getSignatureAssignment_0()); } -) - - |( -{ before(grammarAccess.getMessageAccess().getParameterAssignment_1()); } -(rule__Message__ParameterAssignment_1) -{ after(grammarAccess.getMessageAccess().getParameterAssignment_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__Alternatives_10 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getBlockAssignment_10_0()); } -(rule__LocalProtocolDecl__BlockAssignment_10_0) -{ after(grammarAccess.getLocalProtocolDeclAccess().getBlockAssignment_10_0()); } -) - - |( -{ before(grammarAccess.getLocalProtocolDeclAccess().getGroup_10_1()); } -(rule__LocalProtocolDecl__Group_10_1__0) -{ after(grammarAccess.getLocalProtocolDeclAccess().getGroup_10_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LlobalInteraction__Alternatives - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLlobalInteractionAccess().getLocalSendParserRuleCall_0()); } - ruleLocalSend -{ after(grammarAccess.getLlobalInteractionAccess().getLocalSendParserRuleCall_0()); } -) - - |( -{ before(grammarAccess.getLlobalInteractionAccess().getLocalReceiveParserRuleCall_1()); } - ruleLocalReceive -{ after(grammarAccess.getLlobalInteractionAccess().getLocalReceiveParserRuleCall_1()); } -) - - |( -{ before(grammarAccess.getLlobalInteractionAccess().getLocalChoiceParserRuleCall_2()); } - ruleLocalChoice -{ after(grammarAccess.getLlobalInteractionAccess().getLocalChoiceParserRuleCall_2()); } -) - - |( -{ before(grammarAccess.getLlobalInteractionAccess().getLocalParallelParserRuleCall_3()); } - ruleLocalParallel -{ after(grammarAccess.getLlobalInteractionAccess().getLocalParallelParserRuleCall_3()); } -) - - |( -{ before(grammarAccess.getLlobalInteractionAccess().getLocalRecursionParserRuleCall_4()); } - ruleLocalRecursion -{ after(grammarAccess.getLlobalInteractionAccess().getLocalRecursionParserRuleCall_4()); } -) - - |( -{ before(grammarAccess.getLlobalInteractionAccess().getLocalContinueParserRuleCall_5()); } - ruleLocalContinue -{ after(grammarAccess.getLlobalInteractionAccess().getLocalContinueParserRuleCall_5()); } -) - - |( -{ before(grammarAccess.getLlobalInteractionAccess().getLocalInterruptibleParserRuleCall_6()); } - ruleLocalInterruptible -{ after(grammarAccess.getLlobalInteractionAccess().getLocalInterruptibleParserRuleCall_6()); } -) - - |( -{ before(grammarAccess.getLlobalInteractionAccess().getLocalDoParserRuleCall_7()); } - ruleLocalDo -{ after(grammarAccess.getLlobalInteractionAccess().getLocalDoParserRuleCall_7()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -rule__Module__Group__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__Module__Group__0__Impl - rule__Module__Group__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__Module__Group__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getModuleAccess().getModuleKeyword_0()); } - - 'module' - -{ after(grammarAccess.getModuleAccess().getModuleKeyword_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Module__Group__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__Module__Group__1__Impl - rule__Module__Group__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__Module__Group__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getModuleAccess().getNameAssignment_1()); } -(rule__Module__NameAssignment_1) -{ after(grammarAccess.getModuleAccess().getNameAssignment_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Module__Group__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__Module__Group__2__Impl - rule__Module__Group__3 -; -finally { - restoreStackSize(stackSize); -} - -rule__Module__Group__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getModuleAccess().getSemicolonKeyword_2()); } - - ';' - -{ after(grammarAccess.getModuleAccess().getSemicolonKeyword_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Module__Group__3 - @init { - int stackSize = keepStackSize(); - } -: - rule__Module__Group__3__Impl - rule__Module__Group__4 -; -finally { - restoreStackSize(stackSize); -} - -rule__Module__Group__3__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getModuleAccess().getImportsAssignment_3()); } -(rule__Module__ImportsAssignment_3)* -{ after(grammarAccess.getModuleAccess().getImportsAssignment_3()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Module__Group__4 - @init { - int stackSize = keepStackSize(); - } -: - rule__Module__Group__4__Impl - rule__Module__Group__5 -; -finally { - restoreStackSize(stackSize); -} - -rule__Module__Group__4__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getModuleAccess().getTypesAssignment_4()); } -(rule__Module__TypesAssignment_4)* -{ after(grammarAccess.getModuleAccess().getTypesAssignment_4()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Module__Group__5 - @init { - int stackSize = keepStackSize(); - } -: - rule__Module__Group__5__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__Module__Group__5__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getModuleAccess().getAlternatives_5()); } -(rule__Module__Alternatives_5)* -{ after(grammarAccess.getModuleAccess().getAlternatives_5()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - - - - - - - -rule__ModuleName__Group__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__ModuleName__Group__0__Impl - rule__ModuleName__Group__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__ModuleName__Group__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getModuleNameAccess().getIDTerminalRuleCall_0()); } - RULE_ID -{ after(grammarAccess.getModuleNameAccess().getIDTerminalRuleCall_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__ModuleName__Group__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__ModuleName__Group__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__ModuleName__Group__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getModuleNameAccess().getGroup_1()); } -(rule__ModuleName__Group_1__0)* -{ after(grammarAccess.getModuleNameAccess().getGroup_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__ModuleName__Group_1__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__ModuleName__Group_1__0__Impl - rule__ModuleName__Group_1__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__ModuleName__Group_1__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getModuleNameAccess().getFullStopKeyword_1_0()); } - - '.' - -{ after(grammarAccess.getModuleNameAccess().getFullStopKeyword_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__ModuleName__Group_1__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__ModuleName__Group_1__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__ModuleName__Group_1__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getModuleNameAccess().getIDTerminalRuleCall_1_1()); } - RULE_ID -{ after(grammarAccess.getModuleNameAccess().getIDTerminalRuleCall_1_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__ImportModule__Group__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__ImportModule__Group__0__Impl - rule__ImportModule__Group__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__ImportModule__Group__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getImportModuleAccess().getImportKeyword_0()); } - - 'import' - -{ after(grammarAccess.getImportModuleAccess().getImportKeyword_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__ImportModule__Group__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__ImportModule__Group__1__Impl - rule__ImportModule__Group__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__ImportModule__Group__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getImportModuleAccess().getNameAssignment_1()); } -(rule__ImportModule__NameAssignment_1) -{ after(grammarAccess.getImportModuleAccess().getNameAssignment_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__ImportModule__Group__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__ImportModule__Group__2__Impl - rule__ImportModule__Group__3 -; -finally { - restoreStackSize(stackSize); -} - -rule__ImportModule__Group__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getImportModuleAccess().getGroup_2()); } -(rule__ImportModule__Group_2__0)? -{ after(grammarAccess.getImportModuleAccess().getGroup_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__ImportModule__Group__3 - @init { - int stackSize = keepStackSize(); - } -: - rule__ImportModule__Group__3__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__ImportModule__Group__3__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getImportModuleAccess().getSemicolonKeyword_3()); } - - ';' - -{ after(grammarAccess.getImportModuleAccess().getSemicolonKeyword_3()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - - - -rule__ImportModule__Group_2__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__ImportModule__Group_2__0__Impl - rule__ImportModule__Group_2__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__ImportModule__Group_2__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getImportModuleAccess().getAsKeyword_2_0()); } - - 'as' - -{ after(grammarAccess.getImportModuleAccess().getAsKeyword_2_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__ImportModule__Group_2__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__ImportModule__Group_2__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__ImportModule__Group_2__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getImportModuleAccess().getAliasAssignment_2_1()); } -(rule__ImportModule__AliasAssignment_2_1) -{ after(grammarAccess.getImportModuleAccess().getAliasAssignment_2_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__ImportMember__Group__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__ImportMember__Group__0__Impl - rule__ImportMember__Group__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__ImportMember__Group__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getImportMemberAccess().getFromKeyword_0()); } - - 'from' - -{ after(grammarAccess.getImportMemberAccess().getFromKeyword_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__ImportMember__Group__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__ImportMember__Group__1__Impl - rule__ImportMember__Group__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__ImportMember__Group__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getImportMemberAccess().getNameAssignment_1()); } -(rule__ImportMember__NameAssignment_1) -{ after(grammarAccess.getImportMemberAccess().getNameAssignment_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__ImportMember__Group__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__ImportMember__Group__2__Impl - rule__ImportMember__Group__3 -; -finally { - restoreStackSize(stackSize); -} - -rule__ImportMember__Group__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getImportMemberAccess().getImportKeyword_2()); } - - 'import' - -{ after(grammarAccess.getImportMemberAccess().getImportKeyword_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__ImportMember__Group__3 - @init { - int stackSize = keepStackSize(); - } -: - rule__ImportMember__Group__3__Impl - rule__ImportMember__Group__4 -; -finally { - restoreStackSize(stackSize); -} - -rule__ImportMember__Group__3__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getImportMemberAccess().getMemberAssignment_3()); } -(rule__ImportMember__MemberAssignment_3) -{ after(grammarAccess.getImportMemberAccess().getMemberAssignment_3()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__ImportMember__Group__4 - @init { - int stackSize = keepStackSize(); - } -: - rule__ImportMember__Group__4__Impl - rule__ImportMember__Group__5 -; -finally { - restoreStackSize(stackSize); -} - -rule__ImportMember__Group__4__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getImportMemberAccess().getGroup_4()); } -(rule__ImportMember__Group_4__0)? -{ after(grammarAccess.getImportMemberAccess().getGroup_4()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__ImportMember__Group__5 - @init { - int stackSize = keepStackSize(); - } -: - rule__ImportMember__Group__5__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__ImportMember__Group__5__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getImportMemberAccess().getSemicolonKeyword_5()); } - - ';' - -{ after(grammarAccess.getImportMemberAccess().getSemicolonKeyword_5()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - - - - - - - -rule__ImportMember__Group_4__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__ImportMember__Group_4__0__Impl - rule__ImportMember__Group_4__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__ImportMember__Group_4__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getImportMemberAccess().getAsKeyword_4_0()); } - - 'as' - -{ after(grammarAccess.getImportMemberAccess().getAsKeyword_4_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__ImportMember__Group_4__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__ImportMember__Group_4__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__ImportMember__Group_4__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getImportMemberAccess().getAliasAssignment_4_1()); } -(rule__ImportMember__AliasAssignment_4_1) -{ after(grammarAccess.getImportMemberAccess().getAliasAssignment_4_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__PayloadTypeDecl__Group__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__PayloadTypeDecl__Group__0__Impl - rule__PayloadTypeDecl__Group__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__PayloadTypeDecl__Group__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getPayloadTypeDeclAccess().getTypeKeyword_0()); } - - 'type' - -{ after(grammarAccess.getPayloadTypeDeclAccess().getTypeKeyword_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__PayloadTypeDecl__Group__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__PayloadTypeDecl__Group__1__Impl - rule__PayloadTypeDecl__Group__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__PayloadTypeDecl__Group__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getPayloadTypeDeclAccess().getLessThanSignKeyword_1()); } - - '<' - -{ after(grammarAccess.getPayloadTypeDeclAccess().getLessThanSignKeyword_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__PayloadTypeDecl__Group__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__PayloadTypeDecl__Group__2__Impl - rule__PayloadTypeDecl__Group__3 -; -finally { - restoreStackSize(stackSize); -} - -rule__PayloadTypeDecl__Group__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getPayloadTypeDeclAccess().getSchemaAssignment_2()); } -(rule__PayloadTypeDecl__SchemaAssignment_2) -{ after(grammarAccess.getPayloadTypeDeclAccess().getSchemaAssignment_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__PayloadTypeDecl__Group__3 - @init { - int stackSize = keepStackSize(); - } -: - rule__PayloadTypeDecl__Group__3__Impl - rule__PayloadTypeDecl__Group__4 -; -finally { - restoreStackSize(stackSize); -} - -rule__PayloadTypeDecl__Group__3__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getPayloadTypeDeclAccess().getGreaterThanSignKeyword_3()); } - - '>' - -{ after(grammarAccess.getPayloadTypeDeclAccess().getGreaterThanSignKeyword_3()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__PayloadTypeDecl__Group__4 - @init { - int stackSize = keepStackSize(); - } -: - rule__PayloadTypeDecl__Group__4__Impl - rule__PayloadTypeDecl__Group__5 -; -finally { - restoreStackSize(stackSize); -} - -rule__PayloadTypeDecl__Group__4__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getPayloadTypeDeclAccess().getTypeAssignment_4()); } -(rule__PayloadTypeDecl__TypeAssignment_4) -{ after(grammarAccess.getPayloadTypeDeclAccess().getTypeAssignment_4()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__PayloadTypeDecl__Group__5 - @init { - int stackSize = keepStackSize(); - } -: - rule__PayloadTypeDecl__Group__5__Impl - rule__PayloadTypeDecl__Group__6 -; -finally { - restoreStackSize(stackSize); -} - -rule__PayloadTypeDecl__Group__5__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getPayloadTypeDeclAccess().getFromKeyword_5()); } - - 'from' - -{ after(grammarAccess.getPayloadTypeDeclAccess().getFromKeyword_5()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__PayloadTypeDecl__Group__6 - @init { - int stackSize = keepStackSize(); - } -: - rule__PayloadTypeDecl__Group__6__Impl - rule__PayloadTypeDecl__Group__7 -; -finally { - restoreStackSize(stackSize); -} - -rule__PayloadTypeDecl__Group__6__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getPayloadTypeDeclAccess().getLocationAssignment_6()); } -(rule__PayloadTypeDecl__LocationAssignment_6) -{ after(grammarAccess.getPayloadTypeDeclAccess().getLocationAssignment_6()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__PayloadTypeDecl__Group__7 - @init { - int stackSize = keepStackSize(); - } -: - rule__PayloadTypeDecl__Group__7__Impl - rule__PayloadTypeDecl__Group__8 -; -finally { - restoreStackSize(stackSize); -} - -rule__PayloadTypeDecl__Group__7__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getPayloadTypeDeclAccess().getAsKeyword_7()); } - - 'as' - -{ after(grammarAccess.getPayloadTypeDeclAccess().getAsKeyword_7()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__PayloadTypeDecl__Group__8 - @init { - int stackSize = keepStackSize(); - } -: - rule__PayloadTypeDecl__Group__8__Impl - rule__PayloadTypeDecl__Group__9 -; -finally { - restoreStackSize(stackSize); -} - -rule__PayloadTypeDecl__Group__8__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getPayloadTypeDeclAccess().getAliasAssignment_8()); } -(rule__PayloadTypeDecl__AliasAssignment_8) -{ after(grammarAccess.getPayloadTypeDeclAccess().getAliasAssignment_8()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__PayloadTypeDecl__Group__9 - @init { - int stackSize = keepStackSize(); - } -: - rule__PayloadTypeDecl__Group__9__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__PayloadTypeDecl__Group__9__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getPayloadTypeDeclAccess().getSemicolonKeyword_9()); } - - ';' - -{ after(grammarAccess.getPayloadTypeDeclAccess().getSemicolonKeyword_9()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - - - - - - - - - - - - - - - -rule__MessageSignature__Group__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__MessageSignature__Group__0__Impl - rule__MessageSignature__Group__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__MessageSignature__Group__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getMessageSignatureAccess().getMessageSignatureAction_0()); } -( - -) -{ after(grammarAccess.getMessageSignatureAccess().getMessageSignatureAction_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__MessageSignature__Group__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__MessageSignature__Group__1__Impl - rule__MessageSignature__Group__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__MessageSignature__Group__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getMessageSignatureAccess().getOperatorAssignment_1()); } -(rule__MessageSignature__OperatorAssignment_1)? -{ after(grammarAccess.getMessageSignatureAccess().getOperatorAssignment_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__MessageSignature__Group__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__MessageSignature__Group__2__Impl - rule__MessageSignature__Group__3 -; -finally { - restoreStackSize(stackSize); -} - -rule__MessageSignature__Group__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getMessageSignatureAccess().getLeftParenthesisKeyword_2()); } - - '(' - -{ after(grammarAccess.getMessageSignatureAccess().getLeftParenthesisKeyword_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__MessageSignature__Group__3 - @init { - int stackSize = keepStackSize(); - } -: - rule__MessageSignature__Group__3__Impl - rule__MessageSignature__Group__4 -; -finally { - restoreStackSize(stackSize); -} - -rule__MessageSignature__Group__3__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getMessageSignatureAccess().getGroup_3()); } -(rule__MessageSignature__Group_3__0)? -{ after(grammarAccess.getMessageSignatureAccess().getGroup_3()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__MessageSignature__Group__4 - @init { - int stackSize = keepStackSize(); - } -: - rule__MessageSignature__Group__4__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__MessageSignature__Group__4__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getMessageSignatureAccess().getRightParenthesisKeyword_4()); } - - ')' - -{ after(grammarAccess.getMessageSignatureAccess().getRightParenthesisKeyword_4()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - - - - - -rule__MessageSignature__Group_3__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__MessageSignature__Group_3__0__Impl - rule__MessageSignature__Group_3__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__MessageSignature__Group_3__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getMessageSignatureAccess().getTypesAssignment_3_0()); } -(rule__MessageSignature__TypesAssignment_3_0) -{ after(grammarAccess.getMessageSignatureAccess().getTypesAssignment_3_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__MessageSignature__Group_3__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__MessageSignature__Group_3__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__MessageSignature__Group_3__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getMessageSignatureAccess().getGroup_3_1()); } -(rule__MessageSignature__Group_3_1__0)* -{ after(grammarAccess.getMessageSignatureAccess().getGroup_3_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__MessageSignature__Group_3_1__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__MessageSignature__Group_3_1__0__Impl - rule__MessageSignature__Group_3_1__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__MessageSignature__Group_3_1__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getMessageSignatureAccess().getCommaKeyword_3_1_0()); } - - ',' - -{ after(grammarAccess.getMessageSignatureAccess().getCommaKeyword_3_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__MessageSignature__Group_3_1__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__MessageSignature__Group_3_1__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__MessageSignature__Group_3_1__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getMessageSignatureAccess().getTypesAssignment_3_1_1()); } -(rule__MessageSignature__TypesAssignment_3_1_1) -{ after(grammarAccess.getMessageSignatureAccess().getTypesAssignment_3_1_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__PayloadElement__Group__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__PayloadElement__Group__0__Impl - rule__PayloadElement__Group__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__PayloadElement__Group__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getPayloadElementAccess().getGroup_0()); } -(rule__PayloadElement__Group_0__0)? -{ after(grammarAccess.getPayloadElementAccess().getGroup_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__PayloadElement__Group__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__PayloadElement__Group__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__PayloadElement__Group__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getPayloadElementAccess().getTypeAssignment_1()); } -(rule__PayloadElement__TypeAssignment_1) -{ after(grammarAccess.getPayloadElementAccess().getTypeAssignment_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__PayloadElement__Group_0__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__PayloadElement__Group_0__0__Impl - rule__PayloadElement__Group_0__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__PayloadElement__Group_0__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getPayloadElementAccess().getNameAssignment_0_0()); } -(rule__PayloadElement__NameAssignment_0_0) -{ after(grammarAccess.getPayloadElementAccess().getNameAssignment_0_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__PayloadElement__Group_0__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__PayloadElement__Group_0__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__PayloadElement__Group_0__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getPayloadElementAccess().getColonKeyword_0_1()); } - - ':' - -{ after(grammarAccess.getPayloadElementAccess().getColonKeyword_0_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__GlobalProtocolDecl__Group__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalProtocolDecl__Group__0__Impl - rule__GlobalProtocolDecl__Group__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__Group__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getGlobalKeyword_0()); } - - 'global' - -{ after(grammarAccess.getGlobalProtocolDeclAccess().getGlobalKeyword_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalProtocolDecl__Group__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalProtocolDecl__Group__1__Impl - rule__GlobalProtocolDecl__Group__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__Group__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getProtocolKeyword_1()); } - - 'protocol' - -{ after(grammarAccess.getGlobalProtocolDeclAccess().getProtocolKeyword_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalProtocolDecl__Group__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalProtocolDecl__Group__2__Impl - rule__GlobalProtocolDecl__Group__3 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__Group__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getNameAssignment_2()); } -(rule__GlobalProtocolDecl__NameAssignment_2) -{ after(grammarAccess.getGlobalProtocolDeclAccess().getNameAssignment_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalProtocolDecl__Group__3 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalProtocolDecl__Group__3__Impl - rule__GlobalProtocolDecl__Group__4 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__Group__3__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getGroup_3()); } -(rule__GlobalProtocolDecl__Group_3__0)? -{ after(grammarAccess.getGlobalProtocolDeclAccess().getGroup_3()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalProtocolDecl__Group__4 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalProtocolDecl__Group__4__Impl - rule__GlobalProtocolDecl__Group__5 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__Group__4__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getLeftParenthesisKeyword_4()); } - - '(' - -{ after(grammarAccess.getGlobalProtocolDeclAccess().getLeftParenthesisKeyword_4()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalProtocolDecl__Group__5 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalProtocolDecl__Group__5__Impl - rule__GlobalProtocolDecl__Group__6 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__Group__5__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getRolesAssignment_5()); } -(rule__GlobalProtocolDecl__RolesAssignment_5) -{ after(grammarAccess.getGlobalProtocolDeclAccess().getRolesAssignment_5()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalProtocolDecl__Group__6 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalProtocolDecl__Group__6__Impl - rule__GlobalProtocolDecl__Group__7 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__Group__6__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getGroup_6()); } -(rule__GlobalProtocolDecl__Group_6__0)* -{ after(grammarAccess.getGlobalProtocolDeclAccess().getGroup_6()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalProtocolDecl__Group__7 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalProtocolDecl__Group__7__Impl - rule__GlobalProtocolDecl__Group__8 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__Group__7__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getRightParenthesisKeyword_7()); } - - ')' - -{ after(grammarAccess.getGlobalProtocolDeclAccess().getRightParenthesisKeyword_7()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalProtocolDecl__Group__8 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalProtocolDecl__Group__8__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__Group__8__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getAlternatives_8()); } -(rule__GlobalProtocolDecl__Alternatives_8) -{ after(grammarAccess.getGlobalProtocolDeclAccess().getAlternatives_8()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - - - - - - - - - - - - - -rule__GlobalProtocolDecl__Group_3__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalProtocolDecl__Group_3__0__Impl - rule__GlobalProtocolDecl__Group_3__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__Group_3__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getLessThanSignKeyword_3_0()); } - - '<' - -{ after(grammarAccess.getGlobalProtocolDeclAccess().getLessThanSignKeyword_3_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalProtocolDecl__Group_3__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalProtocolDecl__Group_3__1__Impl - rule__GlobalProtocolDecl__Group_3__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__Group_3__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getParametersAssignment_3_1()); } -(rule__GlobalProtocolDecl__ParametersAssignment_3_1) -{ after(grammarAccess.getGlobalProtocolDeclAccess().getParametersAssignment_3_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalProtocolDecl__Group_3__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalProtocolDecl__Group_3__2__Impl - rule__GlobalProtocolDecl__Group_3__3 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__Group_3__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getGroup_3_2()); } -(rule__GlobalProtocolDecl__Group_3_2__0)* -{ after(grammarAccess.getGlobalProtocolDeclAccess().getGroup_3_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalProtocolDecl__Group_3__3 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalProtocolDecl__Group_3__3__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__Group_3__3__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getGreaterThanSignKeyword_3_3()); } - - '>' - -{ after(grammarAccess.getGlobalProtocolDeclAccess().getGreaterThanSignKeyword_3_3()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - - - -rule__GlobalProtocolDecl__Group_3_2__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalProtocolDecl__Group_3_2__0__Impl - rule__GlobalProtocolDecl__Group_3_2__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__Group_3_2__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getCommaKeyword_3_2_0()); } - - ',' - -{ after(grammarAccess.getGlobalProtocolDeclAccess().getCommaKeyword_3_2_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalProtocolDecl__Group_3_2__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalProtocolDecl__Group_3_2__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__Group_3_2__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getParametersAssignment_3_2_1()); } -(rule__GlobalProtocolDecl__ParametersAssignment_3_2_1) -{ after(grammarAccess.getGlobalProtocolDeclAccess().getParametersAssignment_3_2_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__GlobalProtocolDecl__Group_6__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalProtocolDecl__Group_6__0__Impl - rule__GlobalProtocolDecl__Group_6__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__Group_6__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getCommaKeyword_6_0()); } - - ',' - -{ after(grammarAccess.getGlobalProtocolDeclAccess().getCommaKeyword_6_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalProtocolDecl__Group_6__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalProtocolDecl__Group_6__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__Group_6__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getRolesAssignment_6_1()); } -(rule__GlobalProtocolDecl__RolesAssignment_6_1) -{ after(grammarAccess.getGlobalProtocolDeclAccess().getRolesAssignment_6_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__GlobalProtocolDecl__Group_8_1__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalProtocolDecl__Group_8_1__0__Impl - rule__GlobalProtocolDecl__Group_8_1__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__Group_8_1__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getInstantiatesKeyword_8_1_0()); } - - 'instantiates' - -{ after(grammarAccess.getGlobalProtocolDeclAccess().getInstantiatesKeyword_8_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalProtocolDecl__Group_8_1__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalProtocolDecl__Group_8_1__1__Impl - rule__GlobalProtocolDecl__Group_8_1__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__Group_8_1__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getInstantiatesAssignment_8_1_1()); } -(rule__GlobalProtocolDecl__InstantiatesAssignment_8_1_1) -{ after(grammarAccess.getGlobalProtocolDeclAccess().getInstantiatesAssignment_8_1_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalProtocolDecl__Group_8_1__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalProtocolDecl__Group_8_1__2__Impl - rule__GlobalProtocolDecl__Group_8_1__3 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__Group_8_1__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getGroup_8_1_2()); } -(rule__GlobalProtocolDecl__Group_8_1_2__0)? -{ after(grammarAccess.getGlobalProtocolDeclAccess().getGroup_8_1_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalProtocolDecl__Group_8_1__3 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalProtocolDecl__Group_8_1__3__Impl - rule__GlobalProtocolDecl__Group_8_1__4 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__Group_8_1__3__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getLeftParenthesisKeyword_8_1_3()); } - - '(' - -{ after(grammarAccess.getGlobalProtocolDeclAccess().getLeftParenthesisKeyword_8_1_3()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalProtocolDecl__Group_8_1__4 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalProtocolDecl__Group_8_1__4__Impl - rule__GlobalProtocolDecl__Group_8_1__5 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__Group_8_1__4__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getRoleInstantiationsAssignment_8_1_4()); } -(rule__GlobalProtocolDecl__RoleInstantiationsAssignment_8_1_4) -{ after(grammarAccess.getGlobalProtocolDeclAccess().getRoleInstantiationsAssignment_8_1_4()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalProtocolDecl__Group_8_1__5 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalProtocolDecl__Group_8_1__5__Impl - rule__GlobalProtocolDecl__Group_8_1__6 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__Group_8_1__5__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getGroup_8_1_5()); } -(rule__GlobalProtocolDecl__Group_8_1_5__0)* -{ after(grammarAccess.getGlobalProtocolDeclAccess().getGroup_8_1_5()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalProtocolDecl__Group_8_1__6 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalProtocolDecl__Group_8_1__6__Impl - rule__GlobalProtocolDecl__Group_8_1__7 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__Group_8_1__6__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getRightParenthesisKeyword_8_1_6()); } - - ')' - -{ after(grammarAccess.getGlobalProtocolDeclAccess().getRightParenthesisKeyword_8_1_6()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalProtocolDecl__Group_8_1__7 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalProtocolDecl__Group_8_1__7__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__Group_8_1__7__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getSemicolonKeyword_8_1_7()); } - - ';' - -{ after(grammarAccess.getGlobalProtocolDeclAccess().getSemicolonKeyword_8_1_7()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - - - - - - - - - - - -rule__GlobalProtocolDecl__Group_8_1_2__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalProtocolDecl__Group_8_1_2__0__Impl - rule__GlobalProtocolDecl__Group_8_1_2__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__Group_8_1_2__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getLessThanSignKeyword_8_1_2_0()); } - - '<' - -{ after(grammarAccess.getGlobalProtocolDeclAccess().getLessThanSignKeyword_8_1_2_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalProtocolDecl__Group_8_1_2__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalProtocolDecl__Group_8_1_2__1__Impl - rule__GlobalProtocolDecl__Group_8_1_2__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__Group_8_1_2__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getArgumentsAssignment_8_1_2_1()); } -(rule__GlobalProtocolDecl__ArgumentsAssignment_8_1_2_1) -{ after(grammarAccess.getGlobalProtocolDeclAccess().getArgumentsAssignment_8_1_2_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalProtocolDecl__Group_8_1_2__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalProtocolDecl__Group_8_1_2__2__Impl - rule__GlobalProtocolDecl__Group_8_1_2__3 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__Group_8_1_2__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getGroup_8_1_2_2()); } -(rule__GlobalProtocolDecl__Group_8_1_2_2__0)* -{ after(grammarAccess.getGlobalProtocolDeclAccess().getGroup_8_1_2_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalProtocolDecl__Group_8_1_2__3 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalProtocolDecl__Group_8_1_2__3__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__Group_8_1_2__3__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getGreaterThanSignKeyword_8_1_2_3()); } - - '>' - -{ after(grammarAccess.getGlobalProtocolDeclAccess().getGreaterThanSignKeyword_8_1_2_3()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - - - -rule__GlobalProtocolDecl__Group_8_1_2_2__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalProtocolDecl__Group_8_1_2_2__0__Impl - rule__GlobalProtocolDecl__Group_8_1_2_2__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__Group_8_1_2_2__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getCommaKeyword_8_1_2_2_0()); } - - ',' - -{ after(grammarAccess.getGlobalProtocolDeclAccess().getCommaKeyword_8_1_2_2_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalProtocolDecl__Group_8_1_2_2__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalProtocolDecl__Group_8_1_2_2__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__Group_8_1_2_2__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getArgumentsAssignment_8_1_2_2_1()); } -(rule__GlobalProtocolDecl__ArgumentsAssignment_8_1_2_2_1) -{ after(grammarAccess.getGlobalProtocolDeclAccess().getArgumentsAssignment_8_1_2_2_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__GlobalProtocolDecl__Group_8_1_5__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalProtocolDecl__Group_8_1_5__0__Impl - rule__GlobalProtocolDecl__Group_8_1_5__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__Group_8_1_5__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getCommaKeyword_8_1_5_0()); } - - ',' - -{ after(grammarAccess.getGlobalProtocolDeclAccess().getCommaKeyword_8_1_5_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalProtocolDecl__Group_8_1_5__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalProtocolDecl__Group_8_1_5__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__Group_8_1_5__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getRoleInstantiationsAssignment_8_1_5_1()); } -(rule__GlobalProtocolDecl__RoleInstantiationsAssignment_8_1_5_1) -{ after(grammarAccess.getGlobalProtocolDeclAccess().getRoleInstantiationsAssignment_8_1_5_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__RoleDecl__Group__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__RoleDecl__Group__0__Impl - rule__RoleDecl__Group__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__RoleDecl__Group__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getRoleDeclAccess().getRoleKeyword_0()); } - - 'role' - -{ after(grammarAccess.getRoleDeclAccess().getRoleKeyword_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__RoleDecl__Group__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__RoleDecl__Group__1__Impl - rule__RoleDecl__Group__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__RoleDecl__Group__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getRoleDeclAccess().getNameAssignment_1()); } -(rule__RoleDecl__NameAssignment_1) -{ after(grammarAccess.getRoleDeclAccess().getNameAssignment_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__RoleDecl__Group__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__RoleDecl__Group__2__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__RoleDecl__Group__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getRoleDeclAccess().getGroup_2()); } -(rule__RoleDecl__Group_2__0)? -{ after(grammarAccess.getRoleDeclAccess().getGroup_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - -rule__RoleDecl__Group_2__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__RoleDecl__Group_2__0__Impl - rule__RoleDecl__Group_2__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__RoleDecl__Group_2__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getRoleDeclAccess().getAsKeyword_2_0()); } - - 'as' - -{ after(grammarAccess.getRoleDeclAccess().getAsKeyword_2_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__RoleDecl__Group_2__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__RoleDecl__Group_2__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__RoleDecl__Group_2__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getRoleDeclAccess().getAliasAssignment_2_1()); } -(rule__RoleDecl__AliasAssignment_2_1) -{ after(grammarAccess.getRoleDeclAccess().getAliasAssignment_2_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__ParameterDecl__Group_0__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__ParameterDecl__Group_0__0__Impl - rule__ParameterDecl__Group_0__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__ParameterDecl__Group_0__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getParameterDeclAccess().getTypeKeyword_0_0()); } - - 'type' - -{ after(grammarAccess.getParameterDeclAccess().getTypeKeyword_0_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__ParameterDecl__Group_0__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__ParameterDecl__Group_0__1__Impl - rule__ParameterDecl__Group_0__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__ParameterDecl__Group_0__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getParameterDeclAccess().getNameAssignment_0_1()); } -(rule__ParameterDecl__NameAssignment_0_1) -{ after(grammarAccess.getParameterDeclAccess().getNameAssignment_0_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__ParameterDecl__Group_0__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__ParameterDecl__Group_0__2__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__ParameterDecl__Group_0__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getParameterDeclAccess().getGroup_0_2()); } -(rule__ParameterDecl__Group_0_2__0)? -{ after(grammarAccess.getParameterDeclAccess().getGroup_0_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - -rule__ParameterDecl__Group_0_2__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__ParameterDecl__Group_0_2__0__Impl - rule__ParameterDecl__Group_0_2__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__ParameterDecl__Group_0_2__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getParameterDeclAccess().getAsKeyword_0_2_0()); } - - 'as' - -{ after(grammarAccess.getParameterDeclAccess().getAsKeyword_0_2_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__ParameterDecl__Group_0_2__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__ParameterDecl__Group_0_2__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__ParameterDecl__Group_0_2__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getParameterDeclAccess().getAliasAssignment_0_2_1()); } -(rule__ParameterDecl__AliasAssignment_0_2_1) -{ after(grammarAccess.getParameterDeclAccess().getAliasAssignment_0_2_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__ParameterDecl__Group_1__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__ParameterDecl__Group_1__0__Impl - rule__ParameterDecl__Group_1__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__ParameterDecl__Group_1__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getParameterDeclAccess().getSigKeyword_1_0()); } - - 'sig' - -{ after(grammarAccess.getParameterDeclAccess().getSigKeyword_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__ParameterDecl__Group_1__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__ParameterDecl__Group_1__1__Impl - rule__ParameterDecl__Group_1__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__ParameterDecl__Group_1__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getParameterDeclAccess().getNameAssignment_1_1()); } -(rule__ParameterDecl__NameAssignment_1_1) -{ after(grammarAccess.getParameterDeclAccess().getNameAssignment_1_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__ParameterDecl__Group_1__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__ParameterDecl__Group_1__2__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__ParameterDecl__Group_1__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getParameterDeclAccess().getGroup_1_2()); } -(rule__ParameterDecl__Group_1_2__0)? -{ after(grammarAccess.getParameterDeclAccess().getGroup_1_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - -rule__ParameterDecl__Group_1_2__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__ParameterDecl__Group_1_2__0__Impl - rule__ParameterDecl__Group_1_2__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__ParameterDecl__Group_1_2__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getParameterDeclAccess().getAsKeyword_1_2_0()); } - - 'as' - -{ after(grammarAccess.getParameterDeclAccess().getAsKeyword_1_2_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__ParameterDecl__Group_1_2__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__ParameterDecl__Group_1_2__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__ParameterDecl__Group_1_2__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getParameterDeclAccess().getAliasAssignment_1_2_1()); } -(rule__ParameterDecl__AliasAssignment_1_2_1) -{ after(grammarAccess.getParameterDeclAccess().getAliasAssignment_1_2_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__RoleInstantiation__Group__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__RoleInstantiation__Group__0__Impl - rule__RoleInstantiation__Group__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__RoleInstantiation__Group__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getRoleInstantiationAccess().getNameAssignment_0()); } -(rule__RoleInstantiation__NameAssignment_0) -{ after(grammarAccess.getRoleInstantiationAccess().getNameAssignment_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__RoleInstantiation__Group__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__RoleInstantiation__Group__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__RoleInstantiation__Group__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getRoleInstantiationAccess().getGroup_1()); } -(rule__RoleInstantiation__Group_1__0)? -{ after(grammarAccess.getRoleInstantiationAccess().getGroup_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__RoleInstantiation__Group_1__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__RoleInstantiation__Group_1__0__Impl - rule__RoleInstantiation__Group_1__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__RoleInstantiation__Group_1__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getRoleInstantiationAccess().getAsKeyword_1_0()); } - - 'as' - -{ after(grammarAccess.getRoleInstantiationAccess().getAsKeyword_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__RoleInstantiation__Group_1__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__RoleInstantiation__Group_1__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__RoleInstantiation__Group_1__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getRoleInstantiationAccess().getAliasAssignment_1_1()); } -(rule__RoleInstantiation__AliasAssignment_1_1) -{ after(grammarAccess.getRoleInstantiationAccess().getAliasAssignment_1_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__Argument__Group_0__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__Argument__Group_0__0__Impl - rule__Argument__Group_0__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__Argument__Group_0__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getArgumentAccess().getSignatureAssignment_0_0()); } -(rule__Argument__SignatureAssignment_0_0) -{ after(grammarAccess.getArgumentAccess().getSignatureAssignment_0_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Argument__Group_0__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__Argument__Group_0__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__Argument__Group_0__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getArgumentAccess().getGroup_0_1()); } -(rule__Argument__Group_0_1__0)? -{ after(grammarAccess.getArgumentAccess().getGroup_0_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__Argument__Group_0_1__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__Argument__Group_0_1__0__Impl - rule__Argument__Group_0_1__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__Argument__Group_0_1__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getArgumentAccess().getAsKeyword_0_1_0()); } - - 'as' - -{ after(grammarAccess.getArgumentAccess().getAsKeyword_0_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Argument__Group_0_1__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__Argument__Group_0_1__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__Argument__Group_0_1__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getArgumentAccess().getAliasAssignment_0_1_1()); } -(rule__Argument__AliasAssignment_0_1_1) -{ after(grammarAccess.getArgumentAccess().getAliasAssignment_0_1_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__Argument__Group_1__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__Argument__Group_1__0__Impl - rule__Argument__Group_1__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__Argument__Group_1__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getArgumentAccess().getNameAssignment_1_0()); } -(rule__Argument__NameAssignment_1_0) -{ after(grammarAccess.getArgumentAccess().getNameAssignment_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Argument__Group_1__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__Argument__Group_1__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__Argument__Group_1__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getArgumentAccess().getGroup_1_1()); } -(rule__Argument__Group_1_1__0)? -{ after(grammarAccess.getArgumentAccess().getGroup_1_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__Argument__Group_1_1__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__Argument__Group_1_1__0__Impl - rule__Argument__Group_1_1__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__Argument__Group_1_1__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getArgumentAccess().getAsKeyword_1_1_0()); } - - 'as' - -{ after(grammarAccess.getArgumentAccess().getAsKeyword_1_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Argument__Group_1_1__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__Argument__Group_1_1__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__Argument__Group_1_1__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getArgumentAccess().getAliasAssignment_1_1_1()); } -(rule__Argument__AliasAssignment_1_1_1) -{ after(grammarAccess.getArgumentAccess().getAliasAssignment_1_1_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__GlobalProtocolBlock__Group__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalProtocolBlock__Group__0__Impl - rule__GlobalProtocolBlock__Group__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolBlock__Group__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolBlockAccess().getGlobalProtocolBlockAction_0()); } -( - -) -{ after(grammarAccess.getGlobalProtocolBlockAccess().getGlobalProtocolBlockAction_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalProtocolBlock__Group__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalProtocolBlock__Group__1__Impl - rule__GlobalProtocolBlock__Group__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolBlock__Group__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolBlockAccess().getLeftCurlyBracketKeyword_1()); } - - '{' - -{ after(grammarAccess.getGlobalProtocolBlockAccess().getLeftCurlyBracketKeyword_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalProtocolBlock__Group__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalProtocolBlock__Group__2__Impl - rule__GlobalProtocolBlock__Group__3 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolBlock__Group__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolBlockAccess().getActivitiesAssignment_2()); } -(rule__GlobalProtocolBlock__ActivitiesAssignment_2)* -{ after(grammarAccess.getGlobalProtocolBlockAccess().getActivitiesAssignment_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalProtocolBlock__Group__3 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalProtocolBlock__Group__3__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolBlock__Group__3__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolBlockAccess().getRightCurlyBracketKeyword_3()); } - - '}' - -{ after(grammarAccess.getGlobalProtocolBlockAccess().getRightCurlyBracketKeyword_3()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - - - -rule__GlobalMessageTransfer__Group__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalMessageTransfer__Group__0__Impl - rule__GlobalMessageTransfer__Group__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalMessageTransfer__Group__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalMessageTransferAccess().getMessageAssignment_0()); } -(rule__GlobalMessageTransfer__MessageAssignment_0) -{ after(grammarAccess.getGlobalMessageTransferAccess().getMessageAssignment_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalMessageTransfer__Group__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalMessageTransfer__Group__1__Impl - rule__GlobalMessageTransfer__Group__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalMessageTransfer__Group__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalMessageTransferAccess().getFromKeyword_1()); } - - 'from' - -{ after(grammarAccess.getGlobalMessageTransferAccess().getFromKeyword_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalMessageTransfer__Group__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalMessageTransfer__Group__2__Impl - rule__GlobalMessageTransfer__Group__3 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalMessageTransfer__Group__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalMessageTransferAccess().getFromRoleAssignment_2()); } -(rule__GlobalMessageTransfer__FromRoleAssignment_2) -{ after(grammarAccess.getGlobalMessageTransferAccess().getFromRoleAssignment_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalMessageTransfer__Group__3 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalMessageTransfer__Group__3__Impl - rule__GlobalMessageTransfer__Group__4 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalMessageTransfer__Group__3__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalMessageTransferAccess().getToKeyword_3()); } - - 'to' - -{ after(grammarAccess.getGlobalMessageTransferAccess().getToKeyword_3()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalMessageTransfer__Group__4 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalMessageTransfer__Group__4__Impl - rule__GlobalMessageTransfer__Group__5 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalMessageTransfer__Group__4__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalMessageTransferAccess().getToRolesAssignment_4()); } -(rule__GlobalMessageTransfer__ToRolesAssignment_4) -{ after(grammarAccess.getGlobalMessageTransferAccess().getToRolesAssignment_4()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalMessageTransfer__Group__5 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalMessageTransfer__Group__5__Impl - rule__GlobalMessageTransfer__Group__6 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalMessageTransfer__Group__5__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalMessageTransferAccess().getGroup_5()); } -(rule__GlobalMessageTransfer__Group_5__0)* -{ after(grammarAccess.getGlobalMessageTransferAccess().getGroup_5()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalMessageTransfer__Group__6 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalMessageTransfer__Group__6__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalMessageTransfer__Group__6__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalMessageTransferAccess().getSemicolonKeyword_6()); } - - ';' - -{ after(grammarAccess.getGlobalMessageTransferAccess().getSemicolonKeyword_6()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - - - - - - - - - -rule__GlobalMessageTransfer__Group_5__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalMessageTransfer__Group_5__0__Impl - rule__GlobalMessageTransfer__Group_5__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalMessageTransfer__Group_5__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalMessageTransferAccess().getCommaKeyword_5_0()); } - - ',' - -{ after(grammarAccess.getGlobalMessageTransferAccess().getCommaKeyword_5_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalMessageTransfer__Group_5__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalMessageTransfer__Group_5__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalMessageTransfer__Group_5__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalMessageTransferAccess().getToRolesAssignment_5_1()); } -(rule__GlobalMessageTransfer__ToRolesAssignment_5_1) -{ after(grammarAccess.getGlobalMessageTransferAccess().getToRolesAssignment_5_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__GlobalChoice__Group__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalChoice__Group__0__Impl - rule__GlobalChoice__Group__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalChoice__Group__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalChoiceAccess().getChoiceKeyword_0()); } - - 'choice' - -{ after(grammarAccess.getGlobalChoiceAccess().getChoiceKeyword_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalChoice__Group__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalChoice__Group__1__Impl - rule__GlobalChoice__Group__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalChoice__Group__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalChoiceAccess().getAtKeyword_1()); } - - 'at' - -{ after(grammarAccess.getGlobalChoiceAccess().getAtKeyword_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalChoice__Group__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalChoice__Group__2__Impl - rule__GlobalChoice__Group__3 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalChoice__Group__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalChoiceAccess().getRoleAssignment_2()); } -(rule__GlobalChoice__RoleAssignment_2) -{ after(grammarAccess.getGlobalChoiceAccess().getRoleAssignment_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalChoice__Group__3 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalChoice__Group__3__Impl - rule__GlobalChoice__Group__4 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalChoice__Group__3__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalChoiceAccess().getBlocksAssignment_3()); } -(rule__GlobalChoice__BlocksAssignment_3) -{ after(grammarAccess.getGlobalChoiceAccess().getBlocksAssignment_3()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalChoice__Group__4 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalChoice__Group__4__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalChoice__Group__4__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalChoiceAccess().getGroup_4()); } -(rule__GlobalChoice__Group_4__0)* -{ after(grammarAccess.getGlobalChoiceAccess().getGroup_4()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - - - - - -rule__GlobalChoice__Group_4__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalChoice__Group_4__0__Impl - rule__GlobalChoice__Group_4__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalChoice__Group_4__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalChoiceAccess().getOrKeyword_4_0()); } - - 'or' - -{ after(grammarAccess.getGlobalChoiceAccess().getOrKeyword_4_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalChoice__Group_4__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalChoice__Group_4__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalChoice__Group_4__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalChoiceAccess().getBlocksAssignment_4_1()); } -(rule__GlobalChoice__BlocksAssignment_4_1) -{ after(grammarAccess.getGlobalChoiceAccess().getBlocksAssignment_4_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__GlobalRecursion__Group__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalRecursion__Group__0__Impl - rule__GlobalRecursion__Group__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalRecursion__Group__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalRecursionAccess().getRecKeyword_0()); } - - 'rec' - -{ after(grammarAccess.getGlobalRecursionAccess().getRecKeyword_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalRecursion__Group__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalRecursion__Group__1__Impl - rule__GlobalRecursion__Group__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalRecursion__Group__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalRecursionAccess().getLabelAssignment_1()); } -(rule__GlobalRecursion__LabelAssignment_1) -{ after(grammarAccess.getGlobalRecursionAccess().getLabelAssignment_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalRecursion__Group__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalRecursion__Group__2__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalRecursion__Group__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalRecursionAccess().getBlockAssignment_2()); } -(rule__GlobalRecursion__BlockAssignment_2) -{ after(grammarAccess.getGlobalRecursionAccess().getBlockAssignment_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - -rule__GlobalContinue__Group__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalContinue__Group__0__Impl - rule__GlobalContinue__Group__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalContinue__Group__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalContinueAccess().getContinueKeyword_0()); } - - 'continue' - -{ after(grammarAccess.getGlobalContinueAccess().getContinueKeyword_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalContinue__Group__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalContinue__Group__1__Impl - rule__GlobalContinue__Group__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalContinue__Group__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalContinueAccess().getLabelAssignment_1()); } -(rule__GlobalContinue__LabelAssignment_1) -{ after(grammarAccess.getGlobalContinueAccess().getLabelAssignment_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalContinue__Group__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalContinue__Group__2__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalContinue__Group__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalContinueAccess().getSemicolonKeyword_2()); } - - ';' - -{ after(grammarAccess.getGlobalContinueAccess().getSemicolonKeyword_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - -rule__GlobalParallel__Group__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalParallel__Group__0__Impl - rule__GlobalParallel__Group__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalParallel__Group__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalParallelAccess().getParKeyword_0()); } - - 'par' - -{ after(grammarAccess.getGlobalParallelAccess().getParKeyword_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalParallel__Group__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalParallel__Group__1__Impl - rule__GlobalParallel__Group__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalParallel__Group__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalParallelAccess().getBlocksAssignment_1()); } -(rule__GlobalParallel__BlocksAssignment_1) -{ after(grammarAccess.getGlobalParallelAccess().getBlocksAssignment_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalParallel__Group__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalParallel__Group__2__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalParallel__Group__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalParallelAccess().getGroup_2()); } -(rule__GlobalParallel__Group_2__0)* -{ after(grammarAccess.getGlobalParallelAccess().getGroup_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - -rule__GlobalParallel__Group_2__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalParallel__Group_2__0__Impl - rule__GlobalParallel__Group_2__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalParallel__Group_2__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalParallelAccess().getAndKeyword_2_0()); } - - 'and' - -{ after(grammarAccess.getGlobalParallelAccess().getAndKeyword_2_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalParallel__Group_2__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalParallel__Group_2__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalParallel__Group_2__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalParallelAccess().getBlocksAssignment_2_1()); } -(rule__GlobalParallel__BlocksAssignment_2_1) -{ after(grammarAccess.getGlobalParallelAccess().getBlocksAssignment_2_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__GlobalInterruptible__Group__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalInterruptible__Group__0__Impl - rule__GlobalInterruptible__Group__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalInterruptible__Group__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalInterruptibleAccess().getInterruptibleKeyword_0()); } - - 'interruptible' - -{ after(grammarAccess.getGlobalInterruptibleAccess().getInterruptibleKeyword_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalInterruptible__Group__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalInterruptible__Group__1__Impl - rule__GlobalInterruptible__Group__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalInterruptible__Group__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalInterruptibleAccess().getGroup_1()); } -(rule__GlobalInterruptible__Group_1__0)? -{ after(grammarAccess.getGlobalInterruptibleAccess().getGroup_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalInterruptible__Group__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalInterruptible__Group__2__Impl - rule__GlobalInterruptible__Group__3 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalInterruptible__Group__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalInterruptibleAccess().getBlockAssignment_2()); } -(rule__GlobalInterruptible__BlockAssignment_2) -{ after(grammarAccess.getGlobalInterruptibleAccess().getBlockAssignment_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalInterruptible__Group__3 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalInterruptible__Group__3__Impl - rule__GlobalInterruptible__Group__4 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalInterruptible__Group__3__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalInterruptibleAccess().getWithKeyword_3()); } - - 'with' - -{ after(grammarAccess.getGlobalInterruptibleAccess().getWithKeyword_3()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalInterruptible__Group__4 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalInterruptible__Group__4__Impl - rule__GlobalInterruptible__Group__5 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalInterruptible__Group__4__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalInterruptibleAccess().getLeftCurlyBracketKeyword_4()); } - - '{' - -{ after(grammarAccess.getGlobalInterruptibleAccess().getLeftCurlyBracketKeyword_4()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalInterruptible__Group__5 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalInterruptible__Group__5__Impl - rule__GlobalInterruptible__Group__6 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalInterruptible__Group__5__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalInterruptibleAccess().getInterruptsAssignment_5()); } -(rule__GlobalInterruptible__InterruptsAssignment_5)* -{ after(grammarAccess.getGlobalInterruptibleAccess().getInterruptsAssignment_5()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalInterruptible__Group__6 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalInterruptible__Group__6__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalInterruptible__Group__6__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalInterruptibleAccess().getRightCurlyBracketKeyword_6()); } - - '}' - -{ after(grammarAccess.getGlobalInterruptibleAccess().getRightCurlyBracketKeyword_6()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - - - - - - - - - -rule__GlobalInterruptible__Group_1__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalInterruptible__Group_1__0__Impl - rule__GlobalInterruptible__Group_1__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalInterruptible__Group_1__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalInterruptibleAccess().getScopeAssignment_1_0()); } -(rule__GlobalInterruptible__ScopeAssignment_1_0) -{ after(grammarAccess.getGlobalInterruptibleAccess().getScopeAssignment_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalInterruptible__Group_1__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalInterruptible__Group_1__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalInterruptible__Group_1__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalInterruptibleAccess().getColonKeyword_1_1()); } - - ':' - -{ after(grammarAccess.getGlobalInterruptibleAccess().getColonKeyword_1_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__GlobalInterrupt__Group__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalInterrupt__Group__0__Impl - rule__GlobalInterrupt__Group__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalInterrupt__Group__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalInterruptAccess().getMessagesAssignment_0()); } -(rule__GlobalInterrupt__MessagesAssignment_0) -{ after(grammarAccess.getGlobalInterruptAccess().getMessagesAssignment_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalInterrupt__Group__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalInterrupt__Group__1__Impl - rule__GlobalInterrupt__Group__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalInterrupt__Group__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalInterruptAccess().getGroup_1()); } -(rule__GlobalInterrupt__Group_1__0)* -{ after(grammarAccess.getGlobalInterruptAccess().getGroup_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalInterrupt__Group__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalInterrupt__Group__2__Impl - rule__GlobalInterrupt__Group__3 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalInterrupt__Group__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalInterruptAccess().getByKeyword_2()); } - - 'by' - -{ after(grammarAccess.getGlobalInterruptAccess().getByKeyword_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalInterrupt__Group__3 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalInterrupt__Group__3__Impl - rule__GlobalInterrupt__Group__4 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalInterrupt__Group__3__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalInterruptAccess().getRoleAssignment_3()); } -(rule__GlobalInterrupt__RoleAssignment_3) -{ after(grammarAccess.getGlobalInterruptAccess().getRoleAssignment_3()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalInterrupt__Group__4 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalInterrupt__Group__4__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalInterrupt__Group__4__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalInterruptAccess().getSemicolonKeyword_4()); } - - ';' - -{ after(grammarAccess.getGlobalInterruptAccess().getSemicolonKeyword_4()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - - - - - -rule__GlobalInterrupt__Group_1__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalInterrupt__Group_1__0__Impl - rule__GlobalInterrupt__Group_1__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalInterrupt__Group_1__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalInterruptAccess().getCommaKeyword_1_0()); } - - ',' - -{ after(grammarAccess.getGlobalInterruptAccess().getCommaKeyword_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalInterrupt__Group_1__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalInterrupt__Group_1__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalInterrupt__Group_1__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalInterruptAccess().getMessagesAssignment_1_1()); } -(rule__GlobalInterrupt__MessagesAssignment_1_1) -{ after(grammarAccess.getGlobalInterruptAccess().getMessagesAssignment_1_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__GlobalDo__Group__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalDo__Group__0__Impl - rule__GlobalDo__Group__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalDo__Group__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalDoAccess().getDoKeyword_0()); } - - 'do' - -{ after(grammarAccess.getGlobalDoAccess().getDoKeyword_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalDo__Group__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalDo__Group__1__Impl - rule__GlobalDo__Group__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalDo__Group__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalDoAccess().getGroup_1()); } -(rule__GlobalDo__Group_1__0)? -{ after(grammarAccess.getGlobalDoAccess().getGroup_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalDo__Group__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalDo__Group__2__Impl - rule__GlobalDo__Group__3 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalDo__Group__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalDoAccess().getMemberAssignment_2()); } -(rule__GlobalDo__MemberAssignment_2) -{ after(grammarAccess.getGlobalDoAccess().getMemberAssignment_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalDo__Group__3 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalDo__Group__3__Impl - rule__GlobalDo__Group__4 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalDo__Group__3__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalDoAccess().getGroup_3()); } -(rule__GlobalDo__Group_3__0)? -{ after(grammarAccess.getGlobalDoAccess().getGroup_3()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalDo__Group__4 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalDo__Group__4__Impl - rule__GlobalDo__Group__5 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalDo__Group__4__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalDoAccess().getLeftParenthesisKeyword_4()); } - - '(' - -{ after(grammarAccess.getGlobalDoAccess().getLeftParenthesisKeyword_4()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalDo__Group__5 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalDo__Group__5__Impl - rule__GlobalDo__Group__6 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalDo__Group__5__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalDoAccess().getRolesAssignment_5()); } -(rule__GlobalDo__RolesAssignment_5) -{ after(grammarAccess.getGlobalDoAccess().getRolesAssignment_5()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalDo__Group__6 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalDo__Group__6__Impl - rule__GlobalDo__Group__7 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalDo__Group__6__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalDoAccess().getGroup_6()); } -(rule__GlobalDo__Group_6__0)* -{ after(grammarAccess.getGlobalDoAccess().getGroup_6()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalDo__Group__7 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalDo__Group__7__Impl - rule__GlobalDo__Group__8 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalDo__Group__7__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalDoAccess().getRightParenthesisKeyword_7()); } - - ')' - -{ after(grammarAccess.getGlobalDoAccess().getRightParenthesisKeyword_7()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalDo__Group__8 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalDo__Group__8__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalDo__Group__8__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalDoAccess().getSemicolonKeyword_8()); } - - ';' - -{ after(grammarAccess.getGlobalDoAccess().getSemicolonKeyword_8()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - - - - - - - - - - - - - -rule__GlobalDo__Group_1__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalDo__Group_1__0__Impl - rule__GlobalDo__Group_1__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalDo__Group_1__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalDoAccess().getScopeAssignment_1_0()); } -(rule__GlobalDo__ScopeAssignment_1_0) -{ after(grammarAccess.getGlobalDoAccess().getScopeAssignment_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalDo__Group_1__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalDo__Group_1__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalDo__Group_1__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalDoAccess().getColonKeyword_1_1()); } - - ':' - -{ after(grammarAccess.getGlobalDoAccess().getColonKeyword_1_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__GlobalDo__Group_3__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalDo__Group_3__0__Impl - rule__GlobalDo__Group_3__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalDo__Group_3__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalDoAccess().getLessThanSignKeyword_3_0()); } - - '<' - -{ after(grammarAccess.getGlobalDoAccess().getLessThanSignKeyword_3_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalDo__Group_3__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalDo__Group_3__1__Impl - rule__GlobalDo__Group_3__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalDo__Group_3__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalDoAccess().getArgumentsAssignment_3_1()); } -(rule__GlobalDo__ArgumentsAssignment_3_1) -{ after(grammarAccess.getGlobalDoAccess().getArgumentsAssignment_3_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalDo__Group_3__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalDo__Group_3__2__Impl - rule__GlobalDo__Group_3__3 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalDo__Group_3__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalDoAccess().getGroup_3_2()); } -(rule__GlobalDo__Group_3_2__0)* -{ after(grammarAccess.getGlobalDoAccess().getGroup_3_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalDo__Group_3__3 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalDo__Group_3__3__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalDo__Group_3__3__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalDoAccess().getGreaterThanSignKeyword_3_3()); } - - '>' - -{ after(grammarAccess.getGlobalDoAccess().getGreaterThanSignKeyword_3_3()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - - - -rule__GlobalDo__Group_3_2__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalDo__Group_3_2__0__Impl - rule__GlobalDo__Group_3_2__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalDo__Group_3_2__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalDoAccess().getCommaKeyword_3_2_0()); } - - ',' - -{ after(grammarAccess.getGlobalDoAccess().getCommaKeyword_3_2_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalDo__Group_3_2__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalDo__Group_3_2__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalDo__Group_3_2__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalDoAccess().getArgumentsAssignment_3_2_1()); } -(rule__GlobalDo__ArgumentsAssignment_3_2_1) -{ after(grammarAccess.getGlobalDoAccess().getArgumentsAssignment_3_2_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__GlobalDo__Group_6__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalDo__Group_6__0__Impl - rule__GlobalDo__Group_6__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalDo__Group_6__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalDoAccess().getCommaKeyword_6_0()); } - - ',' - -{ after(grammarAccess.getGlobalDoAccess().getCommaKeyword_6_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__GlobalDo__Group_6__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__GlobalDo__Group_6__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalDo__Group_6__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalDoAccess().getRolesAssignment_6_1()); } -(rule__GlobalDo__RolesAssignment_6_1) -{ after(grammarAccess.getGlobalDoAccess().getRolesAssignment_6_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__LocalProtocolDecl__Group__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalProtocolDecl__Group__0__Impl - rule__LocalProtocolDecl__Group__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__Group__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getLocalKeyword_0()); } - - 'local' - -{ after(grammarAccess.getLocalProtocolDeclAccess().getLocalKeyword_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalProtocolDecl__Group__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalProtocolDecl__Group__1__Impl - rule__LocalProtocolDecl__Group__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__Group__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getProtocolKeyword_1()); } - - 'protocol' - -{ after(grammarAccess.getLocalProtocolDeclAccess().getProtocolKeyword_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalProtocolDecl__Group__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalProtocolDecl__Group__2__Impl - rule__LocalProtocolDecl__Group__3 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__Group__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getNameAssignment_2()); } -(rule__LocalProtocolDecl__NameAssignment_2) -{ after(grammarAccess.getLocalProtocolDeclAccess().getNameAssignment_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalProtocolDecl__Group__3 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalProtocolDecl__Group__3__Impl - rule__LocalProtocolDecl__Group__4 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__Group__3__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getAtKeyword_3()); } - - 'at' - -{ after(grammarAccess.getLocalProtocolDeclAccess().getAtKeyword_3()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalProtocolDecl__Group__4 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalProtocolDecl__Group__4__Impl - rule__LocalProtocolDecl__Group__5 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__Group__4__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getRoleAssignment_4()); } -(rule__LocalProtocolDecl__RoleAssignment_4) -{ after(grammarAccess.getLocalProtocolDeclAccess().getRoleAssignment_4()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalProtocolDecl__Group__5 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalProtocolDecl__Group__5__Impl - rule__LocalProtocolDecl__Group__6 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__Group__5__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getGroup_5()); } -(rule__LocalProtocolDecl__Group_5__0)? -{ after(grammarAccess.getLocalProtocolDeclAccess().getGroup_5()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalProtocolDecl__Group__6 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalProtocolDecl__Group__6__Impl - rule__LocalProtocolDecl__Group__7 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__Group__6__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getLeftParenthesisKeyword_6()); } - - '(' - -{ after(grammarAccess.getLocalProtocolDeclAccess().getLeftParenthesisKeyword_6()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalProtocolDecl__Group__7 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalProtocolDecl__Group__7__Impl - rule__LocalProtocolDecl__Group__8 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__Group__7__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getRolesAssignment_7()); } -(rule__LocalProtocolDecl__RolesAssignment_7) -{ after(grammarAccess.getLocalProtocolDeclAccess().getRolesAssignment_7()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalProtocolDecl__Group__8 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalProtocolDecl__Group__8__Impl - rule__LocalProtocolDecl__Group__9 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__Group__8__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getGroup_8()); } -(rule__LocalProtocolDecl__Group_8__0)* -{ after(grammarAccess.getLocalProtocolDeclAccess().getGroup_8()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalProtocolDecl__Group__9 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalProtocolDecl__Group__9__Impl - rule__LocalProtocolDecl__Group__10 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__Group__9__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getRightParenthesisKeyword_9()); } - - ')' - -{ after(grammarAccess.getLocalProtocolDeclAccess().getRightParenthesisKeyword_9()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalProtocolDecl__Group__10 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalProtocolDecl__Group__10__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__Group__10__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getAlternatives_10()); } -(rule__LocalProtocolDecl__Alternatives_10) -{ after(grammarAccess.getLocalProtocolDeclAccess().getAlternatives_10()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - - - - - - - - - - - - - - - - - -rule__LocalProtocolDecl__Group_5__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalProtocolDecl__Group_5__0__Impl - rule__LocalProtocolDecl__Group_5__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__Group_5__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getLessThanSignKeyword_5_0()); } - - '<' - -{ after(grammarAccess.getLocalProtocolDeclAccess().getLessThanSignKeyword_5_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalProtocolDecl__Group_5__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalProtocolDecl__Group_5__1__Impl - rule__LocalProtocolDecl__Group_5__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__Group_5__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getParametersAssignment_5_1()); } -(rule__LocalProtocolDecl__ParametersAssignment_5_1) -{ after(grammarAccess.getLocalProtocolDeclAccess().getParametersAssignment_5_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalProtocolDecl__Group_5__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalProtocolDecl__Group_5__2__Impl - rule__LocalProtocolDecl__Group_5__3 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__Group_5__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getGroup_5_2()); } -(rule__LocalProtocolDecl__Group_5_2__0)* -{ after(grammarAccess.getLocalProtocolDeclAccess().getGroup_5_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalProtocolDecl__Group_5__3 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalProtocolDecl__Group_5__3__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__Group_5__3__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getGreaterThanSignKeyword_5_3()); } - - '>' - -{ after(grammarAccess.getLocalProtocolDeclAccess().getGreaterThanSignKeyword_5_3()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - - - -rule__LocalProtocolDecl__Group_5_2__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalProtocolDecl__Group_5_2__0__Impl - rule__LocalProtocolDecl__Group_5_2__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__Group_5_2__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getCommaKeyword_5_2_0()); } - - ',' - -{ after(grammarAccess.getLocalProtocolDeclAccess().getCommaKeyword_5_2_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalProtocolDecl__Group_5_2__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalProtocolDecl__Group_5_2__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__Group_5_2__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getParametersAssignment_5_2_1()); } -(rule__LocalProtocolDecl__ParametersAssignment_5_2_1) -{ after(grammarAccess.getLocalProtocolDeclAccess().getParametersAssignment_5_2_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__LocalProtocolDecl__Group_8__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalProtocolDecl__Group_8__0__Impl - rule__LocalProtocolDecl__Group_8__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__Group_8__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getCommaKeyword_8_0()); } - - ',' - -{ after(grammarAccess.getLocalProtocolDeclAccess().getCommaKeyword_8_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalProtocolDecl__Group_8__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalProtocolDecl__Group_8__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__Group_8__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getRolesAssignment_8_1()); } -(rule__LocalProtocolDecl__RolesAssignment_8_1) -{ after(grammarAccess.getLocalProtocolDeclAccess().getRolesAssignment_8_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__LocalProtocolDecl__Group_10_1__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalProtocolDecl__Group_10_1__0__Impl - rule__LocalProtocolDecl__Group_10_1__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__Group_10_1__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getInstantiatesKeyword_10_1_0()); } - - 'instantiates' - -{ after(grammarAccess.getLocalProtocolDeclAccess().getInstantiatesKeyword_10_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalProtocolDecl__Group_10_1__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalProtocolDecl__Group_10_1__1__Impl - rule__LocalProtocolDecl__Group_10_1__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__Group_10_1__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getInstantiatesAssignment_10_1_1()); } -(rule__LocalProtocolDecl__InstantiatesAssignment_10_1_1) -{ after(grammarAccess.getLocalProtocolDeclAccess().getInstantiatesAssignment_10_1_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalProtocolDecl__Group_10_1__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalProtocolDecl__Group_10_1__2__Impl - rule__LocalProtocolDecl__Group_10_1__3 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__Group_10_1__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getGroup_10_1_2()); } -(rule__LocalProtocolDecl__Group_10_1_2__0)? -{ after(grammarAccess.getLocalProtocolDeclAccess().getGroup_10_1_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalProtocolDecl__Group_10_1__3 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalProtocolDecl__Group_10_1__3__Impl - rule__LocalProtocolDecl__Group_10_1__4 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__Group_10_1__3__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getLeftParenthesisKeyword_10_1_3()); } - - '(' - -{ after(grammarAccess.getLocalProtocolDeclAccess().getLeftParenthesisKeyword_10_1_3()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalProtocolDecl__Group_10_1__4 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalProtocolDecl__Group_10_1__4__Impl - rule__LocalProtocolDecl__Group_10_1__5 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__Group_10_1__4__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getRoleInstantiationsAssignment_10_1_4()); } -(rule__LocalProtocolDecl__RoleInstantiationsAssignment_10_1_4) -{ after(grammarAccess.getLocalProtocolDeclAccess().getRoleInstantiationsAssignment_10_1_4()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalProtocolDecl__Group_10_1__5 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalProtocolDecl__Group_10_1__5__Impl - rule__LocalProtocolDecl__Group_10_1__6 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__Group_10_1__5__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getGroup_10_1_5()); } -(rule__LocalProtocolDecl__Group_10_1_5__0)* -{ after(grammarAccess.getLocalProtocolDeclAccess().getGroup_10_1_5()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalProtocolDecl__Group_10_1__6 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalProtocolDecl__Group_10_1__6__Impl - rule__LocalProtocolDecl__Group_10_1__7 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__Group_10_1__6__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getRightParenthesisKeyword_10_1_6()); } - - ')' - -{ after(grammarAccess.getLocalProtocolDeclAccess().getRightParenthesisKeyword_10_1_6()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalProtocolDecl__Group_10_1__7 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalProtocolDecl__Group_10_1__7__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__Group_10_1__7__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getSemicolonKeyword_10_1_7()); } - - ';' - -{ after(grammarAccess.getLocalProtocolDeclAccess().getSemicolonKeyword_10_1_7()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - - - - - - - - - - - -rule__LocalProtocolDecl__Group_10_1_2__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalProtocolDecl__Group_10_1_2__0__Impl - rule__LocalProtocolDecl__Group_10_1_2__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__Group_10_1_2__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getLessThanSignKeyword_10_1_2_0()); } - - '<' - -{ after(grammarAccess.getLocalProtocolDeclAccess().getLessThanSignKeyword_10_1_2_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalProtocolDecl__Group_10_1_2__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalProtocolDecl__Group_10_1_2__1__Impl - rule__LocalProtocolDecl__Group_10_1_2__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__Group_10_1_2__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getArgumentsAssignment_10_1_2_1()); } -(rule__LocalProtocolDecl__ArgumentsAssignment_10_1_2_1) -{ after(grammarAccess.getLocalProtocolDeclAccess().getArgumentsAssignment_10_1_2_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalProtocolDecl__Group_10_1_2__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalProtocolDecl__Group_10_1_2__2__Impl - rule__LocalProtocolDecl__Group_10_1_2__3 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__Group_10_1_2__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getGroup_10_1_2_2()); } -(rule__LocalProtocolDecl__Group_10_1_2_2__0)* -{ after(grammarAccess.getLocalProtocolDeclAccess().getGroup_10_1_2_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalProtocolDecl__Group_10_1_2__3 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalProtocolDecl__Group_10_1_2__3__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__Group_10_1_2__3__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getGreaterThanSignKeyword_10_1_2_3()); } - - '>' - -{ after(grammarAccess.getLocalProtocolDeclAccess().getGreaterThanSignKeyword_10_1_2_3()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - - - -rule__LocalProtocolDecl__Group_10_1_2_2__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalProtocolDecl__Group_10_1_2_2__0__Impl - rule__LocalProtocolDecl__Group_10_1_2_2__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__Group_10_1_2_2__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getCommaKeyword_10_1_2_2_0()); } - - ',' - -{ after(grammarAccess.getLocalProtocolDeclAccess().getCommaKeyword_10_1_2_2_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalProtocolDecl__Group_10_1_2_2__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalProtocolDecl__Group_10_1_2_2__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__Group_10_1_2_2__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getArgumentsAssignment_10_1_2_2_1()); } -(rule__LocalProtocolDecl__ArgumentsAssignment_10_1_2_2_1) -{ after(grammarAccess.getLocalProtocolDeclAccess().getArgumentsAssignment_10_1_2_2_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__LocalProtocolDecl__Group_10_1_5__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalProtocolDecl__Group_10_1_5__0__Impl - rule__LocalProtocolDecl__Group_10_1_5__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__Group_10_1_5__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getCommaKeyword_10_1_5_0()); } - - ',' - -{ after(grammarAccess.getLocalProtocolDeclAccess().getCommaKeyword_10_1_5_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalProtocolDecl__Group_10_1_5__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalProtocolDecl__Group_10_1_5__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__Group_10_1_5__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getRoleInstantiationsAssignment_10_1_5_1()); } -(rule__LocalProtocolDecl__RoleInstantiationsAssignment_10_1_5_1) -{ after(grammarAccess.getLocalProtocolDeclAccess().getRoleInstantiationsAssignment_10_1_5_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__LocalProtocolBlock__Group__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalProtocolBlock__Group__0__Impl - rule__LocalProtocolBlock__Group__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolBlock__Group__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolBlockAccess().getLocalProtocolBlockAction_0()); } -( - -) -{ after(grammarAccess.getLocalProtocolBlockAccess().getLocalProtocolBlockAction_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalProtocolBlock__Group__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalProtocolBlock__Group__1__Impl - rule__LocalProtocolBlock__Group__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolBlock__Group__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolBlockAccess().getLeftCurlyBracketKeyword_1()); } - - '{' - -{ after(grammarAccess.getLocalProtocolBlockAccess().getLeftCurlyBracketKeyword_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalProtocolBlock__Group__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalProtocolBlock__Group__2__Impl - rule__LocalProtocolBlock__Group__3 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolBlock__Group__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolBlockAccess().getActivitiesAssignment_2()); } -(rule__LocalProtocolBlock__ActivitiesAssignment_2)* -{ after(grammarAccess.getLocalProtocolBlockAccess().getActivitiesAssignment_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalProtocolBlock__Group__3 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalProtocolBlock__Group__3__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolBlock__Group__3__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolBlockAccess().getRightCurlyBracketKeyword_3()); } - - '}' - -{ after(grammarAccess.getLocalProtocolBlockAccess().getRightCurlyBracketKeyword_3()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - - - -rule__LocalSend__Group__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalSend__Group__0__Impl - rule__LocalSend__Group__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalSend__Group__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalSendAccess().getMessageAssignment_0()); } -(rule__LocalSend__MessageAssignment_0) -{ after(grammarAccess.getLocalSendAccess().getMessageAssignment_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalSend__Group__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalSend__Group__1__Impl - rule__LocalSend__Group__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalSend__Group__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalSendAccess().getToKeyword_1()); } - - 'to' - -{ after(grammarAccess.getLocalSendAccess().getToKeyword_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalSend__Group__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalSend__Group__2__Impl - rule__LocalSend__Group__3 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalSend__Group__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalSendAccess().getToRolesAssignment_2()); } -(rule__LocalSend__ToRolesAssignment_2) -{ after(grammarAccess.getLocalSendAccess().getToRolesAssignment_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalSend__Group__3 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalSend__Group__3__Impl - rule__LocalSend__Group__4 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalSend__Group__3__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalSendAccess().getGroup_3()); } -(rule__LocalSend__Group_3__0)* -{ after(grammarAccess.getLocalSendAccess().getGroup_3()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalSend__Group__4 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalSend__Group__4__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalSend__Group__4__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalSendAccess().getSemicolonKeyword_4()); } - - ';' - -{ after(grammarAccess.getLocalSendAccess().getSemicolonKeyword_4()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - - - - - -rule__LocalSend__Group_3__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalSend__Group_3__0__Impl - rule__LocalSend__Group_3__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalSend__Group_3__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalSendAccess().getCommaKeyword_3_0()); } - - ',' - -{ after(grammarAccess.getLocalSendAccess().getCommaKeyword_3_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalSend__Group_3__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalSend__Group_3__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalSend__Group_3__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalSendAccess().getToRolesAssignment_3_1()); } -(rule__LocalSend__ToRolesAssignment_3_1) -{ after(grammarAccess.getLocalSendAccess().getToRolesAssignment_3_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__LocalReceive__Group__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalReceive__Group__0__Impl - rule__LocalReceive__Group__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalReceive__Group__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalReceiveAccess().getMessageAssignment_0()); } -(rule__LocalReceive__MessageAssignment_0) -{ after(grammarAccess.getLocalReceiveAccess().getMessageAssignment_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalReceive__Group__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalReceive__Group__1__Impl - rule__LocalReceive__Group__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalReceive__Group__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalReceiveAccess().getFromKeyword_1()); } - - 'from' - -{ after(grammarAccess.getLocalReceiveAccess().getFromKeyword_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalReceive__Group__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalReceive__Group__2__Impl - rule__LocalReceive__Group__3 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalReceive__Group__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalReceiveAccess().getFromRoleAssignment_2()); } -(rule__LocalReceive__FromRoleAssignment_2) -{ after(grammarAccess.getLocalReceiveAccess().getFromRoleAssignment_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalReceive__Group__3 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalReceive__Group__3__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalReceive__Group__3__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalReceiveAccess().getSemicolonKeyword_3()); } - - ';' - -{ after(grammarAccess.getLocalReceiveAccess().getSemicolonKeyword_3()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - - - -rule__LocalChoice__Group__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalChoice__Group__0__Impl - rule__LocalChoice__Group__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalChoice__Group__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalChoiceAccess().getChoiceKeyword_0()); } - - 'choice' - -{ after(grammarAccess.getLocalChoiceAccess().getChoiceKeyword_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalChoice__Group__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalChoice__Group__1__Impl - rule__LocalChoice__Group__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalChoice__Group__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalChoiceAccess().getAtKeyword_1()); } - - 'at' - -{ after(grammarAccess.getLocalChoiceAccess().getAtKeyword_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalChoice__Group__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalChoice__Group__2__Impl - rule__LocalChoice__Group__3 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalChoice__Group__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalChoiceAccess().getRoleAssignment_2()); } -(rule__LocalChoice__RoleAssignment_2) -{ after(grammarAccess.getLocalChoiceAccess().getRoleAssignment_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalChoice__Group__3 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalChoice__Group__3__Impl - rule__LocalChoice__Group__4 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalChoice__Group__3__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalChoiceAccess().getBlocksAssignment_3()); } -(rule__LocalChoice__BlocksAssignment_3) -{ after(grammarAccess.getLocalChoiceAccess().getBlocksAssignment_3()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalChoice__Group__4 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalChoice__Group__4__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalChoice__Group__4__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalChoiceAccess().getGroup_4()); } -(rule__LocalChoice__Group_4__0)* -{ after(grammarAccess.getLocalChoiceAccess().getGroup_4()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - - - - - -rule__LocalChoice__Group_4__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalChoice__Group_4__0__Impl - rule__LocalChoice__Group_4__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalChoice__Group_4__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalChoiceAccess().getOrKeyword_4_0()); } - - 'or' - -{ after(grammarAccess.getLocalChoiceAccess().getOrKeyword_4_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalChoice__Group_4__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalChoice__Group_4__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalChoice__Group_4__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalChoiceAccess().getBlocksAssignment_4_1()); } -(rule__LocalChoice__BlocksAssignment_4_1) -{ after(grammarAccess.getLocalChoiceAccess().getBlocksAssignment_4_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__LocalRecursion__Group__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalRecursion__Group__0__Impl - rule__LocalRecursion__Group__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalRecursion__Group__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalRecursionAccess().getRecKeyword_0()); } - - 'rec' - -{ after(grammarAccess.getLocalRecursionAccess().getRecKeyword_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalRecursion__Group__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalRecursion__Group__1__Impl - rule__LocalRecursion__Group__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalRecursion__Group__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalRecursionAccess().getLabelAssignment_1()); } -(rule__LocalRecursion__LabelAssignment_1) -{ after(grammarAccess.getLocalRecursionAccess().getLabelAssignment_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalRecursion__Group__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalRecursion__Group__2__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalRecursion__Group__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalRecursionAccess().getBlockAssignment_2()); } -(rule__LocalRecursion__BlockAssignment_2) -{ after(grammarAccess.getLocalRecursionAccess().getBlockAssignment_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - -rule__LocalContinue__Group__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalContinue__Group__0__Impl - rule__LocalContinue__Group__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalContinue__Group__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalContinueAccess().getContinueKeyword_0()); } - - 'continue' - -{ after(grammarAccess.getLocalContinueAccess().getContinueKeyword_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalContinue__Group__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalContinue__Group__1__Impl - rule__LocalContinue__Group__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalContinue__Group__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalContinueAccess().getLabelAssignment_1()); } -(rule__LocalContinue__LabelAssignment_1) -{ after(grammarAccess.getLocalContinueAccess().getLabelAssignment_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalContinue__Group__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalContinue__Group__2__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalContinue__Group__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalContinueAccess().getSemicolonKeyword_2()); } - - ';' - -{ after(grammarAccess.getLocalContinueAccess().getSemicolonKeyword_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - -rule__LocalParallel__Group__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalParallel__Group__0__Impl - rule__LocalParallel__Group__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalParallel__Group__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalParallelAccess().getParKeyword_0()); } - - 'par' - -{ after(grammarAccess.getLocalParallelAccess().getParKeyword_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalParallel__Group__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalParallel__Group__1__Impl - rule__LocalParallel__Group__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalParallel__Group__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalParallelAccess().getBlocksAssignment_1()); } -(rule__LocalParallel__BlocksAssignment_1) -{ after(grammarAccess.getLocalParallelAccess().getBlocksAssignment_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalParallel__Group__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalParallel__Group__2__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalParallel__Group__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalParallelAccess().getGroup_2()); } -(rule__LocalParallel__Group_2__0)* -{ after(grammarAccess.getLocalParallelAccess().getGroup_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - -rule__LocalParallel__Group_2__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalParallel__Group_2__0__Impl - rule__LocalParallel__Group_2__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalParallel__Group_2__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalParallelAccess().getAndKeyword_2_0()); } - - 'and' - -{ after(grammarAccess.getLocalParallelAccess().getAndKeyword_2_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalParallel__Group_2__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalParallel__Group_2__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalParallel__Group_2__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalParallelAccess().getBlocksAssignment_2_1()); } -(rule__LocalParallel__BlocksAssignment_2_1) -{ after(grammarAccess.getLocalParallelAccess().getBlocksAssignment_2_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__LocalInterruptible__Group__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalInterruptible__Group__0__Impl - rule__LocalInterruptible__Group__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalInterruptible__Group__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalInterruptibleAccess().getInterruptibleKeyword_0()); } - - 'interruptible' - -{ after(grammarAccess.getLocalInterruptibleAccess().getInterruptibleKeyword_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalInterruptible__Group__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalInterruptible__Group__1__Impl - rule__LocalInterruptible__Group__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalInterruptible__Group__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalInterruptibleAccess().getGroup_1()); } -(rule__LocalInterruptible__Group_1__0)? -{ after(grammarAccess.getLocalInterruptibleAccess().getGroup_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalInterruptible__Group__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalInterruptible__Group__2__Impl - rule__LocalInterruptible__Group__3 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalInterruptible__Group__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalInterruptibleAccess().getBlockAssignment_2()); } -(rule__LocalInterruptible__BlockAssignment_2) -{ after(grammarAccess.getLocalInterruptibleAccess().getBlockAssignment_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalInterruptible__Group__3 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalInterruptible__Group__3__Impl - rule__LocalInterruptible__Group__4 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalInterruptible__Group__3__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalInterruptibleAccess().getWithKeyword_3()); } - - 'with' - -{ after(grammarAccess.getLocalInterruptibleAccess().getWithKeyword_3()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalInterruptible__Group__4 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalInterruptible__Group__4__Impl - rule__LocalInterruptible__Group__5 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalInterruptible__Group__4__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalInterruptibleAccess().getLeftCurlyBracketKeyword_4()); } - - '{' - -{ after(grammarAccess.getLocalInterruptibleAccess().getLeftCurlyBracketKeyword_4()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalInterruptible__Group__5 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalInterruptible__Group__5__Impl - rule__LocalInterruptible__Group__6 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalInterruptible__Group__5__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalInterruptibleAccess().getThrowAssignment_5()); } -(rule__LocalInterruptible__ThrowAssignment_5)? -{ after(grammarAccess.getLocalInterruptibleAccess().getThrowAssignment_5()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalInterruptible__Group__6 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalInterruptible__Group__6__Impl - rule__LocalInterruptible__Group__7 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalInterruptible__Group__6__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalInterruptibleAccess().getCatchesAssignment_6()); } -(rule__LocalInterruptible__CatchesAssignment_6)* -{ after(grammarAccess.getLocalInterruptibleAccess().getCatchesAssignment_6()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalInterruptible__Group__7 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalInterruptible__Group__7__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalInterruptible__Group__7__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalInterruptibleAccess().getRightCurlyBracketKeyword_7()); } - - '}' - -{ after(grammarAccess.getLocalInterruptibleAccess().getRightCurlyBracketKeyword_7()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - - - - - - - - - - - -rule__LocalInterruptible__Group_1__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalInterruptible__Group_1__0__Impl - rule__LocalInterruptible__Group_1__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalInterruptible__Group_1__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalInterruptibleAccess().getScopeAssignment_1_0()); } -(rule__LocalInterruptible__ScopeAssignment_1_0) -{ after(grammarAccess.getLocalInterruptibleAccess().getScopeAssignment_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalInterruptible__Group_1__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalInterruptible__Group_1__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalInterruptible__Group_1__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalInterruptibleAccess().getColonKeyword_1_1()); } - - ':' - -{ after(grammarAccess.getLocalInterruptibleAccess().getColonKeyword_1_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__LocalThrow__Group__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalThrow__Group__0__Impl - rule__LocalThrow__Group__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalThrow__Group__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalThrowAccess().getThrowKeyword_0()); } - - 'throw' - -{ after(grammarAccess.getLocalThrowAccess().getThrowKeyword_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalThrow__Group__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalThrow__Group__1__Impl - rule__LocalThrow__Group__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalThrow__Group__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalThrowAccess().getMessagesAssignment_1()); } -(rule__LocalThrow__MessagesAssignment_1) -{ after(grammarAccess.getLocalThrowAccess().getMessagesAssignment_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalThrow__Group__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalThrow__Group__2__Impl - rule__LocalThrow__Group__3 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalThrow__Group__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalThrowAccess().getGroup_2()); } -(rule__LocalThrow__Group_2__0)* -{ after(grammarAccess.getLocalThrowAccess().getGroup_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalThrow__Group__3 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalThrow__Group__3__Impl - rule__LocalThrow__Group__4 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalThrow__Group__3__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalThrowAccess().getToKeyword_3()); } - - 'to' - -{ after(grammarAccess.getLocalThrowAccess().getToKeyword_3()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalThrow__Group__4 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalThrow__Group__4__Impl - rule__LocalThrow__Group__5 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalThrow__Group__4__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalThrowAccess().getToRolesAssignment_4()); } -(rule__LocalThrow__ToRolesAssignment_4) -{ after(grammarAccess.getLocalThrowAccess().getToRolesAssignment_4()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalThrow__Group__5 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalThrow__Group__5__Impl - rule__LocalThrow__Group__6 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalThrow__Group__5__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalThrowAccess().getGroup_5()); } -(rule__LocalThrow__Group_5__0)* -{ after(grammarAccess.getLocalThrowAccess().getGroup_5()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalThrow__Group__6 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalThrow__Group__6__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalThrow__Group__6__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalThrowAccess().getSemicolonKeyword_6()); } - - ';' - -{ after(grammarAccess.getLocalThrowAccess().getSemicolonKeyword_6()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - - - - - - - - - -rule__LocalThrow__Group_2__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalThrow__Group_2__0__Impl - rule__LocalThrow__Group_2__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalThrow__Group_2__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalThrowAccess().getCommaKeyword_2_0()); } - - ',' - -{ after(grammarAccess.getLocalThrowAccess().getCommaKeyword_2_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalThrow__Group_2__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalThrow__Group_2__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalThrow__Group_2__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalThrowAccess().getMessagesAssignment_2_1()); } -(rule__LocalThrow__MessagesAssignment_2_1) -{ after(grammarAccess.getLocalThrowAccess().getMessagesAssignment_2_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__LocalThrow__Group_5__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalThrow__Group_5__0__Impl - rule__LocalThrow__Group_5__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalThrow__Group_5__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalThrowAccess().getCommaKeyword_5_0()); } - - ',' - -{ after(grammarAccess.getLocalThrowAccess().getCommaKeyword_5_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalThrow__Group_5__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalThrow__Group_5__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalThrow__Group_5__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalThrowAccess().getToRolesAssignment_5_1()); } -(rule__LocalThrow__ToRolesAssignment_5_1) -{ after(grammarAccess.getLocalThrowAccess().getToRolesAssignment_5_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__LocalCatch__Group__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalCatch__Group__0__Impl - rule__LocalCatch__Group__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalCatch__Group__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalCatchAccess().getCatchesKeyword_0()); } - - 'catches' - -{ after(grammarAccess.getLocalCatchAccess().getCatchesKeyword_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalCatch__Group__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalCatch__Group__1__Impl - rule__LocalCatch__Group__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalCatch__Group__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalCatchAccess().getMessagesAssignment_1()); } -(rule__LocalCatch__MessagesAssignment_1) -{ after(grammarAccess.getLocalCatchAccess().getMessagesAssignment_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalCatch__Group__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalCatch__Group__2__Impl - rule__LocalCatch__Group__3 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalCatch__Group__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalCatchAccess().getGroup_2()); } -(rule__LocalCatch__Group_2__0)* -{ after(grammarAccess.getLocalCatchAccess().getGroup_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalCatch__Group__3 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalCatch__Group__3__Impl - rule__LocalCatch__Group__4 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalCatch__Group__3__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalCatchAccess().getFromKeyword_3()); } - - 'from' - -{ after(grammarAccess.getLocalCatchAccess().getFromKeyword_3()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalCatch__Group__4 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalCatch__Group__4__Impl - rule__LocalCatch__Group__5 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalCatch__Group__4__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalCatchAccess().getFromRoleAssignment_4()); } -(rule__LocalCatch__FromRoleAssignment_4) -{ after(grammarAccess.getLocalCatchAccess().getFromRoleAssignment_4()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalCatch__Group__5 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalCatch__Group__5__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalCatch__Group__5__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalCatchAccess().getSemicolonKeyword_5()); } - - ';' - -{ after(grammarAccess.getLocalCatchAccess().getSemicolonKeyword_5()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - - - - - - - -rule__LocalCatch__Group_2__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalCatch__Group_2__0__Impl - rule__LocalCatch__Group_2__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalCatch__Group_2__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalCatchAccess().getCommaKeyword_2_0()); } - - ',' - -{ after(grammarAccess.getLocalCatchAccess().getCommaKeyword_2_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalCatch__Group_2__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalCatch__Group_2__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalCatch__Group_2__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalCatchAccess().getMessagesAssignment_2_1()); } -(rule__LocalCatch__MessagesAssignment_2_1) -{ after(grammarAccess.getLocalCatchAccess().getMessagesAssignment_2_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__LocalDo__Group__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalDo__Group__0__Impl - rule__LocalDo__Group__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalDo__Group__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalDoAccess().getDoKeyword_0()); } - - 'do' - -{ after(grammarAccess.getLocalDoAccess().getDoKeyword_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalDo__Group__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalDo__Group__1__Impl - rule__LocalDo__Group__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalDo__Group__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalDoAccess().getGroup_1()); } -(rule__LocalDo__Group_1__0)? -{ after(grammarAccess.getLocalDoAccess().getGroup_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalDo__Group__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalDo__Group__2__Impl - rule__LocalDo__Group__3 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalDo__Group__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalDoAccess().getMemberAssignment_2()); } -(rule__LocalDo__MemberAssignment_2) -{ after(grammarAccess.getLocalDoAccess().getMemberAssignment_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalDo__Group__3 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalDo__Group__3__Impl - rule__LocalDo__Group__4 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalDo__Group__3__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalDoAccess().getGroup_3()); } -(rule__LocalDo__Group_3__0)? -{ after(grammarAccess.getLocalDoAccess().getGroup_3()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalDo__Group__4 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalDo__Group__4__Impl - rule__LocalDo__Group__5 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalDo__Group__4__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalDoAccess().getLeftParenthesisKeyword_4()); } - - '(' - -{ after(grammarAccess.getLocalDoAccess().getLeftParenthesisKeyword_4()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalDo__Group__5 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalDo__Group__5__Impl - rule__LocalDo__Group__6 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalDo__Group__5__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalDoAccess().getRolesAssignment_5()); } -(rule__LocalDo__RolesAssignment_5) -{ after(grammarAccess.getLocalDoAccess().getRolesAssignment_5()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalDo__Group__6 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalDo__Group__6__Impl - rule__LocalDo__Group__7 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalDo__Group__6__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalDoAccess().getGroup_6()); } -(rule__LocalDo__Group_6__0)* -{ after(grammarAccess.getLocalDoAccess().getGroup_6()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalDo__Group__7 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalDo__Group__7__Impl - rule__LocalDo__Group__8 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalDo__Group__7__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalDoAccess().getRightParenthesisKeyword_7()); } - - ')' - -{ after(grammarAccess.getLocalDoAccess().getRightParenthesisKeyword_7()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalDo__Group__8 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalDo__Group__8__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalDo__Group__8__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalDoAccess().getSemicolonKeyword_8()); } - - ';' - -{ after(grammarAccess.getLocalDoAccess().getSemicolonKeyword_8()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - - - - - - - - - - - - - -rule__LocalDo__Group_1__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalDo__Group_1__0__Impl - rule__LocalDo__Group_1__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalDo__Group_1__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalDoAccess().getScopeAssignment_1_0()); } -(rule__LocalDo__ScopeAssignment_1_0) -{ after(grammarAccess.getLocalDoAccess().getScopeAssignment_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalDo__Group_1__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalDo__Group_1__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalDo__Group_1__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalDoAccess().getColonKeyword_1_1()); } - - ':' - -{ after(grammarAccess.getLocalDoAccess().getColonKeyword_1_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__LocalDo__Group_3__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalDo__Group_3__0__Impl - rule__LocalDo__Group_3__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalDo__Group_3__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalDoAccess().getLessThanSignKeyword_3_0()); } - - '<' - -{ after(grammarAccess.getLocalDoAccess().getLessThanSignKeyword_3_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalDo__Group_3__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalDo__Group_3__1__Impl - rule__LocalDo__Group_3__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalDo__Group_3__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalDoAccess().getArgumentsAssignment_3_1()); } -(rule__LocalDo__ArgumentsAssignment_3_1) -{ after(grammarAccess.getLocalDoAccess().getArgumentsAssignment_3_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalDo__Group_3__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalDo__Group_3__2__Impl - rule__LocalDo__Group_3__3 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalDo__Group_3__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalDoAccess().getGroup_3_2()); } -(rule__LocalDo__Group_3_2__0)* -{ after(grammarAccess.getLocalDoAccess().getGroup_3_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalDo__Group_3__3 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalDo__Group_3__3__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalDo__Group_3__3__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalDoAccess().getGreaterThanSignKeyword_3_3()); } - - '>' - -{ after(grammarAccess.getLocalDoAccess().getGreaterThanSignKeyword_3_3()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - - - -rule__LocalDo__Group_3_2__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalDo__Group_3_2__0__Impl - rule__LocalDo__Group_3_2__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalDo__Group_3_2__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalDoAccess().getCommaKeyword_3_2_0()); } - - ',' - -{ after(grammarAccess.getLocalDoAccess().getCommaKeyword_3_2_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalDo__Group_3_2__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalDo__Group_3_2__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalDo__Group_3_2__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalDoAccess().getArgumentsAssignment_3_2_1()); } -(rule__LocalDo__ArgumentsAssignment_3_2_1) -{ after(grammarAccess.getLocalDoAccess().getArgumentsAssignment_3_2_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__LocalDo__Group_6__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalDo__Group_6__0__Impl - rule__LocalDo__Group_6__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalDo__Group_6__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalDoAccess().getCommaKeyword_6_0()); } - - ',' - -{ after(grammarAccess.getLocalDoAccess().getCommaKeyword_6_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__LocalDo__Group_6__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__LocalDo__Group_6__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalDo__Group_6__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalDoAccess().getRolesAssignment_6_1()); } -(rule__LocalDo__RolesAssignment_6_1) -{ after(grammarAccess.getLocalDoAccess().getRolesAssignment_6_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - -rule__Module__NameAssignment_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getModuleAccess().getNameModuleNameParserRuleCall_1_0()); } - ruleModuleName{ after(grammarAccess.getModuleAccess().getNameModuleNameParserRuleCall_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__Module__ImportsAssignment_3 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getModuleAccess().getImportsImportDeclParserRuleCall_3_0()); } - ruleImportDecl{ after(grammarAccess.getModuleAccess().getImportsImportDeclParserRuleCall_3_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__Module__TypesAssignment_4 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getModuleAccess().getTypesPayloadTypeDeclParserRuleCall_4_0()); } - rulePayloadTypeDecl{ after(grammarAccess.getModuleAccess().getTypesPayloadTypeDeclParserRuleCall_4_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__Module__GlobalsAssignment_5_0 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getModuleAccess().getGlobalsGlobalProtocolDeclParserRuleCall_5_0_0()); } - ruleGlobalProtocolDecl{ after(grammarAccess.getModuleAccess().getGlobalsGlobalProtocolDeclParserRuleCall_5_0_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__Module__LocalsAssignment_5_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getModuleAccess().getLocalsLocalProtocolDeclParserRuleCall_5_1_0()); } - ruleLocalProtocolDecl{ after(grammarAccess.getModuleAccess().getLocalsLocalProtocolDeclParserRuleCall_5_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__ImportModule__NameAssignment_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getImportModuleAccess().getNameModuleNameParserRuleCall_1_0()); } - ruleModuleName{ after(grammarAccess.getImportModuleAccess().getNameModuleNameParserRuleCall_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__ImportModule__AliasAssignment_2_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getImportModuleAccess().getAliasIDTerminalRuleCall_2_1_0()); } - RULE_ID{ after(grammarAccess.getImportModuleAccess().getAliasIDTerminalRuleCall_2_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__ImportMember__NameAssignment_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getImportMemberAccess().getNameModuleNameParserRuleCall_1_0()); } - ruleModuleName{ after(grammarAccess.getImportMemberAccess().getNameModuleNameParserRuleCall_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__ImportMember__MemberAssignment_3 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getImportMemberAccess().getMemberIDTerminalRuleCall_3_0()); } - RULE_ID{ after(grammarAccess.getImportMemberAccess().getMemberIDTerminalRuleCall_3_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__ImportMember__AliasAssignment_4_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getImportMemberAccess().getAliasIDTerminalRuleCall_4_1_0()); } - RULE_ID{ after(grammarAccess.getImportMemberAccess().getAliasIDTerminalRuleCall_4_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__PayloadTypeDecl__SchemaAssignment_2 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getPayloadTypeDeclAccess().getSchemaIDTerminalRuleCall_2_0()); } - RULE_ID{ after(grammarAccess.getPayloadTypeDeclAccess().getSchemaIDTerminalRuleCall_2_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__PayloadTypeDecl__TypeAssignment_4 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getPayloadTypeDeclAccess().getTypeSTRINGTerminalRuleCall_4_0()); } - RULE_STRING{ after(grammarAccess.getPayloadTypeDeclAccess().getTypeSTRINGTerminalRuleCall_4_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__PayloadTypeDecl__LocationAssignment_6 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getPayloadTypeDeclAccess().getLocationSTRINGTerminalRuleCall_6_0()); } - RULE_STRING{ after(grammarAccess.getPayloadTypeDeclAccess().getLocationSTRINGTerminalRuleCall_6_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__PayloadTypeDecl__AliasAssignment_8 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getPayloadTypeDeclAccess().getAliasIDTerminalRuleCall_8_0()); } - RULE_ID{ after(grammarAccess.getPayloadTypeDeclAccess().getAliasIDTerminalRuleCall_8_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__MessageSignature__OperatorAssignment_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getMessageSignatureAccess().getOperatorIDTerminalRuleCall_1_0()); } - RULE_ID{ after(grammarAccess.getMessageSignatureAccess().getOperatorIDTerminalRuleCall_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__MessageSignature__TypesAssignment_3_0 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getMessageSignatureAccess().getTypesPayloadElementParserRuleCall_3_0_0()); } - rulePayloadElement{ after(grammarAccess.getMessageSignatureAccess().getTypesPayloadElementParserRuleCall_3_0_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__MessageSignature__TypesAssignment_3_1_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getMessageSignatureAccess().getTypesPayloadElementParserRuleCall_3_1_1_0()); } - rulePayloadElement{ after(grammarAccess.getMessageSignatureAccess().getTypesPayloadElementParserRuleCall_3_1_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__PayloadElement__NameAssignment_0_0 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getPayloadElementAccess().getNameIDTerminalRuleCall_0_0_0()); } - RULE_ID{ after(grammarAccess.getPayloadElementAccess().getNameIDTerminalRuleCall_0_0_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__PayloadElement__TypeAssignment_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getPayloadElementAccess().getTypeIDTerminalRuleCall_1_0()); } - RULE_ID{ after(grammarAccess.getPayloadElementAccess().getTypeIDTerminalRuleCall_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__NameAssignment_2 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getNameIDTerminalRuleCall_2_0()); } - RULE_ID{ after(grammarAccess.getGlobalProtocolDeclAccess().getNameIDTerminalRuleCall_2_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__ParametersAssignment_3_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getParametersParameterDeclParserRuleCall_3_1_0()); } - ruleParameterDecl{ after(grammarAccess.getGlobalProtocolDeclAccess().getParametersParameterDeclParserRuleCall_3_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__ParametersAssignment_3_2_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getParametersParameterDeclParserRuleCall_3_2_1_0()); } - ruleParameterDecl{ after(grammarAccess.getGlobalProtocolDeclAccess().getParametersParameterDeclParserRuleCall_3_2_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__RolesAssignment_5 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getRolesRoleDeclParserRuleCall_5_0()); } - ruleRoleDecl{ after(grammarAccess.getGlobalProtocolDeclAccess().getRolesRoleDeclParserRuleCall_5_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__RolesAssignment_6_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getRolesRoleDeclParserRuleCall_6_1_0()); } - ruleRoleDecl{ after(grammarAccess.getGlobalProtocolDeclAccess().getRolesRoleDeclParserRuleCall_6_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__BlockAssignment_8_0 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getBlockGlobalProtocolBlockParserRuleCall_8_0_0()); } - ruleGlobalProtocolBlock{ after(grammarAccess.getGlobalProtocolDeclAccess().getBlockGlobalProtocolBlockParserRuleCall_8_0_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__InstantiatesAssignment_8_1_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getInstantiatesIDTerminalRuleCall_8_1_1_0()); } - RULE_ID{ after(grammarAccess.getGlobalProtocolDeclAccess().getInstantiatesIDTerminalRuleCall_8_1_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__ArgumentsAssignment_8_1_2_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getArgumentsArgumentParserRuleCall_8_1_2_1_0()); } - ruleArgument{ after(grammarAccess.getGlobalProtocolDeclAccess().getArgumentsArgumentParserRuleCall_8_1_2_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__ArgumentsAssignment_8_1_2_2_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getArgumentsArgumentParserRuleCall_8_1_2_2_1_0()); } - ruleArgument{ after(grammarAccess.getGlobalProtocolDeclAccess().getArgumentsArgumentParserRuleCall_8_1_2_2_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__RoleInstantiationsAssignment_8_1_4 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getRoleInstantiationsRoleInstantiationParserRuleCall_8_1_4_0()); } - ruleRoleInstantiation{ after(grammarAccess.getGlobalProtocolDeclAccess().getRoleInstantiationsRoleInstantiationParserRuleCall_8_1_4_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolDecl__RoleInstantiationsAssignment_8_1_5_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolDeclAccess().getRoleInstantiationsRoleInstantiationParserRuleCall_8_1_5_1_0()); } - ruleRoleInstantiation{ after(grammarAccess.getGlobalProtocolDeclAccess().getRoleInstantiationsRoleInstantiationParserRuleCall_8_1_5_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__RoleDecl__NameAssignment_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getRoleDeclAccess().getNameIDTerminalRuleCall_1_0()); } - RULE_ID{ after(grammarAccess.getRoleDeclAccess().getNameIDTerminalRuleCall_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__RoleDecl__AliasAssignment_2_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getRoleDeclAccess().getAliasIDTerminalRuleCall_2_1_0()); } - RULE_ID{ after(grammarAccess.getRoleDeclAccess().getAliasIDTerminalRuleCall_2_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__ParameterDecl__NameAssignment_0_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getParameterDeclAccess().getNameIDTerminalRuleCall_0_1_0()); } - RULE_ID{ after(grammarAccess.getParameterDeclAccess().getNameIDTerminalRuleCall_0_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__ParameterDecl__AliasAssignment_0_2_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getParameterDeclAccess().getAliasIDTerminalRuleCall_0_2_1_0()); } - RULE_ID{ after(grammarAccess.getParameterDeclAccess().getAliasIDTerminalRuleCall_0_2_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__ParameterDecl__NameAssignment_1_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getParameterDeclAccess().getNameIDTerminalRuleCall_1_1_0()); } - RULE_ID{ after(grammarAccess.getParameterDeclAccess().getNameIDTerminalRuleCall_1_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__ParameterDecl__AliasAssignment_1_2_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getParameterDeclAccess().getAliasIDTerminalRuleCall_1_2_1_0()); } - RULE_ID{ after(grammarAccess.getParameterDeclAccess().getAliasIDTerminalRuleCall_1_2_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__RoleInstantiation__NameAssignment_0 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getRoleInstantiationAccess().getNameIDTerminalRuleCall_0_0()); } - RULE_ID{ after(grammarAccess.getRoleInstantiationAccess().getNameIDTerminalRuleCall_0_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__RoleInstantiation__AliasAssignment_1_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getRoleInstantiationAccess().getAliasIDTerminalRuleCall_1_1_0()); } - RULE_ID{ after(grammarAccess.getRoleInstantiationAccess().getAliasIDTerminalRuleCall_1_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__Argument__SignatureAssignment_0_0 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getArgumentAccess().getSignatureMessageSignatureParserRuleCall_0_0_0()); } - ruleMessageSignature{ after(grammarAccess.getArgumentAccess().getSignatureMessageSignatureParserRuleCall_0_0_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__Argument__AliasAssignment_0_1_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getArgumentAccess().getAliasIDTerminalRuleCall_0_1_1_0()); } - RULE_ID{ after(grammarAccess.getArgumentAccess().getAliasIDTerminalRuleCall_0_1_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__Argument__NameAssignment_1_0 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getArgumentAccess().getNameIDTerminalRuleCall_1_0_0()); } - RULE_ID{ after(grammarAccess.getArgumentAccess().getNameIDTerminalRuleCall_1_0_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__Argument__AliasAssignment_1_1_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getArgumentAccess().getAliasIDTerminalRuleCall_1_1_1_0()); } - RULE_ID{ after(grammarAccess.getArgumentAccess().getAliasIDTerminalRuleCall_1_1_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalProtocolBlock__ActivitiesAssignment_2 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalProtocolBlockAccess().getActivitiesGlobalInteractionParserRuleCall_2_0()); } - ruleGlobalInteraction{ after(grammarAccess.getGlobalProtocolBlockAccess().getActivitiesGlobalInteractionParserRuleCall_2_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalMessageTransfer__MessageAssignment_0 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalMessageTransferAccess().getMessageMessageParserRuleCall_0_0()); } - ruleMessage{ after(grammarAccess.getGlobalMessageTransferAccess().getMessageMessageParserRuleCall_0_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalMessageTransfer__FromRoleAssignment_2 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalMessageTransferAccess().getFromRoleIDTerminalRuleCall_2_0()); } - RULE_ID{ after(grammarAccess.getGlobalMessageTransferAccess().getFromRoleIDTerminalRuleCall_2_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalMessageTransfer__ToRolesAssignment_4 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalMessageTransferAccess().getToRolesIDTerminalRuleCall_4_0()); } - RULE_ID{ after(grammarAccess.getGlobalMessageTransferAccess().getToRolesIDTerminalRuleCall_4_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalMessageTransfer__ToRolesAssignment_5_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalMessageTransferAccess().getToRolesIDTerminalRuleCall_5_1_0()); } - RULE_ID{ after(grammarAccess.getGlobalMessageTransferAccess().getToRolesIDTerminalRuleCall_5_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__Message__SignatureAssignment_0 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getMessageAccess().getSignatureMessageSignatureParserRuleCall_0_0()); } - ruleMessageSignature{ after(grammarAccess.getMessageAccess().getSignatureMessageSignatureParserRuleCall_0_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__Message__ParameterAssignment_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getMessageAccess().getParameterIDTerminalRuleCall_1_0()); } - RULE_ID{ after(grammarAccess.getMessageAccess().getParameterIDTerminalRuleCall_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalChoice__RoleAssignment_2 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalChoiceAccess().getRoleIDTerminalRuleCall_2_0()); } - RULE_ID{ after(grammarAccess.getGlobalChoiceAccess().getRoleIDTerminalRuleCall_2_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalChoice__BlocksAssignment_3 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalChoiceAccess().getBlocksGlobalProtocolBlockParserRuleCall_3_0()); } - ruleGlobalProtocolBlock{ after(grammarAccess.getGlobalChoiceAccess().getBlocksGlobalProtocolBlockParserRuleCall_3_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalChoice__BlocksAssignment_4_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalChoiceAccess().getBlocksGlobalProtocolBlockParserRuleCall_4_1_0()); } - ruleGlobalProtocolBlock{ after(grammarAccess.getGlobalChoiceAccess().getBlocksGlobalProtocolBlockParserRuleCall_4_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalRecursion__LabelAssignment_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalRecursionAccess().getLabelIDTerminalRuleCall_1_0()); } - RULE_ID{ after(grammarAccess.getGlobalRecursionAccess().getLabelIDTerminalRuleCall_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalRecursion__BlockAssignment_2 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalRecursionAccess().getBlockGlobalProtocolBlockParserRuleCall_2_0()); } - ruleGlobalProtocolBlock{ after(grammarAccess.getGlobalRecursionAccess().getBlockGlobalProtocolBlockParserRuleCall_2_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalContinue__LabelAssignment_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalContinueAccess().getLabelIDTerminalRuleCall_1_0()); } - RULE_ID{ after(grammarAccess.getGlobalContinueAccess().getLabelIDTerminalRuleCall_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalParallel__BlocksAssignment_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalParallelAccess().getBlocksGlobalProtocolBlockParserRuleCall_1_0()); } - ruleGlobalProtocolBlock{ after(grammarAccess.getGlobalParallelAccess().getBlocksGlobalProtocolBlockParserRuleCall_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalParallel__BlocksAssignment_2_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalParallelAccess().getBlocksGlobalProtocolBlockParserRuleCall_2_1_0()); } - ruleGlobalProtocolBlock{ after(grammarAccess.getGlobalParallelAccess().getBlocksGlobalProtocolBlockParserRuleCall_2_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalInterruptible__ScopeAssignment_1_0 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalInterruptibleAccess().getScopeIDTerminalRuleCall_1_0_0()); } - RULE_ID{ after(grammarAccess.getGlobalInterruptibleAccess().getScopeIDTerminalRuleCall_1_0_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalInterruptible__BlockAssignment_2 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalInterruptibleAccess().getBlockGlobalProtocolBlockParserRuleCall_2_0()); } - ruleGlobalProtocolBlock{ after(grammarAccess.getGlobalInterruptibleAccess().getBlockGlobalProtocolBlockParserRuleCall_2_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalInterruptible__InterruptsAssignment_5 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalInterruptibleAccess().getInterruptsGlobalInterruptParserRuleCall_5_0()); } - ruleGlobalInterrupt{ after(grammarAccess.getGlobalInterruptibleAccess().getInterruptsGlobalInterruptParserRuleCall_5_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalInterrupt__MessagesAssignment_0 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalInterruptAccess().getMessagesMessageParserRuleCall_0_0()); } - ruleMessage{ after(grammarAccess.getGlobalInterruptAccess().getMessagesMessageParserRuleCall_0_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalInterrupt__MessagesAssignment_1_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalInterruptAccess().getMessagesMessageParserRuleCall_1_1_0()); } - ruleMessage{ after(grammarAccess.getGlobalInterruptAccess().getMessagesMessageParserRuleCall_1_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalInterrupt__RoleAssignment_3 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalInterruptAccess().getRoleIDTerminalRuleCall_3_0()); } - RULE_ID{ after(grammarAccess.getGlobalInterruptAccess().getRoleIDTerminalRuleCall_3_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalDo__ScopeAssignment_1_0 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalDoAccess().getScopeIDTerminalRuleCall_1_0_0()); } - RULE_ID{ after(grammarAccess.getGlobalDoAccess().getScopeIDTerminalRuleCall_1_0_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalDo__MemberAssignment_2 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalDoAccess().getMemberIDTerminalRuleCall_2_0()); } - RULE_ID{ after(grammarAccess.getGlobalDoAccess().getMemberIDTerminalRuleCall_2_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalDo__ArgumentsAssignment_3_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalDoAccess().getArgumentsArgumentParserRuleCall_3_1_0()); } - ruleArgument{ after(grammarAccess.getGlobalDoAccess().getArgumentsArgumentParserRuleCall_3_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalDo__ArgumentsAssignment_3_2_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalDoAccess().getArgumentsArgumentParserRuleCall_3_2_1_0()); } - ruleArgument{ after(grammarAccess.getGlobalDoAccess().getArgumentsArgumentParserRuleCall_3_2_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalDo__RolesAssignment_5 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalDoAccess().getRolesRoleInstantiationParserRuleCall_5_0()); } - ruleRoleInstantiation{ after(grammarAccess.getGlobalDoAccess().getRolesRoleInstantiationParserRuleCall_5_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__GlobalDo__RolesAssignment_6_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getGlobalDoAccess().getRolesRoleInstantiationParserRuleCall_6_1_0()); } - ruleRoleInstantiation{ after(grammarAccess.getGlobalDoAccess().getRolesRoleInstantiationParserRuleCall_6_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__NameAssignment_2 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getNameIDTerminalRuleCall_2_0()); } - RULE_ID{ after(grammarAccess.getLocalProtocolDeclAccess().getNameIDTerminalRuleCall_2_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__RoleAssignment_4 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getRoleIDTerminalRuleCall_4_0()); } - RULE_ID{ after(grammarAccess.getLocalProtocolDeclAccess().getRoleIDTerminalRuleCall_4_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__ParametersAssignment_5_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getParametersParameterDeclParserRuleCall_5_1_0()); } - ruleParameterDecl{ after(grammarAccess.getLocalProtocolDeclAccess().getParametersParameterDeclParserRuleCall_5_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__ParametersAssignment_5_2_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getParametersParameterDeclParserRuleCall_5_2_1_0()); } - ruleParameterDecl{ after(grammarAccess.getLocalProtocolDeclAccess().getParametersParameterDeclParserRuleCall_5_2_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__RolesAssignment_7 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getRolesRoleDeclParserRuleCall_7_0()); } - ruleRoleDecl{ after(grammarAccess.getLocalProtocolDeclAccess().getRolesRoleDeclParserRuleCall_7_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__RolesAssignment_8_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getRolesRoleDeclParserRuleCall_8_1_0()); } - ruleRoleDecl{ after(grammarAccess.getLocalProtocolDeclAccess().getRolesRoleDeclParserRuleCall_8_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__BlockAssignment_10_0 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getBlockLocalProtocolBlockParserRuleCall_10_0_0()); } - ruleLocalProtocolBlock{ after(grammarAccess.getLocalProtocolDeclAccess().getBlockLocalProtocolBlockParserRuleCall_10_0_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__InstantiatesAssignment_10_1_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getInstantiatesIDTerminalRuleCall_10_1_1_0()); } - RULE_ID{ after(grammarAccess.getLocalProtocolDeclAccess().getInstantiatesIDTerminalRuleCall_10_1_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__ArgumentsAssignment_10_1_2_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getArgumentsArgumentParserRuleCall_10_1_2_1_0()); } - ruleArgument{ after(grammarAccess.getLocalProtocolDeclAccess().getArgumentsArgumentParserRuleCall_10_1_2_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__ArgumentsAssignment_10_1_2_2_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getArgumentsArgumentParserRuleCall_10_1_2_2_1_0()); } - ruleArgument{ after(grammarAccess.getLocalProtocolDeclAccess().getArgumentsArgumentParserRuleCall_10_1_2_2_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__RoleInstantiationsAssignment_10_1_4 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getRoleInstantiationsRoleInstantiationParserRuleCall_10_1_4_0()); } - ruleRoleInstantiation{ after(grammarAccess.getLocalProtocolDeclAccess().getRoleInstantiationsRoleInstantiationParserRuleCall_10_1_4_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolDecl__RoleInstantiationsAssignment_10_1_5_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolDeclAccess().getRoleInstantiationsRoleInstantiationParserRuleCall_10_1_5_1_0()); } - ruleRoleInstantiation{ after(grammarAccess.getLocalProtocolDeclAccess().getRoleInstantiationsRoleInstantiationParserRuleCall_10_1_5_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalProtocolBlock__ActivitiesAssignment_2 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalProtocolBlockAccess().getActivitiesLlobalInteractionParserRuleCall_2_0()); } - ruleLlobalInteraction{ after(grammarAccess.getLocalProtocolBlockAccess().getActivitiesLlobalInteractionParserRuleCall_2_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalSend__MessageAssignment_0 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalSendAccess().getMessageMessageParserRuleCall_0_0()); } - ruleMessage{ after(grammarAccess.getLocalSendAccess().getMessageMessageParserRuleCall_0_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalSend__ToRolesAssignment_2 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalSendAccess().getToRolesIDTerminalRuleCall_2_0()); } - RULE_ID{ after(grammarAccess.getLocalSendAccess().getToRolesIDTerminalRuleCall_2_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalSend__ToRolesAssignment_3_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalSendAccess().getToRolesIDTerminalRuleCall_3_1_0()); } - RULE_ID{ after(grammarAccess.getLocalSendAccess().getToRolesIDTerminalRuleCall_3_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalReceive__MessageAssignment_0 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalReceiveAccess().getMessageMessageParserRuleCall_0_0()); } - ruleMessage{ after(grammarAccess.getLocalReceiveAccess().getMessageMessageParserRuleCall_0_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalReceive__FromRoleAssignment_2 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalReceiveAccess().getFromRoleIDTerminalRuleCall_2_0()); } - RULE_ID{ after(grammarAccess.getLocalReceiveAccess().getFromRoleIDTerminalRuleCall_2_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalChoice__RoleAssignment_2 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalChoiceAccess().getRoleIDTerminalRuleCall_2_0()); } - RULE_ID{ after(grammarAccess.getLocalChoiceAccess().getRoleIDTerminalRuleCall_2_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalChoice__BlocksAssignment_3 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalChoiceAccess().getBlocksLocalProtocolBlockParserRuleCall_3_0()); } - ruleLocalProtocolBlock{ after(grammarAccess.getLocalChoiceAccess().getBlocksLocalProtocolBlockParserRuleCall_3_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalChoice__BlocksAssignment_4_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalChoiceAccess().getBlocksLocalProtocolBlockParserRuleCall_4_1_0()); } - ruleLocalProtocolBlock{ after(grammarAccess.getLocalChoiceAccess().getBlocksLocalProtocolBlockParserRuleCall_4_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalRecursion__LabelAssignment_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalRecursionAccess().getLabelIDTerminalRuleCall_1_0()); } - RULE_ID{ after(grammarAccess.getLocalRecursionAccess().getLabelIDTerminalRuleCall_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalRecursion__BlockAssignment_2 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalRecursionAccess().getBlockLocalProtocolBlockParserRuleCall_2_0()); } - ruleLocalProtocolBlock{ after(grammarAccess.getLocalRecursionAccess().getBlockLocalProtocolBlockParserRuleCall_2_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalContinue__LabelAssignment_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalContinueAccess().getLabelIDTerminalRuleCall_1_0()); } - RULE_ID{ after(grammarAccess.getLocalContinueAccess().getLabelIDTerminalRuleCall_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalParallel__BlocksAssignment_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalParallelAccess().getBlocksLocalProtocolBlockParserRuleCall_1_0()); } - ruleLocalProtocolBlock{ after(grammarAccess.getLocalParallelAccess().getBlocksLocalProtocolBlockParserRuleCall_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalParallel__BlocksAssignment_2_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalParallelAccess().getBlocksLocalProtocolBlockParserRuleCall_2_1_0()); } - ruleLocalProtocolBlock{ after(grammarAccess.getLocalParallelAccess().getBlocksLocalProtocolBlockParserRuleCall_2_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalInterruptible__ScopeAssignment_1_0 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalInterruptibleAccess().getScopeIDTerminalRuleCall_1_0_0()); } - RULE_ID{ after(grammarAccess.getLocalInterruptibleAccess().getScopeIDTerminalRuleCall_1_0_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalInterruptible__BlockAssignment_2 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalInterruptibleAccess().getBlockLocalProtocolBlockParserRuleCall_2_0()); } - ruleLocalProtocolBlock{ after(grammarAccess.getLocalInterruptibleAccess().getBlockLocalProtocolBlockParserRuleCall_2_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalInterruptible__ThrowAssignment_5 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalInterruptibleAccess().getThrowLocalThrowParserRuleCall_5_0()); } - ruleLocalThrow{ after(grammarAccess.getLocalInterruptibleAccess().getThrowLocalThrowParserRuleCall_5_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalInterruptible__CatchesAssignment_6 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalInterruptibleAccess().getCatchesLocalCatchParserRuleCall_6_0()); } - ruleLocalCatch{ after(grammarAccess.getLocalInterruptibleAccess().getCatchesLocalCatchParserRuleCall_6_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalThrow__MessagesAssignment_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalThrowAccess().getMessagesMessageParserRuleCall_1_0()); } - ruleMessage{ after(grammarAccess.getLocalThrowAccess().getMessagesMessageParserRuleCall_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalThrow__MessagesAssignment_2_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalThrowAccess().getMessagesMessageParserRuleCall_2_1_0()); } - ruleMessage{ after(grammarAccess.getLocalThrowAccess().getMessagesMessageParserRuleCall_2_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalThrow__ToRolesAssignment_4 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalThrowAccess().getToRolesIDTerminalRuleCall_4_0()); } - RULE_ID{ after(grammarAccess.getLocalThrowAccess().getToRolesIDTerminalRuleCall_4_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalThrow__ToRolesAssignment_5_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalThrowAccess().getToRolesIDTerminalRuleCall_5_1_0()); } - RULE_ID{ after(grammarAccess.getLocalThrowAccess().getToRolesIDTerminalRuleCall_5_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalCatch__MessagesAssignment_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalCatchAccess().getMessagesMessageParserRuleCall_1_0()); } - ruleMessage{ after(grammarAccess.getLocalCatchAccess().getMessagesMessageParserRuleCall_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalCatch__MessagesAssignment_2_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalCatchAccess().getMessagesMessageParserRuleCall_2_1_0()); } - ruleMessage{ after(grammarAccess.getLocalCatchAccess().getMessagesMessageParserRuleCall_2_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalCatch__FromRoleAssignment_4 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalCatchAccess().getFromRoleIDTerminalRuleCall_4_0()); } - RULE_ID{ after(grammarAccess.getLocalCatchAccess().getFromRoleIDTerminalRuleCall_4_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalDo__ScopeAssignment_1_0 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalDoAccess().getScopeIDTerminalRuleCall_1_0_0()); } - RULE_ID{ after(grammarAccess.getLocalDoAccess().getScopeIDTerminalRuleCall_1_0_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalDo__MemberAssignment_2 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalDoAccess().getMemberIDTerminalRuleCall_2_0()); } - RULE_ID{ after(grammarAccess.getLocalDoAccess().getMemberIDTerminalRuleCall_2_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalDo__ArgumentsAssignment_3_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalDoAccess().getArgumentsArgumentParserRuleCall_3_1_0()); } - ruleArgument{ after(grammarAccess.getLocalDoAccess().getArgumentsArgumentParserRuleCall_3_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalDo__ArgumentsAssignment_3_2_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalDoAccess().getArgumentsArgumentParserRuleCall_3_2_1_0()); } - ruleArgument{ after(grammarAccess.getLocalDoAccess().getArgumentsArgumentParserRuleCall_3_2_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalDo__RolesAssignment_5 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalDoAccess().getRolesRoleInstantiationParserRuleCall_5_0()); } - ruleRoleInstantiation{ after(grammarAccess.getLocalDoAccess().getRolesRoleInstantiationParserRuleCall_5_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__LocalDo__RolesAssignment_6_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getLocalDoAccess().getRolesRoleInstantiationParserRuleCall_6_1_0()); } - ruleRoleInstantiation{ after(grammarAccess.getLocalDoAccess().getRolesRoleInstantiationParserRuleCall_6_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -RULE_ID : '^'? ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*; - -RULE_INT : ('0'..'9')+; - -RULE_STRING : ('"' ('\\' ('b'|'t'|'n'|'f'|'r'|'u'|'"'|'\''|'\\')|~(('\\'|'"')))* '"'|'\'' ('\\' ('b'|'t'|'n'|'f'|'r'|'u'|'"'|'\''|'\\')|~(('\\'|'\'')))* '\''); - -RULE_ML_COMMENT : '/*' ( options {greedy=false;} : . )*'*/'; - -RULE_SL_COMMENT : '//' ~(('\n'|'\r'))* ('\r'? '\n')?; - -RULE_WS : (' '|'\t'|'\r'|'\n')+; - -RULE_ANY_OTHER : .; - - diff --git a/tools/eclipse/plugins/org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.tokens b/tools/eclipse/plugins/org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.tokens deleted file mode 100644 index 4c123030c..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.tokens +++ /dev/null @@ -1,77 +0,0 @@ -RULE_ID=4 -T__29=29 -T__28=28 -T__27=27 -T__26=26 -T__25=25 -T__24=24 -T__23=23 -T__22=22 -RULE_ANY_OTHER=10 -T__21=21 -T__20=20 -T__19=19 -T__16=16 -T__15=15 -T__18=18 -T__17=17 -T__12=12 -T__11=11 -T__14=14 -T__13=13 -RULE_INT=6 -T__42=42 -T__43=43 -T__40=40 -T__41=41 -T__44=44 -T__45=45 -RULE_SL_COMMENT=8 -RULE_ML_COMMENT=7 -T__30=30 -T__31=31 -T__32=32 -RULE_STRING=5 -T__33=33 -T__34=34 -T__35=35 -T__36=36 -T__37=37 -T__38=38 -T__39=39 -RULE_WS=9 -'interruptible'=39 -'catches'=45 -'type'=17 -'protocol'=25 -'at'=33 -'>'=19 -'with'=40 -';'=12 -'module'=11 -'role'=27 -'par'=37 -'choice'=32 -'global'=24 -'throw'=44 -'sig'=28 -'rec'=35 -')'=21 -'.'=13 -'do'=42 -'import'=14 -'}'=30 -'by'=41 -'and'=38 -'{'=29 -'to'=31 -'as'=15 -'continue'=36 -'<'=18 -'instantiates'=26 -':'=23 -'('=20 -'or'=34 -'local'=43 -','=22 -'from'=16 diff --git a/tools/eclipse/plugins/org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDslLexer.java b/tools/eclipse/plugins/org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDslLexer.java deleted file mode 100644 index c9b5fe899..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDslLexer.java +++ /dev/null @@ -1,1984 +0,0 @@ -package org.scribble.editor.dsl.ui.contentassist.antlr.internal; - -// Hack: Use our own Lexer superclass by means of import. -// Currently there is no other way to specify the superclass for the lexer. -import org.eclipse.xtext.ui.editor.contentassist.antlr.internal.Lexer; - - -import org.antlr.runtime.*; -import java.util.Stack; -import java.util.List; -import java.util.ArrayList; - -@SuppressWarnings("all") -public class InternalScribbleDslLexer extends Lexer { - public static final int RULE_ID=4; - public static final int T__29=29; - public static final int T__28=28; - public static final int T__27=27; - public static final int T__26=26; - public static final int T__25=25; - public static final int T__24=24; - public static final int T__23=23; - public static final int T__22=22; - public static final int T__21=21; - public static final int RULE_ANY_OTHER=10; - public static final int T__20=20; - public static final int EOF=-1; - public static final int T__19=19; - public static final int T__16=16; - public static final int T__15=15; - public static final int T__18=18; - public static final int T__17=17; - public static final int T__12=12; - public static final int T__11=11; - public static final int T__14=14; - public static final int T__13=13; - public static final int RULE_INT=6; - public static final int T__42=42; - public static final int T__43=43; - public static final int T__40=40; - public static final int T__41=41; - public static final int T__44=44; - public static final int T__45=45; - public static final int RULE_SL_COMMENT=8; - public static final int RULE_ML_COMMENT=7; - public static final int T__30=30; - public static final int T__31=31; - public static final int T__32=32; - public static final int RULE_STRING=5; - public static final int T__33=33; - public static final int T__34=34; - public static final int T__35=35; - public static final int T__36=36; - public static final int T__37=37; - public static final int T__38=38; - public static final int T__39=39; - public static final int RULE_WS=9; - - // delegates - // delegators - - public InternalScribbleDslLexer() {;} - public InternalScribbleDslLexer(CharStream input) { - this(input, new RecognizerSharedState()); - } - public InternalScribbleDslLexer(CharStream input, RecognizerSharedState state) { - super(input,state); - - } - public String getGrammarFileName() { return "../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g"; } - - // $ANTLR start "T__11" - public final void mT__11() throws RecognitionException { - try { - int _type = T__11; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11:7: ( 'module' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11:9: 'module' - { - match("module"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__11" - - // $ANTLR start "T__12" - public final void mT__12() throws RecognitionException { - try { - int _type = T__12; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12:7: ( ';' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12:9: ';' - { - match(';'); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__12" - - // $ANTLR start "T__13" - public final void mT__13() throws RecognitionException { - try { - int _type = T__13; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:13:7: ( '.' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:13:9: '.' - { - match('.'); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__13" - - // $ANTLR start "T__14" - public final void mT__14() throws RecognitionException { - try { - int _type = T__14; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:14:7: ( 'import' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:14:9: 'import' - { - match("import"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__14" - - // $ANTLR start "T__15" - public final void mT__15() throws RecognitionException { - try { - int _type = T__15; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:15:7: ( 'as' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:15:9: 'as' - { - match("as"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__15" - - // $ANTLR start "T__16" - public final void mT__16() throws RecognitionException { - try { - int _type = T__16; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:16:7: ( 'from' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:16:9: 'from' - { - match("from"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__16" - - // $ANTLR start "T__17" - public final void mT__17() throws RecognitionException { - try { - int _type = T__17; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:17:7: ( 'type' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:17:9: 'type' - { - match("type"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__17" - - // $ANTLR start "T__18" - public final void mT__18() throws RecognitionException { - try { - int _type = T__18; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:18:7: ( '<' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:18:9: '<' - { - match('<'); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__18" - - // $ANTLR start "T__19" - public final void mT__19() throws RecognitionException { - try { - int _type = T__19; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:19:7: ( '>' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:19:9: '>' - { - match('>'); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__19" - - // $ANTLR start "T__20" - public final void mT__20() throws RecognitionException { - try { - int _type = T__20; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:20:7: ( '(' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:20:9: '(' - { - match('('); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__20" - - // $ANTLR start "T__21" - public final void mT__21() throws RecognitionException { - try { - int _type = T__21; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:21:7: ( ')' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:21:9: ')' - { - match(')'); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__21" - - // $ANTLR start "T__22" - public final void mT__22() throws RecognitionException { - try { - int _type = T__22; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:22:7: ( ',' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:22:9: ',' - { - match(','); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__22" - - // $ANTLR start "T__23" - public final void mT__23() throws RecognitionException { - try { - int _type = T__23; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:23:7: ( ':' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:23:9: ':' - { - match(':'); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__23" - - // $ANTLR start "T__24" - public final void mT__24() throws RecognitionException { - try { - int _type = T__24; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:24:7: ( 'global' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:24:9: 'global' - { - match("global"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__24" - - // $ANTLR start "T__25" - public final void mT__25() throws RecognitionException { - try { - int _type = T__25; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:25:7: ( 'protocol' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:25:9: 'protocol' - { - match("protocol"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__25" - - // $ANTLR start "T__26" - public final void mT__26() throws RecognitionException { - try { - int _type = T__26; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:26:7: ( 'instantiates' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:26:9: 'instantiates' - { - match("instantiates"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__26" - - // $ANTLR start "T__27" - public final void mT__27() throws RecognitionException { - try { - int _type = T__27; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:27:7: ( 'role' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:27:9: 'role' - { - match("role"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__27" - - // $ANTLR start "T__28" - public final void mT__28() throws RecognitionException { - try { - int _type = T__28; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:28:7: ( 'sig' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:28:9: 'sig' - { - match("sig"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__28" - - // $ANTLR start "T__29" - public final void mT__29() throws RecognitionException { - try { - int _type = T__29; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:29:7: ( '{' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:29:9: '{' - { - match('{'); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__29" - - // $ANTLR start "T__30" - public final void mT__30() throws RecognitionException { - try { - int _type = T__30; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:30:7: ( '}' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:30:9: '}' - { - match('}'); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__30" - - // $ANTLR start "T__31" - public final void mT__31() throws RecognitionException { - try { - int _type = T__31; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:31:7: ( 'to' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:31:9: 'to' - { - match("to"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__31" - - // $ANTLR start "T__32" - public final void mT__32() throws RecognitionException { - try { - int _type = T__32; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:32:7: ( 'choice' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:32:9: 'choice' - { - match("choice"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__32" - - // $ANTLR start "T__33" - public final void mT__33() throws RecognitionException { - try { - int _type = T__33; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:33:7: ( 'at' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:33:9: 'at' - { - match("at"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__33" - - // $ANTLR start "T__34" - public final void mT__34() throws RecognitionException { - try { - int _type = T__34; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:34:7: ( 'or' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:34:9: 'or' - { - match("or"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__34" - - // $ANTLR start "T__35" - public final void mT__35() throws RecognitionException { - try { - int _type = T__35; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:35:7: ( 'rec' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:35:9: 'rec' - { - match("rec"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__35" - - // $ANTLR start "T__36" - public final void mT__36() throws RecognitionException { - try { - int _type = T__36; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:36:7: ( 'continue' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:36:9: 'continue' - { - match("continue"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__36" - - // $ANTLR start "T__37" - public final void mT__37() throws RecognitionException { - try { - int _type = T__37; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:37:7: ( 'par' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:37:9: 'par' - { - match("par"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__37" - - // $ANTLR start "T__38" - public final void mT__38() throws RecognitionException { - try { - int _type = T__38; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:38:7: ( 'and' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:38:9: 'and' - { - match("and"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__38" - - // $ANTLR start "T__39" - public final void mT__39() throws RecognitionException { - try { - int _type = T__39; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:39:7: ( 'interruptible' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:39:9: 'interruptible' - { - match("interruptible"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__39" - - // $ANTLR start "T__40" - public final void mT__40() throws RecognitionException { - try { - int _type = T__40; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:40:7: ( 'with' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:40:9: 'with' - { - match("with"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__40" - - // $ANTLR start "T__41" - public final void mT__41() throws RecognitionException { - try { - int _type = T__41; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:41:7: ( 'by' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:41:9: 'by' - { - match("by"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__41" - - // $ANTLR start "T__42" - public final void mT__42() throws RecognitionException { - try { - int _type = T__42; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:42:7: ( 'do' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:42:9: 'do' - { - match("do"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__42" - - // $ANTLR start "T__43" - public final void mT__43() throws RecognitionException { - try { - int _type = T__43; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:43:7: ( 'local' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:43:9: 'local' - { - match("local"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__43" - - // $ANTLR start "T__44" - public final void mT__44() throws RecognitionException { - try { - int _type = T__44; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:44:7: ( 'throw' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:44:9: 'throw' - { - match("throw"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__44" - - // $ANTLR start "T__45" - public final void mT__45() throws RecognitionException { - try { - int _type = T__45; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:45:7: ( 'catches' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:45:9: 'catches' - { - match("catches"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__45" - - // $ANTLR start "RULE_ID" - public final void mRULE_ID() throws RecognitionException { - try { - int _type = RULE_ID; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12190:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12190:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12190:11: ( '^' )? - int alt1=2; - int LA1_0 = input.LA(1); - - if ( (LA1_0=='^') ) { - alt1=1; - } - switch (alt1) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12190:11: '^' - { - match('^'); - - } - break; - - } - - if ( (input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12190:40: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* - loop2: - do { - int alt2=2; - int LA2_0 = input.LA(1); - - if ( ((LA2_0>='0' && LA2_0<='9')||(LA2_0>='A' && LA2_0<='Z')||LA2_0=='_'||(LA2_0>='a' && LA2_0<='z')) ) { - alt2=1; - } - - - switch (alt2) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g: - { - if ( (input.LA(1)>='0' && input.LA(1)<='9')||(input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - - } - break; - - default : - break loop2; - } - } while (true); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "RULE_ID" - - // $ANTLR start "RULE_INT" - public final void mRULE_INT() throws RecognitionException { - try { - int _type = RULE_INT; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12192:10: ( ( '0' .. '9' )+ ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12192:12: ( '0' .. '9' )+ - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12192:12: ( '0' .. '9' )+ - int cnt3=0; - loop3: - do { - int alt3=2; - int LA3_0 = input.LA(1); - - if ( ((LA3_0>='0' && LA3_0<='9')) ) { - alt3=1; - } - - - switch (alt3) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12192:13: '0' .. '9' - { - matchRange('0','9'); - - } - break; - - default : - if ( cnt3 >= 1 ) break loop3; - EarlyExitException eee = - new EarlyExitException(3, input); - throw eee; - } - cnt3++; - } while (true); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "RULE_INT" - - // $ANTLR start "RULE_STRING" - public final void mRULE_STRING() throws RecognitionException { - try { - int _type = RULE_STRING; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12194:13: ( ( '\"' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | 'u' | '\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | 'u' | '\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12194:15: ( '\"' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | 'u' | '\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | 'u' | '\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12194:15: ( '\"' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | 'u' | '\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | 'u' | '\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) - int alt6=2; - int LA6_0 = input.LA(1); - - if ( (LA6_0=='\"') ) { - alt6=1; - } - else if ( (LA6_0=='\'') ) { - alt6=2; - } - else { - NoViableAltException nvae = - new NoViableAltException("", 6, 0, input); - - throw nvae; - } - switch (alt6) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12194:16: '\"' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | 'u' | '\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\"' ) ) )* '\"' - { - match('\"'); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12194:20: ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | 'u' | '\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\"' ) ) )* - loop4: - do { - int alt4=3; - int LA4_0 = input.LA(1); - - if ( (LA4_0=='\\') ) { - alt4=1; - } - else if ( ((LA4_0>='\u0000' && LA4_0<='!')||(LA4_0>='#' && LA4_0<='[')||(LA4_0>=']' && LA4_0<='\uFFFF')) ) { - alt4=2; - } - - - switch (alt4) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12194:21: '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | 'u' | '\"' | '\\'' | '\\\\' ) - { - match('\\'); - if ( input.LA(1)=='\"'||input.LA(1)=='\''||input.LA(1)=='\\'||input.LA(1)=='b'||input.LA(1)=='f'||input.LA(1)=='n'||input.LA(1)=='r'||(input.LA(1)>='t' && input.LA(1)<='u') ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - - } - break; - case 2 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12194:66: ~ ( ( '\\\\' | '\"' ) ) - { - if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - - } - break; - - default : - break loop4; - } - } while (true); - - match('\"'); - - } - break; - case 2 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12194:86: '\\'' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | 'u' | '\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' - { - match('\''); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12194:91: ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | 'u' | '\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )* - loop5: - do { - int alt5=3; - int LA5_0 = input.LA(1); - - if ( (LA5_0=='\\') ) { - alt5=1; - } - else if ( ((LA5_0>='\u0000' && LA5_0<='&')||(LA5_0>='(' && LA5_0<='[')||(LA5_0>=']' && LA5_0<='\uFFFF')) ) { - alt5=2; - } - - - switch (alt5) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12194:92: '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | 'u' | '\"' | '\\'' | '\\\\' ) - { - match('\\'); - if ( input.LA(1)=='\"'||input.LA(1)=='\''||input.LA(1)=='\\'||input.LA(1)=='b'||input.LA(1)=='f'||input.LA(1)=='n'||input.LA(1)=='r'||(input.LA(1)>='t' && input.LA(1)<='u') ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - - } - break; - case 2 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12194:137: ~ ( ( '\\\\' | '\\'' ) ) - { - if ( (input.LA(1)>='\u0000' && input.LA(1)<='&')||(input.LA(1)>='(' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - - } - break; - - default : - break loop5; - } - } while (true); - - match('\''); - - } - break; - - } - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "RULE_STRING" - - // $ANTLR start "RULE_ML_COMMENT" - public final void mRULE_ML_COMMENT() throws RecognitionException { - try { - int _type = RULE_ML_COMMENT; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12196:17: ( '/*' ( options {greedy=false; } : . )* '*/' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12196:19: '/*' ( options {greedy=false; } : . )* '*/' - { - match("/*"); - - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12196:24: ( options {greedy=false; } : . )* - loop7: - do { - int alt7=2; - int LA7_0 = input.LA(1); - - if ( (LA7_0=='*') ) { - int LA7_1 = input.LA(2); - - if ( (LA7_1=='/') ) { - alt7=2; - } - else if ( ((LA7_1>='\u0000' && LA7_1<='.')||(LA7_1>='0' && LA7_1<='\uFFFF')) ) { - alt7=1; - } - - - } - else if ( ((LA7_0>='\u0000' && LA7_0<=')')||(LA7_0>='+' && LA7_0<='\uFFFF')) ) { - alt7=1; - } - - - switch (alt7) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12196:52: . - { - matchAny(); - - } - break; - - default : - break loop7; - } - } while (true); - - match("*/"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "RULE_ML_COMMENT" - - // $ANTLR start "RULE_SL_COMMENT" - public final void mRULE_SL_COMMENT() throws RecognitionException { - try { - int _type = RULE_SL_COMMENT; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12198:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12198:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? - { - match("//"); - - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12198:24: (~ ( ( '\\n' | '\\r' ) ) )* - loop8: - do { - int alt8=2; - int LA8_0 = input.LA(1); - - if ( ((LA8_0>='\u0000' && LA8_0<='\t')||(LA8_0>='\u000B' && LA8_0<='\f')||(LA8_0>='\u000E' && LA8_0<='\uFFFF')) ) { - alt8=1; - } - - - switch (alt8) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12198:24: ~ ( ( '\\n' | '\\r' ) ) - { - if ( (input.LA(1)>='\u0000' && input.LA(1)<='\t')||(input.LA(1)>='\u000B' && input.LA(1)<='\f')||(input.LA(1)>='\u000E' && input.LA(1)<='\uFFFF') ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - - } - break; - - default : - break loop8; - } - } while (true); - - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12198:40: ( ( '\\r' )? '\\n' )? - int alt10=2; - int LA10_0 = input.LA(1); - - if ( (LA10_0=='\n'||LA10_0=='\r') ) { - alt10=1; - } - switch (alt10) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12198:41: ( '\\r' )? '\\n' - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12198:41: ( '\\r' )? - int alt9=2; - int LA9_0 = input.LA(1); - - if ( (LA9_0=='\r') ) { - alt9=1; - } - switch (alt9) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12198:41: '\\r' - { - match('\r'); - - } - break; - - } - - match('\n'); - - } - break; - - } - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "RULE_SL_COMMENT" - - // $ANTLR start "RULE_WS" - public final void mRULE_WS() throws RecognitionException { - try { - int _type = RULE_WS; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12200:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12200:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12200:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ - int cnt11=0; - loop11: - do { - int alt11=2; - int LA11_0 = input.LA(1); - - if ( ((LA11_0>='\t' && LA11_0<='\n')||LA11_0=='\r'||LA11_0==' ') ) { - alt11=1; - } - - - switch (alt11) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g: - { - if ( (input.LA(1)>='\t' && input.LA(1)<='\n')||input.LA(1)=='\r'||input.LA(1)==' ' ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - - } - break; - - default : - if ( cnt11 >= 1 ) break loop11; - EarlyExitException eee = - new EarlyExitException(11, input); - throw eee; - } - cnt11++; - } while (true); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "RULE_WS" - - // $ANTLR start "RULE_ANY_OTHER" - public final void mRULE_ANY_OTHER() throws RecognitionException { - try { - int _type = RULE_ANY_OTHER; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12202:16: ( . ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12202:18: . - { - matchAny(); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "RULE_ANY_OTHER" - - public void mTokens() throws RecognitionException { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:8: ( T__11 | T__12 | T__13 | T__14 | T__15 | T__16 | T__17 | T__18 | T__19 | T__20 | T__21 | T__22 | T__23 | T__24 | T__25 | T__26 | T__27 | T__28 | T__29 | T__30 | T__31 | T__32 | T__33 | T__34 | T__35 | T__36 | T__37 | T__38 | T__39 | T__40 | T__41 | T__42 | T__43 | T__44 | T__45 | RULE_ID | RULE_INT | RULE_STRING | RULE_ML_COMMENT | RULE_SL_COMMENT | RULE_WS | RULE_ANY_OTHER ) - int alt12=42; - alt12 = dfa12.predict(input); - switch (alt12) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:10: T__11 - { - mT__11(); - - } - break; - case 2 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:16: T__12 - { - mT__12(); - - } - break; - case 3 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:22: T__13 - { - mT__13(); - - } - break; - case 4 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:28: T__14 - { - mT__14(); - - } - break; - case 5 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:34: T__15 - { - mT__15(); - - } - break; - case 6 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:40: T__16 - { - mT__16(); - - } - break; - case 7 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:46: T__17 - { - mT__17(); - - } - break; - case 8 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:52: T__18 - { - mT__18(); - - } - break; - case 9 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:58: T__19 - { - mT__19(); - - } - break; - case 10 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:64: T__20 - { - mT__20(); - - } - break; - case 11 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:70: T__21 - { - mT__21(); - - } - break; - case 12 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:76: T__22 - { - mT__22(); - - } - break; - case 13 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:82: T__23 - { - mT__23(); - - } - break; - case 14 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:88: T__24 - { - mT__24(); - - } - break; - case 15 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:94: T__25 - { - mT__25(); - - } - break; - case 16 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:100: T__26 - { - mT__26(); - - } - break; - case 17 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:106: T__27 - { - mT__27(); - - } - break; - case 18 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:112: T__28 - { - mT__28(); - - } - break; - case 19 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:118: T__29 - { - mT__29(); - - } - break; - case 20 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:124: T__30 - { - mT__30(); - - } - break; - case 21 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:130: T__31 - { - mT__31(); - - } - break; - case 22 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:136: T__32 - { - mT__32(); - - } - break; - case 23 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:142: T__33 - { - mT__33(); - - } - break; - case 24 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:148: T__34 - { - mT__34(); - - } - break; - case 25 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:154: T__35 - { - mT__35(); - - } - break; - case 26 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:160: T__36 - { - mT__36(); - - } - break; - case 27 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:166: T__37 - { - mT__37(); - - } - break; - case 28 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:172: T__38 - { - mT__38(); - - } - break; - case 29 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:178: T__39 - { - mT__39(); - - } - break; - case 30 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:184: T__40 - { - mT__40(); - - } - break; - case 31 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:190: T__41 - { - mT__41(); - - } - break; - case 32 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:196: T__42 - { - mT__42(); - - } - break; - case 33 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:202: T__43 - { - mT__43(); - - } - break; - case 34 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:208: T__44 - { - mT__44(); - - } - break; - case 35 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:214: T__45 - { - mT__45(); - - } - break; - case 36 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:220: RULE_ID - { - mRULE_ID(); - - } - break; - case 37 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:228: RULE_INT - { - mRULE_INT(); - - } - break; - case 38 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:237: RULE_STRING - { - mRULE_STRING(); - - } - break; - case 39 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:249: RULE_ML_COMMENT - { - mRULE_ML_COMMENT(); - - } - break; - case 40 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:265: RULE_SL_COMMENT - { - mRULE_SL_COMMENT(); - - } - break; - case 41 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:281: RULE_WS - { - mRULE_WS(); - - } - break; - case 42 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1:289: RULE_ANY_OTHER - { - mRULE_ANY_OTHER(); - - } - break; - - } - - } - - - protected DFA12 dfa12 = new DFA12(this); - static final String DFA12_eotS = - "\1\uffff\1\43\2\uffff\4\43\6\uffff\4\43\2\uffff\6\43\1\41\2\uffff"+ - "\3\41\2\uffff\1\43\3\uffff\2\43\1\116\1\117\3\43\1\123\1\43\6\uffff"+ - "\6\43\2\uffff\3\43\1\136\1\43\1\140\1\141\1\43\5\uffff\4\43\2\uffff"+ - "\1\147\2\43\1\uffff\3\43\1\155\1\43\1\157\1\160\3\43\1\uffff\1\43"+ - "\2\uffff\5\43\1\uffff\1\172\1\173\3\43\1\uffff\1\177\2\uffff\3\43"+ - "\1\u0083\5\43\2\uffff\1\u0089\2\43\1\uffff\3\43\1\uffff\1\u008f"+ - "\1\u0090\1\u0091\2\43\1\uffff\1\u0094\1\43\1\u0096\2\43\3\uffff"+ - "\2\43\1\uffff\1\43\1\uffff\1\43\1\u009d\2\43\1\u00a0\1\u00a1\1\uffff"+ - "\2\43\2\uffff\4\43\1\u00a8\1\43\1\uffff\1\u00aa\1\uffff"; - static final String DFA12_eofS = - "\u00ab\uffff"; - static final String DFA12_minS = - "\1\0\1\157\2\uffff\1\155\1\156\1\162\1\150\6\uffff\1\154\1\141\1"+ - "\145\1\151\2\uffff\1\141\1\162\1\151\1\171\2\157\1\101\2\uffff\2"+ - "\0\1\52\2\uffff\1\144\3\uffff\1\160\1\163\2\60\1\144\1\157\1\160"+ - "\1\60\1\162\6\uffff\2\157\1\162\1\154\1\143\1\147\2\uffff\1\157"+ - "\1\156\1\164\1\60\1\164\2\60\1\143\5\uffff\1\165\1\157\1\164\1\145"+ - "\2\uffff\1\60\1\155\1\145\1\uffff\1\157\1\142\1\164\1\60\1\145\2"+ - "\60\1\151\1\164\1\143\1\uffff\1\150\2\uffff\1\141\1\154\1\162\1"+ - "\141\1\162\1\uffff\2\60\1\167\1\141\1\157\1\uffff\1\60\2\uffff\1"+ - "\143\1\151\1\150\1\60\1\154\1\145\1\164\1\156\1\162\2\uffff\1\60"+ - "\1\154\1\143\1\uffff\1\145\1\156\1\145\1\uffff\3\60\1\164\1\165"+ - "\1\uffff\1\60\1\157\1\60\1\165\1\163\3\uffff\1\151\1\160\1\uffff"+ - "\1\154\1\uffff\1\145\1\60\1\141\1\164\2\60\1\uffff\1\164\1\151\2"+ - "\uffff\1\145\1\142\1\163\1\154\1\60\1\145\1\uffff\1\60\1\uffff"; - static final String DFA12_maxS = - "\1\uffff\1\157\2\uffff\1\156\1\164\1\162\1\171\6\uffff\1\154\1\162"+ - "\1\157\1\151\2\uffff\1\157\1\162\1\151\1\171\2\157\1\172\2\uffff"+ - "\2\uffff\1\57\2\uffff\1\144\3\uffff\1\160\1\164\2\172\1\144\1\157"+ - "\1\160\1\172\1\162\6\uffff\2\157\1\162\1\154\1\143\1\147\2\uffff"+ - "\1\157\1\156\1\164\1\172\1\164\2\172\1\143\5\uffff\1\165\1\157\1"+ - "\164\1\145\2\uffff\1\172\1\155\1\145\1\uffff\1\157\1\142\1\164\1"+ - "\172\1\145\2\172\1\151\1\164\1\143\1\uffff\1\150\2\uffff\1\141\1"+ - "\154\1\162\1\141\1\162\1\uffff\2\172\1\167\1\141\1\157\1\uffff\1"+ - "\172\2\uffff\1\143\1\151\1\150\1\172\1\154\1\145\1\164\1\156\1\162"+ - "\2\uffff\1\172\1\154\1\143\1\uffff\1\145\1\156\1\145\1\uffff\3\172"+ - "\1\164\1\165\1\uffff\1\172\1\157\1\172\1\165\1\163\3\uffff\1\151"+ - "\1\160\1\uffff\1\154\1\uffff\1\145\1\172\1\141\1\164\2\172\1\uffff"+ - "\1\164\1\151\2\uffff\1\145\1\142\1\163\1\154\1\172\1\145\1\uffff"+ - "\1\172\1\uffff"; - static final String DFA12_acceptS = - "\2\uffff\1\2\1\3\4\uffff\1\10\1\11\1\12\1\13\1\14\1\15\4\uffff\1"+ - "\23\1\24\7\uffff\1\44\1\45\3\uffff\1\51\1\52\1\uffff\1\44\1\2\1"+ - "\3\11\uffff\1\10\1\11\1\12\1\13\1\14\1\15\6\uffff\1\23\1\24\10\uffff"+ - "\1\45\1\46\1\47\1\50\1\51\4\uffff\1\5\1\27\3\uffff\1\25\12\uffff"+ - "\1\30\1\uffff\1\37\1\40\5\uffff\1\34\5\uffff\1\33\1\uffff\1\31\1"+ - "\22\11\uffff\1\6\1\7\3\uffff\1\21\3\uffff\1\36\5\uffff\1\42\5\uffff"+ - "\1\41\1\1\1\4\2\uffff\1\16\1\uffff\1\26\6\uffff\1\43\2\uffff\1\17"+ - "\1\32\6\uffff\1\20\1\uffff\1\35"; - static final String DFA12_specialS = - "\1\2\34\uffff\1\1\1\0\u008c\uffff}>"; - static final String[] DFA12_transitionS = { - "\11\41\2\40\2\41\1\40\22\41\1\40\1\41\1\35\4\41\1\36\1\12\1"+ - "\13\2\41\1\14\1\41\1\3\1\37\12\34\1\15\1\2\1\10\1\41\1\11\2"+ - "\41\32\33\3\41\1\32\1\33\1\41\1\5\1\27\1\24\1\30\1\33\1\6\1"+ - "\16\1\33\1\4\2\33\1\31\1\1\1\33\1\25\1\17\1\33\1\20\1\21\1\7"+ - "\2\33\1\26\3\33\1\22\1\41\1\23\uff82\41", - "\1\42", - "", - "", - "\1\46\1\47", - "\1\52\4\uffff\1\50\1\51", - "\1\53", - "\1\56\6\uffff\1\55\11\uffff\1\54", - "", - "", - "", - "", - "", - "", - "\1\65", - "\1\67\20\uffff\1\66", - "\1\71\11\uffff\1\70", - "\1\72", - "", - "", - "\1\77\6\uffff\1\75\6\uffff\1\76", - "\1\100", - "\1\101", - "\1\102", - "\1\103", - "\1\104", - "\32\43\4\uffff\1\43\1\uffff\32\43", - "", - "", - "\0\106", - "\0\106", - "\1\107\4\uffff\1\110", - "", - "", - "\1\112", - "", - "", - "", - "\1\113", - "\1\114\1\115", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\1\120", - "\1\121", - "\1\122", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\1\124", - "", - "", - "", - "", - "", - "", - "\1\125", - "\1\126", - "\1\127", - "\1\130", - "\1\131", - "\1\132", - "", - "", - "\1\133", - "\1\134", - "\1\135", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\1\137", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\1\142", - "", - "", - "", - "", - "", - "\1\143", - "\1\144", - "\1\145", - "\1\146", - "", - "", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\1\150", - "\1\151", - "", - "\1\152", - "\1\153", - "\1\154", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\1\156", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\1\161", - "\1\162", - "\1\163", - "", - "\1\164", - "", - "", - "\1\165", - "\1\166", - "\1\167", - "\1\170", - "\1\171", - "", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\1\174", - "\1\175", - "\1\176", - "", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "", - "", - "\1\u0080", - "\1\u0081", - "\1\u0082", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\1\u0084", - "\1\u0085", - "\1\u0086", - "\1\u0087", - "\1\u0088", - "", - "", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\1\u008a", - "\1\u008b", - "", - "\1\u008c", - "\1\u008d", - "\1\u008e", - "", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\1\u0092", - "\1\u0093", - "", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\1\u0095", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\1\u0097", - "\1\u0098", - "", - "", - "", - "\1\u0099", - "\1\u009a", - "", - "\1\u009b", - "", - "\1\u009c", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\1\u009e", - "\1\u009f", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "", - "\1\u00a2", - "\1\u00a3", - "", - "", - "\1\u00a4", - "\1\u00a5", - "\1\u00a6", - "\1\u00a7", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\1\u00a9", - "", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "" - }; - - static final short[] DFA12_eot = DFA.unpackEncodedString(DFA12_eotS); - static final short[] DFA12_eof = DFA.unpackEncodedString(DFA12_eofS); - static final char[] DFA12_min = DFA.unpackEncodedStringToUnsignedChars(DFA12_minS); - static final char[] DFA12_max = DFA.unpackEncodedStringToUnsignedChars(DFA12_maxS); - static final short[] DFA12_accept = DFA.unpackEncodedString(DFA12_acceptS); - static final short[] DFA12_special = DFA.unpackEncodedString(DFA12_specialS); - static final short[][] DFA12_transition; - - static { - int numStates = DFA12_transitionS.length; - DFA12_transition = new short[numStates][]; - for (int i=0; i='\u0000' && LA12_30<='\uFFFF')) ) {s = 70;} - - else s = 33; - - if ( s>=0 ) return s; - break; - case 1 : - int LA12_29 = input.LA(1); - - s = -1; - if ( ((LA12_29>='\u0000' && LA12_29<='\uFFFF')) ) {s = 70;} - - else s = 33; - - if ( s>=0 ) return s; - break; - case 2 : - int LA12_0 = input.LA(1); - - s = -1; - if ( (LA12_0=='m') ) {s = 1;} - - else if ( (LA12_0==';') ) {s = 2;} - - else if ( (LA12_0=='.') ) {s = 3;} - - else if ( (LA12_0=='i') ) {s = 4;} - - else if ( (LA12_0=='a') ) {s = 5;} - - else if ( (LA12_0=='f') ) {s = 6;} - - else if ( (LA12_0=='t') ) {s = 7;} - - else if ( (LA12_0=='<') ) {s = 8;} - - else if ( (LA12_0=='>') ) {s = 9;} - - else if ( (LA12_0=='(') ) {s = 10;} - - else if ( (LA12_0==')') ) {s = 11;} - - else if ( (LA12_0==',') ) {s = 12;} - - else if ( (LA12_0==':') ) {s = 13;} - - else if ( (LA12_0=='g') ) {s = 14;} - - else if ( (LA12_0=='p') ) {s = 15;} - - else if ( (LA12_0=='r') ) {s = 16;} - - else if ( (LA12_0=='s') ) {s = 17;} - - else if ( (LA12_0=='{') ) {s = 18;} - - else if ( (LA12_0=='}') ) {s = 19;} - - else if ( (LA12_0=='c') ) {s = 20;} - - else if ( (LA12_0=='o') ) {s = 21;} - - else if ( (LA12_0=='w') ) {s = 22;} - - else if ( (LA12_0=='b') ) {s = 23;} - - else if ( (LA12_0=='d') ) {s = 24;} - - else if ( (LA12_0=='l') ) {s = 25;} - - else if ( (LA12_0=='^') ) {s = 26;} - - else if ( ((LA12_0>='A' && LA12_0<='Z')||LA12_0=='_'||LA12_0=='e'||LA12_0=='h'||(LA12_0>='j' && LA12_0<='k')||LA12_0=='n'||LA12_0=='q'||(LA12_0>='u' && LA12_0<='v')||(LA12_0>='x' && LA12_0<='z')) ) {s = 27;} - - else if ( ((LA12_0>='0' && LA12_0<='9')) ) {s = 28;} - - else if ( (LA12_0=='\"') ) {s = 29;} - - else if ( (LA12_0=='\'') ) {s = 30;} - - else if ( (LA12_0=='/') ) {s = 31;} - - else if ( ((LA12_0>='\t' && LA12_0<='\n')||LA12_0=='\r'||LA12_0==' ') ) {s = 32;} - - else if ( ((LA12_0>='\u0000' && LA12_0<='\b')||(LA12_0>='\u000B' && LA12_0<='\f')||(LA12_0>='\u000E' && LA12_0<='\u001F')||LA12_0=='!'||(LA12_0>='#' && LA12_0<='&')||(LA12_0>='*' && LA12_0<='+')||LA12_0=='-'||LA12_0=='='||(LA12_0>='?' && LA12_0<='@')||(LA12_0>='[' && LA12_0<=']')||LA12_0=='`'||LA12_0=='|'||(LA12_0>='~' && LA12_0<='\uFFFF')) ) {s = 33;} - - if ( s>=0 ) return s; - break; - } - NoViableAltException nvae = - new NoViableAltException(getDescription(), 12, _s, input); - error(nvae); - throw nvae; - } - } - - -} \ No newline at end of file diff --git a/tools/eclipse/plugins/org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDslParser.java b/tools/eclipse/plugins/org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDslParser.java deleted file mode 100644 index 406ca796a..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDslParser.java +++ /dev/null @@ -1,33109 +0,0 @@ -package org.scribble.editor.dsl.ui.contentassist.antlr.internal; - -import java.io.InputStream; -import org.eclipse.xtext.*; -import org.eclipse.xtext.parser.*; -import org.eclipse.xtext.parser.impl.*; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.xtext.parser.antlr.XtextTokenStream; -import org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens; -import org.eclipse.xtext.ui.editor.contentassist.antlr.internal.AbstractInternalContentAssistParser; -import org.eclipse.xtext.ui.editor.contentassist.antlr.internal.DFA; -import org.scribble.editor.dsl.services.ScribbleDslGrammarAccess; - - - -import org.antlr.runtime.*; -import java.util.Stack; -import java.util.List; -import java.util.ArrayList; - -@SuppressWarnings("all") -public class InternalScribbleDslParser extends AbstractInternalContentAssistParser { - public static final String[] tokenNames = new String[] { - "", "", "", "", "RULE_ID", "RULE_STRING", "RULE_INT", "RULE_ML_COMMENT", "RULE_SL_COMMENT", "RULE_WS", "RULE_ANY_OTHER", "'module'", "';'", "'.'", "'import'", "'as'", "'from'", "'type'", "'<'", "'>'", "'('", "')'", "','", "':'", "'global'", "'protocol'", "'instantiates'", "'role'", "'sig'", "'{'", "'}'", "'to'", "'choice'", "'at'", "'or'", "'rec'", "'continue'", "'par'", "'and'", "'interruptible'", "'with'", "'by'", "'do'", "'local'", "'throw'", "'catches'" - }; - public static final int RULE_ID=4; - public static final int T__29=29; - public static final int T__28=28; - public static final int T__27=27; - public static final int T__26=26; - public static final int T__25=25; - public static final int T__24=24; - public static final int T__23=23; - public static final int T__22=22; - public static final int RULE_ANY_OTHER=10; - public static final int T__21=21; - public static final int T__20=20; - public static final int EOF=-1; - public static final int T__19=19; - public static final int T__16=16; - public static final int T__15=15; - public static final int T__18=18; - public static final int T__17=17; - public static final int T__12=12; - public static final int T__11=11; - public static final int T__14=14; - public static final int T__13=13; - public static final int RULE_INT=6; - public static final int T__42=42; - public static final int T__43=43; - public static final int T__40=40; - public static final int T__41=41; - public static final int T__44=44; - public static final int T__45=45; - public static final int RULE_SL_COMMENT=8; - public static final int RULE_ML_COMMENT=7; - public static final int T__30=30; - public static final int T__31=31; - public static final int T__32=32; - public static final int RULE_STRING=5; - public static final int T__33=33; - public static final int T__34=34; - public static final int T__35=35; - public static final int T__36=36; - public static final int T__37=37; - public static final int T__38=38; - public static final int T__39=39; - public static final int RULE_WS=9; - - // delegates - // delegators - - - public InternalScribbleDslParser(TokenStream input) { - this(input, new RecognizerSharedState()); - } - public InternalScribbleDslParser(TokenStream input, RecognizerSharedState state) { - super(input, state); - - } - - - public String[] getTokenNames() { return InternalScribbleDslParser.tokenNames; } - public String getGrammarFileName() { return "../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g"; } - - - - private ScribbleDslGrammarAccess grammarAccess; - - public void setGrammarAccess(ScribbleDslGrammarAccess grammarAccess) { - this.grammarAccess = grammarAccess; - } - - @Override - protected Grammar getGrammar() { - return grammarAccess.getGrammar(); - } - - @Override - protected String getValueForTokenName(String tokenName) { - return tokenName; - } - - - - - // $ANTLR start "entryRuleModule" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:60:1: entryRuleModule : ruleModule EOF ; - public final void entryRuleModule() throws RecognitionException { - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:61:1: ( ruleModule EOF ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:62:1: ruleModule EOF - { - before(grammarAccess.getModuleRule()); - pushFollow(FOLLOW_ruleModule_in_entryRuleModule61); - ruleModule(); - - state._fsp--; - - after(grammarAccess.getModuleRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleModule68); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleModule" - - - // $ANTLR start "ruleModule" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:69:1: ruleModule : ( ( rule__Module__Group__0 ) ) ; - public final void ruleModule() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:73:2: ( ( ( rule__Module__Group__0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:74:1: ( ( rule__Module__Group__0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:74:1: ( ( rule__Module__Group__0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:75:1: ( rule__Module__Group__0 ) - { - before(grammarAccess.getModuleAccess().getGroup()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:76:1: ( rule__Module__Group__0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:76:2: rule__Module__Group__0 - { - pushFollow(FOLLOW_rule__Module__Group__0_in_ruleModule94); - rule__Module__Group__0(); - - state._fsp--; - - - } - - after(grammarAccess.getModuleAccess().getGroup()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleModule" - - - // $ANTLR start "entryRuleModuleName" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:88:1: entryRuleModuleName : ruleModuleName EOF ; - public final void entryRuleModuleName() throws RecognitionException { - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:89:1: ( ruleModuleName EOF ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:90:1: ruleModuleName EOF - { - before(grammarAccess.getModuleNameRule()); - pushFollow(FOLLOW_ruleModuleName_in_entryRuleModuleName121); - ruleModuleName(); - - state._fsp--; - - after(grammarAccess.getModuleNameRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleModuleName128); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleModuleName" - - - // $ANTLR start "ruleModuleName" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:97:1: ruleModuleName : ( ( rule__ModuleName__Group__0 ) ) ; - public final void ruleModuleName() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:101:2: ( ( ( rule__ModuleName__Group__0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:102:1: ( ( rule__ModuleName__Group__0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:102:1: ( ( rule__ModuleName__Group__0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:103:1: ( rule__ModuleName__Group__0 ) - { - before(grammarAccess.getModuleNameAccess().getGroup()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:104:1: ( rule__ModuleName__Group__0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:104:2: rule__ModuleName__Group__0 - { - pushFollow(FOLLOW_rule__ModuleName__Group__0_in_ruleModuleName154); - rule__ModuleName__Group__0(); - - state._fsp--; - - - } - - after(grammarAccess.getModuleNameAccess().getGroup()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleModuleName" - - - // $ANTLR start "entryRuleImportDecl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:116:1: entryRuleImportDecl : ruleImportDecl EOF ; - public final void entryRuleImportDecl() throws RecognitionException { - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:117:1: ( ruleImportDecl EOF ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:118:1: ruleImportDecl EOF - { - before(grammarAccess.getImportDeclRule()); - pushFollow(FOLLOW_ruleImportDecl_in_entryRuleImportDecl181); - ruleImportDecl(); - - state._fsp--; - - after(grammarAccess.getImportDeclRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleImportDecl188); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleImportDecl" - - - // $ANTLR start "ruleImportDecl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:125:1: ruleImportDecl : ( ( rule__ImportDecl__Alternatives ) ) ; - public final void ruleImportDecl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:129:2: ( ( ( rule__ImportDecl__Alternatives ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:130:1: ( ( rule__ImportDecl__Alternatives ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:130:1: ( ( rule__ImportDecl__Alternatives ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:131:1: ( rule__ImportDecl__Alternatives ) - { - before(grammarAccess.getImportDeclAccess().getAlternatives()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:132:1: ( rule__ImportDecl__Alternatives ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:132:2: rule__ImportDecl__Alternatives - { - pushFollow(FOLLOW_rule__ImportDecl__Alternatives_in_ruleImportDecl214); - rule__ImportDecl__Alternatives(); - - state._fsp--; - - - } - - after(grammarAccess.getImportDeclAccess().getAlternatives()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleImportDecl" - - - // $ANTLR start "entryRuleImportModule" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:144:1: entryRuleImportModule : ruleImportModule EOF ; - public final void entryRuleImportModule() throws RecognitionException { - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:145:1: ( ruleImportModule EOF ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:146:1: ruleImportModule EOF - { - before(grammarAccess.getImportModuleRule()); - pushFollow(FOLLOW_ruleImportModule_in_entryRuleImportModule241); - ruleImportModule(); - - state._fsp--; - - after(grammarAccess.getImportModuleRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleImportModule248); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleImportModule" - - - // $ANTLR start "ruleImportModule" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:153:1: ruleImportModule : ( ( rule__ImportModule__Group__0 ) ) ; - public final void ruleImportModule() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:157:2: ( ( ( rule__ImportModule__Group__0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:158:1: ( ( rule__ImportModule__Group__0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:158:1: ( ( rule__ImportModule__Group__0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:159:1: ( rule__ImportModule__Group__0 ) - { - before(grammarAccess.getImportModuleAccess().getGroup()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:160:1: ( rule__ImportModule__Group__0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:160:2: rule__ImportModule__Group__0 - { - pushFollow(FOLLOW_rule__ImportModule__Group__0_in_ruleImportModule274); - rule__ImportModule__Group__0(); - - state._fsp--; - - - } - - after(grammarAccess.getImportModuleAccess().getGroup()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleImportModule" - - - // $ANTLR start "entryRuleImportMember" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:172:1: entryRuleImportMember : ruleImportMember EOF ; - public final void entryRuleImportMember() throws RecognitionException { - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:173:1: ( ruleImportMember EOF ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:174:1: ruleImportMember EOF - { - before(grammarAccess.getImportMemberRule()); - pushFollow(FOLLOW_ruleImportMember_in_entryRuleImportMember301); - ruleImportMember(); - - state._fsp--; - - after(grammarAccess.getImportMemberRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleImportMember308); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleImportMember" - - - // $ANTLR start "ruleImportMember" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:181:1: ruleImportMember : ( ( rule__ImportMember__Group__0 ) ) ; - public final void ruleImportMember() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:185:2: ( ( ( rule__ImportMember__Group__0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:186:1: ( ( rule__ImportMember__Group__0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:186:1: ( ( rule__ImportMember__Group__0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:187:1: ( rule__ImportMember__Group__0 ) - { - before(grammarAccess.getImportMemberAccess().getGroup()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:188:1: ( rule__ImportMember__Group__0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:188:2: rule__ImportMember__Group__0 - { - pushFollow(FOLLOW_rule__ImportMember__Group__0_in_ruleImportMember334); - rule__ImportMember__Group__0(); - - state._fsp--; - - - } - - after(grammarAccess.getImportMemberAccess().getGroup()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleImportMember" - - - // $ANTLR start "entryRulePayloadTypeDecl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:200:1: entryRulePayloadTypeDecl : rulePayloadTypeDecl EOF ; - public final void entryRulePayloadTypeDecl() throws RecognitionException { - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:201:1: ( rulePayloadTypeDecl EOF ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:202:1: rulePayloadTypeDecl EOF - { - before(grammarAccess.getPayloadTypeDeclRule()); - pushFollow(FOLLOW_rulePayloadTypeDecl_in_entryRulePayloadTypeDecl361); - rulePayloadTypeDecl(); - - state._fsp--; - - after(grammarAccess.getPayloadTypeDeclRule()); - match(input,EOF,FOLLOW_EOF_in_entryRulePayloadTypeDecl368); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRulePayloadTypeDecl" - - - // $ANTLR start "rulePayloadTypeDecl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:209:1: rulePayloadTypeDecl : ( ( rule__PayloadTypeDecl__Group__0 ) ) ; - public final void rulePayloadTypeDecl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:213:2: ( ( ( rule__PayloadTypeDecl__Group__0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:214:1: ( ( rule__PayloadTypeDecl__Group__0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:214:1: ( ( rule__PayloadTypeDecl__Group__0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:215:1: ( rule__PayloadTypeDecl__Group__0 ) - { - before(grammarAccess.getPayloadTypeDeclAccess().getGroup()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:216:1: ( rule__PayloadTypeDecl__Group__0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:216:2: rule__PayloadTypeDecl__Group__0 - { - pushFollow(FOLLOW_rule__PayloadTypeDecl__Group__0_in_rulePayloadTypeDecl394); - rule__PayloadTypeDecl__Group__0(); - - state._fsp--; - - - } - - after(grammarAccess.getPayloadTypeDeclAccess().getGroup()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rulePayloadTypeDecl" - - - // $ANTLR start "entryRuleMessageSignature" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:228:1: entryRuleMessageSignature : ruleMessageSignature EOF ; - public final void entryRuleMessageSignature() throws RecognitionException { - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:229:1: ( ruleMessageSignature EOF ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:230:1: ruleMessageSignature EOF - { - before(grammarAccess.getMessageSignatureRule()); - pushFollow(FOLLOW_ruleMessageSignature_in_entryRuleMessageSignature421); - ruleMessageSignature(); - - state._fsp--; - - after(grammarAccess.getMessageSignatureRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleMessageSignature428); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleMessageSignature" - - - // $ANTLR start "ruleMessageSignature" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:237:1: ruleMessageSignature : ( ( rule__MessageSignature__Group__0 ) ) ; - public final void ruleMessageSignature() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:241:2: ( ( ( rule__MessageSignature__Group__0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:242:1: ( ( rule__MessageSignature__Group__0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:242:1: ( ( rule__MessageSignature__Group__0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:243:1: ( rule__MessageSignature__Group__0 ) - { - before(grammarAccess.getMessageSignatureAccess().getGroup()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:244:1: ( rule__MessageSignature__Group__0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:244:2: rule__MessageSignature__Group__0 - { - pushFollow(FOLLOW_rule__MessageSignature__Group__0_in_ruleMessageSignature454); - rule__MessageSignature__Group__0(); - - state._fsp--; - - - } - - after(grammarAccess.getMessageSignatureAccess().getGroup()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleMessageSignature" - - - // $ANTLR start "entryRulePayloadElement" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:256:1: entryRulePayloadElement : rulePayloadElement EOF ; - public final void entryRulePayloadElement() throws RecognitionException { - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:257:1: ( rulePayloadElement EOF ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:258:1: rulePayloadElement EOF - { - before(grammarAccess.getPayloadElementRule()); - pushFollow(FOLLOW_rulePayloadElement_in_entryRulePayloadElement481); - rulePayloadElement(); - - state._fsp--; - - after(grammarAccess.getPayloadElementRule()); - match(input,EOF,FOLLOW_EOF_in_entryRulePayloadElement488); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRulePayloadElement" - - - // $ANTLR start "rulePayloadElement" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:265:1: rulePayloadElement : ( ( rule__PayloadElement__Group__0 ) ) ; - public final void rulePayloadElement() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:269:2: ( ( ( rule__PayloadElement__Group__0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:270:1: ( ( rule__PayloadElement__Group__0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:270:1: ( ( rule__PayloadElement__Group__0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:271:1: ( rule__PayloadElement__Group__0 ) - { - before(grammarAccess.getPayloadElementAccess().getGroup()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:272:1: ( rule__PayloadElement__Group__0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:272:2: rule__PayloadElement__Group__0 - { - pushFollow(FOLLOW_rule__PayloadElement__Group__0_in_rulePayloadElement514); - rule__PayloadElement__Group__0(); - - state._fsp--; - - - } - - after(grammarAccess.getPayloadElementAccess().getGroup()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rulePayloadElement" - - - // $ANTLR start "entryRuleGlobalProtocolDecl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:284:1: entryRuleGlobalProtocolDecl : ruleGlobalProtocolDecl EOF ; - public final void entryRuleGlobalProtocolDecl() throws RecognitionException { - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:285:1: ( ruleGlobalProtocolDecl EOF ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:286:1: ruleGlobalProtocolDecl EOF - { - before(grammarAccess.getGlobalProtocolDeclRule()); - pushFollow(FOLLOW_ruleGlobalProtocolDecl_in_entryRuleGlobalProtocolDecl541); - ruleGlobalProtocolDecl(); - - state._fsp--; - - after(grammarAccess.getGlobalProtocolDeclRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleGlobalProtocolDecl548); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleGlobalProtocolDecl" - - - // $ANTLR start "ruleGlobalProtocolDecl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:293:1: ruleGlobalProtocolDecl : ( ( rule__GlobalProtocolDecl__Group__0 ) ) ; - public final void ruleGlobalProtocolDecl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:297:2: ( ( ( rule__GlobalProtocolDecl__Group__0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:298:1: ( ( rule__GlobalProtocolDecl__Group__0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:298:1: ( ( rule__GlobalProtocolDecl__Group__0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:299:1: ( rule__GlobalProtocolDecl__Group__0 ) - { - before(grammarAccess.getGlobalProtocolDeclAccess().getGroup()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:300:1: ( rule__GlobalProtocolDecl__Group__0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:300:2: rule__GlobalProtocolDecl__Group__0 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group__0_in_ruleGlobalProtocolDecl574); - rule__GlobalProtocolDecl__Group__0(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalProtocolDeclAccess().getGroup()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleGlobalProtocolDecl" - - - // $ANTLR start "entryRuleRoleDecl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:312:1: entryRuleRoleDecl : ruleRoleDecl EOF ; - public final void entryRuleRoleDecl() throws RecognitionException { - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:313:1: ( ruleRoleDecl EOF ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:314:1: ruleRoleDecl EOF - { - before(grammarAccess.getRoleDeclRule()); - pushFollow(FOLLOW_ruleRoleDecl_in_entryRuleRoleDecl601); - ruleRoleDecl(); - - state._fsp--; - - after(grammarAccess.getRoleDeclRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleRoleDecl608); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleRoleDecl" - - - // $ANTLR start "ruleRoleDecl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:321:1: ruleRoleDecl : ( ( rule__RoleDecl__Group__0 ) ) ; - public final void ruleRoleDecl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:325:2: ( ( ( rule__RoleDecl__Group__0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:326:1: ( ( rule__RoleDecl__Group__0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:326:1: ( ( rule__RoleDecl__Group__0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:327:1: ( rule__RoleDecl__Group__0 ) - { - before(grammarAccess.getRoleDeclAccess().getGroup()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:328:1: ( rule__RoleDecl__Group__0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:328:2: rule__RoleDecl__Group__0 - { - pushFollow(FOLLOW_rule__RoleDecl__Group__0_in_ruleRoleDecl634); - rule__RoleDecl__Group__0(); - - state._fsp--; - - - } - - after(grammarAccess.getRoleDeclAccess().getGroup()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleRoleDecl" - - - // $ANTLR start "entryRuleParameterDecl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:340:1: entryRuleParameterDecl : ruleParameterDecl EOF ; - public final void entryRuleParameterDecl() throws RecognitionException { - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:341:1: ( ruleParameterDecl EOF ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:342:1: ruleParameterDecl EOF - { - before(grammarAccess.getParameterDeclRule()); - pushFollow(FOLLOW_ruleParameterDecl_in_entryRuleParameterDecl661); - ruleParameterDecl(); - - state._fsp--; - - after(grammarAccess.getParameterDeclRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleParameterDecl668); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleParameterDecl" - - - // $ANTLR start "ruleParameterDecl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:349:1: ruleParameterDecl : ( ( rule__ParameterDecl__Alternatives ) ) ; - public final void ruleParameterDecl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:353:2: ( ( ( rule__ParameterDecl__Alternatives ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:354:1: ( ( rule__ParameterDecl__Alternatives ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:354:1: ( ( rule__ParameterDecl__Alternatives ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:355:1: ( rule__ParameterDecl__Alternatives ) - { - before(grammarAccess.getParameterDeclAccess().getAlternatives()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:356:1: ( rule__ParameterDecl__Alternatives ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:356:2: rule__ParameterDecl__Alternatives - { - pushFollow(FOLLOW_rule__ParameterDecl__Alternatives_in_ruleParameterDecl694); - rule__ParameterDecl__Alternatives(); - - state._fsp--; - - - } - - after(grammarAccess.getParameterDeclAccess().getAlternatives()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleParameterDecl" - - - // $ANTLR start "entryRuleRoleInstantiation" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:368:1: entryRuleRoleInstantiation : ruleRoleInstantiation EOF ; - public final void entryRuleRoleInstantiation() throws RecognitionException { - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:369:1: ( ruleRoleInstantiation EOF ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:370:1: ruleRoleInstantiation EOF - { - before(grammarAccess.getRoleInstantiationRule()); - pushFollow(FOLLOW_ruleRoleInstantiation_in_entryRuleRoleInstantiation721); - ruleRoleInstantiation(); - - state._fsp--; - - after(grammarAccess.getRoleInstantiationRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleRoleInstantiation728); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleRoleInstantiation" - - - // $ANTLR start "ruleRoleInstantiation" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:377:1: ruleRoleInstantiation : ( ( rule__RoleInstantiation__Group__0 ) ) ; - public final void ruleRoleInstantiation() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:381:2: ( ( ( rule__RoleInstantiation__Group__0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:382:1: ( ( rule__RoleInstantiation__Group__0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:382:1: ( ( rule__RoleInstantiation__Group__0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:383:1: ( rule__RoleInstantiation__Group__0 ) - { - before(grammarAccess.getRoleInstantiationAccess().getGroup()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:384:1: ( rule__RoleInstantiation__Group__0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:384:2: rule__RoleInstantiation__Group__0 - { - pushFollow(FOLLOW_rule__RoleInstantiation__Group__0_in_ruleRoleInstantiation754); - rule__RoleInstantiation__Group__0(); - - state._fsp--; - - - } - - after(grammarAccess.getRoleInstantiationAccess().getGroup()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleRoleInstantiation" - - - // $ANTLR start "entryRuleArgument" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:396:1: entryRuleArgument : ruleArgument EOF ; - public final void entryRuleArgument() throws RecognitionException { - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:397:1: ( ruleArgument EOF ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:398:1: ruleArgument EOF - { - before(grammarAccess.getArgumentRule()); - pushFollow(FOLLOW_ruleArgument_in_entryRuleArgument781); - ruleArgument(); - - state._fsp--; - - after(grammarAccess.getArgumentRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleArgument788); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleArgument" - - - // $ANTLR start "ruleArgument" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:405:1: ruleArgument : ( ( rule__Argument__Alternatives ) ) ; - public final void ruleArgument() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:409:2: ( ( ( rule__Argument__Alternatives ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:410:1: ( ( rule__Argument__Alternatives ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:410:1: ( ( rule__Argument__Alternatives ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:411:1: ( rule__Argument__Alternatives ) - { - before(grammarAccess.getArgumentAccess().getAlternatives()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:412:1: ( rule__Argument__Alternatives ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:412:2: rule__Argument__Alternatives - { - pushFollow(FOLLOW_rule__Argument__Alternatives_in_ruleArgument814); - rule__Argument__Alternatives(); - - state._fsp--; - - - } - - after(grammarAccess.getArgumentAccess().getAlternatives()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleArgument" - - - // $ANTLR start "entryRuleGlobalProtocolBlock" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:424:1: entryRuleGlobalProtocolBlock : ruleGlobalProtocolBlock EOF ; - public final void entryRuleGlobalProtocolBlock() throws RecognitionException { - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:425:1: ( ruleGlobalProtocolBlock EOF ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:426:1: ruleGlobalProtocolBlock EOF - { - before(grammarAccess.getGlobalProtocolBlockRule()); - pushFollow(FOLLOW_ruleGlobalProtocolBlock_in_entryRuleGlobalProtocolBlock841); - ruleGlobalProtocolBlock(); - - state._fsp--; - - after(grammarAccess.getGlobalProtocolBlockRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleGlobalProtocolBlock848); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleGlobalProtocolBlock" - - - // $ANTLR start "ruleGlobalProtocolBlock" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:433:1: ruleGlobalProtocolBlock : ( ( rule__GlobalProtocolBlock__Group__0 ) ) ; - public final void ruleGlobalProtocolBlock() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:437:2: ( ( ( rule__GlobalProtocolBlock__Group__0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:438:1: ( ( rule__GlobalProtocolBlock__Group__0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:438:1: ( ( rule__GlobalProtocolBlock__Group__0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:439:1: ( rule__GlobalProtocolBlock__Group__0 ) - { - before(grammarAccess.getGlobalProtocolBlockAccess().getGroup()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:440:1: ( rule__GlobalProtocolBlock__Group__0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:440:2: rule__GlobalProtocolBlock__Group__0 - { - pushFollow(FOLLOW_rule__GlobalProtocolBlock__Group__0_in_ruleGlobalProtocolBlock874); - rule__GlobalProtocolBlock__Group__0(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalProtocolBlockAccess().getGroup()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleGlobalProtocolBlock" - - - // $ANTLR start "entryRuleGlobalInteraction" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:452:1: entryRuleGlobalInteraction : ruleGlobalInteraction EOF ; - public final void entryRuleGlobalInteraction() throws RecognitionException { - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:453:1: ( ruleGlobalInteraction EOF ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:454:1: ruleGlobalInteraction EOF - { - before(grammarAccess.getGlobalInteractionRule()); - pushFollow(FOLLOW_ruleGlobalInteraction_in_entryRuleGlobalInteraction901); - ruleGlobalInteraction(); - - state._fsp--; - - after(grammarAccess.getGlobalInteractionRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleGlobalInteraction908); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleGlobalInteraction" - - - // $ANTLR start "ruleGlobalInteraction" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:461:1: ruleGlobalInteraction : ( ( rule__GlobalInteraction__Alternatives ) ) ; - public final void ruleGlobalInteraction() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:465:2: ( ( ( rule__GlobalInteraction__Alternatives ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:466:1: ( ( rule__GlobalInteraction__Alternatives ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:466:1: ( ( rule__GlobalInteraction__Alternatives ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:467:1: ( rule__GlobalInteraction__Alternatives ) - { - before(grammarAccess.getGlobalInteractionAccess().getAlternatives()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:468:1: ( rule__GlobalInteraction__Alternatives ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:468:2: rule__GlobalInteraction__Alternatives - { - pushFollow(FOLLOW_rule__GlobalInteraction__Alternatives_in_ruleGlobalInteraction934); - rule__GlobalInteraction__Alternatives(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalInteractionAccess().getAlternatives()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleGlobalInteraction" - - - // $ANTLR start "entryRuleGlobalMessageTransfer" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:480:1: entryRuleGlobalMessageTransfer : ruleGlobalMessageTransfer EOF ; - public final void entryRuleGlobalMessageTransfer() throws RecognitionException { - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:481:1: ( ruleGlobalMessageTransfer EOF ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:482:1: ruleGlobalMessageTransfer EOF - { - before(grammarAccess.getGlobalMessageTransferRule()); - pushFollow(FOLLOW_ruleGlobalMessageTransfer_in_entryRuleGlobalMessageTransfer961); - ruleGlobalMessageTransfer(); - - state._fsp--; - - after(grammarAccess.getGlobalMessageTransferRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleGlobalMessageTransfer968); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleGlobalMessageTransfer" - - - // $ANTLR start "ruleGlobalMessageTransfer" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:489:1: ruleGlobalMessageTransfer : ( ( rule__GlobalMessageTransfer__Group__0 ) ) ; - public final void ruleGlobalMessageTransfer() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:493:2: ( ( ( rule__GlobalMessageTransfer__Group__0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:494:1: ( ( rule__GlobalMessageTransfer__Group__0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:494:1: ( ( rule__GlobalMessageTransfer__Group__0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:495:1: ( rule__GlobalMessageTransfer__Group__0 ) - { - before(grammarAccess.getGlobalMessageTransferAccess().getGroup()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:496:1: ( rule__GlobalMessageTransfer__Group__0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:496:2: rule__GlobalMessageTransfer__Group__0 - { - pushFollow(FOLLOW_rule__GlobalMessageTransfer__Group__0_in_ruleGlobalMessageTransfer994); - rule__GlobalMessageTransfer__Group__0(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalMessageTransferAccess().getGroup()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleGlobalMessageTransfer" - - - // $ANTLR start "entryRuleMessage" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:508:1: entryRuleMessage : ruleMessage EOF ; - public final void entryRuleMessage() throws RecognitionException { - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:509:1: ( ruleMessage EOF ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:510:1: ruleMessage EOF - { - before(grammarAccess.getMessageRule()); - pushFollow(FOLLOW_ruleMessage_in_entryRuleMessage1021); - ruleMessage(); - - state._fsp--; - - after(grammarAccess.getMessageRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleMessage1028); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleMessage" - - - // $ANTLR start "ruleMessage" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:517:1: ruleMessage : ( ( rule__Message__Alternatives ) ) ; - public final void ruleMessage() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:521:2: ( ( ( rule__Message__Alternatives ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:522:1: ( ( rule__Message__Alternatives ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:522:1: ( ( rule__Message__Alternatives ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:523:1: ( rule__Message__Alternatives ) - { - before(grammarAccess.getMessageAccess().getAlternatives()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:524:1: ( rule__Message__Alternatives ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:524:2: rule__Message__Alternatives - { - pushFollow(FOLLOW_rule__Message__Alternatives_in_ruleMessage1054); - rule__Message__Alternatives(); - - state._fsp--; - - - } - - after(grammarAccess.getMessageAccess().getAlternatives()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleMessage" - - - // $ANTLR start "entryRuleGlobalChoice" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:536:1: entryRuleGlobalChoice : ruleGlobalChoice EOF ; - public final void entryRuleGlobalChoice() throws RecognitionException { - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:537:1: ( ruleGlobalChoice EOF ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:538:1: ruleGlobalChoice EOF - { - before(grammarAccess.getGlobalChoiceRule()); - pushFollow(FOLLOW_ruleGlobalChoice_in_entryRuleGlobalChoice1081); - ruleGlobalChoice(); - - state._fsp--; - - after(grammarAccess.getGlobalChoiceRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleGlobalChoice1088); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleGlobalChoice" - - - // $ANTLR start "ruleGlobalChoice" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:545:1: ruleGlobalChoice : ( ( rule__GlobalChoice__Group__0 ) ) ; - public final void ruleGlobalChoice() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:549:2: ( ( ( rule__GlobalChoice__Group__0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:550:1: ( ( rule__GlobalChoice__Group__0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:550:1: ( ( rule__GlobalChoice__Group__0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:551:1: ( rule__GlobalChoice__Group__0 ) - { - before(grammarAccess.getGlobalChoiceAccess().getGroup()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:552:1: ( rule__GlobalChoice__Group__0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:552:2: rule__GlobalChoice__Group__0 - { - pushFollow(FOLLOW_rule__GlobalChoice__Group__0_in_ruleGlobalChoice1114); - rule__GlobalChoice__Group__0(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalChoiceAccess().getGroup()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleGlobalChoice" - - - // $ANTLR start "entryRuleGlobalRecursion" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:564:1: entryRuleGlobalRecursion : ruleGlobalRecursion EOF ; - public final void entryRuleGlobalRecursion() throws RecognitionException { - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:565:1: ( ruleGlobalRecursion EOF ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:566:1: ruleGlobalRecursion EOF - { - before(grammarAccess.getGlobalRecursionRule()); - pushFollow(FOLLOW_ruleGlobalRecursion_in_entryRuleGlobalRecursion1141); - ruleGlobalRecursion(); - - state._fsp--; - - after(grammarAccess.getGlobalRecursionRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleGlobalRecursion1148); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleGlobalRecursion" - - - // $ANTLR start "ruleGlobalRecursion" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:573:1: ruleGlobalRecursion : ( ( rule__GlobalRecursion__Group__0 ) ) ; - public final void ruleGlobalRecursion() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:577:2: ( ( ( rule__GlobalRecursion__Group__0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:578:1: ( ( rule__GlobalRecursion__Group__0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:578:1: ( ( rule__GlobalRecursion__Group__0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:579:1: ( rule__GlobalRecursion__Group__0 ) - { - before(grammarAccess.getGlobalRecursionAccess().getGroup()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:580:1: ( rule__GlobalRecursion__Group__0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:580:2: rule__GlobalRecursion__Group__0 - { - pushFollow(FOLLOW_rule__GlobalRecursion__Group__0_in_ruleGlobalRecursion1174); - rule__GlobalRecursion__Group__0(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalRecursionAccess().getGroup()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleGlobalRecursion" - - - // $ANTLR start "entryRuleGlobalContinue" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:592:1: entryRuleGlobalContinue : ruleGlobalContinue EOF ; - public final void entryRuleGlobalContinue() throws RecognitionException { - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:593:1: ( ruleGlobalContinue EOF ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:594:1: ruleGlobalContinue EOF - { - before(grammarAccess.getGlobalContinueRule()); - pushFollow(FOLLOW_ruleGlobalContinue_in_entryRuleGlobalContinue1201); - ruleGlobalContinue(); - - state._fsp--; - - after(grammarAccess.getGlobalContinueRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleGlobalContinue1208); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleGlobalContinue" - - - // $ANTLR start "ruleGlobalContinue" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:601:1: ruleGlobalContinue : ( ( rule__GlobalContinue__Group__0 ) ) ; - public final void ruleGlobalContinue() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:605:2: ( ( ( rule__GlobalContinue__Group__0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:606:1: ( ( rule__GlobalContinue__Group__0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:606:1: ( ( rule__GlobalContinue__Group__0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:607:1: ( rule__GlobalContinue__Group__0 ) - { - before(grammarAccess.getGlobalContinueAccess().getGroup()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:608:1: ( rule__GlobalContinue__Group__0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:608:2: rule__GlobalContinue__Group__0 - { - pushFollow(FOLLOW_rule__GlobalContinue__Group__0_in_ruleGlobalContinue1234); - rule__GlobalContinue__Group__0(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalContinueAccess().getGroup()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleGlobalContinue" - - - // $ANTLR start "entryRuleGlobalParallel" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:620:1: entryRuleGlobalParallel : ruleGlobalParallel EOF ; - public final void entryRuleGlobalParallel() throws RecognitionException { - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:621:1: ( ruleGlobalParallel EOF ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:622:1: ruleGlobalParallel EOF - { - before(grammarAccess.getGlobalParallelRule()); - pushFollow(FOLLOW_ruleGlobalParallel_in_entryRuleGlobalParallel1261); - ruleGlobalParallel(); - - state._fsp--; - - after(grammarAccess.getGlobalParallelRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleGlobalParallel1268); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleGlobalParallel" - - - // $ANTLR start "ruleGlobalParallel" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:629:1: ruleGlobalParallel : ( ( rule__GlobalParallel__Group__0 ) ) ; - public final void ruleGlobalParallel() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:633:2: ( ( ( rule__GlobalParallel__Group__0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:634:1: ( ( rule__GlobalParallel__Group__0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:634:1: ( ( rule__GlobalParallel__Group__0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:635:1: ( rule__GlobalParallel__Group__0 ) - { - before(grammarAccess.getGlobalParallelAccess().getGroup()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:636:1: ( rule__GlobalParallel__Group__0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:636:2: rule__GlobalParallel__Group__0 - { - pushFollow(FOLLOW_rule__GlobalParallel__Group__0_in_ruleGlobalParallel1294); - rule__GlobalParallel__Group__0(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalParallelAccess().getGroup()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleGlobalParallel" - - - // $ANTLR start "entryRuleGlobalInterruptible" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:648:1: entryRuleGlobalInterruptible : ruleGlobalInterruptible EOF ; - public final void entryRuleGlobalInterruptible() throws RecognitionException { - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:649:1: ( ruleGlobalInterruptible EOF ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:650:1: ruleGlobalInterruptible EOF - { - before(grammarAccess.getGlobalInterruptibleRule()); - pushFollow(FOLLOW_ruleGlobalInterruptible_in_entryRuleGlobalInterruptible1321); - ruleGlobalInterruptible(); - - state._fsp--; - - after(grammarAccess.getGlobalInterruptibleRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleGlobalInterruptible1328); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleGlobalInterruptible" - - - // $ANTLR start "ruleGlobalInterruptible" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:657:1: ruleGlobalInterruptible : ( ( rule__GlobalInterruptible__Group__0 ) ) ; - public final void ruleGlobalInterruptible() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:661:2: ( ( ( rule__GlobalInterruptible__Group__0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:662:1: ( ( rule__GlobalInterruptible__Group__0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:662:1: ( ( rule__GlobalInterruptible__Group__0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:663:1: ( rule__GlobalInterruptible__Group__0 ) - { - before(grammarAccess.getGlobalInterruptibleAccess().getGroup()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:664:1: ( rule__GlobalInterruptible__Group__0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:664:2: rule__GlobalInterruptible__Group__0 - { - pushFollow(FOLLOW_rule__GlobalInterruptible__Group__0_in_ruleGlobalInterruptible1354); - rule__GlobalInterruptible__Group__0(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalInterruptibleAccess().getGroup()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleGlobalInterruptible" - - - // $ANTLR start "entryRuleGlobalInterrupt" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:676:1: entryRuleGlobalInterrupt : ruleGlobalInterrupt EOF ; - public final void entryRuleGlobalInterrupt() throws RecognitionException { - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:677:1: ( ruleGlobalInterrupt EOF ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:678:1: ruleGlobalInterrupt EOF - { - before(grammarAccess.getGlobalInterruptRule()); - pushFollow(FOLLOW_ruleGlobalInterrupt_in_entryRuleGlobalInterrupt1381); - ruleGlobalInterrupt(); - - state._fsp--; - - after(grammarAccess.getGlobalInterruptRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleGlobalInterrupt1388); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleGlobalInterrupt" - - - // $ANTLR start "ruleGlobalInterrupt" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:685:1: ruleGlobalInterrupt : ( ( rule__GlobalInterrupt__Group__0 ) ) ; - public final void ruleGlobalInterrupt() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:689:2: ( ( ( rule__GlobalInterrupt__Group__0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:690:1: ( ( rule__GlobalInterrupt__Group__0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:690:1: ( ( rule__GlobalInterrupt__Group__0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:691:1: ( rule__GlobalInterrupt__Group__0 ) - { - before(grammarAccess.getGlobalInterruptAccess().getGroup()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:692:1: ( rule__GlobalInterrupt__Group__0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:692:2: rule__GlobalInterrupt__Group__0 - { - pushFollow(FOLLOW_rule__GlobalInterrupt__Group__0_in_ruleGlobalInterrupt1414); - rule__GlobalInterrupt__Group__0(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalInterruptAccess().getGroup()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleGlobalInterrupt" - - - // $ANTLR start "entryRuleGlobalDo" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:704:1: entryRuleGlobalDo : ruleGlobalDo EOF ; - public final void entryRuleGlobalDo() throws RecognitionException { - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:705:1: ( ruleGlobalDo EOF ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:706:1: ruleGlobalDo EOF - { - before(grammarAccess.getGlobalDoRule()); - pushFollow(FOLLOW_ruleGlobalDo_in_entryRuleGlobalDo1441); - ruleGlobalDo(); - - state._fsp--; - - after(grammarAccess.getGlobalDoRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleGlobalDo1448); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleGlobalDo" - - - // $ANTLR start "ruleGlobalDo" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:713:1: ruleGlobalDo : ( ( rule__GlobalDo__Group__0 ) ) ; - public final void ruleGlobalDo() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:717:2: ( ( ( rule__GlobalDo__Group__0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:718:1: ( ( rule__GlobalDo__Group__0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:718:1: ( ( rule__GlobalDo__Group__0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:719:1: ( rule__GlobalDo__Group__0 ) - { - before(grammarAccess.getGlobalDoAccess().getGroup()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:720:1: ( rule__GlobalDo__Group__0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:720:2: rule__GlobalDo__Group__0 - { - pushFollow(FOLLOW_rule__GlobalDo__Group__0_in_ruleGlobalDo1474); - rule__GlobalDo__Group__0(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalDoAccess().getGroup()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleGlobalDo" - - - // $ANTLR start "entryRuleLocalProtocolDecl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:732:1: entryRuleLocalProtocolDecl : ruleLocalProtocolDecl EOF ; - public final void entryRuleLocalProtocolDecl() throws RecognitionException { - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:733:1: ( ruleLocalProtocolDecl EOF ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:734:1: ruleLocalProtocolDecl EOF - { - before(grammarAccess.getLocalProtocolDeclRule()); - pushFollow(FOLLOW_ruleLocalProtocolDecl_in_entryRuleLocalProtocolDecl1501); - ruleLocalProtocolDecl(); - - state._fsp--; - - after(grammarAccess.getLocalProtocolDeclRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleLocalProtocolDecl1508); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleLocalProtocolDecl" - - - // $ANTLR start "ruleLocalProtocolDecl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:741:1: ruleLocalProtocolDecl : ( ( rule__LocalProtocolDecl__Group__0 ) ) ; - public final void ruleLocalProtocolDecl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:745:2: ( ( ( rule__LocalProtocolDecl__Group__0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:746:1: ( ( rule__LocalProtocolDecl__Group__0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:746:1: ( ( rule__LocalProtocolDecl__Group__0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:747:1: ( rule__LocalProtocolDecl__Group__0 ) - { - before(grammarAccess.getLocalProtocolDeclAccess().getGroup()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:748:1: ( rule__LocalProtocolDecl__Group__0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:748:2: rule__LocalProtocolDecl__Group__0 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group__0_in_ruleLocalProtocolDecl1534); - rule__LocalProtocolDecl__Group__0(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalProtocolDeclAccess().getGroup()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleLocalProtocolDecl" - - - // $ANTLR start "entryRuleLocalProtocolBlock" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:760:1: entryRuleLocalProtocolBlock : ruleLocalProtocolBlock EOF ; - public final void entryRuleLocalProtocolBlock() throws RecognitionException { - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:761:1: ( ruleLocalProtocolBlock EOF ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:762:1: ruleLocalProtocolBlock EOF - { - before(grammarAccess.getLocalProtocolBlockRule()); - pushFollow(FOLLOW_ruleLocalProtocolBlock_in_entryRuleLocalProtocolBlock1561); - ruleLocalProtocolBlock(); - - state._fsp--; - - after(grammarAccess.getLocalProtocolBlockRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleLocalProtocolBlock1568); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleLocalProtocolBlock" - - - // $ANTLR start "ruleLocalProtocolBlock" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:769:1: ruleLocalProtocolBlock : ( ( rule__LocalProtocolBlock__Group__0 ) ) ; - public final void ruleLocalProtocolBlock() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:773:2: ( ( ( rule__LocalProtocolBlock__Group__0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:774:1: ( ( rule__LocalProtocolBlock__Group__0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:774:1: ( ( rule__LocalProtocolBlock__Group__0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:775:1: ( rule__LocalProtocolBlock__Group__0 ) - { - before(grammarAccess.getLocalProtocolBlockAccess().getGroup()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:776:1: ( rule__LocalProtocolBlock__Group__0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:776:2: rule__LocalProtocolBlock__Group__0 - { - pushFollow(FOLLOW_rule__LocalProtocolBlock__Group__0_in_ruleLocalProtocolBlock1594); - rule__LocalProtocolBlock__Group__0(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalProtocolBlockAccess().getGroup()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleLocalProtocolBlock" - - - // $ANTLR start "entryRuleLlobalInteraction" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:788:1: entryRuleLlobalInteraction : ruleLlobalInteraction EOF ; - public final void entryRuleLlobalInteraction() throws RecognitionException { - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:789:1: ( ruleLlobalInteraction EOF ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:790:1: ruleLlobalInteraction EOF - { - before(grammarAccess.getLlobalInteractionRule()); - pushFollow(FOLLOW_ruleLlobalInteraction_in_entryRuleLlobalInteraction1621); - ruleLlobalInteraction(); - - state._fsp--; - - after(grammarAccess.getLlobalInteractionRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleLlobalInteraction1628); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleLlobalInteraction" - - - // $ANTLR start "ruleLlobalInteraction" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:797:1: ruleLlobalInteraction : ( ( rule__LlobalInteraction__Alternatives ) ) ; - public final void ruleLlobalInteraction() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:801:2: ( ( ( rule__LlobalInteraction__Alternatives ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:802:1: ( ( rule__LlobalInteraction__Alternatives ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:802:1: ( ( rule__LlobalInteraction__Alternatives ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:803:1: ( rule__LlobalInteraction__Alternatives ) - { - before(grammarAccess.getLlobalInteractionAccess().getAlternatives()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:804:1: ( rule__LlobalInteraction__Alternatives ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:804:2: rule__LlobalInteraction__Alternatives - { - pushFollow(FOLLOW_rule__LlobalInteraction__Alternatives_in_ruleLlobalInteraction1654); - rule__LlobalInteraction__Alternatives(); - - state._fsp--; - - - } - - after(grammarAccess.getLlobalInteractionAccess().getAlternatives()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleLlobalInteraction" - - - // $ANTLR start "entryRuleLocalSend" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:816:1: entryRuleLocalSend : ruleLocalSend EOF ; - public final void entryRuleLocalSend() throws RecognitionException { - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:817:1: ( ruleLocalSend EOF ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:818:1: ruleLocalSend EOF - { - before(grammarAccess.getLocalSendRule()); - pushFollow(FOLLOW_ruleLocalSend_in_entryRuleLocalSend1681); - ruleLocalSend(); - - state._fsp--; - - after(grammarAccess.getLocalSendRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleLocalSend1688); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleLocalSend" - - - // $ANTLR start "ruleLocalSend" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:825:1: ruleLocalSend : ( ( rule__LocalSend__Group__0 ) ) ; - public final void ruleLocalSend() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:829:2: ( ( ( rule__LocalSend__Group__0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:830:1: ( ( rule__LocalSend__Group__0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:830:1: ( ( rule__LocalSend__Group__0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:831:1: ( rule__LocalSend__Group__0 ) - { - before(grammarAccess.getLocalSendAccess().getGroup()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:832:1: ( rule__LocalSend__Group__0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:832:2: rule__LocalSend__Group__0 - { - pushFollow(FOLLOW_rule__LocalSend__Group__0_in_ruleLocalSend1714); - rule__LocalSend__Group__0(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalSendAccess().getGroup()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleLocalSend" - - - // $ANTLR start "entryRuleLocalReceive" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:844:1: entryRuleLocalReceive : ruleLocalReceive EOF ; - public final void entryRuleLocalReceive() throws RecognitionException { - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:845:1: ( ruleLocalReceive EOF ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:846:1: ruleLocalReceive EOF - { - before(grammarAccess.getLocalReceiveRule()); - pushFollow(FOLLOW_ruleLocalReceive_in_entryRuleLocalReceive1741); - ruleLocalReceive(); - - state._fsp--; - - after(grammarAccess.getLocalReceiveRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleLocalReceive1748); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleLocalReceive" - - - // $ANTLR start "ruleLocalReceive" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:853:1: ruleLocalReceive : ( ( rule__LocalReceive__Group__0 ) ) ; - public final void ruleLocalReceive() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:857:2: ( ( ( rule__LocalReceive__Group__0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:858:1: ( ( rule__LocalReceive__Group__0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:858:1: ( ( rule__LocalReceive__Group__0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:859:1: ( rule__LocalReceive__Group__0 ) - { - before(grammarAccess.getLocalReceiveAccess().getGroup()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:860:1: ( rule__LocalReceive__Group__0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:860:2: rule__LocalReceive__Group__0 - { - pushFollow(FOLLOW_rule__LocalReceive__Group__0_in_ruleLocalReceive1774); - rule__LocalReceive__Group__0(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalReceiveAccess().getGroup()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleLocalReceive" - - - // $ANTLR start "entryRuleLocalChoice" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:872:1: entryRuleLocalChoice : ruleLocalChoice EOF ; - public final void entryRuleLocalChoice() throws RecognitionException { - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:873:1: ( ruleLocalChoice EOF ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:874:1: ruleLocalChoice EOF - { - before(grammarAccess.getLocalChoiceRule()); - pushFollow(FOLLOW_ruleLocalChoice_in_entryRuleLocalChoice1801); - ruleLocalChoice(); - - state._fsp--; - - after(grammarAccess.getLocalChoiceRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleLocalChoice1808); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleLocalChoice" - - - // $ANTLR start "ruleLocalChoice" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:881:1: ruleLocalChoice : ( ( rule__LocalChoice__Group__0 ) ) ; - public final void ruleLocalChoice() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:885:2: ( ( ( rule__LocalChoice__Group__0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:886:1: ( ( rule__LocalChoice__Group__0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:886:1: ( ( rule__LocalChoice__Group__0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:887:1: ( rule__LocalChoice__Group__0 ) - { - before(grammarAccess.getLocalChoiceAccess().getGroup()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:888:1: ( rule__LocalChoice__Group__0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:888:2: rule__LocalChoice__Group__0 - { - pushFollow(FOLLOW_rule__LocalChoice__Group__0_in_ruleLocalChoice1834); - rule__LocalChoice__Group__0(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalChoiceAccess().getGroup()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleLocalChoice" - - - // $ANTLR start "entryRuleLocalRecursion" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:900:1: entryRuleLocalRecursion : ruleLocalRecursion EOF ; - public final void entryRuleLocalRecursion() throws RecognitionException { - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:901:1: ( ruleLocalRecursion EOF ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:902:1: ruleLocalRecursion EOF - { - before(grammarAccess.getLocalRecursionRule()); - pushFollow(FOLLOW_ruleLocalRecursion_in_entryRuleLocalRecursion1861); - ruleLocalRecursion(); - - state._fsp--; - - after(grammarAccess.getLocalRecursionRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleLocalRecursion1868); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleLocalRecursion" - - - // $ANTLR start "ruleLocalRecursion" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:909:1: ruleLocalRecursion : ( ( rule__LocalRecursion__Group__0 ) ) ; - public final void ruleLocalRecursion() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:913:2: ( ( ( rule__LocalRecursion__Group__0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:914:1: ( ( rule__LocalRecursion__Group__0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:914:1: ( ( rule__LocalRecursion__Group__0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:915:1: ( rule__LocalRecursion__Group__0 ) - { - before(grammarAccess.getLocalRecursionAccess().getGroup()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:916:1: ( rule__LocalRecursion__Group__0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:916:2: rule__LocalRecursion__Group__0 - { - pushFollow(FOLLOW_rule__LocalRecursion__Group__0_in_ruleLocalRecursion1894); - rule__LocalRecursion__Group__0(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalRecursionAccess().getGroup()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleLocalRecursion" - - - // $ANTLR start "entryRuleLocalContinue" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:928:1: entryRuleLocalContinue : ruleLocalContinue EOF ; - public final void entryRuleLocalContinue() throws RecognitionException { - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:929:1: ( ruleLocalContinue EOF ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:930:1: ruleLocalContinue EOF - { - before(grammarAccess.getLocalContinueRule()); - pushFollow(FOLLOW_ruleLocalContinue_in_entryRuleLocalContinue1921); - ruleLocalContinue(); - - state._fsp--; - - after(grammarAccess.getLocalContinueRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleLocalContinue1928); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleLocalContinue" - - - // $ANTLR start "ruleLocalContinue" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:937:1: ruleLocalContinue : ( ( rule__LocalContinue__Group__0 ) ) ; - public final void ruleLocalContinue() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:941:2: ( ( ( rule__LocalContinue__Group__0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:942:1: ( ( rule__LocalContinue__Group__0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:942:1: ( ( rule__LocalContinue__Group__0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:943:1: ( rule__LocalContinue__Group__0 ) - { - before(grammarAccess.getLocalContinueAccess().getGroup()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:944:1: ( rule__LocalContinue__Group__0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:944:2: rule__LocalContinue__Group__0 - { - pushFollow(FOLLOW_rule__LocalContinue__Group__0_in_ruleLocalContinue1954); - rule__LocalContinue__Group__0(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalContinueAccess().getGroup()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleLocalContinue" - - - // $ANTLR start "entryRuleLocalParallel" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:956:1: entryRuleLocalParallel : ruleLocalParallel EOF ; - public final void entryRuleLocalParallel() throws RecognitionException { - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:957:1: ( ruleLocalParallel EOF ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:958:1: ruleLocalParallel EOF - { - before(grammarAccess.getLocalParallelRule()); - pushFollow(FOLLOW_ruleLocalParallel_in_entryRuleLocalParallel1981); - ruleLocalParallel(); - - state._fsp--; - - after(grammarAccess.getLocalParallelRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleLocalParallel1988); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleLocalParallel" - - - // $ANTLR start "ruleLocalParallel" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:965:1: ruleLocalParallel : ( ( rule__LocalParallel__Group__0 ) ) ; - public final void ruleLocalParallel() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:969:2: ( ( ( rule__LocalParallel__Group__0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:970:1: ( ( rule__LocalParallel__Group__0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:970:1: ( ( rule__LocalParallel__Group__0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:971:1: ( rule__LocalParallel__Group__0 ) - { - before(grammarAccess.getLocalParallelAccess().getGroup()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:972:1: ( rule__LocalParallel__Group__0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:972:2: rule__LocalParallel__Group__0 - { - pushFollow(FOLLOW_rule__LocalParallel__Group__0_in_ruleLocalParallel2014); - rule__LocalParallel__Group__0(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalParallelAccess().getGroup()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleLocalParallel" - - - // $ANTLR start "entryRuleLocalInterruptible" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:984:1: entryRuleLocalInterruptible : ruleLocalInterruptible EOF ; - public final void entryRuleLocalInterruptible() throws RecognitionException { - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:985:1: ( ruleLocalInterruptible EOF ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:986:1: ruleLocalInterruptible EOF - { - before(grammarAccess.getLocalInterruptibleRule()); - pushFollow(FOLLOW_ruleLocalInterruptible_in_entryRuleLocalInterruptible2041); - ruleLocalInterruptible(); - - state._fsp--; - - after(grammarAccess.getLocalInterruptibleRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleLocalInterruptible2048); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleLocalInterruptible" - - - // $ANTLR start "ruleLocalInterruptible" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:993:1: ruleLocalInterruptible : ( ( rule__LocalInterruptible__Group__0 ) ) ; - public final void ruleLocalInterruptible() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:997:2: ( ( ( rule__LocalInterruptible__Group__0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:998:1: ( ( rule__LocalInterruptible__Group__0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:998:1: ( ( rule__LocalInterruptible__Group__0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:999:1: ( rule__LocalInterruptible__Group__0 ) - { - before(grammarAccess.getLocalInterruptibleAccess().getGroup()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1000:1: ( rule__LocalInterruptible__Group__0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1000:2: rule__LocalInterruptible__Group__0 - { - pushFollow(FOLLOW_rule__LocalInterruptible__Group__0_in_ruleLocalInterruptible2074); - rule__LocalInterruptible__Group__0(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalInterruptibleAccess().getGroup()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleLocalInterruptible" - - - // $ANTLR start "entryRuleLocalThrow" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1012:1: entryRuleLocalThrow : ruleLocalThrow EOF ; - public final void entryRuleLocalThrow() throws RecognitionException { - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1013:1: ( ruleLocalThrow EOF ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1014:1: ruleLocalThrow EOF - { - before(grammarAccess.getLocalThrowRule()); - pushFollow(FOLLOW_ruleLocalThrow_in_entryRuleLocalThrow2101); - ruleLocalThrow(); - - state._fsp--; - - after(grammarAccess.getLocalThrowRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleLocalThrow2108); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleLocalThrow" - - - // $ANTLR start "ruleLocalThrow" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1021:1: ruleLocalThrow : ( ( rule__LocalThrow__Group__0 ) ) ; - public final void ruleLocalThrow() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1025:2: ( ( ( rule__LocalThrow__Group__0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1026:1: ( ( rule__LocalThrow__Group__0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1026:1: ( ( rule__LocalThrow__Group__0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1027:1: ( rule__LocalThrow__Group__0 ) - { - before(grammarAccess.getLocalThrowAccess().getGroup()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1028:1: ( rule__LocalThrow__Group__0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1028:2: rule__LocalThrow__Group__0 - { - pushFollow(FOLLOW_rule__LocalThrow__Group__0_in_ruleLocalThrow2134); - rule__LocalThrow__Group__0(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalThrowAccess().getGroup()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleLocalThrow" - - - // $ANTLR start "entryRuleLocalCatch" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1040:1: entryRuleLocalCatch : ruleLocalCatch EOF ; - public final void entryRuleLocalCatch() throws RecognitionException { - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1041:1: ( ruleLocalCatch EOF ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1042:1: ruleLocalCatch EOF - { - before(grammarAccess.getLocalCatchRule()); - pushFollow(FOLLOW_ruleLocalCatch_in_entryRuleLocalCatch2161); - ruleLocalCatch(); - - state._fsp--; - - after(grammarAccess.getLocalCatchRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleLocalCatch2168); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleLocalCatch" - - - // $ANTLR start "ruleLocalCatch" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1049:1: ruleLocalCatch : ( ( rule__LocalCatch__Group__0 ) ) ; - public final void ruleLocalCatch() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1053:2: ( ( ( rule__LocalCatch__Group__0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1054:1: ( ( rule__LocalCatch__Group__0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1054:1: ( ( rule__LocalCatch__Group__0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1055:1: ( rule__LocalCatch__Group__0 ) - { - before(grammarAccess.getLocalCatchAccess().getGroup()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1056:1: ( rule__LocalCatch__Group__0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1056:2: rule__LocalCatch__Group__0 - { - pushFollow(FOLLOW_rule__LocalCatch__Group__0_in_ruleLocalCatch2194); - rule__LocalCatch__Group__0(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalCatchAccess().getGroup()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleLocalCatch" - - - // $ANTLR start "entryRuleLocalDo" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1068:1: entryRuleLocalDo : ruleLocalDo EOF ; - public final void entryRuleLocalDo() throws RecognitionException { - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1069:1: ( ruleLocalDo EOF ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1070:1: ruleLocalDo EOF - { - before(grammarAccess.getLocalDoRule()); - pushFollow(FOLLOW_ruleLocalDo_in_entryRuleLocalDo2221); - ruleLocalDo(); - - state._fsp--; - - after(grammarAccess.getLocalDoRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleLocalDo2228); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleLocalDo" - - - // $ANTLR start "ruleLocalDo" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1077:1: ruleLocalDo : ( ( rule__LocalDo__Group__0 ) ) ; - public final void ruleLocalDo() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1081:2: ( ( ( rule__LocalDo__Group__0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1082:1: ( ( rule__LocalDo__Group__0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1082:1: ( ( rule__LocalDo__Group__0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1083:1: ( rule__LocalDo__Group__0 ) - { - before(grammarAccess.getLocalDoAccess().getGroup()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1084:1: ( rule__LocalDo__Group__0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1084:2: rule__LocalDo__Group__0 - { - pushFollow(FOLLOW_rule__LocalDo__Group__0_in_ruleLocalDo2254); - rule__LocalDo__Group__0(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalDoAccess().getGroup()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleLocalDo" - - - // $ANTLR start "rule__Module__Alternatives_5" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1096:1: rule__Module__Alternatives_5 : ( ( ( rule__Module__GlobalsAssignment_5_0 ) ) | ( ( rule__Module__LocalsAssignment_5_1 ) ) ); - public final void rule__Module__Alternatives_5() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1100:1: ( ( ( rule__Module__GlobalsAssignment_5_0 ) ) | ( ( rule__Module__LocalsAssignment_5_1 ) ) ) - int alt1=2; - int LA1_0 = input.LA(1); - - if ( (LA1_0==24) ) { - alt1=1; - } - else if ( (LA1_0==43) ) { - alt1=2; - } - else { - NoViableAltException nvae = - new NoViableAltException("", 1, 0, input); - - throw nvae; - } - switch (alt1) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1101:1: ( ( rule__Module__GlobalsAssignment_5_0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1101:1: ( ( rule__Module__GlobalsAssignment_5_0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1102:1: ( rule__Module__GlobalsAssignment_5_0 ) - { - before(grammarAccess.getModuleAccess().getGlobalsAssignment_5_0()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1103:1: ( rule__Module__GlobalsAssignment_5_0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1103:2: rule__Module__GlobalsAssignment_5_0 - { - pushFollow(FOLLOW_rule__Module__GlobalsAssignment_5_0_in_rule__Module__Alternatives_52290); - rule__Module__GlobalsAssignment_5_0(); - - state._fsp--; - - - } - - after(grammarAccess.getModuleAccess().getGlobalsAssignment_5_0()); - - } - - - } - break; - case 2 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1107:6: ( ( rule__Module__LocalsAssignment_5_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1107:6: ( ( rule__Module__LocalsAssignment_5_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1108:1: ( rule__Module__LocalsAssignment_5_1 ) - { - before(grammarAccess.getModuleAccess().getLocalsAssignment_5_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1109:1: ( rule__Module__LocalsAssignment_5_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1109:2: rule__Module__LocalsAssignment_5_1 - { - pushFollow(FOLLOW_rule__Module__LocalsAssignment_5_1_in_rule__Module__Alternatives_52308); - rule__Module__LocalsAssignment_5_1(); - - state._fsp--; - - - } - - after(grammarAccess.getModuleAccess().getLocalsAssignment_5_1()); - - } - - - } - break; - - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Module__Alternatives_5" - - - // $ANTLR start "rule__ImportDecl__Alternatives" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1118:1: rule__ImportDecl__Alternatives : ( ( ruleImportModule ) | ( ruleImportMember ) ); - public final void rule__ImportDecl__Alternatives() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1122:1: ( ( ruleImportModule ) | ( ruleImportMember ) ) - int alt2=2; - int LA2_0 = input.LA(1); - - if ( (LA2_0==14) ) { - alt2=1; - } - else if ( (LA2_0==16) ) { - alt2=2; - } - else { - NoViableAltException nvae = - new NoViableAltException("", 2, 0, input); - - throw nvae; - } - switch (alt2) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1123:1: ( ruleImportModule ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1123:1: ( ruleImportModule ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1124:1: ruleImportModule - { - before(grammarAccess.getImportDeclAccess().getImportModuleParserRuleCall_0()); - pushFollow(FOLLOW_ruleImportModule_in_rule__ImportDecl__Alternatives2341); - ruleImportModule(); - - state._fsp--; - - after(grammarAccess.getImportDeclAccess().getImportModuleParserRuleCall_0()); - - } - - - } - break; - case 2 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1129:6: ( ruleImportMember ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1129:6: ( ruleImportMember ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1130:1: ruleImportMember - { - before(grammarAccess.getImportDeclAccess().getImportMemberParserRuleCall_1()); - pushFollow(FOLLOW_ruleImportMember_in_rule__ImportDecl__Alternatives2358); - ruleImportMember(); - - state._fsp--; - - after(grammarAccess.getImportDeclAccess().getImportMemberParserRuleCall_1()); - - } - - - } - break; - - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ImportDecl__Alternatives" - - - // $ANTLR start "rule__GlobalProtocolDecl__Alternatives_8" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1140:1: rule__GlobalProtocolDecl__Alternatives_8 : ( ( ( rule__GlobalProtocolDecl__BlockAssignment_8_0 ) ) | ( ( rule__GlobalProtocolDecl__Group_8_1__0 ) ) ); - public final void rule__GlobalProtocolDecl__Alternatives_8() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1144:1: ( ( ( rule__GlobalProtocolDecl__BlockAssignment_8_0 ) ) | ( ( rule__GlobalProtocolDecl__Group_8_1__0 ) ) ) - int alt3=2; - int LA3_0 = input.LA(1); - - if ( (LA3_0==29) ) { - alt3=1; - } - else if ( (LA3_0==26) ) { - alt3=2; - } - else { - NoViableAltException nvae = - new NoViableAltException("", 3, 0, input); - - throw nvae; - } - switch (alt3) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1145:1: ( ( rule__GlobalProtocolDecl__BlockAssignment_8_0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1145:1: ( ( rule__GlobalProtocolDecl__BlockAssignment_8_0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1146:1: ( rule__GlobalProtocolDecl__BlockAssignment_8_0 ) - { - before(grammarAccess.getGlobalProtocolDeclAccess().getBlockAssignment_8_0()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1147:1: ( rule__GlobalProtocolDecl__BlockAssignment_8_0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1147:2: rule__GlobalProtocolDecl__BlockAssignment_8_0 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__BlockAssignment_8_0_in_rule__GlobalProtocolDecl__Alternatives_82390); - rule__GlobalProtocolDecl__BlockAssignment_8_0(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalProtocolDeclAccess().getBlockAssignment_8_0()); - - } - - - } - break; - case 2 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1151:6: ( ( rule__GlobalProtocolDecl__Group_8_1__0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1151:6: ( ( rule__GlobalProtocolDecl__Group_8_1__0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1152:1: ( rule__GlobalProtocolDecl__Group_8_1__0 ) - { - before(grammarAccess.getGlobalProtocolDeclAccess().getGroup_8_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1153:1: ( rule__GlobalProtocolDecl__Group_8_1__0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1153:2: rule__GlobalProtocolDecl__Group_8_1__0 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_8_1__0_in_rule__GlobalProtocolDecl__Alternatives_82408); - rule__GlobalProtocolDecl__Group_8_1__0(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalProtocolDeclAccess().getGroup_8_1()); - - } - - - } - break; - - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Alternatives_8" - - - // $ANTLR start "rule__ParameterDecl__Alternatives" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1162:1: rule__ParameterDecl__Alternatives : ( ( ( rule__ParameterDecl__Group_0__0 ) ) | ( ( rule__ParameterDecl__Group_1__0 ) ) ); - public final void rule__ParameterDecl__Alternatives() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1166:1: ( ( ( rule__ParameterDecl__Group_0__0 ) ) | ( ( rule__ParameterDecl__Group_1__0 ) ) ) - int alt4=2; - int LA4_0 = input.LA(1); - - if ( (LA4_0==17) ) { - alt4=1; - } - else if ( (LA4_0==28) ) { - alt4=2; - } - else { - NoViableAltException nvae = - new NoViableAltException("", 4, 0, input); - - throw nvae; - } - switch (alt4) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1167:1: ( ( rule__ParameterDecl__Group_0__0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1167:1: ( ( rule__ParameterDecl__Group_0__0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1168:1: ( rule__ParameterDecl__Group_0__0 ) - { - before(grammarAccess.getParameterDeclAccess().getGroup_0()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1169:1: ( rule__ParameterDecl__Group_0__0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1169:2: rule__ParameterDecl__Group_0__0 - { - pushFollow(FOLLOW_rule__ParameterDecl__Group_0__0_in_rule__ParameterDecl__Alternatives2441); - rule__ParameterDecl__Group_0__0(); - - state._fsp--; - - - } - - after(grammarAccess.getParameterDeclAccess().getGroup_0()); - - } - - - } - break; - case 2 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1173:6: ( ( rule__ParameterDecl__Group_1__0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1173:6: ( ( rule__ParameterDecl__Group_1__0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1174:1: ( rule__ParameterDecl__Group_1__0 ) - { - before(grammarAccess.getParameterDeclAccess().getGroup_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1175:1: ( rule__ParameterDecl__Group_1__0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1175:2: rule__ParameterDecl__Group_1__0 - { - pushFollow(FOLLOW_rule__ParameterDecl__Group_1__0_in_rule__ParameterDecl__Alternatives2459); - rule__ParameterDecl__Group_1__0(); - - state._fsp--; - - - } - - after(grammarAccess.getParameterDeclAccess().getGroup_1()); - - } - - - } - break; - - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ParameterDecl__Alternatives" - - - // $ANTLR start "rule__Argument__Alternatives" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1184:1: rule__Argument__Alternatives : ( ( ( rule__Argument__Group_0__0 ) ) | ( ( rule__Argument__Group_1__0 ) ) ); - public final void rule__Argument__Alternatives() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1188:1: ( ( ( rule__Argument__Group_0__0 ) ) | ( ( rule__Argument__Group_1__0 ) ) ) - int alt5=2; - int LA5_0 = input.LA(1); - - if ( (LA5_0==RULE_ID) ) { - int LA5_1 = input.LA(2); - - if ( (LA5_1==20) ) { - alt5=1; - } - else if ( (LA5_1==EOF||LA5_1==15||LA5_1==19||LA5_1==22) ) { - alt5=2; - } - else { - NoViableAltException nvae = - new NoViableAltException("", 5, 1, input); - - throw nvae; - } - } - else if ( (LA5_0==20) ) { - alt5=1; - } - else { - NoViableAltException nvae = - new NoViableAltException("", 5, 0, input); - - throw nvae; - } - switch (alt5) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1189:1: ( ( rule__Argument__Group_0__0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1189:1: ( ( rule__Argument__Group_0__0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1190:1: ( rule__Argument__Group_0__0 ) - { - before(grammarAccess.getArgumentAccess().getGroup_0()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1191:1: ( rule__Argument__Group_0__0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1191:2: rule__Argument__Group_0__0 - { - pushFollow(FOLLOW_rule__Argument__Group_0__0_in_rule__Argument__Alternatives2492); - rule__Argument__Group_0__0(); - - state._fsp--; - - - } - - after(grammarAccess.getArgumentAccess().getGroup_0()); - - } - - - } - break; - case 2 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1195:6: ( ( rule__Argument__Group_1__0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1195:6: ( ( rule__Argument__Group_1__0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1196:1: ( rule__Argument__Group_1__0 ) - { - before(grammarAccess.getArgumentAccess().getGroup_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1197:1: ( rule__Argument__Group_1__0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1197:2: rule__Argument__Group_1__0 - { - pushFollow(FOLLOW_rule__Argument__Group_1__0_in_rule__Argument__Alternatives2510); - rule__Argument__Group_1__0(); - - state._fsp--; - - - } - - after(grammarAccess.getArgumentAccess().getGroup_1()); - - } - - - } - break; - - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Argument__Alternatives" - - - // $ANTLR start "rule__GlobalInteraction__Alternatives" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1206:1: rule__GlobalInteraction__Alternatives : ( ( ruleGlobalMessageTransfer ) | ( ruleGlobalChoice ) | ( ruleGlobalRecursion ) | ( ruleGlobalContinue ) | ( ruleGlobalParallel ) | ( ruleGlobalInterruptible ) | ( ruleGlobalDo ) ); - public final void rule__GlobalInteraction__Alternatives() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1210:1: ( ( ruleGlobalMessageTransfer ) | ( ruleGlobalChoice ) | ( ruleGlobalRecursion ) | ( ruleGlobalContinue ) | ( ruleGlobalParallel ) | ( ruleGlobalInterruptible ) | ( ruleGlobalDo ) ) - int alt6=7; - switch ( input.LA(1) ) { - case RULE_ID: - case 20: - { - alt6=1; - } - break; - case 32: - { - alt6=2; - } - break; - case 35: - { - alt6=3; - } - break; - case 36: - { - alt6=4; - } - break; - case 37: - { - alt6=5; - } - break; - case 39: - { - alt6=6; - } - break; - case 42: - { - alt6=7; - } - break; - default: - NoViableAltException nvae = - new NoViableAltException("", 6, 0, input); - - throw nvae; - } - - switch (alt6) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1211:1: ( ruleGlobalMessageTransfer ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1211:1: ( ruleGlobalMessageTransfer ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1212:1: ruleGlobalMessageTransfer - { - before(grammarAccess.getGlobalInteractionAccess().getGlobalMessageTransferParserRuleCall_0()); - pushFollow(FOLLOW_ruleGlobalMessageTransfer_in_rule__GlobalInteraction__Alternatives2543); - ruleGlobalMessageTransfer(); - - state._fsp--; - - after(grammarAccess.getGlobalInteractionAccess().getGlobalMessageTransferParserRuleCall_0()); - - } - - - } - break; - case 2 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1217:6: ( ruleGlobalChoice ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1217:6: ( ruleGlobalChoice ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1218:1: ruleGlobalChoice - { - before(grammarAccess.getGlobalInteractionAccess().getGlobalChoiceParserRuleCall_1()); - pushFollow(FOLLOW_ruleGlobalChoice_in_rule__GlobalInteraction__Alternatives2560); - ruleGlobalChoice(); - - state._fsp--; - - after(grammarAccess.getGlobalInteractionAccess().getGlobalChoiceParserRuleCall_1()); - - } - - - } - break; - case 3 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1223:6: ( ruleGlobalRecursion ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1223:6: ( ruleGlobalRecursion ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1224:1: ruleGlobalRecursion - { - before(grammarAccess.getGlobalInteractionAccess().getGlobalRecursionParserRuleCall_2()); - pushFollow(FOLLOW_ruleGlobalRecursion_in_rule__GlobalInteraction__Alternatives2577); - ruleGlobalRecursion(); - - state._fsp--; - - after(grammarAccess.getGlobalInteractionAccess().getGlobalRecursionParserRuleCall_2()); - - } - - - } - break; - case 4 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1229:6: ( ruleGlobalContinue ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1229:6: ( ruleGlobalContinue ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1230:1: ruleGlobalContinue - { - before(grammarAccess.getGlobalInteractionAccess().getGlobalContinueParserRuleCall_3()); - pushFollow(FOLLOW_ruleGlobalContinue_in_rule__GlobalInteraction__Alternatives2594); - ruleGlobalContinue(); - - state._fsp--; - - after(grammarAccess.getGlobalInteractionAccess().getGlobalContinueParserRuleCall_3()); - - } - - - } - break; - case 5 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1235:6: ( ruleGlobalParallel ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1235:6: ( ruleGlobalParallel ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1236:1: ruleGlobalParallel - { - before(grammarAccess.getGlobalInteractionAccess().getGlobalParallelParserRuleCall_4()); - pushFollow(FOLLOW_ruleGlobalParallel_in_rule__GlobalInteraction__Alternatives2611); - ruleGlobalParallel(); - - state._fsp--; - - after(grammarAccess.getGlobalInteractionAccess().getGlobalParallelParserRuleCall_4()); - - } - - - } - break; - case 6 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1241:6: ( ruleGlobalInterruptible ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1241:6: ( ruleGlobalInterruptible ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1242:1: ruleGlobalInterruptible - { - before(grammarAccess.getGlobalInteractionAccess().getGlobalInterruptibleParserRuleCall_5()); - pushFollow(FOLLOW_ruleGlobalInterruptible_in_rule__GlobalInteraction__Alternatives2628); - ruleGlobalInterruptible(); - - state._fsp--; - - after(grammarAccess.getGlobalInteractionAccess().getGlobalInterruptibleParserRuleCall_5()); - - } - - - } - break; - case 7 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1247:6: ( ruleGlobalDo ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1247:6: ( ruleGlobalDo ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1248:1: ruleGlobalDo - { - before(grammarAccess.getGlobalInteractionAccess().getGlobalDoParserRuleCall_6()); - pushFollow(FOLLOW_ruleGlobalDo_in_rule__GlobalInteraction__Alternatives2645); - ruleGlobalDo(); - - state._fsp--; - - after(grammarAccess.getGlobalInteractionAccess().getGlobalDoParserRuleCall_6()); - - } - - - } - break; - - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalInteraction__Alternatives" - - - // $ANTLR start "rule__Message__Alternatives" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1258:1: rule__Message__Alternatives : ( ( ( rule__Message__SignatureAssignment_0 ) ) | ( ( rule__Message__ParameterAssignment_1 ) ) ); - public final void rule__Message__Alternatives() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1262:1: ( ( ( rule__Message__SignatureAssignment_0 ) ) | ( ( rule__Message__ParameterAssignment_1 ) ) ) - int alt7=2; - int LA7_0 = input.LA(1); - - if ( (LA7_0==RULE_ID) ) { - int LA7_1 = input.LA(2); - - if ( (LA7_1==EOF||LA7_1==16||LA7_1==22||LA7_1==31||LA7_1==41) ) { - alt7=2; - } - else if ( (LA7_1==20) ) { - alt7=1; - } - else { - NoViableAltException nvae = - new NoViableAltException("", 7, 1, input); - - throw nvae; - } - } - else if ( (LA7_0==20) ) { - alt7=1; - } - else { - NoViableAltException nvae = - new NoViableAltException("", 7, 0, input); - - throw nvae; - } - switch (alt7) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1263:1: ( ( rule__Message__SignatureAssignment_0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1263:1: ( ( rule__Message__SignatureAssignment_0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1264:1: ( rule__Message__SignatureAssignment_0 ) - { - before(grammarAccess.getMessageAccess().getSignatureAssignment_0()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1265:1: ( rule__Message__SignatureAssignment_0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1265:2: rule__Message__SignatureAssignment_0 - { - pushFollow(FOLLOW_rule__Message__SignatureAssignment_0_in_rule__Message__Alternatives2677); - rule__Message__SignatureAssignment_0(); - - state._fsp--; - - - } - - after(grammarAccess.getMessageAccess().getSignatureAssignment_0()); - - } - - - } - break; - case 2 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1269:6: ( ( rule__Message__ParameterAssignment_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1269:6: ( ( rule__Message__ParameterAssignment_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1270:1: ( rule__Message__ParameterAssignment_1 ) - { - before(grammarAccess.getMessageAccess().getParameterAssignment_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1271:1: ( rule__Message__ParameterAssignment_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1271:2: rule__Message__ParameterAssignment_1 - { - pushFollow(FOLLOW_rule__Message__ParameterAssignment_1_in_rule__Message__Alternatives2695); - rule__Message__ParameterAssignment_1(); - - state._fsp--; - - - } - - after(grammarAccess.getMessageAccess().getParameterAssignment_1()); - - } - - - } - break; - - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Message__Alternatives" - - - // $ANTLR start "rule__LocalProtocolDecl__Alternatives_10" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1280:1: rule__LocalProtocolDecl__Alternatives_10 : ( ( ( rule__LocalProtocolDecl__BlockAssignment_10_0 ) ) | ( ( rule__LocalProtocolDecl__Group_10_1__0 ) ) ); - public final void rule__LocalProtocolDecl__Alternatives_10() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1284:1: ( ( ( rule__LocalProtocolDecl__BlockAssignment_10_0 ) ) | ( ( rule__LocalProtocolDecl__Group_10_1__0 ) ) ) - int alt8=2; - int LA8_0 = input.LA(1); - - if ( (LA8_0==29) ) { - alt8=1; - } - else if ( (LA8_0==26) ) { - alt8=2; - } - else { - NoViableAltException nvae = - new NoViableAltException("", 8, 0, input); - - throw nvae; - } - switch (alt8) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1285:1: ( ( rule__LocalProtocolDecl__BlockAssignment_10_0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1285:1: ( ( rule__LocalProtocolDecl__BlockAssignment_10_0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1286:1: ( rule__LocalProtocolDecl__BlockAssignment_10_0 ) - { - before(grammarAccess.getLocalProtocolDeclAccess().getBlockAssignment_10_0()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1287:1: ( rule__LocalProtocolDecl__BlockAssignment_10_0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1287:2: rule__LocalProtocolDecl__BlockAssignment_10_0 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__BlockAssignment_10_0_in_rule__LocalProtocolDecl__Alternatives_102728); - rule__LocalProtocolDecl__BlockAssignment_10_0(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalProtocolDeclAccess().getBlockAssignment_10_0()); - - } - - - } - break; - case 2 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1291:6: ( ( rule__LocalProtocolDecl__Group_10_1__0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1291:6: ( ( rule__LocalProtocolDecl__Group_10_1__0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1292:1: ( rule__LocalProtocolDecl__Group_10_1__0 ) - { - before(grammarAccess.getLocalProtocolDeclAccess().getGroup_10_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1293:1: ( rule__LocalProtocolDecl__Group_10_1__0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1293:2: rule__LocalProtocolDecl__Group_10_1__0 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_10_1__0_in_rule__LocalProtocolDecl__Alternatives_102746); - rule__LocalProtocolDecl__Group_10_1__0(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalProtocolDeclAccess().getGroup_10_1()); - - } - - - } - break; - - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Alternatives_10" - - - // $ANTLR start "rule__LlobalInteraction__Alternatives" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1302:1: rule__LlobalInteraction__Alternatives : ( ( ruleLocalSend ) | ( ruleLocalReceive ) | ( ruleLocalChoice ) | ( ruleLocalParallel ) | ( ruleLocalRecursion ) | ( ruleLocalContinue ) | ( ruleLocalInterruptible ) | ( ruleLocalDo ) ); - public final void rule__LlobalInteraction__Alternatives() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1306:1: ( ( ruleLocalSend ) | ( ruleLocalReceive ) | ( ruleLocalChoice ) | ( ruleLocalParallel ) | ( ruleLocalRecursion ) | ( ruleLocalContinue ) | ( ruleLocalInterruptible ) | ( ruleLocalDo ) ) - int alt9=8; - alt9 = dfa9.predict(input); - switch (alt9) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1307:1: ( ruleLocalSend ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1307:1: ( ruleLocalSend ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1308:1: ruleLocalSend - { - before(grammarAccess.getLlobalInteractionAccess().getLocalSendParserRuleCall_0()); - pushFollow(FOLLOW_ruleLocalSend_in_rule__LlobalInteraction__Alternatives2779); - ruleLocalSend(); - - state._fsp--; - - after(grammarAccess.getLlobalInteractionAccess().getLocalSendParserRuleCall_0()); - - } - - - } - break; - case 2 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1313:6: ( ruleLocalReceive ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1313:6: ( ruleLocalReceive ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1314:1: ruleLocalReceive - { - before(grammarAccess.getLlobalInteractionAccess().getLocalReceiveParserRuleCall_1()); - pushFollow(FOLLOW_ruleLocalReceive_in_rule__LlobalInteraction__Alternatives2796); - ruleLocalReceive(); - - state._fsp--; - - after(grammarAccess.getLlobalInteractionAccess().getLocalReceiveParserRuleCall_1()); - - } - - - } - break; - case 3 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1319:6: ( ruleLocalChoice ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1319:6: ( ruleLocalChoice ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1320:1: ruleLocalChoice - { - before(grammarAccess.getLlobalInteractionAccess().getLocalChoiceParserRuleCall_2()); - pushFollow(FOLLOW_ruleLocalChoice_in_rule__LlobalInteraction__Alternatives2813); - ruleLocalChoice(); - - state._fsp--; - - after(grammarAccess.getLlobalInteractionAccess().getLocalChoiceParserRuleCall_2()); - - } - - - } - break; - case 4 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1325:6: ( ruleLocalParallel ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1325:6: ( ruleLocalParallel ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1326:1: ruleLocalParallel - { - before(grammarAccess.getLlobalInteractionAccess().getLocalParallelParserRuleCall_3()); - pushFollow(FOLLOW_ruleLocalParallel_in_rule__LlobalInteraction__Alternatives2830); - ruleLocalParallel(); - - state._fsp--; - - after(grammarAccess.getLlobalInteractionAccess().getLocalParallelParserRuleCall_3()); - - } - - - } - break; - case 5 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1331:6: ( ruleLocalRecursion ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1331:6: ( ruleLocalRecursion ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1332:1: ruleLocalRecursion - { - before(grammarAccess.getLlobalInteractionAccess().getLocalRecursionParserRuleCall_4()); - pushFollow(FOLLOW_ruleLocalRecursion_in_rule__LlobalInteraction__Alternatives2847); - ruleLocalRecursion(); - - state._fsp--; - - after(grammarAccess.getLlobalInteractionAccess().getLocalRecursionParserRuleCall_4()); - - } - - - } - break; - case 6 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1337:6: ( ruleLocalContinue ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1337:6: ( ruleLocalContinue ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1338:1: ruleLocalContinue - { - before(grammarAccess.getLlobalInteractionAccess().getLocalContinueParserRuleCall_5()); - pushFollow(FOLLOW_ruleLocalContinue_in_rule__LlobalInteraction__Alternatives2864); - ruleLocalContinue(); - - state._fsp--; - - after(grammarAccess.getLlobalInteractionAccess().getLocalContinueParserRuleCall_5()); - - } - - - } - break; - case 7 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1343:6: ( ruleLocalInterruptible ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1343:6: ( ruleLocalInterruptible ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1344:1: ruleLocalInterruptible - { - before(grammarAccess.getLlobalInteractionAccess().getLocalInterruptibleParserRuleCall_6()); - pushFollow(FOLLOW_ruleLocalInterruptible_in_rule__LlobalInteraction__Alternatives2881); - ruleLocalInterruptible(); - - state._fsp--; - - after(grammarAccess.getLlobalInteractionAccess().getLocalInterruptibleParserRuleCall_6()); - - } - - - } - break; - case 8 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1349:6: ( ruleLocalDo ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1349:6: ( ruleLocalDo ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1350:1: ruleLocalDo - { - before(grammarAccess.getLlobalInteractionAccess().getLocalDoParserRuleCall_7()); - pushFollow(FOLLOW_ruleLocalDo_in_rule__LlobalInteraction__Alternatives2898); - ruleLocalDo(); - - state._fsp--; - - after(grammarAccess.getLlobalInteractionAccess().getLocalDoParserRuleCall_7()); - - } - - - } - break; - - } - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LlobalInteraction__Alternatives" - - - // $ANTLR start "rule__Module__Group__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1362:1: rule__Module__Group__0 : rule__Module__Group__0__Impl rule__Module__Group__1 ; - public final void rule__Module__Group__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1366:1: ( rule__Module__Group__0__Impl rule__Module__Group__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1367:2: rule__Module__Group__0__Impl rule__Module__Group__1 - { - pushFollow(FOLLOW_rule__Module__Group__0__Impl_in_rule__Module__Group__02928); - rule__Module__Group__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Module__Group__1_in_rule__Module__Group__02931); - rule__Module__Group__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Module__Group__0" - - - // $ANTLR start "rule__Module__Group__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1374:1: rule__Module__Group__0__Impl : ( 'module' ) ; - public final void rule__Module__Group__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1378:1: ( ( 'module' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1379:1: ( 'module' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1379:1: ( 'module' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1380:1: 'module' - { - before(grammarAccess.getModuleAccess().getModuleKeyword_0()); - match(input,11,FOLLOW_11_in_rule__Module__Group__0__Impl2959); - after(grammarAccess.getModuleAccess().getModuleKeyword_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Module__Group__0__Impl" - - - // $ANTLR start "rule__Module__Group__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1393:1: rule__Module__Group__1 : rule__Module__Group__1__Impl rule__Module__Group__2 ; - public final void rule__Module__Group__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1397:1: ( rule__Module__Group__1__Impl rule__Module__Group__2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1398:2: rule__Module__Group__1__Impl rule__Module__Group__2 - { - pushFollow(FOLLOW_rule__Module__Group__1__Impl_in_rule__Module__Group__12990); - rule__Module__Group__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Module__Group__2_in_rule__Module__Group__12993); - rule__Module__Group__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Module__Group__1" - - - // $ANTLR start "rule__Module__Group__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1405:1: rule__Module__Group__1__Impl : ( ( rule__Module__NameAssignment_1 ) ) ; - public final void rule__Module__Group__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1409:1: ( ( ( rule__Module__NameAssignment_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1410:1: ( ( rule__Module__NameAssignment_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1410:1: ( ( rule__Module__NameAssignment_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1411:1: ( rule__Module__NameAssignment_1 ) - { - before(grammarAccess.getModuleAccess().getNameAssignment_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1412:1: ( rule__Module__NameAssignment_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1412:2: rule__Module__NameAssignment_1 - { - pushFollow(FOLLOW_rule__Module__NameAssignment_1_in_rule__Module__Group__1__Impl3020); - rule__Module__NameAssignment_1(); - - state._fsp--; - - - } - - after(grammarAccess.getModuleAccess().getNameAssignment_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Module__Group__1__Impl" - - - // $ANTLR start "rule__Module__Group__2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1422:1: rule__Module__Group__2 : rule__Module__Group__2__Impl rule__Module__Group__3 ; - public final void rule__Module__Group__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1426:1: ( rule__Module__Group__2__Impl rule__Module__Group__3 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1427:2: rule__Module__Group__2__Impl rule__Module__Group__3 - { - pushFollow(FOLLOW_rule__Module__Group__2__Impl_in_rule__Module__Group__23050); - rule__Module__Group__2__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Module__Group__3_in_rule__Module__Group__23053); - rule__Module__Group__3(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Module__Group__2" - - - // $ANTLR start "rule__Module__Group__2__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1434:1: rule__Module__Group__2__Impl : ( ';' ) ; - public final void rule__Module__Group__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1438:1: ( ( ';' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1439:1: ( ';' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1439:1: ( ';' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1440:1: ';' - { - before(grammarAccess.getModuleAccess().getSemicolonKeyword_2()); - match(input,12,FOLLOW_12_in_rule__Module__Group__2__Impl3081); - after(grammarAccess.getModuleAccess().getSemicolonKeyword_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Module__Group__2__Impl" - - - // $ANTLR start "rule__Module__Group__3" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1453:1: rule__Module__Group__3 : rule__Module__Group__3__Impl rule__Module__Group__4 ; - public final void rule__Module__Group__3() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1457:1: ( rule__Module__Group__3__Impl rule__Module__Group__4 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1458:2: rule__Module__Group__3__Impl rule__Module__Group__4 - { - pushFollow(FOLLOW_rule__Module__Group__3__Impl_in_rule__Module__Group__33112); - rule__Module__Group__3__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Module__Group__4_in_rule__Module__Group__33115); - rule__Module__Group__4(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Module__Group__3" - - - // $ANTLR start "rule__Module__Group__3__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1465:1: rule__Module__Group__3__Impl : ( ( rule__Module__ImportsAssignment_3 )* ) ; - public final void rule__Module__Group__3__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1469:1: ( ( ( rule__Module__ImportsAssignment_3 )* ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1470:1: ( ( rule__Module__ImportsAssignment_3 )* ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1470:1: ( ( rule__Module__ImportsAssignment_3 )* ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1471:1: ( rule__Module__ImportsAssignment_3 )* - { - before(grammarAccess.getModuleAccess().getImportsAssignment_3()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1472:1: ( rule__Module__ImportsAssignment_3 )* - loop10: - do { - int alt10=2; - int LA10_0 = input.LA(1); - - if ( (LA10_0==14||LA10_0==16) ) { - alt10=1; - } - - - switch (alt10) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1472:2: rule__Module__ImportsAssignment_3 - { - pushFollow(FOLLOW_rule__Module__ImportsAssignment_3_in_rule__Module__Group__3__Impl3142); - rule__Module__ImportsAssignment_3(); - - state._fsp--; - - - } - break; - - default : - break loop10; - } - } while (true); - - after(grammarAccess.getModuleAccess().getImportsAssignment_3()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Module__Group__3__Impl" - - - // $ANTLR start "rule__Module__Group__4" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1482:1: rule__Module__Group__4 : rule__Module__Group__4__Impl rule__Module__Group__5 ; - public final void rule__Module__Group__4() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1486:1: ( rule__Module__Group__4__Impl rule__Module__Group__5 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1487:2: rule__Module__Group__4__Impl rule__Module__Group__5 - { - pushFollow(FOLLOW_rule__Module__Group__4__Impl_in_rule__Module__Group__43173); - rule__Module__Group__4__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Module__Group__5_in_rule__Module__Group__43176); - rule__Module__Group__5(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Module__Group__4" - - - // $ANTLR start "rule__Module__Group__4__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1494:1: rule__Module__Group__4__Impl : ( ( rule__Module__TypesAssignment_4 )* ) ; - public final void rule__Module__Group__4__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1498:1: ( ( ( rule__Module__TypesAssignment_4 )* ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1499:1: ( ( rule__Module__TypesAssignment_4 )* ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1499:1: ( ( rule__Module__TypesAssignment_4 )* ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1500:1: ( rule__Module__TypesAssignment_4 )* - { - before(grammarAccess.getModuleAccess().getTypesAssignment_4()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1501:1: ( rule__Module__TypesAssignment_4 )* - loop11: - do { - int alt11=2; - int LA11_0 = input.LA(1); - - if ( (LA11_0==17) ) { - alt11=1; - } - - - switch (alt11) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1501:2: rule__Module__TypesAssignment_4 - { - pushFollow(FOLLOW_rule__Module__TypesAssignment_4_in_rule__Module__Group__4__Impl3203); - rule__Module__TypesAssignment_4(); - - state._fsp--; - - - } - break; - - default : - break loop11; - } - } while (true); - - after(grammarAccess.getModuleAccess().getTypesAssignment_4()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Module__Group__4__Impl" - - - // $ANTLR start "rule__Module__Group__5" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1511:1: rule__Module__Group__5 : rule__Module__Group__5__Impl ; - public final void rule__Module__Group__5() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1515:1: ( rule__Module__Group__5__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1516:2: rule__Module__Group__5__Impl - { - pushFollow(FOLLOW_rule__Module__Group__5__Impl_in_rule__Module__Group__53234); - rule__Module__Group__5__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Module__Group__5" - - - // $ANTLR start "rule__Module__Group__5__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1522:1: rule__Module__Group__5__Impl : ( ( rule__Module__Alternatives_5 )* ) ; - public final void rule__Module__Group__5__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1526:1: ( ( ( rule__Module__Alternatives_5 )* ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1527:1: ( ( rule__Module__Alternatives_5 )* ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1527:1: ( ( rule__Module__Alternatives_5 )* ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1528:1: ( rule__Module__Alternatives_5 )* - { - before(grammarAccess.getModuleAccess().getAlternatives_5()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1529:1: ( rule__Module__Alternatives_5 )* - loop12: - do { - int alt12=2; - int LA12_0 = input.LA(1); - - if ( (LA12_0==24||LA12_0==43) ) { - alt12=1; - } - - - switch (alt12) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1529:2: rule__Module__Alternatives_5 - { - pushFollow(FOLLOW_rule__Module__Alternatives_5_in_rule__Module__Group__5__Impl3261); - rule__Module__Alternatives_5(); - - state._fsp--; - - - } - break; - - default : - break loop12; - } - } while (true); - - after(grammarAccess.getModuleAccess().getAlternatives_5()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Module__Group__5__Impl" - - - // $ANTLR start "rule__ModuleName__Group__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1551:1: rule__ModuleName__Group__0 : rule__ModuleName__Group__0__Impl rule__ModuleName__Group__1 ; - public final void rule__ModuleName__Group__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1555:1: ( rule__ModuleName__Group__0__Impl rule__ModuleName__Group__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1556:2: rule__ModuleName__Group__0__Impl rule__ModuleName__Group__1 - { - pushFollow(FOLLOW_rule__ModuleName__Group__0__Impl_in_rule__ModuleName__Group__03304); - rule__ModuleName__Group__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__ModuleName__Group__1_in_rule__ModuleName__Group__03307); - rule__ModuleName__Group__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ModuleName__Group__0" - - - // $ANTLR start "rule__ModuleName__Group__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1563:1: rule__ModuleName__Group__0__Impl : ( RULE_ID ) ; - public final void rule__ModuleName__Group__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1567:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1568:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1568:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1569:1: RULE_ID - { - before(grammarAccess.getModuleNameAccess().getIDTerminalRuleCall_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__ModuleName__Group__0__Impl3334); - after(grammarAccess.getModuleNameAccess().getIDTerminalRuleCall_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ModuleName__Group__0__Impl" - - - // $ANTLR start "rule__ModuleName__Group__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1580:1: rule__ModuleName__Group__1 : rule__ModuleName__Group__1__Impl ; - public final void rule__ModuleName__Group__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1584:1: ( rule__ModuleName__Group__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1585:2: rule__ModuleName__Group__1__Impl - { - pushFollow(FOLLOW_rule__ModuleName__Group__1__Impl_in_rule__ModuleName__Group__13363); - rule__ModuleName__Group__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ModuleName__Group__1" - - - // $ANTLR start "rule__ModuleName__Group__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1591:1: rule__ModuleName__Group__1__Impl : ( ( rule__ModuleName__Group_1__0 )* ) ; - public final void rule__ModuleName__Group__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1595:1: ( ( ( rule__ModuleName__Group_1__0 )* ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1596:1: ( ( rule__ModuleName__Group_1__0 )* ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1596:1: ( ( rule__ModuleName__Group_1__0 )* ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1597:1: ( rule__ModuleName__Group_1__0 )* - { - before(grammarAccess.getModuleNameAccess().getGroup_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1598:1: ( rule__ModuleName__Group_1__0 )* - loop13: - do { - int alt13=2; - int LA13_0 = input.LA(1); - - if ( (LA13_0==13) ) { - alt13=1; - } - - - switch (alt13) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1598:2: rule__ModuleName__Group_1__0 - { - pushFollow(FOLLOW_rule__ModuleName__Group_1__0_in_rule__ModuleName__Group__1__Impl3390); - rule__ModuleName__Group_1__0(); - - state._fsp--; - - - } - break; - - default : - break loop13; - } - } while (true); - - after(grammarAccess.getModuleNameAccess().getGroup_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ModuleName__Group__1__Impl" - - - // $ANTLR start "rule__ModuleName__Group_1__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1612:1: rule__ModuleName__Group_1__0 : rule__ModuleName__Group_1__0__Impl rule__ModuleName__Group_1__1 ; - public final void rule__ModuleName__Group_1__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1616:1: ( rule__ModuleName__Group_1__0__Impl rule__ModuleName__Group_1__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1617:2: rule__ModuleName__Group_1__0__Impl rule__ModuleName__Group_1__1 - { - pushFollow(FOLLOW_rule__ModuleName__Group_1__0__Impl_in_rule__ModuleName__Group_1__03425); - rule__ModuleName__Group_1__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__ModuleName__Group_1__1_in_rule__ModuleName__Group_1__03428); - rule__ModuleName__Group_1__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ModuleName__Group_1__0" - - - // $ANTLR start "rule__ModuleName__Group_1__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1624:1: rule__ModuleName__Group_1__0__Impl : ( '.' ) ; - public final void rule__ModuleName__Group_1__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1628:1: ( ( '.' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1629:1: ( '.' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1629:1: ( '.' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1630:1: '.' - { - before(grammarAccess.getModuleNameAccess().getFullStopKeyword_1_0()); - match(input,13,FOLLOW_13_in_rule__ModuleName__Group_1__0__Impl3456); - after(grammarAccess.getModuleNameAccess().getFullStopKeyword_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ModuleName__Group_1__0__Impl" - - - // $ANTLR start "rule__ModuleName__Group_1__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1643:1: rule__ModuleName__Group_1__1 : rule__ModuleName__Group_1__1__Impl ; - public final void rule__ModuleName__Group_1__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1647:1: ( rule__ModuleName__Group_1__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1648:2: rule__ModuleName__Group_1__1__Impl - { - pushFollow(FOLLOW_rule__ModuleName__Group_1__1__Impl_in_rule__ModuleName__Group_1__13487); - rule__ModuleName__Group_1__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ModuleName__Group_1__1" - - - // $ANTLR start "rule__ModuleName__Group_1__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1654:1: rule__ModuleName__Group_1__1__Impl : ( RULE_ID ) ; - public final void rule__ModuleName__Group_1__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1658:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1659:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1659:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1660:1: RULE_ID - { - before(grammarAccess.getModuleNameAccess().getIDTerminalRuleCall_1_1()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__ModuleName__Group_1__1__Impl3514); - after(grammarAccess.getModuleNameAccess().getIDTerminalRuleCall_1_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ModuleName__Group_1__1__Impl" - - - // $ANTLR start "rule__ImportModule__Group__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1675:1: rule__ImportModule__Group__0 : rule__ImportModule__Group__0__Impl rule__ImportModule__Group__1 ; - public final void rule__ImportModule__Group__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1679:1: ( rule__ImportModule__Group__0__Impl rule__ImportModule__Group__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1680:2: rule__ImportModule__Group__0__Impl rule__ImportModule__Group__1 - { - pushFollow(FOLLOW_rule__ImportModule__Group__0__Impl_in_rule__ImportModule__Group__03547); - rule__ImportModule__Group__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__ImportModule__Group__1_in_rule__ImportModule__Group__03550); - rule__ImportModule__Group__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ImportModule__Group__0" - - - // $ANTLR start "rule__ImportModule__Group__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1687:1: rule__ImportModule__Group__0__Impl : ( 'import' ) ; - public final void rule__ImportModule__Group__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1691:1: ( ( 'import' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1692:1: ( 'import' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1692:1: ( 'import' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1693:1: 'import' - { - before(grammarAccess.getImportModuleAccess().getImportKeyword_0()); - match(input,14,FOLLOW_14_in_rule__ImportModule__Group__0__Impl3578); - after(grammarAccess.getImportModuleAccess().getImportKeyword_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ImportModule__Group__0__Impl" - - - // $ANTLR start "rule__ImportModule__Group__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1706:1: rule__ImportModule__Group__1 : rule__ImportModule__Group__1__Impl rule__ImportModule__Group__2 ; - public final void rule__ImportModule__Group__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1710:1: ( rule__ImportModule__Group__1__Impl rule__ImportModule__Group__2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1711:2: rule__ImportModule__Group__1__Impl rule__ImportModule__Group__2 - { - pushFollow(FOLLOW_rule__ImportModule__Group__1__Impl_in_rule__ImportModule__Group__13609); - rule__ImportModule__Group__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__ImportModule__Group__2_in_rule__ImportModule__Group__13612); - rule__ImportModule__Group__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ImportModule__Group__1" - - - // $ANTLR start "rule__ImportModule__Group__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1718:1: rule__ImportModule__Group__1__Impl : ( ( rule__ImportModule__NameAssignment_1 ) ) ; - public final void rule__ImportModule__Group__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1722:1: ( ( ( rule__ImportModule__NameAssignment_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1723:1: ( ( rule__ImportModule__NameAssignment_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1723:1: ( ( rule__ImportModule__NameAssignment_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1724:1: ( rule__ImportModule__NameAssignment_1 ) - { - before(grammarAccess.getImportModuleAccess().getNameAssignment_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1725:1: ( rule__ImportModule__NameAssignment_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1725:2: rule__ImportModule__NameAssignment_1 - { - pushFollow(FOLLOW_rule__ImportModule__NameAssignment_1_in_rule__ImportModule__Group__1__Impl3639); - rule__ImportModule__NameAssignment_1(); - - state._fsp--; - - - } - - after(grammarAccess.getImportModuleAccess().getNameAssignment_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ImportModule__Group__1__Impl" - - - // $ANTLR start "rule__ImportModule__Group__2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1735:1: rule__ImportModule__Group__2 : rule__ImportModule__Group__2__Impl rule__ImportModule__Group__3 ; - public final void rule__ImportModule__Group__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1739:1: ( rule__ImportModule__Group__2__Impl rule__ImportModule__Group__3 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1740:2: rule__ImportModule__Group__2__Impl rule__ImportModule__Group__3 - { - pushFollow(FOLLOW_rule__ImportModule__Group__2__Impl_in_rule__ImportModule__Group__23669); - rule__ImportModule__Group__2__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__ImportModule__Group__3_in_rule__ImportModule__Group__23672); - rule__ImportModule__Group__3(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ImportModule__Group__2" - - - // $ANTLR start "rule__ImportModule__Group__2__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1747:1: rule__ImportModule__Group__2__Impl : ( ( rule__ImportModule__Group_2__0 )? ) ; - public final void rule__ImportModule__Group__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1751:1: ( ( ( rule__ImportModule__Group_2__0 )? ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1752:1: ( ( rule__ImportModule__Group_2__0 )? ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1752:1: ( ( rule__ImportModule__Group_2__0 )? ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1753:1: ( rule__ImportModule__Group_2__0 )? - { - before(grammarAccess.getImportModuleAccess().getGroup_2()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1754:1: ( rule__ImportModule__Group_2__0 )? - int alt14=2; - int LA14_0 = input.LA(1); - - if ( (LA14_0==15) ) { - alt14=1; - } - switch (alt14) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1754:2: rule__ImportModule__Group_2__0 - { - pushFollow(FOLLOW_rule__ImportModule__Group_2__0_in_rule__ImportModule__Group__2__Impl3699); - rule__ImportModule__Group_2__0(); - - state._fsp--; - - - } - break; - - } - - after(grammarAccess.getImportModuleAccess().getGroup_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ImportModule__Group__2__Impl" - - - // $ANTLR start "rule__ImportModule__Group__3" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1764:1: rule__ImportModule__Group__3 : rule__ImportModule__Group__3__Impl ; - public final void rule__ImportModule__Group__3() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1768:1: ( rule__ImportModule__Group__3__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1769:2: rule__ImportModule__Group__3__Impl - { - pushFollow(FOLLOW_rule__ImportModule__Group__3__Impl_in_rule__ImportModule__Group__33730); - rule__ImportModule__Group__3__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ImportModule__Group__3" - - - // $ANTLR start "rule__ImportModule__Group__3__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1775:1: rule__ImportModule__Group__3__Impl : ( ';' ) ; - public final void rule__ImportModule__Group__3__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1779:1: ( ( ';' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1780:1: ( ';' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1780:1: ( ';' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1781:1: ';' - { - before(grammarAccess.getImportModuleAccess().getSemicolonKeyword_3()); - match(input,12,FOLLOW_12_in_rule__ImportModule__Group__3__Impl3758); - after(grammarAccess.getImportModuleAccess().getSemicolonKeyword_3()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ImportModule__Group__3__Impl" - - - // $ANTLR start "rule__ImportModule__Group_2__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1802:1: rule__ImportModule__Group_2__0 : rule__ImportModule__Group_2__0__Impl rule__ImportModule__Group_2__1 ; - public final void rule__ImportModule__Group_2__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1806:1: ( rule__ImportModule__Group_2__0__Impl rule__ImportModule__Group_2__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1807:2: rule__ImportModule__Group_2__0__Impl rule__ImportModule__Group_2__1 - { - pushFollow(FOLLOW_rule__ImportModule__Group_2__0__Impl_in_rule__ImportModule__Group_2__03797); - rule__ImportModule__Group_2__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__ImportModule__Group_2__1_in_rule__ImportModule__Group_2__03800); - rule__ImportModule__Group_2__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ImportModule__Group_2__0" - - - // $ANTLR start "rule__ImportModule__Group_2__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1814:1: rule__ImportModule__Group_2__0__Impl : ( 'as' ) ; - public final void rule__ImportModule__Group_2__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1818:1: ( ( 'as' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1819:1: ( 'as' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1819:1: ( 'as' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1820:1: 'as' - { - before(grammarAccess.getImportModuleAccess().getAsKeyword_2_0()); - match(input,15,FOLLOW_15_in_rule__ImportModule__Group_2__0__Impl3828); - after(grammarAccess.getImportModuleAccess().getAsKeyword_2_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ImportModule__Group_2__0__Impl" - - - // $ANTLR start "rule__ImportModule__Group_2__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1833:1: rule__ImportModule__Group_2__1 : rule__ImportModule__Group_2__1__Impl ; - public final void rule__ImportModule__Group_2__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1837:1: ( rule__ImportModule__Group_2__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1838:2: rule__ImportModule__Group_2__1__Impl - { - pushFollow(FOLLOW_rule__ImportModule__Group_2__1__Impl_in_rule__ImportModule__Group_2__13859); - rule__ImportModule__Group_2__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ImportModule__Group_2__1" - - - // $ANTLR start "rule__ImportModule__Group_2__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1844:1: rule__ImportModule__Group_2__1__Impl : ( ( rule__ImportModule__AliasAssignment_2_1 ) ) ; - public final void rule__ImportModule__Group_2__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1848:1: ( ( ( rule__ImportModule__AliasAssignment_2_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1849:1: ( ( rule__ImportModule__AliasAssignment_2_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1849:1: ( ( rule__ImportModule__AliasAssignment_2_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1850:1: ( rule__ImportModule__AliasAssignment_2_1 ) - { - before(grammarAccess.getImportModuleAccess().getAliasAssignment_2_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1851:1: ( rule__ImportModule__AliasAssignment_2_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1851:2: rule__ImportModule__AliasAssignment_2_1 - { - pushFollow(FOLLOW_rule__ImportModule__AliasAssignment_2_1_in_rule__ImportModule__Group_2__1__Impl3886); - rule__ImportModule__AliasAssignment_2_1(); - - state._fsp--; - - - } - - after(grammarAccess.getImportModuleAccess().getAliasAssignment_2_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ImportModule__Group_2__1__Impl" - - - // $ANTLR start "rule__ImportMember__Group__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1865:1: rule__ImportMember__Group__0 : rule__ImportMember__Group__0__Impl rule__ImportMember__Group__1 ; - public final void rule__ImportMember__Group__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1869:1: ( rule__ImportMember__Group__0__Impl rule__ImportMember__Group__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1870:2: rule__ImportMember__Group__0__Impl rule__ImportMember__Group__1 - { - pushFollow(FOLLOW_rule__ImportMember__Group__0__Impl_in_rule__ImportMember__Group__03920); - rule__ImportMember__Group__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__ImportMember__Group__1_in_rule__ImportMember__Group__03923); - rule__ImportMember__Group__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ImportMember__Group__0" - - - // $ANTLR start "rule__ImportMember__Group__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1877:1: rule__ImportMember__Group__0__Impl : ( 'from' ) ; - public final void rule__ImportMember__Group__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1881:1: ( ( 'from' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1882:1: ( 'from' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1882:1: ( 'from' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1883:1: 'from' - { - before(grammarAccess.getImportMemberAccess().getFromKeyword_0()); - match(input,16,FOLLOW_16_in_rule__ImportMember__Group__0__Impl3951); - after(grammarAccess.getImportMemberAccess().getFromKeyword_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ImportMember__Group__0__Impl" - - - // $ANTLR start "rule__ImportMember__Group__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1896:1: rule__ImportMember__Group__1 : rule__ImportMember__Group__1__Impl rule__ImportMember__Group__2 ; - public final void rule__ImportMember__Group__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1900:1: ( rule__ImportMember__Group__1__Impl rule__ImportMember__Group__2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1901:2: rule__ImportMember__Group__1__Impl rule__ImportMember__Group__2 - { - pushFollow(FOLLOW_rule__ImportMember__Group__1__Impl_in_rule__ImportMember__Group__13982); - rule__ImportMember__Group__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__ImportMember__Group__2_in_rule__ImportMember__Group__13985); - rule__ImportMember__Group__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ImportMember__Group__1" - - - // $ANTLR start "rule__ImportMember__Group__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1908:1: rule__ImportMember__Group__1__Impl : ( ( rule__ImportMember__NameAssignment_1 ) ) ; - public final void rule__ImportMember__Group__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1912:1: ( ( ( rule__ImportMember__NameAssignment_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1913:1: ( ( rule__ImportMember__NameAssignment_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1913:1: ( ( rule__ImportMember__NameAssignment_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1914:1: ( rule__ImportMember__NameAssignment_1 ) - { - before(grammarAccess.getImportMemberAccess().getNameAssignment_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1915:1: ( rule__ImportMember__NameAssignment_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1915:2: rule__ImportMember__NameAssignment_1 - { - pushFollow(FOLLOW_rule__ImportMember__NameAssignment_1_in_rule__ImportMember__Group__1__Impl4012); - rule__ImportMember__NameAssignment_1(); - - state._fsp--; - - - } - - after(grammarAccess.getImportMemberAccess().getNameAssignment_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ImportMember__Group__1__Impl" - - - // $ANTLR start "rule__ImportMember__Group__2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1925:1: rule__ImportMember__Group__2 : rule__ImportMember__Group__2__Impl rule__ImportMember__Group__3 ; - public final void rule__ImportMember__Group__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1929:1: ( rule__ImportMember__Group__2__Impl rule__ImportMember__Group__3 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1930:2: rule__ImportMember__Group__2__Impl rule__ImportMember__Group__3 - { - pushFollow(FOLLOW_rule__ImportMember__Group__2__Impl_in_rule__ImportMember__Group__24042); - rule__ImportMember__Group__2__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__ImportMember__Group__3_in_rule__ImportMember__Group__24045); - rule__ImportMember__Group__3(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ImportMember__Group__2" - - - // $ANTLR start "rule__ImportMember__Group__2__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1937:1: rule__ImportMember__Group__2__Impl : ( 'import' ) ; - public final void rule__ImportMember__Group__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1941:1: ( ( 'import' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1942:1: ( 'import' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1942:1: ( 'import' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1943:1: 'import' - { - before(grammarAccess.getImportMemberAccess().getImportKeyword_2()); - match(input,14,FOLLOW_14_in_rule__ImportMember__Group__2__Impl4073); - after(grammarAccess.getImportMemberAccess().getImportKeyword_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ImportMember__Group__2__Impl" - - - // $ANTLR start "rule__ImportMember__Group__3" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1956:1: rule__ImportMember__Group__3 : rule__ImportMember__Group__3__Impl rule__ImportMember__Group__4 ; - public final void rule__ImportMember__Group__3() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1960:1: ( rule__ImportMember__Group__3__Impl rule__ImportMember__Group__4 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1961:2: rule__ImportMember__Group__3__Impl rule__ImportMember__Group__4 - { - pushFollow(FOLLOW_rule__ImportMember__Group__3__Impl_in_rule__ImportMember__Group__34104); - rule__ImportMember__Group__3__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__ImportMember__Group__4_in_rule__ImportMember__Group__34107); - rule__ImportMember__Group__4(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ImportMember__Group__3" - - - // $ANTLR start "rule__ImportMember__Group__3__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1968:1: rule__ImportMember__Group__3__Impl : ( ( rule__ImportMember__MemberAssignment_3 ) ) ; - public final void rule__ImportMember__Group__3__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1972:1: ( ( ( rule__ImportMember__MemberAssignment_3 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1973:1: ( ( rule__ImportMember__MemberAssignment_3 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1973:1: ( ( rule__ImportMember__MemberAssignment_3 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1974:1: ( rule__ImportMember__MemberAssignment_3 ) - { - before(grammarAccess.getImportMemberAccess().getMemberAssignment_3()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1975:1: ( rule__ImportMember__MemberAssignment_3 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1975:2: rule__ImportMember__MemberAssignment_3 - { - pushFollow(FOLLOW_rule__ImportMember__MemberAssignment_3_in_rule__ImportMember__Group__3__Impl4134); - rule__ImportMember__MemberAssignment_3(); - - state._fsp--; - - - } - - after(grammarAccess.getImportMemberAccess().getMemberAssignment_3()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ImportMember__Group__3__Impl" - - - // $ANTLR start "rule__ImportMember__Group__4" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1985:1: rule__ImportMember__Group__4 : rule__ImportMember__Group__4__Impl rule__ImportMember__Group__5 ; - public final void rule__ImportMember__Group__4() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1989:1: ( rule__ImportMember__Group__4__Impl rule__ImportMember__Group__5 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1990:2: rule__ImportMember__Group__4__Impl rule__ImportMember__Group__5 - { - pushFollow(FOLLOW_rule__ImportMember__Group__4__Impl_in_rule__ImportMember__Group__44164); - rule__ImportMember__Group__4__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__ImportMember__Group__5_in_rule__ImportMember__Group__44167); - rule__ImportMember__Group__5(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ImportMember__Group__4" - - - // $ANTLR start "rule__ImportMember__Group__4__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:1997:1: rule__ImportMember__Group__4__Impl : ( ( rule__ImportMember__Group_4__0 )? ) ; - public final void rule__ImportMember__Group__4__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2001:1: ( ( ( rule__ImportMember__Group_4__0 )? ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2002:1: ( ( rule__ImportMember__Group_4__0 )? ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2002:1: ( ( rule__ImportMember__Group_4__0 )? ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2003:1: ( rule__ImportMember__Group_4__0 )? - { - before(grammarAccess.getImportMemberAccess().getGroup_4()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2004:1: ( rule__ImportMember__Group_4__0 )? - int alt15=2; - int LA15_0 = input.LA(1); - - if ( (LA15_0==15) ) { - alt15=1; - } - switch (alt15) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2004:2: rule__ImportMember__Group_4__0 - { - pushFollow(FOLLOW_rule__ImportMember__Group_4__0_in_rule__ImportMember__Group__4__Impl4194); - rule__ImportMember__Group_4__0(); - - state._fsp--; - - - } - break; - - } - - after(grammarAccess.getImportMemberAccess().getGroup_4()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ImportMember__Group__4__Impl" - - - // $ANTLR start "rule__ImportMember__Group__5" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2014:1: rule__ImportMember__Group__5 : rule__ImportMember__Group__5__Impl ; - public final void rule__ImportMember__Group__5() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2018:1: ( rule__ImportMember__Group__5__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2019:2: rule__ImportMember__Group__5__Impl - { - pushFollow(FOLLOW_rule__ImportMember__Group__5__Impl_in_rule__ImportMember__Group__54225); - rule__ImportMember__Group__5__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ImportMember__Group__5" - - - // $ANTLR start "rule__ImportMember__Group__5__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2025:1: rule__ImportMember__Group__5__Impl : ( ';' ) ; - public final void rule__ImportMember__Group__5__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2029:1: ( ( ';' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2030:1: ( ';' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2030:1: ( ';' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2031:1: ';' - { - before(grammarAccess.getImportMemberAccess().getSemicolonKeyword_5()); - match(input,12,FOLLOW_12_in_rule__ImportMember__Group__5__Impl4253); - after(grammarAccess.getImportMemberAccess().getSemicolonKeyword_5()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ImportMember__Group__5__Impl" - - - // $ANTLR start "rule__ImportMember__Group_4__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2056:1: rule__ImportMember__Group_4__0 : rule__ImportMember__Group_4__0__Impl rule__ImportMember__Group_4__1 ; - public final void rule__ImportMember__Group_4__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2060:1: ( rule__ImportMember__Group_4__0__Impl rule__ImportMember__Group_4__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2061:2: rule__ImportMember__Group_4__0__Impl rule__ImportMember__Group_4__1 - { - pushFollow(FOLLOW_rule__ImportMember__Group_4__0__Impl_in_rule__ImportMember__Group_4__04296); - rule__ImportMember__Group_4__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__ImportMember__Group_4__1_in_rule__ImportMember__Group_4__04299); - rule__ImportMember__Group_4__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ImportMember__Group_4__0" - - - // $ANTLR start "rule__ImportMember__Group_4__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2068:1: rule__ImportMember__Group_4__0__Impl : ( 'as' ) ; - public final void rule__ImportMember__Group_4__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2072:1: ( ( 'as' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2073:1: ( 'as' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2073:1: ( 'as' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2074:1: 'as' - { - before(grammarAccess.getImportMemberAccess().getAsKeyword_4_0()); - match(input,15,FOLLOW_15_in_rule__ImportMember__Group_4__0__Impl4327); - after(grammarAccess.getImportMemberAccess().getAsKeyword_4_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ImportMember__Group_4__0__Impl" - - - // $ANTLR start "rule__ImportMember__Group_4__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2087:1: rule__ImportMember__Group_4__1 : rule__ImportMember__Group_4__1__Impl ; - public final void rule__ImportMember__Group_4__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2091:1: ( rule__ImportMember__Group_4__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2092:2: rule__ImportMember__Group_4__1__Impl - { - pushFollow(FOLLOW_rule__ImportMember__Group_4__1__Impl_in_rule__ImportMember__Group_4__14358); - rule__ImportMember__Group_4__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ImportMember__Group_4__1" - - - // $ANTLR start "rule__ImportMember__Group_4__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2098:1: rule__ImportMember__Group_4__1__Impl : ( ( rule__ImportMember__AliasAssignment_4_1 ) ) ; - public final void rule__ImportMember__Group_4__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2102:1: ( ( ( rule__ImportMember__AliasAssignment_4_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2103:1: ( ( rule__ImportMember__AliasAssignment_4_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2103:1: ( ( rule__ImportMember__AliasAssignment_4_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2104:1: ( rule__ImportMember__AliasAssignment_4_1 ) - { - before(grammarAccess.getImportMemberAccess().getAliasAssignment_4_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2105:1: ( rule__ImportMember__AliasAssignment_4_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2105:2: rule__ImportMember__AliasAssignment_4_1 - { - pushFollow(FOLLOW_rule__ImportMember__AliasAssignment_4_1_in_rule__ImportMember__Group_4__1__Impl4385); - rule__ImportMember__AliasAssignment_4_1(); - - state._fsp--; - - - } - - after(grammarAccess.getImportMemberAccess().getAliasAssignment_4_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ImportMember__Group_4__1__Impl" - - - // $ANTLR start "rule__PayloadTypeDecl__Group__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2119:1: rule__PayloadTypeDecl__Group__0 : rule__PayloadTypeDecl__Group__0__Impl rule__PayloadTypeDecl__Group__1 ; - public final void rule__PayloadTypeDecl__Group__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2123:1: ( rule__PayloadTypeDecl__Group__0__Impl rule__PayloadTypeDecl__Group__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2124:2: rule__PayloadTypeDecl__Group__0__Impl rule__PayloadTypeDecl__Group__1 - { - pushFollow(FOLLOW_rule__PayloadTypeDecl__Group__0__Impl_in_rule__PayloadTypeDecl__Group__04419); - rule__PayloadTypeDecl__Group__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__PayloadTypeDecl__Group__1_in_rule__PayloadTypeDecl__Group__04422); - rule__PayloadTypeDecl__Group__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__PayloadTypeDecl__Group__0" - - - // $ANTLR start "rule__PayloadTypeDecl__Group__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2131:1: rule__PayloadTypeDecl__Group__0__Impl : ( 'type' ) ; - public final void rule__PayloadTypeDecl__Group__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2135:1: ( ( 'type' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2136:1: ( 'type' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2136:1: ( 'type' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2137:1: 'type' - { - before(grammarAccess.getPayloadTypeDeclAccess().getTypeKeyword_0()); - match(input,17,FOLLOW_17_in_rule__PayloadTypeDecl__Group__0__Impl4450); - after(grammarAccess.getPayloadTypeDeclAccess().getTypeKeyword_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__PayloadTypeDecl__Group__0__Impl" - - - // $ANTLR start "rule__PayloadTypeDecl__Group__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2150:1: rule__PayloadTypeDecl__Group__1 : rule__PayloadTypeDecl__Group__1__Impl rule__PayloadTypeDecl__Group__2 ; - public final void rule__PayloadTypeDecl__Group__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2154:1: ( rule__PayloadTypeDecl__Group__1__Impl rule__PayloadTypeDecl__Group__2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2155:2: rule__PayloadTypeDecl__Group__1__Impl rule__PayloadTypeDecl__Group__2 - { - pushFollow(FOLLOW_rule__PayloadTypeDecl__Group__1__Impl_in_rule__PayloadTypeDecl__Group__14481); - rule__PayloadTypeDecl__Group__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__PayloadTypeDecl__Group__2_in_rule__PayloadTypeDecl__Group__14484); - rule__PayloadTypeDecl__Group__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__PayloadTypeDecl__Group__1" - - - // $ANTLR start "rule__PayloadTypeDecl__Group__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2162:1: rule__PayloadTypeDecl__Group__1__Impl : ( '<' ) ; - public final void rule__PayloadTypeDecl__Group__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2166:1: ( ( '<' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2167:1: ( '<' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2167:1: ( '<' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2168:1: '<' - { - before(grammarAccess.getPayloadTypeDeclAccess().getLessThanSignKeyword_1()); - match(input,18,FOLLOW_18_in_rule__PayloadTypeDecl__Group__1__Impl4512); - after(grammarAccess.getPayloadTypeDeclAccess().getLessThanSignKeyword_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__PayloadTypeDecl__Group__1__Impl" - - - // $ANTLR start "rule__PayloadTypeDecl__Group__2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2181:1: rule__PayloadTypeDecl__Group__2 : rule__PayloadTypeDecl__Group__2__Impl rule__PayloadTypeDecl__Group__3 ; - public final void rule__PayloadTypeDecl__Group__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2185:1: ( rule__PayloadTypeDecl__Group__2__Impl rule__PayloadTypeDecl__Group__3 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2186:2: rule__PayloadTypeDecl__Group__2__Impl rule__PayloadTypeDecl__Group__3 - { - pushFollow(FOLLOW_rule__PayloadTypeDecl__Group__2__Impl_in_rule__PayloadTypeDecl__Group__24543); - rule__PayloadTypeDecl__Group__2__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__PayloadTypeDecl__Group__3_in_rule__PayloadTypeDecl__Group__24546); - rule__PayloadTypeDecl__Group__3(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__PayloadTypeDecl__Group__2" - - - // $ANTLR start "rule__PayloadTypeDecl__Group__2__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2193:1: rule__PayloadTypeDecl__Group__2__Impl : ( ( rule__PayloadTypeDecl__SchemaAssignment_2 ) ) ; - public final void rule__PayloadTypeDecl__Group__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2197:1: ( ( ( rule__PayloadTypeDecl__SchemaAssignment_2 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2198:1: ( ( rule__PayloadTypeDecl__SchemaAssignment_2 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2198:1: ( ( rule__PayloadTypeDecl__SchemaAssignment_2 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2199:1: ( rule__PayloadTypeDecl__SchemaAssignment_2 ) - { - before(grammarAccess.getPayloadTypeDeclAccess().getSchemaAssignment_2()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2200:1: ( rule__PayloadTypeDecl__SchemaAssignment_2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2200:2: rule__PayloadTypeDecl__SchemaAssignment_2 - { - pushFollow(FOLLOW_rule__PayloadTypeDecl__SchemaAssignment_2_in_rule__PayloadTypeDecl__Group__2__Impl4573); - rule__PayloadTypeDecl__SchemaAssignment_2(); - - state._fsp--; - - - } - - after(grammarAccess.getPayloadTypeDeclAccess().getSchemaAssignment_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__PayloadTypeDecl__Group__2__Impl" - - - // $ANTLR start "rule__PayloadTypeDecl__Group__3" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2210:1: rule__PayloadTypeDecl__Group__3 : rule__PayloadTypeDecl__Group__3__Impl rule__PayloadTypeDecl__Group__4 ; - public final void rule__PayloadTypeDecl__Group__3() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2214:1: ( rule__PayloadTypeDecl__Group__3__Impl rule__PayloadTypeDecl__Group__4 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2215:2: rule__PayloadTypeDecl__Group__3__Impl rule__PayloadTypeDecl__Group__4 - { - pushFollow(FOLLOW_rule__PayloadTypeDecl__Group__3__Impl_in_rule__PayloadTypeDecl__Group__34603); - rule__PayloadTypeDecl__Group__3__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__PayloadTypeDecl__Group__4_in_rule__PayloadTypeDecl__Group__34606); - rule__PayloadTypeDecl__Group__4(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__PayloadTypeDecl__Group__3" - - - // $ANTLR start "rule__PayloadTypeDecl__Group__3__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2222:1: rule__PayloadTypeDecl__Group__3__Impl : ( '>' ) ; - public final void rule__PayloadTypeDecl__Group__3__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2226:1: ( ( '>' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2227:1: ( '>' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2227:1: ( '>' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2228:1: '>' - { - before(grammarAccess.getPayloadTypeDeclAccess().getGreaterThanSignKeyword_3()); - match(input,19,FOLLOW_19_in_rule__PayloadTypeDecl__Group__3__Impl4634); - after(grammarAccess.getPayloadTypeDeclAccess().getGreaterThanSignKeyword_3()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__PayloadTypeDecl__Group__3__Impl" - - - // $ANTLR start "rule__PayloadTypeDecl__Group__4" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2241:1: rule__PayloadTypeDecl__Group__4 : rule__PayloadTypeDecl__Group__4__Impl rule__PayloadTypeDecl__Group__5 ; - public final void rule__PayloadTypeDecl__Group__4() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2245:1: ( rule__PayloadTypeDecl__Group__4__Impl rule__PayloadTypeDecl__Group__5 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2246:2: rule__PayloadTypeDecl__Group__4__Impl rule__PayloadTypeDecl__Group__5 - { - pushFollow(FOLLOW_rule__PayloadTypeDecl__Group__4__Impl_in_rule__PayloadTypeDecl__Group__44665); - rule__PayloadTypeDecl__Group__4__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__PayloadTypeDecl__Group__5_in_rule__PayloadTypeDecl__Group__44668); - rule__PayloadTypeDecl__Group__5(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__PayloadTypeDecl__Group__4" - - - // $ANTLR start "rule__PayloadTypeDecl__Group__4__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2253:1: rule__PayloadTypeDecl__Group__4__Impl : ( ( rule__PayloadTypeDecl__TypeAssignment_4 ) ) ; - public final void rule__PayloadTypeDecl__Group__4__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2257:1: ( ( ( rule__PayloadTypeDecl__TypeAssignment_4 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2258:1: ( ( rule__PayloadTypeDecl__TypeAssignment_4 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2258:1: ( ( rule__PayloadTypeDecl__TypeAssignment_4 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2259:1: ( rule__PayloadTypeDecl__TypeAssignment_4 ) - { - before(grammarAccess.getPayloadTypeDeclAccess().getTypeAssignment_4()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2260:1: ( rule__PayloadTypeDecl__TypeAssignment_4 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2260:2: rule__PayloadTypeDecl__TypeAssignment_4 - { - pushFollow(FOLLOW_rule__PayloadTypeDecl__TypeAssignment_4_in_rule__PayloadTypeDecl__Group__4__Impl4695); - rule__PayloadTypeDecl__TypeAssignment_4(); - - state._fsp--; - - - } - - after(grammarAccess.getPayloadTypeDeclAccess().getTypeAssignment_4()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__PayloadTypeDecl__Group__4__Impl" - - - // $ANTLR start "rule__PayloadTypeDecl__Group__5" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2270:1: rule__PayloadTypeDecl__Group__5 : rule__PayloadTypeDecl__Group__5__Impl rule__PayloadTypeDecl__Group__6 ; - public final void rule__PayloadTypeDecl__Group__5() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2274:1: ( rule__PayloadTypeDecl__Group__5__Impl rule__PayloadTypeDecl__Group__6 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2275:2: rule__PayloadTypeDecl__Group__5__Impl rule__PayloadTypeDecl__Group__6 - { - pushFollow(FOLLOW_rule__PayloadTypeDecl__Group__5__Impl_in_rule__PayloadTypeDecl__Group__54725); - rule__PayloadTypeDecl__Group__5__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__PayloadTypeDecl__Group__6_in_rule__PayloadTypeDecl__Group__54728); - rule__PayloadTypeDecl__Group__6(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__PayloadTypeDecl__Group__5" - - - // $ANTLR start "rule__PayloadTypeDecl__Group__5__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2282:1: rule__PayloadTypeDecl__Group__5__Impl : ( 'from' ) ; - public final void rule__PayloadTypeDecl__Group__5__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2286:1: ( ( 'from' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2287:1: ( 'from' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2287:1: ( 'from' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2288:1: 'from' - { - before(grammarAccess.getPayloadTypeDeclAccess().getFromKeyword_5()); - match(input,16,FOLLOW_16_in_rule__PayloadTypeDecl__Group__5__Impl4756); - after(grammarAccess.getPayloadTypeDeclAccess().getFromKeyword_5()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__PayloadTypeDecl__Group__5__Impl" - - - // $ANTLR start "rule__PayloadTypeDecl__Group__6" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2301:1: rule__PayloadTypeDecl__Group__6 : rule__PayloadTypeDecl__Group__6__Impl rule__PayloadTypeDecl__Group__7 ; - public final void rule__PayloadTypeDecl__Group__6() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2305:1: ( rule__PayloadTypeDecl__Group__6__Impl rule__PayloadTypeDecl__Group__7 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2306:2: rule__PayloadTypeDecl__Group__6__Impl rule__PayloadTypeDecl__Group__7 - { - pushFollow(FOLLOW_rule__PayloadTypeDecl__Group__6__Impl_in_rule__PayloadTypeDecl__Group__64787); - rule__PayloadTypeDecl__Group__6__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__PayloadTypeDecl__Group__7_in_rule__PayloadTypeDecl__Group__64790); - rule__PayloadTypeDecl__Group__7(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__PayloadTypeDecl__Group__6" - - - // $ANTLR start "rule__PayloadTypeDecl__Group__6__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2313:1: rule__PayloadTypeDecl__Group__6__Impl : ( ( rule__PayloadTypeDecl__LocationAssignment_6 ) ) ; - public final void rule__PayloadTypeDecl__Group__6__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2317:1: ( ( ( rule__PayloadTypeDecl__LocationAssignment_6 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2318:1: ( ( rule__PayloadTypeDecl__LocationAssignment_6 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2318:1: ( ( rule__PayloadTypeDecl__LocationAssignment_6 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2319:1: ( rule__PayloadTypeDecl__LocationAssignment_6 ) - { - before(grammarAccess.getPayloadTypeDeclAccess().getLocationAssignment_6()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2320:1: ( rule__PayloadTypeDecl__LocationAssignment_6 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2320:2: rule__PayloadTypeDecl__LocationAssignment_6 - { - pushFollow(FOLLOW_rule__PayloadTypeDecl__LocationAssignment_6_in_rule__PayloadTypeDecl__Group__6__Impl4817); - rule__PayloadTypeDecl__LocationAssignment_6(); - - state._fsp--; - - - } - - after(grammarAccess.getPayloadTypeDeclAccess().getLocationAssignment_6()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__PayloadTypeDecl__Group__6__Impl" - - - // $ANTLR start "rule__PayloadTypeDecl__Group__7" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2330:1: rule__PayloadTypeDecl__Group__7 : rule__PayloadTypeDecl__Group__7__Impl rule__PayloadTypeDecl__Group__8 ; - public final void rule__PayloadTypeDecl__Group__7() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2334:1: ( rule__PayloadTypeDecl__Group__7__Impl rule__PayloadTypeDecl__Group__8 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2335:2: rule__PayloadTypeDecl__Group__7__Impl rule__PayloadTypeDecl__Group__8 - { - pushFollow(FOLLOW_rule__PayloadTypeDecl__Group__7__Impl_in_rule__PayloadTypeDecl__Group__74847); - rule__PayloadTypeDecl__Group__7__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__PayloadTypeDecl__Group__8_in_rule__PayloadTypeDecl__Group__74850); - rule__PayloadTypeDecl__Group__8(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__PayloadTypeDecl__Group__7" - - - // $ANTLR start "rule__PayloadTypeDecl__Group__7__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2342:1: rule__PayloadTypeDecl__Group__7__Impl : ( 'as' ) ; - public final void rule__PayloadTypeDecl__Group__7__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2346:1: ( ( 'as' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2347:1: ( 'as' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2347:1: ( 'as' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2348:1: 'as' - { - before(grammarAccess.getPayloadTypeDeclAccess().getAsKeyword_7()); - match(input,15,FOLLOW_15_in_rule__PayloadTypeDecl__Group__7__Impl4878); - after(grammarAccess.getPayloadTypeDeclAccess().getAsKeyword_7()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__PayloadTypeDecl__Group__7__Impl" - - - // $ANTLR start "rule__PayloadTypeDecl__Group__8" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2361:1: rule__PayloadTypeDecl__Group__8 : rule__PayloadTypeDecl__Group__8__Impl rule__PayloadTypeDecl__Group__9 ; - public final void rule__PayloadTypeDecl__Group__8() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2365:1: ( rule__PayloadTypeDecl__Group__8__Impl rule__PayloadTypeDecl__Group__9 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2366:2: rule__PayloadTypeDecl__Group__8__Impl rule__PayloadTypeDecl__Group__9 - { - pushFollow(FOLLOW_rule__PayloadTypeDecl__Group__8__Impl_in_rule__PayloadTypeDecl__Group__84909); - rule__PayloadTypeDecl__Group__8__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__PayloadTypeDecl__Group__9_in_rule__PayloadTypeDecl__Group__84912); - rule__PayloadTypeDecl__Group__9(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__PayloadTypeDecl__Group__8" - - - // $ANTLR start "rule__PayloadTypeDecl__Group__8__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2373:1: rule__PayloadTypeDecl__Group__8__Impl : ( ( rule__PayloadTypeDecl__AliasAssignment_8 ) ) ; - public final void rule__PayloadTypeDecl__Group__8__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2377:1: ( ( ( rule__PayloadTypeDecl__AliasAssignment_8 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2378:1: ( ( rule__PayloadTypeDecl__AliasAssignment_8 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2378:1: ( ( rule__PayloadTypeDecl__AliasAssignment_8 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2379:1: ( rule__PayloadTypeDecl__AliasAssignment_8 ) - { - before(grammarAccess.getPayloadTypeDeclAccess().getAliasAssignment_8()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2380:1: ( rule__PayloadTypeDecl__AliasAssignment_8 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2380:2: rule__PayloadTypeDecl__AliasAssignment_8 - { - pushFollow(FOLLOW_rule__PayloadTypeDecl__AliasAssignment_8_in_rule__PayloadTypeDecl__Group__8__Impl4939); - rule__PayloadTypeDecl__AliasAssignment_8(); - - state._fsp--; - - - } - - after(grammarAccess.getPayloadTypeDeclAccess().getAliasAssignment_8()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__PayloadTypeDecl__Group__8__Impl" - - - // $ANTLR start "rule__PayloadTypeDecl__Group__9" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2390:1: rule__PayloadTypeDecl__Group__9 : rule__PayloadTypeDecl__Group__9__Impl ; - public final void rule__PayloadTypeDecl__Group__9() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2394:1: ( rule__PayloadTypeDecl__Group__9__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2395:2: rule__PayloadTypeDecl__Group__9__Impl - { - pushFollow(FOLLOW_rule__PayloadTypeDecl__Group__9__Impl_in_rule__PayloadTypeDecl__Group__94969); - rule__PayloadTypeDecl__Group__9__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__PayloadTypeDecl__Group__9" - - - // $ANTLR start "rule__PayloadTypeDecl__Group__9__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2401:1: rule__PayloadTypeDecl__Group__9__Impl : ( ';' ) ; - public final void rule__PayloadTypeDecl__Group__9__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2405:1: ( ( ';' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2406:1: ( ';' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2406:1: ( ';' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2407:1: ';' - { - before(grammarAccess.getPayloadTypeDeclAccess().getSemicolonKeyword_9()); - match(input,12,FOLLOW_12_in_rule__PayloadTypeDecl__Group__9__Impl4997); - after(grammarAccess.getPayloadTypeDeclAccess().getSemicolonKeyword_9()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__PayloadTypeDecl__Group__9__Impl" - - - // $ANTLR start "rule__MessageSignature__Group__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2440:1: rule__MessageSignature__Group__0 : rule__MessageSignature__Group__0__Impl rule__MessageSignature__Group__1 ; - public final void rule__MessageSignature__Group__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2444:1: ( rule__MessageSignature__Group__0__Impl rule__MessageSignature__Group__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2445:2: rule__MessageSignature__Group__0__Impl rule__MessageSignature__Group__1 - { - pushFollow(FOLLOW_rule__MessageSignature__Group__0__Impl_in_rule__MessageSignature__Group__05048); - rule__MessageSignature__Group__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__MessageSignature__Group__1_in_rule__MessageSignature__Group__05051); - rule__MessageSignature__Group__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__MessageSignature__Group__0" - - - // $ANTLR start "rule__MessageSignature__Group__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2452:1: rule__MessageSignature__Group__0__Impl : ( () ) ; - public final void rule__MessageSignature__Group__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2456:1: ( ( () ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2457:1: ( () ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2457:1: ( () ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2458:1: () - { - before(grammarAccess.getMessageSignatureAccess().getMessageSignatureAction_0()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2459:1: () - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2461:1: - { - } - - after(grammarAccess.getMessageSignatureAccess().getMessageSignatureAction_0()); - - } - - - } - - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__MessageSignature__Group__0__Impl" - - - // $ANTLR start "rule__MessageSignature__Group__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2471:1: rule__MessageSignature__Group__1 : rule__MessageSignature__Group__1__Impl rule__MessageSignature__Group__2 ; - public final void rule__MessageSignature__Group__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2475:1: ( rule__MessageSignature__Group__1__Impl rule__MessageSignature__Group__2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2476:2: rule__MessageSignature__Group__1__Impl rule__MessageSignature__Group__2 - { - pushFollow(FOLLOW_rule__MessageSignature__Group__1__Impl_in_rule__MessageSignature__Group__15109); - rule__MessageSignature__Group__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__MessageSignature__Group__2_in_rule__MessageSignature__Group__15112); - rule__MessageSignature__Group__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__MessageSignature__Group__1" - - - // $ANTLR start "rule__MessageSignature__Group__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2483:1: rule__MessageSignature__Group__1__Impl : ( ( rule__MessageSignature__OperatorAssignment_1 )? ) ; - public final void rule__MessageSignature__Group__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2487:1: ( ( ( rule__MessageSignature__OperatorAssignment_1 )? ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2488:1: ( ( rule__MessageSignature__OperatorAssignment_1 )? ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2488:1: ( ( rule__MessageSignature__OperatorAssignment_1 )? ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2489:1: ( rule__MessageSignature__OperatorAssignment_1 )? - { - before(grammarAccess.getMessageSignatureAccess().getOperatorAssignment_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2490:1: ( rule__MessageSignature__OperatorAssignment_1 )? - int alt16=2; - int LA16_0 = input.LA(1); - - if ( (LA16_0==RULE_ID) ) { - alt16=1; - } - switch (alt16) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2490:2: rule__MessageSignature__OperatorAssignment_1 - { - pushFollow(FOLLOW_rule__MessageSignature__OperatorAssignment_1_in_rule__MessageSignature__Group__1__Impl5139); - rule__MessageSignature__OperatorAssignment_1(); - - state._fsp--; - - - } - break; - - } - - after(grammarAccess.getMessageSignatureAccess().getOperatorAssignment_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__MessageSignature__Group__1__Impl" - - - // $ANTLR start "rule__MessageSignature__Group__2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2500:1: rule__MessageSignature__Group__2 : rule__MessageSignature__Group__2__Impl rule__MessageSignature__Group__3 ; - public final void rule__MessageSignature__Group__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2504:1: ( rule__MessageSignature__Group__2__Impl rule__MessageSignature__Group__3 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2505:2: rule__MessageSignature__Group__2__Impl rule__MessageSignature__Group__3 - { - pushFollow(FOLLOW_rule__MessageSignature__Group__2__Impl_in_rule__MessageSignature__Group__25170); - rule__MessageSignature__Group__2__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__MessageSignature__Group__3_in_rule__MessageSignature__Group__25173); - rule__MessageSignature__Group__3(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__MessageSignature__Group__2" - - - // $ANTLR start "rule__MessageSignature__Group__2__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2512:1: rule__MessageSignature__Group__2__Impl : ( '(' ) ; - public final void rule__MessageSignature__Group__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2516:1: ( ( '(' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2517:1: ( '(' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2517:1: ( '(' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2518:1: '(' - { - before(grammarAccess.getMessageSignatureAccess().getLeftParenthesisKeyword_2()); - match(input,20,FOLLOW_20_in_rule__MessageSignature__Group__2__Impl5201); - after(grammarAccess.getMessageSignatureAccess().getLeftParenthesisKeyword_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__MessageSignature__Group__2__Impl" - - - // $ANTLR start "rule__MessageSignature__Group__3" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2531:1: rule__MessageSignature__Group__3 : rule__MessageSignature__Group__3__Impl rule__MessageSignature__Group__4 ; - public final void rule__MessageSignature__Group__3() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2535:1: ( rule__MessageSignature__Group__3__Impl rule__MessageSignature__Group__4 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2536:2: rule__MessageSignature__Group__3__Impl rule__MessageSignature__Group__4 - { - pushFollow(FOLLOW_rule__MessageSignature__Group__3__Impl_in_rule__MessageSignature__Group__35232); - rule__MessageSignature__Group__3__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__MessageSignature__Group__4_in_rule__MessageSignature__Group__35235); - rule__MessageSignature__Group__4(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__MessageSignature__Group__3" - - - // $ANTLR start "rule__MessageSignature__Group__3__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2543:1: rule__MessageSignature__Group__3__Impl : ( ( rule__MessageSignature__Group_3__0 )? ) ; - public final void rule__MessageSignature__Group__3__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2547:1: ( ( ( rule__MessageSignature__Group_3__0 )? ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2548:1: ( ( rule__MessageSignature__Group_3__0 )? ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2548:1: ( ( rule__MessageSignature__Group_3__0 )? ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2549:1: ( rule__MessageSignature__Group_3__0 )? - { - before(grammarAccess.getMessageSignatureAccess().getGroup_3()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2550:1: ( rule__MessageSignature__Group_3__0 )? - int alt17=2; - int LA17_0 = input.LA(1); - - if ( (LA17_0==RULE_ID) ) { - alt17=1; - } - switch (alt17) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2550:2: rule__MessageSignature__Group_3__0 - { - pushFollow(FOLLOW_rule__MessageSignature__Group_3__0_in_rule__MessageSignature__Group__3__Impl5262); - rule__MessageSignature__Group_3__0(); - - state._fsp--; - - - } - break; - - } - - after(grammarAccess.getMessageSignatureAccess().getGroup_3()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__MessageSignature__Group__3__Impl" - - - // $ANTLR start "rule__MessageSignature__Group__4" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2560:1: rule__MessageSignature__Group__4 : rule__MessageSignature__Group__4__Impl ; - public final void rule__MessageSignature__Group__4() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2564:1: ( rule__MessageSignature__Group__4__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2565:2: rule__MessageSignature__Group__4__Impl - { - pushFollow(FOLLOW_rule__MessageSignature__Group__4__Impl_in_rule__MessageSignature__Group__45293); - rule__MessageSignature__Group__4__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__MessageSignature__Group__4" - - - // $ANTLR start "rule__MessageSignature__Group__4__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2571:1: rule__MessageSignature__Group__4__Impl : ( ')' ) ; - public final void rule__MessageSignature__Group__4__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2575:1: ( ( ')' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2576:1: ( ')' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2576:1: ( ')' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2577:1: ')' - { - before(grammarAccess.getMessageSignatureAccess().getRightParenthesisKeyword_4()); - match(input,21,FOLLOW_21_in_rule__MessageSignature__Group__4__Impl5321); - after(grammarAccess.getMessageSignatureAccess().getRightParenthesisKeyword_4()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__MessageSignature__Group__4__Impl" - - - // $ANTLR start "rule__MessageSignature__Group_3__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2600:1: rule__MessageSignature__Group_3__0 : rule__MessageSignature__Group_3__0__Impl rule__MessageSignature__Group_3__1 ; - public final void rule__MessageSignature__Group_3__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2604:1: ( rule__MessageSignature__Group_3__0__Impl rule__MessageSignature__Group_3__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2605:2: rule__MessageSignature__Group_3__0__Impl rule__MessageSignature__Group_3__1 - { - pushFollow(FOLLOW_rule__MessageSignature__Group_3__0__Impl_in_rule__MessageSignature__Group_3__05362); - rule__MessageSignature__Group_3__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__MessageSignature__Group_3__1_in_rule__MessageSignature__Group_3__05365); - rule__MessageSignature__Group_3__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__MessageSignature__Group_3__0" - - - // $ANTLR start "rule__MessageSignature__Group_3__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2612:1: rule__MessageSignature__Group_3__0__Impl : ( ( rule__MessageSignature__TypesAssignment_3_0 ) ) ; - public final void rule__MessageSignature__Group_3__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2616:1: ( ( ( rule__MessageSignature__TypesAssignment_3_0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2617:1: ( ( rule__MessageSignature__TypesAssignment_3_0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2617:1: ( ( rule__MessageSignature__TypesAssignment_3_0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2618:1: ( rule__MessageSignature__TypesAssignment_3_0 ) - { - before(grammarAccess.getMessageSignatureAccess().getTypesAssignment_3_0()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2619:1: ( rule__MessageSignature__TypesAssignment_3_0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2619:2: rule__MessageSignature__TypesAssignment_3_0 - { - pushFollow(FOLLOW_rule__MessageSignature__TypesAssignment_3_0_in_rule__MessageSignature__Group_3__0__Impl5392); - rule__MessageSignature__TypesAssignment_3_0(); - - state._fsp--; - - - } - - after(grammarAccess.getMessageSignatureAccess().getTypesAssignment_3_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__MessageSignature__Group_3__0__Impl" - - - // $ANTLR start "rule__MessageSignature__Group_3__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2629:1: rule__MessageSignature__Group_3__1 : rule__MessageSignature__Group_3__1__Impl ; - public final void rule__MessageSignature__Group_3__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2633:1: ( rule__MessageSignature__Group_3__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2634:2: rule__MessageSignature__Group_3__1__Impl - { - pushFollow(FOLLOW_rule__MessageSignature__Group_3__1__Impl_in_rule__MessageSignature__Group_3__15422); - rule__MessageSignature__Group_3__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__MessageSignature__Group_3__1" - - - // $ANTLR start "rule__MessageSignature__Group_3__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2640:1: rule__MessageSignature__Group_3__1__Impl : ( ( rule__MessageSignature__Group_3_1__0 )* ) ; - public final void rule__MessageSignature__Group_3__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2644:1: ( ( ( rule__MessageSignature__Group_3_1__0 )* ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2645:1: ( ( rule__MessageSignature__Group_3_1__0 )* ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2645:1: ( ( rule__MessageSignature__Group_3_1__0 )* ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2646:1: ( rule__MessageSignature__Group_3_1__0 )* - { - before(grammarAccess.getMessageSignatureAccess().getGroup_3_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2647:1: ( rule__MessageSignature__Group_3_1__0 )* - loop18: - do { - int alt18=2; - int LA18_0 = input.LA(1); - - if ( (LA18_0==22) ) { - alt18=1; - } - - - switch (alt18) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2647:2: rule__MessageSignature__Group_3_1__0 - { - pushFollow(FOLLOW_rule__MessageSignature__Group_3_1__0_in_rule__MessageSignature__Group_3__1__Impl5449); - rule__MessageSignature__Group_3_1__0(); - - state._fsp--; - - - } - break; - - default : - break loop18; - } - } while (true); - - after(grammarAccess.getMessageSignatureAccess().getGroup_3_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__MessageSignature__Group_3__1__Impl" - - - // $ANTLR start "rule__MessageSignature__Group_3_1__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2661:1: rule__MessageSignature__Group_3_1__0 : rule__MessageSignature__Group_3_1__0__Impl rule__MessageSignature__Group_3_1__1 ; - public final void rule__MessageSignature__Group_3_1__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2665:1: ( rule__MessageSignature__Group_3_1__0__Impl rule__MessageSignature__Group_3_1__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2666:2: rule__MessageSignature__Group_3_1__0__Impl rule__MessageSignature__Group_3_1__1 - { - pushFollow(FOLLOW_rule__MessageSignature__Group_3_1__0__Impl_in_rule__MessageSignature__Group_3_1__05484); - rule__MessageSignature__Group_3_1__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__MessageSignature__Group_3_1__1_in_rule__MessageSignature__Group_3_1__05487); - rule__MessageSignature__Group_3_1__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__MessageSignature__Group_3_1__0" - - - // $ANTLR start "rule__MessageSignature__Group_3_1__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2673:1: rule__MessageSignature__Group_3_1__0__Impl : ( ',' ) ; - public final void rule__MessageSignature__Group_3_1__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2677:1: ( ( ',' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2678:1: ( ',' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2678:1: ( ',' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2679:1: ',' - { - before(grammarAccess.getMessageSignatureAccess().getCommaKeyword_3_1_0()); - match(input,22,FOLLOW_22_in_rule__MessageSignature__Group_3_1__0__Impl5515); - after(grammarAccess.getMessageSignatureAccess().getCommaKeyword_3_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__MessageSignature__Group_3_1__0__Impl" - - - // $ANTLR start "rule__MessageSignature__Group_3_1__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2692:1: rule__MessageSignature__Group_3_1__1 : rule__MessageSignature__Group_3_1__1__Impl ; - public final void rule__MessageSignature__Group_3_1__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2696:1: ( rule__MessageSignature__Group_3_1__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2697:2: rule__MessageSignature__Group_3_1__1__Impl - { - pushFollow(FOLLOW_rule__MessageSignature__Group_3_1__1__Impl_in_rule__MessageSignature__Group_3_1__15546); - rule__MessageSignature__Group_3_1__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__MessageSignature__Group_3_1__1" - - - // $ANTLR start "rule__MessageSignature__Group_3_1__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2703:1: rule__MessageSignature__Group_3_1__1__Impl : ( ( rule__MessageSignature__TypesAssignment_3_1_1 ) ) ; - public final void rule__MessageSignature__Group_3_1__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2707:1: ( ( ( rule__MessageSignature__TypesAssignment_3_1_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2708:1: ( ( rule__MessageSignature__TypesAssignment_3_1_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2708:1: ( ( rule__MessageSignature__TypesAssignment_3_1_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2709:1: ( rule__MessageSignature__TypesAssignment_3_1_1 ) - { - before(grammarAccess.getMessageSignatureAccess().getTypesAssignment_3_1_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2710:1: ( rule__MessageSignature__TypesAssignment_3_1_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2710:2: rule__MessageSignature__TypesAssignment_3_1_1 - { - pushFollow(FOLLOW_rule__MessageSignature__TypesAssignment_3_1_1_in_rule__MessageSignature__Group_3_1__1__Impl5573); - rule__MessageSignature__TypesAssignment_3_1_1(); - - state._fsp--; - - - } - - after(grammarAccess.getMessageSignatureAccess().getTypesAssignment_3_1_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__MessageSignature__Group_3_1__1__Impl" - - - // $ANTLR start "rule__PayloadElement__Group__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2724:1: rule__PayloadElement__Group__0 : rule__PayloadElement__Group__0__Impl rule__PayloadElement__Group__1 ; - public final void rule__PayloadElement__Group__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2728:1: ( rule__PayloadElement__Group__0__Impl rule__PayloadElement__Group__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2729:2: rule__PayloadElement__Group__0__Impl rule__PayloadElement__Group__1 - { - pushFollow(FOLLOW_rule__PayloadElement__Group__0__Impl_in_rule__PayloadElement__Group__05607); - rule__PayloadElement__Group__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__PayloadElement__Group__1_in_rule__PayloadElement__Group__05610); - rule__PayloadElement__Group__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__PayloadElement__Group__0" - - - // $ANTLR start "rule__PayloadElement__Group__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2736:1: rule__PayloadElement__Group__0__Impl : ( ( rule__PayloadElement__Group_0__0 )? ) ; - public final void rule__PayloadElement__Group__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2740:1: ( ( ( rule__PayloadElement__Group_0__0 )? ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2741:1: ( ( rule__PayloadElement__Group_0__0 )? ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2741:1: ( ( rule__PayloadElement__Group_0__0 )? ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2742:1: ( rule__PayloadElement__Group_0__0 )? - { - before(grammarAccess.getPayloadElementAccess().getGroup_0()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2743:1: ( rule__PayloadElement__Group_0__0 )? - int alt19=2; - int LA19_0 = input.LA(1); - - if ( (LA19_0==RULE_ID) ) { - int LA19_1 = input.LA(2); - - if ( (LA19_1==23) ) { - alt19=1; - } - } - switch (alt19) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2743:2: rule__PayloadElement__Group_0__0 - { - pushFollow(FOLLOW_rule__PayloadElement__Group_0__0_in_rule__PayloadElement__Group__0__Impl5637); - rule__PayloadElement__Group_0__0(); - - state._fsp--; - - - } - break; - - } - - after(grammarAccess.getPayloadElementAccess().getGroup_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__PayloadElement__Group__0__Impl" - - - // $ANTLR start "rule__PayloadElement__Group__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2753:1: rule__PayloadElement__Group__1 : rule__PayloadElement__Group__1__Impl ; - public final void rule__PayloadElement__Group__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2757:1: ( rule__PayloadElement__Group__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2758:2: rule__PayloadElement__Group__1__Impl - { - pushFollow(FOLLOW_rule__PayloadElement__Group__1__Impl_in_rule__PayloadElement__Group__15668); - rule__PayloadElement__Group__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__PayloadElement__Group__1" - - - // $ANTLR start "rule__PayloadElement__Group__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2764:1: rule__PayloadElement__Group__1__Impl : ( ( rule__PayloadElement__TypeAssignment_1 ) ) ; - public final void rule__PayloadElement__Group__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2768:1: ( ( ( rule__PayloadElement__TypeAssignment_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2769:1: ( ( rule__PayloadElement__TypeAssignment_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2769:1: ( ( rule__PayloadElement__TypeAssignment_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2770:1: ( rule__PayloadElement__TypeAssignment_1 ) - { - before(grammarAccess.getPayloadElementAccess().getTypeAssignment_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2771:1: ( rule__PayloadElement__TypeAssignment_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2771:2: rule__PayloadElement__TypeAssignment_1 - { - pushFollow(FOLLOW_rule__PayloadElement__TypeAssignment_1_in_rule__PayloadElement__Group__1__Impl5695); - rule__PayloadElement__TypeAssignment_1(); - - state._fsp--; - - - } - - after(grammarAccess.getPayloadElementAccess().getTypeAssignment_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__PayloadElement__Group__1__Impl" - - - // $ANTLR start "rule__PayloadElement__Group_0__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2785:1: rule__PayloadElement__Group_0__0 : rule__PayloadElement__Group_0__0__Impl rule__PayloadElement__Group_0__1 ; - public final void rule__PayloadElement__Group_0__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2789:1: ( rule__PayloadElement__Group_0__0__Impl rule__PayloadElement__Group_0__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2790:2: rule__PayloadElement__Group_0__0__Impl rule__PayloadElement__Group_0__1 - { - pushFollow(FOLLOW_rule__PayloadElement__Group_0__0__Impl_in_rule__PayloadElement__Group_0__05729); - rule__PayloadElement__Group_0__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__PayloadElement__Group_0__1_in_rule__PayloadElement__Group_0__05732); - rule__PayloadElement__Group_0__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__PayloadElement__Group_0__0" - - - // $ANTLR start "rule__PayloadElement__Group_0__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2797:1: rule__PayloadElement__Group_0__0__Impl : ( ( rule__PayloadElement__NameAssignment_0_0 ) ) ; - public final void rule__PayloadElement__Group_0__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2801:1: ( ( ( rule__PayloadElement__NameAssignment_0_0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2802:1: ( ( rule__PayloadElement__NameAssignment_0_0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2802:1: ( ( rule__PayloadElement__NameAssignment_0_0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2803:1: ( rule__PayloadElement__NameAssignment_0_0 ) - { - before(grammarAccess.getPayloadElementAccess().getNameAssignment_0_0()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2804:1: ( rule__PayloadElement__NameAssignment_0_0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2804:2: rule__PayloadElement__NameAssignment_0_0 - { - pushFollow(FOLLOW_rule__PayloadElement__NameAssignment_0_0_in_rule__PayloadElement__Group_0__0__Impl5759); - rule__PayloadElement__NameAssignment_0_0(); - - state._fsp--; - - - } - - after(grammarAccess.getPayloadElementAccess().getNameAssignment_0_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__PayloadElement__Group_0__0__Impl" - - - // $ANTLR start "rule__PayloadElement__Group_0__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2814:1: rule__PayloadElement__Group_0__1 : rule__PayloadElement__Group_0__1__Impl ; - public final void rule__PayloadElement__Group_0__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2818:1: ( rule__PayloadElement__Group_0__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2819:2: rule__PayloadElement__Group_0__1__Impl - { - pushFollow(FOLLOW_rule__PayloadElement__Group_0__1__Impl_in_rule__PayloadElement__Group_0__15789); - rule__PayloadElement__Group_0__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__PayloadElement__Group_0__1" - - - // $ANTLR start "rule__PayloadElement__Group_0__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2825:1: rule__PayloadElement__Group_0__1__Impl : ( ':' ) ; - public final void rule__PayloadElement__Group_0__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2829:1: ( ( ':' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2830:1: ( ':' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2830:1: ( ':' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2831:1: ':' - { - before(grammarAccess.getPayloadElementAccess().getColonKeyword_0_1()); - match(input,23,FOLLOW_23_in_rule__PayloadElement__Group_0__1__Impl5817); - after(grammarAccess.getPayloadElementAccess().getColonKeyword_0_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__PayloadElement__Group_0__1__Impl" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2848:1: rule__GlobalProtocolDecl__Group__0 : rule__GlobalProtocolDecl__Group__0__Impl rule__GlobalProtocolDecl__Group__1 ; - public final void rule__GlobalProtocolDecl__Group__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2852:1: ( rule__GlobalProtocolDecl__Group__0__Impl rule__GlobalProtocolDecl__Group__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2853:2: rule__GlobalProtocolDecl__Group__0__Impl rule__GlobalProtocolDecl__Group__1 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group__0__Impl_in_rule__GlobalProtocolDecl__Group__05852); - rule__GlobalProtocolDecl__Group__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group__1_in_rule__GlobalProtocolDecl__Group__05855); - rule__GlobalProtocolDecl__Group__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group__0" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2860:1: rule__GlobalProtocolDecl__Group__0__Impl : ( 'global' ) ; - public final void rule__GlobalProtocolDecl__Group__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2864:1: ( ( 'global' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2865:1: ( 'global' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2865:1: ( 'global' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2866:1: 'global' - { - before(grammarAccess.getGlobalProtocolDeclAccess().getGlobalKeyword_0()); - match(input,24,FOLLOW_24_in_rule__GlobalProtocolDecl__Group__0__Impl5883); - after(grammarAccess.getGlobalProtocolDeclAccess().getGlobalKeyword_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group__0__Impl" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2879:1: rule__GlobalProtocolDecl__Group__1 : rule__GlobalProtocolDecl__Group__1__Impl rule__GlobalProtocolDecl__Group__2 ; - public final void rule__GlobalProtocolDecl__Group__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2883:1: ( rule__GlobalProtocolDecl__Group__1__Impl rule__GlobalProtocolDecl__Group__2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2884:2: rule__GlobalProtocolDecl__Group__1__Impl rule__GlobalProtocolDecl__Group__2 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group__1__Impl_in_rule__GlobalProtocolDecl__Group__15914); - rule__GlobalProtocolDecl__Group__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group__2_in_rule__GlobalProtocolDecl__Group__15917); - rule__GlobalProtocolDecl__Group__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group__1" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2891:1: rule__GlobalProtocolDecl__Group__1__Impl : ( 'protocol' ) ; - public final void rule__GlobalProtocolDecl__Group__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2895:1: ( ( 'protocol' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2896:1: ( 'protocol' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2896:1: ( 'protocol' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2897:1: 'protocol' - { - before(grammarAccess.getGlobalProtocolDeclAccess().getProtocolKeyword_1()); - match(input,25,FOLLOW_25_in_rule__GlobalProtocolDecl__Group__1__Impl5945); - after(grammarAccess.getGlobalProtocolDeclAccess().getProtocolKeyword_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group__1__Impl" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group__2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2910:1: rule__GlobalProtocolDecl__Group__2 : rule__GlobalProtocolDecl__Group__2__Impl rule__GlobalProtocolDecl__Group__3 ; - public final void rule__GlobalProtocolDecl__Group__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2914:1: ( rule__GlobalProtocolDecl__Group__2__Impl rule__GlobalProtocolDecl__Group__3 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2915:2: rule__GlobalProtocolDecl__Group__2__Impl rule__GlobalProtocolDecl__Group__3 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group__2__Impl_in_rule__GlobalProtocolDecl__Group__25976); - rule__GlobalProtocolDecl__Group__2__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group__3_in_rule__GlobalProtocolDecl__Group__25979); - rule__GlobalProtocolDecl__Group__3(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group__2" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group__2__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2922:1: rule__GlobalProtocolDecl__Group__2__Impl : ( ( rule__GlobalProtocolDecl__NameAssignment_2 ) ) ; - public final void rule__GlobalProtocolDecl__Group__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2926:1: ( ( ( rule__GlobalProtocolDecl__NameAssignment_2 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2927:1: ( ( rule__GlobalProtocolDecl__NameAssignment_2 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2927:1: ( ( rule__GlobalProtocolDecl__NameAssignment_2 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2928:1: ( rule__GlobalProtocolDecl__NameAssignment_2 ) - { - before(grammarAccess.getGlobalProtocolDeclAccess().getNameAssignment_2()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2929:1: ( rule__GlobalProtocolDecl__NameAssignment_2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2929:2: rule__GlobalProtocolDecl__NameAssignment_2 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__NameAssignment_2_in_rule__GlobalProtocolDecl__Group__2__Impl6006); - rule__GlobalProtocolDecl__NameAssignment_2(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalProtocolDeclAccess().getNameAssignment_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group__2__Impl" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group__3" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2939:1: rule__GlobalProtocolDecl__Group__3 : rule__GlobalProtocolDecl__Group__3__Impl rule__GlobalProtocolDecl__Group__4 ; - public final void rule__GlobalProtocolDecl__Group__3() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2943:1: ( rule__GlobalProtocolDecl__Group__3__Impl rule__GlobalProtocolDecl__Group__4 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2944:2: rule__GlobalProtocolDecl__Group__3__Impl rule__GlobalProtocolDecl__Group__4 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group__3__Impl_in_rule__GlobalProtocolDecl__Group__36036); - rule__GlobalProtocolDecl__Group__3__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group__4_in_rule__GlobalProtocolDecl__Group__36039); - rule__GlobalProtocolDecl__Group__4(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group__3" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group__3__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2951:1: rule__GlobalProtocolDecl__Group__3__Impl : ( ( rule__GlobalProtocolDecl__Group_3__0 )? ) ; - public final void rule__GlobalProtocolDecl__Group__3__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2955:1: ( ( ( rule__GlobalProtocolDecl__Group_3__0 )? ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2956:1: ( ( rule__GlobalProtocolDecl__Group_3__0 )? ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2956:1: ( ( rule__GlobalProtocolDecl__Group_3__0 )? ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2957:1: ( rule__GlobalProtocolDecl__Group_3__0 )? - { - before(grammarAccess.getGlobalProtocolDeclAccess().getGroup_3()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2958:1: ( rule__GlobalProtocolDecl__Group_3__0 )? - int alt20=2; - int LA20_0 = input.LA(1); - - if ( (LA20_0==18) ) { - alt20=1; - } - switch (alt20) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2958:2: rule__GlobalProtocolDecl__Group_3__0 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_3__0_in_rule__GlobalProtocolDecl__Group__3__Impl6066); - rule__GlobalProtocolDecl__Group_3__0(); - - state._fsp--; - - - } - break; - - } - - after(grammarAccess.getGlobalProtocolDeclAccess().getGroup_3()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group__3__Impl" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group__4" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2968:1: rule__GlobalProtocolDecl__Group__4 : rule__GlobalProtocolDecl__Group__4__Impl rule__GlobalProtocolDecl__Group__5 ; - public final void rule__GlobalProtocolDecl__Group__4() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2972:1: ( rule__GlobalProtocolDecl__Group__4__Impl rule__GlobalProtocolDecl__Group__5 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2973:2: rule__GlobalProtocolDecl__Group__4__Impl rule__GlobalProtocolDecl__Group__5 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group__4__Impl_in_rule__GlobalProtocolDecl__Group__46097); - rule__GlobalProtocolDecl__Group__4__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group__5_in_rule__GlobalProtocolDecl__Group__46100); - rule__GlobalProtocolDecl__Group__5(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group__4" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group__4__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2980:1: rule__GlobalProtocolDecl__Group__4__Impl : ( '(' ) ; - public final void rule__GlobalProtocolDecl__Group__4__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2984:1: ( ( '(' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2985:1: ( '(' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2985:1: ( '(' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2986:1: '(' - { - before(grammarAccess.getGlobalProtocolDeclAccess().getLeftParenthesisKeyword_4()); - match(input,20,FOLLOW_20_in_rule__GlobalProtocolDecl__Group__4__Impl6128); - after(grammarAccess.getGlobalProtocolDeclAccess().getLeftParenthesisKeyword_4()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group__4__Impl" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group__5" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:2999:1: rule__GlobalProtocolDecl__Group__5 : rule__GlobalProtocolDecl__Group__5__Impl rule__GlobalProtocolDecl__Group__6 ; - public final void rule__GlobalProtocolDecl__Group__5() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3003:1: ( rule__GlobalProtocolDecl__Group__5__Impl rule__GlobalProtocolDecl__Group__6 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3004:2: rule__GlobalProtocolDecl__Group__5__Impl rule__GlobalProtocolDecl__Group__6 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group__5__Impl_in_rule__GlobalProtocolDecl__Group__56159); - rule__GlobalProtocolDecl__Group__5__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group__6_in_rule__GlobalProtocolDecl__Group__56162); - rule__GlobalProtocolDecl__Group__6(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group__5" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group__5__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3011:1: rule__GlobalProtocolDecl__Group__5__Impl : ( ( rule__GlobalProtocolDecl__RolesAssignment_5 ) ) ; - public final void rule__GlobalProtocolDecl__Group__5__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3015:1: ( ( ( rule__GlobalProtocolDecl__RolesAssignment_5 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3016:1: ( ( rule__GlobalProtocolDecl__RolesAssignment_5 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3016:1: ( ( rule__GlobalProtocolDecl__RolesAssignment_5 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3017:1: ( rule__GlobalProtocolDecl__RolesAssignment_5 ) - { - before(grammarAccess.getGlobalProtocolDeclAccess().getRolesAssignment_5()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3018:1: ( rule__GlobalProtocolDecl__RolesAssignment_5 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3018:2: rule__GlobalProtocolDecl__RolesAssignment_5 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__RolesAssignment_5_in_rule__GlobalProtocolDecl__Group__5__Impl6189); - rule__GlobalProtocolDecl__RolesAssignment_5(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalProtocolDeclAccess().getRolesAssignment_5()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group__5__Impl" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group__6" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3028:1: rule__GlobalProtocolDecl__Group__6 : rule__GlobalProtocolDecl__Group__6__Impl rule__GlobalProtocolDecl__Group__7 ; - public final void rule__GlobalProtocolDecl__Group__6() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3032:1: ( rule__GlobalProtocolDecl__Group__6__Impl rule__GlobalProtocolDecl__Group__7 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3033:2: rule__GlobalProtocolDecl__Group__6__Impl rule__GlobalProtocolDecl__Group__7 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group__6__Impl_in_rule__GlobalProtocolDecl__Group__66219); - rule__GlobalProtocolDecl__Group__6__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group__7_in_rule__GlobalProtocolDecl__Group__66222); - rule__GlobalProtocolDecl__Group__7(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group__6" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group__6__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3040:1: rule__GlobalProtocolDecl__Group__6__Impl : ( ( rule__GlobalProtocolDecl__Group_6__0 )* ) ; - public final void rule__GlobalProtocolDecl__Group__6__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3044:1: ( ( ( rule__GlobalProtocolDecl__Group_6__0 )* ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3045:1: ( ( rule__GlobalProtocolDecl__Group_6__0 )* ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3045:1: ( ( rule__GlobalProtocolDecl__Group_6__0 )* ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3046:1: ( rule__GlobalProtocolDecl__Group_6__0 )* - { - before(grammarAccess.getGlobalProtocolDeclAccess().getGroup_6()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3047:1: ( rule__GlobalProtocolDecl__Group_6__0 )* - loop21: - do { - int alt21=2; - int LA21_0 = input.LA(1); - - if ( (LA21_0==22) ) { - alt21=1; - } - - - switch (alt21) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3047:2: rule__GlobalProtocolDecl__Group_6__0 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_6__0_in_rule__GlobalProtocolDecl__Group__6__Impl6249); - rule__GlobalProtocolDecl__Group_6__0(); - - state._fsp--; - - - } - break; - - default : - break loop21; - } - } while (true); - - after(grammarAccess.getGlobalProtocolDeclAccess().getGroup_6()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group__6__Impl" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group__7" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3057:1: rule__GlobalProtocolDecl__Group__7 : rule__GlobalProtocolDecl__Group__7__Impl rule__GlobalProtocolDecl__Group__8 ; - public final void rule__GlobalProtocolDecl__Group__7() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3061:1: ( rule__GlobalProtocolDecl__Group__7__Impl rule__GlobalProtocolDecl__Group__8 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3062:2: rule__GlobalProtocolDecl__Group__7__Impl rule__GlobalProtocolDecl__Group__8 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group__7__Impl_in_rule__GlobalProtocolDecl__Group__76280); - rule__GlobalProtocolDecl__Group__7__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group__8_in_rule__GlobalProtocolDecl__Group__76283); - rule__GlobalProtocolDecl__Group__8(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group__7" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group__7__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3069:1: rule__GlobalProtocolDecl__Group__7__Impl : ( ')' ) ; - public final void rule__GlobalProtocolDecl__Group__7__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3073:1: ( ( ')' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3074:1: ( ')' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3074:1: ( ')' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3075:1: ')' - { - before(grammarAccess.getGlobalProtocolDeclAccess().getRightParenthesisKeyword_7()); - match(input,21,FOLLOW_21_in_rule__GlobalProtocolDecl__Group__7__Impl6311); - after(grammarAccess.getGlobalProtocolDeclAccess().getRightParenthesisKeyword_7()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group__7__Impl" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group__8" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3088:1: rule__GlobalProtocolDecl__Group__8 : rule__GlobalProtocolDecl__Group__8__Impl ; - public final void rule__GlobalProtocolDecl__Group__8() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3092:1: ( rule__GlobalProtocolDecl__Group__8__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3093:2: rule__GlobalProtocolDecl__Group__8__Impl - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group__8__Impl_in_rule__GlobalProtocolDecl__Group__86342); - rule__GlobalProtocolDecl__Group__8__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group__8" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group__8__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3099:1: rule__GlobalProtocolDecl__Group__8__Impl : ( ( rule__GlobalProtocolDecl__Alternatives_8 ) ) ; - public final void rule__GlobalProtocolDecl__Group__8__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3103:1: ( ( ( rule__GlobalProtocolDecl__Alternatives_8 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3104:1: ( ( rule__GlobalProtocolDecl__Alternatives_8 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3104:1: ( ( rule__GlobalProtocolDecl__Alternatives_8 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3105:1: ( rule__GlobalProtocolDecl__Alternatives_8 ) - { - before(grammarAccess.getGlobalProtocolDeclAccess().getAlternatives_8()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3106:1: ( rule__GlobalProtocolDecl__Alternatives_8 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3106:2: rule__GlobalProtocolDecl__Alternatives_8 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Alternatives_8_in_rule__GlobalProtocolDecl__Group__8__Impl6369); - rule__GlobalProtocolDecl__Alternatives_8(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalProtocolDeclAccess().getAlternatives_8()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group__8__Impl" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_3__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3134:1: rule__GlobalProtocolDecl__Group_3__0 : rule__GlobalProtocolDecl__Group_3__0__Impl rule__GlobalProtocolDecl__Group_3__1 ; - public final void rule__GlobalProtocolDecl__Group_3__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3138:1: ( rule__GlobalProtocolDecl__Group_3__0__Impl rule__GlobalProtocolDecl__Group_3__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3139:2: rule__GlobalProtocolDecl__Group_3__0__Impl rule__GlobalProtocolDecl__Group_3__1 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_3__0__Impl_in_rule__GlobalProtocolDecl__Group_3__06417); - rule__GlobalProtocolDecl__Group_3__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_3__1_in_rule__GlobalProtocolDecl__Group_3__06420); - rule__GlobalProtocolDecl__Group_3__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_3__0" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_3__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3146:1: rule__GlobalProtocolDecl__Group_3__0__Impl : ( '<' ) ; - public final void rule__GlobalProtocolDecl__Group_3__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3150:1: ( ( '<' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3151:1: ( '<' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3151:1: ( '<' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3152:1: '<' - { - before(grammarAccess.getGlobalProtocolDeclAccess().getLessThanSignKeyword_3_0()); - match(input,18,FOLLOW_18_in_rule__GlobalProtocolDecl__Group_3__0__Impl6448); - after(grammarAccess.getGlobalProtocolDeclAccess().getLessThanSignKeyword_3_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_3__0__Impl" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_3__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3165:1: rule__GlobalProtocolDecl__Group_3__1 : rule__GlobalProtocolDecl__Group_3__1__Impl rule__GlobalProtocolDecl__Group_3__2 ; - public final void rule__GlobalProtocolDecl__Group_3__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3169:1: ( rule__GlobalProtocolDecl__Group_3__1__Impl rule__GlobalProtocolDecl__Group_3__2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3170:2: rule__GlobalProtocolDecl__Group_3__1__Impl rule__GlobalProtocolDecl__Group_3__2 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_3__1__Impl_in_rule__GlobalProtocolDecl__Group_3__16479); - rule__GlobalProtocolDecl__Group_3__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_3__2_in_rule__GlobalProtocolDecl__Group_3__16482); - rule__GlobalProtocolDecl__Group_3__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_3__1" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_3__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3177:1: rule__GlobalProtocolDecl__Group_3__1__Impl : ( ( rule__GlobalProtocolDecl__ParametersAssignment_3_1 ) ) ; - public final void rule__GlobalProtocolDecl__Group_3__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3181:1: ( ( ( rule__GlobalProtocolDecl__ParametersAssignment_3_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3182:1: ( ( rule__GlobalProtocolDecl__ParametersAssignment_3_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3182:1: ( ( rule__GlobalProtocolDecl__ParametersAssignment_3_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3183:1: ( rule__GlobalProtocolDecl__ParametersAssignment_3_1 ) - { - before(grammarAccess.getGlobalProtocolDeclAccess().getParametersAssignment_3_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3184:1: ( rule__GlobalProtocolDecl__ParametersAssignment_3_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3184:2: rule__GlobalProtocolDecl__ParametersAssignment_3_1 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__ParametersAssignment_3_1_in_rule__GlobalProtocolDecl__Group_3__1__Impl6509); - rule__GlobalProtocolDecl__ParametersAssignment_3_1(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalProtocolDeclAccess().getParametersAssignment_3_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_3__1__Impl" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_3__2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3194:1: rule__GlobalProtocolDecl__Group_3__2 : rule__GlobalProtocolDecl__Group_3__2__Impl rule__GlobalProtocolDecl__Group_3__3 ; - public final void rule__GlobalProtocolDecl__Group_3__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3198:1: ( rule__GlobalProtocolDecl__Group_3__2__Impl rule__GlobalProtocolDecl__Group_3__3 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3199:2: rule__GlobalProtocolDecl__Group_3__2__Impl rule__GlobalProtocolDecl__Group_3__3 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_3__2__Impl_in_rule__GlobalProtocolDecl__Group_3__26539); - rule__GlobalProtocolDecl__Group_3__2__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_3__3_in_rule__GlobalProtocolDecl__Group_3__26542); - rule__GlobalProtocolDecl__Group_3__3(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_3__2" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_3__2__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3206:1: rule__GlobalProtocolDecl__Group_3__2__Impl : ( ( rule__GlobalProtocolDecl__Group_3_2__0 )* ) ; - public final void rule__GlobalProtocolDecl__Group_3__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3210:1: ( ( ( rule__GlobalProtocolDecl__Group_3_2__0 )* ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3211:1: ( ( rule__GlobalProtocolDecl__Group_3_2__0 )* ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3211:1: ( ( rule__GlobalProtocolDecl__Group_3_2__0 )* ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3212:1: ( rule__GlobalProtocolDecl__Group_3_2__0 )* - { - before(grammarAccess.getGlobalProtocolDeclAccess().getGroup_3_2()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3213:1: ( rule__GlobalProtocolDecl__Group_3_2__0 )* - loop22: - do { - int alt22=2; - int LA22_0 = input.LA(1); - - if ( (LA22_0==22) ) { - alt22=1; - } - - - switch (alt22) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3213:2: rule__GlobalProtocolDecl__Group_3_2__0 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_3_2__0_in_rule__GlobalProtocolDecl__Group_3__2__Impl6569); - rule__GlobalProtocolDecl__Group_3_2__0(); - - state._fsp--; - - - } - break; - - default : - break loop22; - } - } while (true); - - after(grammarAccess.getGlobalProtocolDeclAccess().getGroup_3_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_3__2__Impl" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_3__3" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3223:1: rule__GlobalProtocolDecl__Group_3__3 : rule__GlobalProtocolDecl__Group_3__3__Impl ; - public final void rule__GlobalProtocolDecl__Group_3__3() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3227:1: ( rule__GlobalProtocolDecl__Group_3__3__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3228:2: rule__GlobalProtocolDecl__Group_3__3__Impl - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_3__3__Impl_in_rule__GlobalProtocolDecl__Group_3__36600); - rule__GlobalProtocolDecl__Group_3__3__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_3__3" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_3__3__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3234:1: rule__GlobalProtocolDecl__Group_3__3__Impl : ( '>' ) ; - public final void rule__GlobalProtocolDecl__Group_3__3__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3238:1: ( ( '>' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3239:1: ( '>' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3239:1: ( '>' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3240:1: '>' - { - before(grammarAccess.getGlobalProtocolDeclAccess().getGreaterThanSignKeyword_3_3()); - match(input,19,FOLLOW_19_in_rule__GlobalProtocolDecl__Group_3__3__Impl6628); - after(grammarAccess.getGlobalProtocolDeclAccess().getGreaterThanSignKeyword_3_3()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_3__3__Impl" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_3_2__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3261:1: rule__GlobalProtocolDecl__Group_3_2__0 : rule__GlobalProtocolDecl__Group_3_2__0__Impl rule__GlobalProtocolDecl__Group_3_2__1 ; - public final void rule__GlobalProtocolDecl__Group_3_2__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3265:1: ( rule__GlobalProtocolDecl__Group_3_2__0__Impl rule__GlobalProtocolDecl__Group_3_2__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3266:2: rule__GlobalProtocolDecl__Group_3_2__0__Impl rule__GlobalProtocolDecl__Group_3_2__1 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_3_2__0__Impl_in_rule__GlobalProtocolDecl__Group_3_2__06667); - rule__GlobalProtocolDecl__Group_3_2__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_3_2__1_in_rule__GlobalProtocolDecl__Group_3_2__06670); - rule__GlobalProtocolDecl__Group_3_2__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_3_2__0" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_3_2__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3273:1: rule__GlobalProtocolDecl__Group_3_2__0__Impl : ( ',' ) ; - public final void rule__GlobalProtocolDecl__Group_3_2__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3277:1: ( ( ',' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3278:1: ( ',' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3278:1: ( ',' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3279:1: ',' - { - before(grammarAccess.getGlobalProtocolDeclAccess().getCommaKeyword_3_2_0()); - match(input,22,FOLLOW_22_in_rule__GlobalProtocolDecl__Group_3_2__0__Impl6698); - after(grammarAccess.getGlobalProtocolDeclAccess().getCommaKeyword_3_2_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_3_2__0__Impl" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_3_2__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3292:1: rule__GlobalProtocolDecl__Group_3_2__1 : rule__GlobalProtocolDecl__Group_3_2__1__Impl ; - public final void rule__GlobalProtocolDecl__Group_3_2__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3296:1: ( rule__GlobalProtocolDecl__Group_3_2__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3297:2: rule__GlobalProtocolDecl__Group_3_2__1__Impl - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_3_2__1__Impl_in_rule__GlobalProtocolDecl__Group_3_2__16729); - rule__GlobalProtocolDecl__Group_3_2__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_3_2__1" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_3_2__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3303:1: rule__GlobalProtocolDecl__Group_3_2__1__Impl : ( ( rule__GlobalProtocolDecl__ParametersAssignment_3_2_1 ) ) ; - public final void rule__GlobalProtocolDecl__Group_3_2__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3307:1: ( ( ( rule__GlobalProtocolDecl__ParametersAssignment_3_2_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3308:1: ( ( rule__GlobalProtocolDecl__ParametersAssignment_3_2_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3308:1: ( ( rule__GlobalProtocolDecl__ParametersAssignment_3_2_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3309:1: ( rule__GlobalProtocolDecl__ParametersAssignment_3_2_1 ) - { - before(grammarAccess.getGlobalProtocolDeclAccess().getParametersAssignment_3_2_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3310:1: ( rule__GlobalProtocolDecl__ParametersAssignment_3_2_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3310:2: rule__GlobalProtocolDecl__ParametersAssignment_3_2_1 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__ParametersAssignment_3_2_1_in_rule__GlobalProtocolDecl__Group_3_2__1__Impl6756); - rule__GlobalProtocolDecl__ParametersAssignment_3_2_1(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalProtocolDeclAccess().getParametersAssignment_3_2_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_3_2__1__Impl" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_6__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3324:1: rule__GlobalProtocolDecl__Group_6__0 : rule__GlobalProtocolDecl__Group_6__0__Impl rule__GlobalProtocolDecl__Group_6__1 ; - public final void rule__GlobalProtocolDecl__Group_6__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3328:1: ( rule__GlobalProtocolDecl__Group_6__0__Impl rule__GlobalProtocolDecl__Group_6__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3329:2: rule__GlobalProtocolDecl__Group_6__0__Impl rule__GlobalProtocolDecl__Group_6__1 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_6__0__Impl_in_rule__GlobalProtocolDecl__Group_6__06790); - rule__GlobalProtocolDecl__Group_6__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_6__1_in_rule__GlobalProtocolDecl__Group_6__06793); - rule__GlobalProtocolDecl__Group_6__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_6__0" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_6__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3336:1: rule__GlobalProtocolDecl__Group_6__0__Impl : ( ',' ) ; - public final void rule__GlobalProtocolDecl__Group_6__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3340:1: ( ( ',' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3341:1: ( ',' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3341:1: ( ',' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3342:1: ',' - { - before(grammarAccess.getGlobalProtocolDeclAccess().getCommaKeyword_6_0()); - match(input,22,FOLLOW_22_in_rule__GlobalProtocolDecl__Group_6__0__Impl6821); - after(grammarAccess.getGlobalProtocolDeclAccess().getCommaKeyword_6_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_6__0__Impl" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_6__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3355:1: rule__GlobalProtocolDecl__Group_6__1 : rule__GlobalProtocolDecl__Group_6__1__Impl ; - public final void rule__GlobalProtocolDecl__Group_6__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3359:1: ( rule__GlobalProtocolDecl__Group_6__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3360:2: rule__GlobalProtocolDecl__Group_6__1__Impl - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_6__1__Impl_in_rule__GlobalProtocolDecl__Group_6__16852); - rule__GlobalProtocolDecl__Group_6__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_6__1" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_6__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3366:1: rule__GlobalProtocolDecl__Group_6__1__Impl : ( ( rule__GlobalProtocolDecl__RolesAssignment_6_1 ) ) ; - public final void rule__GlobalProtocolDecl__Group_6__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3370:1: ( ( ( rule__GlobalProtocolDecl__RolesAssignment_6_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3371:1: ( ( rule__GlobalProtocolDecl__RolesAssignment_6_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3371:1: ( ( rule__GlobalProtocolDecl__RolesAssignment_6_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3372:1: ( rule__GlobalProtocolDecl__RolesAssignment_6_1 ) - { - before(grammarAccess.getGlobalProtocolDeclAccess().getRolesAssignment_6_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3373:1: ( rule__GlobalProtocolDecl__RolesAssignment_6_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3373:2: rule__GlobalProtocolDecl__RolesAssignment_6_1 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__RolesAssignment_6_1_in_rule__GlobalProtocolDecl__Group_6__1__Impl6879); - rule__GlobalProtocolDecl__RolesAssignment_6_1(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalProtocolDeclAccess().getRolesAssignment_6_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_6__1__Impl" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_8_1__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3387:1: rule__GlobalProtocolDecl__Group_8_1__0 : rule__GlobalProtocolDecl__Group_8_1__0__Impl rule__GlobalProtocolDecl__Group_8_1__1 ; - public final void rule__GlobalProtocolDecl__Group_8_1__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3391:1: ( rule__GlobalProtocolDecl__Group_8_1__0__Impl rule__GlobalProtocolDecl__Group_8_1__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3392:2: rule__GlobalProtocolDecl__Group_8_1__0__Impl rule__GlobalProtocolDecl__Group_8_1__1 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_8_1__0__Impl_in_rule__GlobalProtocolDecl__Group_8_1__06913); - rule__GlobalProtocolDecl__Group_8_1__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_8_1__1_in_rule__GlobalProtocolDecl__Group_8_1__06916); - rule__GlobalProtocolDecl__Group_8_1__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_8_1__0" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_8_1__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3399:1: rule__GlobalProtocolDecl__Group_8_1__0__Impl : ( 'instantiates' ) ; - public final void rule__GlobalProtocolDecl__Group_8_1__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3403:1: ( ( 'instantiates' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3404:1: ( 'instantiates' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3404:1: ( 'instantiates' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3405:1: 'instantiates' - { - before(grammarAccess.getGlobalProtocolDeclAccess().getInstantiatesKeyword_8_1_0()); - match(input,26,FOLLOW_26_in_rule__GlobalProtocolDecl__Group_8_1__0__Impl6944); - after(grammarAccess.getGlobalProtocolDeclAccess().getInstantiatesKeyword_8_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_8_1__0__Impl" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_8_1__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3418:1: rule__GlobalProtocolDecl__Group_8_1__1 : rule__GlobalProtocolDecl__Group_8_1__1__Impl rule__GlobalProtocolDecl__Group_8_1__2 ; - public final void rule__GlobalProtocolDecl__Group_8_1__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3422:1: ( rule__GlobalProtocolDecl__Group_8_1__1__Impl rule__GlobalProtocolDecl__Group_8_1__2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3423:2: rule__GlobalProtocolDecl__Group_8_1__1__Impl rule__GlobalProtocolDecl__Group_8_1__2 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_8_1__1__Impl_in_rule__GlobalProtocolDecl__Group_8_1__16975); - rule__GlobalProtocolDecl__Group_8_1__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_8_1__2_in_rule__GlobalProtocolDecl__Group_8_1__16978); - rule__GlobalProtocolDecl__Group_8_1__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_8_1__1" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_8_1__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3430:1: rule__GlobalProtocolDecl__Group_8_1__1__Impl : ( ( rule__GlobalProtocolDecl__InstantiatesAssignment_8_1_1 ) ) ; - public final void rule__GlobalProtocolDecl__Group_8_1__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3434:1: ( ( ( rule__GlobalProtocolDecl__InstantiatesAssignment_8_1_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3435:1: ( ( rule__GlobalProtocolDecl__InstantiatesAssignment_8_1_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3435:1: ( ( rule__GlobalProtocolDecl__InstantiatesAssignment_8_1_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3436:1: ( rule__GlobalProtocolDecl__InstantiatesAssignment_8_1_1 ) - { - before(grammarAccess.getGlobalProtocolDeclAccess().getInstantiatesAssignment_8_1_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3437:1: ( rule__GlobalProtocolDecl__InstantiatesAssignment_8_1_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3437:2: rule__GlobalProtocolDecl__InstantiatesAssignment_8_1_1 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__InstantiatesAssignment_8_1_1_in_rule__GlobalProtocolDecl__Group_8_1__1__Impl7005); - rule__GlobalProtocolDecl__InstantiatesAssignment_8_1_1(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalProtocolDeclAccess().getInstantiatesAssignment_8_1_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_8_1__1__Impl" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_8_1__2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3447:1: rule__GlobalProtocolDecl__Group_8_1__2 : rule__GlobalProtocolDecl__Group_8_1__2__Impl rule__GlobalProtocolDecl__Group_8_1__3 ; - public final void rule__GlobalProtocolDecl__Group_8_1__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3451:1: ( rule__GlobalProtocolDecl__Group_8_1__2__Impl rule__GlobalProtocolDecl__Group_8_1__3 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3452:2: rule__GlobalProtocolDecl__Group_8_1__2__Impl rule__GlobalProtocolDecl__Group_8_1__3 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_8_1__2__Impl_in_rule__GlobalProtocolDecl__Group_8_1__27035); - rule__GlobalProtocolDecl__Group_8_1__2__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_8_1__3_in_rule__GlobalProtocolDecl__Group_8_1__27038); - rule__GlobalProtocolDecl__Group_8_1__3(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_8_1__2" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_8_1__2__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3459:1: rule__GlobalProtocolDecl__Group_8_1__2__Impl : ( ( rule__GlobalProtocolDecl__Group_8_1_2__0 )? ) ; - public final void rule__GlobalProtocolDecl__Group_8_1__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3463:1: ( ( ( rule__GlobalProtocolDecl__Group_8_1_2__0 )? ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3464:1: ( ( rule__GlobalProtocolDecl__Group_8_1_2__0 )? ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3464:1: ( ( rule__GlobalProtocolDecl__Group_8_1_2__0 )? ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3465:1: ( rule__GlobalProtocolDecl__Group_8_1_2__0 )? - { - before(grammarAccess.getGlobalProtocolDeclAccess().getGroup_8_1_2()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3466:1: ( rule__GlobalProtocolDecl__Group_8_1_2__0 )? - int alt23=2; - int LA23_0 = input.LA(1); - - if ( (LA23_0==18) ) { - alt23=1; - } - switch (alt23) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3466:2: rule__GlobalProtocolDecl__Group_8_1_2__0 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_8_1_2__0_in_rule__GlobalProtocolDecl__Group_8_1__2__Impl7065); - rule__GlobalProtocolDecl__Group_8_1_2__0(); - - state._fsp--; - - - } - break; - - } - - after(grammarAccess.getGlobalProtocolDeclAccess().getGroup_8_1_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_8_1__2__Impl" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_8_1__3" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3476:1: rule__GlobalProtocolDecl__Group_8_1__3 : rule__GlobalProtocolDecl__Group_8_1__3__Impl rule__GlobalProtocolDecl__Group_8_1__4 ; - public final void rule__GlobalProtocolDecl__Group_8_1__3() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3480:1: ( rule__GlobalProtocolDecl__Group_8_1__3__Impl rule__GlobalProtocolDecl__Group_8_1__4 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3481:2: rule__GlobalProtocolDecl__Group_8_1__3__Impl rule__GlobalProtocolDecl__Group_8_1__4 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_8_1__3__Impl_in_rule__GlobalProtocolDecl__Group_8_1__37096); - rule__GlobalProtocolDecl__Group_8_1__3__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_8_1__4_in_rule__GlobalProtocolDecl__Group_8_1__37099); - rule__GlobalProtocolDecl__Group_8_1__4(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_8_1__3" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_8_1__3__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3488:1: rule__GlobalProtocolDecl__Group_8_1__3__Impl : ( '(' ) ; - public final void rule__GlobalProtocolDecl__Group_8_1__3__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3492:1: ( ( '(' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3493:1: ( '(' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3493:1: ( '(' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3494:1: '(' - { - before(grammarAccess.getGlobalProtocolDeclAccess().getLeftParenthesisKeyword_8_1_3()); - match(input,20,FOLLOW_20_in_rule__GlobalProtocolDecl__Group_8_1__3__Impl7127); - after(grammarAccess.getGlobalProtocolDeclAccess().getLeftParenthesisKeyword_8_1_3()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_8_1__3__Impl" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_8_1__4" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3507:1: rule__GlobalProtocolDecl__Group_8_1__4 : rule__GlobalProtocolDecl__Group_8_1__4__Impl rule__GlobalProtocolDecl__Group_8_1__5 ; - public final void rule__GlobalProtocolDecl__Group_8_1__4() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3511:1: ( rule__GlobalProtocolDecl__Group_8_1__4__Impl rule__GlobalProtocolDecl__Group_8_1__5 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3512:2: rule__GlobalProtocolDecl__Group_8_1__4__Impl rule__GlobalProtocolDecl__Group_8_1__5 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_8_1__4__Impl_in_rule__GlobalProtocolDecl__Group_8_1__47158); - rule__GlobalProtocolDecl__Group_8_1__4__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_8_1__5_in_rule__GlobalProtocolDecl__Group_8_1__47161); - rule__GlobalProtocolDecl__Group_8_1__5(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_8_1__4" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_8_1__4__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3519:1: rule__GlobalProtocolDecl__Group_8_1__4__Impl : ( ( rule__GlobalProtocolDecl__RoleInstantiationsAssignment_8_1_4 ) ) ; - public final void rule__GlobalProtocolDecl__Group_8_1__4__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3523:1: ( ( ( rule__GlobalProtocolDecl__RoleInstantiationsAssignment_8_1_4 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3524:1: ( ( rule__GlobalProtocolDecl__RoleInstantiationsAssignment_8_1_4 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3524:1: ( ( rule__GlobalProtocolDecl__RoleInstantiationsAssignment_8_1_4 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3525:1: ( rule__GlobalProtocolDecl__RoleInstantiationsAssignment_8_1_4 ) - { - before(grammarAccess.getGlobalProtocolDeclAccess().getRoleInstantiationsAssignment_8_1_4()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3526:1: ( rule__GlobalProtocolDecl__RoleInstantiationsAssignment_8_1_4 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3526:2: rule__GlobalProtocolDecl__RoleInstantiationsAssignment_8_1_4 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__RoleInstantiationsAssignment_8_1_4_in_rule__GlobalProtocolDecl__Group_8_1__4__Impl7188); - rule__GlobalProtocolDecl__RoleInstantiationsAssignment_8_1_4(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalProtocolDeclAccess().getRoleInstantiationsAssignment_8_1_4()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_8_1__4__Impl" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_8_1__5" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3536:1: rule__GlobalProtocolDecl__Group_8_1__5 : rule__GlobalProtocolDecl__Group_8_1__5__Impl rule__GlobalProtocolDecl__Group_8_1__6 ; - public final void rule__GlobalProtocolDecl__Group_8_1__5() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3540:1: ( rule__GlobalProtocolDecl__Group_8_1__5__Impl rule__GlobalProtocolDecl__Group_8_1__6 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3541:2: rule__GlobalProtocolDecl__Group_8_1__5__Impl rule__GlobalProtocolDecl__Group_8_1__6 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_8_1__5__Impl_in_rule__GlobalProtocolDecl__Group_8_1__57218); - rule__GlobalProtocolDecl__Group_8_1__5__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_8_1__6_in_rule__GlobalProtocolDecl__Group_8_1__57221); - rule__GlobalProtocolDecl__Group_8_1__6(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_8_1__5" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_8_1__5__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3548:1: rule__GlobalProtocolDecl__Group_8_1__5__Impl : ( ( rule__GlobalProtocolDecl__Group_8_1_5__0 )* ) ; - public final void rule__GlobalProtocolDecl__Group_8_1__5__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3552:1: ( ( ( rule__GlobalProtocolDecl__Group_8_1_5__0 )* ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3553:1: ( ( rule__GlobalProtocolDecl__Group_8_1_5__0 )* ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3553:1: ( ( rule__GlobalProtocolDecl__Group_8_1_5__0 )* ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3554:1: ( rule__GlobalProtocolDecl__Group_8_1_5__0 )* - { - before(grammarAccess.getGlobalProtocolDeclAccess().getGroup_8_1_5()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3555:1: ( rule__GlobalProtocolDecl__Group_8_1_5__0 )* - loop24: - do { - int alt24=2; - int LA24_0 = input.LA(1); - - if ( (LA24_0==22) ) { - alt24=1; - } - - - switch (alt24) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3555:2: rule__GlobalProtocolDecl__Group_8_1_5__0 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_8_1_5__0_in_rule__GlobalProtocolDecl__Group_8_1__5__Impl7248); - rule__GlobalProtocolDecl__Group_8_1_5__0(); - - state._fsp--; - - - } - break; - - default : - break loop24; - } - } while (true); - - after(grammarAccess.getGlobalProtocolDeclAccess().getGroup_8_1_5()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_8_1__5__Impl" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_8_1__6" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3565:1: rule__GlobalProtocolDecl__Group_8_1__6 : rule__GlobalProtocolDecl__Group_8_1__6__Impl rule__GlobalProtocolDecl__Group_8_1__7 ; - public final void rule__GlobalProtocolDecl__Group_8_1__6() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3569:1: ( rule__GlobalProtocolDecl__Group_8_1__6__Impl rule__GlobalProtocolDecl__Group_8_1__7 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3570:2: rule__GlobalProtocolDecl__Group_8_1__6__Impl rule__GlobalProtocolDecl__Group_8_1__7 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_8_1__6__Impl_in_rule__GlobalProtocolDecl__Group_8_1__67279); - rule__GlobalProtocolDecl__Group_8_1__6__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_8_1__7_in_rule__GlobalProtocolDecl__Group_8_1__67282); - rule__GlobalProtocolDecl__Group_8_1__7(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_8_1__6" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_8_1__6__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3577:1: rule__GlobalProtocolDecl__Group_8_1__6__Impl : ( ')' ) ; - public final void rule__GlobalProtocolDecl__Group_8_1__6__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3581:1: ( ( ')' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3582:1: ( ')' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3582:1: ( ')' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3583:1: ')' - { - before(grammarAccess.getGlobalProtocolDeclAccess().getRightParenthesisKeyword_8_1_6()); - match(input,21,FOLLOW_21_in_rule__GlobalProtocolDecl__Group_8_1__6__Impl7310); - after(grammarAccess.getGlobalProtocolDeclAccess().getRightParenthesisKeyword_8_1_6()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_8_1__6__Impl" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_8_1__7" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3596:1: rule__GlobalProtocolDecl__Group_8_1__7 : rule__GlobalProtocolDecl__Group_8_1__7__Impl ; - public final void rule__GlobalProtocolDecl__Group_8_1__7() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3600:1: ( rule__GlobalProtocolDecl__Group_8_1__7__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3601:2: rule__GlobalProtocolDecl__Group_8_1__7__Impl - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_8_1__7__Impl_in_rule__GlobalProtocolDecl__Group_8_1__77341); - rule__GlobalProtocolDecl__Group_8_1__7__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_8_1__7" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_8_1__7__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3607:1: rule__GlobalProtocolDecl__Group_8_1__7__Impl : ( ';' ) ; - public final void rule__GlobalProtocolDecl__Group_8_1__7__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3611:1: ( ( ';' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3612:1: ( ';' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3612:1: ( ';' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3613:1: ';' - { - before(grammarAccess.getGlobalProtocolDeclAccess().getSemicolonKeyword_8_1_7()); - match(input,12,FOLLOW_12_in_rule__GlobalProtocolDecl__Group_8_1__7__Impl7369); - after(grammarAccess.getGlobalProtocolDeclAccess().getSemicolonKeyword_8_1_7()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_8_1__7__Impl" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_8_1_2__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3642:1: rule__GlobalProtocolDecl__Group_8_1_2__0 : rule__GlobalProtocolDecl__Group_8_1_2__0__Impl rule__GlobalProtocolDecl__Group_8_1_2__1 ; - public final void rule__GlobalProtocolDecl__Group_8_1_2__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3646:1: ( rule__GlobalProtocolDecl__Group_8_1_2__0__Impl rule__GlobalProtocolDecl__Group_8_1_2__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3647:2: rule__GlobalProtocolDecl__Group_8_1_2__0__Impl rule__GlobalProtocolDecl__Group_8_1_2__1 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_8_1_2__0__Impl_in_rule__GlobalProtocolDecl__Group_8_1_2__07416); - rule__GlobalProtocolDecl__Group_8_1_2__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_8_1_2__1_in_rule__GlobalProtocolDecl__Group_8_1_2__07419); - rule__GlobalProtocolDecl__Group_8_1_2__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_8_1_2__0" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_8_1_2__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3654:1: rule__GlobalProtocolDecl__Group_8_1_2__0__Impl : ( '<' ) ; - public final void rule__GlobalProtocolDecl__Group_8_1_2__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3658:1: ( ( '<' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3659:1: ( '<' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3659:1: ( '<' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3660:1: '<' - { - before(grammarAccess.getGlobalProtocolDeclAccess().getLessThanSignKeyword_8_1_2_0()); - match(input,18,FOLLOW_18_in_rule__GlobalProtocolDecl__Group_8_1_2__0__Impl7447); - after(grammarAccess.getGlobalProtocolDeclAccess().getLessThanSignKeyword_8_1_2_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_8_1_2__0__Impl" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_8_1_2__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3673:1: rule__GlobalProtocolDecl__Group_8_1_2__1 : rule__GlobalProtocolDecl__Group_8_1_2__1__Impl rule__GlobalProtocolDecl__Group_8_1_2__2 ; - public final void rule__GlobalProtocolDecl__Group_8_1_2__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3677:1: ( rule__GlobalProtocolDecl__Group_8_1_2__1__Impl rule__GlobalProtocolDecl__Group_8_1_2__2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3678:2: rule__GlobalProtocolDecl__Group_8_1_2__1__Impl rule__GlobalProtocolDecl__Group_8_1_2__2 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_8_1_2__1__Impl_in_rule__GlobalProtocolDecl__Group_8_1_2__17478); - rule__GlobalProtocolDecl__Group_8_1_2__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_8_1_2__2_in_rule__GlobalProtocolDecl__Group_8_1_2__17481); - rule__GlobalProtocolDecl__Group_8_1_2__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_8_1_2__1" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_8_1_2__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3685:1: rule__GlobalProtocolDecl__Group_8_1_2__1__Impl : ( ( rule__GlobalProtocolDecl__ArgumentsAssignment_8_1_2_1 ) ) ; - public final void rule__GlobalProtocolDecl__Group_8_1_2__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3689:1: ( ( ( rule__GlobalProtocolDecl__ArgumentsAssignment_8_1_2_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3690:1: ( ( rule__GlobalProtocolDecl__ArgumentsAssignment_8_1_2_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3690:1: ( ( rule__GlobalProtocolDecl__ArgumentsAssignment_8_1_2_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3691:1: ( rule__GlobalProtocolDecl__ArgumentsAssignment_8_1_2_1 ) - { - before(grammarAccess.getGlobalProtocolDeclAccess().getArgumentsAssignment_8_1_2_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3692:1: ( rule__GlobalProtocolDecl__ArgumentsAssignment_8_1_2_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3692:2: rule__GlobalProtocolDecl__ArgumentsAssignment_8_1_2_1 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__ArgumentsAssignment_8_1_2_1_in_rule__GlobalProtocolDecl__Group_8_1_2__1__Impl7508); - rule__GlobalProtocolDecl__ArgumentsAssignment_8_1_2_1(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalProtocolDeclAccess().getArgumentsAssignment_8_1_2_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_8_1_2__1__Impl" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_8_1_2__2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3702:1: rule__GlobalProtocolDecl__Group_8_1_2__2 : rule__GlobalProtocolDecl__Group_8_1_2__2__Impl rule__GlobalProtocolDecl__Group_8_1_2__3 ; - public final void rule__GlobalProtocolDecl__Group_8_1_2__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3706:1: ( rule__GlobalProtocolDecl__Group_8_1_2__2__Impl rule__GlobalProtocolDecl__Group_8_1_2__3 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3707:2: rule__GlobalProtocolDecl__Group_8_1_2__2__Impl rule__GlobalProtocolDecl__Group_8_1_2__3 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_8_1_2__2__Impl_in_rule__GlobalProtocolDecl__Group_8_1_2__27538); - rule__GlobalProtocolDecl__Group_8_1_2__2__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_8_1_2__3_in_rule__GlobalProtocolDecl__Group_8_1_2__27541); - rule__GlobalProtocolDecl__Group_8_1_2__3(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_8_1_2__2" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_8_1_2__2__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3714:1: rule__GlobalProtocolDecl__Group_8_1_2__2__Impl : ( ( rule__GlobalProtocolDecl__Group_8_1_2_2__0 )* ) ; - public final void rule__GlobalProtocolDecl__Group_8_1_2__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3718:1: ( ( ( rule__GlobalProtocolDecl__Group_8_1_2_2__0 )* ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3719:1: ( ( rule__GlobalProtocolDecl__Group_8_1_2_2__0 )* ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3719:1: ( ( rule__GlobalProtocolDecl__Group_8_1_2_2__0 )* ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3720:1: ( rule__GlobalProtocolDecl__Group_8_1_2_2__0 )* - { - before(grammarAccess.getGlobalProtocolDeclAccess().getGroup_8_1_2_2()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3721:1: ( rule__GlobalProtocolDecl__Group_8_1_2_2__0 )* - loop25: - do { - int alt25=2; - int LA25_0 = input.LA(1); - - if ( (LA25_0==22) ) { - alt25=1; - } - - - switch (alt25) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3721:2: rule__GlobalProtocolDecl__Group_8_1_2_2__0 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_8_1_2_2__0_in_rule__GlobalProtocolDecl__Group_8_1_2__2__Impl7568); - rule__GlobalProtocolDecl__Group_8_1_2_2__0(); - - state._fsp--; - - - } - break; - - default : - break loop25; - } - } while (true); - - after(grammarAccess.getGlobalProtocolDeclAccess().getGroup_8_1_2_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_8_1_2__2__Impl" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_8_1_2__3" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3731:1: rule__GlobalProtocolDecl__Group_8_1_2__3 : rule__GlobalProtocolDecl__Group_8_1_2__3__Impl ; - public final void rule__GlobalProtocolDecl__Group_8_1_2__3() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3735:1: ( rule__GlobalProtocolDecl__Group_8_1_2__3__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3736:2: rule__GlobalProtocolDecl__Group_8_1_2__3__Impl - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_8_1_2__3__Impl_in_rule__GlobalProtocolDecl__Group_8_1_2__37599); - rule__GlobalProtocolDecl__Group_8_1_2__3__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_8_1_2__3" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_8_1_2__3__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3742:1: rule__GlobalProtocolDecl__Group_8_1_2__3__Impl : ( '>' ) ; - public final void rule__GlobalProtocolDecl__Group_8_1_2__3__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3746:1: ( ( '>' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3747:1: ( '>' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3747:1: ( '>' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3748:1: '>' - { - before(grammarAccess.getGlobalProtocolDeclAccess().getGreaterThanSignKeyword_8_1_2_3()); - match(input,19,FOLLOW_19_in_rule__GlobalProtocolDecl__Group_8_1_2__3__Impl7627); - after(grammarAccess.getGlobalProtocolDeclAccess().getGreaterThanSignKeyword_8_1_2_3()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_8_1_2__3__Impl" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_8_1_2_2__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3769:1: rule__GlobalProtocolDecl__Group_8_1_2_2__0 : rule__GlobalProtocolDecl__Group_8_1_2_2__0__Impl rule__GlobalProtocolDecl__Group_8_1_2_2__1 ; - public final void rule__GlobalProtocolDecl__Group_8_1_2_2__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3773:1: ( rule__GlobalProtocolDecl__Group_8_1_2_2__0__Impl rule__GlobalProtocolDecl__Group_8_1_2_2__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3774:2: rule__GlobalProtocolDecl__Group_8_1_2_2__0__Impl rule__GlobalProtocolDecl__Group_8_1_2_2__1 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_8_1_2_2__0__Impl_in_rule__GlobalProtocolDecl__Group_8_1_2_2__07666); - rule__GlobalProtocolDecl__Group_8_1_2_2__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_8_1_2_2__1_in_rule__GlobalProtocolDecl__Group_8_1_2_2__07669); - rule__GlobalProtocolDecl__Group_8_1_2_2__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_8_1_2_2__0" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_8_1_2_2__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3781:1: rule__GlobalProtocolDecl__Group_8_1_2_2__0__Impl : ( ',' ) ; - public final void rule__GlobalProtocolDecl__Group_8_1_2_2__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3785:1: ( ( ',' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3786:1: ( ',' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3786:1: ( ',' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3787:1: ',' - { - before(grammarAccess.getGlobalProtocolDeclAccess().getCommaKeyword_8_1_2_2_0()); - match(input,22,FOLLOW_22_in_rule__GlobalProtocolDecl__Group_8_1_2_2__0__Impl7697); - after(grammarAccess.getGlobalProtocolDeclAccess().getCommaKeyword_8_1_2_2_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_8_1_2_2__0__Impl" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_8_1_2_2__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3800:1: rule__GlobalProtocolDecl__Group_8_1_2_2__1 : rule__GlobalProtocolDecl__Group_8_1_2_2__1__Impl ; - public final void rule__GlobalProtocolDecl__Group_8_1_2_2__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3804:1: ( rule__GlobalProtocolDecl__Group_8_1_2_2__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3805:2: rule__GlobalProtocolDecl__Group_8_1_2_2__1__Impl - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_8_1_2_2__1__Impl_in_rule__GlobalProtocolDecl__Group_8_1_2_2__17728); - rule__GlobalProtocolDecl__Group_8_1_2_2__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_8_1_2_2__1" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_8_1_2_2__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3811:1: rule__GlobalProtocolDecl__Group_8_1_2_2__1__Impl : ( ( rule__GlobalProtocolDecl__ArgumentsAssignment_8_1_2_2_1 ) ) ; - public final void rule__GlobalProtocolDecl__Group_8_1_2_2__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3815:1: ( ( ( rule__GlobalProtocolDecl__ArgumentsAssignment_8_1_2_2_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3816:1: ( ( rule__GlobalProtocolDecl__ArgumentsAssignment_8_1_2_2_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3816:1: ( ( rule__GlobalProtocolDecl__ArgumentsAssignment_8_1_2_2_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3817:1: ( rule__GlobalProtocolDecl__ArgumentsAssignment_8_1_2_2_1 ) - { - before(grammarAccess.getGlobalProtocolDeclAccess().getArgumentsAssignment_8_1_2_2_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3818:1: ( rule__GlobalProtocolDecl__ArgumentsAssignment_8_1_2_2_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3818:2: rule__GlobalProtocolDecl__ArgumentsAssignment_8_1_2_2_1 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__ArgumentsAssignment_8_1_2_2_1_in_rule__GlobalProtocolDecl__Group_8_1_2_2__1__Impl7755); - rule__GlobalProtocolDecl__ArgumentsAssignment_8_1_2_2_1(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalProtocolDeclAccess().getArgumentsAssignment_8_1_2_2_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_8_1_2_2__1__Impl" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_8_1_5__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3832:1: rule__GlobalProtocolDecl__Group_8_1_5__0 : rule__GlobalProtocolDecl__Group_8_1_5__0__Impl rule__GlobalProtocolDecl__Group_8_1_5__1 ; - public final void rule__GlobalProtocolDecl__Group_8_1_5__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3836:1: ( rule__GlobalProtocolDecl__Group_8_1_5__0__Impl rule__GlobalProtocolDecl__Group_8_1_5__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3837:2: rule__GlobalProtocolDecl__Group_8_1_5__0__Impl rule__GlobalProtocolDecl__Group_8_1_5__1 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_8_1_5__0__Impl_in_rule__GlobalProtocolDecl__Group_8_1_5__07789); - rule__GlobalProtocolDecl__Group_8_1_5__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_8_1_5__1_in_rule__GlobalProtocolDecl__Group_8_1_5__07792); - rule__GlobalProtocolDecl__Group_8_1_5__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_8_1_5__0" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_8_1_5__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3844:1: rule__GlobalProtocolDecl__Group_8_1_5__0__Impl : ( ',' ) ; - public final void rule__GlobalProtocolDecl__Group_8_1_5__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3848:1: ( ( ',' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3849:1: ( ',' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3849:1: ( ',' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3850:1: ',' - { - before(grammarAccess.getGlobalProtocolDeclAccess().getCommaKeyword_8_1_5_0()); - match(input,22,FOLLOW_22_in_rule__GlobalProtocolDecl__Group_8_1_5__0__Impl7820); - after(grammarAccess.getGlobalProtocolDeclAccess().getCommaKeyword_8_1_5_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_8_1_5__0__Impl" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_8_1_5__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3863:1: rule__GlobalProtocolDecl__Group_8_1_5__1 : rule__GlobalProtocolDecl__Group_8_1_5__1__Impl ; - public final void rule__GlobalProtocolDecl__Group_8_1_5__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3867:1: ( rule__GlobalProtocolDecl__Group_8_1_5__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3868:2: rule__GlobalProtocolDecl__Group_8_1_5__1__Impl - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__Group_8_1_5__1__Impl_in_rule__GlobalProtocolDecl__Group_8_1_5__17851); - rule__GlobalProtocolDecl__Group_8_1_5__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_8_1_5__1" - - - // $ANTLR start "rule__GlobalProtocolDecl__Group_8_1_5__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3874:1: rule__GlobalProtocolDecl__Group_8_1_5__1__Impl : ( ( rule__GlobalProtocolDecl__RoleInstantiationsAssignment_8_1_5_1 ) ) ; - public final void rule__GlobalProtocolDecl__Group_8_1_5__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3878:1: ( ( ( rule__GlobalProtocolDecl__RoleInstantiationsAssignment_8_1_5_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3879:1: ( ( rule__GlobalProtocolDecl__RoleInstantiationsAssignment_8_1_5_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3879:1: ( ( rule__GlobalProtocolDecl__RoleInstantiationsAssignment_8_1_5_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3880:1: ( rule__GlobalProtocolDecl__RoleInstantiationsAssignment_8_1_5_1 ) - { - before(grammarAccess.getGlobalProtocolDeclAccess().getRoleInstantiationsAssignment_8_1_5_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3881:1: ( rule__GlobalProtocolDecl__RoleInstantiationsAssignment_8_1_5_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3881:2: rule__GlobalProtocolDecl__RoleInstantiationsAssignment_8_1_5_1 - { - pushFollow(FOLLOW_rule__GlobalProtocolDecl__RoleInstantiationsAssignment_8_1_5_1_in_rule__GlobalProtocolDecl__Group_8_1_5__1__Impl7878); - rule__GlobalProtocolDecl__RoleInstantiationsAssignment_8_1_5_1(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalProtocolDeclAccess().getRoleInstantiationsAssignment_8_1_5_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__Group_8_1_5__1__Impl" - - - // $ANTLR start "rule__RoleDecl__Group__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3895:1: rule__RoleDecl__Group__0 : rule__RoleDecl__Group__0__Impl rule__RoleDecl__Group__1 ; - public final void rule__RoleDecl__Group__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3899:1: ( rule__RoleDecl__Group__0__Impl rule__RoleDecl__Group__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3900:2: rule__RoleDecl__Group__0__Impl rule__RoleDecl__Group__1 - { - pushFollow(FOLLOW_rule__RoleDecl__Group__0__Impl_in_rule__RoleDecl__Group__07912); - rule__RoleDecl__Group__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__RoleDecl__Group__1_in_rule__RoleDecl__Group__07915); - rule__RoleDecl__Group__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__RoleDecl__Group__0" - - - // $ANTLR start "rule__RoleDecl__Group__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3907:1: rule__RoleDecl__Group__0__Impl : ( 'role' ) ; - public final void rule__RoleDecl__Group__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3911:1: ( ( 'role' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3912:1: ( 'role' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3912:1: ( 'role' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3913:1: 'role' - { - before(grammarAccess.getRoleDeclAccess().getRoleKeyword_0()); - match(input,27,FOLLOW_27_in_rule__RoleDecl__Group__0__Impl7943); - after(grammarAccess.getRoleDeclAccess().getRoleKeyword_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__RoleDecl__Group__0__Impl" - - - // $ANTLR start "rule__RoleDecl__Group__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3926:1: rule__RoleDecl__Group__1 : rule__RoleDecl__Group__1__Impl rule__RoleDecl__Group__2 ; - public final void rule__RoleDecl__Group__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3930:1: ( rule__RoleDecl__Group__1__Impl rule__RoleDecl__Group__2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3931:2: rule__RoleDecl__Group__1__Impl rule__RoleDecl__Group__2 - { - pushFollow(FOLLOW_rule__RoleDecl__Group__1__Impl_in_rule__RoleDecl__Group__17974); - rule__RoleDecl__Group__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__RoleDecl__Group__2_in_rule__RoleDecl__Group__17977); - rule__RoleDecl__Group__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__RoleDecl__Group__1" - - - // $ANTLR start "rule__RoleDecl__Group__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3938:1: rule__RoleDecl__Group__1__Impl : ( ( rule__RoleDecl__NameAssignment_1 ) ) ; - public final void rule__RoleDecl__Group__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3942:1: ( ( ( rule__RoleDecl__NameAssignment_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3943:1: ( ( rule__RoleDecl__NameAssignment_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3943:1: ( ( rule__RoleDecl__NameAssignment_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3944:1: ( rule__RoleDecl__NameAssignment_1 ) - { - before(grammarAccess.getRoleDeclAccess().getNameAssignment_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3945:1: ( rule__RoleDecl__NameAssignment_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3945:2: rule__RoleDecl__NameAssignment_1 - { - pushFollow(FOLLOW_rule__RoleDecl__NameAssignment_1_in_rule__RoleDecl__Group__1__Impl8004); - rule__RoleDecl__NameAssignment_1(); - - state._fsp--; - - - } - - after(grammarAccess.getRoleDeclAccess().getNameAssignment_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__RoleDecl__Group__1__Impl" - - - // $ANTLR start "rule__RoleDecl__Group__2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3955:1: rule__RoleDecl__Group__2 : rule__RoleDecl__Group__2__Impl ; - public final void rule__RoleDecl__Group__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3959:1: ( rule__RoleDecl__Group__2__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3960:2: rule__RoleDecl__Group__2__Impl - { - pushFollow(FOLLOW_rule__RoleDecl__Group__2__Impl_in_rule__RoleDecl__Group__28034); - rule__RoleDecl__Group__2__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__RoleDecl__Group__2" - - - // $ANTLR start "rule__RoleDecl__Group__2__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3966:1: rule__RoleDecl__Group__2__Impl : ( ( rule__RoleDecl__Group_2__0 )? ) ; - public final void rule__RoleDecl__Group__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3970:1: ( ( ( rule__RoleDecl__Group_2__0 )? ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3971:1: ( ( rule__RoleDecl__Group_2__0 )? ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3971:1: ( ( rule__RoleDecl__Group_2__0 )? ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3972:1: ( rule__RoleDecl__Group_2__0 )? - { - before(grammarAccess.getRoleDeclAccess().getGroup_2()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3973:1: ( rule__RoleDecl__Group_2__0 )? - int alt26=2; - int LA26_0 = input.LA(1); - - if ( (LA26_0==15) ) { - alt26=1; - } - switch (alt26) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3973:2: rule__RoleDecl__Group_2__0 - { - pushFollow(FOLLOW_rule__RoleDecl__Group_2__0_in_rule__RoleDecl__Group__2__Impl8061); - rule__RoleDecl__Group_2__0(); - - state._fsp--; - - - } - break; - - } - - after(grammarAccess.getRoleDeclAccess().getGroup_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__RoleDecl__Group__2__Impl" - - - // $ANTLR start "rule__RoleDecl__Group_2__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3989:1: rule__RoleDecl__Group_2__0 : rule__RoleDecl__Group_2__0__Impl rule__RoleDecl__Group_2__1 ; - public final void rule__RoleDecl__Group_2__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3993:1: ( rule__RoleDecl__Group_2__0__Impl rule__RoleDecl__Group_2__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:3994:2: rule__RoleDecl__Group_2__0__Impl rule__RoleDecl__Group_2__1 - { - pushFollow(FOLLOW_rule__RoleDecl__Group_2__0__Impl_in_rule__RoleDecl__Group_2__08098); - rule__RoleDecl__Group_2__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__RoleDecl__Group_2__1_in_rule__RoleDecl__Group_2__08101); - rule__RoleDecl__Group_2__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__RoleDecl__Group_2__0" - - - // $ANTLR start "rule__RoleDecl__Group_2__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4001:1: rule__RoleDecl__Group_2__0__Impl : ( 'as' ) ; - public final void rule__RoleDecl__Group_2__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4005:1: ( ( 'as' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4006:1: ( 'as' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4006:1: ( 'as' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4007:1: 'as' - { - before(grammarAccess.getRoleDeclAccess().getAsKeyword_2_0()); - match(input,15,FOLLOW_15_in_rule__RoleDecl__Group_2__0__Impl8129); - after(grammarAccess.getRoleDeclAccess().getAsKeyword_2_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__RoleDecl__Group_2__0__Impl" - - - // $ANTLR start "rule__RoleDecl__Group_2__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4020:1: rule__RoleDecl__Group_2__1 : rule__RoleDecl__Group_2__1__Impl ; - public final void rule__RoleDecl__Group_2__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4024:1: ( rule__RoleDecl__Group_2__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4025:2: rule__RoleDecl__Group_2__1__Impl - { - pushFollow(FOLLOW_rule__RoleDecl__Group_2__1__Impl_in_rule__RoleDecl__Group_2__18160); - rule__RoleDecl__Group_2__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__RoleDecl__Group_2__1" - - - // $ANTLR start "rule__RoleDecl__Group_2__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4031:1: rule__RoleDecl__Group_2__1__Impl : ( ( rule__RoleDecl__AliasAssignment_2_1 ) ) ; - public final void rule__RoleDecl__Group_2__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4035:1: ( ( ( rule__RoleDecl__AliasAssignment_2_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4036:1: ( ( rule__RoleDecl__AliasAssignment_2_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4036:1: ( ( rule__RoleDecl__AliasAssignment_2_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4037:1: ( rule__RoleDecl__AliasAssignment_2_1 ) - { - before(grammarAccess.getRoleDeclAccess().getAliasAssignment_2_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4038:1: ( rule__RoleDecl__AliasAssignment_2_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4038:2: rule__RoleDecl__AliasAssignment_2_1 - { - pushFollow(FOLLOW_rule__RoleDecl__AliasAssignment_2_1_in_rule__RoleDecl__Group_2__1__Impl8187); - rule__RoleDecl__AliasAssignment_2_1(); - - state._fsp--; - - - } - - after(grammarAccess.getRoleDeclAccess().getAliasAssignment_2_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__RoleDecl__Group_2__1__Impl" - - - // $ANTLR start "rule__ParameterDecl__Group_0__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4052:1: rule__ParameterDecl__Group_0__0 : rule__ParameterDecl__Group_0__0__Impl rule__ParameterDecl__Group_0__1 ; - public final void rule__ParameterDecl__Group_0__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4056:1: ( rule__ParameterDecl__Group_0__0__Impl rule__ParameterDecl__Group_0__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4057:2: rule__ParameterDecl__Group_0__0__Impl rule__ParameterDecl__Group_0__1 - { - pushFollow(FOLLOW_rule__ParameterDecl__Group_0__0__Impl_in_rule__ParameterDecl__Group_0__08221); - rule__ParameterDecl__Group_0__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__ParameterDecl__Group_0__1_in_rule__ParameterDecl__Group_0__08224); - rule__ParameterDecl__Group_0__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ParameterDecl__Group_0__0" - - - // $ANTLR start "rule__ParameterDecl__Group_0__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4064:1: rule__ParameterDecl__Group_0__0__Impl : ( 'type' ) ; - public final void rule__ParameterDecl__Group_0__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4068:1: ( ( 'type' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4069:1: ( 'type' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4069:1: ( 'type' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4070:1: 'type' - { - before(grammarAccess.getParameterDeclAccess().getTypeKeyword_0_0()); - match(input,17,FOLLOW_17_in_rule__ParameterDecl__Group_0__0__Impl8252); - after(grammarAccess.getParameterDeclAccess().getTypeKeyword_0_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ParameterDecl__Group_0__0__Impl" - - - // $ANTLR start "rule__ParameterDecl__Group_0__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4083:1: rule__ParameterDecl__Group_0__1 : rule__ParameterDecl__Group_0__1__Impl rule__ParameterDecl__Group_0__2 ; - public final void rule__ParameterDecl__Group_0__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4087:1: ( rule__ParameterDecl__Group_0__1__Impl rule__ParameterDecl__Group_0__2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4088:2: rule__ParameterDecl__Group_0__1__Impl rule__ParameterDecl__Group_0__2 - { - pushFollow(FOLLOW_rule__ParameterDecl__Group_0__1__Impl_in_rule__ParameterDecl__Group_0__18283); - rule__ParameterDecl__Group_0__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__ParameterDecl__Group_0__2_in_rule__ParameterDecl__Group_0__18286); - rule__ParameterDecl__Group_0__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ParameterDecl__Group_0__1" - - - // $ANTLR start "rule__ParameterDecl__Group_0__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4095:1: rule__ParameterDecl__Group_0__1__Impl : ( ( rule__ParameterDecl__NameAssignment_0_1 ) ) ; - public final void rule__ParameterDecl__Group_0__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4099:1: ( ( ( rule__ParameterDecl__NameAssignment_0_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4100:1: ( ( rule__ParameterDecl__NameAssignment_0_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4100:1: ( ( rule__ParameterDecl__NameAssignment_0_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4101:1: ( rule__ParameterDecl__NameAssignment_0_1 ) - { - before(grammarAccess.getParameterDeclAccess().getNameAssignment_0_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4102:1: ( rule__ParameterDecl__NameAssignment_0_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4102:2: rule__ParameterDecl__NameAssignment_0_1 - { - pushFollow(FOLLOW_rule__ParameterDecl__NameAssignment_0_1_in_rule__ParameterDecl__Group_0__1__Impl8313); - rule__ParameterDecl__NameAssignment_0_1(); - - state._fsp--; - - - } - - after(grammarAccess.getParameterDeclAccess().getNameAssignment_0_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ParameterDecl__Group_0__1__Impl" - - - // $ANTLR start "rule__ParameterDecl__Group_0__2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4112:1: rule__ParameterDecl__Group_0__2 : rule__ParameterDecl__Group_0__2__Impl ; - public final void rule__ParameterDecl__Group_0__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4116:1: ( rule__ParameterDecl__Group_0__2__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4117:2: rule__ParameterDecl__Group_0__2__Impl - { - pushFollow(FOLLOW_rule__ParameterDecl__Group_0__2__Impl_in_rule__ParameterDecl__Group_0__28343); - rule__ParameterDecl__Group_0__2__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ParameterDecl__Group_0__2" - - - // $ANTLR start "rule__ParameterDecl__Group_0__2__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4123:1: rule__ParameterDecl__Group_0__2__Impl : ( ( rule__ParameterDecl__Group_0_2__0 )? ) ; - public final void rule__ParameterDecl__Group_0__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4127:1: ( ( ( rule__ParameterDecl__Group_0_2__0 )? ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4128:1: ( ( rule__ParameterDecl__Group_0_2__0 )? ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4128:1: ( ( rule__ParameterDecl__Group_0_2__0 )? ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4129:1: ( rule__ParameterDecl__Group_0_2__0 )? - { - before(grammarAccess.getParameterDeclAccess().getGroup_0_2()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4130:1: ( rule__ParameterDecl__Group_0_2__0 )? - int alt27=2; - int LA27_0 = input.LA(1); - - if ( (LA27_0==15) ) { - alt27=1; - } - switch (alt27) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4130:2: rule__ParameterDecl__Group_0_2__0 - { - pushFollow(FOLLOW_rule__ParameterDecl__Group_0_2__0_in_rule__ParameterDecl__Group_0__2__Impl8370); - rule__ParameterDecl__Group_0_2__0(); - - state._fsp--; - - - } - break; - - } - - after(grammarAccess.getParameterDeclAccess().getGroup_0_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ParameterDecl__Group_0__2__Impl" - - - // $ANTLR start "rule__ParameterDecl__Group_0_2__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4146:1: rule__ParameterDecl__Group_0_2__0 : rule__ParameterDecl__Group_0_2__0__Impl rule__ParameterDecl__Group_0_2__1 ; - public final void rule__ParameterDecl__Group_0_2__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4150:1: ( rule__ParameterDecl__Group_0_2__0__Impl rule__ParameterDecl__Group_0_2__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4151:2: rule__ParameterDecl__Group_0_2__0__Impl rule__ParameterDecl__Group_0_2__1 - { - pushFollow(FOLLOW_rule__ParameterDecl__Group_0_2__0__Impl_in_rule__ParameterDecl__Group_0_2__08407); - rule__ParameterDecl__Group_0_2__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__ParameterDecl__Group_0_2__1_in_rule__ParameterDecl__Group_0_2__08410); - rule__ParameterDecl__Group_0_2__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ParameterDecl__Group_0_2__0" - - - // $ANTLR start "rule__ParameterDecl__Group_0_2__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4158:1: rule__ParameterDecl__Group_0_2__0__Impl : ( 'as' ) ; - public final void rule__ParameterDecl__Group_0_2__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4162:1: ( ( 'as' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4163:1: ( 'as' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4163:1: ( 'as' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4164:1: 'as' - { - before(grammarAccess.getParameterDeclAccess().getAsKeyword_0_2_0()); - match(input,15,FOLLOW_15_in_rule__ParameterDecl__Group_0_2__0__Impl8438); - after(grammarAccess.getParameterDeclAccess().getAsKeyword_0_2_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ParameterDecl__Group_0_2__0__Impl" - - - // $ANTLR start "rule__ParameterDecl__Group_0_2__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4177:1: rule__ParameterDecl__Group_0_2__1 : rule__ParameterDecl__Group_0_2__1__Impl ; - public final void rule__ParameterDecl__Group_0_2__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4181:1: ( rule__ParameterDecl__Group_0_2__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4182:2: rule__ParameterDecl__Group_0_2__1__Impl - { - pushFollow(FOLLOW_rule__ParameterDecl__Group_0_2__1__Impl_in_rule__ParameterDecl__Group_0_2__18469); - rule__ParameterDecl__Group_0_2__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ParameterDecl__Group_0_2__1" - - - // $ANTLR start "rule__ParameterDecl__Group_0_2__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4188:1: rule__ParameterDecl__Group_0_2__1__Impl : ( ( rule__ParameterDecl__AliasAssignment_0_2_1 ) ) ; - public final void rule__ParameterDecl__Group_0_2__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4192:1: ( ( ( rule__ParameterDecl__AliasAssignment_0_2_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4193:1: ( ( rule__ParameterDecl__AliasAssignment_0_2_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4193:1: ( ( rule__ParameterDecl__AliasAssignment_0_2_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4194:1: ( rule__ParameterDecl__AliasAssignment_0_2_1 ) - { - before(grammarAccess.getParameterDeclAccess().getAliasAssignment_0_2_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4195:1: ( rule__ParameterDecl__AliasAssignment_0_2_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4195:2: rule__ParameterDecl__AliasAssignment_0_2_1 - { - pushFollow(FOLLOW_rule__ParameterDecl__AliasAssignment_0_2_1_in_rule__ParameterDecl__Group_0_2__1__Impl8496); - rule__ParameterDecl__AliasAssignment_0_2_1(); - - state._fsp--; - - - } - - after(grammarAccess.getParameterDeclAccess().getAliasAssignment_0_2_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ParameterDecl__Group_0_2__1__Impl" - - - // $ANTLR start "rule__ParameterDecl__Group_1__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4209:1: rule__ParameterDecl__Group_1__0 : rule__ParameterDecl__Group_1__0__Impl rule__ParameterDecl__Group_1__1 ; - public final void rule__ParameterDecl__Group_1__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4213:1: ( rule__ParameterDecl__Group_1__0__Impl rule__ParameterDecl__Group_1__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4214:2: rule__ParameterDecl__Group_1__0__Impl rule__ParameterDecl__Group_1__1 - { - pushFollow(FOLLOW_rule__ParameterDecl__Group_1__0__Impl_in_rule__ParameterDecl__Group_1__08530); - rule__ParameterDecl__Group_1__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__ParameterDecl__Group_1__1_in_rule__ParameterDecl__Group_1__08533); - rule__ParameterDecl__Group_1__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ParameterDecl__Group_1__0" - - - // $ANTLR start "rule__ParameterDecl__Group_1__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4221:1: rule__ParameterDecl__Group_1__0__Impl : ( 'sig' ) ; - public final void rule__ParameterDecl__Group_1__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4225:1: ( ( 'sig' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4226:1: ( 'sig' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4226:1: ( 'sig' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4227:1: 'sig' - { - before(grammarAccess.getParameterDeclAccess().getSigKeyword_1_0()); - match(input,28,FOLLOW_28_in_rule__ParameterDecl__Group_1__0__Impl8561); - after(grammarAccess.getParameterDeclAccess().getSigKeyword_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ParameterDecl__Group_1__0__Impl" - - - // $ANTLR start "rule__ParameterDecl__Group_1__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4240:1: rule__ParameterDecl__Group_1__1 : rule__ParameterDecl__Group_1__1__Impl rule__ParameterDecl__Group_1__2 ; - public final void rule__ParameterDecl__Group_1__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4244:1: ( rule__ParameterDecl__Group_1__1__Impl rule__ParameterDecl__Group_1__2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4245:2: rule__ParameterDecl__Group_1__1__Impl rule__ParameterDecl__Group_1__2 - { - pushFollow(FOLLOW_rule__ParameterDecl__Group_1__1__Impl_in_rule__ParameterDecl__Group_1__18592); - rule__ParameterDecl__Group_1__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__ParameterDecl__Group_1__2_in_rule__ParameterDecl__Group_1__18595); - rule__ParameterDecl__Group_1__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ParameterDecl__Group_1__1" - - - // $ANTLR start "rule__ParameterDecl__Group_1__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4252:1: rule__ParameterDecl__Group_1__1__Impl : ( ( rule__ParameterDecl__NameAssignment_1_1 ) ) ; - public final void rule__ParameterDecl__Group_1__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4256:1: ( ( ( rule__ParameterDecl__NameAssignment_1_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4257:1: ( ( rule__ParameterDecl__NameAssignment_1_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4257:1: ( ( rule__ParameterDecl__NameAssignment_1_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4258:1: ( rule__ParameterDecl__NameAssignment_1_1 ) - { - before(grammarAccess.getParameterDeclAccess().getNameAssignment_1_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4259:1: ( rule__ParameterDecl__NameAssignment_1_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4259:2: rule__ParameterDecl__NameAssignment_1_1 - { - pushFollow(FOLLOW_rule__ParameterDecl__NameAssignment_1_1_in_rule__ParameterDecl__Group_1__1__Impl8622); - rule__ParameterDecl__NameAssignment_1_1(); - - state._fsp--; - - - } - - after(grammarAccess.getParameterDeclAccess().getNameAssignment_1_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ParameterDecl__Group_1__1__Impl" - - - // $ANTLR start "rule__ParameterDecl__Group_1__2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4269:1: rule__ParameterDecl__Group_1__2 : rule__ParameterDecl__Group_1__2__Impl ; - public final void rule__ParameterDecl__Group_1__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4273:1: ( rule__ParameterDecl__Group_1__2__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4274:2: rule__ParameterDecl__Group_1__2__Impl - { - pushFollow(FOLLOW_rule__ParameterDecl__Group_1__2__Impl_in_rule__ParameterDecl__Group_1__28652); - rule__ParameterDecl__Group_1__2__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ParameterDecl__Group_1__2" - - - // $ANTLR start "rule__ParameterDecl__Group_1__2__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4280:1: rule__ParameterDecl__Group_1__2__Impl : ( ( rule__ParameterDecl__Group_1_2__0 )? ) ; - public final void rule__ParameterDecl__Group_1__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4284:1: ( ( ( rule__ParameterDecl__Group_1_2__0 )? ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4285:1: ( ( rule__ParameterDecl__Group_1_2__0 )? ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4285:1: ( ( rule__ParameterDecl__Group_1_2__0 )? ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4286:1: ( rule__ParameterDecl__Group_1_2__0 )? - { - before(grammarAccess.getParameterDeclAccess().getGroup_1_2()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4287:1: ( rule__ParameterDecl__Group_1_2__0 )? - int alt28=2; - int LA28_0 = input.LA(1); - - if ( (LA28_0==15) ) { - alt28=1; - } - switch (alt28) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4287:2: rule__ParameterDecl__Group_1_2__0 - { - pushFollow(FOLLOW_rule__ParameterDecl__Group_1_2__0_in_rule__ParameterDecl__Group_1__2__Impl8679); - rule__ParameterDecl__Group_1_2__0(); - - state._fsp--; - - - } - break; - - } - - after(grammarAccess.getParameterDeclAccess().getGroup_1_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ParameterDecl__Group_1__2__Impl" - - - // $ANTLR start "rule__ParameterDecl__Group_1_2__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4303:1: rule__ParameterDecl__Group_1_2__0 : rule__ParameterDecl__Group_1_2__0__Impl rule__ParameterDecl__Group_1_2__1 ; - public final void rule__ParameterDecl__Group_1_2__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4307:1: ( rule__ParameterDecl__Group_1_2__0__Impl rule__ParameterDecl__Group_1_2__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4308:2: rule__ParameterDecl__Group_1_2__0__Impl rule__ParameterDecl__Group_1_2__1 - { - pushFollow(FOLLOW_rule__ParameterDecl__Group_1_2__0__Impl_in_rule__ParameterDecl__Group_1_2__08716); - rule__ParameterDecl__Group_1_2__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__ParameterDecl__Group_1_2__1_in_rule__ParameterDecl__Group_1_2__08719); - rule__ParameterDecl__Group_1_2__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ParameterDecl__Group_1_2__0" - - - // $ANTLR start "rule__ParameterDecl__Group_1_2__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4315:1: rule__ParameterDecl__Group_1_2__0__Impl : ( 'as' ) ; - public final void rule__ParameterDecl__Group_1_2__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4319:1: ( ( 'as' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4320:1: ( 'as' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4320:1: ( 'as' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4321:1: 'as' - { - before(grammarAccess.getParameterDeclAccess().getAsKeyword_1_2_0()); - match(input,15,FOLLOW_15_in_rule__ParameterDecl__Group_1_2__0__Impl8747); - after(grammarAccess.getParameterDeclAccess().getAsKeyword_1_2_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ParameterDecl__Group_1_2__0__Impl" - - - // $ANTLR start "rule__ParameterDecl__Group_1_2__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4334:1: rule__ParameterDecl__Group_1_2__1 : rule__ParameterDecl__Group_1_2__1__Impl ; - public final void rule__ParameterDecl__Group_1_2__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4338:1: ( rule__ParameterDecl__Group_1_2__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4339:2: rule__ParameterDecl__Group_1_2__1__Impl - { - pushFollow(FOLLOW_rule__ParameterDecl__Group_1_2__1__Impl_in_rule__ParameterDecl__Group_1_2__18778); - rule__ParameterDecl__Group_1_2__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ParameterDecl__Group_1_2__1" - - - // $ANTLR start "rule__ParameterDecl__Group_1_2__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4345:1: rule__ParameterDecl__Group_1_2__1__Impl : ( ( rule__ParameterDecl__AliasAssignment_1_2_1 ) ) ; - public final void rule__ParameterDecl__Group_1_2__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4349:1: ( ( ( rule__ParameterDecl__AliasAssignment_1_2_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4350:1: ( ( rule__ParameterDecl__AliasAssignment_1_2_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4350:1: ( ( rule__ParameterDecl__AliasAssignment_1_2_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4351:1: ( rule__ParameterDecl__AliasAssignment_1_2_1 ) - { - before(grammarAccess.getParameterDeclAccess().getAliasAssignment_1_2_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4352:1: ( rule__ParameterDecl__AliasAssignment_1_2_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4352:2: rule__ParameterDecl__AliasAssignment_1_2_1 - { - pushFollow(FOLLOW_rule__ParameterDecl__AliasAssignment_1_2_1_in_rule__ParameterDecl__Group_1_2__1__Impl8805); - rule__ParameterDecl__AliasAssignment_1_2_1(); - - state._fsp--; - - - } - - after(grammarAccess.getParameterDeclAccess().getAliasAssignment_1_2_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ParameterDecl__Group_1_2__1__Impl" - - - // $ANTLR start "rule__RoleInstantiation__Group__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4366:1: rule__RoleInstantiation__Group__0 : rule__RoleInstantiation__Group__0__Impl rule__RoleInstantiation__Group__1 ; - public final void rule__RoleInstantiation__Group__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4370:1: ( rule__RoleInstantiation__Group__0__Impl rule__RoleInstantiation__Group__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4371:2: rule__RoleInstantiation__Group__0__Impl rule__RoleInstantiation__Group__1 - { - pushFollow(FOLLOW_rule__RoleInstantiation__Group__0__Impl_in_rule__RoleInstantiation__Group__08839); - rule__RoleInstantiation__Group__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__RoleInstantiation__Group__1_in_rule__RoleInstantiation__Group__08842); - rule__RoleInstantiation__Group__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__RoleInstantiation__Group__0" - - - // $ANTLR start "rule__RoleInstantiation__Group__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4378:1: rule__RoleInstantiation__Group__0__Impl : ( ( rule__RoleInstantiation__NameAssignment_0 ) ) ; - public final void rule__RoleInstantiation__Group__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4382:1: ( ( ( rule__RoleInstantiation__NameAssignment_0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4383:1: ( ( rule__RoleInstantiation__NameAssignment_0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4383:1: ( ( rule__RoleInstantiation__NameAssignment_0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4384:1: ( rule__RoleInstantiation__NameAssignment_0 ) - { - before(grammarAccess.getRoleInstantiationAccess().getNameAssignment_0()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4385:1: ( rule__RoleInstantiation__NameAssignment_0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4385:2: rule__RoleInstantiation__NameAssignment_0 - { - pushFollow(FOLLOW_rule__RoleInstantiation__NameAssignment_0_in_rule__RoleInstantiation__Group__0__Impl8869); - rule__RoleInstantiation__NameAssignment_0(); - - state._fsp--; - - - } - - after(grammarAccess.getRoleInstantiationAccess().getNameAssignment_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__RoleInstantiation__Group__0__Impl" - - - // $ANTLR start "rule__RoleInstantiation__Group__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4395:1: rule__RoleInstantiation__Group__1 : rule__RoleInstantiation__Group__1__Impl ; - public final void rule__RoleInstantiation__Group__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4399:1: ( rule__RoleInstantiation__Group__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4400:2: rule__RoleInstantiation__Group__1__Impl - { - pushFollow(FOLLOW_rule__RoleInstantiation__Group__1__Impl_in_rule__RoleInstantiation__Group__18899); - rule__RoleInstantiation__Group__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__RoleInstantiation__Group__1" - - - // $ANTLR start "rule__RoleInstantiation__Group__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4406:1: rule__RoleInstantiation__Group__1__Impl : ( ( rule__RoleInstantiation__Group_1__0 )? ) ; - public final void rule__RoleInstantiation__Group__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4410:1: ( ( ( rule__RoleInstantiation__Group_1__0 )? ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4411:1: ( ( rule__RoleInstantiation__Group_1__0 )? ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4411:1: ( ( rule__RoleInstantiation__Group_1__0 )? ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4412:1: ( rule__RoleInstantiation__Group_1__0 )? - { - before(grammarAccess.getRoleInstantiationAccess().getGroup_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4413:1: ( rule__RoleInstantiation__Group_1__0 )? - int alt29=2; - int LA29_0 = input.LA(1); - - if ( (LA29_0==15) ) { - alt29=1; - } - switch (alt29) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4413:2: rule__RoleInstantiation__Group_1__0 - { - pushFollow(FOLLOW_rule__RoleInstantiation__Group_1__0_in_rule__RoleInstantiation__Group__1__Impl8926); - rule__RoleInstantiation__Group_1__0(); - - state._fsp--; - - - } - break; - - } - - after(grammarAccess.getRoleInstantiationAccess().getGroup_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__RoleInstantiation__Group__1__Impl" - - - // $ANTLR start "rule__RoleInstantiation__Group_1__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4427:1: rule__RoleInstantiation__Group_1__0 : rule__RoleInstantiation__Group_1__0__Impl rule__RoleInstantiation__Group_1__1 ; - public final void rule__RoleInstantiation__Group_1__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4431:1: ( rule__RoleInstantiation__Group_1__0__Impl rule__RoleInstantiation__Group_1__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4432:2: rule__RoleInstantiation__Group_1__0__Impl rule__RoleInstantiation__Group_1__1 - { - pushFollow(FOLLOW_rule__RoleInstantiation__Group_1__0__Impl_in_rule__RoleInstantiation__Group_1__08961); - rule__RoleInstantiation__Group_1__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__RoleInstantiation__Group_1__1_in_rule__RoleInstantiation__Group_1__08964); - rule__RoleInstantiation__Group_1__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__RoleInstantiation__Group_1__0" - - - // $ANTLR start "rule__RoleInstantiation__Group_1__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4439:1: rule__RoleInstantiation__Group_1__0__Impl : ( 'as' ) ; - public final void rule__RoleInstantiation__Group_1__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4443:1: ( ( 'as' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4444:1: ( 'as' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4444:1: ( 'as' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4445:1: 'as' - { - before(grammarAccess.getRoleInstantiationAccess().getAsKeyword_1_0()); - match(input,15,FOLLOW_15_in_rule__RoleInstantiation__Group_1__0__Impl8992); - after(grammarAccess.getRoleInstantiationAccess().getAsKeyword_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__RoleInstantiation__Group_1__0__Impl" - - - // $ANTLR start "rule__RoleInstantiation__Group_1__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4458:1: rule__RoleInstantiation__Group_1__1 : rule__RoleInstantiation__Group_1__1__Impl ; - public final void rule__RoleInstantiation__Group_1__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4462:1: ( rule__RoleInstantiation__Group_1__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4463:2: rule__RoleInstantiation__Group_1__1__Impl - { - pushFollow(FOLLOW_rule__RoleInstantiation__Group_1__1__Impl_in_rule__RoleInstantiation__Group_1__19023); - rule__RoleInstantiation__Group_1__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__RoleInstantiation__Group_1__1" - - - // $ANTLR start "rule__RoleInstantiation__Group_1__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4469:1: rule__RoleInstantiation__Group_1__1__Impl : ( ( rule__RoleInstantiation__AliasAssignment_1_1 ) ) ; - public final void rule__RoleInstantiation__Group_1__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4473:1: ( ( ( rule__RoleInstantiation__AliasAssignment_1_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4474:1: ( ( rule__RoleInstantiation__AliasAssignment_1_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4474:1: ( ( rule__RoleInstantiation__AliasAssignment_1_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4475:1: ( rule__RoleInstantiation__AliasAssignment_1_1 ) - { - before(grammarAccess.getRoleInstantiationAccess().getAliasAssignment_1_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4476:1: ( rule__RoleInstantiation__AliasAssignment_1_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4476:2: rule__RoleInstantiation__AliasAssignment_1_1 - { - pushFollow(FOLLOW_rule__RoleInstantiation__AliasAssignment_1_1_in_rule__RoleInstantiation__Group_1__1__Impl9050); - rule__RoleInstantiation__AliasAssignment_1_1(); - - state._fsp--; - - - } - - after(grammarAccess.getRoleInstantiationAccess().getAliasAssignment_1_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__RoleInstantiation__Group_1__1__Impl" - - - // $ANTLR start "rule__Argument__Group_0__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4490:1: rule__Argument__Group_0__0 : rule__Argument__Group_0__0__Impl rule__Argument__Group_0__1 ; - public final void rule__Argument__Group_0__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4494:1: ( rule__Argument__Group_0__0__Impl rule__Argument__Group_0__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4495:2: rule__Argument__Group_0__0__Impl rule__Argument__Group_0__1 - { - pushFollow(FOLLOW_rule__Argument__Group_0__0__Impl_in_rule__Argument__Group_0__09084); - rule__Argument__Group_0__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Argument__Group_0__1_in_rule__Argument__Group_0__09087); - rule__Argument__Group_0__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Argument__Group_0__0" - - - // $ANTLR start "rule__Argument__Group_0__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4502:1: rule__Argument__Group_0__0__Impl : ( ( rule__Argument__SignatureAssignment_0_0 ) ) ; - public final void rule__Argument__Group_0__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4506:1: ( ( ( rule__Argument__SignatureAssignment_0_0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4507:1: ( ( rule__Argument__SignatureAssignment_0_0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4507:1: ( ( rule__Argument__SignatureAssignment_0_0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4508:1: ( rule__Argument__SignatureAssignment_0_0 ) - { - before(grammarAccess.getArgumentAccess().getSignatureAssignment_0_0()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4509:1: ( rule__Argument__SignatureAssignment_0_0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4509:2: rule__Argument__SignatureAssignment_0_0 - { - pushFollow(FOLLOW_rule__Argument__SignatureAssignment_0_0_in_rule__Argument__Group_0__0__Impl9114); - rule__Argument__SignatureAssignment_0_0(); - - state._fsp--; - - - } - - after(grammarAccess.getArgumentAccess().getSignatureAssignment_0_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Argument__Group_0__0__Impl" - - - // $ANTLR start "rule__Argument__Group_0__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4519:1: rule__Argument__Group_0__1 : rule__Argument__Group_0__1__Impl ; - public final void rule__Argument__Group_0__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4523:1: ( rule__Argument__Group_0__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4524:2: rule__Argument__Group_0__1__Impl - { - pushFollow(FOLLOW_rule__Argument__Group_0__1__Impl_in_rule__Argument__Group_0__19144); - rule__Argument__Group_0__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Argument__Group_0__1" - - - // $ANTLR start "rule__Argument__Group_0__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4530:1: rule__Argument__Group_0__1__Impl : ( ( rule__Argument__Group_0_1__0 )? ) ; - public final void rule__Argument__Group_0__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4534:1: ( ( ( rule__Argument__Group_0_1__0 )? ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4535:1: ( ( rule__Argument__Group_0_1__0 )? ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4535:1: ( ( rule__Argument__Group_0_1__0 )? ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4536:1: ( rule__Argument__Group_0_1__0 )? - { - before(grammarAccess.getArgumentAccess().getGroup_0_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4537:1: ( rule__Argument__Group_0_1__0 )? - int alt30=2; - int LA30_0 = input.LA(1); - - if ( (LA30_0==15) ) { - alt30=1; - } - switch (alt30) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4537:2: rule__Argument__Group_0_1__0 - { - pushFollow(FOLLOW_rule__Argument__Group_0_1__0_in_rule__Argument__Group_0__1__Impl9171); - rule__Argument__Group_0_1__0(); - - state._fsp--; - - - } - break; - - } - - after(grammarAccess.getArgumentAccess().getGroup_0_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Argument__Group_0__1__Impl" - - - // $ANTLR start "rule__Argument__Group_0_1__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4551:1: rule__Argument__Group_0_1__0 : rule__Argument__Group_0_1__0__Impl rule__Argument__Group_0_1__1 ; - public final void rule__Argument__Group_0_1__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4555:1: ( rule__Argument__Group_0_1__0__Impl rule__Argument__Group_0_1__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4556:2: rule__Argument__Group_0_1__0__Impl rule__Argument__Group_0_1__1 - { - pushFollow(FOLLOW_rule__Argument__Group_0_1__0__Impl_in_rule__Argument__Group_0_1__09206); - rule__Argument__Group_0_1__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Argument__Group_0_1__1_in_rule__Argument__Group_0_1__09209); - rule__Argument__Group_0_1__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Argument__Group_0_1__0" - - - // $ANTLR start "rule__Argument__Group_0_1__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4563:1: rule__Argument__Group_0_1__0__Impl : ( 'as' ) ; - public final void rule__Argument__Group_0_1__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4567:1: ( ( 'as' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4568:1: ( 'as' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4568:1: ( 'as' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4569:1: 'as' - { - before(grammarAccess.getArgumentAccess().getAsKeyword_0_1_0()); - match(input,15,FOLLOW_15_in_rule__Argument__Group_0_1__0__Impl9237); - after(grammarAccess.getArgumentAccess().getAsKeyword_0_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Argument__Group_0_1__0__Impl" - - - // $ANTLR start "rule__Argument__Group_0_1__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4582:1: rule__Argument__Group_0_1__1 : rule__Argument__Group_0_1__1__Impl ; - public final void rule__Argument__Group_0_1__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4586:1: ( rule__Argument__Group_0_1__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4587:2: rule__Argument__Group_0_1__1__Impl - { - pushFollow(FOLLOW_rule__Argument__Group_0_1__1__Impl_in_rule__Argument__Group_0_1__19268); - rule__Argument__Group_0_1__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Argument__Group_0_1__1" - - - // $ANTLR start "rule__Argument__Group_0_1__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4593:1: rule__Argument__Group_0_1__1__Impl : ( ( rule__Argument__AliasAssignment_0_1_1 ) ) ; - public final void rule__Argument__Group_0_1__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4597:1: ( ( ( rule__Argument__AliasAssignment_0_1_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4598:1: ( ( rule__Argument__AliasAssignment_0_1_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4598:1: ( ( rule__Argument__AliasAssignment_0_1_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4599:1: ( rule__Argument__AliasAssignment_0_1_1 ) - { - before(grammarAccess.getArgumentAccess().getAliasAssignment_0_1_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4600:1: ( rule__Argument__AliasAssignment_0_1_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4600:2: rule__Argument__AliasAssignment_0_1_1 - { - pushFollow(FOLLOW_rule__Argument__AliasAssignment_0_1_1_in_rule__Argument__Group_0_1__1__Impl9295); - rule__Argument__AliasAssignment_0_1_1(); - - state._fsp--; - - - } - - after(grammarAccess.getArgumentAccess().getAliasAssignment_0_1_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Argument__Group_0_1__1__Impl" - - - // $ANTLR start "rule__Argument__Group_1__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4614:1: rule__Argument__Group_1__0 : rule__Argument__Group_1__0__Impl rule__Argument__Group_1__1 ; - public final void rule__Argument__Group_1__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4618:1: ( rule__Argument__Group_1__0__Impl rule__Argument__Group_1__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4619:2: rule__Argument__Group_1__0__Impl rule__Argument__Group_1__1 - { - pushFollow(FOLLOW_rule__Argument__Group_1__0__Impl_in_rule__Argument__Group_1__09329); - rule__Argument__Group_1__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Argument__Group_1__1_in_rule__Argument__Group_1__09332); - rule__Argument__Group_1__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Argument__Group_1__0" - - - // $ANTLR start "rule__Argument__Group_1__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4626:1: rule__Argument__Group_1__0__Impl : ( ( rule__Argument__NameAssignment_1_0 ) ) ; - public final void rule__Argument__Group_1__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4630:1: ( ( ( rule__Argument__NameAssignment_1_0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4631:1: ( ( rule__Argument__NameAssignment_1_0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4631:1: ( ( rule__Argument__NameAssignment_1_0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4632:1: ( rule__Argument__NameAssignment_1_0 ) - { - before(grammarAccess.getArgumentAccess().getNameAssignment_1_0()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4633:1: ( rule__Argument__NameAssignment_1_0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4633:2: rule__Argument__NameAssignment_1_0 - { - pushFollow(FOLLOW_rule__Argument__NameAssignment_1_0_in_rule__Argument__Group_1__0__Impl9359); - rule__Argument__NameAssignment_1_0(); - - state._fsp--; - - - } - - after(grammarAccess.getArgumentAccess().getNameAssignment_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Argument__Group_1__0__Impl" - - - // $ANTLR start "rule__Argument__Group_1__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4643:1: rule__Argument__Group_1__1 : rule__Argument__Group_1__1__Impl ; - public final void rule__Argument__Group_1__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4647:1: ( rule__Argument__Group_1__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4648:2: rule__Argument__Group_1__1__Impl - { - pushFollow(FOLLOW_rule__Argument__Group_1__1__Impl_in_rule__Argument__Group_1__19389); - rule__Argument__Group_1__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Argument__Group_1__1" - - - // $ANTLR start "rule__Argument__Group_1__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4654:1: rule__Argument__Group_1__1__Impl : ( ( rule__Argument__Group_1_1__0 )? ) ; - public final void rule__Argument__Group_1__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4658:1: ( ( ( rule__Argument__Group_1_1__0 )? ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4659:1: ( ( rule__Argument__Group_1_1__0 )? ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4659:1: ( ( rule__Argument__Group_1_1__0 )? ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4660:1: ( rule__Argument__Group_1_1__0 )? - { - before(grammarAccess.getArgumentAccess().getGroup_1_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4661:1: ( rule__Argument__Group_1_1__0 )? - int alt31=2; - int LA31_0 = input.LA(1); - - if ( (LA31_0==15) ) { - alt31=1; - } - switch (alt31) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4661:2: rule__Argument__Group_1_1__0 - { - pushFollow(FOLLOW_rule__Argument__Group_1_1__0_in_rule__Argument__Group_1__1__Impl9416); - rule__Argument__Group_1_1__0(); - - state._fsp--; - - - } - break; - - } - - after(grammarAccess.getArgumentAccess().getGroup_1_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Argument__Group_1__1__Impl" - - - // $ANTLR start "rule__Argument__Group_1_1__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4675:1: rule__Argument__Group_1_1__0 : rule__Argument__Group_1_1__0__Impl rule__Argument__Group_1_1__1 ; - public final void rule__Argument__Group_1_1__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4679:1: ( rule__Argument__Group_1_1__0__Impl rule__Argument__Group_1_1__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4680:2: rule__Argument__Group_1_1__0__Impl rule__Argument__Group_1_1__1 - { - pushFollow(FOLLOW_rule__Argument__Group_1_1__0__Impl_in_rule__Argument__Group_1_1__09451); - rule__Argument__Group_1_1__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Argument__Group_1_1__1_in_rule__Argument__Group_1_1__09454); - rule__Argument__Group_1_1__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Argument__Group_1_1__0" - - - // $ANTLR start "rule__Argument__Group_1_1__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4687:1: rule__Argument__Group_1_1__0__Impl : ( 'as' ) ; - public final void rule__Argument__Group_1_1__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4691:1: ( ( 'as' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4692:1: ( 'as' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4692:1: ( 'as' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4693:1: 'as' - { - before(grammarAccess.getArgumentAccess().getAsKeyword_1_1_0()); - match(input,15,FOLLOW_15_in_rule__Argument__Group_1_1__0__Impl9482); - after(grammarAccess.getArgumentAccess().getAsKeyword_1_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Argument__Group_1_1__0__Impl" - - - // $ANTLR start "rule__Argument__Group_1_1__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4706:1: rule__Argument__Group_1_1__1 : rule__Argument__Group_1_1__1__Impl ; - public final void rule__Argument__Group_1_1__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4710:1: ( rule__Argument__Group_1_1__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4711:2: rule__Argument__Group_1_1__1__Impl - { - pushFollow(FOLLOW_rule__Argument__Group_1_1__1__Impl_in_rule__Argument__Group_1_1__19513); - rule__Argument__Group_1_1__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Argument__Group_1_1__1" - - - // $ANTLR start "rule__Argument__Group_1_1__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4717:1: rule__Argument__Group_1_1__1__Impl : ( ( rule__Argument__AliasAssignment_1_1_1 ) ) ; - public final void rule__Argument__Group_1_1__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4721:1: ( ( ( rule__Argument__AliasAssignment_1_1_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4722:1: ( ( rule__Argument__AliasAssignment_1_1_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4722:1: ( ( rule__Argument__AliasAssignment_1_1_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4723:1: ( rule__Argument__AliasAssignment_1_1_1 ) - { - before(grammarAccess.getArgumentAccess().getAliasAssignment_1_1_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4724:1: ( rule__Argument__AliasAssignment_1_1_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4724:2: rule__Argument__AliasAssignment_1_1_1 - { - pushFollow(FOLLOW_rule__Argument__AliasAssignment_1_1_1_in_rule__Argument__Group_1_1__1__Impl9540); - rule__Argument__AliasAssignment_1_1_1(); - - state._fsp--; - - - } - - after(grammarAccess.getArgumentAccess().getAliasAssignment_1_1_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Argument__Group_1_1__1__Impl" - - - // $ANTLR start "rule__GlobalProtocolBlock__Group__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4738:1: rule__GlobalProtocolBlock__Group__0 : rule__GlobalProtocolBlock__Group__0__Impl rule__GlobalProtocolBlock__Group__1 ; - public final void rule__GlobalProtocolBlock__Group__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4742:1: ( rule__GlobalProtocolBlock__Group__0__Impl rule__GlobalProtocolBlock__Group__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4743:2: rule__GlobalProtocolBlock__Group__0__Impl rule__GlobalProtocolBlock__Group__1 - { - pushFollow(FOLLOW_rule__GlobalProtocolBlock__Group__0__Impl_in_rule__GlobalProtocolBlock__Group__09574); - rule__GlobalProtocolBlock__Group__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalProtocolBlock__Group__1_in_rule__GlobalProtocolBlock__Group__09577); - rule__GlobalProtocolBlock__Group__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolBlock__Group__0" - - - // $ANTLR start "rule__GlobalProtocolBlock__Group__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4750:1: rule__GlobalProtocolBlock__Group__0__Impl : ( () ) ; - public final void rule__GlobalProtocolBlock__Group__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4754:1: ( ( () ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4755:1: ( () ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4755:1: ( () ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4756:1: () - { - before(grammarAccess.getGlobalProtocolBlockAccess().getGlobalProtocolBlockAction_0()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4757:1: () - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4759:1: - { - } - - after(grammarAccess.getGlobalProtocolBlockAccess().getGlobalProtocolBlockAction_0()); - - } - - - } - - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolBlock__Group__0__Impl" - - - // $ANTLR start "rule__GlobalProtocolBlock__Group__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4769:1: rule__GlobalProtocolBlock__Group__1 : rule__GlobalProtocolBlock__Group__1__Impl rule__GlobalProtocolBlock__Group__2 ; - public final void rule__GlobalProtocolBlock__Group__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4773:1: ( rule__GlobalProtocolBlock__Group__1__Impl rule__GlobalProtocolBlock__Group__2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4774:2: rule__GlobalProtocolBlock__Group__1__Impl rule__GlobalProtocolBlock__Group__2 - { - pushFollow(FOLLOW_rule__GlobalProtocolBlock__Group__1__Impl_in_rule__GlobalProtocolBlock__Group__19635); - rule__GlobalProtocolBlock__Group__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalProtocolBlock__Group__2_in_rule__GlobalProtocolBlock__Group__19638); - rule__GlobalProtocolBlock__Group__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolBlock__Group__1" - - - // $ANTLR start "rule__GlobalProtocolBlock__Group__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4781:1: rule__GlobalProtocolBlock__Group__1__Impl : ( '{' ) ; - public final void rule__GlobalProtocolBlock__Group__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4785:1: ( ( '{' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4786:1: ( '{' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4786:1: ( '{' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4787:1: '{' - { - before(grammarAccess.getGlobalProtocolBlockAccess().getLeftCurlyBracketKeyword_1()); - match(input,29,FOLLOW_29_in_rule__GlobalProtocolBlock__Group__1__Impl9666); - after(grammarAccess.getGlobalProtocolBlockAccess().getLeftCurlyBracketKeyword_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolBlock__Group__1__Impl" - - - // $ANTLR start "rule__GlobalProtocolBlock__Group__2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4800:1: rule__GlobalProtocolBlock__Group__2 : rule__GlobalProtocolBlock__Group__2__Impl rule__GlobalProtocolBlock__Group__3 ; - public final void rule__GlobalProtocolBlock__Group__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4804:1: ( rule__GlobalProtocolBlock__Group__2__Impl rule__GlobalProtocolBlock__Group__3 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4805:2: rule__GlobalProtocolBlock__Group__2__Impl rule__GlobalProtocolBlock__Group__3 - { - pushFollow(FOLLOW_rule__GlobalProtocolBlock__Group__2__Impl_in_rule__GlobalProtocolBlock__Group__29697); - rule__GlobalProtocolBlock__Group__2__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalProtocolBlock__Group__3_in_rule__GlobalProtocolBlock__Group__29700); - rule__GlobalProtocolBlock__Group__3(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolBlock__Group__2" - - - // $ANTLR start "rule__GlobalProtocolBlock__Group__2__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4812:1: rule__GlobalProtocolBlock__Group__2__Impl : ( ( rule__GlobalProtocolBlock__ActivitiesAssignment_2 )* ) ; - public final void rule__GlobalProtocolBlock__Group__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4816:1: ( ( ( rule__GlobalProtocolBlock__ActivitiesAssignment_2 )* ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4817:1: ( ( rule__GlobalProtocolBlock__ActivitiesAssignment_2 )* ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4817:1: ( ( rule__GlobalProtocolBlock__ActivitiesAssignment_2 )* ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4818:1: ( rule__GlobalProtocolBlock__ActivitiesAssignment_2 )* - { - before(grammarAccess.getGlobalProtocolBlockAccess().getActivitiesAssignment_2()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4819:1: ( rule__GlobalProtocolBlock__ActivitiesAssignment_2 )* - loop32: - do { - int alt32=2; - int LA32_0 = input.LA(1); - - if ( (LA32_0==RULE_ID||LA32_0==20||LA32_0==32||(LA32_0>=35 && LA32_0<=37)||LA32_0==39||LA32_0==42) ) { - alt32=1; - } - - - switch (alt32) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4819:2: rule__GlobalProtocolBlock__ActivitiesAssignment_2 - { - pushFollow(FOLLOW_rule__GlobalProtocolBlock__ActivitiesAssignment_2_in_rule__GlobalProtocolBlock__Group__2__Impl9727); - rule__GlobalProtocolBlock__ActivitiesAssignment_2(); - - state._fsp--; - - - } - break; - - default : - break loop32; - } - } while (true); - - after(grammarAccess.getGlobalProtocolBlockAccess().getActivitiesAssignment_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolBlock__Group__2__Impl" - - - // $ANTLR start "rule__GlobalProtocolBlock__Group__3" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4829:1: rule__GlobalProtocolBlock__Group__3 : rule__GlobalProtocolBlock__Group__3__Impl ; - public final void rule__GlobalProtocolBlock__Group__3() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4833:1: ( rule__GlobalProtocolBlock__Group__3__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4834:2: rule__GlobalProtocolBlock__Group__3__Impl - { - pushFollow(FOLLOW_rule__GlobalProtocolBlock__Group__3__Impl_in_rule__GlobalProtocolBlock__Group__39758); - rule__GlobalProtocolBlock__Group__3__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolBlock__Group__3" - - - // $ANTLR start "rule__GlobalProtocolBlock__Group__3__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4840:1: rule__GlobalProtocolBlock__Group__3__Impl : ( '}' ) ; - public final void rule__GlobalProtocolBlock__Group__3__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4844:1: ( ( '}' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4845:1: ( '}' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4845:1: ( '}' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4846:1: '}' - { - before(grammarAccess.getGlobalProtocolBlockAccess().getRightCurlyBracketKeyword_3()); - match(input,30,FOLLOW_30_in_rule__GlobalProtocolBlock__Group__3__Impl9786); - after(grammarAccess.getGlobalProtocolBlockAccess().getRightCurlyBracketKeyword_3()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolBlock__Group__3__Impl" - - - // $ANTLR start "rule__GlobalMessageTransfer__Group__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4867:1: rule__GlobalMessageTransfer__Group__0 : rule__GlobalMessageTransfer__Group__0__Impl rule__GlobalMessageTransfer__Group__1 ; - public final void rule__GlobalMessageTransfer__Group__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4871:1: ( rule__GlobalMessageTransfer__Group__0__Impl rule__GlobalMessageTransfer__Group__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4872:2: rule__GlobalMessageTransfer__Group__0__Impl rule__GlobalMessageTransfer__Group__1 - { - pushFollow(FOLLOW_rule__GlobalMessageTransfer__Group__0__Impl_in_rule__GlobalMessageTransfer__Group__09825); - rule__GlobalMessageTransfer__Group__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalMessageTransfer__Group__1_in_rule__GlobalMessageTransfer__Group__09828); - rule__GlobalMessageTransfer__Group__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalMessageTransfer__Group__0" - - - // $ANTLR start "rule__GlobalMessageTransfer__Group__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4879:1: rule__GlobalMessageTransfer__Group__0__Impl : ( ( rule__GlobalMessageTransfer__MessageAssignment_0 ) ) ; - public final void rule__GlobalMessageTransfer__Group__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4883:1: ( ( ( rule__GlobalMessageTransfer__MessageAssignment_0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4884:1: ( ( rule__GlobalMessageTransfer__MessageAssignment_0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4884:1: ( ( rule__GlobalMessageTransfer__MessageAssignment_0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4885:1: ( rule__GlobalMessageTransfer__MessageAssignment_0 ) - { - before(grammarAccess.getGlobalMessageTransferAccess().getMessageAssignment_0()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4886:1: ( rule__GlobalMessageTransfer__MessageAssignment_0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4886:2: rule__GlobalMessageTransfer__MessageAssignment_0 - { - pushFollow(FOLLOW_rule__GlobalMessageTransfer__MessageAssignment_0_in_rule__GlobalMessageTransfer__Group__0__Impl9855); - rule__GlobalMessageTransfer__MessageAssignment_0(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalMessageTransferAccess().getMessageAssignment_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalMessageTransfer__Group__0__Impl" - - - // $ANTLR start "rule__GlobalMessageTransfer__Group__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4896:1: rule__GlobalMessageTransfer__Group__1 : rule__GlobalMessageTransfer__Group__1__Impl rule__GlobalMessageTransfer__Group__2 ; - public final void rule__GlobalMessageTransfer__Group__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4900:1: ( rule__GlobalMessageTransfer__Group__1__Impl rule__GlobalMessageTransfer__Group__2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4901:2: rule__GlobalMessageTransfer__Group__1__Impl rule__GlobalMessageTransfer__Group__2 - { - pushFollow(FOLLOW_rule__GlobalMessageTransfer__Group__1__Impl_in_rule__GlobalMessageTransfer__Group__19885); - rule__GlobalMessageTransfer__Group__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalMessageTransfer__Group__2_in_rule__GlobalMessageTransfer__Group__19888); - rule__GlobalMessageTransfer__Group__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalMessageTransfer__Group__1" - - - // $ANTLR start "rule__GlobalMessageTransfer__Group__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4908:1: rule__GlobalMessageTransfer__Group__1__Impl : ( 'from' ) ; - public final void rule__GlobalMessageTransfer__Group__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4912:1: ( ( 'from' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4913:1: ( 'from' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4913:1: ( 'from' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4914:1: 'from' - { - before(grammarAccess.getGlobalMessageTransferAccess().getFromKeyword_1()); - match(input,16,FOLLOW_16_in_rule__GlobalMessageTransfer__Group__1__Impl9916); - after(grammarAccess.getGlobalMessageTransferAccess().getFromKeyword_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalMessageTransfer__Group__1__Impl" - - - // $ANTLR start "rule__GlobalMessageTransfer__Group__2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4927:1: rule__GlobalMessageTransfer__Group__2 : rule__GlobalMessageTransfer__Group__2__Impl rule__GlobalMessageTransfer__Group__3 ; - public final void rule__GlobalMessageTransfer__Group__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4931:1: ( rule__GlobalMessageTransfer__Group__2__Impl rule__GlobalMessageTransfer__Group__3 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4932:2: rule__GlobalMessageTransfer__Group__2__Impl rule__GlobalMessageTransfer__Group__3 - { - pushFollow(FOLLOW_rule__GlobalMessageTransfer__Group__2__Impl_in_rule__GlobalMessageTransfer__Group__29947); - rule__GlobalMessageTransfer__Group__2__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalMessageTransfer__Group__3_in_rule__GlobalMessageTransfer__Group__29950); - rule__GlobalMessageTransfer__Group__3(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalMessageTransfer__Group__2" - - - // $ANTLR start "rule__GlobalMessageTransfer__Group__2__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4939:1: rule__GlobalMessageTransfer__Group__2__Impl : ( ( rule__GlobalMessageTransfer__FromRoleAssignment_2 ) ) ; - public final void rule__GlobalMessageTransfer__Group__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4943:1: ( ( ( rule__GlobalMessageTransfer__FromRoleAssignment_2 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4944:1: ( ( rule__GlobalMessageTransfer__FromRoleAssignment_2 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4944:1: ( ( rule__GlobalMessageTransfer__FromRoleAssignment_2 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4945:1: ( rule__GlobalMessageTransfer__FromRoleAssignment_2 ) - { - before(grammarAccess.getGlobalMessageTransferAccess().getFromRoleAssignment_2()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4946:1: ( rule__GlobalMessageTransfer__FromRoleAssignment_2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4946:2: rule__GlobalMessageTransfer__FromRoleAssignment_2 - { - pushFollow(FOLLOW_rule__GlobalMessageTransfer__FromRoleAssignment_2_in_rule__GlobalMessageTransfer__Group__2__Impl9977); - rule__GlobalMessageTransfer__FromRoleAssignment_2(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalMessageTransferAccess().getFromRoleAssignment_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalMessageTransfer__Group__2__Impl" - - - // $ANTLR start "rule__GlobalMessageTransfer__Group__3" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4956:1: rule__GlobalMessageTransfer__Group__3 : rule__GlobalMessageTransfer__Group__3__Impl rule__GlobalMessageTransfer__Group__4 ; - public final void rule__GlobalMessageTransfer__Group__3() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4960:1: ( rule__GlobalMessageTransfer__Group__3__Impl rule__GlobalMessageTransfer__Group__4 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4961:2: rule__GlobalMessageTransfer__Group__3__Impl rule__GlobalMessageTransfer__Group__4 - { - pushFollow(FOLLOW_rule__GlobalMessageTransfer__Group__3__Impl_in_rule__GlobalMessageTransfer__Group__310007); - rule__GlobalMessageTransfer__Group__3__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalMessageTransfer__Group__4_in_rule__GlobalMessageTransfer__Group__310010); - rule__GlobalMessageTransfer__Group__4(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalMessageTransfer__Group__3" - - - // $ANTLR start "rule__GlobalMessageTransfer__Group__3__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4968:1: rule__GlobalMessageTransfer__Group__3__Impl : ( 'to' ) ; - public final void rule__GlobalMessageTransfer__Group__3__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4972:1: ( ( 'to' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4973:1: ( 'to' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4973:1: ( 'to' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4974:1: 'to' - { - before(grammarAccess.getGlobalMessageTransferAccess().getToKeyword_3()); - match(input,31,FOLLOW_31_in_rule__GlobalMessageTransfer__Group__3__Impl10038); - after(grammarAccess.getGlobalMessageTransferAccess().getToKeyword_3()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalMessageTransfer__Group__3__Impl" - - - // $ANTLR start "rule__GlobalMessageTransfer__Group__4" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4987:1: rule__GlobalMessageTransfer__Group__4 : rule__GlobalMessageTransfer__Group__4__Impl rule__GlobalMessageTransfer__Group__5 ; - public final void rule__GlobalMessageTransfer__Group__4() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4991:1: ( rule__GlobalMessageTransfer__Group__4__Impl rule__GlobalMessageTransfer__Group__5 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4992:2: rule__GlobalMessageTransfer__Group__4__Impl rule__GlobalMessageTransfer__Group__5 - { - pushFollow(FOLLOW_rule__GlobalMessageTransfer__Group__4__Impl_in_rule__GlobalMessageTransfer__Group__410069); - rule__GlobalMessageTransfer__Group__4__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalMessageTransfer__Group__5_in_rule__GlobalMessageTransfer__Group__410072); - rule__GlobalMessageTransfer__Group__5(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalMessageTransfer__Group__4" - - - // $ANTLR start "rule__GlobalMessageTransfer__Group__4__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:4999:1: rule__GlobalMessageTransfer__Group__4__Impl : ( ( rule__GlobalMessageTransfer__ToRolesAssignment_4 ) ) ; - public final void rule__GlobalMessageTransfer__Group__4__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5003:1: ( ( ( rule__GlobalMessageTransfer__ToRolesAssignment_4 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5004:1: ( ( rule__GlobalMessageTransfer__ToRolesAssignment_4 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5004:1: ( ( rule__GlobalMessageTransfer__ToRolesAssignment_4 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5005:1: ( rule__GlobalMessageTransfer__ToRolesAssignment_4 ) - { - before(grammarAccess.getGlobalMessageTransferAccess().getToRolesAssignment_4()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5006:1: ( rule__GlobalMessageTransfer__ToRolesAssignment_4 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5006:2: rule__GlobalMessageTransfer__ToRolesAssignment_4 - { - pushFollow(FOLLOW_rule__GlobalMessageTransfer__ToRolesAssignment_4_in_rule__GlobalMessageTransfer__Group__4__Impl10099); - rule__GlobalMessageTransfer__ToRolesAssignment_4(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalMessageTransferAccess().getToRolesAssignment_4()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalMessageTransfer__Group__4__Impl" - - - // $ANTLR start "rule__GlobalMessageTransfer__Group__5" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5016:1: rule__GlobalMessageTransfer__Group__5 : rule__GlobalMessageTransfer__Group__5__Impl rule__GlobalMessageTransfer__Group__6 ; - public final void rule__GlobalMessageTransfer__Group__5() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5020:1: ( rule__GlobalMessageTransfer__Group__5__Impl rule__GlobalMessageTransfer__Group__6 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5021:2: rule__GlobalMessageTransfer__Group__5__Impl rule__GlobalMessageTransfer__Group__6 - { - pushFollow(FOLLOW_rule__GlobalMessageTransfer__Group__5__Impl_in_rule__GlobalMessageTransfer__Group__510129); - rule__GlobalMessageTransfer__Group__5__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalMessageTransfer__Group__6_in_rule__GlobalMessageTransfer__Group__510132); - rule__GlobalMessageTransfer__Group__6(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalMessageTransfer__Group__5" - - - // $ANTLR start "rule__GlobalMessageTransfer__Group__5__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5028:1: rule__GlobalMessageTransfer__Group__5__Impl : ( ( rule__GlobalMessageTransfer__Group_5__0 )* ) ; - public final void rule__GlobalMessageTransfer__Group__5__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5032:1: ( ( ( rule__GlobalMessageTransfer__Group_5__0 )* ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5033:1: ( ( rule__GlobalMessageTransfer__Group_5__0 )* ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5033:1: ( ( rule__GlobalMessageTransfer__Group_5__0 )* ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5034:1: ( rule__GlobalMessageTransfer__Group_5__0 )* - { - before(grammarAccess.getGlobalMessageTransferAccess().getGroup_5()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5035:1: ( rule__GlobalMessageTransfer__Group_5__0 )* - loop33: - do { - int alt33=2; - int LA33_0 = input.LA(1); - - if ( (LA33_0==22) ) { - alt33=1; - } - - - switch (alt33) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5035:2: rule__GlobalMessageTransfer__Group_5__0 - { - pushFollow(FOLLOW_rule__GlobalMessageTransfer__Group_5__0_in_rule__GlobalMessageTransfer__Group__5__Impl10159); - rule__GlobalMessageTransfer__Group_5__0(); - - state._fsp--; - - - } - break; - - default : - break loop33; - } - } while (true); - - after(grammarAccess.getGlobalMessageTransferAccess().getGroup_5()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalMessageTransfer__Group__5__Impl" - - - // $ANTLR start "rule__GlobalMessageTransfer__Group__6" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5045:1: rule__GlobalMessageTransfer__Group__6 : rule__GlobalMessageTransfer__Group__6__Impl ; - public final void rule__GlobalMessageTransfer__Group__6() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5049:1: ( rule__GlobalMessageTransfer__Group__6__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5050:2: rule__GlobalMessageTransfer__Group__6__Impl - { - pushFollow(FOLLOW_rule__GlobalMessageTransfer__Group__6__Impl_in_rule__GlobalMessageTransfer__Group__610190); - rule__GlobalMessageTransfer__Group__6__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalMessageTransfer__Group__6" - - - // $ANTLR start "rule__GlobalMessageTransfer__Group__6__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5056:1: rule__GlobalMessageTransfer__Group__6__Impl : ( ';' ) ; - public final void rule__GlobalMessageTransfer__Group__6__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5060:1: ( ( ';' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5061:1: ( ';' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5061:1: ( ';' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5062:1: ';' - { - before(grammarAccess.getGlobalMessageTransferAccess().getSemicolonKeyword_6()); - match(input,12,FOLLOW_12_in_rule__GlobalMessageTransfer__Group__6__Impl10218); - after(grammarAccess.getGlobalMessageTransferAccess().getSemicolonKeyword_6()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalMessageTransfer__Group__6__Impl" - - - // $ANTLR start "rule__GlobalMessageTransfer__Group_5__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5089:1: rule__GlobalMessageTransfer__Group_5__0 : rule__GlobalMessageTransfer__Group_5__0__Impl rule__GlobalMessageTransfer__Group_5__1 ; - public final void rule__GlobalMessageTransfer__Group_5__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5093:1: ( rule__GlobalMessageTransfer__Group_5__0__Impl rule__GlobalMessageTransfer__Group_5__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5094:2: rule__GlobalMessageTransfer__Group_5__0__Impl rule__GlobalMessageTransfer__Group_5__1 - { - pushFollow(FOLLOW_rule__GlobalMessageTransfer__Group_5__0__Impl_in_rule__GlobalMessageTransfer__Group_5__010263); - rule__GlobalMessageTransfer__Group_5__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalMessageTransfer__Group_5__1_in_rule__GlobalMessageTransfer__Group_5__010266); - rule__GlobalMessageTransfer__Group_5__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalMessageTransfer__Group_5__0" - - - // $ANTLR start "rule__GlobalMessageTransfer__Group_5__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5101:1: rule__GlobalMessageTransfer__Group_5__0__Impl : ( ',' ) ; - public final void rule__GlobalMessageTransfer__Group_5__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5105:1: ( ( ',' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5106:1: ( ',' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5106:1: ( ',' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5107:1: ',' - { - before(grammarAccess.getGlobalMessageTransferAccess().getCommaKeyword_5_0()); - match(input,22,FOLLOW_22_in_rule__GlobalMessageTransfer__Group_5__0__Impl10294); - after(grammarAccess.getGlobalMessageTransferAccess().getCommaKeyword_5_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalMessageTransfer__Group_5__0__Impl" - - - // $ANTLR start "rule__GlobalMessageTransfer__Group_5__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5120:1: rule__GlobalMessageTransfer__Group_5__1 : rule__GlobalMessageTransfer__Group_5__1__Impl ; - public final void rule__GlobalMessageTransfer__Group_5__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5124:1: ( rule__GlobalMessageTransfer__Group_5__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5125:2: rule__GlobalMessageTransfer__Group_5__1__Impl - { - pushFollow(FOLLOW_rule__GlobalMessageTransfer__Group_5__1__Impl_in_rule__GlobalMessageTransfer__Group_5__110325); - rule__GlobalMessageTransfer__Group_5__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalMessageTransfer__Group_5__1" - - - // $ANTLR start "rule__GlobalMessageTransfer__Group_5__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5131:1: rule__GlobalMessageTransfer__Group_5__1__Impl : ( ( rule__GlobalMessageTransfer__ToRolesAssignment_5_1 ) ) ; - public final void rule__GlobalMessageTransfer__Group_5__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5135:1: ( ( ( rule__GlobalMessageTransfer__ToRolesAssignment_5_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5136:1: ( ( rule__GlobalMessageTransfer__ToRolesAssignment_5_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5136:1: ( ( rule__GlobalMessageTransfer__ToRolesAssignment_5_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5137:1: ( rule__GlobalMessageTransfer__ToRolesAssignment_5_1 ) - { - before(grammarAccess.getGlobalMessageTransferAccess().getToRolesAssignment_5_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5138:1: ( rule__GlobalMessageTransfer__ToRolesAssignment_5_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5138:2: rule__GlobalMessageTransfer__ToRolesAssignment_5_1 - { - pushFollow(FOLLOW_rule__GlobalMessageTransfer__ToRolesAssignment_5_1_in_rule__GlobalMessageTransfer__Group_5__1__Impl10352); - rule__GlobalMessageTransfer__ToRolesAssignment_5_1(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalMessageTransferAccess().getToRolesAssignment_5_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalMessageTransfer__Group_5__1__Impl" - - - // $ANTLR start "rule__GlobalChoice__Group__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5152:1: rule__GlobalChoice__Group__0 : rule__GlobalChoice__Group__0__Impl rule__GlobalChoice__Group__1 ; - public final void rule__GlobalChoice__Group__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5156:1: ( rule__GlobalChoice__Group__0__Impl rule__GlobalChoice__Group__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5157:2: rule__GlobalChoice__Group__0__Impl rule__GlobalChoice__Group__1 - { - pushFollow(FOLLOW_rule__GlobalChoice__Group__0__Impl_in_rule__GlobalChoice__Group__010386); - rule__GlobalChoice__Group__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalChoice__Group__1_in_rule__GlobalChoice__Group__010389); - rule__GlobalChoice__Group__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalChoice__Group__0" - - - // $ANTLR start "rule__GlobalChoice__Group__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5164:1: rule__GlobalChoice__Group__0__Impl : ( 'choice' ) ; - public final void rule__GlobalChoice__Group__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5168:1: ( ( 'choice' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5169:1: ( 'choice' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5169:1: ( 'choice' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5170:1: 'choice' - { - before(grammarAccess.getGlobalChoiceAccess().getChoiceKeyword_0()); - match(input,32,FOLLOW_32_in_rule__GlobalChoice__Group__0__Impl10417); - after(grammarAccess.getGlobalChoiceAccess().getChoiceKeyword_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalChoice__Group__0__Impl" - - - // $ANTLR start "rule__GlobalChoice__Group__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5183:1: rule__GlobalChoice__Group__1 : rule__GlobalChoice__Group__1__Impl rule__GlobalChoice__Group__2 ; - public final void rule__GlobalChoice__Group__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5187:1: ( rule__GlobalChoice__Group__1__Impl rule__GlobalChoice__Group__2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5188:2: rule__GlobalChoice__Group__1__Impl rule__GlobalChoice__Group__2 - { - pushFollow(FOLLOW_rule__GlobalChoice__Group__1__Impl_in_rule__GlobalChoice__Group__110448); - rule__GlobalChoice__Group__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalChoice__Group__2_in_rule__GlobalChoice__Group__110451); - rule__GlobalChoice__Group__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalChoice__Group__1" - - - // $ANTLR start "rule__GlobalChoice__Group__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5195:1: rule__GlobalChoice__Group__1__Impl : ( 'at' ) ; - public final void rule__GlobalChoice__Group__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5199:1: ( ( 'at' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5200:1: ( 'at' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5200:1: ( 'at' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5201:1: 'at' - { - before(grammarAccess.getGlobalChoiceAccess().getAtKeyword_1()); - match(input,33,FOLLOW_33_in_rule__GlobalChoice__Group__1__Impl10479); - after(grammarAccess.getGlobalChoiceAccess().getAtKeyword_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalChoice__Group__1__Impl" - - - // $ANTLR start "rule__GlobalChoice__Group__2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5214:1: rule__GlobalChoice__Group__2 : rule__GlobalChoice__Group__2__Impl rule__GlobalChoice__Group__3 ; - public final void rule__GlobalChoice__Group__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5218:1: ( rule__GlobalChoice__Group__2__Impl rule__GlobalChoice__Group__3 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5219:2: rule__GlobalChoice__Group__2__Impl rule__GlobalChoice__Group__3 - { - pushFollow(FOLLOW_rule__GlobalChoice__Group__2__Impl_in_rule__GlobalChoice__Group__210510); - rule__GlobalChoice__Group__2__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalChoice__Group__3_in_rule__GlobalChoice__Group__210513); - rule__GlobalChoice__Group__3(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalChoice__Group__2" - - - // $ANTLR start "rule__GlobalChoice__Group__2__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5226:1: rule__GlobalChoice__Group__2__Impl : ( ( rule__GlobalChoice__RoleAssignment_2 ) ) ; - public final void rule__GlobalChoice__Group__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5230:1: ( ( ( rule__GlobalChoice__RoleAssignment_2 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5231:1: ( ( rule__GlobalChoice__RoleAssignment_2 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5231:1: ( ( rule__GlobalChoice__RoleAssignment_2 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5232:1: ( rule__GlobalChoice__RoleAssignment_2 ) - { - before(grammarAccess.getGlobalChoiceAccess().getRoleAssignment_2()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5233:1: ( rule__GlobalChoice__RoleAssignment_2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5233:2: rule__GlobalChoice__RoleAssignment_2 - { - pushFollow(FOLLOW_rule__GlobalChoice__RoleAssignment_2_in_rule__GlobalChoice__Group__2__Impl10540); - rule__GlobalChoice__RoleAssignment_2(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalChoiceAccess().getRoleAssignment_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalChoice__Group__2__Impl" - - - // $ANTLR start "rule__GlobalChoice__Group__3" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5243:1: rule__GlobalChoice__Group__3 : rule__GlobalChoice__Group__3__Impl rule__GlobalChoice__Group__4 ; - public final void rule__GlobalChoice__Group__3() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5247:1: ( rule__GlobalChoice__Group__3__Impl rule__GlobalChoice__Group__4 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5248:2: rule__GlobalChoice__Group__3__Impl rule__GlobalChoice__Group__4 - { - pushFollow(FOLLOW_rule__GlobalChoice__Group__3__Impl_in_rule__GlobalChoice__Group__310570); - rule__GlobalChoice__Group__3__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalChoice__Group__4_in_rule__GlobalChoice__Group__310573); - rule__GlobalChoice__Group__4(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalChoice__Group__3" - - - // $ANTLR start "rule__GlobalChoice__Group__3__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5255:1: rule__GlobalChoice__Group__3__Impl : ( ( rule__GlobalChoice__BlocksAssignment_3 ) ) ; - public final void rule__GlobalChoice__Group__3__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5259:1: ( ( ( rule__GlobalChoice__BlocksAssignment_3 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5260:1: ( ( rule__GlobalChoice__BlocksAssignment_3 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5260:1: ( ( rule__GlobalChoice__BlocksAssignment_3 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5261:1: ( rule__GlobalChoice__BlocksAssignment_3 ) - { - before(grammarAccess.getGlobalChoiceAccess().getBlocksAssignment_3()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5262:1: ( rule__GlobalChoice__BlocksAssignment_3 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5262:2: rule__GlobalChoice__BlocksAssignment_3 - { - pushFollow(FOLLOW_rule__GlobalChoice__BlocksAssignment_3_in_rule__GlobalChoice__Group__3__Impl10600); - rule__GlobalChoice__BlocksAssignment_3(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalChoiceAccess().getBlocksAssignment_3()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalChoice__Group__3__Impl" - - - // $ANTLR start "rule__GlobalChoice__Group__4" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5272:1: rule__GlobalChoice__Group__4 : rule__GlobalChoice__Group__4__Impl ; - public final void rule__GlobalChoice__Group__4() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5276:1: ( rule__GlobalChoice__Group__4__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5277:2: rule__GlobalChoice__Group__4__Impl - { - pushFollow(FOLLOW_rule__GlobalChoice__Group__4__Impl_in_rule__GlobalChoice__Group__410630); - rule__GlobalChoice__Group__4__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalChoice__Group__4" - - - // $ANTLR start "rule__GlobalChoice__Group__4__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5283:1: rule__GlobalChoice__Group__4__Impl : ( ( rule__GlobalChoice__Group_4__0 )* ) ; - public final void rule__GlobalChoice__Group__4__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5287:1: ( ( ( rule__GlobalChoice__Group_4__0 )* ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5288:1: ( ( rule__GlobalChoice__Group_4__0 )* ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5288:1: ( ( rule__GlobalChoice__Group_4__0 )* ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5289:1: ( rule__GlobalChoice__Group_4__0 )* - { - before(grammarAccess.getGlobalChoiceAccess().getGroup_4()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5290:1: ( rule__GlobalChoice__Group_4__0 )* - loop34: - do { - int alt34=2; - int LA34_0 = input.LA(1); - - if ( (LA34_0==34) ) { - alt34=1; - } - - - switch (alt34) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5290:2: rule__GlobalChoice__Group_4__0 - { - pushFollow(FOLLOW_rule__GlobalChoice__Group_4__0_in_rule__GlobalChoice__Group__4__Impl10657); - rule__GlobalChoice__Group_4__0(); - - state._fsp--; - - - } - break; - - default : - break loop34; - } - } while (true); - - after(grammarAccess.getGlobalChoiceAccess().getGroup_4()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalChoice__Group__4__Impl" - - - // $ANTLR start "rule__GlobalChoice__Group_4__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5310:1: rule__GlobalChoice__Group_4__0 : rule__GlobalChoice__Group_4__0__Impl rule__GlobalChoice__Group_4__1 ; - public final void rule__GlobalChoice__Group_4__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5314:1: ( rule__GlobalChoice__Group_4__0__Impl rule__GlobalChoice__Group_4__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5315:2: rule__GlobalChoice__Group_4__0__Impl rule__GlobalChoice__Group_4__1 - { - pushFollow(FOLLOW_rule__GlobalChoice__Group_4__0__Impl_in_rule__GlobalChoice__Group_4__010698); - rule__GlobalChoice__Group_4__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalChoice__Group_4__1_in_rule__GlobalChoice__Group_4__010701); - rule__GlobalChoice__Group_4__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalChoice__Group_4__0" - - - // $ANTLR start "rule__GlobalChoice__Group_4__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5322:1: rule__GlobalChoice__Group_4__0__Impl : ( 'or' ) ; - public final void rule__GlobalChoice__Group_4__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5326:1: ( ( 'or' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5327:1: ( 'or' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5327:1: ( 'or' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5328:1: 'or' - { - before(grammarAccess.getGlobalChoiceAccess().getOrKeyword_4_0()); - match(input,34,FOLLOW_34_in_rule__GlobalChoice__Group_4__0__Impl10729); - after(grammarAccess.getGlobalChoiceAccess().getOrKeyword_4_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalChoice__Group_4__0__Impl" - - - // $ANTLR start "rule__GlobalChoice__Group_4__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5341:1: rule__GlobalChoice__Group_4__1 : rule__GlobalChoice__Group_4__1__Impl ; - public final void rule__GlobalChoice__Group_4__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5345:1: ( rule__GlobalChoice__Group_4__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5346:2: rule__GlobalChoice__Group_4__1__Impl - { - pushFollow(FOLLOW_rule__GlobalChoice__Group_4__1__Impl_in_rule__GlobalChoice__Group_4__110760); - rule__GlobalChoice__Group_4__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalChoice__Group_4__1" - - - // $ANTLR start "rule__GlobalChoice__Group_4__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5352:1: rule__GlobalChoice__Group_4__1__Impl : ( ( rule__GlobalChoice__BlocksAssignment_4_1 ) ) ; - public final void rule__GlobalChoice__Group_4__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5356:1: ( ( ( rule__GlobalChoice__BlocksAssignment_4_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5357:1: ( ( rule__GlobalChoice__BlocksAssignment_4_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5357:1: ( ( rule__GlobalChoice__BlocksAssignment_4_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5358:1: ( rule__GlobalChoice__BlocksAssignment_4_1 ) - { - before(grammarAccess.getGlobalChoiceAccess().getBlocksAssignment_4_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5359:1: ( rule__GlobalChoice__BlocksAssignment_4_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5359:2: rule__GlobalChoice__BlocksAssignment_4_1 - { - pushFollow(FOLLOW_rule__GlobalChoice__BlocksAssignment_4_1_in_rule__GlobalChoice__Group_4__1__Impl10787); - rule__GlobalChoice__BlocksAssignment_4_1(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalChoiceAccess().getBlocksAssignment_4_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalChoice__Group_4__1__Impl" - - - // $ANTLR start "rule__GlobalRecursion__Group__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5373:1: rule__GlobalRecursion__Group__0 : rule__GlobalRecursion__Group__0__Impl rule__GlobalRecursion__Group__1 ; - public final void rule__GlobalRecursion__Group__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5377:1: ( rule__GlobalRecursion__Group__0__Impl rule__GlobalRecursion__Group__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5378:2: rule__GlobalRecursion__Group__0__Impl rule__GlobalRecursion__Group__1 - { - pushFollow(FOLLOW_rule__GlobalRecursion__Group__0__Impl_in_rule__GlobalRecursion__Group__010821); - rule__GlobalRecursion__Group__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalRecursion__Group__1_in_rule__GlobalRecursion__Group__010824); - rule__GlobalRecursion__Group__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalRecursion__Group__0" - - - // $ANTLR start "rule__GlobalRecursion__Group__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5385:1: rule__GlobalRecursion__Group__0__Impl : ( 'rec' ) ; - public final void rule__GlobalRecursion__Group__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5389:1: ( ( 'rec' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5390:1: ( 'rec' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5390:1: ( 'rec' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5391:1: 'rec' - { - before(grammarAccess.getGlobalRecursionAccess().getRecKeyword_0()); - match(input,35,FOLLOW_35_in_rule__GlobalRecursion__Group__0__Impl10852); - after(grammarAccess.getGlobalRecursionAccess().getRecKeyword_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalRecursion__Group__0__Impl" - - - // $ANTLR start "rule__GlobalRecursion__Group__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5404:1: rule__GlobalRecursion__Group__1 : rule__GlobalRecursion__Group__1__Impl rule__GlobalRecursion__Group__2 ; - public final void rule__GlobalRecursion__Group__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5408:1: ( rule__GlobalRecursion__Group__1__Impl rule__GlobalRecursion__Group__2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5409:2: rule__GlobalRecursion__Group__1__Impl rule__GlobalRecursion__Group__2 - { - pushFollow(FOLLOW_rule__GlobalRecursion__Group__1__Impl_in_rule__GlobalRecursion__Group__110883); - rule__GlobalRecursion__Group__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalRecursion__Group__2_in_rule__GlobalRecursion__Group__110886); - rule__GlobalRecursion__Group__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalRecursion__Group__1" - - - // $ANTLR start "rule__GlobalRecursion__Group__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5416:1: rule__GlobalRecursion__Group__1__Impl : ( ( rule__GlobalRecursion__LabelAssignment_1 ) ) ; - public final void rule__GlobalRecursion__Group__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5420:1: ( ( ( rule__GlobalRecursion__LabelAssignment_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5421:1: ( ( rule__GlobalRecursion__LabelAssignment_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5421:1: ( ( rule__GlobalRecursion__LabelAssignment_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5422:1: ( rule__GlobalRecursion__LabelAssignment_1 ) - { - before(grammarAccess.getGlobalRecursionAccess().getLabelAssignment_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5423:1: ( rule__GlobalRecursion__LabelAssignment_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5423:2: rule__GlobalRecursion__LabelAssignment_1 - { - pushFollow(FOLLOW_rule__GlobalRecursion__LabelAssignment_1_in_rule__GlobalRecursion__Group__1__Impl10913); - rule__GlobalRecursion__LabelAssignment_1(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalRecursionAccess().getLabelAssignment_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalRecursion__Group__1__Impl" - - - // $ANTLR start "rule__GlobalRecursion__Group__2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5433:1: rule__GlobalRecursion__Group__2 : rule__GlobalRecursion__Group__2__Impl ; - public final void rule__GlobalRecursion__Group__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5437:1: ( rule__GlobalRecursion__Group__2__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5438:2: rule__GlobalRecursion__Group__2__Impl - { - pushFollow(FOLLOW_rule__GlobalRecursion__Group__2__Impl_in_rule__GlobalRecursion__Group__210943); - rule__GlobalRecursion__Group__2__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalRecursion__Group__2" - - - // $ANTLR start "rule__GlobalRecursion__Group__2__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5444:1: rule__GlobalRecursion__Group__2__Impl : ( ( rule__GlobalRecursion__BlockAssignment_2 ) ) ; - public final void rule__GlobalRecursion__Group__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5448:1: ( ( ( rule__GlobalRecursion__BlockAssignment_2 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5449:1: ( ( rule__GlobalRecursion__BlockAssignment_2 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5449:1: ( ( rule__GlobalRecursion__BlockAssignment_2 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5450:1: ( rule__GlobalRecursion__BlockAssignment_2 ) - { - before(grammarAccess.getGlobalRecursionAccess().getBlockAssignment_2()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5451:1: ( rule__GlobalRecursion__BlockAssignment_2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5451:2: rule__GlobalRecursion__BlockAssignment_2 - { - pushFollow(FOLLOW_rule__GlobalRecursion__BlockAssignment_2_in_rule__GlobalRecursion__Group__2__Impl10970); - rule__GlobalRecursion__BlockAssignment_2(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalRecursionAccess().getBlockAssignment_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalRecursion__Group__2__Impl" - - - // $ANTLR start "rule__GlobalContinue__Group__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5467:1: rule__GlobalContinue__Group__0 : rule__GlobalContinue__Group__0__Impl rule__GlobalContinue__Group__1 ; - public final void rule__GlobalContinue__Group__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5471:1: ( rule__GlobalContinue__Group__0__Impl rule__GlobalContinue__Group__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5472:2: rule__GlobalContinue__Group__0__Impl rule__GlobalContinue__Group__1 - { - pushFollow(FOLLOW_rule__GlobalContinue__Group__0__Impl_in_rule__GlobalContinue__Group__011006); - rule__GlobalContinue__Group__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalContinue__Group__1_in_rule__GlobalContinue__Group__011009); - rule__GlobalContinue__Group__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalContinue__Group__0" - - - // $ANTLR start "rule__GlobalContinue__Group__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5479:1: rule__GlobalContinue__Group__0__Impl : ( 'continue' ) ; - public final void rule__GlobalContinue__Group__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5483:1: ( ( 'continue' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5484:1: ( 'continue' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5484:1: ( 'continue' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5485:1: 'continue' - { - before(grammarAccess.getGlobalContinueAccess().getContinueKeyword_0()); - match(input,36,FOLLOW_36_in_rule__GlobalContinue__Group__0__Impl11037); - after(grammarAccess.getGlobalContinueAccess().getContinueKeyword_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalContinue__Group__0__Impl" - - - // $ANTLR start "rule__GlobalContinue__Group__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5498:1: rule__GlobalContinue__Group__1 : rule__GlobalContinue__Group__1__Impl rule__GlobalContinue__Group__2 ; - public final void rule__GlobalContinue__Group__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5502:1: ( rule__GlobalContinue__Group__1__Impl rule__GlobalContinue__Group__2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5503:2: rule__GlobalContinue__Group__1__Impl rule__GlobalContinue__Group__2 - { - pushFollow(FOLLOW_rule__GlobalContinue__Group__1__Impl_in_rule__GlobalContinue__Group__111068); - rule__GlobalContinue__Group__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalContinue__Group__2_in_rule__GlobalContinue__Group__111071); - rule__GlobalContinue__Group__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalContinue__Group__1" - - - // $ANTLR start "rule__GlobalContinue__Group__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5510:1: rule__GlobalContinue__Group__1__Impl : ( ( rule__GlobalContinue__LabelAssignment_1 ) ) ; - public final void rule__GlobalContinue__Group__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5514:1: ( ( ( rule__GlobalContinue__LabelAssignment_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5515:1: ( ( rule__GlobalContinue__LabelAssignment_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5515:1: ( ( rule__GlobalContinue__LabelAssignment_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5516:1: ( rule__GlobalContinue__LabelAssignment_1 ) - { - before(grammarAccess.getGlobalContinueAccess().getLabelAssignment_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5517:1: ( rule__GlobalContinue__LabelAssignment_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5517:2: rule__GlobalContinue__LabelAssignment_1 - { - pushFollow(FOLLOW_rule__GlobalContinue__LabelAssignment_1_in_rule__GlobalContinue__Group__1__Impl11098); - rule__GlobalContinue__LabelAssignment_1(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalContinueAccess().getLabelAssignment_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalContinue__Group__1__Impl" - - - // $ANTLR start "rule__GlobalContinue__Group__2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5527:1: rule__GlobalContinue__Group__2 : rule__GlobalContinue__Group__2__Impl ; - public final void rule__GlobalContinue__Group__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5531:1: ( rule__GlobalContinue__Group__2__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5532:2: rule__GlobalContinue__Group__2__Impl - { - pushFollow(FOLLOW_rule__GlobalContinue__Group__2__Impl_in_rule__GlobalContinue__Group__211128); - rule__GlobalContinue__Group__2__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalContinue__Group__2" - - - // $ANTLR start "rule__GlobalContinue__Group__2__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5538:1: rule__GlobalContinue__Group__2__Impl : ( ';' ) ; - public final void rule__GlobalContinue__Group__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5542:1: ( ( ';' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5543:1: ( ';' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5543:1: ( ';' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5544:1: ';' - { - before(grammarAccess.getGlobalContinueAccess().getSemicolonKeyword_2()); - match(input,12,FOLLOW_12_in_rule__GlobalContinue__Group__2__Impl11156); - after(grammarAccess.getGlobalContinueAccess().getSemicolonKeyword_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalContinue__Group__2__Impl" - - - // $ANTLR start "rule__GlobalParallel__Group__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5563:1: rule__GlobalParallel__Group__0 : rule__GlobalParallel__Group__0__Impl rule__GlobalParallel__Group__1 ; - public final void rule__GlobalParallel__Group__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5567:1: ( rule__GlobalParallel__Group__0__Impl rule__GlobalParallel__Group__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5568:2: rule__GlobalParallel__Group__0__Impl rule__GlobalParallel__Group__1 - { - pushFollow(FOLLOW_rule__GlobalParallel__Group__0__Impl_in_rule__GlobalParallel__Group__011193); - rule__GlobalParallel__Group__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalParallel__Group__1_in_rule__GlobalParallel__Group__011196); - rule__GlobalParallel__Group__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalParallel__Group__0" - - - // $ANTLR start "rule__GlobalParallel__Group__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5575:1: rule__GlobalParallel__Group__0__Impl : ( 'par' ) ; - public final void rule__GlobalParallel__Group__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5579:1: ( ( 'par' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5580:1: ( 'par' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5580:1: ( 'par' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5581:1: 'par' - { - before(grammarAccess.getGlobalParallelAccess().getParKeyword_0()); - match(input,37,FOLLOW_37_in_rule__GlobalParallel__Group__0__Impl11224); - after(grammarAccess.getGlobalParallelAccess().getParKeyword_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalParallel__Group__0__Impl" - - - // $ANTLR start "rule__GlobalParallel__Group__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5594:1: rule__GlobalParallel__Group__1 : rule__GlobalParallel__Group__1__Impl rule__GlobalParallel__Group__2 ; - public final void rule__GlobalParallel__Group__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5598:1: ( rule__GlobalParallel__Group__1__Impl rule__GlobalParallel__Group__2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5599:2: rule__GlobalParallel__Group__1__Impl rule__GlobalParallel__Group__2 - { - pushFollow(FOLLOW_rule__GlobalParallel__Group__1__Impl_in_rule__GlobalParallel__Group__111255); - rule__GlobalParallel__Group__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalParallel__Group__2_in_rule__GlobalParallel__Group__111258); - rule__GlobalParallel__Group__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalParallel__Group__1" - - - // $ANTLR start "rule__GlobalParallel__Group__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5606:1: rule__GlobalParallel__Group__1__Impl : ( ( rule__GlobalParallel__BlocksAssignment_1 ) ) ; - public final void rule__GlobalParallel__Group__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5610:1: ( ( ( rule__GlobalParallel__BlocksAssignment_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5611:1: ( ( rule__GlobalParallel__BlocksAssignment_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5611:1: ( ( rule__GlobalParallel__BlocksAssignment_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5612:1: ( rule__GlobalParallel__BlocksAssignment_1 ) - { - before(grammarAccess.getGlobalParallelAccess().getBlocksAssignment_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5613:1: ( rule__GlobalParallel__BlocksAssignment_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5613:2: rule__GlobalParallel__BlocksAssignment_1 - { - pushFollow(FOLLOW_rule__GlobalParallel__BlocksAssignment_1_in_rule__GlobalParallel__Group__1__Impl11285); - rule__GlobalParallel__BlocksAssignment_1(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalParallelAccess().getBlocksAssignment_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalParallel__Group__1__Impl" - - - // $ANTLR start "rule__GlobalParallel__Group__2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5623:1: rule__GlobalParallel__Group__2 : rule__GlobalParallel__Group__2__Impl ; - public final void rule__GlobalParallel__Group__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5627:1: ( rule__GlobalParallel__Group__2__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5628:2: rule__GlobalParallel__Group__2__Impl - { - pushFollow(FOLLOW_rule__GlobalParallel__Group__2__Impl_in_rule__GlobalParallel__Group__211315); - rule__GlobalParallel__Group__2__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalParallel__Group__2" - - - // $ANTLR start "rule__GlobalParallel__Group__2__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5634:1: rule__GlobalParallel__Group__2__Impl : ( ( rule__GlobalParallel__Group_2__0 )* ) ; - public final void rule__GlobalParallel__Group__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5638:1: ( ( ( rule__GlobalParallel__Group_2__0 )* ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5639:1: ( ( rule__GlobalParallel__Group_2__0 )* ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5639:1: ( ( rule__GlobalParallel__Group_2__0 )* ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5640:1: ( rule__GlobalParallel__Group_2__0 )* - { - before(grammarAccess.getGlobalParallelAccess().getGroup_2()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5641:1: ( rule__GlobalParallel__Group_2__0 )* - loop35: - do { - int alt35=2; - int LA35_0 = input.LA(1); - - if ( (LA35_0==38) ) { - alt35=1; - } - - - switch (alt35) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5641:2: rule__GlobalParallel__Group_2__0 - { - pushFollow(FOLLOW_rule__GlobalParallel__Group_2__0_in_rule__GlobalParallel__Group__2__Impl11342); - rule__GlobalParallel__Group_2__0(); - - state._fsp--; - - - } - break; - - default : - break loop35; - } - } while (true); - - after(grammarAccess.getGlobalParallelAccess().getGroup_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalParallel__Group__2__Impl" - - - // $ANTLR start "rule__GlobalParallel__Group_2__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5657:1: rule__GlobalParallel__Group_2__0 : rule__GlobalParallel__Group_2__0__Impl rule__GlobalParallel__Group_2__1 ; - public final void rule__GlobalParallel__Group_2__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5661:1: ( rule__GlobalParallel__Group_2__0__Impl rule__GlobalParallel__Group_2__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5662:2: rule__GlobalParallel__Group_2__0__Impl rule__GlobalParallel__Group_2__1 - { - pushFollow(FOLLOW_rule__GlobalParallel__Group_2__0__Impl_in_rule__GlobalParallel__Group_2__011379); - rule__GlobalParallel__Group_2__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalParallel__Group_2__1_in_rule__GlobalParallel__Group_2__011382); - rule__GlobalParallel__Group_2__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalParallel__Group_2__0" - - - // $ANTLR start "rule__GlobalParallel__Group_2__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5669:1: rule__GlobalParallel__Group_2__0__Impl : ( 'and' ) ; - public final void rule__GlobalParallel__Group_2__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5673:1: ( ( 'and' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5674:1: ( 'and' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5674:1: ( 'and' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5675:1: 'and' - { - before(grammarAccess.getGlobalParallelAccess().getAndKeyword_2_0()); - match(input,38,FOLLOW_38_in_rule__GlobalParallel__Group_2__0__Impl11410); - after(grammarAccess.getGlobalParallelAccess().getAndKeyword_2_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalParallel__Group_2__0__Impl" - - - // $ANTLR start "rule__GlobalParallel__Group_2__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5688:1: rule__GlobalParallel__Group_2__1 : rule__GlobalParallel__Group_2__1__Impl ; - public final void rule__GlobalParallel__Group_2__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5692:1: ( rule__GlobalParallel__Group_2__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5693:2: rule__GlobalParallel__Group_2__1__Impl - { - pushFollow(FOLLOW_rule__GlobalParallel__Group_2__1__Impl_in_rule__GlobalParallel__Group_2__111441); - rule__GlobalParallel__Group_2__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalParallel__Group_2__1" - - - // $ANTLR start "rule__GlobalParallel__Group_2__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5699:1: rule__GlobalParallel__Group_2__1__Impl : ( ( rule__GlobalParallel__BlocksAssignment_2_1 ) ) ; - public final void rule__GlobalParallel__Group_2__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5703:1: ( ( ( rule__GlobalParallel__BlocksAssignment_2_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5704:1: ( ( rule__GlobalParallel__BlocksAssignment_2_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5704:1: ( ( rule__GlobalParallel__BlocksAssignment_2_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5705:1: ( rule__GlobalParallel__BlocksAssignment_2_1 ) - { - before(grammarAccess.getGlobalParallelAccess().getBlocksAssignment_2_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5706:1: ( rule__GlobalParallel__BlocksAssignment_2_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5706:2: rule__GlobalParallel__BlocksAssignment_2_1 - { - pushFollow(FOLLOW_rule__GlobalParallel__BlocksAssignment_2_1_in_rule__GlobalParallel__Group_2__1__Impl11468); - rule__GlobalParallel__BlocksAssignment_2_1(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalParallelAccess().getBlocksAssignment_2_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalParallel__Group_2__1__Impl" - - - // $ANTLR start "rule__GlobalInterruptible__Group__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5720:1: rule__GlobalInterruptible__Group__0 : rule__GlobalInterruptible__Group__0__Impl rule__GlobalInterruptible__Group__1 ; - public final void rule__GlobalInterruptible__Group__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5724:1: ( rule__GlobalInterruptible__Group__0__Impl rule__GlobalInterruptible__Group__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5725:2: rule__GlobalInterruptible__Group__0__Impl rule__GlobalInterruptible__Group__1 - { - pushFollow(FOLLOW_rule__GlobalInterruptible__Group__0__Impl_in_rule__GlobalInterruptible__Group__011502); - rule__GlobalInterruptible__Group__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalInterruptible__Group__1_in_rule__GlobalInterruptible__Group__011505); - rule__GlobalInterruptible__Group__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalInterruptible__Group__0" - - - // $ANTLR start "rule__GlobalInterruptible__Group__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5732:1: rule__GlobalInterruptible__Group__0__Impl : ( 'interruptible' ) ; - public final void rule__GlobalInterruptible__Group__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5736:1: ( ( 'interruptible' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5737:1: ( 'interruptible' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5737:1: ( 'interruptible' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5738:1: 'interruptible' - { - before(grammarAccess.getGlobalInterruptibleAccess().getInterruptibleKeyword_0()); - match(input,39,FOLLOW_39_in_rule__GlobalInterruptible__Group__0__Impl11533); - after(grammarAccess.getGlobalInterruptibleAccess().getInterruptibleKeyword_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalInterruptible__Group__0__Impl" - - - // $ANTLR start "rule__GlobalInterruptible__Group__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5751:1: rule__GlobalInterruptible__Group__1 : rule__GlobalInterruptible__Group__1__Impl rule__GlobalInterruptible__Group__2 ; - public final void rule__GlobalInterruptible__Group__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5755:1: ( rule__GlobalInterruptible__Group__1__Impl rule__GlobalInterruptible__Group__2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5756:2: rule__GlobalInterruptible__Group__1__Impl rule__GlobalInterruptible__Group__2 - { - pushFollow(FOLLOW_rule__GlobalInterruptible__Group__1__Impl_in_rule__GlobalInterruptible__Group__111564); - rule__GlobalInterruptible__Group__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalInterruptible__Group__2_in_rule__GlobalInterruptible__Group__111567); - rule__GlobalInterruptible__Group__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalInterruptible__Group__1" - - - // $ANTLR start "rule__GlobalInterruptible__Group__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5763:1: rule__GlobalInterruptible__Group__1__Impl : ( ( rule__GlobalInterruptible__Group_1__0 )? ) ; - public final void rule__GlobalInterruptible__Group__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5767:1: ( ( ( rule__GlobalInterruptible__Group_1__0 )? ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5768:1: ( ( rule__GlobalInterruptible__Group_1__0 )? ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5768:1: ( ( rule__GlobalInterruptible__Group_1__0 )? ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5769:1: ( rule__GlobalInterruptible__Group_1__0 )? - { - before(grammarAccess.getGlobalInterruptibleAccess().getGroup_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5770:1: ( rule__GlobalInterruptible__Group_1__0 )? - int alt36=2; - int LA36_0 = input.LA(1); - - if ( (LA36_0==RULE_ID) ) { - alt36=1; - } - switch (alt36) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5770:2: rule__GlobalInterruptible__Group_1__0 - { - pushFollow(FOLLOW_rule__GlobalInterruptible__Group_1__0_in_rule__GlobalInterruptible__Group__1__Impl11594); - rule__GlobalInterruptible__Group_1__0(); - - state._fsp--; - - - } - break; - - } - - after(grammarAccess.getGlobalInterruptibleAccess().getGroup_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalInterruptible__Group__1__Impl" - - - // $ANTLR start "rule__GlobalInterruptible__Group__2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5780:1: rule__GlobalInterruptible__Group__2 : rule__GlobalInterruptible__Group__2__Impl rule__GlobalInterruptible__Group__3 ; - public final void rule__GlobalInterruptible__Group__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5784:1: ( rule__GlobalInterruptible__Group__2__Impl rule__GlobalInterruptible__Group__3 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5785:2: rule__GlobalInterruptible__Group__2__Impl rule__GlobalInterruptible__Group__3 - { - pushFollow(FOLLOW_rule__GlobalInterruptible__Group__2__Impl_in_rule__GlobalInterruptible__Group__211625); - rule__GlobalInterruptible__Group__2__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalInterruptible__Group__3_in_rule__GlobalInterruptible__Group__211628); - rule__GlobalInterruptible__Group__3(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalInterruptible__Group__2" - - - // $ANTLR start "rule__GlobalInterruptible__Group__2__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5792:1: rule__GlobalInterruptible__Group__2__Impl : ( ( rule__GlobalInterruptible__BlockAssignment_2 ) ) ; - public final void rule__GlobalInterruptible__Group__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5796:1: ( ( ( rule__GlobalInterruptible__BlockAssignment_2 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5797:1: ( ( rule__GlobalInterruptible__BlockAssignment_2 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5797:1: ( ( rule__GlobalInterruptible__BlockAssignment_2 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5798:1: ( rule__GlobalInterruptible__BlockAssignment_2 ) - { - before(grammarAccess.getGlobalInterruptibleAccess().getBlockAssignment_2()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5799:1: ( rule__GlobalInterruptible__BlockAssignment_2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5799:2: rule__GlobalInterruptible__BlockAssignment_2 - { - pushFollow(FOLLOW_rule__GlobalInterruptible__BlockAssignment_2_in_rule__GlobalInterruptible__Group__2__Impl11655); - rule__GlobalInterruptible__BlockAssignment_2(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalInterruptibleAccess().getBlockAssignment_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalInterruptible__Group__2__Impl" - - - // $ANTLR start "rule__GlobalInterruptible__Group__3" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5809:1: rule__GlobalInterruptible__Group__3 : rule__GlobalInterruptible__Group__3__Impl rule__GlobalInterruptible__Group__4 ; - public final void rule__GlobalInterruptible__Group__3() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5813:1: ( rule__GlobalInterruptible__Group__3__Impl rule__GlobalInterruptible__Group__4 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5814:2: rule__GlobalInterruptible__Group__3__Impl rule__GlobalInterruptible__Group__4 - { - pushFollow(FOLLOW_rule__GlobalInterruptible__Group__3__Impl_in_rule__GlobalInterruptible__Group__311685); - rule__GlobalInterruptible__Group__3__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalInterruptible__Group__4_in_rule__GlobalInterruptible__Group__311688); - rule__GlobalInterruptible__Group__4(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalInterruptible__Group__3" - - - // $ANTLR start "rule__GlobalInterruptible__Group__3__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5821:1: rule__GlobalInterruptible__Group__3__Impl : ( 'with' ) ; - public final void rule__GlobalInterruptible__Group__3__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5825:1: ( ( 'with' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5826:1: ( 'with' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5826:1: ( 'with' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5827:1: 'with' - { - before(grammarAccess.getGlobalInterruptibleAccess().getWithKeyword_3()); - match(input,40,FOLLOW_40_in_rule__GlobalInterruptible__Group__3__Impl11716); - after(grammarAccess.getGlobalInterruptibleAccess().getWithKeyword_3()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalInterruptible__Group__3__Impl" - - - // $ANTLR start "rule__GlobalInterruptible__Group__4" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5840:1: rule__GlobalInterruptible__Group__4 : rule__GlobalInterruptible__Group__4__Impl rule__GlobalInterruptible__Group__5 ; - public final void rule__GlobalInterruptible__Group__4() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5844:1: ( rule__GlobalInterruptible__Group__4__Impl rule__GlobalInterruptible__Group__5 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5845:2: rule__GlobalInterruptible__Group__4__Impl rule__GlobalInterruptible__Group__5 - { - pushFollow(FOLLOW_rule__GlobalInterruptible__Group__4__Impl_in_rule__GlobalInterruptible__Group__411747); - rule__GlobalInterruptible__Group__4__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalInterruptible__Group__5_in_rule__GlobalInterruptible__Group__411750); - rule__GlobalInterruptible__Group__5(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalInterruptible__Group__4" - - - // $ANTLR start "rule__GlobalInterruptible__Group__4__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5852:1: rule__GlobalInterruptible__Group__4__Impl : ( '{' ) ; - public final void rule__GlobalInterruptible__Group__4__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5856:1: ( ( '{' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5857:1: ( '{' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5857:1: ( '{' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5858:1: '{' - { - before(grammarAccess.getGlobalInterruptibleAccess().getLeftCurlyBracketKeyword_4()); - match(input,29,FOLLOW_29_in_rule__GlobalInterruptible__Group__4__Impl11778); - after(grammarAccess.getGlobalInterruptibleAccess().getLeftCurlyBracketKeyword_4()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalInterruptible__Group__4__Impl" - - - // $ANTLR start "rule__GlobalInterruptible__Group__5" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5871:1: rule__GlobalInterruptible__Group__5 : rule__GlobalInterruptible__Group__5__Impl rule__GlobalInterruptible__Group__6 ; - public final void rule__GlobalInterruptible__Group__5() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5875:1: ( rule__GlobalInterruptible__Group__5__Impl rule__GlobalInterruptible__Group__6 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5876:2: rule__GlobalInterruptible__Group__5__Impl rule__GlobalInterruptible__Group__6 - { - pushFollow(FOLLOW_rule__GlobalInterruptible__Group__5__Impl_in_rule__GlobalInterruptible__Group__511809); - rule__GlobalInterruptible__Group__5__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalInterruptible__Group__6_in_rule__GlobalInterruptible__Group__511812); - rule__GlobalInterruptible__Group__6(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalInterruptible__Group__5" - - - // $ANTLR start "rule__GlobalInterruptible__Group__5__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5883:1: rule__GlobalInterruptible__Group__5__Impl : ( ( rule__GlobalInterruptible__InterruptsAssignment_5 )* ) ; - public final void rule__GlobalInterruptible__Group__5__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5887:1: ( ( ( rule__GlobalInterruptible__InterruptsAssignment_5 )* ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5888:1: ( ( rule__GlobalInterruptible__InterruptsAssignment_5 )* ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5888:1: ( ( rule__GlobalInterruptible__InterruptsAssignment_5 )* ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5889:1: ( rule__GlobalInterruptible__InterruptsAssignment_5 )* - { - before(grammarAccess.getGlobalInterruptibleAccess().getInterruptsAssignment_5()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5890:1: ( rule__GlobalInterruptible__InterruptsAssignment_5 )* - loop37: - do { - int alt37=2; - int LA37_0 = input.LA(1); - - if ( (LA37_0==RULE_ID||LA37_0==20) ) { - alt37=1; - } - - - switch (alt37) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5890:2: rule__GlobalInterruptible__InterruptsAssignment_5 - { - pushFollow(FOLLOW_rule__GlobalInterruptible__InterruptsAssignment_5_in_rule__GlobalInterruptible__Group__5__Impl11839); - rule__GlobalInterruptible__InterruptsAssignment_5(); - - state._fsp--; - - - } - break; - - default : - break loop37; - } - } while (true); - - after(grammarAccess.getGlobalInterruptibleAccess().getInterruptsAssignment_5()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalInterruptible__Group__5__Impl" - - - // $ANTLR start "rule__GlobalInterruptible__Group__6" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5900:1: rule__GlobalInterruptible__Group__6 : rule__GlobalInterruptible__Group__6__Impl ; - public final void rule__GlobalInterruptible__Group__6() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5904:1: ( rule__GlobalInterruptible__Group__6__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5905:2: rule__GlobalInterruptible__Group__6__Impl - { - pushFollow(FOLLOW_rule__GlobalInterruptible__Group__6__Impl_in_rule__GlobalInterruptible__Group__611870); - rule__GlobalInterruptible__Group__6__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalInterruptible__Group__6" - - - // $ANTLR start "rule__GlobalInterruptible__Group__6__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5911:1: rule__GlobalInterruptible__Group__6__Impl : ( '}' ) ; - public final void rule__GlobalInterruptible__Group__6__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5915:1: ( ( '}' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5916:1: ( '}' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5916:1: ( '}' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5917:1: '}' - { - before(grammarAccess.getGlobalInterruptibleAccess().getRightCurlyBracketKeyword_6()); - match(input,30,FOLLOW_30_in_rule__GlobalInterruptible__Group__6__Impl11898); - after(grammarAccess.getGlobalInterruptibleAccess().getRightCurlyBracketKeyword_6()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalInterruptible__Group__6__Impl" - - - // $ANTLR start "rule__GlobalInterruptible__Group_1__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5944:1: rule__GlobalInterruptible__Group_1__0 : rule__GlobalInterruptible__Group_1__0__Impl rule__GlobalInterruptible__Group_1__1 ; - public final void rule__GlobalInterruptible__Group_1__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5948:1: ( rule__GlobalInterruptible__Group_1__0__Impl rule__GlobalInterruptible__Group_1__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5949:2: rule__GlobalInterruptible__Group_1__0__Impl rule__GlobalInterruptible__Group_1__1 - { - pushFollow(FOLLOW_rule__GlobalInterruptible__Group_1__0__Impl_in_rule__GlobalInterruptible__Group_1__011943); - rule__GlobalInterruptible__Group_1__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalInterruptible__Group_1__1_in_rule__GlobalInterruptible__Group_1__011946); - rule__GlobalInterruptible__Group_1__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalInterruptible__Group_1__0" - - - // $ANTLR start "rule__GlobalInterruptible__Group_1__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5956:1: rule__GlobalInterruptible__Group_1__0__Impl : ( ( rule__GlobalInterruptible__ScopeAssignment_1_0 ) ) ; - public final void rule__GlobalInterruptible__Group_1__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5960:1: ( ( ( rule__GlobalInterruptible__ScopeAssignment_1_0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5961:1: ( ( rule__GlobalInterruptible__ScopeAssignment_1_0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5961:1: ( ( rule__GlobalInterruptible__ScopeAssignment_1_0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5962:1: ( rule__GlobalInterruptible__ScopeAssignment_1_0 ) - { - before(grammarAccess.getGlobalInterruptibleAccess().getScopeAssignment_1_0()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5963:1: ( rule__GlobalInterruptible__ScopeAssignment_1_0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5963:2: rule__GlobalInterruptible__ScopeAssignment_1_0 - { - pushFollow(FOLLOW_rule__GlobalInterruptible__ScopeAssignment_1_0_in_rule__GlobalInterruptible__Group_1__0__Impl11973); - rule__GlobalInterruptible__ScopeAssignment_1_0(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalInterruptibleAccess().getScopeAssignment_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalInterruptible__Group_1__0__Impl" - - - // $ANTLR start "rule__GlobalInterruptible__Group_1__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5973:1: rule__GlobalInterruptible__Group_1__1 : rule__GlobalInterruptible__Group_1__1__Impl ; - public final void rule__GlobalInterruptible__Group_1__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5977:1: ( rule__GlobalInterruptible__Group_1__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5978:2: rule__GlobalInterruptible__Group_1__1__Impl - { - pushFollow(FOLLOW_rule__GlobalInterruptible__Group_1__1__Impl_in_rule__GlobalInterruptible__Group_1__112003); - rule__GlobalInterruptible__Group_1__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalInterruptible__Group_1__1" - - - // $ANTLR start "rule__GlobalInterruptible__Group_1__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5984:1: rule__GlobalInterruptible__Group_1__1__Impl : ( ':' ) ; - public final void rule__GlobalInterruptible__Group_1__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5988:1: ( ( ':' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5989:1: ( ':' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5989:1: ( ':' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:5990:1: ':' - { - before(grammarAccess.getGlobalInterruptibleAccess().getColonKeyword_1_1()); - match(input,23,FOLLOW_23_in_rule__GlobalInterruptible__Group_1__1__Impl12031); - after(grammarAccess.getGlobalInterruptibleAccess().getColonKeyword_1_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalInterruptible__Group_1__1__Impl" - - - // $ANTLR start "rule__GlobalInterrupt__Group__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6007:1: rule__GlobalInterrupt__Group__0 : rule__GlobalInterrupt__Group__0__Impl rule__GlobalInterrupt__Group__1 ; - public final void rule__GlobalInterrupt__Group__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6011:1: ( rule__GlobalInterrupt__Group__0__Impl rule__GlobalInterrupt__Group__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6012:2: rule__GlobalInterrupt__Group__0__Impl rule__GlobalInterrupt__Group__1 - { - pushFollow(FOLLOW_rule__GlobalInterrupt__Group__0__Impl_in_rule__GlobalInterrupt__Group__012066); - rule__GlobalInterrupt__Group__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalInterrupt__Group__1_in_rule__GlobalInterrupt__Group__012069); - rule__GlobalInterrupt__Group__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalInterrupt__Group__0" - - - // $ANTLR start "rule__GlobalInterrupt__Group__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6019:1: rule__GlobalInterrupt__Group__0__Impl : ( ( rule__GlobalInterrupt__MessagesAssignment_0 ) ) ; - public final void rule__GlobalInterrupt__Group__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6023:1: ( ( ( rule__GlobalInterrupt__MessagesAssignment_0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6024:1: ( ( rule__GlobalInterrupt__MessagesAssignment_0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6024:1: ( ( rule__GlobalInterrupt__MessagesAssignment_0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6025:1: ( rule__GlobalInterrupt__MessagesAssignment_0 ) - { - before(grammarAccess.getGlobalInterruptAccess().getMessagesAssignment_0()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6026:1: ( rule__GlobalInterrupt__MessagesAssignment_0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6026:2: rule__GlobalInterrupt__MessagesAssignment_0 - { - pushFollow(FOLLOW_rule__GlobalInterrupt__MessagesAssignment_0_in_rule__GlobalInterrupt__Group__0__Impl12096); - rule__GlobalInterrupt__MessagesAssignment_0(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalInterruptAccess().getMessagesAssignment_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalInterrupt__Group__0__Impl" - - - // $ANTLR start "rule__GlobalInterrupt__Group__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6036:1: rule__GlobalInterrupt__Group__1 : rule__GlobalInterrupt__Group__1__Impl rule__GlobalInterrupt__Group__2 ; - public final void rule__GlobalInterrupt__Group__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6040:1: ( rule__GlobalInterrupt__Group__1__Impl rule__GlobalInterrupt__Group__2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6041:2: rule__GlobalInterrupt__Group__1__Impl rule__GlobalInterrupt__Group__2 - { - pushFollow(FOLLOW_rule__GlobalInterrupt__Group__1__Impl_in_rule__GlobalInterrupt__Group__112126); - rule__GlobalInterrupt__Group__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalInterrupt__Group__2_in_rule__GlobalInterrupt__Group__112129); - rule__GlobalInterrupt__Group__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalInterrupt__Group__1" - - - // $ANTLR start "rule__GlobalInterrupt__Group__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6048:1: rule__GlobalInterrupt__Group__1__Impl : ( ( rule__GlobalInterrupt__Group_1__0 )* ) ; - public final void rule__GlobalInterrupt__Group__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6052:1: ( ( ( rule__GlobalInterrupt__Group_1__0 )* ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6053:1: ( ( rule__GlobalInterrupt__Group_1__0 )* ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6053:1: ( ( rule__GlobalInterrupt__Group_1__0 )* ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6054:1: ( rule__GlobalInterrupt__Group_1__0 )* - { - before(grammarAccess.getGlobalInterruptAccess().getGroup_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6055:1: ( rule__GlobalInterrupt__Group_1__0 )* - loop38: - do { - int alt38=2; - int LA38_0 = input.LA(1); - - if ( (LA38_0==22) ) { - alt38=1; - } - - - switch (alt38) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6055:2: rule__GlobalInterrupt__Group_1__0 - { - pushFollow(FOLLOW_rule__GlobalInterrupt__Group_1__0_in_rule__GlobalInterrupt__Group__1__Impl12156); - rule__GlobalInterrupt__Group_1__0(); - - state._fsp--; - - - } - break; - - default : - break loop38; - } - } while (true); - - after(grammarAccess.getGlobalInterruptAccess().getGroup_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalInterrupt__Group__1__Impl" - - - // $ANTLR start "rule__GlobalInterrupt__Group__2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6065:1: rule__GlobalInterrupt__Group__2 : rule__GlobalInterrupt__Group__2__Impl rule__GlobalInterrupt__Group__3 ; - public final void rule__GlobalInterrupt__Group__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6069:1: ( rule__GlobalInterrupt__Group__2__Impl rule__GlobalInterrupt__Group__3 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6070:2: rule__GlobalInterrupt__Group__2__Impl rule__GlobalInterrupt__Group__3 - { - pushFollow(FOLLOW_rule__GlobalInterrupt__Group__2__Impl_in_rule__GlobalInterrupt__Group__212187); - rule__GlobalInterrupt__Group__2__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalInterrupt__Group__3_in_rule__GlobalInterrupt__Group__212190); - rule__GlobalInterrupt__Group__3(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalInterrupt__Group__2" - - - // $ANTLR start "rule__GlobalInterrupt__Group__2__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6077:1: rule__GlobalInterrupt__Group__2__Impl : ( 'by' ) ; - public final void rule__GlobalInterrupt__Group__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6081:1: ( ( 'by' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6082:1: ( 'by' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6082:1: ( 'by' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6083:1: 'by' - { - before(grammarAccess.getGlobalInterruptAccess().getByKeyword_2()); - match(input,41,FOLLOW_41_in_rule__GlobalInterrupt__Group__2__Impl12218); - after(grammarAccess.getGlobalInterruptAccess().getByKeyword_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalInterrupt__Group__2__Impl" - - - // $ANTLR start "rule__GlobalInterrupt__Group__3" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6096:1: rule__GlobalInterrupt__Group__3 : rule__GlobalInterrupt__Group__3__Impl rule__GlobalInterrupt__Group__4 ; - public final void rule__GlobalInterrupt__Group__3() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6100:1: ( rule__GlobalInterrupt__Group__3__Impl rule__GlobalInterrupt__Group__4 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6101:2: rule__GlobalInterrupt__Group__3__Impl rule__GlobalInterrupt__Group__4 - { - pushFollow(FOLLOW_rule__GlobalInterrupt__Group__3__Impl_in_rule__GlobalInterrupt__Group__312249); - rule__GlobalInterrupt__Group__3__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalInterrupt__Group__4_in_rule__GlobalInterrupt__Group__312252); - rule__GlobalInterrupt__Group__4(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalInterrupt__Group__3" - - - // $ANTLR start "rule__GlobalInterrupt__Group__3__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6108:1: rule__GlobalInterrupt__Group__3__Impl : ( ( rule__GlobalInterrupt__RoleAssignment_3 ) ) ; - public final void rule__GlobalInterrupt__Group__3__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6112:1: ( ( ( rule__GlobalInterrupt__RoleAssignment_3 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6113:1: ( ( rule__GlobalInterrupt__RoleAssignment_3 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6113:1: ( ( rule__GlobalInterrupt__RoleAssignment_3 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6114:1: ( rule__GlobalInterrupt__RoleAssignment_3 ) - { - before(grammarAccess.getGlobalInterruptAccess().getRoleAssignment_3()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6115:1: ( rule__GlobalInterrupt__RoleAssignment_3 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6115:2: rule__GlobalInterrupt__RoleAssignment_3 - { - pushFollow(FOLLOW_rule__GlobalInterrupt__RoleAssignment_3_in_rule__GlobalInterrupt__Group__3__Impl12279); - rule__GlobalInterrupt__RoleAssignment_3(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalInterruptAccess().getRoleAssignment_3()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalInterrupt__Group__3__Impl" - - - // $ANTLR start "rule__GlobalInterrupt__Group__4" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6125:1: rule__GlobalInterrupt__Group__4 : rule__GlobalInterrupt__Group__4__Impl ; - public final void rule__GlobalInterrupt__Group__4() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6129:1: ( rule__GlobalInterrupt__Group__4__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6130:2: rule__GlobalInterrupt__Group__4__Impl - { - pushFollow(FOLLOW_rule__GlobalInterrupt__Group__4__Impl_in_rule__GlobalInterrupt__Group__412309); - rule__GlobalInterrupt__Group__4__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalInterrupt__Group__4" - - - // $ANTLR start "rule__GlobalInterrupt__Group__4__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6136:1: rule__GlobalInterrupt__Group__4__Impl : ( ';' ) ; - public final void rule__GlobalInterrupt__Group__4__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6140:1: ( ( ';' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6141:1: ( ';' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6141:1: ( ';' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6142:1: ';' - { - before(grammarAccess.getGlobalInterruptAccess().getSemicolonKeyword_4()); - match(input,12,FOLLOW_12_in_rule__GlobalInterrupt__Group__4__Impl12337); - after(grammarAccess.getGlobalInterruptAccess().getSemicolonKeyword_4()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalInterrupt__Group__4__Impl" - - - // $ANTLR start "rule__GlobalInterrupt__Group_1__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6165:1: rule__GlobalInterrupt__Group_1__0 : rule__GlobalInterrupt__Group_1__0__Impl rule__GlobalInterrupt__Group_1__1 ; - public final void rule__GlobalInterrupt__Group_1__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6169:1: ( rule__GlobalInterrupt__Group_1__0__Impl rule__GlobalInterrupt__Group_1__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6170:2: rule__GlobalInterrupt__Group_1__0__Impl rule__GlobalInterrupt__Group_1__1 - { - pushFollow(FOLLOW_rule__GlobalInterrupt__Group_1__0__Impl_in_rule__GlobalInterrupt__Group_1__012378); - rule__GlobalInterrupt__Group_1__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalInterrupt__Group_1__1_in_rule__GlobalInterrupt__Group_1__012381); - rule__GlobalInterrupt__Group_1__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalInterrupt__Group_1__0" - - - // $ANTLR start "rule__GlobalInterrupt__Group_1__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6177:1: rule__GlobalInterrupt__Group_1__0__Impl : ( ',' ) ; - public final void rule__GlobalInterrupt__Group_1__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6181:1: ( ( ',' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6182:1: ( ',' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6182:1: ( ',' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6183:1: ',' - { - before(grammarAccess.getGlobalInterruptAccess().getCommaKeyword_1_0()); - match(input,22,FOLLOW_22_in_rule__GlobalInterrupt__Group_1__0__Impl12409); - after(grammarAccess.getGlobalInterruptAccess().getCommaKeyword_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalInterrupt__Group_1__0__Impl" - - - // $ANTLR start "rule__GlobalInterrupt__Group_1__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6196:1: rule__GlobalInterrupt__Group_1__1 : rule__GlobalInterrupt__Group_1__1__Impl ; - public final void rule__GlobalInterrupt__Group_1__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6200:1: ( rule__GlobalInterrupt__Group_1__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6201:2: rule__GlobalInterrupt__Group_1__1__Impl - { - pushFollow(FOLLOW_rule__GlobalInterrupt__Group_1__1__Impl_in_rule__GlobalInterrupt__Group_1__112440); - rule__GlobalInterrupt__Group_1__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalInterrupt__Group_1__1" - - - // $ANTLR start "rule__GlobalInterrupt__Group_1__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6207:1: rule__GlobalInterrupt__Group_1__1__Impl : ( ( rule__GlobalInterrupt__MessagesAssignment_1_1 ) ) ; - public final void rule__GlobalInterrupt__Group_1__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6211:1: ( ( ( rule__GlobalInterrupt__MessagesAssignment_1_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6212:1: ( ( rule__GlobalInterrupt__MessagesAssignment_1_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6212:1: ( ( rule__GlobalInterrupt__MessagesAssignment_1_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6213:1: ( rule__GlobalInterrupt__MessagesAssignment_1_1 ) - { - before(grammarAccess.getGlobalInterruptAccess().getMessagesAssignment_1_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6214:1: ( rule__GlobalInterrupt__MessagesAssignment_1_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6214:2: rule__GlobalInterrupt__MessagesAssignment_1_1 - { - pushFollow(FOLLOW_rule__GlobalInterrupt__MessagesAssignment_1_1_in_rule__GlobalInterrupt__Group_1__1__Impl12467); - rule__GlobalInterrupt__MessagesAssignment_1_1(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalInterruptAccess().getMessagesAssignment_1_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalInterrupt__Group_1__1__Impl" - - - // $ANTLR start "rule__GlobalDo__Group__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6228:1: rule__GlobalDo__Group__0 : rule__GlobalDo__Group__0__Impl rule__GlobalDo__Group__1 ; - public final void rule__GlobalDo__Group__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6232:1: ( rule__GlobalDo__Group__0__Impl rule__GlobalDo__Group__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6233:2: rule__GlobalDo__Group__0__Impl rule__GlobalDo__Group__1 - { - pushFollow(FOLLOW_rule__GlobalDo__Group__0__Impl_in_rule__GlobalDo__Group__012501); - rule__GlobalDo__Group__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalDo__Group__1_in_rule__GlobalDo__Group__012504); - rule__GlobalDo__Group__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__Group__0" - - - // $ANTLR start "rule__GlobalDo__Group__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6240:1: rule__GlobalDo__Group__0__Impl : ( 'do' ) ; - public final void rule__GlobalDo__Group__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6244:1: ( ( 'do' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6245:1: ( 'do' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6245:1: ( 'do' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6246:1: 'do' - { - before(grammarAccess.getGlobalDoAccess().getDoKeyword_0()); - match(input,42,FOLLOW_42_in_rule__GlobalDo__Group__0__Impl12532); - after(grammarAccess.getGlobalDoAccess().getDoKeyword_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__Group__0__Impl" - - - // $ANTLR start "rule__GlobalDo__Group__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6259:1: rule__GlobalDo__Group__1 : rule__GlobalDo__Group__1__Impl rule__GlobalDo__Group__2 ; - public final void rule__GlobalDo__Group__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6263:1: ( rule__GlobalDo__Group__1__Impl rule__GlobalDo__Group__2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6264:2: rule__GlobalDo__Group__1__Impl rule__GlobalDo__Group__2 - { - pushFollow(FOLLOW_rule__GlobalDo__Group__1__Impl_in_rule__GlobalDo__Group__112563); - rule__GlobalDo__Group__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalDo__Group__2_in_rule__GlobalDo__Group__112566); - rule__GlobalDo__Group__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__Group__1" - - - // $ANTLR start "rule__GlobalDo__Group__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6271:1: rule__GlobalDo__Group__1__Impl : ( ( rule__GlobalDo__Group_1__0 )? ) ; - public final void rule__GlobalDo__Group__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6275:1: ( ( ( rule__GlobalDo__Group_1__0 )? ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6276:1: ( ( rule__GlobalDo__Group_1__0 )? ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6276:1: ( ( rule__GlobalDo__Group_1__0 )? ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6277:1: ( rule__GlobalDo__Group_1__0 )? - { - before(grammarAccess.getGlobalDoAccess().getGroup_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6278:1: ( rule__GlobalDo__Group_1__0 )? - int alt39=2; - int LA39_0 = input.LA(1); - - if ( (LA39_0==RULE_ID) ) { - int LA39_1 = input.LA(2); - - if ( (LA39_1==23) ) { - alt39=1; - } - } - switch (alt39) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6278:2: rule__GlobalDo__Group_1__0 - { - pushFollow(FOLLOW_rule__GlobalDo__Group_1__0_in_rule__GlobalDo__Group__1__Impl12593); - rule__GlobalDo__Group_1__0(); - - state._fsp--; - - - } - break; - - } - - after(grammarAccess.getGlobalDoAccess().getGroup_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__Group__1__Impl" - - - // $ANTLR start "rule__GlobalDo__Group__2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6288:1: rule__GlobalDo__Group__2 : rule__GlobalDo__Group__2__Impl rule__GlobalDo__Group__3 ; - public final void rule__GlobalDo__Group__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6292:1: ( rule__GlobalDo__Group__2__Impl rule__GlobalDo__Group__3 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6293:2: rule__GlobalDo__Group__2__Impl rule__GlobalDo__Group__3 - { - pushFollow(FOLLOW_rule__GlobalDo__Group__2__Impl_in_rule__GlobalDo__Group__212624); - rule__GlobalDo__Group__2__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalDo__Group__3_in_rule__GlobalDo__Group__212627); - rule__GlobalDo__Group__3(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__Group__2" - - - // $ANTLR start "rule__GlobalDo__Group__2__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6300:1: rule__GlobalDo__Group__2__Impl : ( ( rule__GlobalDo__MemberAssignment_2 ) ) ; - public final void rule__GlobalDo__Group__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6304:1: ( ( ( rule__GlobalDo__MemberAssignment_2 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6305:1: ( ( rule__GlobalDo__MemberAssignment_2 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6305:1: ( ( rule__GlobalDo__MemberAssignment_2 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6306:1: ( rule__GlobalDo__MemberAssignment_2 ) - { - before(grammarAccess.getGlobalDoAccess().getMemberAssignment_2()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6307:1: ( rule__GlobalDo__MemberAssignment_2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6307:2: rule__GlobalDo__MemberAssignment_2 - { - pushFollow(FOLLOW_rule__GlobalDo__MemberAssignment_2_in_rule__GlobalDo__Group__2__Impl12654); - rule__GlobalDo__MemberAssignment_2(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalDoAccess().getMemberAssignment_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__Group__2__Impl" - - - // $ANTLR start "rule__GlobalDo__Group__3" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6317:1: rule__GlobalDo__Group__3 : rule__GlobalDo__Group__3__Impl rule__GlobalDo__Group__4 ; - public final void rule__GlobalDo__Group__3() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6321:1: ( rule__GlobalDo__Group__3__Impl rule__GlobalDo__Group__4 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6322:2: rule__GlobalDo__Group__3__Impl rule__GlobalDo__Group__4 - { - pushFollow(FOLLOW_rule__GlobalDo__Group__3__Impl_in_rule__GlobalDo__Group__312684); - rule__GlobalDo__Group__3__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalDo__Group__4_in_rule__GlobalDo__Group__312687); - rule__GlobalDo__Group__4(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__Group__3" - - - // $ANTLR start "rule__GlobalDo__Group__3__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6329:1: rule__GlobalDo__Group__3__Impl : ( ( rule__GlobalDo__Group_3__0 )? ) ; - public final void rule__GlobalDo__Group__3__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6333:1: ( ( ( rule__GlobalDo__Group_3__0 )? ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6334:1: ( ( rule__GlobalDo__Group_3__0 )? ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6334:1: ( ( rule__GlobalDo__Group_3__0 )? ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6335:1: ( rule__GlobalDo__Group_3__0 )? - { - before(grammarAccess.getGlobalDoAccess().getGroup_3()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6336:1: ( rule__GlobalDo__Group_3__0 )? - int alt40=2; - int LA40_0 = input.LA(1); - - if ( (LA40_0==18) ) { - alt40=1; - } - switch (alt40) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6336:2: rule__GlobalDo__Group_3__0 - { - pushFollow(FOLLOW_rule__GlobalDo__Group_3__0_in_rule__GlobalDo__Group__3__Impl12714); - rule__GlobalDo__Group_3__0(); - - state._fsp--; - - - } - break; - - } - - after(grammarAccess.getGlobalDoAccess().getGroup_3()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__Group__3__Impl" - - - // $ANTLR start "rule__GlobalDo__Group__4" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6346:1: rule__GlobalDo__Group__4 : rule__GlobalDo__Group__4__Impl rule__GlobalDo__Group__5 ; - public final void rule__GlobalDo__Group__4() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6350:1: ( rule__GlobalDo__Group__4__Impl rule__GlobalDo__Group__5 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6351:2: rule__GlobalDo__Group__4__Impl rule__GlobalDo__Group__5 - { - pushFollow(FOLLOW_rule__GlobalDo__Group__4__Impl_in_rule__GlobalDo__Group__412745); - rule__GlobalDo__Group__4__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalDo__Group__5_in_rule__GlobalDo__Group__412748); - rule__GlobalDo__Group__5(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__Group__4" - - - // $ANTLR start "rule__GlobalDo__Group__4__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6358:1: rule__GlobalDo__Group__4__Impl : ( '(' ) ; - public final void rule__GlobalDo__Group__4__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6362:1: ( ( '(' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6363:1: ( '(' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6363:1: ( '(' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6364:1: '(' - { - before(grammarAccess.getGlobalDoAccess().getLeftParenthesisKeyword_4()); - match(input,20,FOLLOW_20_in_rule__GlobalDo__Group__4__Impl12776); - after(grammarAccess.getGlobalDoAccess().getLeftParenthesisKeyword_4()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__Group__4__Impl" - - - // $ANTLR start "rule__GlobalDo__Group__5" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6377:1: rule__GlobalDo__Group__5 : rule__GlobalDo__Group__5__Impl rule__GlobalDo__Group__6 ; - public final void rule__GlobalDo__Group__5() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6381:1: ( rule__GlobalDo__Group__5__Impl rule__GlobalDo__Group__6 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6382:2: rule__GlobalDo__Group__5__Impl rule__GlobalDo__Group__6 - { - pushFollow(FOLLOW_rule__GlobalDo__Group__5__Impl_in_rule__GlobalDo__Group__512807); - rule__GlobalDo__Group__5__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalDo__Group__6_in_rule__GlobalDo__Group__512810); - rule__GlobalDo__Group__6(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__Group__5" - - - // $ANTLR start "rule__GlobalDo__Group__5__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6389:1: rule__GlobalDo__Group__5__Impl : ( ( rule__GlobalDo__RolesAssignment_5 ) ) ; - public final void rule__GlobalDo__Group__5__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6393:1: ( ( ( rule__GlobalDo__RolesAssignment_5 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6394:1: ( ( rule__GlobalDo__RolesAssignment_5 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6394:1: ( ( rule__GlobalDo__RolesAssignment_5 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6395:1: ( rule__GlobalDo__RolesAssignment_5 ) - { - before(grammarAccess.getGlobalDoAccess().getRolesAssignment_5()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6396:1: ( rule__GlobalDo__RolesAssignment_5 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6396:2: rule__GlobalDo__RolesAssignment_5 - { - pushFollow(FOLLOW_rule__GlobalDo__RolesAssignment_5_in_rule__GlobalDo__Group__5__Impl12837); - rule__GlobalDo__RolesAssignment_5(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalDoAccess().getRolesAssignment_5()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__Group__5__Impl" - - - // $ANTLR start "rule__GlobalDo__Group__6" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6406:1: rule__GlobalDo__Group__6 : rule__GlobalDo__Group__6__Impl rule__GlobalDo__Group__7 ; - public final void rule__GlobalDo__Group__6() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6410:1: ( rule__GlobalDo__Group__6__Impl rule__GlobalDo__Group__7 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6411:2: rule__GlobalDo__Group__6__Impl rule__GlobalDo__Group__7 - { - pushFollow(FOLLOW_rule__GlobalDo__Group__6__Impl_in_rule__GlobalDo__Group__612867); - rule__GlobalDo__Group__6__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalDo__Group__7_in_rule__GlobalDo__Group__612870); - rule__GlobalDo__Group__7(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__Group__6" - - - // $ANTLR start "rule__GlobalDo__Group__6__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6418:1: rule__GlobalDo__Group__6__Impl : ( ( rule__GlobalDo__Group_6__0 )* ) ; - public final void rule__GlobalDo__Group__6__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6422:1: ( ( ( rule__GlobalDo__Group_6__0 )* ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6423:1: ( ( rule__GlobalDo__Group_6__0 )* ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6423:1: ( ( rule__GlobalDo__Group_6__0 )* ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6424:1: ( rule__GlobalDo__Group_6__0 )* - { - before(grammarAccess.getGlobalDoAccess().getGroup_6()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6425:1: ( rule__GlobalDo__Group_6__0 )* - loop41: - do { - int alt41=2; - int LA41_0 = input.LA(1); - - if ( (LA41_0==22) ) { - alt41=1; - } - - - switch (alt41) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6425:2: rule__GlobalDo__Group_6__0 - { - pushFollow(FOLLOW_rule__GlobalDo__Group_6__0_in_rule__GlobalDo__Group__6__Impl12897); - rule__GlobalDo__Group_6__0(); - - state._fsp--; - - - } - break; - - default : - break loop41; - } - } while (true); - - after(grammarAccess.getGlobalDoAccess().getGroup_6()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__Group__6__Impl" - - - // $ANTLR start "rule__GlobalDo__Group__7" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6435:1: rule__GlobalDo__Group__7 : rule__GlobalDo__Group__7__Impl rule__GlobalDo__Group__8 ; - public final void rule__GlobalDo__Group__7() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6439:1: ( rule__GlobalDo__Group__7__Impl rule__GlobalDo__Group__8 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6440:2: rule__GlobalDo__Group__7__Impl rule__GlobalDo__Group__8 - { - pushFollow(FOLLOW_rule__GlobalDo__Group__7__Impl_in_rule__GlobalDo__Group__712928); - rule__GlobalDo__Group__7__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalDo__Group__8_in_rule__GlobalDo__Group__712931); - rule__GlobalDo__Group__8(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__Group__7" - - - // $ANTLR start "rule__GlobalDo__Group__7__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6447:1: rule__GlobalDo__Group__7__Impl : ( ')' ) ; - public final void rule__GlobalDo__Group__7__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6451:1: ( ( ')' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6452:1: ( ')' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6452:1: ( ')' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6453:1: ')' - { - before(grammarAccess.getGlobalDoAccess().getRightParenthesisKeyword_7()); - match(input,21,FOLLOW_21_in_rule__GlobalDo__Group__7__Impl12959); - after(grammarAccess.getGlobalDoAccess().getRightParenthesisKeyword_7()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__Group__7__Impl" - - - // $ANTLR start "rule__GlobalDo__Group__8" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6466:1: rule__GlobalDo__Group__8 : rule__GlobalDo__Group__8__Impl ; - public final void rule__GlobalDo__Group__8() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6470:1: ( rule__GlobalDo__Group__8__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6471:2: rule__GlobalDo__Group__8__Impl - { - pushFollow(FOLLOW_rule__GlobalDo__Group__8__Impl_in_rule__GlobalDo__Group__812990); - rule__GlobalDo__Group__8__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__Group__8" - - - // $ANTLR start "rule__GlobalDo__Group__8__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6477:1: rule__GlobalDo__Group__8__Impl : ( ';' ) ; - public final void rule__GlobalDo__Group__8__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6481:1: ( ( ';' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6482:1: ( ';' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6482:1: ( ';' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6483:1: ';' - { - before(grammarAccess.getGlobalDoAccess().getSemicolonKeyword_8()); - match(input,12,FOLLOW_12_in_rule__GlobalDo__Group__8__Impl13018); - after(grammarAccess.getGlobalDoAccess().getSemicolonKeyword_8()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__Group__8__Impl" - - - // $ANTLR start "rule__GlobalDo__Group_1__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6514:1: rule__GlobalDo__Group_1__0 : rule__GlobalDo__Group_1__0__Impl rule__GlobalDo__Group_1__1 ; - public final void rule__GlobalDo__Group_1__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6518:1: ( rule__GlobalDo__Group_1__0__Impl rule__GlobalDo__Group_1__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6519:2: rule__GlobalDo__Group_1__0__Impl rule__GlobalDo__Group_1__1 - { - pushFollow(FOLLOW_rule__GlobalDo__Group_1__0__Impl_in_rule__GlobalDo__Group_1__013067); - rule__GlobalDo__Group_1__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalDo__Group_1__1_in_rule__GlobalDo__Group_1__013070); - rule__GlobalDo__Group_1__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__Group_1__0" - - - // $ANTLR start "rule__GlobalDo__Group_1__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6526:1: rule__GlobalDo__Group_1__0__Impl : ( ( rule__GlobalDo__ScopeAssignment_1_0 ) ) ; - public final void rule__GlobalDo__Group_1__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6530:1: ( ( ( rule__GlobalDo__ScopeAssignment_1_0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6531:1: ( ( rule__GlobalDo__ScopeAssignment_1_0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6531:1: ( ( rule__GlobalDo__ScopeAssignment_1_0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6532:1: ( rule__GlobalDo__ScopeAssignment_1_0 ) - { - before(grammarAccess.getGlobalDoAccess().getScopeAssignment_1_0()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6533:1: ( rule__GlobalDo__ScopeAssignment_1_0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6533:2: rule__GlobalDo__ScopeAssignment_1_0 - { - pushFollow(FOLLOW_rule__GlobalDo__ScopeAssignment_1_0_in_rule__GlobalDo__Group_1__0__Impl13097); - rule__GlobalDo__ScopeAssignment_1_0(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalDoAccess().getScopeAssignment_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__Group_1__0__Impl" - - - // $ANTLR start "rule__GlobalDo__Group_1__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6543:1: rule__GlobalDo__Group_1__1 : rule__GlobalDo__Group_1__1__Impl ; - public final void rule__GlobalDo__Group_1__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6547:1: ( rule__GlobalDo__Group_1__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6548:2: rule__GlobalDo__Group_1__1__Impl - { - pushFollow(FOLLOW_rule__GlobalDo__Group_1__1__Impl_in_rule__GlobalDo__Group_1__113127); - rule__GlobalDo__Group_1__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__Group_1__1" - - - // $ANTLR start "rule__GlobalDo__Group_1__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6554:1: rule__GlobalDo__Group_1__1__Impl : ( ':' ) ; - public final void rule__GlobalDo__Group_1__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6558:1: ( ( ':' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6559:1: ( ':' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6559:1: ( ':' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6560:1: ':' - { - before(grammarAccess.getGlobalDoAccess().getColonKeyword_1_1()); - match(input,23,FOLLOW_23_in_rule__GlobalDo__Group_1__1__Impl13155); - after(grammarAccess.getGlobalDoAccess().getColonKeyword_1_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__Group_1__1__Impl" - - - // $ANTLR start "rule__GlobalDo__Group_3__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6577:1: rule__GlobalDo__Group_3__0 : rule__GlobalDo__Group_3__0__Impl rule__GlobalDo__Group_3__1 ; - public final void rule__GlobalDo__Group_3__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6581:1: ( rule__GlobalDo__Group_3__0__Impl rule__GlobalDo__Group_3__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6582:2: rule__GlobalDo__Group_3__0__Impl rule__GlobalDo__Group_3__1 - { - pushFollow(FOLLOW_rule__GlobalDo__Group_3__0__Impl_in_rule__GlobalDo__Group_3__013190); - rule__GlobalDo__Group_3__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalDo__Group_3__1_in_rule__GlobalDo__Group_3__013193); - rule__GlobalDo__Group_3__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__Group_3__0" - - - // $ANTLR start "rule__GlobalDo__Group_3__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6589:1: rule__GlobalDo__Group_3__0__Impl : ( '<' ) ; - public final void rule__GlobalDo__Group_3__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6593:1: ( ( '<' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6594:1: ( '<' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6594:1: ( '<' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6595:1: '<' - { - before(grammarAccess.getGlobalDoAccess().getLessThanSignKeyword_3_0()); - match(input,18,FOLLOW_18_in_rule__GlobalDo__Group_3__0__Impl13221); - after(grammarAccess.getGlobalDoAccess().getLessThanSignKeyword_3_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__Group_3__0__Impl" - - - // $ANTLR start "rule__GlobalDo__Group_3__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6608:1: rule__GlobalDo__Group_3__1 : rule__GlobalDo__Group_3__1__Impl rule__GlobalDo__Group_3__2 ; - public final void rule__GlobalDo__Group_3__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6612:1: ( rule__GlobalDo__Group_3__1__Impl rule__GlobalDo__Group_3__2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6613:2: rule__GlobalDo__Group_3__1__Impl rule__GlobalDo__Group_3__2 - { - pushFollow(FOLLOW_rule__GlobalDo__Group_3__1__Impl_in_rule__GlobalDo__Group_3__113252); - rule__GlobalDo__Group_3__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalDo__Group_3__2_in_rule__GlobalDo__Group_3__113255); - rule__GlobalDo__Group_3__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__Group_3__1" - - - // $ANTLR start "rule__GlobalDo__Group_3__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6620:1: rule__GlobalDo__Group_3__1__Impl : ( ( rule__GlobalDo__ArgumentsAssignment_3_1 ) ) ; - public final void rule__GlobalDo__Group_3__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6624:1: ( ( ( rule__GlobalDo__ArgumentsAssignment_3_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6625:1: ( ( rule__GlobalDo__ArgumentsAssignment_3_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6625:1: ( ( rule__GlobalDo__ArgumentsAssignment_3_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6626:1: ( rule__GlobalDo__ArgumentsAssignment_3_1 ) - { - before(grammarAccess.getGlobalDoAccess().getArgumentsAssignment_3_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6627:1: ( rule__GlobalDo__ArgumentsAssignment_3_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6627:2: rule__GlobalDo__ArgumentsAssignment_3_1 - { - pushFollow(FOLLOW_rule__GlobalDo__ArgumentsAssignment_3_1_in_rule__GlobalDo__Group_3__1__Impl13282); - rule__GlobalDo__ArgumentsAssignment_3_1(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalDoAccess().getArgumentsAssignment_3_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__Group_3__1__Impl" - - - // $ANTLR start "rule__GlobalDo__Group_3__2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6637:1: rule__GlobalDo__Group_3__2 : rule__GlobalDo__Group_3__2__Impl rule__GlobalDo__Group_3__3 ; - public final void rule__GlobalDo__Group_3__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6641:1: ( rule__GlobalDo__Group_3__2__Impl rule__GlobalDo__Group_3__3 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6642:2: rule__GlobalDo__Group_3__2__Impl rule__GlobalDo__Group_3__3 - { - pushFollow(FOLLOW_rule__GlobalDo__Group_3__2__Impl_in_rule__GlobalDo__Group_3__213312); - rule__GlobalDo__Group_3__2__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalDo__Group_3__3_in_rule__GlobalDo__Group_3__213315); - rule__GlobalDo__Group_3__3(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__Group_3__2" - - - // $ANTLR start "rule__GlobalDo__Group_3__2__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6649:1: rule__GlobalDo__Group_3__2__Impl : ( ( rule__GlobalDo__Group_3_2__0 )* ) ; - public final void rule__GlobalDo__Group_3__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6653:1: ( ( ( rule__GlobalDo__Group_3_2__0 )* ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6654:1: ( ( rule__GlobalDo__Group_3_2__0 )* ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6654:1: ( ( rule__GlobalDo__Group_3_2__0 )* ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6655:1: ( rule__GlobalDo__Group_3_2__0 )* - { - before(grammarAccess.getGlobalDoAccess().getGroup_3_2()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6656:1: ( rule__GlobalDo__Group_3_2__0 )* - loop42: - do { - int alt42=2; - int LA42_0 = input.LA(1); - - if ( (LA42_0==22) ) { - alt42=1; - } - - - switch (alt42) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6656:2: rule__GlobalDo__Group_3_2__0 - { - pushFollow(FOLLOW_rule__GlobalDo__Group_3_2__0_in_rule__GlobalDo__Group_3__2__Impl13342); - rule__GlobalDo__Group_3_2__0(); - - state._fsp--; - - - } - break; - - default : - break loop42; - } - } while (true); - - after(grammarAccess.getGlobalDoAccess().getGroup_3_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__Group_3__2__Impl" - - - // $ANTLR start "rule__GlobalDo__Group_3__3" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6666:1: rule__GlobalDo__Group_3__3 : rule__GlobalDo__Group_3__3__Impl ; - public final void rule__GlobalDo__Group_3__3() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6670:1: ( rule__GlobalDo__Group_3__3__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6671:2: rule__GlobalDo__Group_3__3__Impl - { - pushFollow(FOLLOW_rule__GlobalDo__Group_3__3__Impl_in_rule__GlobalDo__Group_3__313373); - rule__GlobalDo__Group_3__3__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__Group_3__3" - - - // $ANTLR start "rule__GlobalDo__Group_3__3__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6677:1: rule__GlobalDo__Group_3__3__Impl : ( '>' ) ; - public final void rule__GlobalDo__Group_3__3__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6681:1: ( ( '>' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6682:1: ( '>' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6682:1: ( '>' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6683:1: '>' - { - before(grammarAccess.getGlobalDoAccess().getGreaterThanSignKeyword_3_3()); - match(input,19,FOLLOW_19_in_rule__GlobalDo__Group_3__3__Impl13401); - after(grammarAccess.getGlobalDoAccess().getGreaterThanSignKeyword_3_3()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__Group_3__3__Impl" - - - // $ANTLR start "rule__GlobalDo__Group_3_2__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6704:1: rule__GlobalDo__Group_3_2__0 : rule__GlobalDo__Group_3_2__0__Impl rule__GlobalDo__Group_3_2__1 ; - public final void rule__GlobalDo__Group_3_2__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6708:1: ( rule__GlobalDo__Group_3_2__0__Impl rule__GlobalDo__Group_3_2__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6709:2: rule__GlobalDo__Group_3_2__0__Impl rule__GlobalDo__Group_3_2__1 - { - pushFollow(FOLLOW_rule__GlobalDo__Group_3_2__0__Impl_in_rule__GlobalDo__Group_3_2__013440); - rule__GlobalDo__Group_3_2__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalDo__Group_3_2__1_in_rule__GlobalDo__Group_3_2__013443); - rule__GlobalDo__Group_3_2__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__Group_3_2__0" - - - // $ANTLR start "rule__GlobalDo__Group_3_2__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6716:1: rule__GlobalDo__Group_3_2__0__Impl : ( ',' ) ; - public final void rule__GlobalDo__Group_3_2__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6720:1: ( ( ',' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6721:1: ( ',' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6721:1: ( ',' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6722:1: ',' - { - before(grammarAccess.getGlobalDoAccess().getCommaKeyword_3_2_0()); - match(input,22,FOLLOW_22_in_rule__GlobalDo__Group_3_2__0__Impl13471); - after(grammarAccess.getGlobalDoAccess().getCommaKeyword_3_2_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__Group_3_2__0__Impl" - - - // $ANTLR start "rule__GlobalDo__Group_3_2__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6735:1: rule__GlobalDo__Group_3_2__1 : rule__GlobalDo__Group_3_2__1__Impl ; - public final void rule__GlobalDo__Group_3_2__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6739:1: ( rule__GlobalDo__Group_3_2__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6740:2: rule__GlobalDo__Group_3_2__1__Impl - { - pushFollow(FOLLOW_rule__GlobalDo__Group_3_2__1__Impl_in_rule__GlobalDo__Group_3_2__113502); - rule__GlobalDo__Group_3_2__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__Group_3_2__1" - - - // $ANTLR start "rule__GlobalDo__Group_3_2__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6746:1: rule__GlobalDo__Group_3_2__1__Impl : ( ( rule__GlobalDo__ArgumentsAssignment_3_2_1 ) ) ; - public final void rule__GlobalDo__Group_3_2__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6750:1: ( ( ( rule__GlobalDo__ArgumentsAssignment_3_2_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6751:1: ( ( rule__GlobalDo__ArgumentsAssignment_3_2_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6751:1: ( ( rule__GlobalDo__ArgumentsAssignment_3_2_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6752:1: ( rule__GlobalDo__ArgumentsAssignment_3_2_1 ) - { - before(grammarAccess.getGlobalDoAccess().getArgumentsAssignment_3_2_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6753:1: ( rule__GlobalDo__ArgumentsAssignment_3_2_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6753:2: rule__GlobalDo__ArgumentsAssignment_3_2_1 - { - pushFollow(FOLLOW_rule__GlobalDo__ArgumentsAssignment_3_2_1_in_rule__GlobalDo__Group_3_2__1__Impl13529); - rule__GlobalDo__ArgumentsAssignment_3_2_1(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalDoAccess().getArgumentsAssignment_3_2_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__Group_3_2__1__Impl" - - - // $ANTLR start "rule__GlobalDo__Group_6__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6767:1: rule__GlobalDo__Group_6__0 : rule__GlobalDo__Group_6__0__Impl rule__GlobalDo__Group_6__1 ; - public final void rule__GlobalDo__Group_6__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6771:1: ( rule__GlobalDo__Group_6__0__Impl rule__GlobalDo__Group_6__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6772:2: rule__GlobalDo__Group_6__0__Impl rule__GlobalDo__Group_6__1 - { - pushFollow(FOLLOW_rule__GlobalDo__Group_6__0__Impl_in_rule__GlobalDo__Group_6__013563); - rule__GlobalDo__Group_6__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__GlobalDo__Group_6__1_in_rule__GlobalDo__Group_6__013566); - rule__GlobalDo__Group_6__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__Group_6__0" - - - // $ANTLR start "rule__GlobalDo__Group_6__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6779:1: rule__GlobalDo__Group_6__0__Impl : ( ',' ) ; - public final void rule__GlobalDo__Group_6__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6783:1: ( ( ',' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6784:1: ( ',' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6784:1: ( ',' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6785:1: ',' - { - before(grammarAccess.getGlobalDoAccess().getCommaKeyword_6_0()); - match(input,22,FOLLOW_22_in_rule__GlobalDo__Group_6__0__Impl13594); - after(grammarAccess.getGlobalDoAccess().getCommaKeyword_6_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__Group_6__0__Impl" - - - // $ANTLR start "rule__GlobalDo__Group_6__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6798:1: rule__GlobalDo__Group_6__1 : rule__GlobalDo__Group_6__1__Impl ; - public final void rule__GlobalDo__Group_6__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6802:1: ( rule__GlobalDo__Group_6__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6803:2: rule__GlobalDo__Group_6__1__Impl - { - pushFollow(FOLLOW_rule__GlobalDo__Group_6__1__Impl_in_rule__GlobalDo__Group_6__113625); - rule__GlobalDo__Group_6__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__Group_6__1" - - - // $ANTLR start "rule__GlobalDo__Group_6__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6809:1: rule__GlobalDo__Group_6__1__Impl : ( ( rule__GlobalDo__RolesAssignment_6_1 ) ) ; - public final void rule__GlobalDo__Group_6__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6813:1: ( ( ( rule__GlobalDo__RolesAssignment_6_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6814:1: ( ( rule__GlobalDo__RolesAssignment_6_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6814:1: ( ( rule__GlobalDo__RolesAssignment_6_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6815:1: ( rule__GlobalDo__RolesAssignment_6_1 ) - { - before(grammarAccess.getGlobalDoAccess().getRolesAssignment_6_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6816:1: ( rule__GlobalDo__RolesAssignment_6_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6816:2: rule__GlobalDo__RolesAssignment_6_1 - { - pushFollow(FOLLOW_rule__GlobalDo__RolesAssignment_6_1_in_rule__GlobalDo__Group_6__1__Impl13652); - rule__GlobalDo__RolesAssignment_6_1(); - - state._fsp--; - - - } - - after(grammarAccess.getGlobalDoAccess().getRolesAssignment_6_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__Group_6__1__Impl" - - - // $ANTLR start "rule__LocalProtocolDecl__Group__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6830:1: rule__LocalProtocolDecl__Group__0 : rule__LocalProtocolDecl__Group__0__Impl rule__LocalProtocolDecl__Group__1 ; - public final void rule__LocalProtocolDecl__Group__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6834:1: ( rule__LocalProtocolDecl__Group__0__Impl rule__LocalProtocolDecl__Group__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6835:2: rule__LocalProtocolDecl__Group__0__Impl rule__LocalProtocolDecl__Group__1 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group__0__Impl_in_rule__LocalProtocolDecl__Group__013686); - rule__LocalProtocolDecl__Group__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group__1_in_rule__LocalProtocolDecl__Group__013689); - rule__LocalProtocolDecl__Group__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group__0" - - - // $ANTLR start "rule__LocalProtocolDecl__Group__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6842:1: rule__LocalProtocolDecl__Group__0__Impl : ( 'local' ) ; - public final void rule__LocalProtocolDecl__Group__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6846:1: ( ( 'local' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6847:1: ( 'local' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6847:1: ( 'local' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6848:1: 'local' - { - before(grammarAccess.getLocalProtocolDeclAccess().getLocalKeyword_0()); - match(input,43,FOLLOW_43_in_rule__LocalProtocolDecl__Group__0__Impl13717); - after(grammarAccess.getLocalProtocolDeclAccess().getLocalKeyword_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group__0__Impl" - - - // $ANTLR start "rule__LocalProtocolDecl__Group__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6861:1: rule__LocalProtocolDecl__Group__1 : rule__LocalProtocolDecl__Group__1__Impl rule__LocalProtocolDecl__Group__2 ; - public final void rule__LocalProtocolDecl__Group__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6865:1: ( rule__LocalProtocolDecl__Group__1__Impl rule__LocalProtocolDecl__Group__2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6866:2: rule__LocalProtocolDecl__Group__1__Impl rule__LocalProtocolDecl__Group__2 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group__1__Impl_in_rule__LocalProtocolDecl__Group__113748); - rule__LocalProtocolDecl__Group__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group__2_in_rule__LocalProtocolDecl__Group__113751); - rule__LocalProtocolDecl__Group__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group__1" - - - // $ANTLR start "rule__LocalProtocolDecl__Group__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6873:1: rule__LocalProtocolDecl__Group__1__Impl : ( 'protocol' ) ; - public final void rule__LocalProtocolDecl__Group__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6877:1: ( ( 'protocol' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6878:1: ( 'protocol' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6878:1: ( 'protocol' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6879:1: 'protocol' - { - before(grammarAccess.getLocalProtocolDeclAccess().getProtocolKeyword_1()); - match(input,25,FOLLOW_25_in_rule__LocalProtocolDecl__Group__1__Impl13779); - after(grammarAccess.getLocalProtocolDeclAccess().getProtocolKeyword_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group__1__Impl" - - - // $ANTLR start "rule__LocalProtocolDecl__Group__2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6892:1: rule__LocalProtocolDecl__Group__2 : rule__LocalProtocolDecl__Group__2__Impl rule__LocalProtocolDecl__Group__3 ; - public final void rule__LocalProtocolDecl__Group__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6896:1: ( rule__LocalProtocolDecl__Group__2__Impl rule__LocalProtocolDecl__Group__3 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6897:2: rule__LocalProtocolDecl__Group__2__Impl rule__LocalProtocolDecl__Group__3 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group__2__Impl_in_rule__LocalProtocolDecl__Group__213810); - rule__LocalProtocolDecl__Group__2__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group__3_in_rule__LocalProtocolDecl__Group__213813); - rule__LocalProtocolDecl__Group__3(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group__2" - - - // $ANTLR start "rule__LocalProtocolDecl__Group__2__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6904:1: rule__LocalProtocolDecl__Group__2__Impl : ( ( rule__LocalProtocolDecl__NameAssignment_2 ) ) ; - public final void rule__LocalProtocolDecl__Group__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6908:1: ( ( ( rule__LocalProtocolDecl__NameAssignment_2 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6909:1: ( ( rule__LocalProtocolDecl__NameAssignment_2 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6909:1: ( ( rule__LocalProtocolDecl__NameAssignment_2 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6910:1: ( rule__LocalProtocolDecl__NameAssignment_2 ) - { - before(grammarAccess.getLocalProtocolDeclAccess().getNameAssignment_2()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6911:1: ( rule__LocalProtocolDecl__NameAssignment_2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6911:2: rule__LocalProtocolDecl__NameAssignment_2 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__NameAssignment_2_in_rule__LocalProtocolDecl__Group__2__Impl13840); - rule__LocalProtocolDecl__NameAssignment_2(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalProtocolDeclAccess().getNameAssignment_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group__2__Impl" - - - // $ANTLR start "rule__LocalProtocolDecl__Group__3" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6921:1: rule__LocalProtocolDecl__Group__3 : rule__LocalProtocolDecl__Group__3__Impl rule__LocalProtocolDecl__Group__4 ; - public final void rule__LocalProtocolDecl__Group__3() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6925:1: ( rule__LocalProtocolDecl__Group__3__Impl rule__LocalProtocolDecl__Group__4 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6926:2: rule__LocalProtocolDecl__Group__3__Impl rule__LocalProtocolDecl__Group__4 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group__3__Impl_in_rule__LocalProtocolDecl__Group__313870); - rule__LocalProtocolDecl__Group__3__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group__4_in_rule__LocalProtocolDecl__Group__313873); - rule__LocalProtocolDecl__Group__4(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group__3" - - - // $ANTLR start "rule__LocalProtocolDecl__Group__3__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6933:1: rule__LocalProtocolDecl__Group__3__Impl : ( 'at' ) ; - public final void rule__LocalProtocolDecl__Group__3__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6937:1: ( ( 'at' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6938:1: ( 'at' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6938:1: ( 'at' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6939:1: 'at' - { - before(grammarAccess.getLocalProtocolDeclAccess().getAtKeyword_3()); - match(input,33,FOLLOW_33_in_rule__LocalProtocolDecl__Group__3__Impl13901); - after(grammarAccess.getLocalProtocolDeclAccess().getAtKeyword_3()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group__3__Impl" - - - // $ANTLR start "rule__LocalProtocolDecl__Group__4" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6952:1: rule__LocalProtocolDecl__Group__4 : rule__LocalProtocolDecl__Group__4__Impl rule__LocalProtocolDecl__Group__5 ; - public final void rule__LocalProtocolDecl__Group__4() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6956:1: ( rule__LocalProtocolDecl__Group__4__Impl rule__LocalProtocolDecl__Group__5 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6957:2: rule__LocalProtocolDecl__Group__4__Impl rule__LocalProtocolDecl__Group__5 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group__4__Impl_in_rule__LocalProtocolDecl__Group__413932); - rule__LocalProtocolDecl__Group__4__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group__5_in_rule__LocalProtocolDecl__Group__413935); - rule__LocalProtocolDecl__Group__5(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group__4" - - - // $ANTLR start "rule__LocalProtocolDecl__Group__4__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6964:1: rule__LocalProtocolDecl__Group__4__Impl : ( ( rule__LocalProtocolDecl__RoleAssignment_4 ) ) ; - public final void rule__LocalProtocolDecl__Group__4__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6968:1: ( ( ( rule__LocalProtocolDecl__RoleAssignment_4 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6969:1: ( ( rule__LocalProtocolDecl__RoleAssignment_4 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6969:1: ( ( rule__LocalProtocolDecl__RoleAssignment_4 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6970:1: ( rule__LocalProtocolDecl__RoleAssignment_4 ) - { - before(grammarAccess.getLocalProtocolDeclAccess().getRoleAssignment_4()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6971:1: ( rule__LocalProtocolDecl__RoleAssignment_4 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6971:2: rule__LocalProtocolDecl__RoleAssignment_4 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__RoleAssignment_4_in_rule__LocalProtocolDecl__Group__4__Impl13962); - rule__LocalProtocolDecl__RoleAssignment_4(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalProtocolDeclAccess().getRoleAssignment_4()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group__4__Impl" - - - // $ANTLR start "rule__LocalProtocolDecl__Group__5" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6981:1: rule__LocalProtocolDecl__Group__5 : rule__LocalProtocolDecl__Group__5__Impl rule__LocalProtocolDecl__Group__6 ; - public final void rule__LocalProtocolDecl__Group__5() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6985:1: ( rule__LocalProtocolDecl__Group__5__Impl rule__LocalProtocolDecl__Group__6 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6986:2: rule__LocalProtocolDecl__Group__5__Impl rule__LocalProtocolDecl__Group__6 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group__5__Impl_in_rule__LocalProtocolDecl__Group__513992); - rule__LocalProtocolDecl__Group__5__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group__6_in_rule__LocalProtocolDecl__Group__513995); - rule__LocalProtocolDecl__Group__6(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group__5" - - - // $ANTLR start "rule__LocalProtocolDecl__Group__5__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6993:1: rule__LocalProtocolDecl__Group__5__Impl : ( ( rule__LocalProtocolDecl__Group_5__0 )? ) ; - public final void rule__LocalProtocolDecl__Group__5__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6997:1: ( ( ( rule__LocalProtocolDecl__Group_5__0 )? ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6998:1: ( ( rule__LocalProtocolDecl__Group_5__0 )? ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6998:1: ( ( rule__LocalProtocolDecl__Group_5__0 )? ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:6999:1: ( rule__LocalProtocolDecl__Group_5__0 )? - { - before(grammarAccess.getLocalProtocolDeclAccess().getGroup_5()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7000:1: ( rule__LocalProtocolDecl__Group_5__0 )? - int alt43=2; - int LA43_0 = input.LA(1); - - if ( (LA43_0==18) ) { - alt43=1; - } - switch (alt43) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7000:2: rule__LocalProtocolDecl__Group_5__0 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_5__0_in_rule__LocalProtocolDecl__Group__5__Impl14022); - rule__LocalProtocolDecl__Group_5__0(); - - state._fsp--; - - - } - break; - - } - - after(grammarAccess.getLocalProtocolDeclAccess().getGroup_5()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group__5__Impl" - - - // $ANTLR start "rule__LocalProtocolDecl__Group__6" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7010:1: rule__LocalProtocolDecl__Group__6 : rule__LocalProtocolDecl__Group__6__Impl rule__LocalProtocolDecl__Group__7 ; - public final void rule__LocalProtocolDecl__Group__6() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7014:1: ( rule__LocalProtocolDecl__Group__6__Impl rule__LocalProtocolDecl__Group__7 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7015:2: rule__LocalProtocolDecl__Group__6__Impl rule__LocalProtocolDecl__Group__7 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group__6__Impl_in_rule__LocalProtocolDecl__Group__614053); - rule__LocalProtocolDecl__Group__6__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group__7_in_rule__LocalProtocolDecl__Group__614056); - rule__LocalProtocolDecl__Group__7(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group__6" - - - // $ANTLR start "rule__LocalProtocolDecl__Group__6__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7022:1: rule__LocalProtocolDecl__Group__6__Impl : ( '(' ) ; - public final void rule__LocalProtocolDecl__Group__6__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7026:1: ( ( '(' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7027:1: ( '(' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7027:1: ( '(' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7028:1: '(' - { - before(grammarAccess.getLocalProtocolDeclAccess().getLeftParenthesisKeyword_6()); - match(input,20,FOLLOW_20_in_rule__LocalProtocolDecl__Group__6__Impl14084); - after(grammarAccess.getLocalProtocolDeclAccess().getLeftParenthesisKeyword_6()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group__6__Impl" - - - // $ANTLR start "rule__LocalProtocolDecl__Group__7" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7041:1: rule__LocalProtocolDecl__Group__7 : rule__LocalProtocolDecl__Group__7__Impl rule__LocalProtocolDecl__Group__8 ; - public final void rule__LocalProtocolDecl__Group__7() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7045:1: ( rule__LocalProtocolDecl__Group__7__Impl rule__LocalProtocolDecl__Group__8 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7046:2: rule__LocalProtocolDecl__Group__7__Impl rule__LocalProtocolDecl__Group__8 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group__7__Impl_in_rule__LocalProtocolDecl__Group__714115); - rule__LocalProtocolDecl__Group__7__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group__8_in_rule__LocalProtocolDecl__Group__714118); - rule__LocalProtocolDecl__Group__8(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group__7" - - - // $ANTLR start "rule__LocalProtocolDecl__Group__7__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7053:1: rule__LocalProtocolDecl__Group__7__Impl : ( ( rule__LocalProtocolDecl__RolesAssignment_7 ) ) ; - public final void rule__LocalProtocolDecl__Group__7__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7057:1: ( ( ( rule__LocalProtocolDecl__RolesAssignment_7 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7058:1: ( ( rule__LocalProtocolDecl__RolesAssignment_7 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7058:1: ( ( rule__LocalProtocolDecl__RolesAssignment_7 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7059:1: ( rule__LocalProtocolDecl__RolesAssignment_7 ) - { - before(grammarAccess.getLocalProtocolDeclAccess().getRolesAssignment_7()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7060:1: ( rule__LocalProtocolDecl__RolesAssignment_7 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7060:2: rule__LocalProtocolDecl__RolesAssignment_7 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__RolesAssignment_7_in_rule__LocalProtocolDecl__Group__7__Impl14145); - rule__LocalProtocolDecl__RolesAssignment_7(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalProtocolDeclAccess().getRolesAssignment_7()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group__7__Impl" - - - // $ANTLR start "rule__LocalProtocolDecl__Group__8" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7070:1: rule__LocalProtocolDecl__Group__8 : rule__LocalProtocolDecl__Group__8__Impl rule__LocalProtocolDecl__Group__9 ; - public final void rule__LocalProtocolDecl__Group__8() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7074:1: ( rule__LocalProtocolDecl__Group__8__Impl rule__LocalProtocolDecl__Group__9 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7075:2: rule__LocalProtocolDecl__Group__8__Impl rule__LocalProtocolDecl__Group__9 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group__8__Impl_in_rule__LocalProtocolDecl__Group__814175); - rule__LocalProtocolDecl__Group__8__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group__9_in_rule__LocalProtocolDecl__Group__814178); - rule__LocalProtocolDecl__Group__9(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group__8" - - - // $ANTLR start "rule__LocalProtocolDecl__Group__8__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7082:1: rule__LocalProtocolDecl__Group__8__Impl : ( ( rule__LocalProtocolDecl__Group_8__0 )* ) ; - public final void rule__LocalProtocolDecl__Group__8__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7086:1: ( ( ( rule__LocalProtocolDecl__Group_8__0 )* ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7087:1: ( ( rule__LocalProtocolDecl__Group_8__0 )* ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7087:1: ( ( rule__LocalProtocolDecl__Group_8__0 )* ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7088:1: ( rule__LocalProtocolDecl__Group_8__0 )* - { - before(grammarAccess.getLocalProtocolDeclAccess().getGroup_8()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7089:1: ( rule__LocalProtocolDecl__Group_8__0 )* - loop44: - do { - int alt44=2; - int LA44_0 = input.LA(1); - - if ( (LA44_0==22) ) { - alt44=1; - } - - - switch (alt44) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7089:2: rule__LocalProtocolDecl__Group_8__0 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_8__0_in_rule__LocalProtocolDecl__Group__8__Impl14205); - rule__LocalProtocolDecl__Group_8__0(); - - state._fsp--; - - - } - break; - - default : - break loop44; - } - } while (true); - - after(grammarAccess.getLocalProtocolDeclAccess().getGroup_8()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group__8__Impl" - - - // $ANTLR start "rule__LocalProtocolDecl__Group__9" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7099:1: rule__LocalProtocolDecl__Group__9 : rule__LocalProtocolDecl__Group__9__Impl rule__LocalProtocolDecl__Group__10 ; - public final void rule__LocalProtocolDecl__Group__9() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7103:1: ( rule__LocalProtocolDecl__Group__9__Impl rule__LocalProtocolDecl__Group__10 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7104:2: rule__LocalProtocolDecl__Group__9__Impl rule__LocalProtocolDecl__Group__10 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group__9__Impl_in_rule__LocalProtocolDecl__Group__914236); - rule__LocalProtocolDecl__Group__9__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group__10_in_rule__LocalProtocolDecl__Group__914239); - rule__LocalProtocolDecl__Group__10(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group__9" - - - // $ANTLR start "rule__LocalProtocolDecl__Group__9__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7111:1: rule__LocalProtocolDecl__Group__9__Impl : ( ')' ) ; - public final void rule__LocalProtocolDecl__Group__9__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7115:1: ( ( ')' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7116:1: ( ')' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7116:1: ( ')' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7117:1: ')' - { - before(grammarAccess.getLocalProtocolDeclAccess().getRightParenthesisKeyword_9()); - match(input,21,FOLLOW_21_in_rule__LocalProtocolDecl__Group__9__Impl14267); - after(grammarAccess.getLocalProtocolDeclAccess().getRightParenthesisKeyword_9()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group__9__Impl" - - - // $ANTLR start "rule__LocalProtocolDecl__Group__10" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7130:1: rule__LocalProtocolDecl__Group__10 : rule__LocalProtocolDecl__Group__10__Impl ; - public final void rule__LocalProtocolDecl__Group__10() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7134:1: ( rule__LocalProtocolDecl__Group__10__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7135:2: rule__LocalProtocolDecl__Group__10__Impl - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group__10__Impl_in_rule__LocalProtocolDecl__Group__1014298); - rule__LocalProtocolDecl__Group__10__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group__10" - - - // $ANTLR start "rule__LocalProtocolDecl__Group__10__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7141:1: rule__LocalProtocolDecl__Group__10__Impl : ( ( rule__LocalProtocolDecl__Alternatives_10 ) ) ; - public final void rule__LocalProtocolDecl__Group__10__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7145:1: ( ( ( rule__LocalProtocolDecl__Alternatives_10 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7146:1: ( ( rule__LocalProtocolDecl__Alternatives_10 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7146:1: ( ( rule__LocalProtocolDecl__Alternatives_10 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7147:1: ( rule__LocalProtocolDecl__Alternatives_10 ) - { - before(grammarAccess.getLocalProtocolDeclAccess().getAlternatives_10()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7148:1: ( rule__LocalProtocolDecl__Alternatives_10 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7148:2: rule__LocalProtocolDecl__Alternatives_10 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Alternatives_10_in_rule__LocalProtocolDecl__Group__10__Impl14325); - rule__LocalProtocolDecl__Alternatives_10(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalProtocolDeclAccess().getAlternatives_10()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group__10__Impl" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_5__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7180:1: rule__LocalProtocolDecl__Group_5__0 : rule__LocalProtocolDecl__Group_5__0__Impl rule__LocalProtocolDecl__Group_5__1 ; - public final void rule__LocalProtocolDecl__Group_5__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7184:1: ( rule__LocalProtocolDecl__Group_5__0__Impl rule__LocalProtocolDecl__Group_5__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7185:2: rule__LocalProtocolDecl__Group_5__0__Impl rule__LocalProtocolDecl__Group_5__1 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_5__0__Impl_in_rule__LocalProtocolDecl__Group_5__014377); - rule__LocalProtocolDecl__Group_5__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_5__1_in_rule__LocalProtocolDecl__Group_5__014380); - rule__LocalProtocolDecl__Group_5__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_5__0" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_5__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7192:1: rule__LocalProtocolDecl__Group_5__0__Impl : ( '<' ) ; - public final void rule__LocalProtocolDecl__Group_5__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7196:1: ( ( '<' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7197:1: ( '<' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7197:1: ( '<' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7198:1: '<' - { - before(grammarAccess.getLocalProtocolDeclAccess().getLessThanSignKeyword_5_0()); - match(input,18,FOLLOW_18_in_rule__LocalProtocolDecl__Group_5__0__Impl14408); - after(grammarAccess.getLocalProtocolDeclAccess().getLessThanSignKeyword_5_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_5__0__Impl" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_5__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7211:1: rule__LocalProtocolDecl__Group_5__1 : rule__LocalProtocolDecl__Group_5__1__Impl rule__LocalProtocolDecl__Group_5__2 ; - public final void rule__LocalProtocolDecl__Group_5__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7215:1: ( rule__LocalProtocolDecl__Group_5__1__Impl rule__LocalProtocolDecl__Group_5__2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7216:2: rule__LocalProtocolDecl__Group_5__1__Impl rule__LocalProtocolDecl__Group_5__2 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_5__1__Impl_in_rule__LocalProtocolDecl__Group_5__114439); - rule__LocalProtocolDecl__Group_5__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_5__2_in_rule__LocalProtocolDecl__Group_5__114442); - rule__LocalProtocolDecl__Group_5__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_5__1" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_5__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7223:1: rule__LocalProtocolDecl__Group_5__1__Impl : ( ( rule__LocalProtocolDecl__ParametersAssignment_5_1 ) ) ; - public final void rule__LocalProtocolDecl__Group_5__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7227:1: ( ( ( rule__LocalProtocolDecl__ParametersAssignment_5_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7228:1: ( ( rule__LocalProtocolDecl__ParametersAssignment_5_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7228:1: ( ( rule__LocalProtocolDecl__ParametersAssignment_5_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7229:1: ( rule__LocalProtocolDecl__ParametersAssignment_5_1 ) - { - before(grammarAccess.getLocalProtocolDeclAccess().getParametersAssignment_5_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7230:1: ( rule__LocalProtocolDecl__ParametersAssignment_5_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7230:2: rule__LocalProtocolDecl__ParametersAssignment_5_1 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__ParametersAssignment_5_1_in_rule__LocalProtocolDecl__Group_5__1__Impl14469); - rule__LocalProtocolDecl__ParametersAssignment_5_1(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalProtocolDeclAccess().getParametersAssignment_5_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_5__1__Impl" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_5__2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7240:1: rule__LocalProtocolDecl__Group_5__2 : rule__LocalProtocolDecl__Group_5__2__Impl rule__LocalProtocolDecl__Group_5__3 ; - public final void rule__LocalProtocolDecl__Group_5__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7244:1: ( rule__LocalProtocolDecl__Group_5__2__Impl rule__LocalProtocolDecl__Group_5__3 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7245:2: rule__LocalProtocolDecl__Group_5__2__Impl rule__LocalProtocolDecl__Group_5__3 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_5__2__Impl_in_rule__LocalProtocolDecl__Group_5__214499); - rule__LocalProtocolDecl__Group_5__2__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_5__3_in_rule__LocalProtocolDecl__Group_5__214502); - rule__LocalProtocolDecl__Group_5__3(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_5__2" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_5__2__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7252:1: rule__LocalProtocolDecl__Group_5__2__Impl : ( ( rule__LocalProtocolDecl__Group_5_2__0 )* ) ; - public final void rule__LocalProtocolDecl__Group_5__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7256:1: ( ( ( rule__LocalProtocolDecl__Group_5_2__0 )* ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7257:1: ( ( rule__LocalProtocolDecl__Group_5_2__0 )* ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7257:1: ( ( rule__LocalProtocolDecl__Group_5_2__0 )* ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7258:1: ( rule__LocalProtocolDecl__Group_5_2__0 )* - { - before(grammarAccess.getLocalProtocolDeclAccess().getGroup_5_2()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7259:1: ( rule__LocalProtocolDecl__Group_5_2__0 )* - loop45: - do { - int alt45=2; - int LA45_0 = input.LA(1); - - if ( (LA45_0==22) ) { - alt45=1; - } - - - switch (alt45) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7259:2: rule__LocalProtocolDecl__Group_5_2__0 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_5_2__0_in_rule__LocalProtocolDecl__Group_5__2__Impl14529); - rule__LocalProtocolDecl__Group_5_2__0(); - - state._fsp--; - - - } - break; - - default : - break loop45; - } - } while (true); - - after(grammarAccess.getLocalProtocolDeclAccess().getGroup_5_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_5__2__Impl" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_5__3" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7269:1: rule__LocalProtocolDecl__Group_5__3 : rule__LocalProtocolDecl__Group_5__3__Impl ; - public final void rule__LocalProtocolDecl__Group_5__3() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7273:1: ( rule__LocalProtocolDecl__Group_5__3__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7274:2: rule__LocalProtocolDecl__Group_5__3__Impl - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_5__3__Impl_in_rule__LocalProtocolDecl__Group_5__314560); - rule__LocalProtocolDecl__Group_5__3__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_5__3" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_5__3__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7280:1: rule__LocalProtocolDecl__Group_5__3__Impl : ( '>' ) ; - public final void rule__LocalProtocolDecl__Group_5__3__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7284:1: ( ( '>' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7285:1: ( '>' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7285:1: ( '>' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7286:1: '>' - { - before(grammarAccess.getLocalProtocolDeclAccess().getGreaterThanSignKeyword_5_3()); - match(input,19,FOLLOW_19_in_rule__LocalProtocolDecl__Group_5__3__Impl14588); - after(grammarAccess.getLocalProtocolDeclAccess().getGreaterThanSignKeyword_5_3()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_5__3__Impl" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_5_2__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7307:1: rule__LocalProtocolDecl__Group_5_2__0 : rule__LocalProtocolDecl__Group_5_2__0__Impl rule__LocalProtocolDecl__Group_5_2__1 ; - public final void rule__LocalProtocolDecl__Group_5_2__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7311:1: ( rule__LocalProtocolDecl__Group_5_2__0__Impl rule__LocalProtocolDecl__Group_5_2__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7312:2: rule__LocalProtocolDecl__Group_5_2__0__Impl rule__LocalProtocolDecl__Group_5_2__1 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_5_2__0__Impl_in_rule__LocalProtocolDecl__Group_5_2__014627); - rule__LocalProtocolDecl__Group_5_2__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_5_2__1_in_rule__LocalProtocolDecl__Group_5_2__014630); - rule__LocalProtocolDecl__Group_5_2__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_5_2__0" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_5_2__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7319:1: rule__LocalProtocolDecl__Group_5_2__0__Impl : ( ',' ) ; - public final void rule__LocalProtocolDecl__Group_5_2__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7323:1: ( ( ',' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7324:1: ( ',' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7324:1: ( ',' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7325:1: ',' - { - before(grammarAccess.getLocalProtocolDeclAccess().getCommaKeyword_5_2_0()); - match(input,22,FOLLOW_22_in_rule__LocalProtocolDecl__Group_5_2__0__Impl14658); - after(grammarAccess.getLocalProtocolDeclAccess().getCommaKeyword_5_2_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_5_2__0__Impl" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_5_2__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7338:1: rule__LocalProtocolDecl__Group_5_2__1 : rule__LocalProtocolDecl__Group_5_2__1__Impl ; - public final void rule__LocalProtocolDecl__Group_5_2__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7342:1: ( rule__LocalProtocolDecl__Group_5_2__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7343:2: rule__LocalProtocolDecl__Group_5_2__1__Impl - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_5_2__1__Impl_in_rule__LocalProtocolDecl__Group_5_2__114689); - rule__LocalProtocolDecl__Group_5_2__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_5_2__1" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_5_2__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7349:1: rule__LocalProtocolDecl__Group_5_2__1__Impl : ( ( rule__LocalProtocolDecl__ParametersAssignment_5_2_1 ) ) ; - public final void rule__LocalProtocolDecl__Group_5_2__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7353:1: ( ( ( rule__LocalProtocolDecl__ParametersAssignment_5_2_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7354:1: ( ( rule__LocalProtocolDecl__ParametersAssignment_5_2_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7354:1: ( ( rule__LocalProtocolDecl__ParametersAssignment_5_2_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7355:1: ( rule__LocalProtocolDecl__ParametersAssignment_5_2_1 ) - { - before(grammarAccess.getLocalProtocolDeclAccess().getParametersAssignment_5_2_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7356:1: ( rule__LocalProtocolDecl__ParametersAssignment_5_2_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7356:2: rule__LocalProtocolDecl__ParametersAssignment_5_2_1 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__ParametersAssignment_5_2_1_in_rule__LocalProtocolDecl__Group_5_2__1__Impl14716); - rule__LocalProtocolDecl__ParametersAssignment_5_2_1(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalProtocolDeclAccess().getParametersAssignment_5_2_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_5_2__1__Impl" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_8__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7370:1: rule__LocalProtocolDecl__Group_8__0 : rule__LocalProtocolDecl__Group_8__0__Impl rule__LocalProtocolDecl__Group_8__1 ; - public final void rule__LocalProtocolDecl__Group_8__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7374:1: ( rule__LocalProtocolDecl__Group_8__0__Impl rule__LocalProtocolDecl__Group_8__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7375:2: rule__LocalProtocolDecl__Group_8__0__Impl rule__LocalProtocolDecl__Group_8__1 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_8__0__Impl_in_rule__LocalProtocolDecl__Group_8__014750); - rule__LocalProtocolDecl__Group_8__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_8__1_in_rule__LocalProtocolDecl__Group_8__014753); - rule__LocalProtocolDecl__Group_8__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_8__0" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_8__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7382:1: rule__LocalProtocolDecl__Group_8__0__Impl : ( ',' ) ; - public final void rule__LocalProtocolDecl__Group_8__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7386:1: ( ( ',' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7387:1: ( ',' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7387:1: ( ',' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7388:1: ',' - { - before(grammarAccess.getLocalProtocolDeclAccess().getCommaKeyword_8_0()); - match(input,22,FOLLOW_22_in_rule__LocalProtocolDecl__Group_8__0__Impl14781); - after(grammarAccess.getLocalProtocolDeclAccess().getCommaKeyword_8_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_8__0__Impl" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_8__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7401:1: rule__LocalProtocolDecl__Group_8__1 : rule__LocalProtocolDecl__Group_8__1__Impl ; - public final void rule__LocalProtocolDecl__Group_8__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7405:1: ( rule__LocalProtocolDecl__Group_8__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7406:2: rule__LocalProtocolDecl__Group_8__1__Impl - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_8__1__Impl_in_rule__LocalProtocolDecl__Group_8__114812); - rule__LocalProtocolDecl__Group_8__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_8__1" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_8__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7412:1: rule__LocalProtocolDecl__Group_8__1__Impl : ( ( rule__LocalProtocolDecl__RolesAssignment_8_1 ) ) ; - public final void rule__LocalProtocolDecl__Group_8__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7416:1: ( ( ( rule__LocalProtocolDecl__RolesAssignment_8_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7417:1: ( ( rule__LocalProtocolDecl__RolesAssignment_8_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7417:1: ( ( rule__LocalProtocolDecl__RolesAssignment_8_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7418:1: ( rule__LocalProtocolDecl__RolesAssignment_8_1 ) - { - before(grammarAccess.getLocalProtocolDeclAccess().getRolesAssignment_8_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7419:1: ( rule__LocalProtocolDecl__RolesAssignment_8_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7419:2: rule__LocalProtocolDecl__RolesAssignment_8_1 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__RolesAssignment_8_1_in_rule__LocalProtocolDecl__Group_8__1__Impl14839); - rule__LocalProtocolDecl__RolesAssignment_8_1(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalProtocolDeclAccess().getRolesAssignment_8_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_8__1__Impl" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_10_1__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7433:1: rule__LocalProtocolDecl__Group_10_1__0 : rule__LocalProtocolDecl__Group_10_1__0__Impl rule__LocalProtocolDecl__Group_10_1__1 ; - public final void rule__LocalProtocolDecl__Group_10_1__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7437:1: ( rule__LocalProtocolDecl__Group_10_1__0__Impl rule__LocalProtocolDecl__Group_10_1__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7438:2: rule__LocalProtocolDecl__Group_10_1__0__Impl rule__LocalProtocolDecl__Group_10_1__1 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_10_1__0__Impl_in_rule__LocalProtocolDecl__Group_10_1__014873); - rule__LocalProtocolDecl__Group_10_1__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_10_1__1_in_rule__LocalProtocolDecl__Group_10_1__014876); - rule__LocalProtocolDecl__Group_10_1__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_10_1__0" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_10_1__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7445:1: rule__LocalProtocolDecl__Group_10_1__0__Impl : ( 'instantiates' ) ; - public final void rule__LocalProtocolDecl__Group_10_1__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7449:1: ( ( 'instantiates' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7450:1: ( 'instantiates' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7450:1: ( 'instantiates' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7451:1: 'instantiates' - { - before(grammarAccess.getLocalProtocolDeclAccess().getInstantiatesKeyword_10_1_0()); - match(input,26,FOLLOW_26_in_rule__LocalProtocolDecl__Group_10_1__0__Impl14904); - after(grammarAccess.getLocalProtocolDeclAccess().getInstantiatesKeyword_10_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_10_1__0__Impl" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_10_1__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7464:1: rule__LocalProtocolDecl__Group_10_1__1 : rule__LocalProtocolDecl__Group_10_1__1__Impl rule__LocalProtocolDecl__Group_10_1__2 ; - public final void rule__LocalProtocolDecl__Group_10_1__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7468:1: ( rule__LocalProtocolDecl__Group_10_1__1__Impl rule__LocalProtocolDecl__Group_10_1__2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7469:2: rule__LocalProtocolDecl__Group_10_1__1__Impl rule__LocalProtocolDecl__Group_10_1__2 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_10_1__1__Impl_in_rule__LocalProtocolDecl__Group_10_1__114935); - rule__LocalProtocolDecl__Group_10_1__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_10_1__2_in_rule__LocalProtocolDecl__Group_10_1__114938); - rule__LocalProtocolDecl__Group_10_1__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_10_1__1" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_10_1__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7476:1: rule__LocalProtocolDecl__Group_10_1__1__Impl : ( ( rule__LocalProtocolDecl__InstantiatesAssignment_10_1_1 ) ) ; - public final void rule__LocalProtocolDecl__Group_10_1__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7480:1: ( ( ( rule__LocalProtocolDecl__InstantiatesAssignment_10_1_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7481:1: ( ( rule__LocalProtocolDecl__InstantiatesAssignment_10_1_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7481:1: ( ( rule__LocalProtocolDecl__InstantiatesAssignment_10_1_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7482:1: ( rule__LocalProtocolDecl__InstantiatesAssignment_10_1_1 ) - { - before(grammarAccess.getLocalProtocolDeclAccess().getInstantiatesAssignment_10_1_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7483:1: ( rule__LocalProtocolDecl__InstantiatesAssignment_10_1_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7483:2: rule__LocalProtocolDecl__InstantiatesAssignment_10_1_1 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__InstantiatesAssignment_10_1_1_in_rule__LocalProtocolDecl__Group_10_1__1__Impl14965); - rule__LocalProtocolDecl__InstantiatesAssignment_10_1_1(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalProtocolDeclAccess().getInstantiatesAssignment_10_1_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_10_1__1__Impl" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_10_1__2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7493:1: rule__LocalProtocolDecl__Group_10_1__2 : rule__LocalProtocolDecl__Group_10_1__2__Impl rule__LocalProtocolDecl__Group_10_1__3 ; - public final void rule__LocalProtocolDecl__Group_10_1__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7497:1: ( rule__LocalProtocolDecl__Group_10_1__2__Impl rule__LocalProtocolDecl__Group_10_1__3 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7498:2: rule__LocalProtocolDecl__Group_10_1__2__Impl rule__LocalProtocolDecl__Group_10_1__3 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_10_1__2__Impl_in_rule__LocalProtocolDecl__Group_10_1__214995); - rule__LocalProtocolDecl__Group_10_1__2__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_10_1__3_in_rule__LocalProtocolDecl__Group_10_1__214998); - rule__LocalProtocolDecl__Group_10_1__3(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_10_1__2" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_10_1__2__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7505:1: rule__LocalProtocolDecl__Group_10_1__2__Impl : ( ( rule__LocalProtocolDecl__Group_10_1_2__0 )? ) ; - public final void rule__LocalProtocolDecl__Group_10_1__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7509:1: ( ( ( rule__LocalProtocolDecl__Group_10_1_2__0 )? ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7510:1: ( ( rule__LocalProtocolDecl__Group_10_1_2__0 )? ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7510:1: ( ( rule__LocalProtocolDecl__Group_10_1_2__0 )? ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7511:1: ( rule__LocalProtocolDecl__Group_10_1_2__0 )? - { - before(grammarAccess.getLocalProtocolDeclAccess().getGroup_10_1_2()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7512:1: ( rule__LocalProtocolDecl__Group_10_1_2__0 )? - int alt46=2; - int LA46_0 = input.LA(1); - - if ( (LA46_0==18) ) { - alt46=1; - } - switch (alt46) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7512:2: rule__LocalProtocolDecl__Group_10_1_2__0 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_10_1_2__0_in_rule__LocalProtocolDecl__Group_10_1__2__Impl15025); - rule__LocalProtocolDecl__Group_10_1_2__0(); - - state._fsp--; - - - } - break; - - } - - after(grammarAccess.getLocalProtocolDeclAccess().getGroup_10_1_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_10_1__2__Impl" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_10_1__3" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7522:1: rule__LocalProtocolDecl__Group_10_1__3 : rule__LocalProtocolDecl__Group_10_1__3__Impl rule__LocalProtocolDecl__Group_10_1__4 ; - public final void rule__LocalProtocolDecl__Group_10_1__3() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7526:1: ( rule__LocalProtocolDecl__Group_10_1__3__Impl rule__LocalProtocolDecl__Group_10_1__4 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7527:2: rule__LocalProtocolDecl__Group_10_1__3__Impl rule__LocalProtocolDecl__Group_10_1__4 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_10_1__3__Impl_in_rule__LocalProtocolDecl__Group_10_1__315056); - rule__LocalProtocolDecl__Group_10_1__3__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_10_1__4_in_rule__LocalProtocolDecl__Group_10_1__315059); - rule__LocalProtocolDecl__Group_10_1__4(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_10_1__3" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_10_1__3__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7534:1: rule__LocalProtocolDecl__Group_10_1__3__Impl : ( '(' ) ; - public final void rule__LocalProtocolDecl__Group_10_1__3__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7538:1: ( ( '(' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7539:1: ( '(' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7539:1: ( '(' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7540:1: '(' - { - before(grammarAccess.getLocalProtocolDeclAccess().getLeftParenthesisKeyword_10_1_3()); - match(input,20,FOLLOW_20_in_rule__LocalProtocolDecl__Group_10_1__3__Impl15087); - after(grammarAccess.getLocalProtocolDeclAccess().getLeftParenthesisKeyword_10_1_3()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_10_1__3__Impl" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_10_1__4" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7553:1: rule__LocalProtocolDecl__Group_10_1__4 : rule__LocalProtocolDecl__Group_10_1__4__Impl rule__LocalProtocolDecl__Group_10_1__5 ; - public final void rule__LocalProtocolDecl__Group_10_1__4() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7557:1: ( rule__LocalProtocolDecl__Group_10_1__4__Impl rule__LocalProtocolDecl__Group_10_1__5 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7558:2: rule__LocalProtocolDecl__Group_10_1__4__Impl rule__LocalProtocolDecl__Group_10_1__5 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_10_1__4__Impl_in_rule__LocalProtocolDecl__Group_10_1__415118); - rule__LocalProtocolDecl__Group_10_1__4__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_10_1__5_in_rule__LocalProtocolDecl__Group_10_1__415121); - rule__LocalProtocolDecl__Group_10_1__5(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_10_1__4" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_10_1__4__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7565:1: rule__LocalProtocolDecl__Group_10_1__4__Impl : ( ( rule__LocalProtocolDecl__RoleInstantiationsAssignment_10_1_4 ) ) ; - public final void rule__LocalProtocolDecl__Group_10_1__4__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7569:1: ( ( ( rule__LocalProtocolDecl__RoleInstantiationsAssignment_10_1_4 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7570:1: ( ( rule__LocalProtocolDecl__RoleInstantiationsAssignment_10_1_4 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7570:1: ( ( rule__LocalProtocolDecl__RoleInstantiationsAssignment_10_1_4 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7571:1: ( rule__LocalProtocolDecl__RoleInstantiationsAssignment_10_1_4 ) - { - before(grammarAccess.getLocalProtocolDeclAccess().getRoleInstantiationsAssignment_10_1_4()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7572:1: ( rule__LocalProtocolDecl__RoleInstantiationsAssignment_10_1_4 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7572:2: rule__LocalProtocolDecl__RoleInstantiationsAssignment_10_1_4 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__RoleInstantiationsAssignment_10_1_4_in_rule__LocalProtocolDecl__Group_10_1__4__Impl15148); - rule__LocalProtocolDecl__RoleInstantiationsAssignment_10_1_4(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalProtocolDeclAccess().getRoleInstantiationsAssignment_10_1_4()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_10_1__4__Impl" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_10_1__5" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7582:1: rule__LocalProtocolDecl__Group_10_1__5 : rule__LocalProtocolDecl__Group_10_1__5__Impl rule__LocalProtocolDecl__Group_10_1__6 ; - public final void rule__LocalProtocolDecl__Group_10_1__5() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7586:1: ( rule__LocalProtocolDecl__Group_10_1__5__Impl rule__LocalProtocolDecl__Group_10_1__6 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7587:2: rule__LocalProtocolDecl__Group_10_1__5__Impl rule__LocalProtocolDecl__Group_10_1__6 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_10_1__5__Impl_in_rule__LocalProtocolDecl__Group_10_1__515178); - rule__LocalProtocolDecl__Group_10_1__5__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_10_1__6_in_rule__LocalProtocolDecl__Group_10_1__515181); - rule__LocalProtocolDecl__Group_10_1__6(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_10_1__5" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_10_1__5__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7594:1: rule__LocalProtocolDecl__Group_10_1__5__Impl : ( ( rule__LocalProtocolDecl__Group_10_1_5__0 )* ) ; - public final void rule__LocalProtocolDecl__Group_10_1__5__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7598:1: ( ( ( rule__LocalProtocolDecl__Group_10_1_5__0 )* ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7599:1: ( ( rule__LocalProtocolDecl__Group_10_1_5__0 )* ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7599:1: ( ( rule__LocalProtocolDecl__Group_10_1_5__0 )* ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7600:1: ( rule__LocalProtocolDecl__Group_10_1_5__0 )* - { - before(grammarAccess.getLocalProtocolDeclAccess().getGroup_10_1_5()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7601:1: ( rule__LocalProtocolDecl__Group_10_1_5__0 )* - loop47: - do { - int alt47=2; - int LA47_0 = input.LA(1); - - if ( (LA47_0==22) ) { - alt47=1; - } - - - switch (alt47) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7601:2: rule__LocalProtocolDecl__Group_10_1_5__0 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_10_1_5__0_in_rule__LocalProtocolDecl__Group_10_1__5__Impl15208); - rule__LocalProtocolDecl__Group_10_1_5__0(); - - state._fsp--; - - - } - break; - - default : - break loop47; - } - } while (true); - - after(grammarAccess.getLocalProtocolDeclAccess().getGroup_10_1_5()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_10_1__5__Impl" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_10_1__6" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7611:1: rule__LocalProtocolDecl__Group_10_1__6 : rule__LocalProtocolDecl__Group_10_1__6__Impl rule__LocalProtocolDecl__Group_10_1__7 ; - public final void rule__LocalProtocolDecl__Group_10_1__6() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7615:1: ( rule__LocalProtocolDecl__Group_10_1__6__Impl rule__LocalProtocolDecl__Group_10_1__7 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7616:2: rule__LocalProtocolDecl__Group_10_1__6__Impl rule__LocalProtocolDecl__Group_10_1__7 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_10_1__6__Impl_in_rule__LocalProtocolDecl__Group_10_1__615239); - rule__LocalProtocolDecl__Group_10_1__6__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_10_1__7_in_rule__LocalProtocolDecl__Group_10_1__615242); - rule__LocalProtocolDecl__Group_10_1__7(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_10_1__6" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_10_1__6__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7623:1: rule__LocalProtocolDecl__Group_10_1__6__Impl : ( ')' ) ; - public final void rule__LocalProtocolDecl__Group_10_1__6__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7627:1: ( ( ')' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7628:1: ( ')' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7628:1: ( ')' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7629:1: ')' - { - before(grammarAccess.getLocalProtocolDeclAccess().getRightParenthesisKeyword_10_1_6()); - match(input,21,FOLLOW_21_in_rule__LocalProtocolDecl__Group_10_1__6__Impl15270); - after(grammarAccess.getLocalProtocolDeclAccess().getRightParenthesisKeyword_10_1_6()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_10_1__6__Impl" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_10_1__7" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7642:1: rule__LocalProtocolDecl__Group_10_1__7 : rule__LocalProtocolDecl__Group_10_1__7__Impl ; - public final void rule__LocalProtocolDecl__Group_10_1__7() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7646:1: ( rule__LocalProtocolDecl__Group_10_1__7__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7647:2: rule__LocalProtocolDecl__Group_10_1__7__Impl - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_10_1__7__Impl_in_rule__LocalProtocolDecl__Group_10_1__715301); - rule__LocalProtocolDecl__Group_10_1__7__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_10_1__7" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_10_1__7__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7653:1: rule__LocalProtocolDecl__Group_10_1__7__Impl : ( ';' ) ; - public final void rule__LocalProtocolDecl__Group_10_1__7__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7657:1: ( ( ';' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7658:1: ( ';' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7658:1: ( ';' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7659:1: ';' - { - before(grammarAccess.getLocalProtocolDeclAccess().getSemicolonKeyword_10_1_7()); - match(input,12,FOLLOW_12_in_rule__LocalProtocolDecl__Group_10_1__7__Impl15329); - after(grammarAccess.getLocalProtocolDeclAccess().getSemicolonKeyword_10_1_7()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_10_1__7__Impl" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_10_1_2__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7688:1: rule__LocalProtocolDecl__Group_10_1_2__0 : rule__LocalProtocolDecl__Group_10_1_2__0__Impl rule__LocalProtocolDecl__Group_10_1_2__1 ; - public final void rule__LocalProtocolDecl__Group_10_1_2__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7692:1: ( rule__LocalProtocolDecl__Group_10_1_2__0__Impl rule__LocalProtocolDecl__Group_10_1_2__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7693:2: rule__LocalProtocolDecl__Group_10_1_2__0__Impl rule__LocalProtocolDecl__Group_10_1_2__1 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_10_1_2__0__Impl_in_rule__LocalProtocolDecl__Group_10_1_2__015376); - rule__LocalProtocolDecl__Group_10_1_2__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_10_1_2__1_in_rule__LocalProtocolDecl__Group_10_1_2__015379); - rule__LocalProtocolDecl__Group_10_1_2__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_10_1_2__0" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_10_1_2__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7700:1: rule__LocalProtocolDecl__Group_10_1_2__0__Impl : ( '<' ) ; - public final void rule__LocalProtocolDecl__Group_10_1_2__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7704:1: ( ( '<' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7705:1: ( '<' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7705:1: ( '<' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7706:1: '<' - { - before(grammarAccess.getLocalProtocolDeclAccess().getLessThanSignKeyword_10_1_2_0()); - match(input,18,FOLLOW_18_in_rule__LocalProtocolDecl__Group_10_1_2__0__Impl15407); - after(grammarAccess.getLocalProtocolDeclAccess().getLessThanSignKeyword_10_1_2_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_10_1_2__0__Impl" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_10_1_2__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7719:1: rule__LocalProtocolDecl__Group_10_1_2__1 : rule__LocalProtocolDecl__Group_10_1_2__1__Impl rule__LocalProtocolDecl__Group_10_1_2__2 ; - public final void rule__LocalProtocolDecl__Group_10_1_2__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7723:1: ( rule__LocalProtocolDecl__Group_10_1_2__1__Impl rule__LocalProtocolDecl__Group_10_1_2__2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7724:2: rule__LocalProtocolDecl__Group_10_1_2__1__Impl rule__LocalProtocolDecl__Group_10_1_2__2 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_10_1_2__1__Impl_in_rule__LocalProtocolDecl__Group_10_1_2__115438); - rule__LocalProtocolDecl__Group_10_1_2__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_10_1_2__2_in_rule__LocalProtocolDecl__Group_10_1_2__115441); - rule__LocalProtocolDecl__Group_10_1_2__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_10_1_2__1" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_10_1_2__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7731:1: rule__LocalProtocolDecl__Group_10_1_2__1__Impl : ( ( rule__LocalProtocolDecl__ArgumentsAssignment_10_1_2_1 ) ) ; - public final void rule__LocalProtocolDecl__Group_10_1_2__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7735:1: ( ( ( rule__LocalProtocolDecl__ArgumentsAssignment_10_1_2_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7736:1: ( ( rule__LocalProtocolDecl__ArgumentsAssignment_10_1_2_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7736:1: ( ( rule__LocalProtocolDecl__ArgumentsAssignment_10_1_2_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7737:1: ( rule__LocalProtocolDecl__ArgumentsAssignment_10_1_2_1 ) - { - before(grammarAccess.getLocalProtocolDeclAccess().getArgumentsAssignment_10_1_2_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7738:1: ( rule__LocalProtocolDecl__ArgumentsAssignment_10_1_2_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7738:2: rule__LocalProtocolDecl__ArgumentsAssignment_10_1_2_1 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__ArgumentsAssignment_10_1_2_1_in_rule__LocalProtocolDecl__Group_10_1_2__1__Impl15468); - rule__LocalProtocolDecl__ArgumentsAssignment_10_1_2_1(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalProtocolDeclAccess().getArgumentsAssignment_10_1_2_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_10_1_2__1__Impl" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_10_1_2__2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7748:1: rule__LocalProtocolDecl__Group_10_1_2__2 : rule__LocalProtocolDecl__Group_10_1_2__2__Impl rule__LocalProtocolDecl__Group_10_1_2__3 ; - public final void rule__LocalProtocolDecl__Group_10_1_2__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7752:1: ( rule__LocalProtocolDecl__Group_10_1_2__2__Impl rule__LocalProtocolDecl__Group_10_1_2__3 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7753:2: rule__LocalProtocolDecl__Group_10_1_2__2__Impl rule__LocalProtocolDecl__Group_10_1_2__3 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_10_1_2__2__Impl_in_rule__LocalProtocolDecl__Group_10_1_2__215498); - rule__LocalProtocolDecl__Group_10_1_2__2__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_10_1_2__3_in_rule__LocalProtocolDecl__Group_10_1_2__215501); - rule__LocalProtocolDecl__Group_10_1_2__3(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_10_1_2__2" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_10_1_2__2__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7760:1: rule__LocalProtocolDecl__Group_10_1_2__2__Impl : ( ( rule__LocalProtocolDecl__Group_10_1_2_2__0 )* ) ; - public final void rule__LocalProtocolDecl__Group_10_1_2__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7764:1: ( ( ( rule__LocalProtocolDecl__Group_10_1_2_2__0 )* ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7765:1: ( ( rule__LocalProtocolDecl__Group_10_1_2_2__0 )* ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7765:1: ( ( rule__LocalProtocolDecl__Group_10_1_2_2__0 )* ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7766:1: ( rule__LocalProtocolDecl__Group_10_1_2_2__0 )* - { - before(grammarAccess.getLocalProtocolDeclAccess().getGroup_10_1_2_2()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7767:1: ( rule__LocalProtocolDecl__Group_10_1_2_2__0 )* - loop48: - do { - int alt48=2; - int LA48_0 = input.LA(1); - - if ( (LA48_0==22) ) { - alt48=1; - } - - - switch (alt48) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7767:2: rule__LocalProtocolDecl__Group_10_1_2_2__0 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_10_1_2_2__0_in_rule__LocalProtocolDecl__Group_10_1_2__2__Impl15528); - rule__LocalProtocolDecl__Group_10_1_2_2__0(); - - state._fsp--; - - - } - break; - - default : - break loop48; - } - } while (true); - - after(grammarAccess.getLocalProtocolDeclAccess().getGroup_10_1_2_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_10_1_2__2__Impl" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_10_1_2__3" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7777:1: rule__LocalProtocolDecl__Group_10_1_2__3 : rule__LocalProtocolDecl__Group_10_1_2__3__Impl ; - public final void rule__LocalProtocolDecl__Group_10_1_2__3() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7781:1: ( rule__LocalProtocolDecl__Group_10_1_2__3__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7782:2: rule__LocalProtocolDecl__Group_10_1_2__3__Impl - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_10_1_2__3__Impl_in_rule__LocalProtocolDecl__Group_10_1_2__315559); - rule__LocalProtocolDecl__Group_10_1_2__3__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_10_1_2__3" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_10_1_2__3__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7788:1: rule__LocalProtocolDecl__Group_10_1_2__3__Impl : ( '>' ) ; - public final void rule__LocalProtocolDecl__Group_10_1_2__3__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7792:1: ( ( '>' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7793:1: ( '>' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7793:1: ( '>' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7794:1: '>' - { - before(grammarAccess.getLocalProtocolDeclAccess().getGreaterThanSignKeyword_10_1_2_3()); - match(input,19,FOLLOW_19_in_rule__LocalProtocolDecl__Group_10_1_2__3__Impl15587); - after(grammarAccess.getLocalProtocolDeclAccess().getGreaterThanSignKeyword_10_1_2_3()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_10_1_2__3__Impl" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_10_1_2_2__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7815:1: rule__LocalProtocolDecl__Group_10_1_2_2__0 : rule__LocalProtocolDecl__Group_10_1_2_2__0__Impl rule__LocalProtocolDecl__Group_10_1_2_2__1 ; - public final void rule__LocalProtocolDecl__Group_10_1_2_2__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7819:1: ( rule__LocalProtocolDecl__Group_10_1_2_2__0__Impl rule__LocalProtocolDecl__Group_10_1_2_2__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7820:2: rule__LocalProtocolDecl__Group_10_1_2_2__0__Impl rule__LocalProtocolDecl__Group_10_1_2_2__1 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_10_1_2_2__0__Impl_in_rule__LocalProtocolDecl__Group_10_1_2_2__015626); - rule__LocalProtocolDecl__Group_10_1_2_2__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_10_1_2_2__1_in_rule__LocalProtocolDecl__Group_10_1_2_2__015629); - rule__LocalProtocolDecl__Group_10_1_2_2__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_10_1_2_2__0" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_10_1_2_2__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7827:1: rule__LocalProtocolDecl__Group_10_1_2_2__0__Impl : ( ',' ) ; - public final void rule__LocalProtocolDecl__Group_10_1_2_2__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7831:1: ( ( ',' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7832:1: ( ',' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7832:1: ( ',' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7833:1: ',' - { - before(grammarAccess.getLocalProtocolDeclAccess().getCommaKeyword_10_1_2_2_0()); - match(input,22,FOLLOW_22_in_rule__LocalProtocolDecl__Group_10_1_2_2__0__Impl15657); - after(grammarAccess.getLocalProtocolDeclAccess().getCommaKeyword_10_1_2_2_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_10_1_2_2__0__Impl" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_10_1_2_2__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7846:1: rule__LocalProtocolDecl__Group_10_1_2_2__1 : rule__LocalProtocolDecl__Group_10_1_2_2__1__Impl ; - public final void rule__LocalProtocolDecl__Group_10_1_2_2__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7850:1: ( rule__LocalProtocolDecl__Group_10_1_2_2__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7851:2: rule__LocalProtocolDecl__Group_10_1_2_2__1__Impl - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_10_1_2_2__1__Impl_in_rule__LocalProtocolDecl__Group_10_1_2_2__115688); - rule__LocalProtocolDecl__Group_10_1_2_2__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_10_1_2_2__1" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_10_1_2_2__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7857:1: rule__LocalProtocolDecl__Group_10_1_2_2__1__Impl : ( ( rule__LocalProtocolDecl__ArgumentsAssignment_10_1_2_2_1 ) ) ; - public final void rule__LocalProtocolDecl__Group_10_1_2_2__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7861:1: ( ( ( rule__LocalProtocolDecl__ArgumentsAssignment_10_1_2_2_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7862:1: ( ( rule__LocalProtocolDecl__ArgumentsAssignment_10_1_2_2_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7862:1: ( ( rule__LocalProtocolDecl__ArgumentsAssignment_10_1_2_2_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7863:1: ( rule__LocalProtocolDecl__ArgumentsAssignment_10_1_2_2_1 ) - { - before(grammarAccess.getLocalProtocolDeclAccess().getArgumentsAssignment_10_1_2_2_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7864:1: ( rule__LocalProtocolDecl__ArgumentsAssignment_10_1_2_2_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7864:2: rule__LocalProtocolDecl__ArgumentsAssignment_10_1_2_2_1 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__ArgumentsAssignment_10_1_2_2_1_in_rule__LocalProtocolDecl__Group_10_1_2_2__1__Impl15715); - rule__LocalProtocolDecl__ArgumentsAssignment_10_1_2_2_1(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalProtocolDeclAccess().getArgumentsAssignment_10_1_2_2_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_10_1_2_2__1__Impl" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_10_1_5__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7878:1: rule__LocalProtocolDecl__Group_10_1_5__0 : rule__LocalProtocolDecl__Group_10_1_5__0__Impl rule__LocalProtocolDecl__Group_10_1_5__1 ; - public final void rule__LocalProtocolDecl__Group_10_1_5__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7882:1: ( rule__LocalProtocolDecl__Group_10_1_5__0__Impl rule__LocalProtocolDecl__Group_10_1_5__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7883:2: rule__LocalProtocolDecl__Group_10_1_5__0__Impl rule__LocalProtocolDecl__Group_10_1_5__1 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_10_1_5__0__Impl_in_rule__LocalProtocolDecl__Group_10_1_5__015749); - rule__LocalProtocolDecl__Group_10_1_5__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_10_1_5__1_in_rule__LocalProtocolDecl__Group_10_1_5__015752); - rule__LocalProtocolDecl__Group_10_1_5__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_10_1_5__0" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_10_1_5__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7890:1: rule__LocalProtocolDecl__Group_10_1_5__0__Impl : ( ',' ) ; - public final void rule__LocalProtocolDecl__Group_10_1_5__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7894:1: ( ( ',' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7895:1: ( ',' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7895:1: ( ',' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7896:1: ',' - { - before(grammarAccess.getLocalProtocolDeclAccess().getCommaKeyword_10_1_5_0()); - match(input,22,FOLLOW_22_in_rule__LocalProtocolDecl__Group_10_1_5__0__Impl15780); - after(grammarAccess.getLocalProtocolDeclAccess().getCommaKeyword_10_1_5_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_10_1_5__0__Impl" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_10_1_5__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7909:1: rule__LocalProtocolDecl__Group_10_1_5__1 : rule__LocalProtocolDecl__Group_10_1_5__1__Impl ; - public final void rule__LocalProtocolDecl__Group_10_1_5__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7913:1: ( rule__LocalProtocolDecl__Group_10_1_5__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7914:2: rule__LocalProtocolDecl__Group_10_1_5__1__Impl - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__Group_10_1_5__1__Impl_in_rule__LocalProtocolDecl__Group_10_1_5__115811); - rule__LocalProtocolDecl__Group_10_1_5__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_10_1_5__1" - - - // $ANTLR start "rule__LocalProtocolDecl__Group_10_1_5__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7920:1: rule__LocalProtocolDecl__Group_10_1_5__1__Impl : ( ( rule__LocalProtocolDecl__RoleInstantiationsAssignment_10_1_5_1 ) ) ; - public final void rule__LocalProtocolDecl__Group_10_1_5__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7924:1: ( ( ( rule__LocalProtocolDecl__RoleInstantiationsAssignment_10_1_5_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7925:1: ( ( rule__LocalProtocolDecl__RoleInstantiationsAssignment_10_1_5_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7925:1: ( ( rule__LocalProtocolDecl__RoleInstantiationsAssignment_10_1_5_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7926:1: ( rule__LocalProtocolDecl__RoleInstantiationsAssignment_10_1_5_1 ) - { - before(grammarAccess.getLocalProtocolDeclAccess().getRoleInstantiationsAssignment_10_1_5_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7927:1: ( rule__LocalProtocolDecl__RoleInstantiationsAssignment_10_1_5_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7927:2: rule__LocalProtocolDecl__RoleInstantiationsAssignment_10_1_5_1 - { - pushFollow(FOLLOW_rule__LocalProtocolDecl__RoleInstantiationsAssignment_10_1_5_1_in_rule__LocalProtocolDecl__Group_10_1_5__1__Impl15838); - rule__LocalProtocolDecl__RoleInstantiationsAssignment_10_1_5_1(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalProtocolDeclAccess().getRoleInstantiationsAssignment_10_1_5_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__Group_10_1_5__1__Impl" - - - // $ANTLR start "rule__LocalProtocolBlock__Group__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7941:1: rule__LocalProtocolBlock__Group__0 : rule__LocalProtocolBlock__Group__0__Impl rule__LocalProtocolBlock__Group__1 ; - public final void rule__LocalProtocolBlock__Group__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7945:1: ( rule__LocalProtocolBlock__Group__0__Impl rule__LocalProtocolBlock__Group__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7946:2: rule__LocalProtocolBlock__Group__0__Impl rule__LocalProtocolBlock__Group__1 - { - pushFollow(FOLLOW_rule__LocalProtocolBlock__Group__0__Impl_in_rule__LocalProtocolBlock__Group__015872); - rule__LocalProtocolBlock__Group__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalProtocolBlock__Group__1_in_rule__LocalProtocolBlock__Group__015875); - rule__LocalProtocolBlock__Group__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolBlock__Group__0" - - - // $ANTLR start "rule__LocalProtocolBlock__Group__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7953:1: rule__LocalProtocolBlock__Group__0__Impl : ( () ) ; - public final void rule__LocalProtocolBlock__Group__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7957:1: ( ( () ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7958:1: ( () ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7958:1: ( () ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7959:1: () - { - before(grammarAccess.getLocalProtocolBlockAccess().getLocalProtocolBlockAction_0()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7960:1: () - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7962:1: - { - } - - after(grammarAccess.getLocalProtocolBlockAccess().getLocalProtocolBlockAction_0()); - - } - - - } - - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolBlock__Group__0__Impl" - - - // $ANTLR start "rule__LocalProtocolBlock__Group__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7972:1: rule__LocalProtocolBlock__Group__1 : rule__LocalProtocolBlock__Group__1__Impl rule__LocalProtocolBlock__Group__2 ; - public final void rule__LocalProtocolBlock__Group__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7976:1: ( rule__LocalProtocolBlock__Group__1__Impl rule__LocalProtocolBlock__Group__2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7977:2: rule__LocalProtocolBlock__Group__1__Impl rule__LocalProtocolBlock__Group__2 - { - pushFollow(FOLLOW_rule__LocalProtocolBlock__Group__1__Impl_in_rule__LocalProtocolBlock__Group__115933); - rule__LocalProtocolBlock__Group__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalProtocolBlock__Group__2_in_rule__LocalProtocolBlock__Group__115936); - rule__LocalProtocolBlock__Group__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolBlock__Group__1" - - - // $ANTLR start "rule__LocalProtocolBlock__Group__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7984:1: rule__LocalProtocolBlock__Group__1__Impl : ( '{' ) ; - public final void rule__LocalProtocolBlock__Group__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7988:1: ( ( '{' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7989:1: ( '{' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7989:1: ( '{' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:7990:1: '{' - { - before(grammarAccess.getLocalProtocolBlockAccess().getLeftCurlyBracketKeyword_1()); - match(input,29,FOLLOW_29_in_rule__LocalProtocolBlock__Group__1__Impl15964); - after(grammarAccess.getLocalProtocolBlockAccess().getLeftCurlyBracketKeyword_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolBlock__Group__1__Impl" - - - // $ANTLR start "rule__LocalProtocolBlock__Group__2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8003:1: rule__LocalProtocolBlock__Group__2 : rule__LocalProtocolBlock__Group__2__Impl rule__LocalProtocolBlock__Group__3 ; - public final void rule__LocalProtocolBlock__Group__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8007:1: ( rule__LocalProtocolBlock__Group__2__Impl rule__LocalProtocolBlock__Group__3 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8008:2: rule__LocalProtocolBlock__Group__2__Impl rule__LocalProtocolBlock__Group__3 - { - pushFollow(FOLLOW_rule__LocalProtocolBlock__Group__2__Impl_in_rule__LocalProtocolBlock__Group__215995); - rule__LocalProtocolBlock__Group__2__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalProtocolBlock__Group__3_in_rule__LocalProtocolBlock__Group__215998); - rule__LocalProtocolBlock__Group__3(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolBlock__Group__2" - - - // $ANTLR start "rule__LocalProtocolBlock__Group__2__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8015:1: rule__LocalProtocolBlock__Group__2__Impl : ( ( rule__LocalProtocolBlock__ActivitiesAssignment_2 )* ) ; - public final void rule__LocalProtocolBlock__Group__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8019:1: ( ( ( rule__LocalProtocolBlock__ActivitiesAssignment_2 )* ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8020:1: ( ( rule__LocalProtocolBlock__ActivitiesAssignment_2 )* ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8020:1: ( ( rule__LocalProtocolBlock__ActivitiesAssignment_2 )* ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8021:1: ( rule__LocalProtocolBlock__ActivitiesAssignment_2 )* - { - before(grammarAccess.getLocalProtocolBlockAccess().getActivitiesAssignment_2()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8022:1: ( rule__LocalProtocolBlock__ActivitiesAssignment_2 )* - loop49: - do { - int alt49=2; - int LA49_0 = input.LA(1); - - if ( (LA49_0==RULE_ID||LA49_0==20||LA49_0==32||(LA49_0>=35 && LA49_0<=37)||LA49_0==39||LA49_0==42) ) { - alt49=1; - } - - - switch (alt49) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8022:2: rule__LocalProtocolBlock__ActivitiesAssignment_2 - { - pushFollow(FOLLOW_rule__LocalProtocolBlock__ActivitiesAssignment_2_in_rule__LocalProtocolBlock__Group__2__Impl16025); - rule__LocalProtocolBlock__ActivitiesAssignment_2(); - - state._fsp--; - - - } - break; - - default : - break loop49; - } - } while (true); - - after(grammarAccess.getLocalProtocolBlockAccess().getActivitiesAssignment_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolBlock__Group__2__Impl" - - - // $ANTLR start "rule__LocalProtocolBlock__Group__3" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8032:1: rule__LocalProtocolBlock__Group__3 : rule__LocalProtocolBlock__Group__3__Impl ; - public final void rule__LocalProtocolBlock__Group__3() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8036:1: ( rule__LocalProtocolBlock__Group__3__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8037:2: rule__LocalProtocolBlock__Group__3__Impl - { - pushFollow(FOLLOW_rule__LocalProtocolBlock__Group__3__Impl_in_rule__LocalProtocolBlock__Group__316056); - rule__LocalProtocolBlock__Group__3__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolBlock__Group__3" - - - // $ANTLR start "rule__LocalProtocolBlock__Group__3__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8043:1: rule__LocalProtocolBlock__Group__3__Impl : ( '}' ) ; - public final void rule__LocalProtocolBlock__Group__3__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8047:1: ( ( '}' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8048:1: ( '}' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8048:1: ( '}' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8049:1: '}' - { - before(grammarAccess.getLocalProtocolBlockAccess().getRightCurlyBracketKeyword_3()); - match(input,30,FOLLOW_30_in_rule__LocalProtocolBlock__Group__3__Impl16084); - after(grammarAccess.getLocalProtocolBlockAccess().getRightCurlyBracketKeyword_3()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolBlock__Group__3__Impl" - - - // $ANTLR start "rule__LocalSend__Group__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8070:1: rule__LocalSend__Group__0 : rule__LocalSend__Group__0__Impl rule__LocalSend__Group__1 ; - public final void rule__LocalSend__Group__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8074:1: ( rule__LocalSend__Group__0__Impl rule__LocalSend__Group__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8075:2: rule__LocalSend__Group__0__Impl rule__LocalSend__Group__1 - { - pushFollow(FOLLOW_rule__LocalSend__Group__0__Impl_in_rule__LocalSend__Group__016123); - rule__LocalSend__Group__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalSend__Group__1_in_rule__LocalSend__Group__016126); - rule__LocalSend__Group__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalSend__Group__0" - - - // $ANTLR start "rule__LocalSend__Group__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8082:1: rule__LocalSend__Group__0__Impl : ( ( rule__LocalSend__MessageAssignment_0 ) ) ; - public final void rule__LocalSend__Group__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8086:1: ( ( ( rule__LocalSend__MessageAssignment_0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8087:1: ( ( rule__LocalSend__MessageAssignment_0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8087:1: ( ( rule__LocalSend__MessageAssignment_0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8088:1: ( rule__LocalSend__MessageAssignment_0 ) - { - before(grammarAccess.getLocalSendAccess().getMessageAssignment_0()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8089:1: ( rule__LocalSend__MessageAssignment_0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8089:2: rule__LocalSend__MessageAssignment_0 - { - pushFollow(FOLLOW_rule__LocalSend__MessageAssignment_0_in_rule__LocalSend__Group__0__Impl16153); - rule__LocalSend__MessageAssignment_0(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalSendAccess().getMessageAssignment_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalSend__Group__0__Impl" - - - // $ANTLR start "rule__LocalSend__Group__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8099:1: rule__LocalSend__Group__1 : rule__LocalSend__Group__1__Impl rule__LocalSend__Group__2 ; - public final void rule__LocalSend__Group__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8103:1: ( rule__LocalSend__Group__1__Impl rule__LocalSend__Group__2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8104:2: rule__LocalSend__Group__1__Impl rule__LocalSend__Group__2 - { - pushFollow(FOLLOW_rule__LocalSend__Group__1__Impl_in_rule__LocalSend__Group__116183); - rule__LocalSend__Group__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalSend__Group__2_in_rule__LocalSend__Group__116186); - rule__LocalSend__Group__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalSend__Group__1" - - - // $ANTLR start "rule__LocalSend__Group__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8111:1: rule__LocalSend__Group__1__Impl : ( 'to' ) ; - public final void rule__LocalSend__Group__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8115:1: ( ( 'to' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8116:1: ( 'to' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8116:1: ( 'to' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8117:1: 'to' - { - before(grammarAccess.getLocalSendAccess().getToKeyword_1()); - match(input,31,FOLLOW_31_in_rule__LocalSend__Group__1__Impl16214); - after(grammarAccess.getLocalSendAccess().getToKeyword_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalSend__Group__1__Impl" - - - // $ANTLR start "rule__LocalSend__Group__2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8130:1: rule__LocalSend__Group__2 : rule__LocalSend__Group__2__Impl rule__LocalSend__Group__3 ; - public final void rule__LocalSend__Group__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8134:1: ( rule__LocalSend__Group__2__Impl rule__LocalSend__Group__3 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8135:2: rule__LocalSend__Group__2__Impl rule__LocalSend__Group__3 - { - pushFollow(FOLLOW_rule__LocalSend__Group__2__Impl_in_rule__LocalSend__Group__216245); - rule__LocalSend__Group__2__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalSend__Group__3_in_rule__LocalSend__Group__216248); - rule__LocalSend__Group__3(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalSend__Group__2" - - - // $ANTLR start "rule__LocalSend__Group__2__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8142:1: rule__LocalSend__Group__2__Impl : ( ( rule__LocalSend__ToRolesAssignment_2 ) ) ; - public final void rule__LocalSend__Group__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8146:1: ( ( ( rule__LocalSend__ToRolesAssignment_2 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8147:1: ( ( rule__LocalSend__ToRolesAssignment_2 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8147:1: ( ( rule__LocalSend__ToRolesAssignment_2 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8148:1: ( rule__LocalSend__ToRolesAssignment_2 ) - { - before(grammarAccess.getLocalSendAccess().getToRolesAssignment_2()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8149:1: ( rule__LocalSend__ToRolesAssignment_2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8149:2: rule__LocalSend__ToRolesAssignment_2 - { - pushFollow(FOLLOW_rule__LocalSend__ToRolesAssignment_2_in_rule__LocalSend__Group__2__Impl16275); - rule__LocalSend__ToRolesAssignment_2(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalSendAccess().getToRolesAssignment_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalSend__Group__2__Impl" - - - // $ANTLR start "rule__LocalSend__Group__3" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8159:1: rule__LocalSend__Group__3 : rule__LocalSend__Group__3__Impl rule__LocalSend__Group__4 ; - public final void rule__LocalSend__Group__3() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8163:1: ( rule__LocalSend__Group__3__Impl rule__LocalSend__Group__4 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8164:2: rule__LocalSend__Group__3__Impl rule__LocalSend__Group__4 - { - pushFollow(FOLLOW_rule__LocalSend__Group__3__Impl_in_rule__LocalSend__Group__316305); - rule__LocalSend__Group__3__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalSend__Group__4_in_rule__LocalSend__Group__316308); - rule__LocalSend__Group__4(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalSend__Group__3" - - - // $ANTLR start "rule__LocalSend__Group__3__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8171:1: rule__LocalSend__Group__3__Impl : ( ( rule__LocalSend__Group_3__0 )* ) ; - public final void rule__LocalSend__Group__3__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8175:1: ( ( ( rule__LocalSend__Group_3__0 )* ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8176:1: ( ( rule__LocalSend__Group_3__0 )* ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8176:1: ( ( rule__LocalSend__Group_3__0 )* ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8177:1: ( rule__LocalSend__Group_3__0 )* - { - before(grammarAccess.getLocalSendAccess().getGroup_3()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8178:1: ( rule__LocalSend__Group_3__0 )* - loop50: - do { - int alt50=2; - int LA50_0 = input.LA(1); - - if ( (LA50_0==22) ) { - alt50=1; - } - - - switch (alt50) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8178:2: rule__LocalSend__Group_3__0 - { - pushFollow(FOLLOW_rule__LocalSend__Group_3__0_in_rule__LocalSend__Group__3__Impl16335); - rule__LocalSend__Group_3__0(); - - state._fsp--; - - - } - break; - - default : - break loop50; - } - } while (true); - - after(grammarAccess.getLocalSendAccess().getGroup_3()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalSend__Group__3__Impl" - - - // $ANTLR start "rule__LocalSend__Group__4" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8188:1: rule__LocalSend__Group__4 : rule__LocalSend__Group__4__Impl ; - public final void rule__LocalSend__Group__4() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8192:1: ( rule__LocalSend__Group__4__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8193:2: rule__LocalSend__Group__4__Impl - { - pushFollow(FOLLOW_rule__LocalSend__Group__4__Impl_in_rule__LocalSend__Group__416366); - rule__LocalSend__Group__4__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalSend__Group__4" - - - // $ANTLR start "rule__LocalSend__Group__4__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8199:1: rule__LocalSend__Group__4__Impl : ( ';' ) ; - public final void rule__LocalSend__Group__4__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8203:1: ( ( ';' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8204:1: ( ';' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8204:1: ( ';' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8205:1: ';' - { - before(grammarAccess.getLocalSendAccess().getSemicolonKeyword_4()); - match(input,12,FOLLOW_12_in_rule__LocalSend__Group__4__Impl16394); - after(grammarAccess.getLocalSendAccess().getSemicolonKeyword_4()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalSend__Group__4__Impl" - - - // $ANTLR start "rule__LocalSend__Group_3__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8228:1: rule__LocalSend__Group_3__0 : rule__LocalSend__Group_3__0__Impl rule__LocalSend__Group_3__1 ; - public final void rule__LocalSend__Group_3__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8232:1: ( rule__LocalSend__Group_3__0__Impl rule__LocalSend__Group_3__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8233:2: rule__LocalSend__Group_3__0__Impl rule__LocalSend__Group_3__1 - { - pushFollow(FOLLOW_rule__LocalSend__Group_3__0__Impl_in_rule__LocalSend__Group_3__016435); - rule__LocalSend__Group_3__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalSend__Group_3__1_in_rule__LocalSend__Group_3__016438); - rule__LocalSend__Group_3__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalSend__Group_3__0" - - - // $ANTLR start "rule__LocalSend__Group_3__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8240:1: rule__LocalSend__Group_3__0__Impl : ( ',' ) ; - public final void rule__LocalSend__Group_3__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8244:1: ( ( ',' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8245:1: ( ',' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8245:1: ( ',' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8246:1: ',' - { - before(grammarAccess.getLocalSendAccess().getCommaKeyword_3_0()); - match(input,22,FOLLOW_22_in_rule__LocalSend__Group_3__0__Impl16466); - after(grammarAccess.getLocalSendAccess().getCommaKeyword_3_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalSend__Group_3__0__Impl" - - - // $ANTLR start "rule__LocalSend__Group_3__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8259:1: rule__LocalSend__Group_3__1 : rule__LocalSend__Group_3__1__Impl ; - public final void rule__LocalSend__Group_3__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8263:1: ( rule__LocalSend__Group_3__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8264:2: rule__LocalSend__Group_3__1__Impl - { - pushFollow(FOLLOW_rule__LocalSend__Group_3__1__Impl_in_rule__LocalSend__Group_3__116497); - rule__LocalSend__Group_3__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalSend__Group_3__1" - - - // $ANTLR start "rule__LocalSend__Group_3__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8270:1: rule__LocalSend__Group_3__1__Impl : ( ( rule__LocalSend__ToRolesAssignment_3_1 ) ) ; - public final void rule__LocalSend__Group_3__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8274:1: ( ( ( rule__LocalSend__ToRolesAssignment_3_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8275:1: ( ( rule__LocalSend__ToRolesAssignment_3_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8275:1: ( ( rule__LocalSend__ToRolesAssignment_3_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8276:1: ( rule__LocalSend__ToRolesAssignment_3_1 ) - { - before(grammarAccess.getLocalSendAccess().getToRolesAssignment_3_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8277:1: ( rule__LocalSend__ToRolesAssignment_3_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8277:2: rule__LocalSend__ToRolesAssignment_3_1 - { - pushFollow(FOLLOW_rule__LocalSend__ToRolesAssignment_3_1_in_rule__LocalSend__Group_3__1__Impl16524); - rule__LocalSend__ToRolesAssignment_3_1(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalSendAccess().getToRolesAssignment_3_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalSend__Group_3__1__Impl" - - - // $ANTLR start "rule__LocalReceive__Group__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8291:1: rule__LocalReceive__Group__0 : rule__LocalReceive__Group__0__Impl rule__LocalReceive__Group__1 ; - public final void rule__LocalReceive__Group__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8295:1: ( rule__LocalReceive__Group__0__Impl rule__LocalReceive__Group__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8296:2: rule__LocalReceive__Group__0__Impl rule__LocalReceive__Group__1 - { - pushFollow(FOLLOW_rule__LocalReceive__Group__0__Impl_in_rule__LocalReceive__Group__016558); - rule__LocalReceive__Group__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalReceive__Group__1_in_rule__LocalReceive__Group__016561); - rule__LocalReceive__Group__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalReceive__Group__0" - - - // $ANTLR start "rule__LocalReceive__Group__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8303:1: rule__LocalReceive__Group__0__Impl : ( ( rule__LocalReceive__MessageAssignment_0 ) ) ; - public final void rule__LocalReceive__Group__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8307:1: ( ( ( rule__LocalReceive__MessageAssignment_0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8308:1: ( ( rule__LocalReceive__MessageAssignment_0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8308:1: ( ( rule__LocalReceive__MessageAssignment_0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8309:1: ( rule__LocalReceive__MessageAssignment_0 ) - { - before(grammarAccess.getLocalReceiveAccess().getMessageAssignment_0()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8310:1: ( rule__LocalReceive__MessageAssignment_0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8310:2: rule__LocalReceive__MessageAssignment_0 - { - pushFollow(FOLLOW_rule__LocalReceive__MessageAssignment_0_in_rule__LocalReceive__Group__0__Impl16588); - rule__LocalReceive__MessageAssignment_0(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalReceiveAccess().getMessageAssignment_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalReceive__Group__0__Impl" - - - // $ANTLR start "rule__LocalReceive__Group__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8320:1: rule__LocalReceive__Group__1 : rule__LocalReceive__Group__1__Impl rule__LocalReceive__Group__2 ; - public final void rule__LocalReceive__Group__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8324:1: ( rule__LocalReceive__Group__1__Impl rule__LocalReceive__Group__2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8325:2: rule__LocalReceive__Group__1__Impl rule__LocalReceive__Group__2 - { - pushFollow(FOLLOW_rule__LocalReceive__Group__1__Impl_in_rule__LocalReceive__Group__116618); - rule__LocalReceive__Group__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalReceive__Group__2_in_rule__LocalReceive__Group__116621); - rule__LocalReceive__Group__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalReceive__Group__1" - - - // $ANTLR start "rule__LocalReceive__Group__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8332:1: rule__LocalReceive__Group__1__Impl : ( 'from' ) ; - public final void rule__LocalReceive__Group__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8336:1: ( ( 'from' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8337:1: ( 'from' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8337:1: ( 'from' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8338:1: 'from' - { - before(grammarAccess.getLocalReceiveAccess().getFromKeyword_1()); - match(input,16,FOLLOW_16_in_rule__LocalReceive__Group__1__Impl16649); - after(grammarAccess.getLocalReceiveAccess().getFromKeyword_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalReceive__Group__1__Impl" - - - // $ANTLR start "rule__LocalReceive__Group__2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8351:1: rule__LocalReceive__Group__2 : rule__LocalReceive__Group__2__Impl rule__LocalReceive__Group__3 ; - public final void rule__LocalReceive__Group__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8355:1: ( rule__LocalReceive__Group__2__Impl rule__LocalReceive__Group__3 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8356:2: rule__LocalReceive__Group__2__Impl rule__LocalReceive__Group__3 - { - pushFollow(FOLLOW_rule__LocalReceive__Group__2__Impl_in_rule__LocalReceive__Group__216680); - rule__LocalReceive__Group__2__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalReceive__Group__3_in_rule__LocalReceive__Group__216683); - rule__LocalReceive__Group__3(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalReceive__Group__2" - - - // $ANTLR start "rule__LocalReceive__Group__2__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8363:1: rule__LocalReceive__Group__2__Impl : ( ( rule__LocalReceive__FromRoleAssignment_2 ) ) ; - public final void rule__LocalReceive__Group__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8367:1: ( ( ( rule__LocalReceive__FromRoleAssignment_2 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8368:1: ( ( rule__LocalReceive__FromRoleAssignment_2 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8368:1: ( ( rule__LocalReceive__FromRoleAssignment_2 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8369:1: ( rule__LocalReceive__FromRoleAssignment_2 ) - { - before(grammarAccess.getLocalReceiveAccess().getFromRoleAssignment_2()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8370:1: ( rule__LocalReceive__FromRoleAssignment_2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8370:2: rule__LocalReceive__FromRoleAssignment_2 - { - pushFollow(FOLLOW_rule__LocalReceive__FromRoleAssignment_2_in_rule__LocalReceive__Group__2__Impl16710); - rule__LocalReceive__FromRoleAssignment_2(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalReceiveAccess().getFromRoleAssignment_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalReceive__Group__2__Impl" - - - // $ANTLR start "rule__LocalReceive__Group__3" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8380:1: rule__LocalReceive__Group__3 : rule__LocalReceive__Group__3__Impl ; - public final void rule__LocalReceive__Group__3() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8384:1: ( rule__LocalReceive__Group__3__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8385:2: rule__LocalReceive__Group__3__Impl - { - pushFollow(FOLLOW_rule__LocalReceive__Group__3__Impl_in_rule__LocalReceive__Group__316740); - rule__LocalReceive__Group__3__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalReceive__Group__3" - - - // $ANTLR start "rule__LocalReceive__Group__3__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8391:1: rule__LocalReceive__Group__3__Impl : ( ';' ) ; - public final void rule__LocalReceive__Group__3__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8395:1: ( ( ';' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8396:1: ( ';' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8396:1: ( ';' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8397:1: ';' - { - before(grammarAccess.getLocalReceiveAccess().getSemicolonKeyword_3()); - match(input,12,FOLLOW_12_in_rule__LocalReceive__Group__3__Impl16768); - after(grammarAccess.getLocalReceiveAccess().getSemicolonKeyword_3()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalReceive__Group__3__Impl" - - - // $ANTLR start "rule__LocalChoice__Group__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8418:1: rule__LocalChoice__Group__0 : rule__LocalChoice__Group__0__Impl rule__LocalChoice__Group__1 ; - public final void rule__LocalChoice__Group__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8422:1: ( rule__LocalChoice__Group__0__Impl rule__LocalChoice__Group__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8423:2: rule__LocalChoice__Group__0__Impl rule__LocalChoice__Group__1 - { - pushFollow(FOLLOW_rule__LocalChoice__Group__0__Impl_in_rule__LocalChoice__Group__016807); - rule__LocalChoice__Group__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalChoice__Group__1_in_rule__LocalChoice__Group__016810); - rule__LocalChoice__Group__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalChoice__Group__0" - - - // $ANTLR start "rule__LocalChoice__Group__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8430:1: rule__LocalChoice__Group__0__Impl : ( 'choice' ) ; - public final void rule__LocalChoice__Group__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8434:1: ( ( 'choice' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8435:1: ( 'choice' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8435:1: ( 'choice' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8436:1: 'choice' - { - before(grammarAccess.getLocalChoiceAccess().getChoiceKeyword_0()); - match(input,32,FOLLOW_32_in_rule__LocalChoice__Group__0__Impl16838); - after(grammarAccess.getLocalChoiceAccess().getChoiceKeyword_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalChoice__Group__0__Impl" - - - // $ANTLR start "rule__LocalChoice__Group__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8449:1: rule__LocalChoice__Group__1 : rule__LocalChoice__Group__1__Impl rule__LocalChoice__Group__2 ; - public final void rule__LocalChoice__Group__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8453:1: ( rule__LocalChoice__Group__1__Impl rule__LocalChoice__Group__2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8454:2: rule__LocalChoice__Group__1__Impl rule__LocalChoice__Group__2 - { - pushFollow(FOLLOW_rule__LocalChoice__Group__1__Impl_in_rule__LocalChoice__Group__116869); - rule__LocalChoice__Group__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalChoice__Group__2_in_rule__LocalChoice__Group__116872); - rule__LocalChoice__Group__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalChoice__Group__1" - - - // $ANTLR start "rule__LocalChoice__Group__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8461:1: rule__LocalChoice__Group__1__Impl : ( 'at' ) ; - public final void rule__LocalChoice__Group__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8465:1: ( ( 'at' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8466:1: ( 'at' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8466:1: ( 'at' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8467:1: 'at' - { - before(grammarAccess.getLocalChoiceAccess().getAtKeyword_1()); - match(input,33,FOLLOW_33_in_rule__LocalChoice__Group__1__Impl16900); - after(grammarAccess.getLocalChoiceAccess().getAtKeyword_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalChoice__Group__1__Impl" - - - // $ANTLR start "rule__LocalChoice__Group__2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8480:1: rule__LocalChoice__Group__2 : rule__LocalChoice__Group__2__Impl rule__LocalChoice__Group__3 ; - public final void rule__LocalChoice__Group__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8484:1: ( rule__LocalChoice__Group__2__Impl rule__LocalChoice__Group__3 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8485:2: rule__LocalChoice__Group__2__Impl rule__LocalChoice__Group__3 - { - pushFollow(FOLLOW_rule__LocalChoice__Group__2__Impl_in_rule__LocalChoice__Group__216931); - rule__LocalChoice__Group__2__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalChoice__Group__3_in_rule__LocalChoice__Group__216934); - rule__LocalChoice__Group__3(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalChoice__Group__2" - - - // $ANTLR start "rule__LocalChoice__Group__2__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8492:1: rule__LocalChoice__Group__2__Impl : ( ( rule__LocalChoice__RoleAssignment_2 ) ) ; - public final void rule__LocalChoice__Group__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8496:1: ( ( ( rule__LocalChoice__RoleAssignment_2 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8497:1: ( ( rule__LocalChoice__RoleAssignment_2 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8497:1: ( ( rule__LocalChoice__RoleAssignment_2 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8498:1: ( rule__LocalChoice__RoleAssignment_2 ) - { - before(grammarAccess.getLocalChoiceAccess().getRoleAssignment_2()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8499:1: ( rule__LocalChoice__RoleAssignment_2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8499:2: rule__LocalChoice__RoleAssignment_2 - { - pushFollow(FOLLOW_rule__LocalChoice__RoleAssignment_2_in_rule__LocalChoice__Group__2__Impl16961); - rule__LocalChoice__RoleAssignment_2(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalChoiceAccess().getRoleAssignment_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalChoice__Group__2__Impl" - - - // $ANTLR start "rule__LocalChoice__Group__3" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8509:1: rule__LocalChoice__Group__3 : rule__LocalChoice__Group__3__Impl rule__LocalChoice__Group__4 ; - public final void rule__LocalChoice__Group__3() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8513:1: ( rule__LocalChoice__Group__3__Impl rule__LocalChoice__Group__4 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8514:2: rule__LocalChoice__Group__3__Impl rule__LocalChoice__Group__4 - { - pushFollow(FOLLOW_rule__LocalChoice__Group__3__Impl_in_rule__LocalChoice__Group__316991); - rule__LocalChoice__Group__3__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalChoice__Group__4_in_rule__LocalChoice__Group__316994); - rule__LocalChoice__Group__4(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalChoice__Group__3" - - - // $ANTLR start "rule__LocalChoice__Group__3__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8521:1: rule__LocalChoice__Group__3__Impl : ( ( rule__LocalChoice__BlocksAssignment_3 ) ) ; - public final void rule__LocalChoice__Group__3__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8525:1: ( ( ( rule__LocalChoice__BlocksAssignment_3 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8526:1: ( ( rule__LocalChoice__BlocksAssignment_3 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8526:1: ( ( rule__LocalChoice__BlocksAssignment_3 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8527:1: ( rule__LocalChoice__BlocksAssignment_3 ) - { - before(grammarAccess.getLocalChoiceAccess().getBlocksAssignment_3()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8528:1: ( rule__LocalChoice__BlocksAssignment_3 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8528:2: rule__LocalChoice__BlocksAssignment_3 - { - pushFollow(FOLLOW_rule__LocalChoice__BlocksAssignment_3_in_rule__LocalChoice__Group__3__Impl17021); - rule__LocalChoice__BlocksAssignment_3(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalChoiceAccess().getBlocksAssignment_3()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalChoice__Group__3__Impl" - - - // $ANTLR start "rule__LocalChoice__Group__4" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8538:1: rule__LocalChoice__Group__4 : rule__LocalChoice__Group__4__Impl ; - public final void rule__LocalChoice__Group__4() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8542:1: ( rule__LocalChoice__Group__4__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8543:2: rule__LocalChoice__Group__4__Impl - { - pushFollow(FOLLOW_rule__LocalChoice__Group__4__Impl_in_rule__LocalChoice__Group__417051); - rule__LocalChoice__Group__4__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalChoice__Group__4" - - - // $ANTLR start "rule__LocalChoice__Group__4__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8549:1: rule__LocalChoice__Group__4__Impl : ( ( rule__LocalChoice__Group_4__0 )* ) ; - public final void rule__LocalChoice__Group__4__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8553:1: ( ( ( rule__LocalChoice__Group_4__0 )* ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8554:1: ( ( rule__LocalChoice__Group_4__0 )* ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8554:1: ( ( rule__LocalChoice__Group_4__0 )* ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8555:1: ( rule__LocalChoice__Group_4__0 )* - { - before(grammarAccess.getLocalChoiceAccess().getGroup_4()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8556:1: ( rule__LocalChoice__Group_4__0 )* - loop51: - do { - int alt51=2; - int LA51_0 = input.LA(1); - - if ( (LA51_0==34) ) { - alt51=1; - } - - - switch (alt51) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8556:2: rule__LocalChoice__Group_4__0 - { - pushFollow(FOLLOW_rule__LocalChoice__Group_4__0_in_rule__LocalChoice__Group__4__Impl17078); - rule__LocalChoice__Group_4__0(); - - state._fsp--; - - - } - break; - - default : - break loop51; - } - } while (true); - - after(grammarAccess.getLocalChoiceAccess().getGroup_4()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalChoice__Group__4__Impl" - - - // $ANTLR start "rule__LocalChoice__Group_4__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8576:1: rule__LocalChoice__Group_4__0 : rule__LocalChoice__Group_4__0__Impl rule__LocalChoice__Group_4__1 ; - public final void rule__LocalChoice__Group_4__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8580:1: ( rule__LocalChoice__Group_4__0__Impl rule__LocalChoice__Group_4__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8581:2: rule__LocalChoice__Group_4__0__Impl rule__LocalChoice__Group_4__1 - { - pushFollow(FOLLOW_rule__LocalChoice__Group_4__0__Impl_in_rule__LocalChoice__Group_4__017119); - rule__LocalChoice__Group_4__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalChoice__Group_4__1_in_rule__LocalChoice__Group_4__017122); - rule__LocalChoice__Group_4__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalChoice__Group_4__0" - - - // $ANTLR start "rule__LocalChoice__Group_4__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8588:1: rule__LocalChoice__Group_4__0__Impl : ( 'or' ) ; - public final void rule__LocalChoice__Group_4__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8592:1: ( ( 'or' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8593:1: ( 'or' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8593:1: ( 'or' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8594:1: 'or' - { - before(grammarAccess.getLocalChoiceAccess().getOrKeyword_4_0()); - match(input,34,FOLLOW_34_in_rule__LocalChoice__Group_4__0__Impl17150); - after(grammarAccess.getLocalChoiceAccess().getOrKeyword_4_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalChoice__Group_4__0__Impl" - - - // $ANTLR start "rule__LocalChoice__Group_4__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8607:1: rule__LocalChoice__Group_4__1 : rule__LocalChoice__Group_4__1__Impl ; - public final void rule__LocalChoice__Group_4__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8611:1: ( rule__LocalChoice__Group_4__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8612:2: rule__LocalChoice__Group_4__1__Impl - { - pushFollow(FOLLOW_rule__LocalChoice__Group_4__1__Impl_in_rule__LocalChoice__Group_4__117181); - rule__LocalChoice__Group_4__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalChoice__Group_4__1" - - - // $ANTLR start "rule__LocalChoice__Group_4__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8618:1: rule__LocalChoice__Group_4__1__Impl : ( ( rule__LocalChoice__BlocksAssignment_4_1 ) ) ; - public final void rule__LocalChoice__Group_4__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8622:1: ( ( ( rule__LocalChoice__BlocksAssignment_4_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8623:1: ( ( rule__LocalChoice__BlocksAssignment_4_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8623:1: ( ( rule__LocalChoice__BlocksAssignment_4_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8624:1: ( rule__LocalChoice__BlocksAssignment_4_1 ) - { - before(grammarAccess.getLocalChoiceAccess().getBlocksAssignment_4_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8625:1: ( rule__LocalChoice__BlocksAssignment_4_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8625:2: rule__LocalChoice__BlocksAssignment_4_1 - { - pushFollow(FOLLOW_rule__LocalChoice__BlocksAssignment_4_1_in_rule__LocalChoice__Group_4__1__Impl17208); - rule__LocalChoice__BlocksAssignment_4_1(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalChoiceAccess().getBlocksAssignment_4_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalChoice__Group_4__1__Impl" - - - // $ANTLR start "rule__LocalRecursion__Group__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8639:1: rule__LocalRecursion__Group__0 : rule__LocalRecursion__Group__0__Impl rule__LocalRecursion__Group__1 ; - public final void rule__LocalRecursion__Group__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8643:1: ( rule__LocalRecursion__Group__0__Impl rule__LocalRecursion__Group__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8644:2: rule__LocalRecursion__Group__0__Impl rule__LocalRecursion__Group__1 - { - pushFollow(FOLLOW_rule__LocalRecursion__Group__0__Impl_in_rule__LocalRecursion__Group__017242); - rule__LocalRecursion__Group__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalRecursion__Group__1_in_rule__LocalRecursion__Group__017245); - rule__LocalRecursion__Group__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalRecursion__Group__0" - - - // $ANTLR start "rule__LocalRecursion__Group__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8651:1: rule__LocalRecursion__Group__0__Impl : ( 'rec' ) ; - public final void rule__LocalRecursion__Group__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8655:1: ( ( 'rec' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8656:1: ( 'rec' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8656:1: ( 'rec' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8657:1: 'rec' - { - before(grammarAccess.getLocalRecursionAccess().getRecKeyword_0()); - match(input,35,FOLLOW_35_in_rule__LocalRecursion__Group__0__Impl17273); - after(grammarAccess.getLocalRecursionAccess().getRecKeyword_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalRecursion__Group__0__Impl" - - - // $ANTLR start "rule__LocalRecursion__Group__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8670:1: rule__LocalRecursion__Group__1 : rule__LocalRecursion__Group__1__Impl rule__LocalRecursion__Group__2 ; - public final void rule__LocalRecursion__Group__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8674:1: ( rule__LocalRecursion__Group__1__Impl rule__LocalRecursion__Group__2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8675:2: rule__LocalRecursion__Group__1__Impl rule__LocalRecursion__Group__2 - { - pushFollow(FOLLOW_rule__LocalRecursion__Group__1__Impl_in_rule__LocalRecursion__Group__117304); - rule__LocalRecursion__Group__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalRecursion__Group__2_in_rule__LocalRecursion__Group__117307); - rule__LocalRecursion__Group__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalRecursion__Group__1" - - - // $ANTLR start "rule__LocalRecursion__Group__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8682:1: rule__LocalRecursion__Group__1__Impl : ( ( rule__LocalRecursion__LabelAssignment_1 ) ) ; - public final void rule__LocalRecursion__Group__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8686:1: ( ( ( rule__LocalRecursion__LabelAssignment_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8687:1: ( ( rule__LocalRecursion__LabelAssignment_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8687:1: ( ( rule__LocalRecursion__LabelAssignment_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8688:1: ( rule__LocalRecursion__LabelAssignment_1 ) - { - before(grammarAccess.getLocalRecursionAccess().getLabelAssignment_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8689:1: ( rule__LocalRecursion__LabelAssignment_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8689:2: rule__LocalRecursion__LabelAssignment_1 - { - pushFollow(FOLLOW_rule__LocalRecursion__LabelAssignment_1_in_rule__LocalRecursion__Group__1__Impl17334); - rule__LocalRecursion__LabelAssignment_1(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalRecursionAccess().getLabelAssignment_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalRecursion__Group__1__Impl" - - - // $ANTLR start "rule__LocalRecursion__Group__2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8699:1: rule__LocalRecursion__Group__2 : rule__LocalRecursion__Group__2__Impl ; - public final void rule__LocalRecursion__Group__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8703:1: ( rule__LocalRecursion__Group__2__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8704:2: rule__LocalRecursion__Group__2__Impl - { - pushFollow(FOLLOW_rule__LocalRecursion__Group__2__Impl_in_rule__LocalRecursion__Group__217364); - rule__LocalRecursion__Group__2__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalRecursion__Group__2" - - - // $ANTLR start "rule__LocalRecursion__Group__2__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8710:1: rule__LocalRecursion__Group__2__Impl : ( ( rule__LocalRecursion__BlockAssignment_2 ) ) ; - public final void rule__LocalRecursion__Group__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8714:1: ( ( ( rule__LocalRecursion__BlockAssignment_2 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8715:1: ( ( rule__LocalRecursion__BlockAssignment_2 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8715:1: ( ( rule__LocalRecursion__BlockAssignment_2 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8716:1: ( rule__LocalRecursion__BlockAssignment_2 ) - { - before(grammarAccess.getLocalRecursionAccess().getBlockAssignment_2()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8717:1: ( rule__LocalRecursion__BlockAssignment_2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8717:2: rule__LocalRecursion__BlockAssignment_2 - { - pushFollow(FOLLOW_rule__LocalRecursion__BlockAssignment_2_in_rule__LocalRecursion__Group__2__Impl17391); - rule__LocalRecursion__BlockAssignment_2(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalRecursionAccess().getBlockAssignment_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalRecursion__Group__2__Impl" - - - // $ANTLR start "rule__LocalContinue__Group__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8733:1: rule__LocalContinue__Group__0 : rule__LocalContinue__Group__0__Impl rule__LocalContinue__Group__1 ; - public final void rule__LocalContinue__Group__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8737:1: ( rule__LocalContinue__Group__0__Impl rule__LocalContinue__Group__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8738:2: rule__LocalContinue__Group__0__Impl rule__LocalContinue__Group__1 - { - pushFollow(FOLLOW_rule__LocalContinue__Group__0__Impl_in_rule__LocalContinue__Group__017427); - rule__LocalContinue__Group__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalContinue__Group__1_in_rule__LocalContinue__Group__017430); - rule__LocalContinue__Group__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalContinue__Group__0" - - - // $ANTLR start "rule__LocalContinue__Group__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8745:1: rule__LocalContinue__Group__0__Impl : ( 'continue' ) ; - public final void rule__LocalContinue__Group__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8749:1: ( ( 'continue' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8750:1: ( 'continue' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8750:1: ( 'continue' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8751:1: 'continue' - { - before(grammarAccess.getLocalContinueAccess().getContinueKeyword_0()); - match(input,36,FOLLOW_36_in_rule__LocalContinue__Group__0__Impl17458); - after(grammarAccess.getLocalContinueAccess().getContinueKeyword_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalContinue__Group__0__Impl" - - - // $ANTLR start "rule__LocalContinue__Group__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8764:1: rule__LocalContinue__Group__1 : rule__LocalContinue__Group__1__Impl rule__LocalContinue__Group__2 ; - public final void rule__LocalContinue__Group__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8768:1: ( rule__LocalContinue__Group__1__Impl rule__LocalContinue__Group__2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8769:2: rule__LocalContinue__Group__1__Impl rule__LocalContinue__Group__2 - { - pushFollow(FOLLOW_rule__LocalContinue__Group__1__Impl_in_rule__LocalContinue__Group__117489); - rule__LocalContinue__Group__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalContinue__Group__2_in_rule__LocalContinue__Group__117492); - rule__LocalContinue__Group__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalContinue__Group__1" - - - // $ANTLR start "rule__LocalContinue__Group__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8776:1: rule__LocalContinue__Group__1__Impl : ( ( rule__LocalContinue__LabelAssignment_1 ) ) ; - public final void rule__LocalContinue__Group__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8780:1: ( ( ( rule__LocalContinue__LabelAssignment_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8781:1: ( ( rule__LocalContinue__LabelAssignment_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8781:1: ( ( rule__LocalContinue__LabelAssignment_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8782:1: ( rule__LocalContinue__LabelAssignment_1 ) - { - before(grammarAccess.getLocalContinueAccess().getLabelAssignment_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8783:1: ( rule__LocalContinue__LabelAssignment_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8783:2: rule__LocalContinue__LabelAssignment_1 - { - pushFollow(FOLLOW_rule__LocalContinue__LabelAssignment_1_in_rule__LocalContinue__Group__1__Impl17519); - rule__LocalContinue__LabelAssignment_1(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalContinueAccess().getLabelAssignment_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalContinue__Group__1__Impl" - - - // $ANTLR start "rule__LocalContinue__Group__2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8793:1: rule__LocalContinue__Group__2 : rule__LocalContinue__Group__2__Impl ; - public final void rule__LocalContinue__Group__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8797:1: ( rule__LocalContinue__Group__2__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8798:2: rule__LocalContinue__Group__2__Impl - { - pushFollow(FOLLOW_rule__LocalContinue__Group__2__Impl_in_rule__LocalContinue__Group__217549); - rule__LocalContinue__Group__2__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalContinue__Group__2" - - - // $ANTLR start "rule__LocalContinue__Group__2__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8804:1: rule__LocalContinue__Group__2__Impl : ( ';' ) ; - public final void rule__LocalContinue__Group__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8808:1: ( ( ';' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8809:1: ( ';' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8809:1: ( ';' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8810:1: ';' - { - before(grammarAccess.getLocalContinueAccess().getSemicolonKeyword_2()); - match(input,12,FOLLOW_12_in_rule__LocalContinue__Group__2__Impl17577); - after(grammarAccess.getLocalContinueAccess().getSemicolonKeyword_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalContinue__Group__2__Impl" - - - // $ANTLR start "rule__LocalParallel__Group__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8829:1: rule__LocalParallel__Group__0 : rule__LocalParallel__Group__0__Impl rule__LocalParallel__Group__1 ; - public final void rule__LocalParallel__Group__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8833:1: ( rule__LocalParallel__Group__0__Impl rule__LocalParallel__Group__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8834:2: rule__LocalParallel__Group__0__Impl rule__LocalParallel__Group__1 - { - pushFollow(FOLLOW_rule__LocalParallel__Group__0__Impl_in_rule__LocalParallel__Group__017614); - rule__LocalParallel__Group__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalParallel__Group__1_in_rule__LocalParallel__Group__017617); - rule__LocalParallel__Group__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalParallel__Group__0" - - - // $ANTLR start "rule__LocalParallel__Group__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8841:1: rule__LocalParallel__Group__0__Impl : ( 'par' ) ; - public final void rule__LocalParallel__Group__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8845:1: ( ( 'par' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8846:1: ( 'par' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8846:1: ( 'par' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8847:1: 'par' - { - before(grammarAccess.getLocalParallelAccess().getParKeyword_0()); - match(input,37,FOLLOW_37_in_rule__LocalParallel__Group__0__Impl17645); - after(grammarAccess.getLocalParallelAccess().getParKeyword_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalParallel__Group__0__Impl" - - - // $ANTLR start "rule__LocalParallel__Group__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8860:1: rule__LocalParallel__Group__1 : rule__LocalParallel__Group__1__Impl rule__LocalParallel__Group__2 ; - public final void rule__LocalParallel__Group__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8864:1: ( rule__LocalParallel__Group__1__Impl rule__LocalParallel__Group__2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8865:2: rule__LocalParallel__Group__1__Impl rule__LocalParallel__Group__2 - { - pushFollow(FOLLOW_rule__LocalParallel__Group__1__Impl_in_rule__LocalParallel__Group__117676); - rule__LocalParallel__Group__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalParallel__Group__2_in_rule__LocalParallel__Group__117679); - rule__LocalParallel__Group__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalParallel__Group__1" - - - // $ANTLR start "rule__LocalParallel__Group__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8872:1: rule__LocalParallel__Group__1__Impl : ( ( rule__LocalParallel__BlocksAssignment_1 ) ) ; - public final void rule__LocalParallel__Group__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8876:1: ( ( ( rule__LocalParallel__BlocksAssignment_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8877:1: ( ( rule__LocalParallel__BlocksAssignment_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8877:1: ( ( rule__LocalParallel__BlocksAssignment_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8878:1: ( rule__LocalParallel__BlocksAssignment_1 ) - { - before(grammarAccess.getLocalParallelAccess().getBlocksAssignment_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8879:1: ( rule__LocalParallel__BlocksAssignment_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8879:2: rule__LocalParallel__BlocksAssignment_1 - { - pushFollow(FOLLOW_rule__LocalParallel__BlocksAssignment_1_in_rule__LocalParallel__Group__1__Impl17706); - rule__LocalParallel__BlocksAssignment_1(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalParallelAccess().getBlocksAssignment_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalParallel__Group__1__Impl" - - - // $ANTLR start "rule__LocalParallel__Group__2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8889:1: rule__LocalParallel__Group__2 : rule__LocalParallel__Group__2__Impl ; - public final void rule__LocalParallel__Group__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8893:1: ( rule__LocalParallel__Group__2__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8894:2: rule__LocalParallel__Group__2__Impl - { - pushFollow(FOLLOW_rule__LocalParallel__Group__2__Impl_in_rule__LocalParallel__Group__217736); - rule__LocalParallel__Group__2__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalParallel__Group__2" - - - // $ANTLR start "rule__LocalParallel__Group__2__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8900:1: rule__LocalParallel__Group__2__Impl : ( ( rule__LocalParallel__Group_2__0 )* ) ; - public final void rule__LocalParallel__Group__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8904:1: ( ( ( rule__LocalParallel__Group_2__0 )* ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8905:1: ( ( rule__LocalParallel__Group_2__0 )* ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8905:1: ( ( rule__LocalParallel__Group_2__0 )* ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8906:1: ( rule__LocalParallel__Group_2__0 )* - { - before(grammarAccess.getLocalParallelAccess().getGroup_2()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8907:1: ( rule__LocalParallel__Group_2__0 )* - loop52: - do { - int alt52=2; - int LA52_0 = input.LA(1); - - if ( (LA52_0==38) ) { - alt52=1; - } - - - switch (alt52) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8907:2: rule__LocalParallel__Group_2__0 - { - pushFollow(FOLLOW_rule__LocalParallel__Group_2__0_in_rule__LocalParallel__Group__2__Impl17763); - rule__LocalParallel__Group_2__0(); - - state._fsp--; - - - } - break; - - default : - break loop52; - } - } while (true); - - after(grammarAccess.getLocalParallelAccess().getGroup_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalParallel__Group__2__Impl" - - - // $ANTLR start "rule__LocalParallel__Group_2__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8923:1: rule__LocalParallel__Group_2__0 : rule__LocalParallel__Group_2__0__Impl rule__LocalParallel__Group_2__1 ; - public final void rule__LocalParallel__Group_2__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8927:1: ( rule__LocalParallel__Group_2__0__Impl rule__LocalParallel__Group_2__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8928:2: rule__LocalParallel__Group_2__0__Impl rule__LocalParallel__Group_2__1 - { - pushFollow(FOLLOW_rule__LocalParallel__Group_2__0__Impl_in_rule__LocalParallel__Group_2__017800); - rule__LocalParallel__Group_2__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalParallel__Group_2__1_in_rule__LocalParallel__Group_2__017803); - rule__LocalParallel__Group_2__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalParallel__Group_2__0" - - - // $ANTLR start "rule__LocalParallel__Group_2__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8935:1: rule__LocalParallel__Group_2__0__Impl : ( 'and' ) ; - public final void rule__LocalParallel__Group_2__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8939:1: ( ( 'and' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8940:1: ( 'and' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8940:1: ( 'and' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8941:1: 'and' - { - before(grammarAccess.getLocalParallelAccess().getAndKeyword_2_0()); - match(input,38,FOLLOW_38_in_rule__LocalParallel__Group_2__0__Impl17831); - after(grammarAccess.getLocalParallelAccess().getAndKeyword_2_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalParallel__Group_2__0__Impl" - - - // $ANTLR start "rule__LocalParallel__Group_2__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8954:1: rule__LocalParallel__Group_2__1 : rule__LocalParallel__Group_2__1__Impl ; - public final void rule__LocalParallel__Group_2__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8958:1: ( rule__LocalParallel__Group_2__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8959:2: rule__LocalParallel__Group_2__1__Impl - { - pushFollow(FOLLOW_rule__LocalParallel__Group_2__1__Impl_in_rule__LocalParallel__Group_2__117862); - rule__LocalParallel__Group_2__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalParallel__Group_2__1" - - - // $ANTLR start "rule__LocalParallel__Group_2__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8965:1: rule__LocalParallel__Group_2__1__Impl : ( ( rule__LocalParallel__BlocksAssignment_2_1 ) ) ; - public final void rule__LocalParallel__Group_2__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8969:1: ( ( ( rule__LocalParallel__BlocksAssignment_2_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8970:1: ( ( rule__LocalParallel__BlocksAssignment_2_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8970:1: ( ( rule__LocalParallel__BlocksAssignment_2_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8971:1: ( rule__LocalParallel__BlocksAssignment_2_1 ) - { - before(grammarAccess.getLocalParallelAccess().getBlocksAssignment_2_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8972:1: ( rule__LocalParallel__BlocksAssignment_2_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8972:2: rule__LocalParallel__BlocksAssignment_2_1 - { - pushFollow(FOLLOW_rule__LocalParallel__BlocksAssignment_2_1_in_rule__LocalParallel__Group_2__1__Impl17889); - rule__LocalParallel__BlocksAssignment_2_1(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalParallelAccess().getBlocksAssignment_2_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalParallel__Group_2__1__Impl" - - - // $ANTLR start "rule__LocalInterruptible__Group__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8986:1: rule__LocalInterruptible__Group__0 : rule__LocalInterruptible__Group__0__Impl rule__LocalInterruptible__Group__1 ; - public final void rule__LocalInterruptible__Group__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8990:1: ( rule__LocalInterruptible__Group__0__Impl rule__LocalInterruptible__Group__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8991:2: rule__LocalInterruptible__Group__0__Impl rule__LocalInterruptible__Group__1 - { - pushFollow(FOLLOW_rule__LocalInterruptible__Group__0__Impl_in_rule__LocalInterruptible__Group__017923); - rule__LocalInterruptible__Group__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalInterruptible__Group__1_in_rule__LocalInterruptible__Group__017926); - rule__LocalInterruptible__Group__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalInterruptible__Group__0" - - - // $ANTLR start "rule__LocalInterruptible__Group__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:8998:1: rule__LocalInterruptible__Group__0__Impl : ( 'interruptible' ) ; - public final void rule__LocalInterruptible__Group__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9002:1: ( ( 'interruptible' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9003:1: ( 'interruptible' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9003:1: ( 'interruptible' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9004:1: 'interruptible' - { - before(grammarAccess.getLocalInterruptibleAccess().getInterruptibleKeyword_0()); - match(input,39,FOLLOW_39_in_rule__LocalInterruptible__Group__0__Impl17954); - after(grammarAccess.getLocalInterruptibleAccess().getInterruptibleKeyword_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalInterruptible__Group__0__Impl" - - - // $ANTLR start "rule__LocalInterruptible__Group__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9017:1: rule__LocalInterruptible__Group__1 : rule__LocalInterruptible__Group__1__Impl rule__LocalInterruptible__Group__2 ; - public final void rule__LocalInterruptible__Group__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9021:1: ( rule__LocalInterruptible__Group__1__Impl rule__LocalInterruptible__Group__2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9022:2: rule__LocalInterruptible__Group__1__Impl rule__LocalInterruptible__Group__2 - { - pushFollow(FOLLOW_rule__LocalInterruptible__Group__1__Impl_in_rule__LocalInterruptible__Group__117985); - rule__LocalInterruptible__Group__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalInterruptible__Group__2_in_rule__LocalInterruptible__Group__117988); - rule__LocalInterruptible__Group__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalInterruptible__Group__1" - - - // $ANTLR start "rule__LocalInterruptible__Group__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9029:1: rule__LocalInterruptible__Group__1__Impl : ( ( rule__LocalInterruptible__Group_1__0 )? ) ; - public final void rule__LocalInterruptible__Group__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9033:1: ( ( ( rule__LocalInterruptible__Group_1__0 )? ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9034:1: ( ( rule__LocalInterruptible__Group_1__0 )? ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9034:1: ( ( rule__LocalInterruptible__Group_1__0 )? ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9035:1: ( rule__LocalInterruptible__Group_1__0 )? - { - before(grammarAccess.getLocalInterruptibleAccess().getGroup_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9036:1: ( rule__LocalInterruptible__Group_1__0 )? - int alt53=2; - int LA53_0 = input.LA(1); - - if ( (LA53_0==RULE_ID) ) { - alt53=1; - } - switch (alt53) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9036:2: rule__LocalInterruptible__Group_1__0 - { - pushFollow(FOLLOW_rule__LocalInterruptible__Group_1__0_in_rule__LocalInterruptible__Group__1__Impl18015); - rule__LocalInterruptible__Group_1__0(); - - state._fsp--; - - - } - break; - - } - - after(grammarAccess.getLocalInterruptibleAccess().getGroup_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalInterruptible__Group__1__Impl" - - - // $ANTLR start "rule__LocalInterruptible__Group__2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9046:1: rule__LocalInterruptible__Group__2 : rule__LocalInterruptible__Group__2__Impl rule__LocalInterruptible__Group__3 ; - public final void rule__LocalInterruptible__Group__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9050:1: ( rule__LocalInterruptible__Group__2__Impl rule__LocalInterruptible__Group__3 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9051:2: rule__LocalInterruptible__Group__2__Impl rule__LocalInterruptible__Group__3 - { - pushFollow(FOLLOW_rule__LocalInterruptible__Group__2__Impl_in_rule__LocalInterruptible__Group__218046); - rule__LocalInterruptible__Group__2__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalInterruptible__Group__3_in_rule__LocalInterruptible__Group__218049); - rule__LocalInterruptible__Group__3(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalInterruptible__Group__2" - - - // $ANTLR start "rule__LocalInterruptible__Group__2__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9058:1: rule__LocalInterruptible__Group__2__Impl : ( ( rule__LocalInterruptible__BlockAssignment_2 ) ) ; - public final void rule__LocalInterruptible__Group__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9062:1: ( ( ( rule__LocalInterruptible__BlockAssignment_2 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9063:1: ( ( rule__LocalInterruptible__BlockAssignment_2 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9063:1: ( ( rule__LocalInterruptible__BlockAssignment_2 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9064:1: ( rule__LocalInterruptible__BlockAssignment_2 ) - { - before(grammarAccess.getLocalInterruptibleAccess().getBlockAssignment_2()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9065:1: ( rule__LocalInterruptible__BlockAssignment_2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9065:2: rule__LocalInterruptible__BlockAssignment_2 - { - pushFollow(FOLLOW_rule__LocalInterruptible__BlockAssignment_2_in_rule__LocalInterruptible__Group__2__Impl18076); - rule__LocalInterruptible__BlockAssignment_2(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalInterruptibleAccess().getBlockAssignment_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalInterruptible__Group__2__Impl" - - - // $ANTLR start "rule__LocalInterruptible__Group__3" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9075:1: rule__LocalInterruptible__Group__3 : rule__LocalInterruptible__Group__3__Impl rule__LocalInterruptible__Group__4 ; - public final void rule__LocalInterruptible__Group__3() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9079:1: ( rule__LocalInterruptible__Group__3__Impl rule__LocalInterruptible__Group__4 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9080:2: rule__LocalInterruptible__Group__3__Impl rule__LocalInterruptible__Group__4 - { - pushFollow(FOLLOW_rule__LocalInterruptible__Group__3__Impl_in_rule__LocalInterruptible__Group__318106); - rule__LocalInterruptible__Group__3__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalInterruptible__Group__4_in_rule__LocalInterruptible__Group__318109); - rule__LocalInterruptible__Group__4(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalInterruptible__Group__3" - - - // $ANTLR start "rule__LocalInterruptible__Group__3__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9087:1: rule__LocalInterruptible__Group__3__Impl : ( 'with' ) ; - public final void rule__LocalInterruptible__Group__3__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9091:1: ( ( 'with' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9092:1: ( 'with' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9092:1: ( 'with' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9093:1: 'with' - { - before(grammarAccess.getLocalInterruptibleAccess().getWithKeyword_3()); - match(input,40,FOLLOW_40_in_rule__LocalInterruptible__Group__3__Impl18137); - after(grammarAccess.getLocalInterruptibleAccess().getWithKeyword_3()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalInterruptible__Group__3__Impl" - - - // $ANTLR start "rule__LocalInterruptible__Group__4" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9106:1: rule__LocalInterruptible__Group__4 : rule__LocalInterruptible__Group__4__Impl rule__LocalInterruptible__Group__5 ; - public final void rule__LocalInterruptible__Group__4() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9110:1: ( rule__LocalInterruptible__Group__4__Impl rule__LocalInterruptible__Group__5 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9111:2: rule__LocalInterruptible__Group__4__Impl rule__LocalInterruptible__Group__5 - { - pushFollow(FOLLOW_rule__LocalInterruptible__Group__4__Impl_in_rule__LocalInterruptible__Group__418168); - rule__LocalInterruptible__Group__4__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalInterruptible__Group__5_in_rule__LocalInterruptible__Group__418171); - rule__LocalInterruptible__Group__5(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalInterruptible__Group__4" - - - // $ANTLR start "rule__LocalInterruptible__Group__4__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9118:1: rule__LocalInterruptible__Group__4__Impl : ( '{' ) ; - public final void rule__LocalInterruptible__Group__4__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9122:1: ( ( '{' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9123:1: ( '{' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9123:1: ( '{' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9124:1: '{' - { - before(grammarAccess.getLocalInterruptibleAccess().getLeftCurlyBracketKeyword_4()); - match(input,29,FOLLOW_29_in_rule__LocalInterruptible__Group__4__Impl18199); - after(grammarAccess.getLocalInterruptibleAccess().getLeftCurlyBracketKeyword_4()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalInterruptible__Group__4__Impl" - - - // $ANTLR start "rule__LocalInterruptible__Group__5" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9137:1: rule__LocalInterruptible__Group__5 : rule__LocalInterruptible__Group__5__Impl rule__LocalInterruptible__Group__6 ; - public final void rule__LocalInterruptible__Group__5() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9141:1: ( rule__LocalInterruptible__Group__5__Impl rule__LocalInterruptible__Group__6 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9142:2: rule__LocalInterruptible__Group__5__Impl rule__LocalInterruptible__Group__6 - { - pushFollow(FOLLOW_rule__LocalInterruptible__Group__5__Impl_in_rule__LocalInterruptible__Group__518230); - rule__LocalInterruptible__Group__5__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalInterruptible__Group__6_in_rule__LocalInterruptible__Group__518233); - rule__LocalInterruptible__Group__6(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalInterruptible__Group__5" - - - // $ANTLR start "rule__LocalInterruptible__Group__5__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9149:1: rule__LocalInterruptible__Group__5__Impl : ( ( rule__LocalInterruptible__ThrowAssignment_5 )? ) ; - public final void rule__LocalInterruptible__Group__5__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9153:1: ( ( ( rule__LocalInterruptible__ThrowAssignment_5 )? ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9154:1: ( ( rule__LocalInterruptible__ThrowAssignment_5 )? ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9154:1: ( ( rule__LocalInterruptible__ThrowAssignment_5 )? ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9155:1: ( rule__LocalInterruptible__ThrowAssignment_5 )? - { - before(grammarAccess.getLocalInterruptibleAccess().getThrowAssignment_5()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9156:1: ( rule__LocalInterruptible__ThrowAssignment_5 )? - int alt54=2; - int LA54_0 = input.LA(1); - - if ( (LA54_0==44) ) { - alt54=1; - } - switch (alt54) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9156:2: rule__LocalInterruptible__ThrowAssignment_5 - { - pushFollow(FOLLOW_rule__LocalInterruptible__ThrowAssignment_5_in_rule__LocalInterruptible__Group__5__Impl18260); - rule__LocalInterruptible__ThrowAssignment_5(); - - state._fsp--; - - - } - break; - - } - - after(grammarAccess.getLocalInterruptibleAccess().getThrowAssignment_5()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalInterruptible__Group__5__Impl" - - - // $ANTLR start "rule__LocalInterruptible__Group__6" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9166:1: rule__LocalInterruptible__Group__6 : rule__LocalInterruptible__Group__6__Impl rule__LocalInterruptible__Group__7 ; - public final void rule__LocalInterruptible__Group__6() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9170:1: ( rule__LocalInterruptible__Group__6__Impl rule__LocalInterruptible__Group__7 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9171:2: rule__LocalInterruptible__Group__6__Impl rule__LocalInterruptible__Group__7 - { - pushFollow(FOLLOW_rule__LocalInterruptible__Group__6__Impl_in_rule__LocalInterruptible__Group__618291); - rule__LocalInterruptible__Group__6__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalInterruptible__Group__7_in_rule__LocalInterruptible__Group__618294); - rule__LocalInterruptible__Group__7(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalInterruptible__Group__6" - - - // $ANTLR start "rule__LocalInterruptible__Group__6__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9178:1: rule__LocalInterruptible__Group__6__Impl : ( ( rule__LocalInterruptible__CatchesAssignment_6 )* ) ; - public final void rule__LocalInterruptible__Group__6__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9182:1: ( ( ( rule__LocalInterruptible__CatchesAssignment_6 )* ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9183:1: ( ( rule__LocalInterruptible__CatchesAssignment_6 )* ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9183:1: ( ( rule__LocalInterruptible__CatchesAssignment_6 )* ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9184:1: ( rule__LocalInterruptible__CatchesAssignment_6 )* - { - before(grammarAccess.getLocalInterruptibleAccess().getCatchesAssignment_6()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9185:1: ( rule__LocalInterruptible__CatchesAssignment_6 )* - loop55: - do { - int alt55=2; - int LA55_0 = input.LA(1); - - if ( (LA55_0==45) ) { - alt55=1; - } - - - switch (alt55) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9185:2: rule__LocalInterruptible__CatchesAssignment_6 - { - pushFollow(FOLLOW_rule__LocalInterruptible__CatchesAssignment_6_in_rule__LocalInterruptible__Group__6__Impl18321); - rule__LocalInterruptible__CatchesAssignment_6(); - - state._fsp--; - - - } - break; - - default : - break loop55; - } - } while (true); - - after(grammarAccess.getLocalInterruptibleAccess().getCatchesAssignment_6()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalInterruptible__Group__6__Impl" - - - // $ANTLR start "rule__LocalInterruptible__Group__7" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9195:1: rule__LocalInterruptible__Group__7 : rule__LocalInterruptible__Group__7__Impl ; - public final void rule__LocalInterruptible__Group__7() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9199:1: ( rule__LocalInterruptible__Group__7__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9200:2: rule__LocalInterruptible__Group__7__Impl - { - pushFollow(FOLLOW_rule__LocalInterruptible__Group__7__Impl_in_rule__LocalInterruptible__Group__718352); - rule__LocalInterruptible__Group__7__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalInterruptible__Group__7" - - - // $ANTLR start "rule__LocalInterruptible__Group__7__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9206:1: rule__LocalInterruptible__Group__7__Impl : ( '}' ) ; - public final void rule__LocalInterruptible__Group__7__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9210:1: ( ( '}' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9211:1: ( '}' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9211:1: ( '}' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9212:1: '}' - { - before(grammarAccess.getLocalInterruptibleAccess().getRightCurlyBracketKeyword_7()); - match(input,30,FOLLOW_30_in_rule__LocalInterruptible__Group__7__Impl18380); - after(grammarAccess.getLocalInterruptibleAccess().getRightCurlyBracketKeyword_7()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalInterruptible__Group__7__Impl" - - - // $ANTLR start "rule__LocalInterruptible__Group_1__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9241:1: rule__LocalInterruptible__Group_1__0 : rule__LocalInterruptible__Group_1__0__Impl rule__LocalInterruptible__Group_1__1 ; - public final void rule__LocalInterruptible__Group_1__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9245:1: ( rule__LocalInterruptible__Group_1__0__Impl rule__LocalInterruptible__Group_1__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9246:2: rule__LocalInterruptible__Group_1__0__Impl rule__LocalInterruptible__Group_1__1 - { - pushFollow(FOLLOW_rule__LocalInterruptible__Group_1__0__Impl_in_rule__LocalInterruptible__Group_1__018427); - rule__LocalInterruptible__Group_1__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalInterruptible__Group_1__1_in_rule__LocalInterruptible__Group_1__018430); - rule__LocalInterruptible__Group_1__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalInterruptible__Group_1__0" - - - // $ANTLR start "rule__LocalInterruptible__Group_1__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9253:1: rule__LocalInterruptible__Group_1__0__Impl : ( ( rule__LocalInterruptible__ScopeAssignment_1_0 ) ) ; - public final void rule__LocalInterruptible__Group_1__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9257:1: ( ( ( rule__LocalInterruptible__ScopeAssignment_1_0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9258:1: ( ( rule__LocalInterruptible__ScopeAssignment_1_0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9258:1: ( ( rule__LocalInterruptible__ScopeAssignment_1_0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9259:1: ( rule__LocalInterruptible__ScopeAssignment_1_0 ) - { - before(grammarAccess.getLocalInterruptibleAccess().getScopeAssignment_1_0()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9260:1: ( rule__LocalInterruptible__ScopeAssignment_1_0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9260:2: rule__LocalInterruptible__ScopeAssignment_1_0 - { - pushFollow(FOLLOW_rule__LocalInterruptible__ScopeAssignment_1_0_in_rule__LocalInterruptible__Group_1__0__Impl18457); - rule__LocalInterruptible__ScopeAssignment_1_0(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalInterruptibleAccess().getScopeAssignment_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalInterruptible__Group_1__0__Impl" - - - // $ANTLR start "rule__LocalInterruptible__Group_1__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9270:1: rule__LocalInterruptible__Group_1__1 : rule__LocalInterruptible__Group_1__1__Impl ; - public final void rule__LocalInterruptible__Group_1__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9274:1: ( rule__LocalInterruptible__Group_1__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9275:2: rule__LocalInterruptible__Group_1__1__Impl - { - pushFollow(FOLLOW_rule__LocalInterruptible__Group_1__1__Impl_in_rule__LocalInterruptible__Group_1__118487); - rule__LocalInterruptible__Group_1__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalInterruptible__Group_1__1" - - - // $ANTLR start "rule__LocalInterruptible__Group_1__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9281:1: rule__LocalInterruptible__Group_1__1__Impl : ( ':' ) ; - public final void rule__LocalInterruptible__Group_1__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9285:1: ( ( ':' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9286:1: ( ':' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9286:1: ( ':' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9287:1: ':' - { - before(grammarAccess.getLocalInterruptibleAccess().getColonKeyword_1_1()); - match(input,23,FOLLOW_23_in_rule__LocalInterruptible__Group_1__1__Impl18515); - after(grammarAccess.getLocalInterruptibleAccess().getColonKeyword_1_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalInterruptible__Group_1__1__Impl" - - - // $ANTLR start "rule__LocalThrow__Group__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9304:1: rule__LocalThrow__Group__0 : rule__LocalThrow__Group__0__Impl rule__LocalThrow__Group__1 ; - public final void rule__LocalThrow__Group__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9308:1: ( rule__LocalThrow__Group__0__Impl rule__LocalThrow__Group__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9309:2: rule__LocalThrow__Group__0__Impl rule__LocalThrow__Group__1 - { - pushFollow(FOLLOW_rule__LocalThrow__Group__0__Impl_in_rule__LocalThrow__Group__018550); - rule__LocalThrow__Group__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalThrow__Group__1_in_rule__LocalThrow__Group__018553); - rule__LocalThrow__Group__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalThrow__Group__0" - - - // $ANTLR start "rule__LocalThrow__Group__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9316:1: rule__LocalThrow__Group__0__Impl : ( 'throw' ) ; - public final void rule__LocalThrow__Group__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9320:1: ( ( 'throw' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9321:1: ( 'throw' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9321:1: ( 'throw' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9322:1: 'throw' - { - before(grammarAccess.getLocalThrowAccess().getThrowKeyword_0()); - match(input,44,FOLLOW_44_in_rule__LocalThrow__Group__0__Impl18581); - after(grammarAccess.getLocalThrowAccess().getThrowKeyword_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalThrow__Group__0__Impl" - - - // $ANTLR start "rule__LocalThrow__Group__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9335:1: rule__LocalThrow__Group__1 : rule__LocalThrow__Group__1__Impl rule__LocalThrow__Group__2 ; - public final void rule__LocalThrow__Group__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9339:1: ( rule__LocalThrow__Group__1__Impl rule__LocalThrow__Group__2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9340:2: rule__LocalThrow__Group__1__Impl rule__LocalThrow__Group__2 - { - pushFollow(FOLLOW_rule__LocalThrow__Group__1__Impl_in_rule__LocalThrow__Group__118612); - rule__LocalThrow__Group__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalThrow__Group__2_in_rule__LocalThrow__Group__118615); - rule__LocalThrow__Group__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalThrow__Group__1" - - - // $ANTLR start "rule__LocalThrow__Group__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9347:1: rule__LocalThrow__Group__1__Impl : ( ( rule__LocalThrow__MessagesAssignment_1 ) ) ; - public final void rule__LocalThrow__Group__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9351:1: ( ( ( rule__LocalThrow__MessagesAssignment_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9352:1: ( ( rule__LocalThrow__MessagesAssignment_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9352:1: ( ( rule__LocalThrow__MessagesAssignment_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9353:1: ( rule__LocalThrow__MessagesAssignment_1 ) - { - before(grammarAccess.getLocalThrowAccess().getMessagesAssignment_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9354:1: ( rule__LocalThrow__MessagesAssignment_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9354:2: rule__LocalThrow__MessagesAssignment_1 - { - pushFollow(FOLLOW_rule__LocalThrow__MessagesAssignment_1_in_rule__LocalThrow__Group__1__Impl18642); - rule__LocalThrow__MessagesAssignment_1(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalThrowAccess().getMessagesAssignment_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalThrow__Group__1__Impl" - - - // $ANTLR start "rule__LocalThrow__Group__2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9364:1: rule__LocalThrow__Group__2 : rule__LocalThrow__Group__2__Impl rule__LocalThrow__Group__3 ; - public final void rule__LocalThrow__Group__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9368:1: ( rule__LocalThrow__Group__2__Impl rule__LocalThrow__Group__3 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9369:2: rule__LocalThrow__Group__2__Impl rule__LocalThrow__Group__3 - { - pushFollow(FOLLOW_rule__LocalThrow__Group__2__Impl_in_rule__LocalThrow__Group__218672); - rule__LocalThrow__Group__2__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalThrow__Group__3_in_rule__LocalThrow__Group__218675); - rule__LocalThrow__Group__3(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalThrow__Group__2" - - - // $ANTLR start "rule__LocalThrow__Group__2__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9376:1: rule__LocalThrow__Group__2__Impl : ( ( rule__LocalThrow__Group_2__0 )* ) ; - public final void rule__LocalThrow__Group__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9380:1: ( ( ( rule__LocalThrow__Group_2__0 )* ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9381:1: ( ( rule__LocalThrow__Group_2__0 )* ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9381:1: ( ( rule__LocalThrow__Group_2__0 )* ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9382:1: ( rule__LocalThrow__Group_2__0 )* - { - before(grammarAccess.getLocalThrowAccess().getGroup_2()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9383:1: ( rule__LocalThrow__Group_2__0 )* - loop56: - do { - int alt56=2; - int LA56_0 = input.LA(1); - - if ( (LA56_0==22) ) { - alt56=1; - } - - - switch (alt56) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9383:2: rule__LocalThrow__Group_2__0 - { - pushFollow(FOLLOW_rule__LocalThrow__Group_2__0_in_rule__LocalThrow__Group__2__Impl18702); - rule__LocalThrow__Group_2__0(); - - state._fsp--; - - - } - break; - - default : - break loop56; - } - } while (true); - - after(grammarAccess.getLocalThrowAccess().getGroup_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalThrow__Group__2__Impl" - - - // $ANTLR start "rule__LocalThrow__Group__3" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9393:1: rule__LocalThrow__Group__3 : rule__LocalThrow__Group__3__Impl rule__LocalThrow__Group__4 ; - public final void rule__LocalThrow__Group__3() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9397:1: ( rule__LocalThrow__Group__3__Impl rule__LocalThrow__Group__4 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9398:2: rule__LocalThrow__Group__3__Impl rule__LocalThrow__Group__4 - { - pushFollow(FOLLOW_rule__LocalThrow__Group__3__Impl_in_rule__LocalThrow__Group__318733); - rule__LocalThrow__Group__3__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalThrow__Group__4_in_rule__LocalThrow__Group__318736); - rule__LocalThrow__Group__4(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalThrow__Group__3" - - - // $ANTLR start "rule__LocalThrow__Group__3__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9405:1: rule__LocalThrow__Group__3__Impl : ( 'to' ) ; - public final void rule__LocalThrow__Group__3__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9409:1: ( ( 'to' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9410:1: ( 'to' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9410:1: ( 'to' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9411:1: 'to' - { - before(grammarAccess.getLocalThrowAccess().getToKeyword_3()); - match(input,31,FOLLOW_31_in_rule__LocalThrow__Group__3__Impl18764); - after(grammarAccess.getLocalThrowAccess().getToKeyword_3()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalThrow__Group__3__Impl" - - - // $ANTLR start "rule__LocalThrow__Group__4" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9424:1: rule__LocalThrow__Group__4 : rule__LocalThrow__Group__4__Impl rule__LocalThrow__Group__5 ; - public final void rule__LocalThrow__Group__4() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9428:1: ( rule__LocalThrow__Group__4__Impl rule__LocalThrow__Group__5 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9429:2: rule__LocalThrow__Group__4__Impl rule__LocalThrow__Group__5 - { - pushFollow(FOLLOW_rule__LocalThrow__Group__4__Impl_in_rule__LocalThrow__Group__418795); - rule__LocalThrow__Group__4__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalThrow__Group__5_in_rule__LocalThrow__Group__418798); - rule__LocalThrow__Group__5(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalThrow__Group__4" - - - // $ANTLR start "rule__LocalThrow__Group__4__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9436:1: rule__LocalThrow__Group__4__Impl : ( ( rule__LocalThrow__ToRolesAssignment_4 ) ) ; - public final void rule__LocalThrow__Group__4__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9440:1: ( ( ( rule__LocalThrow__ToRolesAssignment_4 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9441:1: ( ( rule__LocalThrow__ToRolesAssignment_4 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9441:1: ( ( rule__LocalThrow__ToRolesAssignment_4 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9442:1: ( rule__LocalThrow__ToRolesAssignment_4 ) - { - before(grammarAccess.getLocalThrowAccess().getToRolesAssignment_4()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9443:1: ( rule__LocalThrow__ToRolesAssignment_4 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9443:2: rule__LocalThrow__ToRolesAssignment_4 - { - pushFollow(FOLLOW_rule__LocalThrow__ToRolesAssignment_4_in_rule__LocalThrow__Group__4__Impl18825); - rule__LocalThrow__ToRolesAssignment_4(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalThrowAccess().getToRolesAssignment_4()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalThrow__Group__4__Impl" - - - // $ANTLR start "rule__LocalThrow__Group__5" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9453:1: rule__LocalThrow__Group__5 : rule__LocalThrow__Group__5__Impl rule__LocalThrow__Group__6 ; - public final void rule__LocalThrow__Group__5() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9457:1: ( rule__LocalThrow__Group__5__Impl rule__LocalThrow__Group__6 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9458:2: rule__LocalThrow__Group__5__Impl rule__LocalThrow__Group__6 - { - pushFollow(FOLLOW_rule__LocalThrow__Group__5__Impl_in_rule__LocalThrow__Group__518855); - rule__LocalThrow__Group__5__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalThrow__Group__6_in_rule__LocalThrow__Group__518858); - rule__LocalThrow__Group__6(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalThrow__Group__5" - - - // $ANTLR start "rule__LocalThrow__Group__5__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9465:1: rule__LocalThrow__Group__5__Impl : ( ( rule__LocalThrow__Group_5__0 )* ) ; - public final void rule__LocalThrow__Group__5__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9469:1: ( ( ( rule__LocalThrow__Group_5__0 )* ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9470:1: ( ( rule__LocalThrow__Group_5__0 )* ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9470:1: ( ( rule__LocalThrow__Group_5__0 )* ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9471:1: ( rule__LocalThrow__Group_5__0 )* - { - before(grammarAccess.getLocalThrowAccess().getGroup_5()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9472:1: ( rule__LocalThrow__Group_5__0 )* - loop57: - do { - int alt57=2; - int LA57_0 = input.LA(1); - - if ( (LA57_0==22) ) { - alt57=1; - } - - - switch (alt57) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9472:2: rule__LocalThrow__Group_5__0 - { - pushFollow(FOLLOW_rule__LocalThrow__Group_5__0_in_rule__LocalThrow__Group__5__Impl18885); - rule__LocalThrow__Group_5__0(); - - state._fsp--; - - - } - break; - - default : - break loop57; - } - } while (true); - - after(grammarAccess.getLocalThrowAccess().getGroup_5()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalThrow__Group__5__Impl" - - - // $ANTLR start "rule__LocalThrow__Group__6" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9482:1: rule__LocalThrow__Group__6 : rule__LocalThrow__Group__6__Impl ; - public final void rule__LocalThrow__Group__6() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9486:1: ( rule__LocalThrow__Group__6__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9487:2: rule__LocalThrow__Group__6__Impl - { - pushFollow(FOLLOW_rule__LocalThrow__Group__6__Impl_in_rule__LocalThrow__Group__618916); - rule__LocalThrow__Group__6__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalThrow__Group__6" - - - // $ANTLR start "rule__LocalThrow__Group__6__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9493:1: rule__LocalThrow__Group__6__Impl : ( ';' ) ; - public final void rule__LocalThrow__Group__6__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9497:1: ( ( ';' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9498:1: ( ';' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9498:1: ( ';' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9499:1: ';' - { - before(grammarAccess.getLocalThrowAccess().getSemicolonKeyword_6()); - match(input,12,FOLLOW_12_in_rule__LocalThrow__Group__6__Impl18944); - after(grammarAccess.getLocalThrowAccess().getSemicolonKeyword_6()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalThrow__Group__6__Impl" - - - // $ANTLR start "rule__LocalThrow__Group_2__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9526:1: rule__LocalThrow__Group_2__0 : rule__LocalThrow__Group_2__0__Impl rule__LocalThrow__Group_2__1 ; - public final void rule__LocalThrow__Group_2__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9530:1: ( rule__LocalThrow__Group_2__0__Impl rule__LocalThrow__Group_2__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9531:2: rule__LocalThrow__Group_2__0__Impl rule__LocalThrow__Group_2__1 - { - pushFollow(FOLLOW_rule__LocalThrow__Group_2__0__Impl_in_rule__LocalThrow__Group_2__018989); - rule__LocalThrow__Group_2__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalThrow__Group_2__1_in_rule__LocalThrow__Group_2__018992); - rule__LocalThrow__Group_2__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalThrow__Group_2__0" - - - // $ANTLR start "rule__LocalThrow__Group_2__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9538:1: rule__LocalThrow__Group_2__0__Impl : ( ',' ) ; - public final void rule__LocalThrow__Group_2__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9542:1: ( ( ',' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9543:1: ( ',' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9543:1: ( ',' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9544:1: ',' - { - before(grammarAccess.getLocalThrowAccess().getCommaKeyword_2_0()); - match(input,22,FOLLOW_22_in_rule__LocalThrow__Group_2__0__Impl19020); - after(grammarAccess.getLocalThrowAccess().getCommaKeyword_2_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalThrow__Group_2__0__Impl" - - - // $ANTLR start "rule__LocalThrow__Group_2__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9557:1: rule__LocalThrow__Group_2__1 : rule__LocalThrow__Group_2__1__Impl ; - public final void rule__LocalThrow__Group_2__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9561:1: ( rule__LocalThrow__Group_2__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9562:2: rule__LocalThrow__Group_2__1__Impl - { - pushFollow(FOLLOW_rule__LocalThrow__Group_2__1__Impl_in_rule__LocalThrow__Group_2__119051); - rule__LocalThrow__Group_2__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalThrow__Group_2__1" - - - // $ANTLR start "rule__LocalThrow__Group_2__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9568:1: rule__LocalThrow__Group_2__1__Impl : ( ( rule__LocalThrow__MessagesAssignment_2_1 ) ) ; - public final void rule__LocalThrow__Group_2__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9572:1: ( ( ( rule__LocalThrow__MessagesAssignment_2_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9573:1: ( ( rule__LocalThrow__MessagesAssignment_2_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9573:1: ( ( rule__LocalThrow__MessagesAssignment_2_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9574:1: ( rule__LocalThrow__MessagesAssignment_2_1 ) - { - before(grammarAccess.getLocalThrowAccess().getMessagesAssignment_2_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9575:1: ( rule__LocalThrow__MessagesAssignment_2_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9575:2: rule__LocalThrow__MessagesAssignment_2_1 - { - pushFollow(FOLLOW_rule__LocalThrow__MessagesAssignment_2_1_in_rule__LocalThrow__Group_2__1__Impl19078); - rule__LocalThrow__MessagesAssignment_2_1(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalThrowAccess().getMessagesAssignment_2_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalThrow__Group_2__1__Impl" - - - // $ANTLR start "rule__LocalThrow__Group_5__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9589:1: rule__LocalThrow__Group_5__0 : rule__LocalThrow__Group_5__0__Impl rule__LocalThrow__Group_5__1 ; - public final void rule__LocalThrow__Group_5__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9593:1: ( rule__LocalThrow__Group_5__0__Impl rule__LocalThrow__Group_5__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9594:2: rule__LocalThrow__Group_5__0__Impl rule__LocalThrow__Group_5__1 - { - pushFollow(FOLLOW_rule__LocalThrow__Group_5__0__Impl_in_rule__LocalThrow__Group_5__019112); - rule__LocalThrow__Group_5__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalThrow__Group_5__1_in_rule__LocalThrow__Group_5__019115); - rule__LocalThrow__Group_5__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalThrow__Group_5__0" - - - // $ANTLR start "rule__LocalThrow__Group_5__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9601:1: rule__LocalThrow__Group_5__0__Impl : ( ',' ) ; - public final void rule__LocalThrow__Group_5__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9605:1: ( ( ',' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9606:1: ( ',' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9606:1: ( ',' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9607:1: ',' - { - before(grammarAccess.getLocalThrowAccess().getCommaKeyword_5_0()); - match(input,22,FOLLOW_22_in_rule__LocalThrow__Group_5__0__Impl19143); - after(grammarAccess.getLocalThrowAccess().getCommaKeyword_5_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalThrow__Group_5__0__Impl" - - - // $ANTLR start "rule__LocalThrow__Group_5__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9620:1: rule__LocalThrow__Group_5__1 : rule__LocalThrow__Group_5__1__Impl ; - public final void rule__LocalThrow__Group_5__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9624:1: ( rule__LocalThrow__Group_5__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9625:2: rule__LocalThrow__Group_5__1__Impl - { - pushFollow(FOLLOW_rule__LocalThrow__Group_5__1__Impl_in_rule__LocalThrow__Group_5__119174); - rule__LocalThrow__Group_5__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalThrow__Group_5__1" - - - // $ANTLR start "rule__LocalThrow__Group_5__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9631:1: rule__LocalThrow__Group_5__1__Impl : ( ( rule__LocalThrow__ToRolesAssignment_5_1 ) ) ; - public final void rule__LocalThrow__Group_5__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9635:1: ( ( ( rule__LocalThrow__ToRolesAssignment_5_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9636:1: ( ( rule__LocalThrow__ToRolesAssignment_5_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9636:1: ( ( rule__LocalThrow__ToRolesAssignment_5_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9637:1: ( rule__LocalThrow__ToRolesAssignment_5_1 ) - { - before(grammarAccess.getLocalThrowAccess().getToRolesAssignment_5_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9638:1: ( rule__LocalThrow__ToRolesAssignment_5_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9638:2: rule__LocalThrow__ToRolesAssignment_5_1 - { - pushFollow(FOLLOW_rule__LocalThrow__ToRolesAssignment_5_1_in_rule__LocalThrow__Group_5__1__Impl19201); - rule__LocalThrow__ToRolesAssignment_5_1(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalThrowAccess().getToRolesAssignment_5_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalThrow__Group_5__1__Impl" - - - // $ANTLR start "rule__LocalCatch__Group__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9652:1: rule__LocalCatch__Group__0 : rule__LocalCatch__Group__0__Impl rule__LocalCatch__Group__1 ; - public final void rule__LocalCatch__Group__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9656:1: ( rule__LocalCatch__Group__0__Impl rule__LocalCatch__Group__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9657:2: rule__LocalCatch__Group__0__Impl rule__LocalCatch__Group__1 - { - pushFollow(FOLLOW_rule__LocalCatch__Group__0__Impl_in_rule__LocalCatch__Group__019235); - rule__LocalCatch__Group__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalCatch__Group__1_in_rule__LocalCatch__Group__019238); - rule__LocalCatch__Group__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalCatch__Group__0" - - - // $ANTLR start "rule__LocalCatch__Group__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9664:1: rule__LocalCatch__Group__0__Impl : ( 'catches' ) ; - public final void rule__LocalCatch__Group__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9668:1: ( ( 'catches' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9669:1: ( 'catches' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9669:1: ( 'catches' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9670:1: 'catches' - { - before(grammarAccess.getLocalCatchAccess().getCatchesKeyword_0()); - match(input,45,FOLLOW_45_in_rule__LocalCatch__Group__0__Impl19266); - after(grammarAccess.getLocalCatchAccess().getCatchesKeyword_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalCatch__Group__0__Impl" - - - // $ANTLR start "rule__LocalCatch__Group__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9683:1: rule__LocalCatch__Group__1 : rule__LocalCatch__Group__1__Impl rule__LocalCatch__Group__2 ; - public final void rule__LocalCatch__Group__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9687:1: ( rule__LocalCatch__Group__1__Impl rule__LocalCatch__Group__2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9688:2: rule__LocalCatch__Group__1__Impl rule__LocalCatch__Group__2 - { - pushFollow(FOLLOW_rule__LocalCatch__Group__1__Impl_in_rule__LocalCatch__Group__119297); - rule__LocalCatch__Group__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalCatch__Group__2_in_rule__LocalCatch__Group__119300); - rule__LocalCatch__Group__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalCatch__Group__1" - - - // $ANTLR start "rule__LocalCatch__Group__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9695:1: rule__LocalCatch__Group__1__Impl : ( ( rule__LocalCatch__MessagesAssignment_1 ) ) ; - public final void rule__LocalCatch__Group__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9699:1: ( ( ( rule__LocalCatch__MessagesAssignment_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9700:1: ( ( rule__LocalCatch__MessagesAssignment_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9700:1: ( ( rule__LocalCatch__MessagesAssignment_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9701:1: ( rule__LocalCatch__MessagesAssignment_1 ) - { - before(grammarAccess.getLocalCatchAccess().getMessagesAssignment_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9702:1: ( rule__LocalCatch__MessagesAssignment_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9702:2: rule__LocalCatch__MessagesAssignment_1 - { - pushFollow(FOLLOW_rule__LocalCatch__MessagesAssignment_1_in_rule__LocalCatch__Group__1__Impl19327); - rule__LocalCatch__MessagesAssignment_1(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalCatchAccess().getMessagesAssignment_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalCatch__Group__1__Impl" - - - // $ANTLR start "rule__LocalCatch__Group__2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9712:1: rule__LocalCatch__Group__2 : rule__LocalCatch__Group__2__Impl rule__LocalCatch__Group__3 ; - public final void rule__LocalCatch__Group__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9716:1: ( rule__LocalCatch__Group__2__Impl rule__LocalCatch__Group__3 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9717:2: rule__LocalCatch__Group__2__Impl rule__LocalCatch__Group__3 - { - pushFollow(FOLLOW_rule__LocalCatch__Group__2__Impl_in_rule__LocalCatch__Group__219357); - rule__LocalCatch__Group__2__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalCatch__Group__3_in_rule__LocalCatch__Group__219360); - rule__LocalCatch__Group__3(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalCatch__Group__2" - - - // $ANTLR start "rule__LocalCatch__Group__2__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9724:1: rule__LocalCatch__Group__2__Impl : ( ( rule__LocalCatch__Group_2__0 )* ) ; - public final void rule__LocalCatch__Group__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9728:1: ( ( ( rule__LocalCatch__Group_2__0 )* ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9729:1: ( ( rule__LocalCatch__Group_2__0 )* ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9729:1: ( ( rule__LocalCatch__Group_2__0 )* ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9730:1: ( rule__LocalCatch__Group_2__0 )* - { - before(grammarAccess.getLocalCatchAccess().getGroup_2()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9731:1: ( rule__LocalCatch__Group_2__0 )* - loop58: - do { - int alt58=2; - int LA58_0 = input.LA(1); - - if ( (LA58_0==22) ) { - alt58=1; - } - - - switch (alt58) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9731:2: rule__LocalCatch__Group_2__0 - { - pushFollow(FOLLOW_rule__LocalCatch__Group_2__0_in_rule__LocalCatch__Group__2__Impl19387); - rule__LocalCatch__Group_2__0(); - - state._fsp--; - - - } - break; - - default : - break loop58; - } - } while (true); - - after(grammarAccess.getLocalCatchAccess().getGroup_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalCatch__Group__2__Impl" - - - // $ANTLR start "rule__LocalCatch__Group__3" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9741:1: rule__LocalCatch__Group__3 : rule__LocalCatch__Group__3__Impl rule__LocalCatch__Group__4 ; - public final void rule__LocalCatch__Group__3() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9745:1: ( rule__LocalCatch__Group__3__Impl rule__LocalCatch__Group__4 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9746:2: rule__LocalCatch__Group__3__Impl rule__LocalCatch__Group__4 - { - pushFollow(FOLLOW_rule__LocalCatch__Group__3__Impl_in_rule__LocalCatch__Group__319418); - rule__LocalCatch__Group__3__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalCatch__Group__4_in_rule__LocalCatch__Group__319421); - rule__LocalCatch__Group__4(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalCatch__Group__3" - - - // $ANTLR start "rule__LocalCatch__Group__3__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9753:1: rule__LocalCatch__Group__3__Impl : ( 'from' ) ; - public final void rule__LocalCatch__Group__3__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9757:1: ( ( 'from' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9758:1: ( 'from' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9758:1: ( 'from' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9759:1: 'from' - { - before(grammarAccess.getLocalCatchAccess().getFromKeyword_3()); - match(input,16,FOLLOW_16_in_rule__LocalCatch__Group__3__Impl19449); - after(grammarAccess.getLocalCatchAccess().getFromKeyword_3()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalCatch__Group__3__Impl" - - - // $ANTLR start "rule__LocalCatch__Group__4" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9772:1: rule__LocalCatch__Group__4 : rule__LocalCatch__Group__4__Impl rule__LocalCatch__Group__5 ; - public final void rule__LocalCatch__Group__4() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9776:1: ( rule__LocalCatch__Group__4__Impl rule__LocalCatch__Group__5 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9777:2: rule__LocalCatch__Group__4__Impl rule__LocalCatch__Group__5 - { - pushFollow(FOLLOW_rule__LocalCatch__Group__4__Impl_in_rule__LocalCatch__Group__419480); - rule__LocalCatch__Group__4__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalCatch__Group__5_in_rule__LocalCatch__Group__419483); - rule__LocalCatch__Group__5(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalCatch__Group__4" - - - // $ANTLR start "rule__LocalCatch__Group__4__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9784:1: rule__LocalCatch__Group__4__Impl : ( ( rule__LocalCatch__FromRoleAssignment_4 ) ) ; - public final void rule__LocalCatch__Group__4__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9788:1: ( ( ( rule__LocalCatch__FromRoleAssignment_4 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9789:1: ( ( rule__LocalCatch__FromRoleAssignment_4 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9789:1: ( ( rule__LocalCatch__FromRoleAssignment_4 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9790:1: ( rule__LocalCatch__FromRoleAssignment_4 ) - { - before(grammarAccess.getLocalCatchAccess().getFromRoleAssignment_4()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9791:1: ( rule__LocalCatch__FromRoleAssignment_4 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9791:2: rule__LocalCatch__FromRoleAssignment_4 - { - pushFollow(FOLLOW_rule__LocalCatch__FromRoleAssignment_4_in_rule__LocalCatch__Group__4__Impl19510); - rule__LocalCatch__FromRoleAssignment_4(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalCatchAccess().getFromRoleAssignment_4()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalCatch__Group__4__Impl" - - - // $ANTLR start "rule__LocalCatch__Group__5" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9801:1: rule__LocalCatch__Group__5 : rule__LocalCatch__Group__5__Impl ; - public final void rule__LocalCatch__Group__5() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9805:1: ( rule__LocalCatch__Group__5__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9806:2: rule__LocalCatch__Group__5__Impl - { - pushFollow(FOLLOW_rule__LocalCatch__Group__5__Impl_in_rule__LocalCatch__Group__519540); - rule__LocalCatch__Group__5__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalCatch__Group__5" - - - // $ANTLR start "rule__LocalCatch__Group__5__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9812:1: rule__LocalCatch__Group__5__Impl : ( ';' ) ; - public final void rule__LocalCatch__Group__5__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9816:1: ( ( ';' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9817:1: ( ';' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9817:1: ( ';' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9818:1: ';' - { - before(grammarAccess.getLocalCatchAccess().getSemicolonKeyword_5()); - match(input,12,FOLLOW_12_in_rule__LocalCatch__Group__5__Impl19568); - after(grammarAccess.getLocalCatchAccess().getSemicolonKeyword_5()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalCatch__Group__5__Impl" - - - // $ANTLR start "rule__LocalCatch__Group_2__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9843:1: rule__LocalCatch__Group_2__0 : rule__LocalCatch__Group_2__0__Impl rule__LocalCatch__Group_2__1 ; - public final void rule__LocalCatch__Group_2__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9847:1: ( rule__LocalCatch__Group_2__0__Impl rule__LocalCatch__Group_2__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9848:2: rule__LocalCatch__Group_2__0__Impl rule__LocalCatch__Group_2__1 - { - pushFollow(FOLLOW_rule__LocalCatch__Group_2__0__Impl_in_rule__LocalCatch__Group_2__019611); - rule__LocalCatch__Group_2__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalCatch__Group_2__1_in_rule__LocalCatch__Group_2__019614); - rule__LocalCatch__Group_2__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalCatch__Group_2__0" - - - // $ANTLR start "rule__LocalCatch__Group_2__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9855:1: rule__LocalCatch__Group_2__0__Impl : ( ',' ) ; - public final void rule__LocalCatch__Group_2__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9859:1: ( ( ',' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9860:1: ( ',' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9860:1: ( ',' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9861:1: ',' - { - before(grammarAccess.getLocalCatchAccess().getCommaKeyword_2_0()); - match(input,22,FOLLOW_22_in_rule__LocalCatch__Group_2__0__Impl19642); - after(grammarAccess.getLocalCatchAccess().getCommaKeyword_2_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalCatch__Group_2__0__Impl" - - - // $ANTLR start "rule__LocalCatch__Group_2__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9874:1: rule__LocalCatch__Group_2__1 : rule__LocalCatch__Group_2__1__Impl ; - public final void rule__LocalCatch__Group_2__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9878:1: ( rule__LocalCatch__Group_2__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9879:2: rule__LocalCatch__Group_2__1__Impl - { - pushFollow(FOLLOW_rule__LocalCatch__Group_2__1__Impl_in_rule__LocalCatch__Group_2__119673); - rule__LocalCatch__Group_2__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalCatch__Group_2__1" - - - // $ANTLR start "rule__LocalCatch__Group_2__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9885:1: rule__LocalCatch__Group_2__1__Impl : ( ( rule__LocalCatch__MessagesAssignment_2_1 ) ) ; - public final void rule__LocalCatch__Group_2__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9889:1: ( ( ( rule__LocalCatch__MessagesAssignment_2_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9890:1: ( ( rule__LocalCatch__MessagesAssignment_2_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9890:1: ( ( rule__LocalCatch__MessagesAssignment_2_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9891:1: ( rule__LocalCatch__MessagesAssignment_2_1 ) - { - before(grammarAccess.getLocalCatchAccess().getMessagesAssignment_2_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9892:1: ( rule__LocalCatch__MessagesAssignment_2_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9892:2: rule__LocalCatch__MessagesAssignment_2_1 - { - pushFollow(FOLLOW_rule__LocalCatch__MessagesAssignment_2_1_in_rule__LocalCatch__Group_2__1__Impl19700); - rule__LocalCatch__MessagesAssignment_2_1(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalCatchAccess().getMessagesAssignment_2_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalCatch__Group_2__1__Impl" - - - // $ANTLR start "rule__LocalDo__Group__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9906:1: rule__LocalDo__Group__0 : rule__LocalDo__Group__0__Impl rule__LocalDo__Group__1 ; - public final void rule__LocalDo__Group__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9910:1: ( rule__LocalDo__Group__0__Impl rule__LocalDo__Group__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9911:2: rule__LocalDo__Group__0__Impl rule__LocalDo__Group__1 - { - pushFollow(FOLLOW_rule__LocalDo__Group__0__Impl_in_rule__LocalDo__Group__019734); - rule__LocalDo__Group__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalDo__Group__1_in_rule__LocalDo__Group__019737); - rule__LocalDo__Group__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__Group__0" - - - // $ANTLR start "rule__LocalDo__Group__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9918:1: rule__LocalDo__Group__0__Impl : ( 'do' ) ; - public final void rule__LocalDo__Group__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9922:1: ( ( 'do' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9923:1: ( 'do' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9923:1: ( 'do' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9924:1: 'do' - { - before(grammarAccess.getLocalDoAccess().getDoKeyword_0()); - match(input,42,FOLLOW_42_in_rule__LocalDo__Group__0__Impl19765); - after(grammarAccess.getLocalDoAccess().getDoKeyword_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__Group__0__Impl" - - - // $ANTLR start "rule__LocalDo__Group__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9937:1: rule__LocalDo__Group__1 : rule__LocalDo__Group__1__Impl rule__LocalDo__Group__2 ; - public final void rule__LocalDo__Group__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9941:1: ( rule__LocalDo__Group__1__Impl rule__LocalDo__Group__2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9942:2: rule__LocalDo__Group__1__Impl rule__LocalDo__Group__2 - { - pushFollow(FOLLOW_rule__LocalDo__Group__1__Impl_in_rule__LocalDo__Group__119796); - rule__LocalDo__Group__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalDo__Group__2_in_rule__LocalDo__Group__119799); - rule__LocalDo__Group__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__Group__1" - - - // $ANTLR start "rule__LocalDo__Group__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9949:1: rule__LocalDo__Group__1__Impl : ( ( rule__LocalDo__Group_1__0 )? ) ; - public final void rule__LocalDo__Group__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9953:1: ( ( ( rule__LocalDo__Group_1__0 )? ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9954:1: ( ( rule__LocalDo__Group_1__0 )? ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9954:1: ( ( rule__LocalDo__Group_1__0 )? ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9955:1: ( rule__LocalDo__Group_1__0 )? - { - before(grammarAccess.getLocalDoAccess().getGroup_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9956:1: ( rule__LocalDo__Group_1__0 )? - int alt59=2; - int LA59_0 = input.LA(1); - - if ( (LA59_0==RULE_ID) ) { - int LA59_1 = input.LA(2); - - if ( (LA59_1==23) ) { - alt59=1; - } - } - switch (alt59) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9956:2: rule__LocalDo__Group_1__0 - { - pushFollow(FOLLOW_rule__LocalDo__Group_1__0_in_rule__LocalDo__Group__1__Impl19826); - rule__LocalDo__Group_1__0(); - - state._fsp--; - - - } - break; - - } - - after(grammarAccess.getLocalDoAccess().getGroup_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__Group__1__Impl" - - - // $ANTLR start "rule__LocalDo__Group__2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9966:1: rule__LocalDo__Group__2 : rule__LocalDo__Group__2__Impl rule__LocalDo__Group__3 ; - public final void rule__LocalDo__Group__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9970:1: ( rule__LocalDo__Group__2__Impl rule__LocalDo__Group__3 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9971:2: rule__LocalDo__Group__2__Impl rule__LocalDo__Group__3 - { - pushFollow(FOLLOW_rule__LocalDo__Group__2__Impl_in_rule__LocalDo__Group__219857); - rule__LocalDo__Group__2__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalDo__Group__3_in_rule__LocalDo__Group__219860); - rule__LocalDo__Group__3(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__Group__2" - - - // $ANTLR start "rule__LocalDo__Group__2__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9978:1: rule__LocalDo__Group__2__Impl : ( ( rule__LocalDo__MemberAssignment_2 ) ) ; - public final void rule__LocalDo__Group__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9982:1: ( ( ( rule__LocalDo__MemberAssignment_2 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9983:1: ( ( rule__LocalDo__MemberAssignment_2 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9983:1: ( ( rule__LocalDo__MemberAssignment_2 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9984:1: ( rule__LocalDo__MemberAssignment_2 ) - { - before(grammarAccess.getLocalDoAccess().getMemberAssignment_2()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9985:1: ( rule__LocalDo__MemberAssignment_2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9985:2: rule__LocalDo__MemberAssignment_2 - { - pushFollow(FOLLOW_rule__LocalDo__MemberAssignment_2_in_rule__LocalDo__Group__2__Impl19887); - rule__LocalDo__MemberAssignment_2(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalDoAccess().getMemberAssignment_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__Group__2__Impl" - - - // $ANTLR start "rule__LocalDo__Group__3" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9995:1: rule__LocalDo__Group__3 : rule__LocalDo__Group__3__Impl rule__LocalDo__Group__4 ; - public final void rule__LocalDo__Group__3() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:9999:1: ( rule__LocalDo__Group__3__Impl rule__LocalDo__Group__4 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10000:2: rule__LocalDo__Group__3__Impl rule__LocalDo__Group__4 - { - pushFollow(FOLLOW_rule__LocalDo__Group__3__Impl_in_rule__LocalDo__Group__319917); - rule__LocalDo__Group__3__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalDo__Group__4_in_rule__LocalDo__Group__319920); - rule__LocalDo__Group__4(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__Group__3" - - - // $ANTLR start "rule__LocalDo__Group__3__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10007:1: rule__LocalDo__Group__3__Impl : ( ( rule__LocalDo__Group_3__0 )? ) ; - public final void rule__LocalDo__Group__3__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10011:1: ( ( ( rule__LocalDo__Group_3__0 )? ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10012:1: ( ( rule__LocalDo__Group_3__0 )? ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10012:1: ( ( rule__LocalDo__Group_3__0 )? ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10013:1: ( rule__LocalDo__Group_3__0 )? - { - before(grammarAccess.getLocalDoAccess().getGroup_3()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10014:1: ( rule__LocalDo__Group_3__0 )? - int alt60=2; - int LA60_0 = input.LA(1); - - if ( (LA60_0==18) ) { - alt60=1; - } - switch (alt60) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10014:2: rule__LocalDo__Group_3__0 - { - pushFollow(FOLLOW_rule__LocalDo__Group_3__0_in_rule__LocalDo__Group__3__Impl19947); - rule__LocalDo__Group_3__0(); - - state._fsp--; - - - } - break; - - } - - after(grammarAccess.getLocalDoAccess().getGroup_3()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__Group__3__Impl" - - - // $ANTLR start "rule__LocalDo__Group__4" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10024:1: rule__LocalDo__Group__4 : rule__LocalDo__Group__4__Impl rule__LocalDo__Group__5 ; - public final void rule__LocalDo__Group__4() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10028:1: ( rule__LocalDo__Group__4__Impl rule__LocalDo__Group__5 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10029:2: rule__LocalDo__Group__4__Impl rule__LocalDo__Group__5 - { - pushFollow(FOLLOW_rule__LocalDo__Group__4__Impl_in_rule__LocalDo__Group__419978); - rule__LocalDo__Group__4__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalDo__Group__5_in_rule__LocalDo__Group__419981); - rule__LocalDo__Group__5(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__Group__4" - - - // $ANTLR start "rule__LocalDo__Group__4__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10036:1: rule__LocalDo__Group__4__Impl : ( '(' ) ; - public final void rule__LocalDo__Group__4__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10040:1: ( ( '(' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10041:1: ( '(' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10041:1: ( '(' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10042:1: '(' - { - before(grammarAccess.getLocalDoAccess().getLeftParenthesisKeyword_4()); - match(input,20,FOLLOW_20_in_rule__LocalDo__Group__4__Impl20009); - after(grammarAccess.getLocalDoAccess().getLeftParenthesisKeyword_4()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__Group__4__Impl" - - - // $ANTLR start "rule__LocalDo__Group__5" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10055:1: rule__LocalDo__Group__5 : rule__LocalDo__Group__5__Impl rule__LocalDo__Group__6 ; - public final void rule__LocalDo__Group__5() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10059:1: ( rule__LocalDo__Group__5__Impl rule__LocalDo__Group__6 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10060:2: rule__LocalDo__Group__5__Impl rule__LocalDo__Group__6 - { - pushFollow(FOLLOW_rule__LocalDo__Group__5__Impl_in_rule__LocalDo__Group__520040); - rule__LocalDo__Group__5__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalDo__Group__6_in_rule__LocalDo__Group__520043); - rule__LocalDo__Group__6(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__Group__5" - - - // $ANTLR start "rule__LocalDo__Group__5__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10067:1: rule__LocalDo__Group__5__Impl : ( ( rule__LocalDo__RolesAssignment_5 ) ) ; - public final void rule__LocalDo__Group__5__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10071:1: ( ( ( rule__LocalDo__RolesAssignment_5 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10072:1: ( ( rule__LocalDo__RolesAssignment_5 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10072:1: ( ( rule__LocalDo__RolesAssignment_5 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10073:1: ( rule__LocalDo__RolesAssignment_5 ) - { - before(grammarAccess.getLocalDoAccess().getRolesAssignment_5()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10074:1: ( rule__LocalDo__RolesAssignment_5 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10074:2: rule__LocalDo__RolesAssignment_5 - { - pushFollow(FOLLOW_rule__LocalDo__RolesAssignment_5_in_rule__LocalDo__Group__5__Impl20070); - rule__LocalDo__RolesAssignment_5(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalDoAccess().getRolesAssignment_5()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__Group__5__Impl" - - - // $ANTLR start "rule__LocalDo__Group__6" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10084:1: rule__LocalDo__Group__6 : rule__LocalDo__Group__6__Impl rule__LocalDo__Group__7 ; - public final void rule__LocalDo__Group__6() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10088:1: ( rule__LocalDo__Group__6__Impl rule__LocalDo__Group__7 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10089:2: rule__LocalDo__Group__6__Impl rule__LocalDo__Group__7 - { - pushFollow(FOLLOW_rule__LocalDo__Group__6__Impl_in_rule__LocalDo__Group__620100); - rule__LocalDo__Group__6__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalDo__Group__7_in_rule__LocalDo__Group__620103); - rule__LocalDo__Group__7(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__Group__6" - - - // $ANTLR start "rule__LocalDo__Group__6__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10096:1: rule__LocalDo__Group__6__Impl : ( ( rule__LocalDo__Group_6__0 )* ) ; - public final void rule__LocalDo__Group__6__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10100:1: ( ( ( rule__LocalDo__Group_6__0 )* ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10101:1: ( ( rule__LocalDo__Group_6__0 )* ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10101:1: ( ( rule__LocalDo__Group_6__0 )* ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10102:1: ( rule__LocalDo__Group_6__0 )* - { - before(grammarAccess.getLocalDoAccess().getGroup_6()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10103:1: ( rule__LocalDo__Group_6__0 )* - loop61: - do { - int alt61=2; - int LA61_0 = input.LA(1); - - if ( (LA61_0==22) ) { - alt61=1; - } - - - switch (alt61) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10103:2: rule__LocalDo__Group_6__0 - { - pushFollow(FOLLOW_rule__LocalDo__Group_6__0_in_rule__LocalDo__Group__6__Impl20130); - rule__LocalDo__Group_6__0(); - - state._fsp--; - - - } - break; - - default : - break loop61; - } - } while (true); - - after(grammarAccess.getLocalDoAccess().getGroup_6()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__Group__6__Impl" - - - // $ANTLR start "rule__LocalDo__Group__7" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10113:1: rule__LocalDo__Group__7 : rule__LocalDo__Group__7__Impl rule__LocalDo__Group__8 ; - public final void rule__LocalDo__Group__7() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10117:1: ( rule__LocalDo__Group__7__Impl rule__LocalDo__Group__8 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10118:2: rule__LocalDo__Group__7__Impl rule__LocalDo__Group__8 - { - pushFollow(FOLLOW_rule__LocalDo__Group__7__Impl_in_rule__LocalDo__Group__720161); - rule__LocalDo__Group__7__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalDo__Group__8_in_rule__LocalDo__Group__720164); - rule__LocalDo__Group__8(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__Group__7" - - - // $ANTLR start "rule__LocalDo__Group__7__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10125:1: rule__LocalDo__Group__7__Impl : ( ')' ) ; - public final void rule__LocalDo__Group__7__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10129:1: ( ( ')' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10130:1: ( ')' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10130:1: ( ')' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10131:1: ')' - { - before(grammarAccess.getLocalDoAccess().getRightParenthesisKeyword_7()); - match(input,21,FOLLOW_21_in_rule__LocalDo__Group__7__Impl20192); - after(grammarAccess.getLocalDoAccess().getRightParenthesisKeyword_7()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__Group__7__Impl" - - - // $ANTLR start "rule__LocalDo__Group__8" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10144:1: rule__LocalDo__Group__8 : rule__LocalDo__Group__8__Impl ; - public final void rule__LocalDo__Group__8() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10148:1: ( rule__LocalDo__Group__8__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10149:2: rule__LocalDo__Group__8__Impl - { - pushFollow(FOLLOW_rule__LocalDo__Group__8__Impl_in_rule__LocalDo__Group__820223); - rule__LocalDo__Group__8__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__Group__8" - - - // $ANTLR start "rule__LocalDo__Group__8__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10155:1: rule__LocalDo__Group__8__Impl : ( ';' ) ; - public final void rule__LocalDo__Group__8__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10159:1: ( ( ';' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10160:1: ( ';' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10160:1: ( ';' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10161:1: ';' - { - before(grammarAccess.getLocalDoAccess().getSemicolonKeyword_8()); - match(input,12,FOLLOW_12_in_rule__LocalDo__Group__8__Impl20251); - after(grammarAccess.getLocalDoAccess().getSemicolonKeyword_8()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__Group__8__Impl" - - - // $ANTLR start "rule__LocalDo__Group_1__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10192:1: rule__LocalDo__Group_1__0 : rule__LocalDo__Group_1__0__Impl rule__LocalDo__Group_1__1 ; - public final void rule__LocalDo__Group_1__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10196:1: ( rule__LocalDo__Group_1__0__Impl rule__LocalDo__Group_1__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10197:2: rule__LocalDo__Group_1__0__Impl rule__LocalDo__Group_1__1 - { - pushFollow(FOLLOW_rule__LocalDo__Group_1__0__Impl_in_rule__LocalDo__Group_1__020300); - rule__LocalDo__Group_1__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalDo__Group_1__1_in_rule__LocalDo__Group_1__020303); - rule__LocalDo__Group_1__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__Group_1__0" - - - // $ANTLR start "rule__LocalDo__Group_1__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10204:1: rule__LocalDo__Group_1__0__Impl : ( ( rule__LocalDo__ScopeAssignment_1_0 ) ) ; - public final void rule__LocalDo__Group_1__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10208:1: ( ( ( rule__LocalDo__ScopeAssignment_1_0 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10209:1: ( ( rule__LocalDo__ScopeAssignment_1_0 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10209:1: ( ( rule__LocalDo__ScopeAssignment_1_0 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10210:1: ( rule__LocalDo__ScopeAssignment_1_0 ) - { - before(grammarAccess.getLocalDoAccess().getScopeAssignment_1_0()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10211:1: ( rule__LocalDo__ScopeAssignment_1_0 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10211:2: rule__LocalDo__ScopeAssignment_1_0 - { - pushFollow(FOLLOW_rule__LocalDo__ScopeAssignment_1_0_in_rule__LocalDo__Group_1__0__Impl20330); - rule__LocalDo__ScopeAssignment_1_0(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalDoAccess().getScopeAssignment_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__Group_1__0__Impl" - - - // $ANTLR start "rule__LocalDo__Group_1__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10221:1: rule__LocalDo__Group_1__1 : rule__LocalDo__Group_1__1__Impl ; - public final void rule__LocalDo__Group_1__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10225:1: ( rule__LocalDo__Group_1__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10226:2: rule__LocalDo__Group_1__1__Impl - { - pushFollow(FOLLOW_rule__LocalDo__Group_1__1__Impl_in_rule__LocalDo__Group_1__120360); - rule__LocalDo__Group_1__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__Group_1__1" - - - // $ANTLR start "rule__LocalDo__Group_1__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10232:1: rule__LocalDo__Group_1__1__Impl : ( ':' ) ; - public final void rule__LocalDo__Group_1__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10236:1: ( ( ':' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10237:1: ( ':' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10237:1: ( ':' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10238:1: ':' - { - before(grammarAccess.getLocalDoAccess().getColonKeyword_1_1()); - match(input,23,FOLLOW_23_in_rule__LocalDo__Group_1__1__Impl20388); - after(grammarAccess.getLocalDoAccess().getColonKeyword_1_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__Group_1__1__Impl" - - - // $ANTLR start "rule__LocalDo__Group_3__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10255:1: rule__LocalDo__Group_3__0 : rule__LocalDo__Group_3__0__Impl rule__LocalDo__Group_3__1 ; - public final void rule__LocalDo__Group_3__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10259:1: ( rule__LocalDo__Group_3__0__Impl rule__LocalDo__Group_3__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10260:2: rule__LocalDo__Group_3__0__Impl rule__LocalDo__Group_3__1 - { - pushFollow(FOLLOW_rule__LocalDo__Group_3__0__Impl_in_rule__LocalDo__Group_3__020423); - rule__LocalDo__Group_3__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalDo__Group_3__1_in_rule__LocalDo__Group_3__020426); - rule__LocalDo__Group_3__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__Group_3__0" - - - // $ANTLR start "rule__LocalDo__Group_3__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10267:1: rule__LocalDo__Group_3__0__Impl : ( '<' ) ; - public final void rule__LocalDo__Group_3__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10271:1: ( ( '<' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10272:1: ( '<' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10272:1: ( '<' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10273:1: '<' - { - before(grammarAccess.getLocalDoAccess().getLessThanSignKeyword_3_0()); - match(input,18,FOLLOW_18_in_rule__LocalDo__Group_3__0__Impl20454); - after(grammarAccess.getLocalDoAccess().getLessThanSignKeyword_3_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__Group_3__0__Impl" - - - // $ANTLR start "rule__LocalDo__Group_3__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10286:1: rule__LocalDo__Group_3__1 : rule__LocalDo__Group_3__1__Impl rule__LocalDo__Group_3__2 ; - public final void rule__LocalDo__Group_3__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10290:1: ( rule__LocalDo__Group_3__1__Impl rule__LocalDo__Group_3__2 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10291:2: rule__LocalDo__Group_3__1__Impl rule__LocalDo__Group_3__2 - { - pushFollow(FOLLOW_rule__LocalDo__Group_3__1__Impl_in_rule__LocalDo__Group_3__120485); - rule__LocalDo__Group_3__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalDo__Group_3__2_in_rule__LocalDo__Group_3__120488); - rule__LocalDo__Group_3__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__Group_3__1" - - - // $ANTLR start "rule__LocalDo__Group_3__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10298:1: rule__LocalDo__Group_3__1__Impl : ( ( rule__LocalDo__ArgumentsAssignment_3_1 ) ) ; - public final void rule__LocalDo__Group_3__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10302:1: ( ( ( rule__LocalDo__ArgumentsAssignment_3_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10303:1: ( ( rule__LocalDo__ArgumentsAssignment_3_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10303:1: ( ( rule__LocalDo__ArgumentsAssignment_3_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10304:1: ( rule__LocalDo__ArgumentsAssignment_3_1 ) - { - before(grammarAccess.getLocalDoAccess().getArgumentsAssignment_3_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10305:1: ( rule__LocalDo__ArgumentsAssignment_3_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10305:2: rule__LocalDo__ArgumentsAssignment_3_1 - { - pushFollow(FOLLOW_rule__LocalDo__ArgumentsAssignment_3_1_in_rule__LocalDo__Group_3__1__Impl20515); - rule__LocalDo__ArgumentsAssignment_3_1(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalDoAccess().getArgumentsAssignment_3_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__Group_3__1__Impl" - - - // $ANTLR start "rule__LocalDo__Group_3__2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10315:1: rule__LocalDo__Group_3__2 : rule__LocalDo__Group_3__2__Impl rule__LocalDo__Group_3__3 ; - public final void rule__LocalDo__Group_3__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10319:1: ( rule__LocalDo__Group_3__2__Impl rule__LocalDo__Group_3__3 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10320:2: rule__LocalDo__Group_3__2__Impl rule__LocalDo__Group_3__3 - { - pushFollow(FOLLOW_rule__LocalDo__Group_3__2__Impl_in_rule__LocalDo__Group_3__220545); - rule__LocalDo__Group_3__2__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalDo__Group_3__3_in_rule__LocalDo__Group_3__220548); - rule__LocalDo__Group_3__3(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__Group_3__2" - - - // $ANTLR start "rule__LocalDo__Group_3__2__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10327:1: rule__LocalDo__Group_3__2__Impl : ( ( rule__LocalDo__Group_3_2__0 )* ) ; - public final void rule__LocalDo__Group_3__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10331:1: ( ( ( rule__LocalDo__Group_3_2__0 )* ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10332:1: ( ( rule__LocalDo__Group_3_2__0 )* ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10332:1: ( ( rule__LocalDo__Group_3_2__0 )* ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10333:1: ( rule__LocalDo__Group_3_2__0 )* - { - before(grammarAccess.getLocalDoAccess().getGroup_3_2()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10334:1: ( rule__LocalDo__Group_3_2__0 )* - loop62: - do { - int alt62=2; - int LA62_0 = input.LA(1); - - if ( (LA62_0==22) ) { - alt62=1; - } - - - switch (alt62) { - case 1 : - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10334:2: rule__LocalDo__Group_3_2__0 - { - pushFollow(FOLLOW_rule__LocalDo__Group_3_2__0_in_rule__LocalDo__Group_3__2__Impl20575); - rule__LocalDo__Group_3_2__0(); - - state._fsp--; - - - } - break; - - default : - break loop62; - } - } while (true); - - after(grammarAccess.getLocalDoAccess().getGroup_3_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__Group_3__2__Impl" - - - // $ANTLR start "rule__LocalDo__Group_3__3" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10344:1: rule__LocalDo__Group_3__3 : rule__LocalDo__Group_3__3__Impl ; - public final void rule__LocalDo__Group_3__3() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10348:1: ( rule__LocalDo__Group_3__3__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10349:2: rule__LocalDo__Group_3__3__Impl - { - pushFollow(FOLLOW_rule__LocalDo__Group_3__3__Impl_in_rule__LocalDo__Group_3__320606); - rule__LocalDo__Group_3__3__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__Group_3__3" - - - // $ANTLR start "rule__LocalDo__Group_3__3__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10355:1: rule__LocalDo__Group_3__3__Impl : ( '>' ) ; - public final void rule__LocalDo__Group_3__3__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10359:1: ( ( '>' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10360:1: ( '>' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10360:1: ( '>' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10361:1: '>' - { - before(grammarAccess.getLocalDoAccess().getGreaterThanSignKeyword_3_3()); - match(input,19,FOLLOW_19_in_rule__LocalDo__Group_3__3__Impl20634); - after(grammarAccess.getLocalDoAccess().getGreaterThanSignKeyword_3_3()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__Group_3__3__Impl" - - - // $ANTLR start "rule__LocalDo__Group_3_2__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10382:1: rule__LocalDo__Group_3_2__0 : rule__LocalDo__Group_3_2__0__Impl rule__LocalDo__Group_3_2__1 ; - public final void rule__LocalDo__Group_3_2__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10386:1: ( rule__LocalDo__Group_3_2__0__Impl rule__LocalDo__Group_3_2__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10387:2: rule__LocalDo__Group_3_2__0__Impl rule__LocalDo__Group_3_2__1 - { - pushFollow(FOLLOW_rule__LocalDo__Group_3_2__0__Impl_in_rule__LocalDo__Group_3_2__020673); - rule__LocalDo__Group_3_2__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalDo__Group_3_2__1_in_rule__LocalDo__Group_3_2__020676); - rule__LocalDo__Group_3_2__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__Group_3_2__0" - - - // $ANTLR start "rule__LocalDo__Group_3_2__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10394:1: rule__LocalDo__Group_3_2__0__Impl : ( ',' ) ; - public final void rule__LocalDo__Group_3_2__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10398:1: ( ( ',' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10399:1: ( ',' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10399:1: ( ',' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10400:1: ',' - { - before(grammarAccess.getLocalDoAccess().getCommaKeyword_3_2_0()); - match(input,22,FOLLOW_22_in_rule__LocalDo__Group_3_2__0__Impl20704); - after(grammarAccess.getLocalDoAccess().getCommaKeyword_3_2_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__Group_3_2__0__Impl" - - - // $ANTLR start "rule__LocalDo__Group_3_2__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10413:1: rule__LocalDo__Group_3_2__1 : rule__LocalDo__Group_3_2__1__Impl ; - public final void rule__LocalDo__Group_3_2__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10417:1: ( rule__LocalDo__Group_3_2__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10418:2: rule__LocalDo__Group_3_2__1__Impl - { - pushFollow(FOLLOW_rule__LocalDo__Group_3_2__1__Impl_in_rule__LocalDo__Group_3_2__120735); - rule__LocalDo__Group_3_2__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__Group_3_2__1" - - - // $ANTLR start "rule__LocalDo__Group_3_2__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10424:1: rule__LocalDo__Group_3_2__1__Impl : ( ( rule__LocalDo__ArgumentsAssignment_3_2_1 ) ) ; - public final void rule__LocalDo__Group_3_2__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10428:1: ( ( ( rule__LocalDo__ArgumentsAssignment_3_2_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10429:1: ( ( rule__LocalDo__ArgumentsAssignment_3_2_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10429:1: ( ( rule__LocalDo__ArgumentsAssignment_3_2_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10430:1: ( rule__LocalDo__ArgumentsAssignment_3_2_1 ) - { - before(grammarAccess.getLocalDoAccess().getArgumentsAssignment_3_2_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10431:1: ( rule__LocalDo__ArgumentsAssignment_3_2_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10431:2: rule__LocalDo__ArgumentsAssignment_3_2_1 - { - pushFollow(FOLLOW_rule__LocalDo__ArgumentsAssignment_3_2_1_in_rule__LocalDo__Group_3_2__1__Impl20762); - rule__LocalDo__ArgumentsAssignment_3_2_1(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalDoAccess().getArgumentsAssignment_3_2_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__Group_3_2__1__Impl" - - - // $ANTLR start "rule__LocalDo__Group_6__0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10445:1: rule__LocalDo__Group_6__0 : rule__LocalDo__Group_6__0__Impl rule__LocalDo__Group_6__1 ; - public final void rule__LocalDo__Group_6__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10449:1: ( rule__LocalDo__Group_6__0__Impl rule__LocalDo__Group_6__1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10450:2: rule__LocalDo__Group_6__0__Impl rule__LocalDo__Group_6__1 - { - pushFollow(FOLLOW_rule__LocalDo__Group_6__0__Impl_in_rule__LocalDo__Group_6__020796); - rule__LocalDo__Group_6__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__LocalDo__Group_6__1_in_rule__LocalDo__Group_6__020799); - rule__LocalDo__Group_6__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__Group_6__0" - - - // $ANTLR start "rule__LocalDo__Group_6__0__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10457:1: rule__LocalDo__Group_6__0__Impl : ( ',' ) ; - public final void rule__LocalDo__Group_6__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10461:1: ( ( ',' ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10462:1: ( ',' ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10462:1: ( ',' ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10463:1: ',' - { - before(grammarAccess.getLocalDoAccess().getCommaKeyword_6_0()); - match(input,22,FOLLOW_22_in_rule__LocalDo__Group_6__0__Impl20827); - after(grammarAccess.getLocalDoAccess().getCommaKeyword_6_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__Group_6__0__Impl" - - - // $ANTLR start "rule__LocalDo__Group_6__1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10476:1: rule__LocalDo__Group_6__1 : rule__LocalDo__Group_6__1__Impl ; - public final void rule__LocalDo__Group_6__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10480:1: ( rule__LocalDo__Group_6__1__Impl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10481:2: rule__LocalDo__Group_6__1__Impl - { - pushFollow(FOLLOW_rule__LocalDo__Group_6__1__Impl_in_rule__LocalDo__Group_6__120858); - rule__LocalDo__Group_6__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__Group_6__1" - - - // $ANTLR start "rule__LocalDo__Group_6__1__Impl" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10487:1: rule__LocalDo__Group_6__1__Impl : ( ( rule__LocalDo__RolesAssignment_6_1 ) ) ; - public final void rule__LocalDo__Group_6__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10491:1: ( ( ( rule__LocalDo__RolesAssignment_6_1 ) ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10492:1: ( ( rule__LocalDo__RolesAssignment_6_1 ) ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10492:1: ( ( rule__LocalDo__RolesAssignment_6_1 ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10493:1: ( rule__LocalDo__RolesAssignment_6_1 ) - { - before(grammarAccess.getLocalDoAccess().getRolesAssignment_6_1()); - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10494:1: ( rule__LocalDo__RolesAssignment_6_1 ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10494:2: rule__LocalDo__RolesAssignment_6_1 - { - pushFollow(FOLLOW_rule__LocalDo__RolesAssignment_6_1_in_rule__LocalDo__Group_6__1__Impl20885); - rule__LocalDo__RolesAssignment_6_1(); - - state._fsp--; - - - } - - after(grammarAccess.getLocalDoAccess().getRolesAssignment_6_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__Group_6__1__Impl" - - - // $ANTLR start "rule__Module__NameAssignment_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10509:1: rule__Module__NameAssignment_1 : ( ruleModuleName ) ; - public final void rule__Module__NameAssignment_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10513:1: ( ( ruleModuleName ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10514:1: ( ruleModuleName ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10514:1: ( ruleModuleName ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10515:1: ruleModuleName - { - before(grammarAccess.getModuleAccess().getNameModuleNameParserRuleCall_1_0()); - pushFollow(FOLLOW_ruleModuleName_in_rule__Module__NameAssignment_120924); - ruleModuleName(); - - state._fsp--; - - after(grammarAccess.getModuleAccess().getNameModuleNameParserRuleCall_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Module__NameAssignment_1" - - - // $ANTLR start "rule__Module__ImportsAssignment_3" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10524:1: rule__Module__ImportsAssignment_3 : ( ruleImportDecl ) ; - public final void rule__Module__ImportsAssignment_3() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10528:1: ( ( ruleImportDecl ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10529:1: ( ruleImportDecl ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10529:1: ( ruleImportDecl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10530:1: ruleImportDecl - { - before(grammarAccess.getModuleAccess().getImportsImportDeclParserRuleCall_3_0()); - pushFollow(FOLLOW_ruleImportDecl_in_rule__Module__ImportsAssignment_320955); - ruleImportDecl(); - - state._fsp--; - - after(grammarAccess.getModuleAccess().getImportsImportDeclParserRuleCall_3_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Module__ImportsAssignment_3" - - - // $ANTLR start "rule__Module__TypesAssignment_4" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10539:1: rule__Module__TypesAssignment_4 : ( rulePayloadTypeDecl ) ; - public final void rule__Module__TypesAssignment_4() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10543:1: ( ( rulePayloadTypeDecl ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10544:1: ( rulePayloadTypeDecl ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10544:1: ( rulePayloadTypeDecl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10545:1: rulePayloadTypeDecl - { - before(grammarAccess.getModuleAccess().getTypesPayloadTypeDeclParserRuleCall_4_0()); - pushFollow(FOLLOW_rulePayloadTypeDecl_in_rule__Module__TypesAssignment_420986); - rulePayloadTypeDecl(); - - state._fsp--; - - after(grammarAccess.getModuleAccess().getTypesPayloadTypeDeclParserRuleCall_4_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Module__TypesAssignment_4" - - - // $ANTLR start "rule__Module__GlobalsAssignment_5_0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10554:1: rule__Module__GlobalsAssignment_5_0 : ( ruleGlobalProtocolDecl ) ; - public final void rule__Module__GlobalsAssignment_5_0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10558:1: ( ( ruleGlobalProtocolDecl ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10559:1: ( ruleGlobalProtocolDecl ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10559:1: ( ruleGlobalProtocolDecl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10560:1: ruleGlobalProtocolDecl - { - before(grammarAccess.getModuleAccess().getGlobalsGlobalProtocolDeclParserRuleCall_5_0_0()); - pushFollow(FOLLOW_ruleGlobalProtocolDecl_in_rule__Module__GlobalsAssignment_5_021017); - ruleGlobalProtocolDecl(); - - state._fsp--; - - after(grammarAccess.getModuleAccess().getGlobalsGlobalProtocolDeclParserRuleCall_5_0_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Module__GlobalsAssignment_5_0" - - - // $ANTLR start "rule__Module__LocalsAssignment_5_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10569:1: rule__Module__LocalsAssignment_5_1 : ( ruleLocalProtocolDecl ) ; - public final void rule__Module__LocalsAssignment_5_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10573:1: ( ( ruleLocalProtocolDecl ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10574:1: ( ruleLocalProtocolDecl ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10574:1: ( ruleLocalProtocolDecl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10575:1: ruleLocalProtocolDecl - { - before(grammarAccess.getModuleAccess().getLocalsLocalProtocolDeclParserRuleCall_5_1_0()); - pushFollow(FOLLOW_ruleLocalProtocolDecl_in_rule__Module__LocalsAssignment_5_121048); - ruleLocalProtocolDecl(); - - state._fsp--; - - after(grammarAccess.getModuleAccess().getLocalsLocalProtocolDeclParserRuleCall_5_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Module__LocalsAssignment_5_1" - - - // $ANTLR start "rule__ImportModule__NameAssignment_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10584:1: rule__ImportModule__NameAssignment_1 : ( ruleModuleName ) ; - public final void rule__ImportModule__NameAssignment_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10588:1: ( ( ruleModuleName ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10589:1: ( ruleModuleName ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10589:1: ( ruleModuleName ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10590:1: ruleModuleName - { - before(grammarAccess.getImportModuleAccess().getNameModuleNameParserRuleCall_1_0()); - pushFollow(FOLLOW_ruleModuleName_in_rule__ImportModule__NameAssignment_121079); - ruleModuleName(); - - state._fsp--; - - after(grammarAccess.getImportModuleAccess().getNameModuleNameParserRuleCall_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ImportModule__NameAssignment_1" - - - // $ANTLR start "rule__ImportModule__AliasAssignment_2_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10599:1: rule__ImportModule__AliasAssignment_2_1 : ( RULE_ID ) ; - public final void rule__ImportModule__AliasAssignment_2_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10603:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10604:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10604:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10605:1: RULE_ID - { - before(grammarAccess.getImportModuleAccess().getAliasIDTerminalRuleCall_2_1_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__ImportModule__AliasAssignment_2_121110); - after(grammarAccess.getImportModuleAccess().getAliasIDTerminalRuleCall_2_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ImportModule__AliasAssignment_2_1" - - - // $ANTLR start "rule__ImportMember__NameAssignment_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10614:1: rule__ImportMember__NameAssignment_1 : ( ruleModuleName ) ; - public final void rule__ImportMember__NameAssignment_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10618:1: ( ( ruleModuleName ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10619:1: ( ruleModuleName ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10619:1: ( ruleModuleName ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10620:1: ruleModuleName - { - before(grammarAccess.getImportMemberAccess().getNameModuleNameParserRuleCall_1_0()); - pushFollow(FOLLOW_ruleModuleName_in_rule__ImportMember__NameAssignment_121141); - ruleModuleName(); - - state._fsp--; - - after(grammarAccess.getImportMemberAccess().getNameModuleNameParserRuleCall_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ImportMember__NameAssignment_1" - - - // $ANTLR start "rule__ImportMember__MemberAssignment_3" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10629:1: rule__ImportMember__MemberAssignment_3 : ( RULE_ID ) ; - public final void rule__ImportMember__MemberAssignment_3() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10633:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10634:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10634:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10635:1: RULE_ID - { - before(grammarAccess.getImportMemberAccess().getMemberIDTerminalRuleCall_3_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__ImportMember__MemberAssignment_321172); - after(grammarAccess.getImportMemberAccess().getMemberIDTerminalRuleCall_3_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ImportMember__MemberAssignment_3" - - - // $ANTLR start "rule__ImportMember__AliasAssignment_4_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10644:1: rule__ImportMember__AliasAssignment_4_1 : ( RULE_ID ) ; - public final void rule__ImportMember__AliasAssignment_4_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10648:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10649:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10649:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10650:1: RULE_ID - { - before(grammarAccess.getImportMemberAccess().getAliasIDTerminalRuleCall_4_1_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__ImportMember__AliasAssignment_4_121203); - after(grammarAccess.getImportMemberAccess().getAliasIDTerminalRuleCall_4_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ImportMember__AliasAssignment_4_1" - - - // $ANTLR start "rule__PayloadTypeDecl__SchemaAssignment_2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10659:1: rule__PayloadTypeDecl__SchemaAssignment_2 : ( RULE_ID ) ; - public final void rule__PayloadTypeDecl__SchemaAssignment_2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10663:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10664:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10664:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10665:1: RULE_ID - { - before(grammarAccess.getPayloadTypeDeclAccess().getSchemaIDTerminalRuleCall_2_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__PayloadTypeDecl__SchemaAssignment_221234); - after(grammarAccess.getPayloadTypeDeclAccess().getSchemaIDTerminalRuleCall_2_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__PayloadTypeDecl__SchemaAssignment_2" - - - // $ANTLR start "rule__PayloadTypeDecl__TypeAssignment_4" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10674:1: rule__PayloadTypeDecl__TypeAssignment_4 : ( RULE_STRING ) ; - public final void rule__PayloadTypeDecl__TypeAssignment_4() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10678:1: ( ( RULE_STRING ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10679:1: ( RULE_STRING ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10679:1: ( RULE_STRING ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10680:1: RULE_STRING - { - before(grammarAccess.getPayloadTypeDeclAccess().getTypeSTRINGTerminalRuleCall_4_0()); - match(input,RULE_STRING,FOLLOW_RULE_STRING_in_rule__PayloadTypeDecl__TypeAssignment_421265); - after(grammarAccess.getPayloadTypeDeclAccess().getTypeSTRINGTerminalRuleCall_4_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__PayloadTypeDecl__TypeAssignment_4" - - - // $ANTLR start "rule__PayloadTypeDecl__LocationAssignment_6" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10689:1: rule__PayloadTypeDecl__LocationAssignment_6 : ( RULE_STRING ) ; - public final void rule__PayloadTypeDecl__LocationAssignment_6() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10693:1: ( ( RULE_STRING ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10694:1: ( RULE_STRING ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10694:1: ( RULE_STRING ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10695:1: RULE_STRING - { - before(grammarAccess.getPayloadTypeDeclAccess().getLocationSTRINGTerminalRuleCall_6_0()); - match(input,RULE_STRING,FOLLOW_RULE_STRING_in_rule__PayloadTypeDecl__LocationAssignment_621296); - after(grammarAccess.getPayloadTypeDeclAccess().getLocationSTRINGTerminalRuleCall_6_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__PayloadTypeDecl__LocationAssignment_6" - - - // $ANTLR start "rule__PayloadTypeDecl__AliasAssignment_8" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10704:1: rule__PayloadTypeDecl__AliasAssignment_8 : ( RULE_ID ) ; - public final void rule__PayloadTypeDecl__AliasAssignment_8() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10708:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10709:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10709:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10710:1: RULE_ID - { - before(grammarAccess.getPayloadTypeDeclAccess().getAliasIDTerminalRuleCall_8_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__PayloadTypeDecl__AliasAssignment_821327); - after(grammarAccess.getPayloadTypeDeclAccess().getAliasIDTerminalRuleCall_8_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__PayloadTypeDecl__AliasAssignment_8" - - - // $ANTLR start "rule__MessageSignature__OperatorAssignment_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10719:1: rule__MessageSignature__OperatorAssignment_1 : ( RULE_ID ) ; - public final void rule__MessageSignature__OperatorAssignment_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10723:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10724:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10724:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10725:1: RULE_ID - { - before(grammarAccess.getMessageSignatureAccess().getOperatorIDTerminalRuleCall_1_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__MessageSignature__OperatorAssignment_121358); - after(grammarAccess.getMessageSignatureAccess().getOperatorIDTerminalRuleCall_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__MessageSignature__OperatorAssignment_1" - - - // $ANTLR start "rule__MessageSignature__TypesAssignment_3_0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10734:1: rule__MessageSignature__TypesAssignment_3_0 : ( rulePayloadElement ) ; - public final void rule__MessageSignature__TypesAssignment_3_0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10738:1: ( ( rulePayloadElement ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10739:1: ( rulePayloadElement ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10739:1: ( rulePayloadElement ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10740:1: rulePayloadElement - { - before(grammarAccess.getMessageSignatureAccess().getTypesPayloadElementParserRuleCall_3_0_0()); - pushFollow(FOLLOW_rulePayloadElement_in_rule__MessageSignature__TypesAssignment_3_021389); - rulePayloadElement(); - - state._fsp--; - - after(grammarAccess.getMessageSignatureAccess().getTypesPayloadElementParserRuleCall_3_0_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__MessageSignature__TypesAssignment_3_0" - - - // $ANTLR start "rule__MessageSignature__TypesAssignment_3_1_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10749:1: rule__MessageSignature__TypesAssignment_3_1_1 : ( rulePayloadElement ) ; - public final void rule__MessageSignature__TypesAssignment_3_1_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10753:1: ( ( rulePayloadElement ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10754:1: ( rulePayloadElement ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10754:1: ( rulePayloadElement ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10755:1: rulePayloadElement - { - before(grammarAccess.getMessageSignatureAccess().getTypesPayloadElementParserRuleCall_3_1_1_0()); - pushFollow(FOLLOW_rulePayloadElement_in_rule__MessageSignature__TypesAssignment_3_1_121420); - rulePayloadElement(); - - state._fsp--; - - after(grammarAccess.getMessageSignatureAccess().getTypesPayloadElementParserRuleCall_3_1_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__MessageSignature__TypesAssignment_3_1_1" - - - // $ANTLR start "rule__PayloadElement__NameAssignment_0_0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10764:1: rule__PayloadElement__NameAssignment_0_0 : ( RULE_ID ) ; - public final void rule__PayloadElement__NameAssignment_0_0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10768:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10769:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10769:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10770:1: RULE_ID - { - before(grammarAccess.getPayloadElementAccess().getNameIDTerminalRuleCall_0_0_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__PayloadElement__NameAssignment_0_021451); - after(grammarAccess.getPayloadElementAccess().getNameIDTerminalRuleCall_0_0_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__PayloadElement__NameAssignment_0_0" - - - // $ANTLR start "rule__PayloadElement__TypeAssignment_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10779:1: rule__PayloadElement__TypeAssignment_1 : ( RULE_ID ) ; - public final void rule__PayloadElement__TypeAssignment_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10783:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10784:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10784:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10785:1: RULE_ID - { - before(grammarAccess.getPayloadElementAccess().getTypeIDTerminalRuleCall_1_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__PayloadElement__TypeAssignment_121482); - after(grammarAccess.getPayloadElementAccess().getTypeIDTerminalRuleCall_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__PayloadElement__TypeAssignment_1" - - - // $ANTLR start "rule__GlobalProtocolDecl__NameAssignment_2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10794:1: rule__GlobalProtocolDecl__NameAssignment_2 : ( RULE_ID ) ; - public final void rule__GlobalProtocolDecl__NameAssignment_2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10798:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10799:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10799:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10800:1: RULE_ID - { - before(grammarAccess.getGlobalProtocolDeclAccess().getNameIDTerminalRuleCall_2_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__GlobalProtocolDecl__NameAssignment_221513); - after(grammarAccess.getGlobalProtocolDeclAccess().getNameIDTerminalRuleCall_2_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__NameAssignment_2" - - - // $ANTLR start "rule__GlobalProtocolDecl__ParametersAssignment_3_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10809:1: rule__GlobalProtocolDecl__ParametersAssignment_3_1 : ( ruleParameterDecl ) ; - public final void rule__GlobalProtocolDecl__ParametersAssignment_3_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10813:1: ( ( ruleParameterDecl ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10814:1: ( ruleParameterDecl ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10814:1: ( ruleParameterDecl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10815:1: ruleParameterDecl - { - before(grammarAccess.getGlobalProtocolDeclAccess().getParametersParameterDeclParserRuleCall_3_1_0()); - pushFollow(FOLLOW_ruleParameterDecl_in_rule__GlobalProtocolDecl__ParametersAssignment_3_121544); - ruleParameterDecl(); - - state._fsp--; - - after(grammarAccess.getGlobalProtocolDeclAccess().getParametersParameterDeclParserRuleCall_3_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__ParametersAssignment_3_1" - - - // $ANTLR start "rule__GlobalProtocolDecl__ParametersAssignment_3_2_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10824:1: rule__GlobalProtocolDecl__ParametersAssignment_3_2_1 : ( ruleParameterDecl ) ; - public final void rule__GlobalProtocolDecl__ParametersAssignment_3_2_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10828:1: ( ( ruleParameterDecl ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10829:1: ( ruleParameterDecl ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10829:1: ( ruleParameterDecl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10830:1: ruleParameterDecl - { - before(grammarAccess.getGlobalProtocolDeclAccess().getParametersParameterDeclParserRuleCall_3_2_1_0()); - pushFollow(FOLLOW_ruleParameterDecl_in_rule__GlobalProtocolDecl__ParametersAssignment_3_2_121575); - ruleParameterDecl(); - - state._fsp--; - - after(grammarAccess.getGlobalProtocolDeclAccess().getParametersParameterDeclParserRuleCall_3_2_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__ParametersAssignment_3_2_1" - - - // $ANTLR start "rule__GlobalProtocolDecl__RolesAssignment_5" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10839:1: rule__GlobalProtocolDecl__RolesAssignment_5 : ( ruleRoleDecl ) ; - public final void rule__GlobalProtocolDecl__RolesAssignment_5() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10843:1: ( ( ruleRoleDecl ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10844:1: ( ruleRoleDecl ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10844:1: ( ruleRoleDecl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10845:1: ruleRoleDecl - { - before(grammarAccess.getGlobalProtocolDeclAccess().getRolesRoleDeclParserRuleCall_5_0()); - pushFollow(FOLLOW_ruleRoleDecl_in_rule__GlobalProtocolDecl__RolesAssignment_521606); - ruleRoleDecl(); - - state._fsp--; - - after(grammarAccess.getGlobalProtocolDeclAccess().getRolesRoleDeclParserRuleCall_5_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__RolesAssignment_5" - - - // $ANTLR start "rule__GlobalProtocolDecl__RolesAssignment_6_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10854:1: rule__GlobalProtocolDecl__RolesAssignment_6_1 : ( ruleRoleDecl ) ; - public final void rule__GlobalProtocolDecl__RolesAssignment_6_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10858:1: ( ( ruleRoleDecl ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10859:1: ( ruleRoleDecl ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10859:1: ( ruleRoleDecl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10860:1: ruleRoleDecl - { - before(grammarAccess.getGlobalProtocolDeclAccess().getRolesRoleDeclParserRuleCall_6_1_0()); - pushFollow(FOLLOW_ruleRoleDecl_in_rule__GlobalProtocolDecl__RolesAssignment_6_121637); - ruleRoleDecl(); - - state._fsp--; - - after(grammarAccess.getGlobalProtocolDeclAccess().getRolesRoleDeclParserRuleCall_6_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__RolesAssignment_6_1" - - - // $ANTLR start "rule__GlobalProtocolDecl__BlockAssignment_8_0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10869:1: rule__GlobalProtocolDecl__BlockAssignment_8_0 : ( ruleGlobalProtocolBlock ) ; - public final void rule__GlobalProtocolDecl__BlockAssignment_8_0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10873:1: ( ( ruleGlobalProtocolBlock ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10874:1: ( ruleGlobalProtocolBlock ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10874:1: ( ruleGlobalProtocolBlock ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10875:1: ruleGlobalProtocolBlock - { - before(grammarAccess.getGlobalProtocolDeclAccess().getBlockGlobalProtocolBlockParserRuleCall_8_0_0()); - pushFollow(FOLLOW_ruleGlobalProtocolBlock_in_rule__GlobalProtocolDecl__BlockAssignment_8_021668); - ruleGlobalProtocolBlock(); - - state._fsp--; - - after(grammarAccess.getGlobalProtocolDeclAccess().getBlockGlobalProtocolBlockParserRuleCall_8_0_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__BlockAssignment_8_0" - - - // $ANTLR start "rule__GlobalProtocolDecl__InstantiatesAssignment_8_1_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10884:1: rule__GlobalProtocolDecl__InstantiatesAssignment_8_1_1 : ( RULE_ID ) ; - public final void rule__GlobalProtocolDecl__InstantiatesAssignment_8_1_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10888:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10889:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10889:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10890:1: RULE_ID - { - before(grammarAccess.getGlobalProtocolDeclAccess().getInstantiatesIDTerminalRuleCall_8_1_1_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__GlobalProtocolDecl__InstantiatesAssignment_8_1_121699); - after(grammarAccess.getGlobalProtocolDeclAccess().getInstantiatesIDTerminalRuleCall_8_1_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__InstantiatesAssignment_8_1_1" - - - // $ANTLR start "rule__GlobalProtocolDecl__ArgumentsAssignment_8_1_2_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10899:1: rule__GlobalProtocolDecl__ArgumentsAssignment_8_1_2_1 : ( ruleArgument ) ; - public final void rule__GlobalProtocolDecl__ArgumentsAssignment_8_1_2_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10903:1: ( ( ruleArgument ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10904:1: ( ruleArgument ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10904:1: ( ruleArgument ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10905:1: ruleArgument - { - before(grammarAccess.getGlobalProtocolDeclAccess().getArgumentsArgumentParserRuleCall_8_1_2_1_0()); - pushFollow(FOLLOW_ruleArgument_in_rule__GlobalProtocolDecl__ArgumentsAssignment_8_1_2_121730); - ruleArgument(); - - state._fsp--; - - after(grammarAccess.getGlobalProtocolDeclAccess().getArgumentsArgumentParserRuleCall_8_1_2_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__ArgumentsAssignment_8_1_2_1" - - - // $ANTLR start "rule__GlobalProtocolDecl__ArgumentsAssignment_8_1_2_2_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10914:1: rule__GlobalProtocolDecl__ArgumentsAssignment_8_1_2_2_1 : ( ruleArgument ) ; - public final void rule__GlobalProtocolDecl__ArgumentsAssignment_8_1_2_2_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10918:1: ( ( ruleArgument ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10919:1: ( ruleArgument ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10919:1: ( ruleArgument ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10920:1: ruleArgument - { - before(grammarAccess.getGlobalProtocolDeclAccess().getArgumentsArgumentParserRuleCall_8_1_2_2_1_0()); - pushFollow(FOLLOW_ruleArgument_in_rule__GlobalProtocolDecl__ArgumentsAssignment_8_1_2_2_121761); - ruleArgument(); - - state._fsp--; - - after(grammarAccess.getGlobalProtocolDeclAccess().getArgumentsArgumentParserRuleCall_8_1_2_2_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__ArgumentsAssignment_8_1_2_2_1" - - - // $ANTLR start "rule__GlobalProtocolDecl__RoleInstantiationsAssignment_8_1_4" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10929:1: rule__GlobalProtocolDecl__RoleInstantiationsAssignment_8_1_4 : ( ruleRoleInstantiation ) ; - public final void rule__GlobalProtocolDecl__RoleInstantiationsAssignment_8_1_4() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10933:1: ( ( ruleRoleInstantiation ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10934:1: ( ruleRoleInstantiation ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10934:1: ( ruleRoleInstantiation ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10935:1: ruleRoleInstantiation - { - before(grammarAccess.getGlobalProtocolDeclAccess().getRoleInstantiationsRoleInstantiationParserRuleCall_8_1_4_0()); - pushFollow(FOLLOW_ruleRoleInstantiation_in_rule__GlobalProtocolDecl__RoleInstantiationsAssignment_8_1_421792); - ruleRoleInstantiation(); - - state._fsp--; - - after(grammarAccess.getGlobalProtocolDeclAccess().getRoleInstantiationsRoleInstantiationParserRuleCall_8_1_4_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__RoleInstantiationsAssignment_8_1_4" - - - // $ANTLR start "rule__GlobalProtocolDecl__RoleInstantiationsAssignment_8_1_5_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10944:1: rule__GlobalProtocolDecl__RoleInstantiationsAssignment_8_1_5_1 : ( ruleRoleInstantiation ) ; - public final void rule__GlobalProtocolDecl__RoleInstantiationsAssignment_8_1_5_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10948:1: ( ( ruleRoleInstantiation ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10949:1: ( ruleRoleInstantiation ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10949:1: ( ruleRoleInstantiation ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10950:1: ruleRoleInstantiation - { - before(grammarAccess.getGlobalProtocolDeclAccess().getRoleInstantiationsRoleInstantiationParserRuleCall_8_1_5_1_0()); - pushFollow(FOLLOW_ruleRoleInstantiation_in_rule__GlobalProtocolDecl__RoleInstantiationsAssignment_8_1_5_121823); - ruleRoleInstantiation(); - - state._fsp--; - - after(grammarAccess.getGlobalProtocolDeclAccess().getRoleInstantiationsRoleInstantiationParserRuleCall_8_1_5_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolDecl__RoleInstantiationsAssignment_8_1_5_1" - - - // $ANTLR start "rule__RoleDecl__NameAssignment_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10959:1: rule__RoleDecl__NameAssignment_1 : ( RULE_ID ) ; - public final void rule__RoleDecl__NameAssignment_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10963:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10964:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10964:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10965:1: RULE_ID - { - before(grammarAccess.getRoleDeclAccess().getNameIDTerminalRuleCall_1_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__RoleDecl__NameAssignment_121854); - after(grammarAccess.getRoleDeclAccess().getNameIDTerminalRuleCall_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__RoleDecl__NameAssignment_1" - - - // $ANTLR start "rule__RoleDecl__AliasAssignment_2_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10974:1: rule__RoleDecl__AliasAssignment_2_1 : ( RULE_ID ) ; - public final void rule__RoleDecl__AliasAssignment_2_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10978:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10979:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10979:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10980:1: RULE_ID - { - before(grammarAccess.getRoleDeclAccess().getAliasIDTerminalRuleCall_2_1_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__RoleDecl__AliasAssignment_2_121885); - after(grammarAccess.getRoleDeclAccess().getAliasIDTerminalRuleCall_2_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__RoleDecl__AliasAssignment_2_1" - - - // $ANTLR start "rule__ParameterDecl__NameAssignment_0_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10989:1: rule__ParameterDecl__NameAssignment_0_1 : ( RULE_ID ) ; - public final void rule__ParameterDecl__NameAssignment_0_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10993:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10994:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10994:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:10995:1: RULE_ID - { - before(grammarAccess.getParameterDeclAccess().getNameIDTerminalRuleCall_0_1_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__ParameterDecl__NameAssignment_0_121916); - after(grammarAccess.getParameterDeclAccess().getNameIDTerminalRuleCall_0_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ParameterDecl__NameAssignment_0_1" - - - // $ANTLR start "rule__ParameterDecl__AliasAssignment_0_2_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11004:1: rule__ParameterDecl__AliasAssignment_0_2_1 : ( RULE_ID ) ; - public final void rule__ParameterDecl__AliasAssignment_0_2_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11008:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11009:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11009:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11010:1: RULE_ID - { - before(grammarAccess.getParameterDeclAccess().getAliasIDTerminalRuleCall_0_2_1_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__ParameterDecl__AliasAssignment_0_2_121947); - after(grammarAccess.getParameterDeclAccess().getAliasIDTerminalRuleCall_0_2_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ParameterDecl__AliasAssignment_0_2_1" - - - // $ANTLR start "rule__ParameterDecl__NameAssignment_1_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11019:1: rule__ParameterDecl__NameAssignment_1_1 : ( RULE_ID ) ; - public final void rule__ParameterDecl__NameAssignment_1_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11023:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11024:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11024:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11025:1: RULE_ID - { - before(grammarAccess.getParameterDeclAccess().getNameIDTerminalRuleCall_1_1_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__ParameterDecl__NameAssignment_1_121978); - after(grammarAccess.getParameterDeclAccess().getNameIDTerminalRuleCall_1_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ParameterDecl__NameAssignment_1_1" - - - // $ANTLR start "rule__ParameterDecl__AliasAssignment_1_2_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11034:1: rule__ParameterDecl__AliasAssignment_1_2_1 : ( RULE_ID ) ; - public final void rule__ParameterDecl__AliasAssignment_1_2_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11038:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11039:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11039:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11040:1: RULE_ID - { - before(grammarAccess.getParameterDeclAccess().getAliasIDTerminalRuleCall_1_2_1_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__ParameterDecl__AliasAssignment_1_2_122009); - after(grammarAccess.getParameterDeclAccess().getAliasIDTerminalRuleCall_1_2_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__ParameterDecl__AliasAssignment_1_2_1" - - - // $ANTLR start "rule__RoleInstantiation__NameAssignment_0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11049:1: rule__RoleInstantiation__NameAssignment_0 : ( RULE_ID ) ; - public final void rule__RoleInstantiation__NameAssignment_0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11053:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11054:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11054:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11055:1: RULE_ID - { - before(grammarAccess.getRoleInstantiationAccess().getNameIDTerminalRuleCall_0_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__RoleInstantiation__NameAssignment_022040); - after(grammarAccess.getRoleInstantiationAccess().getNameIDTerminalRuleCall_0_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__RoleInstantiation__NameAssignment_0" - - - // $ANTLR start "rule__RoleInstantiation__AliasAssignment_1_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11064:1: rule__RoleInstantiation__AliasAssignment_1_1 : ( RULE_ID ) ; - public final void rule__RoleInstantiation__AliasAssignment_1_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11068:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11069:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11069:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11070:1: RULE_ID - { - before(grammarAccess.getRoleInstantiationAccess().getAliasIDTerminalRuleCall_1_1_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__RoleInstantiation__AliasAssignment_1_122071); - after(grammarAccess.getRoleInstantiationAccess().getAliasIDTerminalRuleCall_1_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__RoleInstantiation__AliasAssignment_1_1" - - - // $ANTLR start "rule__Argument__SignatureAssignment_0_0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11079:1: rule__Argument__SignatureAssignment_0_0 : ( ruleMessageSignature ) ; - public final void rule__Argument__SignatureAssignment_0_0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11083:1: ( ( ruleMessageSignature ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11084:1: ( ruleMessageSignature ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11084:1: ( ruleMessageSignature ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11085:1: ruleMessageSignature - { - before(grammarAccess.getArgumentAccess().getSignatureMessageSignatureParserRuleCall_0_0_0()); - pushFollow(FOLLOW_ruleMessageSignature_in_rule__Argument__SignatureAssignment_0_022102); - ruleMessageSignature(); - - state._fsp--; - - after(grammarAccess.getArgumentAccess().getSignatureMessageSignatureParserRuleCall_0_0_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Argument__SignatureAssignment_0_0" - - - // $ANTLR start "rule__Argument__AliasAssignment_0_1_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11094:1: rule__Argument__AliasAssignment_0_1_1 : ( RULE_ID ) ; - public final void rule__Argument__AliasAssignment_0_1_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11098:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11099:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11099:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11100:1: RULE_ID - { - before(grammarAccess.getArgumentAccess().getAliasIDTerminalRuleCall_0_1_1_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__Argument__AliasAssignment_0_1_122133); - after(grammarAccess.getArgumentAccess().getAliasIDTerminalRuleCall_0_1_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Argument__AliasAssignment_0_1_1" - - - // $ANTLR start "rule__Argument__NameAssignment_1_0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11109:1: rule__Argument__NameAssignment_1_0 : ( RULE_ID ) ; - public final void rule__Argument__NameAssignment_1_0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11113:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11114:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11114:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11115:1: RULE_ID - { - before(grammarAccess.getArgumentAccess().getNameIDTerminalRuleCall_1_0_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__Argument__NameAssignment_1_022164); - after(grammarAccess.getArgumentAccess().getNameIDTerminalRuleCall_1_0_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Argument__NameAssignment_1_0" - - - // $ANTLR start "rule__Argument__AliasAssignment_1_1_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11124:1: rule__Argument__AliasAssignment_1_1_1 : ( RULE_ID ) ; - public final void rule__Argument__AliasAssignment_1_1_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11128:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11129:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11129:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11130:1: RULE_ID - { - before(grammarAccess.getArgumentAccess().getAliasIDTerminalRuleCall_1_1_1_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__Argument__AliasAssignment_1_1_122195); - after(grammarAccess.getArgumentAccess().getAliasIDTerminalRuleCall_1_1_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Argument__AliasAssignment_1_1_1" - - - // $ANTLR start "rule__GlobalProtocolBlock__ActivitiesAssignment_2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11139:1: rule__GlobalProtocolBlock__ActivitiesAssignment_2 : ( ruleGlobalInteraction ) ; - public final void rule__GlobalProtocolBlock__ActivitiesAssignment_2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11143:1: ( ( ruleGlobalInteraction ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11144:1: ( ruleGlobalInteraction ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11144:1: ( ruleGlobalInteraction ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11145:1: ruleGlobalInteraction - { - before(grammarAccess.getGlobalProtocolBlockAccess().getActivitiesGlobalInteractionParserRuleCall_2_0()); - pushFollow(FOLLOW_ruleGlobalInteraction_in_rule__GlobalProtocolBlock__ActivitiesAssignment_222226); - ruleGlobalInteraction(); - - state._fsp--; - - after(grammarAccess.getGlobalProtocolBlockAccess().getActivitiesGlobalInteractionParserRuleCall_2_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalProtocolBlock__ActivitiesAssignment_2" - - - // $ANTLR start "rule__GlobalMessageTransfer__MessageAssignment_0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11154:1: rule__GlobalMessageTransfer__MessageAssignment_0 : ( ruleMessage ) ; - public final void rule__GlobalMessageTransfer__MessageAssignment_0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11158:1: ( ( ruleMessage ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11159:1: ( ruleMessage ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11159:1: ( ruleMessage ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11160:1: ruleMessage - { - before(grammarAccess.getGlobalMessageTransferAccess().getMessageMessageParserRuleCall_0_0()); - pushFollow(FOLLOW_ruleMessage_in_rule__GlobalMessageTransfer__MessageAssignment_022257); - ruleMessage(); - - state._fsp--; - - after(grammarAccess.getGlobalMessageTransferAccess().getMessageMessageParserRuleCall_0_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalMessageTransfer__MessageAssignment_0" - - - // $ANTLR start "rule__GlobalMessageTransfer__FromRoleAssignment_2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11169:1: rule__GlobalMessageTransfer__FromRoleAssignment_2 : ( RULE_ID ) ; - public final void rule__GlobalMessageTransfer__FromRoleAssignment_2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11173:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11174:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11174:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11175:1: RULE_ID - { - before(grammarAccess.getGlobalMessageTransferAccess().getFromRoleIDTerminalRuleCall_2_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__GlobalMessageTransfer__FromRoleAssignment_222288); - after(grammarAccess.getGlobalMessageTransferAccess().getFromRoleIDTerminalRuleCall_2_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalMessageTransfer__FromRoleAssignment_2" - - - // $ANTLR start "rule__GlobalMessageTransfer__ToRolesAssignment_4" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11184:1: rule__GlobalMessageTransfer__ToRolesAssignment_4 : ( RULE_ID ) ; - public final void rule__GlobalMessageTransfer__ToRolesAssignment_4() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11188:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11189:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11189:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11190:1: RULE_ID - { - before(grammarAccess.getGlobalMessageTransferAccess().getToRolesIDTerminalRuleCall_4_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__GlobalMessageTransfer__ToRolesAssignment_422319); - after(grammarAccess.getGlobalMessageTransferAccess().getToRolesIDTerminalRuleCall_4_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalMessageTransfer__ToRolesAssignment_4" - - - // $ANTLR start "rule__GlobalMessageTransfer__ToRolesAssignment_5_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11199:1: rule__GlobalMessageTransfer__ToRolesAssignment_5_1 : ( RULE_ID ) ; - public final void rule__GlobalMessageTransfer__ToRolesAssignment_5_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11203:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11204:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11204:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11205:1: RULE_ID - { - before(grammarAccess.getGlobalMessageTransferAccess().getToRolesIDTerminalRuleCall_5_1_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__GlobalMessageTransfer__ToRolesAssignment_5_122350); - after(grammarAccess.getGlobalMessageTransferAccess().getToRolesIDTerminalRuleCall_5_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalMessageTransfer__ToRolesAssignment_5_1" - - - // $ANTLR start "rule__Message__SignatureAssignment_0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11214:1: rule__Message__SignatureAssignment_0 : ( ruleMessageSignature ) ; - public final void rule__Message__SignatureAssignment_0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11218:1: ( ( ruleMessageSignature ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11219:1: ( ruleMessageSignature ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11219:1: ( ruleMessageSignature ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11220:1: ruleMessageSignature - { - before(grammarAccess.getMessageAccess().getSignatureMessageSignatureParserRuleCall_0_0()); - pushFollow(FOLLOW_ruleMessageSignature_in_rule__Message__SignatureAssignment_022381); - ruleMessageSignature(); - - state._fsp--; - - after(grammarAccess.getMessageAccess().getSignatureMessageSignatureParserRuleCall_0_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Message__SignatureAssignment_0" - - - // $ANTLR start "rule__Message__ParameterAssignment_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11229:1: rule__Message__ParameterAssignment_1 : ( RULE_ID ) ; - public final void rule__Message__ParameterAssignment_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11233:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11234:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11234:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11235:1: RULE_ID - { - before(grammarAccess.getMessageAccess().getParameterIDTerminalRuleCall_1_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__Message__ParameterAssignment_122412); - after(grammarAccess.getMessageAccess().getParameterIDTerminalRuleCall_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Message__ParameterAssignment_1" - - - // $ANTLR start "rule__GlobalChoice__RoleAssignment_2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11244:1: rule__GlobalChoice__RoleAssignment_2 : ( RULE_ID ) ; - public final void rule__GlobalChoice__RoleAssignment_2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11248:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11249:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11249:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11250:1: RULE_ID - { - before(grammarAccess.getGlobalChoiceAccess().getRoleIDTerminalRuleCall_2_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__GlobalChoice__RoleAssignment_222443); - after(grammarAccess.getGlobalChoiceAccess().getRoleIDTerminalRuleCall_2_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalChoice__RoleAssignment_2" - - - // $ANTLR start "rule__GlobalChoice__BlocksAssignment_3" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11259:1: rule__GlobalChoice__BlocksAssignment_3 : ( ruleGlobalProtocolBlock ) ; - public final void rule__GlobalChoice__BlocksAssignment_3() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11263:1: ( ( ruleGlobalProtocolBlock ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11264:1: ( ruleGlobalProtocolBlock ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11264:1: ( ruleGlobalProtocolBlock ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11265:1: ruleGlobalProtocolBlock - { - before(grammarAccess.getGlobalChoiceAccess().getBlocksGlobalProtocolBlockParserRuleCall_3_0()); - pushFollow(FOLLOW_ruleGlobalProtocolBlock_in_rule__GlobalChoice__BlocksAssignment_322474); - ruleGlobalProtocolBlock(); - - state._fsp--; - - after(grammarAccess.getGlobalChoiceAccess().getBlocksGlobalProtocolBlockParserRuleCall_3_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalChoice__BlocksAssignment_3" - - - // $ANTLR start "rule__GlobalChoice__BlocksAssignment_4_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11274:1: rule__GlobalChoice__BlocksAssignment_4_1 : ( ruleGlobalProtocolBlock ) ; - public final void rule__GlobalChoice__BlocksAssignment_4_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11278:1: ( ( ruleGlobalProtocolBlock ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11279:1: ( ruleGlobalProtocolBlock ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11279:1: ( ruleGlobalProtocolBlock ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11280:1: ruleGlobalProtocolBlock - { - before(grammarAccess.getGlobalChoiceAccess().getBlocksGlobalProtocolBlockParserRuleCall_4_1_0()); - pushFollow(FOLLOW_ruleGlobalProtocolBlock_in_rule__GlobalChoice__BlocksAssignment_4_122505); - ruleGlobalProtocolBlock(); - - state._fsp--; - - after(grammarAccess.getGlobalChoiceAccess().getBlocksGlobalProtocolBlockParserRuleCall_4_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalChoice__BlocksAssignment_4_1" - - - // $ANTLR start "rule__GlobalRecursion__LabelAssignment_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11289:1: rule__GlobalRecursion__LabelAssignment_1 : ( RULE_ID ) ; - public final void rule__GlobalRecursion__LabelAssignment_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11293:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11294:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11294:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11295:1: RULE_ID - { - before(grammarAccess.getGlobalRecursionAccess().getLabelIDTerminalRuleCall_1_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__GlobalRecursion__LabelAssignment_122536); - after(grammarAccess.getGlobalRecursionAccess().getLabelIDTerminalRuleCall_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalRecursion__LabelAssignment_1" - - - // $ANTLR start "rule__GlobalRecursion__BlockAssignment_2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11304:1: rule__GlobalRecursion__BlockAssignment_2 : ( ruleGlobalProtocolBlock ) ; - public final void rule__GlobalRecursion__BlockAssignment_2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11308:1: ( ( ruleGlobalProtocolBlock ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11309:1: ( ruleGlobalProtocolBlock ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11309:1: ( ruleGlobalProtocolBlock ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11310:1: ruleGlobalProtocolBlock - { - before(grammarAccess.getGlobalRecursionAccess().getBlockGlobalProtocolBlockParserRuleCall_2_0()); - pushFollow(FOLLOW_ruleGlobalProtocolBlock_in_rule__GlobalRecursion__BlockAssignment_222567); - ruleGlobalProtocolBlock(); - - state._fsp--; - - after(grammarAccess.getGlobalRecursionAccess().getBlockGlobalProtocolBlockParserRuleCall_2_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalRecursion__BlockAssignment_2" - - - // $ANTLR start "rule__GlobalContinue__LabelAssignment_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11319:1: rule__GlobalContinue__LabelAssignment_1 : ( RULE_ID ) ; - public final void rule__GlobalContinue__LabelAssignment_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11323:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11324:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11324:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11325:1: RULE_ID - { - before(grammarAccess.getGlobalContinueAccess().getLabelIDTerminalRuleCall_1_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__GlobalContinue__LabelAssignment_122598); - after(grammarAccess.getGlobalContinueAccess().getLabelIDTerminalRuleCall_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalContinue__LabelAssignment_1" - - - // $ANTLR start "rule__GlobalParallel__BlocksAssignment_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11334:1: rule__GlobalParallel__BlocksAssignment_1 : ( ruleGlobalProtocolBlock ) ; - public final void rule__GlobalParallel__BlocksAssignment_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11338:1: ( ( ruleGlobalProtocolBlock ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11339:1: ( ruleGlobalProtocolBlock ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11339:1: ( ruleGlobalProtocolBlock ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11340:1: ruleGlobalProtocolBlock - { - before(grammarAccess.getGlobalParallelAccess().getBlocksGlobalProtocolBlockParserRuleCall_1_0()); - pushFollow(FOLLOW_ruleGlobalProtocolBlock_in_rule__GlobalParallel__BlocksAssignment_122629); - ruleGlobalProtocolBlock(); - - state._fsp--; - - after(grammarAccess.getGlobalParallelAccess().getBlocksGlobalProtocolBlockParserRuleCall_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalParallel__BlocksAssignment_1" - - - // $ANTLR start "rule__GlobalParallel__BlocksAssignment_2_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11349:1: rule__GlobalParallel__BlocksAssignment_2_1 : ( ruleGlobalProtocolBlock ) ; - public final void rule__GlobalParallel__BlocksAssignment_2_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11353:1: ( ( ruleGlobalProtocolBlock ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11354:1: ( ruleGlobalProtocolBlock ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11354:1: ( ruleGlobalProtocolBlock ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11355:1: ruleGlobalProtocolBlock - { - before(grammarAccess.getGlobalParallelAccess().getBlocksGlobalProtocolBlockParserRuleCall_2_1_0()); - pushFollow(FOLLOW_ruleGlobalProtocolBlock_in_rule__GlobalParallel__BlocksAssignment_2_122660); - ruleGlobalProtocolBlock(); - - state._fsp--; - - after(grammarAccess.getGlobalParallelAccess().getBlocksGlobalProtocolBlockParserRuleCall_2_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalParallel__BlocksAssignment_2_1" - - - // $ANTLR start "rule__GlobalInterruptible__ScopeAssignment_1_0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11364:1: rule__GlobalInterruptible__ScopeAssignment_1_0 : ( RULE_ID ) ; - public final void rule__GlobalInterruptible__ScopeAssignment_1_0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11368:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11369:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11369:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11370:1: RULE_ID - { - before(grammarAccess.getGlobalInterruptibleAccess().getScopeIDTerminalRuleCall_1_0_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__GlobalInterruptible__ScopeAssignment_1_022691); - after(grammarAccess.getGlobalInterruptibleAccess().getScopeIDTerminalRuleCall_1_0_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalInterruptible__ScopeAssignment_1_0" - - - // $ANTLR start "rule__GlobalInterruptible__BlockAssignment_2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11379:1: rule__GlobalInterruptible__BlockAssignment_2 : ( ruleGlobalProtocolBlock ) ; - public final void rule__GlobalInterruptible__BlockAssignment_2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11383:1: ( ( ruleGlobalProtocolBlock ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11384:1: ( ruleGlobalProtocolBlock ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11384:1: ( ruleGlobalProtocolBlock ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11385:1: ruleGlobalProtocolBlock - { - before(grammarAccess.getGlobalInterruptibleAccess().getBlockGlobalProtocolBlockParserRuleCall_2_0()); - pushFollow(FOLLOW_ruleGlobalProtocolBlock_in_rule__GlobalInterruptible__BlockAssignment_222722); - ruleGlobalProtocolBlock(); - - state._fsp--; - - after(grammarAccess.getGlobalInterruptibleAccess().getBlockGlobalProtocolBlockParserRuleCall_2_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalInterruptible__BlockAssignment_2" - - - // $ANTLR start "rule__GlobalInterruptible__InterruptsAssignment_5" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11394:1: rule__GlobalInterruptible__InterruptsAssignment_5 : ( ruleGlobalInterrupt ) ; - public final void rule__GlobalInterruptible__InterruptsAssignment_5() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11398:1: ( ( ruleGlobalInterrupt ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11399:1: ( ruleGlobalInterrupt ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11399:1: ( ruleGlobalInterrupt ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11400:1: ruleGlobalInterrupt - { - before(grammarAccess.getGlobalInterruptibleAccess().getInterruptsGlobalInterruptParserRuleCall_5_0()); - pushFollow(FOLLOW_ruleGlobalInterrupt_in_rule__GlobalInterruptible__InterruptsAssignment_522753); - ruleGlobalInterrupt(); - - state._fsp--; - - after(grammarAccess.getGlobalInterruptibleAccess().getInterruptsGlobalInterruptParserRuleCall_5_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalInterruptible__InterruptsAssignment_5" - - - // $ANTLR start "rule__GlobalInterrupt__MessagesAssignment_0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11409:1: rule__GlobalInterrupt__MessagesAssignment_0 : ( ruleMessage ) ; - public final void rule__GlobalInterrupt__MessagesAssignment_0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11413:1: ( ( ruleMessage ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11414:1: ( ruleMessage ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11414:1: ( ruleMessage ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11415:1: ruleMessage - { - before(grammarAccess.getGlobalInterruptAccess().getMessagesMessageParserRuleCall_0_0()); - pushFollow(FOLLOW_ruleMessage_in_rule__GlobalInterrupt__MessagesAssignment_022784); - ruleMessage(); - - state._fsp--; - - after(grammarAccess.getGlobalInterruptAccess().getMessagesMessageParserRuleCall_0_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalInterrupt__MessagesAssignment_0" - - - // $ANTLR start "rule__GlobalInterrupt__MessagesAssignment_1_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11424:1: rule__GlobalInterrupt__MessagesAssignment_1_1 : ( ruleMessage ) ; - public final void rule__GlobalInterrupt__MessagesAssignment_1_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11428:1: ( ( ruleMessage ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11429:1: ( ruleMessage ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11429:1: ( ruleMessage ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11430:1: ruleMessage - { - before(grammarAccess.getGlobalInterruptAccess().getMessagesMessageParserRuleCall_1_1_0()); - pushFollow(FOLLOW_ruleMessage_in_rule__GlobalInterrupt__MessagesAssignment_1_122815); - ruleMessage(); - - state._fsp--; - - after(grammarAccess.getGlobalInterruptAccess().getMessagesMessageParserRuleCall_1_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalInterrupt__MessagesAssignment_1_1" - - - // $ANTLR start "rule__GlobalInterrupt__RoleAssignment_3" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11439:1: rule__GlobalInterrupt__RoleAssignment_3 : ( RULE_ID ) ; - public final void rule__GlobalInterrupt__RoleAssignment_3() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11443:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11444:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11444:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11445:1: RULE_ID - { - before(grammarAccess.getGlobalInterruptAccess().getRoleIDTerminalRuleCall_3_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__GlobalInterrupt__RoleAssignment_322846); - after(grammarAccess.getGlobalInterruptAccess().getRoleIDTerminalRuleCall_3_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalInterrupt__RoleAssignment_3" - - - // $ANTLR start "rule__GlobalDo__ScopeAssignment_1_0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11454:1: rule__GlobalDo__ScopeAssignment_1_0 : ( RULE_ID ) ; - public final void rule__GlobalDo__ScopeAssignment_1_0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11458:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11459:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11459:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11460:1: RULE_ID - { - before(grammarAccess.getGlobalDoAccess().getScopeIDTerminalRuleCall_1_0_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__GlobalDo__ScopeAssignment_1_022877); - after(grammarAccess.getGlobalDoAccess().getScopeIDTerminalRuleCall_1_0_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__ScopeAssignment_1_0" - - - // $ANTLR start "rule__GlobalDo__MemberAssignment_2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11469:1: rule__GlobalDo__MemberAssignment_2 : ( RULE_ID ) ; - public final void rule__GlobalDo__MemberAssignment_2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11473:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11474:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11474:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11475:1: RULE_ID - { - before(grammarAccess.getGlobalDoAccess().getMemberIDTerminalRuleCall_2_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__GlobalDo__MemberAssignment_222908); - after(grammarAccess.getGlobalDoAccess().getMemberIDTerminalRuleCall_2_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__MemberAssignment_2" - - - // $ANTLR start "rule__GlobalDo__ArgumentsAssignment_3_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11484:1: rule__GlobalDo__ArgumentsAssignment_3_1 : ( ruleArgument ) ; - public final void rule__GlobalDo__ArgumentsAssignment_3_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11488:1: ( ( ruleArgument ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11489:1: ( ruleArgument ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11489:1: ( ruleArgument ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11490:1: ruleArgument - { - before(grammarAccess.getGlobalDoAccess().getArgumentsArgumentParserRuleCall_3_1_0()); - pushFollow(FOLLOW_ruleArgument_in_rule__GlobalDo__ArgumentsAssignment_3_122939); - ruleArgument(); - - state._fsp--; - - after(grammarAccess.getGlobalDoAccess().getArgumentsArgumentParserRuleCall_3_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__ArgumentsAssignment_3_1" - - - // $ANTLR start "rule__GlobalDo__ArgumentsAssignment_3_2_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11499:1: rule__GlobalDo__ArgumentsAssignment_3_2_1 : ( ruleArgument ) ; - public final void rule__GlobalDo__ArgumentsAssignment_3_2_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11503:1: ( ( ruleArgument ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11504:1: ( ruleArgument ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11504:1: ( ruleArgument ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11505:1: ruleArgument - { - before(grammarAccess.getGlobalDoAccess().getArgumentsArgumentParserRuleCall_3_2_1_0()); - pushFollow(FOLLOW_ruleArgument_in_rule__GlobalDo__ArgumentsAssignment_3_2_122970); - ruleArgument(); - - state._fsp--; - - after(grammarAccess.getGlobalDoAccess().getArgumentsArgumentParserRuleCall_3_2_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__ArgumentsAssignment_3_2_1" - - - // $ANTLR start "rule__GlobalDo__RolesAssignment_5" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11514:1: rule__GlobalDo__RolesAssignment_5 : ( ruleRoleInstantiation ) ; - public final void rule__GlobalDo__RolesAssignment_5() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11518:1: ( ( ruleRoleInstantiation ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11519:1: ( ruleRoleInstantiation ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11519:1: ( ruleRoleInstantiation ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11520:1: ruleRoleInstantiation - { - before(grammarAccess.getGlobalDoAccess().getRolesRoleInstantiationParserRuleCall_5_0()); - pushFollow(FOLLOW_ruleRoleInstantiation_in_rule__GlobalDo__RolesAssignment_523001); - ruleRoleInstantiation(); - - state._fsp--; - - after(grammarAccess.getGlobalDoAccess().getRolesRoleInstantiationParserRuleCall_5_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__RolesAssignment_5" - - - // $ANTLR start "rule__GlobalDo__RolesAssignment_6_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11529:1: rule__GlobalDo__RolesAssignment_6_1 : ( ruleRoleInstantiation ) ; - public final void rule__GlobalDo__RolesAssignment_6_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11533:1: ( ( ruleRoleInstantiation ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11534:1: ( ruleRoleInstantiation ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11534:1: ( ruleRoleInstantiation ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11535:1: ruleRoleInstantiation - { - before(grammarAccess.getGlobalDoAccess().getRolesRoleInstantiationParserRuleCall_6_1_0()); - pushFollow(FOLLOW_ruleRoleInstantiation_in_rule__GlobalDo__RolesAssignment_6_123032); - ruleRoleInstantiation(); - - state._fsp--; - - after(grammarAccess.getGlobalDoAccess().getRolesRoleInstantiationParserRuleCall_6_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__GlobalDo__RolesAssignment_6_1" - - - // $ANTLR start "rule__LocalProtocolDecl__NameAssignment_2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11544:1: rule__LocalProtocolDecl__NameAssignment_2 : ( RULE_ID ) ; - public final void rule__LocalProtocolDecl__NameAssignment_2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11548:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11549:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11549:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11550:1: RULE_ID - { - before(grammarAccess.getLocalProtocolDeclAccess().getNameIDTerminalRuleCall_2_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__LocalProtocolDecl__NameAssignment_223063); - after(grammarAccess.getLocalProtocolDeclAccess().getNameIDTerminalRuleCall_2_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__NameAssignment_2" - - - // $ANTLR start "rule__LocalProtocolDecl__RoleAssignment_4" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11559:1: rule__LocalProtocolDecl__RoleAssignment_4 : ( RULE_ID ) ; - public final void rule__LocalProtocolDecl__RoleAssignment_4() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11563:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11564:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11564:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11565:1: RULE_ID - { - before(grammarAccess.getLocalProtocolDeclAccess().getRoleIDTerminalRuleCall_4_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__LocalProtocolDecl__RoleAssignment_423094); - after(grammarAccess.getLocalProtocolDeclAccess().getRoleIDTerminalRuleCall_4_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__RoleAssignment_4" - - - // $ANTLR start "rule__LocalProtocolDecl__ParametersAssignment_5_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11574:1: rule__LocalProtocolDecl__ParametersAssignment_5_1 : ( ruleParameterDecl ) ; - public final void rule__LocalProtocolDecl__ParametersAssignment_5_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11578:1: ( ( ruleParameterDecl ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11579:1: ( ruleParameterDecl ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11579:1: ( ruleParameterDecl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11580:1: ruleParameterDecl - { - before(grammarAccess.getLocalProtocolDeclAccess().getParametersParameterDeclParserRuleCall_5_1_0()); - pushFollow(FOLLOW_ruleParameterDecl_in_rule__LocalProtocolDecl__ParametersAssignment_5_123125); - ruleParameterDecl(); - - state._fsp--; - - after(grammarAccess.getLocalProtocolDeclAccess().getParametersParameterDeclParserRuleCall_5_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__ParametersAssignment_5_1" - - - // $ANTLR start "rule__LocalProtocolDecl__ParametersAssignment_5_2_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11589:1: rule__LocalProtocolDecl__ParametersAssignment_5_2_1 : ( ruleParameterDecl ) ; - public final void rule__LocalProtocolDecl__ParametersAssignment_5_2_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11593:1: ( ( ruleParameterDecl ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11594:1: ( ruleParameterDecl ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11594:1: ( ruleParameterDecl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11595:1: ruleParameterDecl - { - before(grammarAccess.getLocalProtocolDeclAccess().getParametersParameterDeclParserRuleCall_5_2_1_0()); - pushFollow(FOLLOW_ruleParameterDecl_in_rule__LocalProtocolDecl__ParametersAssignment_5_2_123156); - ruleParameterDecl(); - - state._fsp--; - - after(grammarAccess.getLocalProtocolDeclAccess().getParametersParameterDeclParserRuleCall_5_2_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__ParametersAssignment_5_2_1" - - - // $ANTLR start "rule__LocalProtocolDecl__RolesAssignment_7" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11604:1: rule__LocalProtocolDecl__RolesAssignment_7 : ( ruleRoleDecl ) ; - public final void rule__LocalProtocolDecl__RolesAssignment_7() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11608:1: ( ( ruleRoleDecl ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11609:1: ( ruleRoleDecl ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11609:1: ( ruleRoleDecl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11610:1: ruleRoleDecl - { - before(grammarAccess.getLocalProtocolDeclAccess().getRolesRoleDeclParserRuleCall_7_0()); - pushFollow(FOLLOW_ruleRoleDecl_in_rule__LocalProtocolDecl__RolesAssignment_723187); - ruleRoleDecl(); - - state._fsp--; - - after(grammarAccess.getLocalProtocolDeclAccess().getRolesRoleDeclParserRuleCall_7_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__RolesAssignment_7" - - - // $ANTLR start "rule__LocalProtocolDecl__RolesAssignment_8_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11619:1: rule__LocalProtocolDecl__RolesAssignment_8_1 : ( ruleRoleDecl ) ; - public final void rule__LocalProtocolDecl__RolesAssignment_8_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11623:1: ( ( ruleRoleDecl ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11624:1: ( ruleRoleDecl ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11624:1: ( ruleRoleDecl ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11625:1: ruleRoleDecl - { - before(grammarAccess.getLocalProtocolDeclAccess().getRolesRoleDeclParserRuleCall_8_1_0()); - pushFollow(FOLLOW_ruleRoleDecl_in_rule__LocalProtocolDecl__RolesAssignment_8_123218); - ruleRoleDecl(); - - state._fsp--; - - after(grammarAccess.getLocalProtocolDeclAccess().getRolesRoleDeclParserRuleCall_8_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__RolesAssignment_8_1" - - - // $ANTLR start "rule__LocalProtocolDecl__BlockAssignment_10_0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11634:1: rule__LocalProtocolDecl__BlockAssignment_10_0 : ( ruleLocalProtocolBlock ) ; - public final void rule__LocalProtocolDecl__BlockAssignment_10_0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11638:1: ( ( ruleLocalProtocolBlock ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11639:1: ( ruleLocalProtocolBlock ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11639:1: ( ruleLocalProtocolBlock ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11640:1: ruleLocalProtocolBlock - { - before(grammarAccess.getLocalProtocolDeclAccess().getBlockLocalProtocolBlockParserRuleCall_10_0_0()); - pushFollow(FOLLOW_ruleLocalProtocolBlock_in_rule__LocalProtocolDecl__BlockAssignment_10_023249); - ruleLocalProtocolBlock(); - - state._fsp--; - - after(grammarAccess.getLocalProtocolDeclAccess().getBlockLocalProtocolBlockParserRuleCall_10_0_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__BlockAssignment_10_0" - - - // $ANTLR start "rule__LocalProtocolDecl__InstantiatesAssignment_10_1_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11649:1: rule__LocalProtocolDecl__InstantiatesAssignment_10_1_1 : ( RULE_ID ) ; - public final void rule__LocalProtocolDecl__InstantiatesAssignment_10_1_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11653:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11654:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11654:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11655:1: RULE_ID - { - before(grammarAccess.getLocalProtocolDeclAccess().getInstantiatesIDTerminalRuleCall_10_1_1_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__LocalProtocolDecl__InstantiatesAssignment_10_1_123280); - after(grammarAccess.getLocalProtocolDeclAccess().getInstantiatesIDTerminalRuleCall_10_1_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__InstantiatesAssignment_10_1_1" - - - // $ANTLR start "rule__LocalProtocolDecl__ArgumentsAssignment_10_1_2_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11664:1: rule__LocalProtocolDecl__ArgumentsAssignment_10_1_2_1 : ( ruleArgument ) ; - public final void rule__LocalProtocolDecl__ArgumentsAssignment_10_1_2_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11668:1: ( ( ruleArgument ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11669:1: ( ruleArgument ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11669:1: ( ruleArgument ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11670:1: ruleArgument - { - before(grammarAccess.getLocalProtocolDeclAccess().getArgumentsArgumentParserRuleCall_10_1_2_1_0()); - pushFollow(FOLLOW_ruleArgument_in_rule__LocalProtocolDecl__ArgumentsAssignment_10_1_2_123311); - ruleArgument(); - - state._fsp--; - - after(grammarAccess.getLocalProtocolDeclAccess().getArgumentsArgumentParserRuleCall_10_1_2_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__ArgumentsAssignment_10_1_2_1" - - - // $ANTLR start "rule__LocalProtocolDecl__ArgumentsAssignment_10_1_2_2_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11679:1: rule__LocalProtocolDecl__ArgumentsAssignment_10_1_2_2_1 : ( ruleArgument ) ; - public final void rule__LocalProtocolDecl__ArgumentsAssignment_10_1_2_2_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11683:1: ( ( ruleArgument ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11684:1: ( ruleArgument ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11684:1: ( ruleArgument ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11685:1: ruleArgument - { - before(grammarAccess.getLocalProtocolDeclAccess().getArgumentsArgumentParserRuleCall_10_1_2_2_1_0()); - pushFollow(FOLLOW_ruleArgument_in_rule__LocalProtocolDecl__ArgumentsAssignment_10_1_2_2_123342); - ruleArgument(); - - state._fsp--; - - after(grammarAccess.getLocalProtocolDeclAccess().getArgumentsArgumentParserRuleCall_10_1_2_2_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__ArgumentsAssignment_10_1_2_2_1" - - - // $ANTLR start "rule__LocalProtocolDecl__RoleInstantiationsAssignment_10_1_4" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11694:1: rule__LocalProtocolDecl__RoleInstantiationsAssignment_10_1_4 : ( ruleRoleInstantiation ) ; - public final void rule__LocalProtocolDecl__RoleInstantiationsAssignment_10_1_4() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11698:1: ( ( ruleRoleInstantiation ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11699:1: ( ruleRoleInstantiation ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11699:1: ( ruleRoleInstantiation ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11700:1: ruleRoleInstantiation - { - before(grammarAccess.getLocalProtocolDeclAccess().getRoleInstantiationsRoleInstantiationParserRuleCall_10_1_4_0()); - pushFollow(FOLLOW_ruleRoleInstantiation_in_rule__LocalProtocolDecl__RoleInstantiationsAssignment_10_1_423373); - ruleRoleInstantiation(); - - state._fsp--; - - after(grammarAccess.getLocalProtocolDeclAccess().getRoleInstantiationsRoleInstantiationParserRuleCall_10_1_4_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__RoleInstantiationsAssignment_10_1_4" - - - // $ANTLR start "rule__LocalProtocolDecl__RoleInstantiationsAssignment_10_1_5_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11709:1: rule__LocalProtocolDecl__RoleInstantiationsAssignment_10_1_5_1 : ( ruleRoleInstantiation ) ; - public final void rule__LocalProtocolDecl__RoleInstantiationsAssignment_10_1_5_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11713:1: ( ( ruleRoleInstantiation ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11714:1: ( ruleRoleInstantiation ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11714:1: ( ruleRoleInstantiation ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11715:1: ruleRoleInstantiation - { - before(grammarAccess.getLocalProtocolDeclAccess().getRoleInstantiationsRoleInstantiationParserRuleCall_10_1_5_1_0()); - pushFollow(FOLLOW_ruleRoleInstantiation_in_rule__LocalProtocolDecl__RoleInstantiationsAssignment_10_1_5_123404); - ruleRoleInstantiation(); - - state._fsp--; - - after(grammarAccess.getLocalProtocolDeclAccess().getRoleInstantiationsRoleInstantiationParserRuleCall_10_1_5_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolDecl__RoleInstantiationsAssignment_10_1_5_1" - - - // $ANTLR start "rule__LocalProtocolBlock__ActivitiesAssignment_2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11724:1: rule__LocalProtocolBlock__ActivitiesAssignment_2 : ( ruleLlobalInteraction ) ; - public final void rule__LocalProtocolBlock__ActivitiesAssignment_2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11728:1: ( ( ruleLlobalInteraction ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11729:1: ( ruleLlobalInteraction ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11729:1: ( ruleLlobalInteraction ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11730:1: ruleLlobalInteraction - { - before(grammarAccess.getLocalProtocolBlockAccess().getActivitiesLlobalInteractionParserRuleCall_2_0()); - pushFollow(FOLLOW_ruleLlobalInteraction_in_rule__LocalProtocolBlock__ActivitiesAssignment_223435); - ruleLlobalInteraction(); - - state._fsp--; - - after(grammarAccess.getLocalProtocolBlockAccess().getActivitiesLlobalInteractionParserRuleCall_2_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalProtocolBlock__ActivitiesAssignment_2" - - - // $ANTLR start "rule__LocalSend__MessageAssignment_0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11739:1: rule__LocalSend__MessageAssignment_0 : ( ruleMessage ) ; - public final void rule__LocalSend__MessageAssignment_0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11743:1: ( ( ruleMessage ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11744:1: ( ruleMessage ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11744:1: ( ruleMessage ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11745:1: ruleMessage - { - before(grammarAccess.getLocalSendAccess().getMessageMessageParserRuleCall_0_0()); - pushFollow(FOLLOW_ruleMessage_in_rule__LocalSend__MessageAssignment_023466); - ruleMessage(); - - state._fsp--; - - after(grammarAccess.getLocalSendAccess().getMessageMessageParserRuleCall_0_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalSend__MessageAssignment_0" - - - // $ANTLR start "rule__LocalSend__ToRolesAssignment_2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11754:1: rule__LocalSend__ToRolesAssignment_2 : ( RULE_ID ) ; - public final void rule__LocalSend__ToRolesAssignment_2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11758:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11759:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11759:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11760:1: RULE_ID - { - before(grammarAccess.getLocalSendAccess().getToRolesIDTerminalRuleCall_2_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__LocalSend__ToRolesAssignment_223497); - after(grammarAccess.getLocalSendAccess().getToRolesIDTerminalRuleCall_2_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalSend__ToRolesAssignment_2" - - - // $ANTLR start "rule__LocalSend__ToRolesAssignment_3_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11769:1: rule__LocalSend__ToRolesAssignment_3_1 : ( RULE_ID ) ; - public final void rule__LocalSend__ToRolesAssignment_3_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11773:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11774:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11774:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11775:1: RULE_ID - { - before(grammarAccess.getLocalSendAccess().getToRolesIDTerminalRuleCall_3_1_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__LocalSend__ToRolesAssignment_3_123528); - after(grammarAccess.getLocalSendAccess().getToRolesIDTerminalRuleCall_3_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalSend__ToRolesAssignment_3_1" - - - // $ANTLR start "rule__LocalReceive__MessageAssignment_0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11784:1: rule__LocalReceive__MessageAssignment_0 : ( ruleMessage ) ; - public final void rule__LocalReceive__MessageAssignment_0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11788:1: ( ( ruleMessage ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11789:1: ( ruleMessage ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11789:1: ( ruleMessage ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11790:1: ruleMessage - { - before(grammarAccess.getLocalReceiveAccess().getMessageMessageParserRuleCall_0_0()); - pushFollow(FOLLOW_ruleMessage_in_rule__LocalReceive__MessageAssignment_023559); - ruleMessage(); - - state._fsp--; - - after(grammarAccess.getLocalReceiveAccess().getMessageMessageParserRuleCall_0_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalReceive__MessageAssignment_0" - - - // $ANTLR start "rule__LocalReceive__FromRoleAssignment_2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11799:1: rule__LocalReceive__FromRoleAssignment_2 : ( RULE_ID ) ; - public final void rule__LocalReceive__FromRoleAssignment_2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11803:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11804:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11804:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11805:1: RULE_ID - { - before(grammarAccess.getLocalReceiveAccess().getFromRoleIDTerminalRuleCall_2_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__LocalReceive__FromRoleAssignment_223590); - after(grammarAccess.getLocalReceiveAccess().getFromRoleIDTerminalRuleCall_2_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalReceive__FromRoleAssignment_2" - - - // $ANTLR start "rule__LocalChoice__RoleAssignment_2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11814:1: rule__LocalChoice__RoleAssignment_2 : ( RULE_ID ) ; - public final void rule__LocalChoice__RoleAssignment_2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11818:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11819:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11819:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11820:1: RULE_ID - { - before(grammarAccess.getLocalChoiceAccess().getRoleIDTerminalRuleCall_2_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__LocalChoice__RoleAssignment_223621); - after(grammarAccess.getLocalChoiceAccess().getRoleIDTerminalRuleCall_2_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalChoice__RoleAssignment_2" - - - // $ANTLR start "rule__LocalChoice__BlocksAssignment_3" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11829:1: rule__LocalChoice__BlocksAssignment_3 : ( ruleLocalProtocolBlock ) ; - public final void rule__LocalChoice__BlocksAssignment_3() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11833:1: ( ( ruleLocalProtocolBlock ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11834:1: ( ruleLocalProtocolBlock ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11834:1: ( ruleLocalProtocolBlock ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11835:1: ruleLocalProtocolBlock - { - before(grammarAccess.getLocalChoiceAccess().getBlocksLocalProtocolBlockParserRuleCall_3_0()); - pushFollow(FOLLOW_ruleLocalProtocolBlock_in_rule__LocalChoice__BlocksAssignment_323652); - ruleLocalProtocolBlock(); - - state._fsp--; - - after(grammarAccess.getLocalChoiceAccess().getBlocksLocalProtocolBlockParserRuleCall_3_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalChoice__BlocksAssignment_3" - - - // $ANTLR start "rule__LocalChoice__BlocksAssignment_4_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11844:1: rule__LocalChoice__BlocksAssignment_4_1 : ( ruleLocalProtocolBlock ) ; - public final void rule__LocalChoice__BlocksAssignment_4_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11848:1: ( ( ruleLocalProtocolBlock ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11849:1: ( ruleLocalProtocolBlock ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11849:1: ( ruleLocalProtocolBlock ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11850:1: ruleLocalProtocolBlock - { - before(grammarAccess.getLocalChoiceAccess().getBlocksLocalProtocolBlockParserRuleCall_4_1_0()); - pushFollow(FOLLOW_ruleLocalProtocolBlock_in_rule__LocalChoice__BlocksAssignment_4_123683); - ruleLocalProtocolBlock(); - - state._fsp--; - - after(grammarAccess.getLocalChoiceAccess().getBlocksLocalProtocolBlockParserRuleCall_4_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalChoice__BlocksAssignment_4_1" - - - // $ANTLR start "rule__LocalRecursion__LabelAssignment_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11859:1: rule__LocalRecursion__LabelAssignment_1 : ( RULE_ID ) ; - public final void rule__LocalRecursion__LabelAssignment_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11863:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11864:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11864:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11865:1: RULE_ID - { - before(grammarAccess.getLocalRecursionAccess().getLabelIDTerminalRuleCall_1_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__LocalRecursion__LabelAssignment_123714); - after(grammarAccess.getLocalRecursionAccess().getLabelIDTerminalRuleCall_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalRecursion__LabelAssignment_1" - - - // $ANTLR start "rule__LocalRecursion__BlockAssignment_2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11874:1: rule__LocalRecursion__BlockAssignment_2 : ( ruleLocalProtocolBlock ) ; - public final void rule__LocalRecursion__BlockAssignment_2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11878:1: ( ( ruleLocalProtocolBlock ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11879:1: ( ruleLocalProtocolBlock ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11879:1: ( ruleLocalProtocolBlock ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11880:1: ruleLocalProtocolBlock - { - before(grammarAccess.getLocalRecursionAccess().getBlockLocalProtocolBlockParserRuleCall_2_0()); - pushFollow(FOLLOW_ruleLocalProtocolBlock_in_rule__LocalRecursion__BlockAssignment_223745); - ruleLocalProtocolBlock(); - - state._fsp--; - - after(grammarAccess.getLocalRecursionAccess().getBlockLocalProtocolBlockParserRuleCall_2_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalRecursion__BlockAssignment_2" - - - // $ANTLR start "rule__LocalContinue__LabelAssignment_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11889:1: rule__LocalContinue__LabelAssignment_1 : ( RULE_ID ) ; - public final void rule__LocalContinue__LabelAssignment_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11893:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11894:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11894:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11895:1: RULE_ID - { - before(grammarAccess.getLocalContinueAccess().getLabelIDTerminalRuleCall_1_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__LocalContinue__LabelAssignment_123776); - after(grammarAccess.getLocalContinueAccess().getLabelIDTerminalRuleCall_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalContinue__LabelAssignment_1" - - - // $ANTLR start "rule__LocalParallel__BlocksAssignment_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11904:1: rule__LocalParallel__BlocksAssignment_1 : ( ruleLocalProtocolBlock ) ; - public final void rule__LocalParallel__BlocksAssignment_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11908:1: ( ( ruleLocalProtocolBlock ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11909:1: ( ruleLocalProtocolBlock ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11909:1: ( ruleLocalProtocolBlock ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11910:1: ruleLocalProtocolBlock - { - before(grammarAccess.getLocalParallelAccess().getBlocksLocalProtocolBlockParserRuleCall_1_0()); - pushFollow(FOLLOW_ruleLocalProtocolBlock_in_rule__LocalParallel__BlocksAssignment_123807); - ruleLocalProtocolBlock(); - - state._fsp--; - - after(grammarAccess.getLocalParallelAccess().getBlocksLocalProtocolBlockParserRuleCall_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalParallel__BlocksAssignment_1" - - - // $ANTLR start "rule__LocalParallel__BlocksAssignment_2_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11919:1: rule__LocalParallel__BlocksAssignment_2_1 : ( ruleLocalProtocolBlock ) ; - public final void rule__LocalParallel__BlocksAssignment_2_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11923:1: ( ( ruleLocalProtocolBlock ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11924:1: ( ruleLocalProtocolBlock ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11924:1: ( ruleLocalProtocolBlock ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11925:1: ruleLocalProtocolBlock - { - before(grammarAccess.getLocalParallelAccess().getBlocksLocalProtocolBlockParserRuleCall_2_1_0()); - pushFollow(FOLLOW_ruleLocalProtocolBlock_in_rule__LocalParallel__BlocksAssignment_2_123838); - ruleLocalProtocolBlock(); - - state._fsp--; - - after(grammarAccess.getLocalParallelAccess().getBlocksLocalProtocolBlockParserRuleCall_2_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalParallel__BlocksAssignment_2_1" - - - // $ANTLR start "rule__LocalInterruptible__ScopeAssignment_1_0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11934:1: rule__LocalInterruptible__ScopeAssignment_1_0 : ( RULE_ID ) ; - public final void rule__LocalInterruptible__ScopeAssignment_1_0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11938:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11939:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11939:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11940:1: RULE_ID - { - before(grammarAccess.getLocalInterruptibleAccess().getScopeIDTerminalRuleCall_1_0_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__LocalInterruptible__ScopeAssignment_1_023869); - after(grammarAccess.getLocalInterruptibleAccess().getScopeIDTerminalRuleCall_1_0_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalInterruptible__ScopeAssignment_1_0" - - - // $ANTLR start "rule__LocalInterruptible__BlockAssignment_2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11949:1: rule__LocalInterruptible__BlockAssignment_2 : ( ruleLocalProtocolBlock ) ; - public final void rule__LocalInterruptible__BlockAssignment_2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11953:1: ( ( ruleLocalProtocolBlock ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11954:1: ( ruleLocalProtocolBlock ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11954:1: ( ruleLocalProtocolBlock ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11955:1: ruleLocalProtocolBlock - { - before(grammarAccess.getLocalInterruptibleAccess().getBlockLocalProtocolBlockParserRuleCall_2_0()); - pushFollow(FOLLOW_ruleLocalProtocolBlock_in_rule__LocalInterruptible__BlockAssignment_223900); - ruleLocalProtocolBlock(); - - state._fsp--; - - after(grammarAccess.getLocalInterruptibleAccess().getBlockLocalProtocolBlockParserRuleCall_2_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalInterruptible__BlockAssignment_2" - - - // $ANTLR start "rule__LocalInterruptible__ThrowAssignment_5" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11964:1: rule__LocalInterruptible__ThrowAssignment_5 : ( ruleLocalThrow ) ; - public final void rule__LocalInterruptible__ThrowAssignment_5() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11968:1: ( ( ruleLocalThrow ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11969:1: ( ruleLocalThrow ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11969:1: ( ruleLocalThrow ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11970:1: ruleLocalThrow - { - before(grammarAccess.getLocalInterruptibleAccess().getThrowLocalThrowParserRuleCall_5_0()); - pushFollow(FOLLOW_ruleLocalThrow_in_rule__LocalInterruptible__ThrowAssignment_523931); - ruleLocalThrow(); - - state._fsp--; - - after(grammarAccess.getLocalInterruptibleAccess().getThrowLocalThrowParserRuleCall_5_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalInterruptible__ThrowAssignment_5" - - - // $ANTLR start "rule__LocalInterruptible__CatchesAssignment_6" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11979:1: rule__LocalInterruptible__CatchesAssignment_6 : ( ruleLocalCatch ) ; - public final void rule__LocalInterruptible__CatchesAssignment_6() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11983:1: ( ( ruleLocalCatch ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11984:1: ( ruleLocalCatch ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11984:1: ( ruleLocalCatch ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11985:1: ruleLocalCatch - { - before(grammarAccess.getLocalInterruptibleAccess().getCatchesLocalCatchParserRuleCall_6_0()); - pushFollow(FOLLOW_ruleLocalCatch_in_rule__LocalInterruptible__CatchesAssignment_623962); - ruleLocalCatch(); - - state._fsp--; - - after(grammarAccess.getLocalInterruptibleAccess().getCatchesLocalCatchParserRuleCall_6_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalInterruptible__CatchesAssignment_6" - - - // $ANTLR start "rule__LocalThrow__MessagesAssignment_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11994:1: rule__LocalThrow__MessagesAssignment_1 : ( ruleMessage ) ; - public final void rule__LocalThrow__MessagesAssignment_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11998:1: ( ( ruleMessage ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11999:1: ( ruleMessage ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:11999:1: ( ruleMessage ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12000:1: ruleMessage - { - before(grammarAccess.getLocalThrowAccess().getMessagesMessageParserRuleCall_1_0()); - pushFollow(FOLLOW_ruleMessage_in_rule__LocalThrow__MessagesAssignment_123993); - ruleMessage(); - - state._fsp--; - - after(grammarAccess.getLocalThrowAccess().getMessagesMessageParserRuleCall_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalThrow__MessagesAssignment_1" - - - // $ANTLR start "rule__LocalThrow__MessagesAssignment_2_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12009:1: rule__LocalThrow__MessagesAssignment_2_1 : ( ruleMessage ) ; - public final void rule__LocalThrow__MessagesAssignment_2_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12013:1: ( ( ruleMessage ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12014:1: ( ruleMessage ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12014:1: ( ruleMessage ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12015:1: ruleMessage - { - before(grammarAccess.getLocalThrowAccess().getMessagesMessageParserRuleCall_2_1_0()); - pushFollow(FOLLOW_ruleMessage_in_rule__LocalThrow__MessagesAssignment_2_124024); - ruleMessage(); - - state._fsp--; - - after(grammarAccess.getLocalThrowAccess().getMessagesMessageParserRuleCall_2_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalThrow__MessagesAssignment_2_1" - - - // $ANTLR start "rule__LocalThrow__ToRolesAssignment_4" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12024:1: rule__LocalThrow__ToRolesAssignment_4 : ( RULE_ID ) ; - public final void rule__LocalThrow__ToRolesAssignment_4() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12028:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12029:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12029:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12030:1: RULE_ID - { - before(grammarAccess.getLocalThrowAccess().getToRolesIDTerminalRuleCall_4_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__LocalThrow__ToRolesAssignment_424055); - after(grammarAccess.getLocalThrowAccess().getToRolesIDTerminalRuleCall_4_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalThrow__ToRolesAssignment_4" - - - // $ANTLR start "rule__LocalThrow__ToRolesAssignment_5_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12039:1: rule__LocalThrow__ToRolesAssignment_5_1 : ( RULE_ID ) ; - public final void rule__LocalThrow__ToRolesAssignment_5_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12043:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12044:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12044:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12045:1: RULE_ID - { - before(grammarAccess.getLocalThrowAccess().getToRolesIDTerminalRuleCall_5_1_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__LocalThrow__ToRolesAssignment_5_124086); - after(grammarAccess.getLocalThrowAccess().getToRolesIDTerminalRuleCall_5_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalThrow__ToRolesAssignment_5_1" - - - // $ANTLR start "rule__LocalCatch__MessagesAssignment_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12054:1: rule__LocalCatch__MessagesAssignment_1 : ( ruleMessage ) ; - public final void rule__LocalCatch__MessagesAssignment_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12058:1: ( ( ruleMessage ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12059:1: ( ruleMessage ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12059:1: ( ruleMessage ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12060:1: ruleMessage - { - before(grammarAccess.getLocalCatchAccess().getMessagesMessageParserRuleCall_1_0()); - pushFollow(FOLLOW_ruleMessage_in_rule__LocalCatch__MessagesAssignment_124117); - ruleMessage(); - - state._fsp--; - - after(grammarAccess.getLocalCatchAccess().getMessagesMessageParserRuleCall_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalCatch__MessagesAssignment_1" - - - // $ANTLR start "rule__LocalCatch__MessagesAssignment_2_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12069:1: rule__LocalCatch__MessagesAssignment_2_1 : ( ruleMessage ) ; - public final void rule__LocalCatch__MessagesAssignment_2_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12073:1: ( ( ruleMessage ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12074:1: ( ruleMessage ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12074:1: ( ruleMessage ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12075:1: ruleMessage - { - before(grammarAccess.getLocalCatchAccess().getMessagesMessageParserRuleCall_2_1_0()); - pushFollow(FOLLOW_ruleMessage_in_rule__LocalCatch__MessagesAssignment_2_124148); - ruleMessage(); - - state._fsp--; - - after(grammarAccess.getLocalCatchAccess().getMessagesMessageParserRuleCall_2_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalCatch__MessagesAssignment_2_1" - - - // $ANTLR start "rule__LocalCatch__FromRoleAssignment_4" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12084:1: rule__LocalCatch__FromRoleAssignment_4 : ( RULE_ID ) ; - public final void rule__LocalCatch__FromRoleAssignment_4() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12088:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12089:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12089:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12090:1: RULE_ID - { - before(grammarAccess.getLocalCatchAccess().getFromRoleIDTerminalRuleCall_4_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__LocalCatch__FromRoleAssignment_424179); - after(grammarAccess.getLocalCatchAccess().getFromRoleIDTerminalRuleCall_4_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalCatch__FromRoleAssignment_4" - - - // $ANTLR start "rule__LocalDo__ScopeAssignment_1_0" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12099:1: rule__LocalDo__ScopeAssignment_1_0 : ( RULE_ID ) ; - public final void rule__LocalDo__ScopeAssignment_1_0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12103:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12104:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12104:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12105:1: RULE_ID - { - before(grammarAccess.getLocalDoAccess().getScopeIDTerminalRuleCall_1_0_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__LocalDo__ScopeAssignment_1_024210); - after(grammarAccess.getLocalDoAccess().getScopeIDTerminalRuleCall_1_0_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__ScopeAssignment_1_0" - - - // $ANTLR start "rule__LocalDo__MemberAssignment_2" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12114:1: rule__LocalDo__MemberAssignment_2 : ( RULE_ID ) ; - public final void rule__LocalDo__MemberAssignment_2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12118:1: ( ( RULE_ID ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12119:1: ( RULE_ID ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12119:1: ( RULE_ID ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12120:1: RULE_ID - { - before(grammarAccess.getLocalDoAccess().getMemberIDTerminalRuleCall_2_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__LocalDo__MemberAssignment_224241); - after(grammarAccess.getLocalDoAccess().getMemberIDTerminalRuleCall_2_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__MemberAssignment_2" - - - // $ANTLR start "rule__LocalDo__ArgumentsAssignment_3_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12129:1: rule__LocalDo__ArgumentsAssignment_3_1 : ( ruleArgument ) ; - public final void rule__LocalDo__ArgumentsAssignment_3_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12133:1: ( ( ruleArgument ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12134:1: ( ruleArgument ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12134:1: ( ruleArgument ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12135:1: ruleArgument - { - before(grammarAccess.getLocalDoAccess().getArgumentsArgumentParserRuleCall_3_1_0()); - pushFollow(FOLLOW_ruleArgument_in_rule__LocalDo__ArgumentsAssignment_3_124272); - ruleArgument(); - - state._fsp--; - - after(grammarAccess.getLocalDoAccess().getArgumentsArgumentParserRuleCall_3_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__ArgumentsAssignment_3_1" - - - // $ANTLR start "rule__LocalDo__ArgumentsAssignment_3_2_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12144:1: rule__LocalDo__ArgumentsAssignment_3_2_1 : ( ruleArgument ) ; - public final void rule__LocalDo__ArgumentsAssignment_3_2_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12148:1: ( ( ruleArgument ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12149:1: ( ruleArgument ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12149:1: ( ruleArgument ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12150:1: ruleArgument - { - before(grammarAccess.getLocalDoAccess().getArgumentsArgumentParserRuleCall_3_2_1_0()); - pushFollow(FOLLOW_ruleArgument_in_rule__LocalDo__ArgumentsAssignment_3_2_124303); - ruleArgument(); - - state._fsp--; - - after(grammarAccess.getLocalDoAccess().getArgumentsArgumentParserRuleCall_3_2_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__ArgumentsAssignment_3_2_1" - - - // $ANTLR start "rule__LocalDo__RolesAssignment_5" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12159:1: rule__LocalDo__RolesAssignment_5 : ( ruleRoleInstantiation ) ; - public final void rule__LocalDo__RolesAssignment_5() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12163:1: ( ( ruleRoleInstantiation ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12164:1: ( ruleRoleInstantiation ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12164:1: ( ruleRoleInstantiation ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12165:1: ruleRoleInstantiation - { - before(grammarAccess.getLocalDoAccess().getRolesRoleInstantiationParserRuleCall_5_0()); - pushFollow(FOLLOW_ruleRoleInstantiation_in_rule__LocalDo__RolesAssignment_524334); - ruleRoleInstantiation(); - - state._fsp--; - - after(grammarAccess.getLocalDoAccess().getRolesRoleInstantiationParserRuleCall_5_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__RolesAssignment_5" - - - // $ANTLR start "rule__LocalDo__RolesAssignment_6_1" - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12174:1: rule__LocalDo__RolesAssignment_6_1 : ( ruleRoleInstantiation ) ; - public final void rule__LocalDo__RolesAssignment_6_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12178:1: ( ( ruleRoleInstantiation ) ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12179:1: ( ruleRoleInstantiation ) - { - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12179:1: ( ruleRoleInstantiation ) - // ../org.scribble.editor.ui/src-gen/org/scribble/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleDsl.g:12180:1: ruleRoleInstantiation - { - before(grammarAccess.getLocalDoAccess().getRolesRoleInstantiationParserRuleCall_6_1_0()); - pushFollow(FOLLOW_ruleRoleInstantiation_in_rule__LocalDo__RolesAssignment_6_124365); - ruleRoleInstantiation(); - - state._fsp--; - - after(grammarAccess.getLocalDoAccess().getRolesRoleInstantiationParserRuleCall_6_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__LocalDo__RolesAssignment_6_1" - - // Delegated rules - - - protected DFA9 dfa9 = new DFA9(this); - static final String DFA9_eotS = - "\23\uffff"; - static final String DFA9_eofS = - "\23\uffff"; - static final String DFA9_minS = - "\1\4\1\20\1\4\10\uffff\1\25\1\20\2\4\2\25\1\4\1\25"; - static final String DFA9_maxS = - "\1\52\1\37\1\25\10\uffff\1\27\1\37\2\4\1\27\1\26\1\4\1\26"; - static final String DFA9_acceptS = - "\3\uffff\1\3\1\4\1\5\1\6\1\7\1\10\1\2\1\1\10\uffff"; - static final String DFA9_specialS = - "\23\uffff}>"; - static final String[] DFA9_transitionS = { - "\1\1\17\uffff\1\2\13\uffff\1\3\2\uffff\1\5\1\6\1\4\1\uffff\1"+ - "\7\2\uffff\1\10", - "\1\11\3\uffff\1\2\12\uffff\1\12", - "\1\13\20\uffff\1\14", - "", - "", - "", - "", - "", - "", - "", - "", - "\1\14\1\15\1\16", - "\1\11\16\uffff\1\12", - "\1\17", - "\1\20", - "\1\14\1\15\1\21", - "\1\14\1\15", - "\1\22", - "\1\14\1\15" - }; - - static final short[] DFA9_eot = DFA.unpackEncodedString(DFA9_eotS); - static final short[] DFA9_eof = DFA.unpackEncodedString(DFA9_eofS); - static final char[] DFA9_min = DFA.unpackEncodedStringToUnsignedChars(DFA9_minS); - static final char[] DFA9_max = DFA.unpackEncodedStringToUnsignedChars(DFA9_maxS); - static final short[] DFA9_accept = DFA.unpackEncodedString(DFA9_acceptS); - static final short[] DFA9_special = DFA.unpackEncodedString(DFA9_specialS); - static final short[][] DFA9_transition; - - static { - int numStates = DFA9_transitionS.length; - DFA9_transition = new short[numStates][]; - for (int i=0; i injectors = Collections.synchronizedMap(Maps. newHashMapWithExpectedSize(1)); - - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - INSTANCE = this; - } - - @Override - public void stop(BundleContext context) throws Exception { - injectors.clear(); - INSTANCE = null; - super.stop(context); - } - - public static ScribbleDslActivator getInstance() { - return INSTANCE; - } - - public Injector getInjector(String language) { - synchronized (injectors) { - Injector injector = injectors.get(language); - if (injector == null) { - injectors.put(language, injector = createInjector(language)); - } - return injector; - } - } - - protected Injector createInjector(String language) { - try { - Module runtimeModule = getRuntimeModule(language); - Module sharedStateModule = getSharedStateModule(); - Module uiModule = getUiModule(language); - Module mergedModule = Modules2.mixin(runtimeModule, sharedStateModule, uiModule); - return Guice.createInjector(mergedModule); - } catch (Exception e) { - logger.error("Failed to create injector for " + language); - logger.error(e.getMessage(), e); - throw new RuntimeException("Failed to create injector for " + language, e); - } - } - - protected Module getRuntimeModule(String grammar) { - if (ORG_SCRIBBLE_EDITOR_DSL_SCRIBBLEDSL.equals(grammar)) { - return new org.scribble.editor.dsl.ScribbleDslRuntimeModule(); - } - - throw new IllegalArgumentException(grammar); - } - - protected Module getUiModule(String grammar) { - if (ORG_SCRIBBLE_EDITOR_DSL_SCRIBBLEDSL.equals(grammar)) { - return new org.scribble.editor.dsl.ui.ScribbleDslUiModule(this); - } - - throw new IllegalArgumentException(grammar); - } - - protected Module getSharedStateModule() { - return new SharedStateModule(); - } - -} diff --git a/tools/eclipse/plugins/org.scribble.editor.ui/src/org/scribble/editor/dsl/ui/ScribbleDslUiModule.java b/tools/eclipse/plugins/org.scribble.editor.ui/src/org/scribble/editor/dsl/ui/ScribbleDslUiModule.java deleted file mode 100644 index c29962fd9..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.ui/src/org/scribble/editor/dsl/ui/ScribbleDslUiModule.java +++ /dev/null @@ -1,19 +0,0 @@ -/* - * generated by Xtext - */ -package org.scribble.editor.dsl.ui; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.scribble.editor.tools.logger.EclipseIssueLogger; - -/** - * Use this class to register components to be used within the IDE. - */ -public class ScribbleDslUiModule extends org.scribble.editor.dsl.ui.AbstractScribbleDslUiModule { - public ScribbleDslUiModule(AbstractUIPlugin plugin) { - super(plugin); - - // Trigger the tools plugin - EclipseIssueLogger logger=new EclipseIssueLogger(null); - } -} diff --git a/tools/eclipse/plugins/org.scribble.editor.ui/src/org/scribble/editor/dsl/ui/contentassist/ScribbleDslProposalProvider.xtend b/tools/eclipse/plugins/org.scribble.editor.ui/src/org/scribble/editor/dsl/ui/contentassist/ScribbleDslProposalProvider.xtend deleted file mode 100644 index ab98a1ee1..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.ui/src/org/scribble/editor/dsl/ui/contentassist/ScribbleDslProposalProvider.xtend +++ /dev/null @@ -1,205 +0,0 @@ -/* - * generated by Xtext - */ -package org.scribble.editor.dsl.ui.contentassist - -import org.scribble.editor.dsl.ui.contentassist.AbstractScribbleDslProposalProvider -import org.eclipse.emf.ecore.EObject -import org.eclipse.xtext.Assignment -import org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext -import org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor -import org.scribble.editor.dsl.scribbleDsl.GlobalProtocolDecl -import org.scribble.editor.dsl.scribbleDsl.RoleDecl -import org.scribble.editor.dsl.scribbleDsl.GlobalMessageTransfer -import org.scribble.editor.dsl.scribbleDsl.GlobalRecursion -import org.scribble.editor.dsl.scribbleDsl.PayloadTypeDecl -import org.scribble.editor.dsl.scribbleDsl.Module -import org.scribble.editor.dsl.scribbleDsl.LocalRecursion -import org.scribble.editor.dsl.scribbleDsl.LocalProtocolDecl - -/** - * see http://www.eclipse.org/Xtext/documentation.html#contentAssist on how to customize content assistant - */ -class ScribbleDslProposalProvider extends AbstractScribbleDslProposalProvider { - - def globalRoleCompletion(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - - var obj=model; - - while (obj != null) { - - if (obj instanceof GlobalProtocolDecl) { - var GlobalProtocolDecl gpd=obj as GlobalProtocolDecl; - - for (RoleDecl role : gpd.getRoles()) { - var String name=role.getName(); - if (role.getAlias() != null) { - name = role.getAlias(); - } - acceptor.accept(createCompletionProposal(name, context)); - } - return; - } - - obj = obj.eContainer(); - } - } - - override completeGlobalChoice_Role(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - globalRoleCompletion(model, assignment, context, acceptor); - } - - override completeGlobalMessageTransfer_FromRole(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - - var GlobalMessageTransfer gmt=model as GlobalMessageTransfer; - var obj=model; - - while (obj != null) { - - if (obj instanceof GlobalProtocolDecl) { - var GlobalProtocolDecl gpd=obj as GlobalProtocolDecl; - - for (RoleDecl role : gpd.getRoles()) { - var String name=role.getName(); - if (role.getAlias() != null) { - name = role.getAlias(); - } - if (!gmt.getToRoles().contains(name)) { - acceptor.accept(createCompletionProposal(name, context)); - } - } - return; - } - - obj = obj.eContainer(); - } - } - - override completeGlobalMessageTransfer_ToRoles(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - - var GlobalMessageTransfer gmt=model as GlobalMessageTransfer; - var obj=model; - - while (obj != null) { - - if (obj instanceof GlobalProtocolDecl) { - var GlobalProtocolDecl gpd=obj as GlobalProtocolDecl; - - for (RoleDecl role : gpd.getRoles()) { - var String name=role.getName(); - if (role.getAlias() != null) { - name = role.getAlias(); - } - if (gmt.getFromRole() == null || !gmt.getFromRole().equals(name)) { - acceptor.accept(createCompletionProposal(name, context)); - } - } - return; - } - - obj = obj.eContainer(); - } - } - - override completeGlobalContinue_Label(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - var obj=model; - - while (obj != null) { - - if (obj instanceof GlobalRecursion) { - var GlobalRecursion gr=obj as GlobalRecursion; - - if (gr.getLabel() != null) { - acceptor.accept(createCompletionProposal(gr.getLabel(), context)); - } - } - - obj = obj.eContainer(); - } - } - - override completeGlobalInterrupt_Role(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - globalRoleCompletion(model, assignment, context, acceptor); - } - - override completePayloadElement_Type(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - var obj=model; - - while (obj != null) { - - if (obj instanceof Module) { - var Module module=obj as Module; - - for (PayloadTypeDecl type : module.getTypes()) { - if (type.getAlias() != null) { - acceptor.accept(createCompletionProposal(type.getAlias(), context)); - } - } - return; - } - - obj = obj.eContainer(); - } - } - - def localRoleCompletion(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - - var obj=model; - - while (obj != null) { - - if (obj instanceof LocalProtocolDecl) { - var LocalProtocolDecl lpd=obj as LocalProtocolDecl; - - for (RoleDecl role : lpd.getRoles()) { - var String name=role.getName(); - if (role.getAlias() != null) { - name = role.getAlias(); - } - acceptor.accept(createCompletionProposal(name, context)); - } - return; - } - - obj = obj.eContainer(); - } - } - - override completeLocalSend_ToRoles(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - localRoleCompletion(model, assignment, context, acceptor); - } - - override completeLocalReceive_FromRole(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - localRoleCompletion(model, assignment, context, acceptor); - } - - override completeLocalChoice_Role(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - localRoleCompletion(model, assignment, context, acceptor); - } - - override completeLocalContinue_Label(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - var obj=model; - - while (obj != null) { - - if (obj instanceof LocalRecursion) { - var LocalRecursion lr=obj as LocalRecursion; - - if (lr.getLabel() != null) { - acceptor.accept(createCompletionProposal(lr.getLabel(), context)); - } - } - - obj = obj.eContainer(); - } - } - - override completeLocalThrow_ToRoles(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - localRoleCompletion(model, assignment, context, acceptor); - } - - override completeLocalCatch_FromRole(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - localRoleCompletion(model, assignment, context, acceptor); - } - -} diff --git a/tools/eclipse/plugins/org.scribble.editor.ui/src/org/scribble/editor/dsl/ui/labeling/ScribbleDslDescriptionLabelProvider.xtend b/tools/eclipse/plugins/org.scribble.editor.ui/src/org/scribble/editor/dsl/ui/labeling/ScribbleDslDescriptionLabelProvider.xtend deleted file mode 100644 index ec8fb45ba..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.ui/src/org/scribble/editor/dsl/ui/labeling/ScribbleDslDescriptionLabelProvider.xtend +++ /dev/null @@ -1,24 +0,0 @@ -/* -* generated by Xtext -*/ -package org.scribble.editor.dsl.ui.labeling - -//import org.eclipse.xtext.resource.IEObjectDescription - -/** - * Provides labels for a IEObjectDescriptions and IResourceDescriptions. - * - * see http://www.eclipse.org/Xtext/documentation.html#labelProvider - */ -class ScribbleDslDescriptionLabelProvider extends org.eclipse.xtext.ui.label.DefaultDescriptionLabelProvider { - - // Labels and icons can be computed like this: - -// override text(IEObjectDescription ele) { -// ele.name.toString -// } -// -// override image(IEObjectDescription ele) { -// ele.EClass.name + '.gif' -// } -} diff --git a/tools/eclipse/plugins/org.scribble.editor.ui/src/org/scribble/editor/dsl/ui/labeling/ScribbleDslLabelProvider.xtend b/tools/eclipse/plugins/org.scribble.editor.ui/src/org/scribble/editor/dsl/ui/labeling/ScribbleDslLabelProvider.xtend deleted file mode 100644 index 58702690e..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.ui/src/org/scribble/editor/dsl/ui/labeling/ScribbleDslLabelProvider.xtend +++ /dev/null @@ -1,204 +0,0 @@ -/* -* generated by Xtext -*/ -package org.scribble.editor.dsl.ui.labeling - -import com.google.inject.Inject -import org.scribble.editor.dsl.scribbleDsl.Module -import org.scribble.editor.dsl.scribbleDsl.PayloadTypeDecl -import org.scribble.editor.dsl.scribbleDsl.GlobalProtocolDecl -import org.scribble.editor.dsl.scribbleDsl.LocalProtocolDecl -import org.scribble.editor.dsl.scribbleDsl.GlobalMessageTransfer -import org.scribble.editor.dsl.scribbleDsl.GlobalProtocolBlock -import org.scribble.editor.dsl.scribbleDsl.LocalProtocolBlock -import org.scribble.editor.dsl.scribbleDsl.GlobalDo -import org.scribble.editor.dsl.scribbleDsl.GlobalChoice -import org.scribble.editor.dsl.scribbleDsl.GlobalParallel -import org.scribble.editor.dsl.scribbleDsl.GlobalRecursion -import org.scribble.editor.dsl.scribbleDsl.GlobalContinue -import org.scribble.editor.dsl.scribbleDsl.LocalChoice -import org.scribble.editor.dsl.scribbleDsl.LocalParallel -import org.scribble.editor.dsl.scribbleDsl.LocalRecursion -import org.scribble.editor.dsl.scribbleDsl.LocalContinue -import org.scribble.editor.dsl.scribbleDsl.LocalDo -import org.scribble.editor.dsl.scribbleDsl.LocalSend -import org.scribble.editor.dsl.scribbleDsl.LocalReceive -import org.scribble.editor.dsl.scribbleDsl.GlobalInterruptible -import org.scribble.editor.dsl.scribbleDsl.GlobalInterrupt -import org.scribble.editor.dsl.scribbleDsl.Message -import org.scribble.editor.dsl.scribbleDsl.LocalInterruptible -import org.scribble.editor.dsl.scribbleDsl.LocalThrow -import org.scribble.editor.dsl.scribbleDsl.LocalCatch - -/** - * Provides labels for a EObjects. - * - * see http://www.eclipse.org/Xtext/documentation.html#labelProvider - */ -class ScribbleDslLabelProvider extends org.eclipse.xtext.ui.label.DefaultEObjectLabelProvider { - - @Inject - new(org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider delegate) { - super(delegate); - } - - def text(Module elem) { - 'Module: ' + elem.name; - } - - def text(PayloadTypeDecl elem) { - 'Type: ' + elem.getAlias(); - } - - def text(GlobalProtocolDecl elem) { - 'Global Protocol: ' + elem.getName(); - } - - def text(GlobalProtocolBlock elem) { - 'Sequence'; - } - - def text(GlobalMessageTransfer elem) { - var String message=null; - - if (elem.getMessage().getParameter() != null) { - message = 'Parameter[' + elem.getMessage().getParameter() + ']'; - } else if (elem.getMessage().getSignature() != null) { - message = elem.getMessage().getSignature().getOperator(); - } - - message + ': ' + elem.getFromRole() + ' -> ' + elem.getToRoles(); - } - - def text(GlobalChoice elem) { - 'Choice: at ' + elem.getRole(); - } - - def text(GlobalParallel elem) { - 'Parallel'; - } - - def text(GlobalRecursion elem) { - 'Recursion: ' + elem.getLabel(); - } - - def text(GlobalContinue elem) { - 'Continue: ' + elem.getLabel(); - } - - def text(GlobalDo elem) { - 'Do'; - } - - def text(GlobalInterruptible elem) { - 'Interruptible'; - } - - def text(GlobalInterrupt elem) { - var String messages=""; - - for (Message mesg : elem.getMessages()) { - if (mesg.getParameter() != null) { - messages = messages + 'Parameter[' + mesg.getParameter() + ']'; - } else if (mesg.getSignature() != null) { - messages = messages + mesg.getSignature().getOperator(); - } - } - - 'Interrupt: ' + messages + ' by ' + elem.getRole(); - } - - def text(LocalProtocolDecl elem) { - 'Local Protocol: ' + elem.getName() + ' @ ' + elem.getRole(); - } - - def text(LocalProtocolBlock elem) { - 'Sequence'; - } - - def text(LocalSend elem) { - var String message=null; - - if (elem.getMessage().getParameter() != null) { - message = 'Parameter[' + elem.getMessage().getParameter() + ']'; - } else if (elem.getMessage().getSignature() != null) { - message = elem.getMessage().getSignature().getOperator(); - } - - message + ': to ' + elem.getToRoles(); - } - - def text(LocalReceive elem) { - var String message=null; - - if (elem.getMessage().getParameter() != null) { - message = 'Parameter[' + elem.getMessage().getParameter() + ']'; - } else if (elem.getMessage().getSignature() != null) { - message = elem.getMessage().getSignature().getOperator(); - } - - message + ': from ' + elem.getFromRole(); - } - - def text(LocalChoice elem) { - 'Choice: at ' + elem.getRole(); - } - - def text(LocalParallel elem) { - 'Parallel'; - } - - def text(LocalRecursion elem) { - 'Recursion: ' + elem.getLabel(); - } - - def text(LocalContinue elem) { - 'Continue: ' + elem.getLabel(); - } - - def text(LocalDo elem) { - 'Do'; - } - - def text(LocalInterruptible elem) { - 'Interruptible'; - } - - def text(LocalThrow elem) { - var String messages=""; - - for (Message mesg : elem.getMessages()) { - if (mesg.getParameter() != null) { - messages = messages + 'Parameter[' + mesg.getParameter() + ']'; - } else if (mesg.getSignature() != null) { - messages = messages + mesg.getSignature().getOperator(); - } - } - - 'Throw: ' + messages + ' to ' + elem.getToRoles(); - } - - def text(LocalCatch elem) { - var String messages=""; - - for (Message mesg : elem.getMessages()) { - if (mesg.getParameter() != null) { - messages = messages + 'Parameter[' + mesg.getParameter() + ']'; - } else if (mesg.getSignature() != null) { - messages = messages + mesg.getSignature().getOperator(); - } - } - - 'Catch: ' + messages + ' from ' + elem.getFromRole(); - } - - // Labels and icons can be computed like this: - -// def text(Greeting ele) { -// 'A greeting to ' + ele.name -// } -// -// def image(Greeting ele) { -// 'Greeting.gif' -// } -} diff --git a/tools/eclipse/plugins/org.scribble.editor.ui/src/org/scribble/editor/dsl/ui/outline/ScribbleDslOutlineTreeProvider.xtend b/tools/eclipse/plugins/org.scribble.editor.ui/src/org/scribble/editor/dsl/ui/outline/ScribbleDslOutlineTreeProvider.xtend deleted file mode 100644 index cce9cd390..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.ui/src/org/scribble/editor/dsl/ui/outline/ScribbleDslOutlineTreeProvider.xtend +++ /dev/null @@ -1,13 +0,0 @@ -/* -* generated by Xtext -*/ -package org.scribble.editor.dsl.ui.outline - -/** - * Customization of the default outline structure. - * - * see http://www.eclipse.org/Xtext/documentation.html#outline - */ -class ScribbleDslOutlineTreeProvider extends org.eclipse.xtext.ui.editor.outline.impl.DefaultOutlineTreeProvider { - -} diff --git a/tools/eclipse/plugins/org.scribble.editor.ui/src/org/scribble/editor/dsl/ui/quickfix/ScribbleDslQuickfixProvider.xtend b/tools/eclipse/plugins/org.scribble.editor.ui/src/org/scribble/editor/dsl/ui/quickfix/ScribbleDslQuickfixProvider.xtend deleted file mode 100644 index 43c691fde..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.ui/src/org/scribble/editor/dsl/ui/quickfix/ScribbleDslQuickfixProvider.xtend +++ /dev/null @@ -1,26 +0,0 @@ -/* -* generated by Xtext -*/ -package org.scribble.editor.dsl.ui.quickfix - -//import org.eclipse.xtext.ui.editor.quickfix.Fix -//import org.eclipse.xtext.ui.editor.quickfix.IssueResolutionAcceptor -//import org.eclipse.xtext.validation.Issue - -/** - * Custom quickfixes. - * - * see http://www.eclipse.org/Xtext/documentation.html#quickfixes - */ -class ScribbleDslQuickfixProvider extends org.eclipse.xtext.ui.editor.quickfix.DefaultQuickfixProvider { - -// @Fix(MyDslValidator::INVALID_NAME) -// def capitalizeName(Issue issue, IssueResolutionAcceptor acceptor) { -// acceptor.accept(issue, 'Capitalize name', 'Capitalize the name.', 'upcase.png') [ -// context | -// val xtextDocument = context.xtextDocument -// val firstLetter = xtextDocument.get(issue.offset, 1) -// xtextDocument.replace(issue.offset, 1, firstLetter.toUpperCase) -// ] -// } -} diff --git a/tools/eclipse/plugins/org.scribble.editor.ui/xtend-gen/org/scribble/editor/dsl/ui/contentassist/.ScribbleDslProposalProvider.java._trace b/tools/eclipse/plugins/org.scribble.editor.ui/xtend-gen/org/scribble/editor/dsl/ui/contentassist/.ScribbleDslProposalProvider.java._trace deleted file mode 100644 index 28ff1f7a3..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor.ui/xtend-gen/org/scribble/editor/dsl/ui/contentassist/.ScribbleDslProposalProvider.java._trace and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor.ui/xtend-gen/org/scribble/editor/dsl/ui/contentassist/ScribbleDslProposalProvider.java b/tools/eclipse/plugins/org.scribble.editor.ui/xtend-gen/org/scribble/editor/dsl/ui/contentassist/ScribbleDslProposalProvider.java deleted file mode 100644 index d56b492df..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.ui/xtend-gen/org/scribble/editor/dsl/ui/contentassist/ScribbleDslProposalProvider.java +++ /dev/null @@ -1,279 +0,0 @@ -/** - * generated by Xtext - */ -package org.scribble.editor.dsl.ui.contentassist; - -import com.google.common.base.Objects; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.jface.text.contentassist.ICompletionProposal; -import org.eclipse.xtext.Assignment; -import org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext; -import org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor; -import org.scribble.editor.dsl.scribbleDsl.GlobalMessageTransfer; -import org.scribble.editor.dsl.scribbleDsl.GlobalProtocolDecl; -import org.scribble.editor.dsl.scribbleDsl.GlobalRecursion; -import org.scribble.editor.dsl.scribbleDsl.LocalProtocolDecl; -import org.scribble.editor.dsl.scribbleDsl.LocalRecursion; -import org.scribble.editor.dsl.scribbleDsl.Module; -import org.scribble.editor.dsl.scribbleDsl.PayloadTypeDecl; -import org.scribble.editor.dsl.scribbleDsl.RoleDecl; -import org.scribble.editor.dsl.ui.contentassist.AbstractScribbleDslProposalProvider; - -/** - * see http://www.eclipse.org/Xtext/documentation.html#contentAssist on how to customize content assistant - */ -@SuppressWarnings("all") -public class ScribbleDslProposalProvider extends AbstractScribbleDslProposalProvider { - public void globalRoleCompletion(final EObject model, final Assignment assignment, final ContentAssistContext context, final ICompletionProposalAcceptor acceptor) { - EObject obj = model; - boolean _notEquals = (!Objects.equal(obj, null)); - boolean _while = _notEquals; - while (_while) { - { - if ((obj instanceof GlobalProtocolDecl)) { - GlobalProtocolDecl gpd = ((GlobalProtocolDecl) obj); - EList _roles = gpd.getRoles(); - for (final RoleDecl role : _roles) { - { - String name = role.getName(); - String _alias = role.getAlias(); - boolean _notEquals_1 = (!Objects.equal(_alias, null)); - if (_notEquals_1) { - String _alias_1 = role.getAlias(); - name = _alias_1; - } - ICompletionProposal _createCompletionProposal = this.createCompletionProposal(name, context); - acceptor.accept(_createCompletionProposal); - } - } - return; - } - EObject _eContainer = obj.eContainer(); - obj = _eContainer; - } - boolean _notEquals_1 = (!Objects.equal(obj, null)); - _while = _notEquals_1; - } - } - - public void completeGlobalChoice_Role(final EObject model, final Assignment assignment, final ContentAssistContext context, final ICompletionProposalAcceptor acceptor) { - this.globalRoleCompletion(model, assignment, context, acceptor); - } - - public void completeGlobalMessageTransfer_FromRole(final EObject model, final Assignment assignment, final ContentAssistContext context, final ICompletionProposalAcceptor acceptor) { - GlobalMessageTransfer gmt = ((GlobalMessageTransfer) model); - EObject obj = model; - boolean _notEquals = (!Objects.equal(obj, null)); - boolean _while = _notEquals; - while (_while) { - { - if ((obj instanceof GlobalProtocolDecl)) { - GlobalProtocolDecl gpd = ((GlobalProtocolDecl) obj); - EList _roles = gpd.getRoles(); - for (final RoleDecl role : _roles) { - { - String name = role.getName(); - String _alias = role.getAlias(); - boolean _notEquals_1 = (!Objects.equal(_alias, null)); - if (_notEquals_1) { - String _alias_1 = role.getAlias(); - name = _alias_1; - } - EList _toRoles = gmt.getToRoles(); - boolean _contains = _toRoles.contains(name); - boolean _not = (!_contains); - if (_not) { - ICompletionProposal _createCompletionProposal = this.createCompletionProposal(name, context); - acceptor.accept(_createCompletionProposal); - } - } - } - return; - } - EObject _eContainer = obj.eContainer(); - obj = _eContainer; - } - boolean _notEquals_1 = (!Objects.equal(obj, null)); - _while = _notEquals_1; - } - } - - public void completeGlobalMessageTransfer_ToRoles(final EObject model, final Assignment assignment, final ContentAssistContext context, final ICompletionProposalAcceptor acceptor) { - GlobalMessageTransfer gmt = ((GlobalMessageTransfer) model); - EObject obj = model; - boolean _notEquals = (!Objects.equal(obj, null)); - boolean _while = _notEquals; - while (_while) { - { - if ((obj instanceof GlobalProtocolDecl)) { - GlobalProtocolDecl gpd = ((GlobalProtocolDecl) obj); - EList _roles = gpd.getRoles(); - for (final RoleDecl role : _roles) { - { - String name = role.getName(); - String _alias = role.getAlias(); - boolean _notEquals_1 = (!Objects.equal(_alias, null)); - if (_notEquals_1) { - String _alias_1 = role.getAlias(); - name = _alias_1; - } - boolean _or = false; - String _fromRole = gmt.getFromRole(); - boolean _equals = Objects.equal(_fromRole, null); - if (_equals) { - _or = true; - } else { - String _fromRole_1 = gmt.getFromRole(); - boolean _equals_1 = _fromRole_1.equals(name); - boolean _not = (!_equals_1); - _or = _not; - } - if (_or) { - ICompletionProposal _createCompletionProposal = this.createCompletionProposal(name, context); - acceptor.accept(_createCompletionProposal); - } - } - } - return; - } - EObject _eContainer = obj.eContainer(); - obj = _eContainer; - } - boolean _notEquals_1 = (!Objects.equal(obj, null)); - _while = _notEquals_1; - } - } - - public void completeGlobalContinue_Label(final EObject model, final Assignment assignment, final ContentAssistContext context, final ICompletionProposalAcceptor acceptor) { - EObject obj = model; - boolean _notEquals = (!Objects.equal(obj, null)); - boolean _while = _notEquals; - while (_while) { - { - if ((obj instanceof GlobalRecursion)) { - GlobalRecursion gr = ((GlobalRecursion) obj); - String _label = gr.getLabel(); - boolean _notEquals_1 = (!Objects.equal(_label, null)); - if (_notEquals_1) { - String _label_1 = gr.getLabel(); - ICompletionProposal _createCompletionProposal = this.createCompletionProposal(_label_1, context); - acceptor.accept(_createCompletionProposal); - } - } - EObject _eContainer = obj.eContainer(); - obj = _eContainer; - } - boolean _notEquals_1 = (!Objects.equal(obj, null)); - _while = _notEquals_1; - } - } - - public void completeGlobalInterrupt_Role(final EObject model, final Assignment assignment, final ContentAssistContext context, final ICompletionProposalAcceptor acceptor) { - this.globalRoleCompletion(model, assignment, context, acceptor); - } - - public void completePayloadElement_Type(final EObject model, final Assignment assignment, final ContentAssistContext context, final ICompletionProposalAcceptor acceptor) { - EObject obj = model; - boolean _notEquals = (!Objects.equal(obj, null)); - boolean _while = _notEquals; - while (_while) { - { - if ((obj instanceof Module)) { - Module module = ((Module) obj); - EList _types = module.getTypes(); - for (final PayloadTypeDecl type : _types) { - String _alias = type.getAlias(); - boolean _notEquals_1 = (!Objects.equal(_alias, null)); - if (_notEquals_1) { - String _alias_1 = type.getAlias(); - ICompletionProposal _createCompletionProposal = this.createCompletionProposal(_alias_1, context); - acceptor.accept(_createCompletionProposal); - } - } - return; - } - EObject _eContainer = obj.eContainer(); - obj = _eContainer; - } - boolean _notEquals_1 = (!Objects.equal(obj, null)); - _while = _notEquals_1; - } - } - - public void localRoleCompletion(final EObject model, final Assignment assignment, final ContentAssistContext context, final ICompletionProposalAcceptor acceptor) { - EObject obj = model; - boolean _notEquals = (!Objects.equal(obj, null)); - boolean _while = _notEquals; - while (_while) { - { - if ((obj instanceof LocalProtocolDecl)) { - LocalProtocolDecl lpd = ((LocalProtocolDecl) obj); - EList _roles = lpd.getRoles(); - for (final RoleDecl role : _roles) { - { - String name = role.getName(); - String _alias = role.getAlias(); - boolean _notEquals_1 = (!Objects.equal(_alias, null)); - if (_notEquals_1) { - String _alias_1 = role.getAlias(); - name = _alias_1; - } - ICompletionProposal _createCompletionProposal = this.createCompletionProposal(name, context); - acceptor.accept(_createCompletionProposal); - } - } - return; - } - EObject _eContainer = obj.eContainer(); - obj = _eContainer; - } - boolean _notEquals_1 = (!Objects.equal(obj, null)); - _while = _notEquals_1; - } - } - - public void completeLocalSend_ToRoles(final EObject model, final Assignment assignment, final ContentAssistContext context, final ICompletionProposalAcceptor acceptor) { - this.localRoleCompletion(model, assignment, context, acceptor); - } - - public void completeLocalReceive_FromRole(final EObject model, final Assignment assignment, final ContentAssistContext context, final ICompletionProposalAcceptor acceptor) { - this.localRoleCompletion(model, assignment, context, acceptor); - } - - public void completeLocalChoice_Role(final EObject model, final Assignment assignment, final ContentAssistContext context, final ICompletionProposalAcceptor acceptor) { - this.localRoleCompletion(model, assignment, context, acceptor); - } - - public void completeLocalContinue_Label(final EObject model, final Assignment assignment, final ContentAssistContext context, final ICompletionProposalAcceptor acceptor) { - EObject obj = model; - boolean _notEquals = (!Objects.equal(obj, null)); - boolean _while = _notEquals; - while (_while) { - { - if ((obj instanceof LocalRecursion)) { - LocalRecursion lr = ((LocalRecursion) obj); - String _label = lr.getLabel(); - boolean _notEquals_1 = (!Objects.equal(_label, null)); - if (_notEquals_1) { - String _label_1 = lr.getLabel(); - ICompletionProposal _createCompletionProposal = this.createCompletionProposal(_label_1, context); - acceptor.accept(_createCompletionProposal); - } - } - EObject _eContainer = obj.eContainer(); - obj = _eContainer; - } - boolean _notEquals_1 = (!Objects.equal(obj, null)); - _while = _notEquals_1; - } - } - - public void completeLocalThrow_ToRoles(final EObject model, final Assignment assignment, final ContentAssistContext context, final ICompletionProposalAcceptor acceptor) { - this.localRoleCompletion(model, assignment, context, acceptor); - } - - public void completeLocalCatch_FromRole(final EObject model, final Assignment assignment, final ContentAssistContext context, final ICompletionProposalAcceptor acceptor) { - this.localRoleCompletion(model, assignment, context, acceptor); - } -} diff --git a/tools/eclipse/plugins/org.scribble.editor.ui/xtend-gen/org/scribble/editor/dsl/ui/labeling/.ScribbleDslDescriptionLabelProvider.java._trace b/tools/eclipse/plugins/org.scribble.editor.ui/xtend-gen/org/scribble/editor/dsl/ui/labeling/.ScribbleDslDescriptionLabelProvider.java._trace deleted file mode 100644 index b9043dca6..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor.ui/xtend-gen/org/scribble/editor/dsl/ui/labeling/.ScribbleDslDescriptionLabelProvider.java._trace and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor.ui/xtend-gen/org/scribble/editor/dsl/ui/labeling/.ScribbleDslLabelProvider.java._trace b/tools/eclipse/plugins/org.scribble.editor.ui/xtend-gen/org/scribble/editor/dsl/ui/labeling/.ScribbleDslLabelProvider.java._trace deleted file mode 100644 index 2d57f3094..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor.ui/xtend-gen/org/scribble/editor/dsl/ui/labeling/.ScribbleDslLabelProvider.java._trace and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor.ui/xtend-gen/org/scribble/editor/dsl/ui/labeling/ScribbleDslDescriptionLabelProvider.java b/tools/eclipse/plugins/org.scribble.editor.ui/xtend-gen/org/scribble/editor/dsl/ui/labeling/ScribbleDslDescriptionLabelProvider.java deleted file mode 100644 index 3fe20077f..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.ui/xtend-gen/org/scribble/editor/dsl/ui/labeling/ScribbleDslDescriptionLabelProvider.java +++ /dev/null @@ -1,15 +0,0 @@ -/** - * generated by Xtext - */ -package org.scribble.editor.dsl.ui.labeling; - -import org.eclipse.xtext.ui.label.DefaultDescriptionLabelProvider; - -/** - * Provides labels for a IEObjectDescriptions and IResourceDescriptions. - * - * see http://www.eclipse.org/Xtext/documentation.html#labelProvider - */ -@SuppressWarnings("all") -public class ScribbleDslDescriptionLabelProvider extends DefaultDescriptionLabelProvider { -} diff --git a/tools/eclipse/plugins/org.scribble.editor.ui/xtend-gen/org/scribble/editor/dsl/ui/labeling/ScribbleDslLabelProvider.java b/tools/eclipse/plugins/org.scribble.editor.ui/xtend-gen/org/scribble/editor/dsl/ui/labeling/ScribbleDslLabelProvider.java deleted file mode 100644 index 164ac75ea..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.ui/xtend-gen/org/scribble/editor/dsl/ui/labeling/ScribbleDslLabelProvider.java +++ /dev/null @@ -1,317 +0,0 @@ -/** - * generated by Xtext - */ -package org.scribble.editor.dsl.ui.labeling; - -import com.google.common.base.Objects; -import com.google.inject.Inject; -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; -import org.eclipse.xtext.ui.label.DefaultEObjectLabelProvider; -import org.scribble.editor.dsl.scribbleDsl.GlobalChoice; -import org.scribble.editor.dsl.scribbleDsl.GlobalContinue; -import org.scribble.editor.dsl.scribbleDsl.GlobalDo; -import org.scribble.editor.dsl.scribbleDsl.GlobalInterrupt; -import org.scribble.editor.dsl.scribbleDsl.GlobalInterruptible; -import org.scribble.editor.dsl.scribbleDsl.GlobalMessageTransfer; -import org.scribble.editor.dsl.scribbleDsl.GlobalParallel; -import org.scribble.editor.dsl.scribbleDsl.GlobalProtocolBlock; -import org.scribble.editor.dsl.scribbleDsl.GlobalProtocolDecl; -import org.scribble.editor.dsl.scribbleDsl.GlobalRecursion; -import org.scribble.editor.dsl.scribbleDsl.LocalCatch; -import org.scribble.editor.dsl.scribbleDsl.LocalChoice; -import org.scribble.editor.dsl.scribbleDsl.LocalContinue; -import org.scribble.editor.dsl.scribbleDsl.LocalDo; -import org.scribble.editor.dsl.scribbleDsl.LocalInterruptible; -import org.scribble.editor.dsl.scribbleDsl.LocalParallel; -import org.scribble.editor.dsl.scribbleDsl.LocalProtocolBlock; -import org.scribble.editor.dsl.scribbleDsl.LocalProtocolDecl; -import org.scribble.editor.dsl.scribbleDsl.LocalReceive; -import org.scribble.editor.dsl.scribbleDsl.LocalRecursion; -import org.scribble.editor.dsl.scribbleDsl.LocalSend; -import org.scribble.editor.dsl.scribbleDsl.LocalThrow; -import org.scribble.editor.dsl.scribbleDsl.Message; -import org.scribble.editor.dsl.scribbleDsl.MessageSignature; -import org.scribble.editor.dsl.scribbleDsl.Module; -import org.scribble.editor.dsl.scribbleDsl.PayloadTypeDecl; - -/** - * Provides labels for a EObjects. - * - * see http://www.eclipse.org/Xtext/documentation.html#labelProvider - */ -@SuppressWarnings("all") -public class ScribbleDslLabelProvider extends DefaultEObjectLabelProvider { - @Inject - public ScribbleDslLabelProvider(final AdapterFactoryLabelProvider delegate) { - super(delegate); - } - - public String text(final Module elem) { - String _name = elem.getName(); - return ("Module: " + _name); - } - - public String text(final PayloadTypeDecl elem) { - String _alias = elem.getAlias(); - return ("Type: " + _alias); - } - - public String text(final GlobalProtocolDecl elem) { - String _name = elem.getName(); - return ("Global Protocol: " + _name); - } - - public String text(final GlobalProtocolBlock elem) { - return "Sequence"; - } - - public String text(final GlobalMessageTransfer elem) { - String _xblockexpression = null; - { - String message = null; - Message _message = elem.getMessage(); - String _parameter = _message.getParameter(); - boolean _notEquals = (!Objects.equal(_parameter, null)); - if (_notEquals) { - Message _message_1 = elem.getMessage(); - String _parameter_1 = _message_1.getParameter(); - String _plus = ("Parameter[" + _parameter_1); - String _plus_1 = (_plus + "]"); - message = _plus_1; - } else { - Message _message_2 = elem.getMessage(); - MessageSignature _signature = _message_2.getSignature(); - boolean _notEquals_1 = (!Objects.equal(_signature, null)); - if (_notEquals_1) { - Message _message_3 = elem.getMessage(); - MessageSignature _signature_1 = _message_3.getSignature(); - String _operator = _signature_1.getOperator(); - message = _operator; - } - } - String _fromRole = elem.getFromRole(); - String _plus_2 = ((message + ": ") + _fromRole); - String _plus_3 = (_plus_2 + " -> "); - EList _toRoles = elem.getToRoles(); - _xblockexpression = (_plus_3 + _toRoles); - } - return _xblockexpression; - } - - public String text(final GlobalChoice elem) { - String _role = elem.getRole(); - return ("Choice: at " + _role); - } - - public String text(final GlobalParallel elem) { - return "Parallel"; - } - - public String text(final GlobalRecursion elem) { - String _label = elem.getLabel(); - return ("Recursion: " + _label); - } - - public String text(final GlobalContinue elem) { - String _label = elem.getLabel(); - return ("Continue: " + _label); - } - - public String text(final GlobalDo elem) { - return "Do"; - } - - public String text(final GlobalInterruptible elem) { - return "Interruptible"; - } - - public String text(final GlobalInterrupt elem) { - String _xblockexpression = null; - { - String messages = ""; - EList _messages = elem.getMessages(); - for (final Message mesg : _messages) { - String _parameter = mesg.getParameter(); - boolean _notEquals = (!Objects.equal(_parameter, null)); - if (_notEquals) { - String _parameter_1 = mesg.getParameter(); - String _plus = ((messages + "Parameter[") + _parameter_1); - String _plus_1 = (_plus + "]"); - messages = _plus_1; - } else { - MessageSignature _signature = mesg.getSignature(); - boolean _notEquals_1 = (!Objects.equal(_signature, null)); - if (_notEquals_1) { - MessageSignature _signature_1 = mesg.getSignature(); - String _operator = _signature_1.getOperator(); - String _plus_2 = (messages + _operator); - messages = _plus_2; - } - } - } - String _role = elem.getRole(); - _xblockexpression = ((("Interrupt: " + messages) + " by ") + _role); - } - return _xblockexpression; - } - - public String text(final LocalProtocolDecl elem) { - String _name = elem.getName(); - String _plus = ("Local Protocol: " + _name); - String _plus_1 = (_plus + " @ "); - String _role = elem.getRole(); - return (_plus_1 + _role); - } - - public String text(final LocalProtocolBlock elem) { - return "Sequence"; - } - - public String text(final LocalSend elem) { - String _xblockexpression = null; - { - String message = null; - Message _message = elem.getMessage(); - String _parameter = _message.getParameter(); - boolean _notEquals = (!Objects.equal(_parameter, null)); - if (_notEquals) { - Message _message_1 = elem.getMessage(); - String _parameter_1 = _message_1.getParameter(); - String _plus = ("Parameter[" + _parameter_1); - String _plus_1 = (_plus + "]"); - message = _plus_1; - } else { - Message _message_2 = elem.getMessage(); - MessageSignature _signature = _message_2.getSignature(); - boolean _notEquals_1 = (!Objects.equal(_signature, null)); - if (_notEquals_1) { - Message _message_3 = elem.getMessage(); - MessageSignature _signature_1 = _message_3.getSignature(); - String _operator = _signature_1.getOperator(); - message = _operator; - } - } - EList _toRoles = elem.getToRoles(); - _xblockexpression = ((message + ": to ") + _toRoles); - } - return _xblockexpression; - } - - public String text(final LocalReceive elem) { - String _xblockexpression = null; - { - String message = null; - Message _message = elem.getMessage(); - String _parameter = _message.getParameter(); - boolean _notEquals = (!Objects.equal(_parameter, null)); - if (_notEquals) { - Message _message_1 = elem.getMessage(); - String _parameter_1 = _message_1.getParameter(); - String _plus = ("Parameter[" + _parameter_1); - String _plus_1 = (_plus + "]"); - message = _plus_1; - } else { - Message _message_2 = elem.getMessage(); - MessageSignature _signature = _message_2.getSignature(); - boolean _notEquals_1 = (!Objects.equal(_signature, null)); - if (_notEquals_1) { - Message _message_3 = elem.getMessage(); - MessageSignature _signature_1 = _message_3.getSignature(); - String _operator = _signature_1.getOperator(); - message = _operator; - } - } - String _fromRole = elem.getFromRole(); - _xblockexpression = ((message + ": from ") + _fromRole); - } - return _xblockexpression; - } - - public String text(final LocalChoice elem) { - String _role = elem.getRole(); - return ("Choice: at " + _role); - } - - public String text(final LocalParallel elem) { - return "Parallel"; - } - - public String text(final LocalRecursion elem) { - String _label = elem.getLabel(); - return ("Recursion: " + _label); - } - - public String text(final LocalContinue elem) { - String _label = elem.getLabel(); - return ("Continue: " + _label); - } - - public String text(final LocalDo elem) { - return "Do"; - } - - public String text(final LocalInterruptible elem) { - return "Interruptible"; - } - - public String text(final LocalThrow elem) { - String _xblockexpression = null; - { - String messages = ""; - EList _messages = elem.getMessages(); - for (final Message mesg : _messages) { - String _parameter = mesg.getParameter(); - boolean _notEquals = (!Objects.equal(_parameter, null)); - if (_notEquals) { - String _parameter_1 = mesg.getParameter(); - String _plus = ((messages + "Parameter[") + _parameter_1); - String _plus_1 = (_plus + "]"); - messages = _plus_1; - } else { - MessageSignature _signature = mesg.getSignature(); - boolean _notEquals_1 = (!Objects.equal(_signature, null)); - if (_notEquals_1) { - MessageSignature _signature_1 = mesg.getSignature(); - String _operator = _signature_1.getOperator(); - String _plus_2 = (messages + _operator); - messages = _plus_2; - } - } - } - EList _toRoles = elem.getToRoles(); - _xblockexpression = ((("Throw: " + messages) + " to ") + _toRoles); - } - return _xblockexpression; - } - - public String text(final LocalCatch elem) { - String _xblockexpression = null; - { - String messages = ""; - EList _messages = elem.getMessages(); - for (final Message mesg : _messages) { - String _parameter = mesg.getParameter(); - boolean _notEquals = (!Objects.equal(_parameter, null)); - if (_notEquals) { - String _parameter_1 = mesg.getParameter(); - String _plus = ((messages + "Parameter[") + _parameter_1); - String _plus_1 = (_plus + "]"); - messages = _plus_1; - } else { - MessageSignature _signature = mesg.getSignature(); - boolean _notEquals_1 = (!Objects.equal(_signature, null)); - if (_notEquals_1) { - MessageSignature _signature_1 = mesg.getSignature(); - String _operator = _signature_1.getOperator(); - String _plus_2 = (messages + _operator); - messages = _plus_2; - } - } - } - String _fromRole = elem.getFromRole(); - _xblockexpression = ((("Catch: " + messages) + " from ") + _fromRole); - } - return _xblockexpression; - } -} diff --git a/tools/eclipse/plugins/org.scribble.editor.ui/xtend-gen/org/scribble/editor/dsl/ui/outline/.ScribbleDslOutlineTreeProvider.java._trace b/tools/eclipse/plugins/org.scribble.editor.ui/xtend-gen/org/scribble/editor/dsl/ui/outline/.ScribbleDslOutlineTreeProvider.java._trace deleted file mode 100644 index c33c2dd4b..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor.ui/xtend-gen/org/scribble/editor/dsl/ui/outline/.ScribbleDslOutlineTreeProvider.java._trace and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor.ui/xtend-gen/org/scribble/editor/dsl/ui/outline/ScribbleDslOutlineTreeProvider.java b/tools/eclipse/plugins/org.scribble.editor.ui/xtend-gen/org/scribble/editor/dsl/ui/outline/ScribbleDslOutlineTreeProvider.java deleted file mode 100644 index 3c5f53e01..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.ui/xtend-gen/org/scribble/editor/dsl/ui/outline/ScribbleDslOutlineTreeProvider.java +++ /dev/null @@ -1,15 +0,0 @@ -/** - * generated by Xtext - */ -package org.scribble.editor.dsl.ui.outline; - -import org.eclipse.xtext.ui.editor.outline.impl.DefaultOutlineTreeProvider; - -/** - * Customization of the default outline structure. - * - * see http://www.eclipse.org/Xtext/documentation.html#outline - */ -@SuppressWarnings("all") -public class ScribbleDslOutlineTreeProvider extends DefaultOutlineTreeProvider { -} diff --git a/tools/eclipse/plugins/org.scribble.editor.ui/xtend-gen/org/scribble/editor/dsl/ui/quickfix/.ScribbleDslQuickfixProvider.java._trace b/tools/eclipse/plugins/org.scribble.editor.ui/xtend-gen/org/scribble/editor/dsl/ui/quickfix/.ScribbleDslQuickfixProvider.java._trace deleted file mode 100644 index 9f6f50398..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor.ui/xtend-gen/org/scribble/editor/dsl/ui/quickfix/.ScribbleDslQuickfixProvider.java._trace and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor.ui/xtend-gen/org/scribble/editor/dsl/ui/quickfix/ScribbleDslQuickfixProvider.java b/tools/eclipse/plugins/org.scribble.editor.ui/xtend-gen/org/scribble/editor/dsl/ui/quickfix/ScribbleDslQuickfixProvider.java deleted file mode 100644 index 800740348..000000000 --- a/tools/eclipse/plugins/org.scribble.editor.ui/xtend-gen/org/scribble/editor/dsl/ui/quickfix/ScribbleDslQuickfixProvider.java +++ /dev/null @@ -1,15 +0,0 @@ -/** - * generated by Xtext - */ -package org.scribble.editor.dsl.ui.quickfix; - -import org.eclipse.xtext.ui.editor.quickfix.DefaultQuickfixProvider; - -/** - * Custom quickfixes. - * - * see http://www.eclipse.org/Xtext/documentation.html#quickfixes - */ -@SuppressWarnings("all") -public class ScribbleDslQuickfixProvider extends DefaultQuickfixProvider { -} diff --git a/tools/eclipse/plugins/org.scribble.editor/.launch/Generate Language Infrastructure (org.scribble.editor).launch b/tools/eclipse/plugins/org.scribble.editor/.launch/Generate Language Infrastructure (org.scribble.editor).launch deleted file mode 100644 index 4a12e7879..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/.launch/Generate Language Infrastructure (org.scribble.editor).launch +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/tools/eclipse/plugins/org.scribble.editor/.launch/Launch Runtime Eclipse.launch b/tools/eclipse/plugins/org.scribble.editor/.launch/Launch Runtime Eclipse.launch deleted file mode 100644 index 9f5a5c7dc..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/.launch/Launch Runtime Eclipse.launch +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tools/eclipse/plugins/org.scribble.editor/META-INF/MANIFEST.MF b/tools/eclipse/plugins/org.scribble.editor/META-INF/MANIFEST.MF deleted file mode 100644 index bd53103ac..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/META-INF/MANIFEST.MF +++ /dev/null @@ -1,33 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: org.scribble.editor -Bundle-Vendor: Scribble.org -Bundle-Version: 0.3.2.qualifier -Bundle-SymbolicName: org.scribble.editor; singleton:=true -Bundle-ActivationPolicy: lazy -Require-Bundle: org.eclipse.xtext;visibility:=reexport, - org.eclipse.xtext.xbase;resolution:=optional;visibility:=reexport, - org.eclipse.xtext.generator;resolution:=optional, - org.apache.commons.logging;bundle-version="1.0.4";resolution:=optional, - org.eclipse.emf.codegen.ecore;resolution:=optional, - org.eclipse.emf.mwe.utils;resolution:=optional, - org.eclipse.emf.mwe2.launch;resolution:=optional, - org.eclipse.xtext.util, - org.eclipse.emf.ecore, - org.eclipse.emf.common, - org.antlr.runtime, - org.eclipse.xtext.common.types -Import-Package: org.apache.log4j, - org.eclipse.xtext.xbase.lib -Export-Package: org.scribble.editor.dsl, - org.scribble.editor.dsl.services, - org.scribble.editor.dsl.scribbleDsl, - org.scribble.editor.dsl.scribbleDsl.impl, - org.scribble.editor.dsl.scribbleDsl.util, - org.scribble.editor.dsl.serializer, - org.scribble.editor.dsl.parser.antlr, - org.scribble.editor.dsl.parser.antlr.internal, - org.scribble.editor.dsl.validation, - org.scribble.editor.dsl.scoping, - org.scribble.editor.dsl.generator, - org.scribble.editor.dsl.formatting diff --git a/tools/eclipse/plugins/org.scribble.editor/build.properties b/tools/eclipse/plugins/org.scribble.editor/build.properties deleted file mode 100644 index 9b82d81de..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/build.properties +++ /dev/null @@ -1,7 +0,0 @@ -source.. = src/,\ - src-gen/,\ - xtend-gen/ -bin.includes = model/,\ - META-INF/,\ - .,\ - plugin.xml \ No newline at end of file diff --git a/tools/eclipse/plugins/org.scribble.editor/model/generated/ScribbleDsl.ecore b/tools/eclipse/plugins/org.scribble.editor/model/generated/ScribbleDsl.ecore deleted file mode 100644 index 9d1882a1c..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/model/generated/ScribbleDsl.ecore +++ /dev/null @@ -1,201 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tools/eclipse/plugins/org.scribble.editor/model/generated/ScribbleDsl.genmodel b/tools/eclipse/plugins/org.scribble.editor/model/generated/ScribbleDsl.genmodel deleted file mode 100644 index f8aba7fee..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/model/generated/ScribbleDsl.genmodel +++ /dev/null @@ -1,164 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tools/eclipse/plugins/org.scribble.editor/plugin.xml b/tools/eclipse/plugins/org.scribble.editor/plugin.xml deleted file mode 100644 index 2c925bd24..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/plugin.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - diff --git a/tools/eclipse/plugins/org.scribble.editor/plugin.xml_gen b/tools/eclipse/plugins/org.scribble.editor/plugin.xml_gen deleted file mode 100644 index 2c925bd24..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/plugin.xml_gen +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - diff --git a/tools/eclipse/plugins/org.scribble.editor/pom.xml b/tools/eclipse/plugins/org.scribble.editor/pom.xml deleted file mode 100644 index 2fde554cc..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/pom.xml +++ /dev/null @@ -1,17 +0,0 @@ - - 4.0.0 - org.scribble.tools.eclipse.plugins - org.scribble.editor - 0.3.2-SNAPSHOT - eclipse-plugin - Scribble::Tools::Eclipse::Plugins::Editor - - - org.scribble.tools.eclipse - plugins - 0.3.2-SNAPSHOT - - - - diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/AbstractScribbleDslRuntimeModule.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/AbstractScribbleDslRuntimeModule.java deleted file mode 100644 index a78092ad7..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/AbstractScribbleDslRuntimeModule.java +++ /dev/null @@ -1,172 +0,0 @@ -/* - * generated by Xtext - */ -package org.scribble.editor.dsl; - -import java.util.Properties; - -import org.eclipse.xtext.Constants; -import org.eclipse.xtext.service.DefaultRuntimeModule; - -import com.google.inject.Binder; -import com.google.inject.name.Names; - -/** - * Manual modifications go to {org.scribble.editor.dsl.ScribbleDslRuntimeModule} - */ - @SuppressWarnings("all") -public abstract class AbstractScribbleDslRuntimeModule extends DefaultRuntimeModule { - - protected Properties properties = null; - - @Override - public void configure(Binder binder) { - properties = tryBindProperties(binder, "org/scribble/editor/dsl/ScribbleDsl.properties"); - super.configure(binder); - } - - public void configureLanguageName(Binder binder) { - binder.bind(String.class).annotatedWith(Names.named(Constants.LANGUAGE_NAME)).toInstance("org.scribble.editor.dsl.ScribbleDsl"); - } - - public void configureFileExtensions(Binder binder) { - if (properties == null || properties.getProperty(Constants.FILE_EXTENSIONS) == null) - binder.bind(String.class).annotatedWith(Names.named(Constants.FILE_EXTENSIONS)).toInstance("scr"); - } - - // contributed by org.eclipse.xtext.generator.grammarAccess.GrammarAccessFragment - public Class bindIGrammarAccess() { - return org.scribble.editor.dsl.services.ScribbleDslGrammarAccess.class; - } - - // contributed by org.eclipse.xtext.generator.serializer.SerializerFragment - public Class bindISemanticSequencer() { - return org.scribble.editor.dsl.serializer.ScribbleDslSemanticSequencer.class; - } - - // contributed by org.eclipse.xtext.generator.serializer.SerializerFragment - public Class bindISyntacticSequencer() { - return org.scribble.editor.dsl.serializer.ScribbleDslSyntacticSequencer.class; - } - - // contributed by org.eclipse.xtext.generator.serializer.SerializerFragment - public Class bindISerializer() { - return org.eclipse.xtext.serializer.impl.Serializer.class; - } - - // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment - public Class bindIParser() { - return org.scribble.editor.dsl.parser.antlr.ScribbleDslParser.class; - } - - // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment - public Class bindITokenToStringConverter() { - return org.eclipse.xtext.parser.antlr.AntlrTokenToStringConverter.class; - } - - // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment - public Class bindIAntlrTokenFileProvider() { - return org.scribble.editor.dsl.parser.antlr.ScribbleDslAntlrTokenFileProvider.class; - } - - // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment - public Class bindLexer() { - return org.scribble.editor.dsl.parser.antlr.internal.InternalScribbleDslLexer.class; - } - - // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment - public com.google.inject.Provider provideInternalScribbleDslLexer() { - return org.eclipse.xtext.parser.antlr.LexerProvider.create(org.scribble.editor.dsl.parser.antlr.internal.InternalScribbleDslLexer.class); - } - - // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment - public void configureRuntimeLexer(com.google.inject.Binder binder) { - binder.bind(org.eclipse.xtext.parser.antlr.Lexer.class).annotatedWith(com.google.inject.name.Names.named(org.eclipse.xtext.parser.antlr.LexerBindings.RUNTIME)).to(org.scribble.editor.dsl.parser.antlr.internal.InternalScribbleDslLexer.class); - } - - // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment - public Class bindITokenDefProvider() { - return org.eclipse.xtext.parser.antlr.AntlrTokenDefProvider.class; - } - - // contributed by org.eclipse.xtext.generator.validation.ValidatorFragment - @org.eclipse.xtext.service.SingletonBinding(eager=true) public Class bindScribbleDslValidator() { - return org.scribble.editor.dsl.validation.ScribbleDslValidator.class; - } - - // contributed by org.eclipse.xtext.generator.scoping.AbstractScopingFragment - public Class bindIScopeProvider() { - return org.scribble.editor.dsl.scoping.ScribbleDslScopeProvider.class; - } - - // contributed by org.eclipse.xtext.generator.scoping.AbstractScopingFragment - public void configureIScopeProviderDelegate(com.google.inject.Binder binder) { - binder.bind(org.eclipse.xtext.scoping.IScopeProvider.class).annotatedWith(com.google.inject.name.Names.named(org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider.NAMED_DELEGATE)).to(org.eclipse.xtext.scoping.impl.ImportedNamespaceAwareLocalScopeProvider.class); - } - - // contributed by org.eclipse.xtext.generator.scoping.AbstractScopingFragment - public void configureIgnoreCaseLinking(com.google.inject.Binder binder) { - binder.bindConstant().annotatedWith(org.eclipse.xtext.scoping.IgnoreCaseLinking.class).to(false); - } - - // contributed by org.eclipse.xtext.generator.exporting.QualifiedNamesFragment - public Class bindIQualifiedNameProvider() { - return org.eclipse.xtext.naming.DefaultDeclarativeQualifiedNameProvider.class; - } - - // contributed by org.eclipse.xtext.generator.builder.BuilderIntegrationFragment - public Class bindIContainer$Manager() { - return org.eclipse.xtext.resource.containers.StateBasedContainerManager.class; - } - - // contributed by org.eclipse.xtext.generator.builder.BuilderIntegrationFragment - public Class bindIAllContainersState$Provider() { - return org.eclipse.xtext.resource.containers.ResourceSetBasedAllContainersStateProvider.class; - } - - // contributed by org.eclipse.xtext.generator.builder.BuilderIntegrationFragment - public void configureIResourceDescriptions(com.google.inject.Binder binder) { - binder.bind(org.eclipse.xtext.resource.IResourceDescriptions.class).to(org.eclipse.xtext.resource.impl.ResourceSetBasedResourceDescriptions.class); - } - - // contributed by org.eclipse.xtext.generator.builder.BuilderIntegrationFragment - public void configureIResourceDescriptionsBuilderScope(com.google.inject.Binder binder) { - binder.bind(org.eclipse.xtext.resource.IResourceDescriptions.class).annotatedWith(com.google.inject.name.Names.named(org.eclipse.xtext.resource.impl.ResourceDescriptionsProvider.NAMED_BUILDER_SCOPE)).to(org.eclipse.xtext.resource.impl.ResourceSetBasedResourceDescriptions.class); - } - - // contributed by org.eclipse.xtext.generator.generator.GeneratorFragment - public Class bindIGenerator() { - return org.scribble.editor.dsl.generator.ScribbleDslGenerator.class; - } - - // contributed by org.eclipse.xtext.generator.formatting.FormatterFragment - public Class bindIFormatter() { - return org.scribble.editor.dsl.formatting.ScribbleDslFormatter.class; - } - - // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment - public java.lang.ClassLoader bindClassLoaderToInstance() { - return getClass().getClassLoader(); - } - - // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment - public org.eclipse.xtext.common.types.TypesFactory bindTypesFactoryToInstance() { - return org.eclipse.xtext.common.types.TypesFactory.eINSTANCE; - } - - // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment - public Class bindIJvmTypeProvider$Factory() { - return org.eclipse.xtext.common.types.access.ClasspathTypeProviderFactory.class; - } - - // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment - public Class bindAbstractTypeScopeProvider() { - return org.eclipse.xtext.common.types.xtext.ClasspathBasedTypeScopeProvider.class; - } - - // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment - public Class bindIGlobalScopeProvider() { - return org.eclipse.xtext.common.types.xtext.TypesAwareDefaultGlobalScopeProvider.class; - } - -} diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/ScribbleDsl.xtextbin b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/ScribbleDsl.xtextbin deleted file mode 100644 index 9afdb26db..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/ScribbleDsl.xtextbin and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/ScribbleDslStandaloneSetupGenerated.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/ScribbleDslStandaloneSetupGenerated.java deleted file mode 100644 index 3a38b9e96..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/ScribbleDslStandaloneSetupGenerated.java +++ /dev/null @@ -1,44 +0,0 @@ -/* -* generated by Xtext -*/ -package org.scribble.editor.dsl; - -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.xtext.ISetup; -import org.eclipse.emf.ecore.resource.Resource; - -import com.google.inject.Guice; -import com.google.inject.Injector; - -/** - * Generated from StandaloneSetup.xpt! - */ -@SuppressWarnings("all") -public class ScribbleDslStandaloneSetupGenerated implements ISetup { - - public Injector createInjectorAndDoEMFRegistration() { - org.eclipse.xtext.common.TerminalsStandaloneSetup.doSetup(); - - Injector injector = createInjector(); - register(injector); - return injector; - } - - public Injector createInjector() { - return Guice.createInjector(new org.scribble.editor.dsl.ScribbleDslRuntimeModule()); - } - - public void register(Injector injector) { - if (!EPackage.Registry.INSTANCE.containsKey("http://www.scribble.org/editor/dsl/ScribbleDsl")) { - EPackage.Registry.INSTANCE.put("http://www.scribble.org/editor/dsl/ScribbleDsl", org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage.eINSTANCE); - } - - org.eclipse.xtext.resource.IResourceFactory resourceFactory = injector.getInstance(org.eclipse.xtext.resource.IResourceFactory.class); - org.eclipse.xtext.resource.IResourceServiceProvider serviceProvider = injector.getInstance(org.eclipse.xtext.resource.IResourceServiceProvider.class); - Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("scr", resourceFactory); - org.eclipse.xtext.resource.IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("scr", serviceProvider); - - - - } -} diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/ScribbleDslAntlrTokenFileProvider.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/ScribbleDslAntlrTokenFileProvider.java deleted file mode 100644 index 09ff923c8..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/ScribbleDslAntlrTokenFileProvider.java +++ /dev/null @@ -1,15 +0,0 @@ -/* -* generated by Xtext -*/ -package org.scribble.editor.dsl.parser.antlr; - -import java.io.InputStream; -import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider; - -public class ScribbleDslAntlrTokenFileProvider implements IAntlrTokenFileProvider { - - public InputStream getAntlrTokenFile() { - ClassLoader classLoader = getClass().getClassLoader(); - return classLoader.getResourceAsStream("org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.tokens"); - } -} diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/ScribbleDslParser.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/ScribbleDslParser.java deleted file mode 100644 index 7910d2358..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/ScribbleDslParser.java +++ /dev/null @@ -1,39 +0,0 @@ -/* -* generated by Xtext -*/ -package org.scribble.editor.dsl.parser.antlr; - -import com.google.inject.Inject; - -import org.eclipse.xtext.parser.antlr.XtextTokenStream; -import org.scribble.editor.dsl.services.ScribbleDslGrammarAccess; - -public class ScribbleDslParser extends org.eclipse.xtext.parser.antlr.AbstractAntlrParser { - - @Inject - private ScribbleDslGrammarAccess grammarAccess; - - @Override - protected void setInitialHiddenTokens(XtextTokenStream tokenStream) { - tokenStream.setInitialHiddenTokens("RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT"); - } - - @Override - protected org.scribble.editor.dsl.parser.antlr.internal.InternalScribbleDslParser createParser(XtextTokenStream stream) { - return new org.scribble.editor.dsl.parser.antlr.internal.InternalScribbleDslParser(stream, getGrammarAccess()); - } - - @Override - protected String getDefaultRuleName() { - return "Module"; - } - - public ScribbleDslGrammarAccess getGrammarAccess() { - return this.grammarAccess; - } - - public void setGrammarAccess(ScribbleDslGrammarAccess grammarAccess) { - this.grammarAccess = grammarAccess; - } - -} diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g deleted file mode 100644 index e23510a26..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g +++ /dev/null @@ -1,3604 +0,0 @@ -/* -* generated by Xtext -*/ -grammar InternalScribbleDsl; - -options { - superClass=AbstractInternalAntlrParser; - -} - -@lexer::header { -package org.scribble.editor.dsl.parser.antlr.internal; - -// Hack: Use our own Lexer superclass by means of import. -// Currently there is no other way to specify the superclass for the lexer. -import org.eclipse.xtext.parser.antlr.Lexer; -} - -@parser::header { -package org.scribble.editor.dsl.parser.antlr.internal; - -import org.eclipse.xtext.*; -import org.eclipse.xtext.parser.*; -import org.eclipse.xtext.parser.impl.*; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.xtext.parser.antlr.AbstractInternalAntlrParser; -import org.eclipse.xtext.parser.antlr.XtextTokenStream; -import org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens; -import org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken; -import org.scribble.editor.dsl.services.ScribbleDslGrammarAccess; - -} - -@parser::members { - - private ScribbleDslGrammarAccess grammarAccess; - - public InternalScribbleDslParser(TokenStream input, ScribbleDslGrammarAccess grammarAccess) { - this(input); - this.grammarAccess = grammarAccess; - registerRules(grammarAccess.getGrammar()); - } - - @Override - protected String getFirstRuleName() { - return "Module"; - } - - @Override - protected ScribbleDslGrammarAccess getGrammarAccess() { - return grammarAccess; - } -} - -@rulecatch { - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } -} - - - - -// Entry rule entryRuleModule -entryRuleModule returns [EObject current=null] - : - { newCompositeNode(grammarAccess.getModuleRule()); } - iv_ruleModule=ruleModule - { $current=$iv_ruleModule.current; } - EOF -; - -// Rule Module -ruleModule returns [EObject current=null] - @init { enterRule(); - } - @after { leaveRule(); }: -( otherlv_0='module' - { - newLeafNode(otherlv_0, grammarAccess.getModuleAccess().getModuleKeyword_0()); - } -( -( - { - newCompositeNode(grammarAccess.getModuleAccess().getNameModuleNameParserRuleCall_1_0()); - } - lv_name_1_0=ruleModuleName { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getModuleRule()); - } - set( - $current, - "name", - lv_name_1_0, - "ModuleName"); - afterParserOrEnumRuleCall(); - } - -) -) otherlv_2=';' - { - newLeafNode(otherlv_2, grammarAccess.getModuleAccess().getSemicolonKeyword_2()); - } -( -( - { - newCompositeNode(grammarAccess.getModuleAccess().getImportsImportDeclParserRuleCall_3_0()); - } - lv_imports_3_0=ruleImportDecl { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getModuleRule()); - } - add( - $current, - "imports", - lv_imports_3_0, - "ImportDecl"); - afterParserOrEnumRuleCall(); - } - -) -)*( -( - { - newCompositeNode(grammarAccess.getModuleAccess().getTypesPayloadTypeDeclParserRuleCall_4_0()); - } - lv_types_4_0=rulePayloadTypeDecl { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getModuleRule()); - } - add( - $current, - "types", - lv_types_4_0, - "PayloadTypeDecl"); - afterParserOrEnumRuleCall(); - } - -) -)*(( -( - { - newCompositeNode(grammarAccess.getModuleAccess().getGlobalsGlobalProtocolDeclParserRuleCall_5_0_0()); - } - lv_globals_5_0=ruleGlobalProtocolDecl { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getModuleRule()); - } - add( - $current, - "globals", - lv_globals_5_0, - "GlobalProtocolDecl"); - afterParserOrEnumRuleCall(); - } - -) -) - |( -( - { - newCompositeNode(grammarAccess.getModuleAccess().getLocalsLocalProtocolDeclParserRuleCall_5_1_0()); - } - lv_locals_6_0=ruleLocalProtocolDecl { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getModuleRule()); - } - add( - $current, - "locals", - lv_locals_6_0, - "LocalProtocolDecl"); - afterParserOrEnumRuleCall(); - } - -) -))*) -; - - - - - -// Entry rule entryRuleModuleName -entryRuleModuleName returns [String current=null] - : - { newCompositeNode(grammarAccess.getModuleNameRule()); } - iv_ruleModuleName=ruleModuleName - { $current=$iv_ruleModuleName.current.getText(); } - EOF -; - -// Rule ModuleName -ruleModuleName returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] - @init { enterRule(); - } - @after { leaveRule(); }: -( this_ID_0=RULE_ID { - $current.merge(this_ID_0); - } - - { - newLeafNode(this_ID_0, grammarAccess.getModuleNameAccess().getIDTerminalRuleCall_0()); - } -( - kw='.' - { - $current.merge(kw); - newLeafNode(kw, grammarAccess.getModuleNameAccess().getFullStopKeyword_1_0()); - } - this_ID_2=RULE_ID { - $current.merge(this_ID_2); - } - - { - newLeafNode(this_ID_2, grammarAccess.getModuleNameAccess().getIDTerminalRuleCall_1_1()); - } -)*) - ; - - - - - -// Entry rule entryRuleImportDecl -entryRuleImportDecl returns [EObject current=null] - : - { newCompositeNode(grammarAccess.getImportDeclRule()); } - iv_ruleImportDecl=ruleImportDecl - { $current=$iv_ruleImportDecl.current; } - EOF -; - -// Rule ImportDecl -ruleImportDecl returns [EObject current=null] - @init { enterRule(); - } - @after { leaveRule(); }: -( - { - newCompositeNode(grammarAccess.getImportDeclAccess().getImportModuleParserRuleCall_0()); - } - this_ImportModule_0=ruleImportModule - { - $current = $this_ImportModule_0.current; - afterParserOrEnumRuleCall(); - } - - | - { - newCompositeNode(grammarAccess.getImportDeclAccess().getImportMemberParserRuleCall_1()); - } - this_ImportMember_1=ruleImportMember - { - $current = $this_ImportMember_1.current; - afterParserOrEnumRuleCall(); - } -) -; - - - - - -// Entry rule entryRuleImportModule -entryRuleImportModule returns [EObject current=null] - : - { newCompositeNode(grammarAccess.getImportModuleRule()); } - iv_ruleImportModule=ruleImportModule - { $current=$iv_ruleImportModule.current; } - EOF -; - -// Rule ImportModule -ruleImportModule returns [EObject current=null] - @init { enterRule(); - } - @after { leaveRule(); }: -( otherlv_0='import' - { - newLeafNode(otherlv_0, grammarAccess.getImportModuleAccess().getImportKeyword_0()); - } -( -( - { - newCompositeNode(grammarAccess.getImportModuleAccess().getNameModuleNameParserRuleCall_1_0()); - } - lv_name_1_0=ruleModuleName { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getImportModuleRule()); - } - set( - $current, - "name", - lv_name_1_0, - "ModuleName"); - afterParserOrEnumRuleCall(); - } - -) -)( otherlv_2='as' - { - newLeafNode(otherlv_2, grammarAccess.getImportModuleAccess().getAsKeyword_2_0()); - } -( -( - lv_alias_3_0=RULE_ID - { - newLeafNode(lv_alias_3_0, grammarAccess.getImportModuleAccess().getAliasIDTerminalRuleCall_2_1_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getImportModuleRule()); - } - setWithLastConsumed( - $current, - "alias", - lv_alias_3_0, - "ID"); - } - -) -))? otherlv_4=';' - { - newLeafNode(otherlv_4, grammarAccess.getImportModuleAccess().getSemicolonKeyword_3()); - } -) -; - - - - - -// Entry rule entryRuleImportMember -entryRuleImportMember returns [EObject current=null] - : - { newCompositeNode(grammarAccess.getImportMemberRule()); } - iv_ruleImportMember=ruleImportMember - { $current=$iv_ruleImportMember.current; } - EOF -; - -// Rule ImportMember -ruleImportMember returns [EObject current=null] - @init { enterRule(); - } - @after { leaveRule(); }: -( otherlv_0='from' - { - newLeafNode(otherlv_0, grammarAccess.getImportMemberAccess().getFromKeyword_0()); - } -( -( - { - newCompositeNode(grammarAccess.getImportMemberAccess().getNameModuleNameParserRuleCall_1_0()); - } - lv_name_1_0=ruleModuleName { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getImportMemberRule()); - } - set( - $current, - "name", - lv_name_1_0, - "ModuleName"); - afterParserOrEnumRuleCall(); - } - -) -) otherlv_2='import' - { - newLeafNode(otherlv_2, grammarAccess.getImportMemberAccess().getImportKeyword_2()); - } -( -( - lv_member_3_0=RULE_ID - { - newLeafNode(lv_member_3_0, grammarAccess.getImportMemberAccess().getMemberIDTerminalRuleCall_3_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getImportMemberRule()); - } - setWithLastConsumed( - $current, - "member", - lv_member_3_0, - "ID"); - } - -) -)( otherlv_4='as' - { - newLeafNode(otherlv_4, grammarAccess.getImportMemberAccess().getAsKeyword_4_0()); - } -( -( - lv_alias_5_0=RULE_ID - { - newLeafNode(lv_alias_5_0, grammarAccess.getImportMemberAccess().getAliasIDTerminalRuleCall_4_1_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getImportMemberRule()); - } - setWithLastConsumed( - $current, - "alias", - lv_alias_5_0, - "ID"); - } - -) -))? otherlv_6=';' - { - newLeafNode(otherlv_6, grammarAccess.getImportMemberAccess().getSemicolonKeyword_5()); - } -) -; - - - - - -// Entry rule entryRulePayloadTypeDecl -entryRulePayloadTypeDecl returns [EObject current=null] - : - { newCompositeNode(grammarAccess.getPayloadTypeDeclRule()); } - iv_rulePayloadTypeDecl=rulePayloadTypeDecl - { $current=$iv_rulePayloadTypeDecl.current; } - EOF -; - -// Rule PayloadTypeDecl -rulePayloadTypeDecl returns [EObject current=null] - @init { enterRule(); - } - @after { leaveRule(); }: -( otherlv_0='type' - { - newLeafNode(otherlv_0, grammarAccess.getPayloadTypeDeclAccess().getTypeKeyword_0()); - } - otherlv_1='<' - { - newLeafNode(otherlv_1, grammarAccess.getPayloadTypeDeclAccess().getLessThanSignKeyword_1()); - } -( -( - lv_schema_2_0=RULE_ID - { - newLeafNode(lv_schema_2_0, grammarAccess.getPayloadTypeDeclAccess().getSchemaIDTerminalRuleCall_2_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getPayloadTypeDeclRule()); - } - setWithLastConsumed( - $current, - "schema", - lv_schema_2_0, - "ID"); - } - -) -) otherlv_3='>' - { - newLeafNode(otherlv_3, grammarAccess.getPayloadTypeDeclAccess().getGreaterThanSignKeyword_3()); - } -( -( - lv_type_4_0=RULE_STRING - { - newLeafNode(lv_type_4_0, grammarAccess.getPayloadTypeDeclAccess().getTypeSTRINGTerminalRuleCall_4_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getPayloadTypeDeclRule()); - } - setWithLastConsumed( - $current, - "type", - lv_type_4_0, - "STRING"); - } - -) -) otherlv_5='from' - { - newLeafNode(otherlv_5, grammarAccess.getPayloadTypeDeclAccess().getFromKeyword_5()); - } -( -( - lv_location_6_0=RULE_STRING - { - newLeafNode(lv_location_6_0, grammarAccess.getPayloadTypeDeclAccess().getLocationSTRINGTerminalRuleCall_6_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getPayloadTypeDeclRule()); - } - setWithLastConsumed( - $current, - "location", - lv_location_6_0, - "STRING"); - } - -) -) otherlv_7='as' - { - newLeafNode(otherlv_7, grammarAccess.getPayloadTypeDeclAccess().getAsKeyword_7()); - } -( -( - lv_alias_8_0=RULE_ID - { - newLeafNode(lv_alias_8_0, grammarAccess.getPayloadTypeDeclAccess().getAliasIDTerminalRuleCall_8_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getPayloadTypeDeclRule()); - } - setWithLastConsumed( - $current, - "alias", - lv_alias_8_0, - "ID"); - } - -) -) otherlv_9=';' - { - newLeafNode(otherlv_9, grammarAccess.getPayloadTypeDeclAccess().getSemicolonKeyword_9()); - } -) -; - - - - - -// Entry rule entryRuleMessageSignature -entryRuleMessageSignature returns [EObject current=null] - : - { newCompositeNode(grammarAccess.getMessageSignatureRule()); } - iv_ruleMessageSignature=ruleMessageSignature - { $current=$iv_ruleMessageSignature.current; } - EOF -; - -// Rule MessageSignature -ruleMessageSignature returns [EObject current=null] - @init { enterRule(); - } - @after { leaveRule(); }: -(( - { - $current = forceCreateModelElement( - grammarAccess.getMessageSignatureAccess().getMessageSignatureAction_0(), - $current); - } -)( -( - lv_operator_1_0=RULE_ID - { - newLeafNode(lv_operator_1_0, grammarAccess.getMessageSignatureAccess().getOperatorIDTerminalRuleCall_1_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getMessageSignatureRule()); - } - setWithLastConsumed( - $current, - "operator", - lv_operator_1_0, - "ID"); - } - -) -)? otherlv_2='(' - { - newLeafNode(otherlv_2, grammarAccess.getMessageSignatureAccess().getLeftParenthesisKeyword_2()); - } -(( -( - { - newCompositeNode(grammarAccess.getMessageSignatureAccess().getTypesPayloadElementParserRuleCall_3_0_0()); - } - lv_types_3_0=rulePayloadElement { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getMessageSignatureRule()); - } - add( - $current, - "types", - lv_types_3_0, - "PayloadElement"); - afterParserOrEnumRuleCall(); - } - -) -)( otherlv_4=',' - { - newLeafNode(otherlv_4, grammarAccess.getMessageSignatureAccess().getCommaKeyword_3_1_0()); - } -( -( - { - newCompositeNode(grammarAccess.getMessageSignatureAccess().getTypesPayloadElementParserRuleCall_3_1_1_0()); - } - lv_types_5_0=rulePayloadElement { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getMessageSignatureRule()); - } - add( - $current, - "types", - lv_types_5_0, - "PayloadElement"); - afterParserOrEnumRuleCall(); - } - -) -))*)? otherlv_6=')' - { - newLeafNode(otherlv_6, grammarAccess.getMessageSignatureAccess().getRightParenthesisKeyword_4()); - } -) -; - - - - - -// Entry rule entryRulePayloadElement -entryRulePayloadElement returns [EObject current=null] - : - { newCompositeNode(grammarAccess.getPayloadElementRule()); } - iv_rulePayloadElement=rulePayloadElement - { $current=$iv_rulePayloadElement.current; } - EOF -; - -// Rule PayloadElement -rulePayloadElement returns [EObject current=null] - @init { enterRule(); - } - @after { leaveRule(); }: -((( -( - lv_name_0_0=RULE_ID - { - newLeafNode(lv_name_0_0, grammarAccess.getPayloadElementAccess().getNameIDTerminalRuleCall_0_0_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getPayloadElementRule()); - } - setWithLastConsumed( - $current, - "name", - lv_name_0_0, - "ID"); - } - -) -) otherlv_1=':' - { - newLeafNode(otherlv_1, grammarAccess.getPayloadElementAccess().getColonKeyword_0_1()); - } -)?( -( - lv_type_2_0=RULE_ID - { - newLeafNode(lv_type_2_0, grammarAccess.getPayloadElementAccess().getTypeIDTerminalRuleCall_1_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getPayloadElementRule()); - } - setWithLastConsumed( - $current, - "type", - lv_type_2_0, - "ID"); - } - -) -)) -; - - - - - -// Entry rule entryRuleGlobalProtocolDecl -entryRuleGlobalProtocolDecl returns [EObject current=null] - : - { newCompositeNode(grammarAccess.getGlobalProtocolDeclRule()); } - iv_ruleGlobalProtocolDecl=ruleGlobalProtocolDecl - { $current=$iv_ruleGlobalProtocolDecl.current; } - EOF -; - -// Rule GlobalProtocolDecl -ruleGlobalProtocolDecl returns [EObject current=null] - @init { enterRule(); - } - @after { leaveRule(); }: -( otherlv_0='global' - { - newLeafNode(otherlv_0, grammarAccess.getGlobalProtocolDeclAccess().getGlobalKeyword_0()); - } - otherlv_1='protocol' - { - newLeafNode(otherlv_1, grammarAccess.getGlobalProtocolDeclAccess().getProtocolKeyword_1()); - } -( -( - lv_name_2_0=RULE_ID - { - newLeafNode(lv_name_2_0, grammarAccess.getGlobalProtocolDeclAccess().getNameIDTerminalRuleCall_2_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getGlobalProtocolDeclRule()); - } - setWithLastConsumed( - $current, - "name", - lv_name_2_0, - "ID"); - } - -) -)( otherlv_3='<' - { - newLeafNode(otherlv_3, grammarAccess.getGlobalProtocolDeclAccess().getLessThanSignKeyword_3_0()); - } -( -( - { - newCompositeNode(grammarAccess.getGlobalProtocolDeclAccess().getParametersParameterDeclParserRuleCall_3_1_0()); - } - lv_parameters_4_0=ruleParameterDecl { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getGlobalProtocolDeclRule()); - } - add( - $current, - "parameters", - lv_parameters_4_0, - "ParameterDecl"); - afterParserOrEnumRuleCall(); - } - -) -)( otherlv_5=',' - { - newLeafNode(otherlv_5, grammarAccess.getGlobalProtocolDeclAccess().getCommaKeyword_3_2_0()); - } -( -( - { - newCompositeNode(grammarAccess.getGlobalProtocolDeclAccess().getParametersParameterDeclParserRuleCall_3_2_1_0()); - } - lv_parameters_6_0=ruleParameterDecl { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getGlobalProtocolDeclRule()); - } - add( - $current, - "parameters", - lv_parameters_6_0, - "ParameterDecl"); - afterParserOrEnumRuleCall(); - } - -) -))* otherlv_7='>' - { - newLeafNode(otherlv_7, grammarAccess.getGlobalProtocolDeclAccess().getGreaterThanSignKeyword_3_3()); - } -)? otherlv_8='(' - { - newLeafNode(otherlv_8, grammarAccess.getGlobalProtocolDeclAccess().getLeftParenthesisKeyword_4()); - } -( -( - { - newCompositeNode(grammarAccess.getGlobalProtocolDeclAccess().getRolesRoleDeclParserRuleCall_5_0()); - } - lv_roles_9_0=ruleRoleDecl { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getGlobalProtocolDeclRule()); - } - add( - $current, - "roles", - lv_roles_9_0, - "RoleDecl"); - afterParserOrEnumRuleCall(); - } - -) -)( otherlv_10=',' - { - newLeafNode(otherlv_10, grammarAccess.getGlobalProtocolDeclAccess().getCommaKeyword_6_0()); - } -( -( - { - newCompositeNode(grammarAccess.getGlobalProtocolDeclAccess().getRolesRoleDeclParserRuleCall_6_1_0()); - } - lv_roles_11_0=ruleRoleDecl { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getGlobalProtocolDeclRule()); - } - add( - $current, - "roles", - lv_roles_11_0, - "RoleDecl"); - afterParserOrEnumRuleCall(); - } - -) -))* otherlv_12=')' - { - newLeafNode(otherlv_12, grammarAccess.getGlobalProtocolDeclAccess().getRightParenthesisKeyword_7()); - } -(( -( - { - newCompositeNode(grammarAccess.getGlobalProtocolDeclAccess().getBlockGlobalProtocolBlockParserRuleCall_8_0_0()); - } - lv_block_13_0=ruleGlobalProtocolBlock { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getGlobalProtocolDeclRule()); - } - set( - $current, - "block", - lv_block_13_0, - "GlobalProtocolBlock"); - afterParserOrEnumRuleCall(); - } - -) -) - |( otherlv_14='instantiates' - { - newLeafNode(otherlv_14, grammarAccess.getGlobalProtocolDeclAccess().getInstantiatesKeyword_8_1_0()); - } -( -( - lv_instantiates_15_0=RULE_ID - { - newLeafNode(lv_instantiates_15_0, grammarAccess.getGlobalProtocolDeclAccess().getInstantiatesIDTerminalRuleCall_8_1_1_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getGlobalProtocolDeclRule()); - } - setWithLastConsumed( - $current, - "instantiates", - lv_instantiates_15_0, - "ID"); - } - -) -)( otherlv_16='<' - { - newLeafNode(otherlv_16, grammarAccess.getGlobalProtocolDeclAccess().getLessThanSignKeyword_8_1_2_0()); - } -( -( - { - newCompositeNode(grammarAccess.getGlobalProtocolDeclAccess().getArgumentsArgumentParserRuleCall_8_1_2_1_0()); - } - lv_arguments_17_0=ruleArgument { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getGlobalProtocolDeclRule()); - } - add( - $current, - "arguments", - lv_arguments_17_0, - "Argument"); - afterParserOrEnumRuleCall(); - } - -) -)( otherlv_18=',' - { - newLeafNode(otherlv_18, grammarAccess.getGlobalProtocolDeclAccess().getCommaKeyword_8_1_2_2_0()); - } -( -( - { - newCompositeNode(grammarAccess.getGlobalProtocolDeclAccess().getArgumentsArgumentParserRuleCall_8_1_2_2_1_0()); - } - lv_arguments_19_0=ruleArgument { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getGlobalProtocolDeclRule()); - } - add( - $current, - "arguments", - lv_arguments_19_0, - "Argument"); - afterParserOrEnumRuleCall(); - } - -) -))* otherlv_20='>' - { - newLeafNode(otherlv_20, grammarAccess.getGlobalProtocolDeclAccess().getGreaterThanSignKeyword_8_1_2_3()); - } -)? otherlv_21='(' - { - newLeafNode(otherlv_21, grammarAccess.getGlobalProtocolDeclAccess().getLeftParenthesisKeyword_8_1_3()); - } -( -( - { - newCompositeNode(grammarAccess.getGlobalProtocolDeclAccess().getRoleInstantiationsRoleInstantiationParserRuleCall_8_1_4_0()); - } - lv_roleInstantiations_22_0=ruleRoleInstantiation { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getGlobalProtocolDeclRule()); - } - add( - $current, - "roleInstantiations", - lv_roleInstantiations_22_0, - "RoleInstantiation"); - afterParserOrEnumRuleCall(); - } - -) -)( otherlv_23=',' - { - newLeafNode(otherlv_23, grammarAccess.getGlobalProtocolDeclAccess().getCommaKeyword_8_1_5_0()); - } -( -( - { - newCompositeNode(grammarAccess.getGlobalProtocolDeclAccess().getRoleInstantiationsRoleInstantiationParserRuleCall_8_1_5_1_0()); - } - lv_roleInstantiations_24_0=ruleRoleInstantiation { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getGlobalProtocolDeclRule()); - } - add( - $current, - "roleInstantiations", - lv_roleInstantiations_24_0, - "RoleInstantiation"); - afterParserOrEnumRuleCall(); - } - -) -))* otherlv_25=')' - { - newLeafNode(otherlv_25, grammarAccess.getGlobalProtocolDeclAccess().getRightParenthesisKeyword_8_1_6()); - } - otherlv_26=';' - { - newLeafNode(otherlv_26, grammarAccess.getGlobalProtocolDeclAccess().getSemicolonKeyword_8_1_7()); - } -))) -; - - - - - -// Entry rule entryRuleRoleDecl -entryRuleRoleDecl returns [EObject current=null] - : - { newCompositeNode(grammarAccess.getRoleDeclRule()); } - iv_ruleRoleDecl=ruleRoleDecl - { $current=$iv_ruleRoleDecl.current; } - EOF -; - -// Rule RoleDecl -ruleRoleDecl returns [EObject current=null] - @init { enterRule(); - } - @after { leaveRule(); }: -( otherlv_0='role' - { - newLeafNode(otherlv_0, grammarAccess.getRoleDeclAccess().getRoleKeyword_0()); - } -( -( - lv_name_1_0=RULE_ID - { - newLeafNode(lv_name_1_0, grammarAccess.getRoleDeclAccess().getNameIDTerminalRuleCall_1_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getRoleDeclRule()); - } - setWithLastConsumed( - $current, - "name", - lv_name_1_0, - "ID"); - } - -) -)( otherlv_2='as' - { - newLeafNode(otherlv_2, grammarAccess.getRoleDeclAccess().getAsKeyword_2_0()); - } -( -( - lv_alias_3_0=RULE_ID - { - newLeafNode(lv_alias_3_0, grammarAccess.getRoleDeclAccess().getAliasIDTerminalRuleCall_2_1_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getRoleDeclRule()); - } - setWithLastConsumed( - $current, - "alias", - lv_alias_3_0, - "ID"); - } - -) -))?) -; - - - - - -// Entry rule entryRuleParameterDecl -entryRuleParameterDecl returns [EObject current=null] - : - { newCompositeNode(grammarAccess.getParameterDeclRule()); } - iv_ruleParameterDecl=ruleParameterDecl - { $current=$iv_ruleParameterDecl.current; } - EOF -; - -// Rule ParameterDecl -ruleParameterDecl returns [EObject current=null] - @init { enterRule(); - } - @after { leaveRule(); }: -(( otherlv_0='type' - { - newLeafNode(otherlv_0, grammarAccess.getParameterDeclAccess().getTypeKeyword_0_0()); - } -( -( - lv_name_1_0=RULE_ID - { - newLeafNode(lv_name_1_0, grammarAccess.getParameterDeclAccess().getNameIDTerminalRuleCall_0_1_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getParameterDeclRule()); - } - setWithLastConsumed( - $current, - "name", - lv_name_1_0, - "ID"); - } - -) -)( otherlv_2='as' - { - newLeafNode(otherlv_2, grammarAccess.getParameterDeclAccess().getAsKeyword_0_2_0()); - } -( -( - lv_alias_3_0=RULE_ID - { - newLeafNode(lv_alias_3_0, grammarAccess.getParameterDeclAccess().getAliasIDTerminalRuleCall_0_2_1_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getParameterDeclRule()); - } - setWithLastConsumed( - $current, - "alias", - lv_alias_3_0, - "ID"); - } - -) -))?) - |( otherlv_4='sig' - { - newLeafNode(otherlv_4, grammarAccess.getParameterDeclAccess().getSigKeyword_1_0()); - } -( -( - lv_name_5_0=RULE_ID - { - newLeafNode(lv_name_5_0, grammarAccess.getParameterDeclAccess().getNameIDTerminalRuleCall_1_1_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getParameterDeclRule()); - } - setWithLastConsumed( - $current, - "name", - lv_name_5_0, - "ID"); - } - -) -)( otherlv_6='as' - { - newLeafNode(otherlv_6, grammarAccess.getParameterDeclAccess().getAsKeyword_1_2_0()); - } -( -( - lv_alias_7_0=RULE_ID - { - newLeafNode(lv_alias_7_0, grammarAccess.getParameterDeclAccess().getAliasIDTerminalRuleCall_1_2_1_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getParameterDeclRule()); - } - setWithLastConsumed( - $current, - "alias", - lv_alias_7_0, - "ID"); - } - -) -))?)) -; - - - - - -// Entry rule entryRuleRoleInstantiation -entryRuleRoleInstantiation returns [EObject current=null] - : - { newCompositeNode(grammarAccess.getRoleInstantiationRule()); } - iv_ruleRoleInstantiation=ruleRoleInstantiation - { $current=$iv_ruleRoleInstantiation.current; } - EOF -; - -// Rule RoleInstantiation -ruleRoleInstantiation returns [EObject current=null] - @init { enterRule(); - } - @after { leaveRule(); }: -(( -( - lv_name_0_0=RULE_ID - { - newLeafNode(lv_name_0_0, grammarAccess.getRoleInstantiationAccess().getNameIDTerminalRuleCall_0_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getRoleInstantiationRule()); - } - setWithLastConsumed( - $current, - "name", - lv_name_0_0, - "ID"); - } - -) -)( otherlv_1='as' - { - newLeafNode(otherlv_1, grammarAccess.getRoleInstantiationAccess().getAsKeyword_1_0()); - } -( -( - lv_alias_2_0=RULE_ID - { - newLeafNode(lv_alias_2_0, grammarAccess.getRoleInstantiationAccess().getAliasIDTerminalRuleCall_1_1_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getRoleInstantiationRule()); - } - setWithLastConsumed( - $current, - "alias", - lv_alias_2_0, - "ID"); - } - -) -))?) -; - - - - - -// Entry rule entryRuleArgument -entryRuleArgument returns [EObject current=null] - : - { newCompositeNode(grammarAccess.getArgumentRule()); } - iv_ruleArgument=ruleArgument - { $current=$iv_ruleArgument.current; } - EOF -; - -// Rule Argument -ruleArgument returns [EObject current=null] - @init { enterRule(); - } - @after { leaveRule(); }: -((( -( - { - newCompositeNode(grammarAccess.getArgumentAccess().getSignatureMessageSignatureParserRuleCall_0_0_0()); - } - lv_signature_0_0=ruleMessageSignature { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getArgumentRule()); - } - set( - $current, - "signature", - lv_signature_0_0, - "MessageSignature"); - afterParserOrEnumRuleCall(); - } - -) -)( otherlv_1='as' - { - newLeafNode(otherlv_1, grammarAccess.getArgumentAccess().getAsKeyword_0_1_0()); - } -( -( - lv_alias_2_0=RULE_ID - { - newLeafNode(lv_alias_2_0, grammarAccess.getArgumentAccess().getAliasIDTerminalRuleCall_0_1_1_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getArgumentRule()); - } - setWithLastConsumed( - $current, - "alias", - lv_alias_2_0, - "ID"); - } - -) -))?) - |(( -( - lv_name_3_0=RULE_ID - { - newLeafNode(lv_name_3_0, grammarAccess.getArgumentAccess().getNameIDTerminalRuleCall_1_0_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getArgumentRule()); - } - setWithLastConsumed( - $current, - "name", - lv_name_3_0, - "ID"); - } - -) -)( otherlv_4='as' - { - newLeafNode(otherlv_4, grammarAccess.getArgumentAccess().getAsKeyword_1_1_0()); - } -( -( - lv_alias_5_0=RULE_ID - { - newLeafNode(lv_alias_5_0, grammarAccess.getArgumentAccess().getAliasIDTerminalRuleCall_1_1_1_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getArgumentRule()); - } - setWithLastConsumed( - $current, - "alias", - lv_alias_5_0, - "ID"); - } - -) -))?)) -; - - - - - -// Entry rule entryRuleGlobalProtocolBlock -entryRuleGlobalProtocolBlock returns [EObject current=null] - : - { newCompositeNode(grammarAccess.getGlobalProtocolBlockRule()); } - iv_ruleGlobalProtocolBlock=ruleGlobalProtocolBlock - { $current=$iv_ruleGlobalProtocolBlock.current; } - EOF -; - -// Rule GlobalProtocolBlock -ruleGlobalProtocolBlock returns [EObject current=null] - @init { enterRule(); - } - @after { leaveRule(); }: -(( - { - $current = forceCreateModelElement( - grammarAccess.getGlobalProtocolBlockAccess().getGlobalProtocolBlockAction_0(), - $current); - } -) otherlv_1='{' - { - newLeafNode(otherlv_1, grammarAccess.getGlobalProtocolBlockAccess().getLeftCurlyBracketKeyword_1()); - } -( -( - { - newCompositeNode(grammarAccess.getGlobalProtocolBlockAccess().getActivitiesGlobalInteractionParserRuleCall_2_0()); - } - lv_activities_2_0=ruleGlobalInteraction { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getGlobalProtocolBlockRule()); - } - add( - $current, - "activities", - lv_activities_2_0, - "GlobalInteraction"); - afterParserOrEnumRuleCall(); - } - -) -)* otherlv_3='}' - { - newLeafNode(otherlv_3, grammarAccess.getGlobalProtocolBlockAccess().getRightCurlyBracketKeyword_3()); - } -) -; - - - - - -// Entry rule entryRuleGlobalInteraction -entryRuleGlobalInteraction returns [EObject current=null] - : - { newCompositeNode(grammarAccess.getGlobalInteractionRule()); } - iv_ruleGlobalInteraction=ruleGlobalInteraction - { $current=$iv_ruleGlobalInteraction.current; } - EOF -; - -// Rule GlobalInteraction -ruleGlobalInteraction returns [EObject current=null] - @init { enterRule(); - } - @after { leaveRule(); }: -( - { - newCompositeNode(grammarAccess.getGlobalInteractionAccess().getGlobalMessageTransferParserRuleCall_0()); - } - this_GlobalMessageTransfer_0=ruleGlobalMessageTransfer - { - $current = $this_GlobalMessageTransfer_0.current; - afterParserOrEnumRuleCall(); - } - - | - { - newCompositeNode(grammarAccess.getGlobalInteractionAccess().getGlobalChoiceParserRuleCall_1()); - } - this_GlobalChoice_1=ruleGlobalChoice - { - $current = $this_GlobalChoice_1.current; - afterParserOrEnumRuleCall(); - } - - | - { - newCompositeNode(grammarAccess.getGlobalInteractionAccess().getGlobalRecursionParserRuleCall_2()); - } - this_GlobalRecursion_2=ruleGlobalRecursion - { - $current = $this_GlobalRecursion_2.current; - afterParserOrEnumRuleCall(); - } - - | - { - newCompositeNode(grammarAccess.getGlobalInteractionAccess().getGlobalContinueParserRuleCall_3()); - } - this_GlobalContinue_3=ruleGlobalContinue - { - $current = $this_GlobalContinue_3.current; - afterParserOrEnumRuleCall(); - } - - | - { - newCompositeNode(grammarAccess.getGlobalInteractionAccess().getGlobalParallelParserRuleCall_4()); - } - this_GlobalParallel_4=ruleGlobalParallel - { - $current = $this_GlobalParallel_4.current; - afterParserOrEnumRuleCall(); - } - - | - { - newCompositeNode(grammarAccess.getGlobalInteractionAccess().getGlobalInterruptibleParserRuleCall_5()); - } - this_GlobalInterruptible_5=ruleGlobalInterruptible - { - $current = $this_GlobalInterruptible_5.current; - afterParserOrEnumRuleCall(); - } - - | - { - newCompositeNode(grammarAccess.getGlobalInteractionAccess().getGlobalDoParserRuleCall_6()); - } - this_GlobalDo_6=ruleGlobalDo - { - $current = $this_GlobalDo_6.current; - afterParserOrEnumRuleCall(); - } -) -; - - - - - -// Entry rule entryRuleGlobalMessageTransfer -entryRuleGlobalMessageTransfer returns [EObject current=null] - : - { newCompositeNode(grammarAccess.getGlobalMessageTransferRule()); } - iv_ruleGlobalMessageTransfer=ruleGlobalMessageTransfer - { $current=$iv_ruleGlobalMessageTransfer.current; } - EOF -; - -// Rule GlobalMessageTransfer -ruleGlobalMessageTransfer returns [EObject current=null] - @init { enterRule(); - } - @after { leaveRule(); }: -(( -( - { - newCompositeNode(grammarAccess.getGlobalMessageTransferAccess().getMessageMessageParserRuleCall_0_0()); - } - lv_message_0_0=ruleMessage { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getGlobalMessageTransferRule()); - } - set( - $current, - "message", - lv_message_0_0, - "Message"); - afterParserOrEnumRuleCall(); - } - -) -) otherlv_1='from' - { - newLeafNode(otherlv_1, grammarAccess.getGlobalMessageTransferAccess().getFromKeyword_1()); - } -( -( - lv_fromRole_2_0=RULE_ID - { - newLeafNode(lv_fromRole_2_0, grammarAccess.getGlobalMessageTransferAccess().getFromRoleIDTerminalRuleCall_2_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getGlobalMessageTransferRule()); - } - setWithLastConsumed( - $current, - "fromRole", - lv_fromRole_2_0, - "ID"); - } - -) -) otherlv_3='to' - { - newLeafNode(otherlv_3, grammarAccess.getGlobalMessageTransferAccess().getToKeyword_3()); - } -( -( - lv_toRoles_4_0=RULE_ID - { - newLeafNode(lv_toRoles_4_0, grammarAccess.getGlobalMessageTransferAccess().getToRolesIDTerminalRuleCall_4_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getGlobalMessageTransferRule()); - } - addWithLastConsumed( - $current, - "toRoles", - lv_toRoles_4_0, - "ID"); - } - -) -)( otherlv_5=',' - { - newLeafNode(otherlv_5, grammarAccess.getGlobalMessageTransferAccess().getCommaKeyword_5_0()); - } -( -( - lv_toRoles_6_0=RULE_ID - { - newLeafNode(lv_toRoles_6_0, grammarAccess.getGlobalMessageTransferAccess().getToRolesIDTerminalRuleCall_5_1_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getGlobalMessageTransferRule()); - } - addWithLastConsumed( - $current, - "toRoles", - lv_toRoles_6_0, - "ID"); - } - -) -))* otherlv_7=';' - { - newLeafNode(otherlv_7, grammarAccess.getGlobalMessageTransferAccess().getSemicolonKeyword_6()); - } -) -; - - - - - -// Entry rule entryRuleMessage -entryRuleMessage returns [EObject current=null] - : - { newCompositeNode(grammarAccess.getMessageRule()); } - iv_ruleMessage=ruleMessage - { $current=$iv_ruleMessage.current; } - EOF -; - -// Rule Message -ruleMessage returns [EObject current=null] - @init { enterRule(); - } - @after { leaveRule(); }: -(( -( - { - newCompositeNode(grammarAccess.getMessageAccess().getSignatureMessageSignatureParserRuleCall_0_0()); - } - lv_signature_0_0=ruleMessageSignature { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getMessageRule()); - } - set( - $current, - "signature", - lv_signature_0_0, - "MessageSignature"); - afterParserOrEnumRuleCall(); - } - -) -) - |( -( - lv_parameter_1_0=RULE_ID - { - newLeafNode(lv_parameter_1_0, grammarAccess.getMessageAccess().getParameterIDTerminalRuleCall_1_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getMessageRule()); - } - setWithLastConsumed( - $current, - "parameter", - lv_parameter_1_0, - "ID"); - } - -) -)) -; - - - - - -// Entry rule entryRuleGlobalChoice -entryRuleGlobalChoice returns [EObject current=null] - : - { newCompositeNode(grammarAccess.getGlobalChoiceRule()); } - iv_ruleGlobalChoice=ruleGlobalChoice - { $current=$iv_ruleGlobalChoice.current; } - EOF -; - -// Rule GlobalChoice -ruleGlobalChoice returns [EObject current=null] - @init { enterRule(); - } - @after { leaveRule(); }: -( otherlv_0='choice' - { - newLeafNode(otherlv_0, grammarAccess.getGlobalChoiceAccess().getChoiceKeyword_0()); - } - otherlv_1='at' - { - newLeafNode(otherlv_1, grammarAccess.getGlobalChoiceAccess().getAtKeyword_1()); - } -( -( - lv_role_2_0=RULE_ID - { - newLeafNode(lv_role_2_0, grammarAccess.getGlobalChoiceAccess().getRoleIDTerminalRuleCall_2_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getGlobalChoiceRule()); - } - setWithLastConsumed( - $current, - "role", - lv_role_2_0, - "ID"); - } - -) -)( -( - { - newCompositeNode(grammarAccess.getGlobalChoiceAccess().getBlocksGlobalProtocolBlockParserRuleCall_3_0()); - } - lv_blocks_3_0=ruleGlobalProtocolBlock { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getGlobalChoiceRule()); - } - add( - $current, - "blocks", - lv_blocks_3_0, - "GlobalProtocolBlock"); - afterParserOrEnumRuleCall(); - } - -) -)( otherlv_4='or' - { - newLeafNode(otherlv_4, grammarAccess.getGlobalChoiceAccess().getOrKeyword_4_0()); - } -( -( - { - newCompositeNode(grammarAccess.getGlobalChoiceAccess().getBlocksGlobalProtocolBlockParserRuleCall_4_1_0()); - } - lv_blocks_5_0=ruleGlobalProtocolBlock { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getGlobalChoiceRule()); - } - add( - $current, - "blocks", - lv_blocks_5_0, - "GlobalProtocolBlock"); - afterParserOrEnumRuleCall(); - } - -) -))*) -; - - - - - -// Entry rule entryRuleGlobalRecursion -entryRuleGlobalRecursion returns [EObject current=null] - : - { newCompositeNode(grammarAccess.getGlobalRecursionRule()); } - iv_ruleGlobalRecursion=ruleGlobalRecursion - { $current=$iv_ruleGlobalRecursion.current; } - EOF -; - -// Rule GlobalRecursion -ruleGlobalRecursion returns [EObject current=null] - @init { enterRule(); - } - @after { leaveRule(); }: -( otherlv_0='rec' - { - newLeafNode(otherlv_0, grammarAccess.getGlobalRecursionAccess().getRecKeyword_0()); - } -( -( - lv_label_1_0=RULE_ID - { - newLeafNode(lv_label_1_0, grammarAccess.getGlobalRecursionAccess().getLabelIDTerminalRuleCall_1_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getGlobalRecursionRule()); - } - setWithLastConsumed( - $current, - "label", - lv_label_1_0, - "ID"); - } - -) -)( -( - { - newCompositeNode(grammarAccess.getGlobalRecursionAccess().getBlockGlobalProtocolBlockParserRuleCall_2_0()); - } - lv_block_2_0=ruleGlobalProtocolBlock { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getGlobalRecursionRule()); - } - set( - $current, - "block", - lv_block_2_0, - "GlobalProtocolBlock"); - afterParserOrEnumRuleCall(); - } - -) -)) -; - - - - - -// Entry rule entryRuleGlobalContinue -entryRuleGlobalContinue returns [EObject current=null] - : - { newCompositeNode(grammarAccess.getGlobalContinueRule()); } - iv_ruleGlobalContinue=ruleGlobalContinue - { $current=$iv_ruleGlobalContinue.current; } - EOF -; - -// Rule GlobalContinue -ruleGlobalContinue returns [EObject current=null] - @init { enterRule(); - } - @after { leaveRule(); }: -( otherlv_0='continue' - { - newLeafNode(otherlv_0, grammarAccess.getGlobalContinueAccess().getContinueKeyword_0()); - } -( -( - lv_label_1_0=RULE_ID - { - newLeafNode(lv_label_1_0, grammarAccess.getGlobalContinueAccess().getLabelIDTerminalRuleCall_1_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getGlobalContinueRule()); - } - setWithLastConsumed( - $current, - "label", - lv_label_1_0, - "ID"); - } - -) -) otherlv_2=';' - { - newLeafNode(otherlv_2, grammarAccess.getGlobalContinueAccess().getSemicolonKeyword_2()); - } -) -; - - - - - -// Entry rule entryRuleGlobalParallel -entryRuleGlobalParallel returns [EObject current=null] - : - { newCompositeNode(grammarAccess.getGlobalParallelRule()); } - iv_ruleGlobalParallel=ruleGlobalParallel - { $current=$iv_ruleGlobalParallel.current; } - EOF -; - -// Rule GlobalParallel -ruleGlobalParallel returns [EObject current=null] - @init { enterRule(); - } - @after { leaveRule(); }: -( otherlv_0='par' - { - newLeafNode(otherlv_0, grammarAccess.getGlobalParallelAccess().getParKeyword_0()); - } -( -( - { - newCompositeNode(grammarAccess.getGlobalParallelAccess().getBlocksGlobalProtocolBlockParserRuleCall_1_0()); - } - lv_blocks_1_0=ruleGlobalProtocolBlock { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getGlobalParallelRule()); - } - add( - $current, - "blocks", - lv_blocks_1_0, - "GlobalProtocolBlock"); - afterParserOrEnumRuleCall(); - } - -) -)( otherlv_2='and' - { - newLeafNode(otherlv_2, grammarAccess.getGlobalParallelAccess().getAndKeyword_2_0()); - } -( -( - { - newCompositeNode(grammarAccess.getGlobalParallelAccess().getBlocksGlobalProtocolBlockParserRuleCall_2_1_0()); - } - lv_blocks_3_0=ruleGlobalProtocolBlock { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getGlobalParallelRule()); - } - add( - $current, - "blocks", - lv_blocks_3_0, - "GlobalProtocolBlock"); - afterParserOrEnumRuleCall(); - } - -) -))*) -; - - - - - -// Entry rule entryRuleGlobalInterruptible -entryRuleGlobalInterruptible returns [EObject current=null] - : - { newCompositeNode(grammarAccess.getGlobalInterruptibleRule()); } - iv_ruleGlobalInterruptible=ruleGlobalInterruptible - { $current=$iv_ruleGlobalInterruptible.current; } - EOF -; - -// Rule GlobalInterruptible -ruleGlobalInterruptible returns [EObject current=null] - @init { enterRule(); - } - @after { leaveRule(); }: -( otherlv_0='interruptible' - { - newLeafNode(otherlv_0, grammarAccess.getGlobalInterruptibleAccess().getInterruptibleKeyword_0()); - } -(( -( - lv_scope_1_0=RULE_ID - { - newLeafNode(lv_scope_1_0, grammarAccess.getGlobalInterruptibleAccess().getScopeIDTerminalRuleCall_1_0_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getGlobalInterruptibleRule()); - } - setWithLastConsumed( - $current, - "scope", - lv_scope_1_0, - "ID"); - } - -) -) otherlv_2=':' - { - newLeafNode(otherlv_2, grammarAccess.getGlobalInterruptibleAccess().getColonKeyword_1_1()); - } -)?( -( - { - newCompositeNode(grammarAccess.getGlobalInterruptibleAccess().getBlockGlobalProtocolBlockParserRuleCall_2_0()); - } - lv_block_3_0=ruleGlobalProtocolBlock { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getGlobalInterruptibleRule()); - } - set( - $current, - "block", - lv_block_3_0, - "GlobalProtocolBlock"); - afterParserOrEnumRuleCall(); - } - -) -) otherlv_4='with' - { - newLeafNode(otherlv_4, grammarAccess.getGlobalInterruptibleAccess().getWithKeyword_3()); - } - otherlv_5='{' - { - newLeafNode(otherlv_5, grammarAccess.getGlobalInterruptibleAccess().getLeftCurlyBracketKeyword_4()); - } -( -( - { - newCompositeNode(grammarAccess.getGlobalInterruptibleAccess().getInterruptsGlobalInterruptParserRuleCall_5_0()); - } - lv_interrupts_6_0=ruleGlobalInterrupt { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getGlobalInterruptibleRule()); - } - add( - $current, - "interrupts", - lv_interrupts_6_0, - "GlobalInterrupt"); - afterParserOrEnumRuleCall(); - } - -) -)* otherlv_7='}' - { - newLeafNode(otherlv_7, grammarAccess.getGlobalInterruptibleAccess().getRightCurlyBracketKeyword_6()); - } -) -; - - - - - -// Entry rule entryRuleGlobalInterrupt -entryRuleGlobalInterrupt returns [EObject current=null] - : - { newCompositeNode(grammarAccess.getGlobalInterruptRule()); } - iv_ruleGlobalInterrupt=ruleGlobalInterrupt - { $current=$iv_ruleGlobalInterrupt.current; } - EOF -; - -// Rule GlobalInterrupt -ruleGlobalInterrupt returns [EObject current=null] - @init { enterRule(); - } - @after { leaveRule(); }: -(( -( - { - newCompositeNode(grammarAccess.getGlobalInterruptAccess().getMessagesMessageParserRuleCall_0_0()); - } - lv_messages_0_0=ruleMessage { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getGlobalInterruptRule()); - } - add( - $current, - "messages", - lv_messages_0_0, - "Message"); - afterParserOrEnumRuleCall(); - } - -) -)( otherlv_1=',' - { - newLeafNode(otherlv_1, grammarAccess.getGlobalInterruptAccess().getCommaKeyword_1_0()); - } -( -( - { - newCompositeNode(grammarAccess.getGlobalInterruptAccess().getMessagesMessageParserRuleCall_1_1_0()); - } - lv_messages_2_0=ruleMessage { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getGlobalInterruptRule()); - } - add( - $current, - "messages", - lv_messages_2_0, - "Message"); - afterParserOrEnumRuleCall(); - } - -) -))* otherlv_3='by' - { - newLeafNode(otherlv_3, grammarAccess.getGlobalInterruptAccess().getByKeyword_2()); - } -( -( - lv_role_4_0=RULE_ID - { - newLeafNode(lv_role_4_0, grammarAccess.getGlobalInterruptAccess().getRoleIDTerminalRuleCall_3_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getGlobalInterruptRule()); - } - setWithLastConsumed( - $current, - "role", - lv_role_4_0, - "ID"); - } - -) -) otherlv_5=';' - { - newLeafNode(otherlv_5, grammarAccess.getGlobalInterruptAccess().getSemicolonKeyword_4()); - } -) -; - - - - - -// Entry rule entryRuleGlobalDo -entryRuleGlobalDo returns [EObject current=null] - : - { newCompositeNode(grammarAccess.getGlobalDoRule()); } - iv_ruleGlobalDo=ruleGlobalDo - { $current=$iv_ruleGlobalDo.current; } - EOF -; - -// Rule GlobalDo -ruleGlobalDo returns [EObject current=null] - @init { enterRule(); - } - @after { leaveRule(); }: -( otherlv_0='do' - { - newLeafNode(otherlv_0, grammarAccess.getGlobalDoAccess().getDoKeyword_0()); - } -(( -( - lv_scope_1_0=RULE_ID - { - newLeafNode(lv_scope_1_0, grammarAccess.getGlobalDoAccess().getScopeIDTerminalRuleCall_1_0_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getGlobalDoRule()); - } - setWithLastConsumed( - $current, - "scope", - lv_scope_1_0, - "ID"); - } - -) -) otherlv_2=':' - { - newLeafNode(otherlv_2, grammarAccess.getGlobalDoAccess().getColonKeyword_1_1()); - } -)?( -( - lv_member_3_0=RULE_ID - { - newLeafNode(lv_member_3_0, grammarAccess.getGlobalDoAccess().getMemberIDTerminalRuleCall_2_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getGlobalDoRule()); - } - setWithLastConsumed( - $current, - "member", - lv_member_3_0, - "ID"); - } - -) -)( otherlv_4='<' - { - newLeafNode(otherlv_4, grammarAccess.getGlobalDoAccess().getLessThanSignKeyword_3_0()); - } -( -( - { - newCompositeNode(grammarAccess.getGlobalDoAccess().getArgumentsArgumentParserRuleCall_3_1_0()); - } - lv_arguments_5_0=ruleArgument { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getGlobalDoRule()); - } - add( - $current, - "arguments", - lv_arguments_5_0, - "Argument"); - afterParserOrEnumRuleCall(); - } - -) -)( otherlv_6=',' - { - newLeafNode(otherlv_6, grammarAccess.getGlobalDoAccess().getCommaKeyword_3_2_0()); - } -( -( - { - newCompositeNode(grammarAccess.getGlobalDoAccess().getArgumentsArgumentParserRuleCall_3_2_1_0()); - } - lv_arguments_7_0=ruleArgument { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getGlobalDoRule()); - } - add( - $current, - "arguments", - lv_arguments_7_0, - "Argument"); - afterParserOrEnumRuleCall(); - } - -) -))* otherlv_8='>' - { - newLeafNode(otherlv_8, grammarAccess.getGlobalDoAccess().getGreaterThanSignKeyword_3_3()); - } -)? otherlv_9='(' - { - newLeafNode(otherlv_9, grammarAccess.getGlobalDoAccess().getLeftParenthesisKeyword_4()); - } -( -( - { - newCompositeNode(grammarAccess.getGlobalDoAccess().getRolesRoleInstantiationParserRuleCall_5_0()); - } - lv_roles_10_0=ruleRoleInstantiation { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getGlobalDoRule()); - } - add( - $current, - "roles", - lv_roles_10_0, - "RoleInstantiation"); - afterParserOrEnumRuleCall(); - } - -) -)( otherlv_11=',' - { - newLeafNode(otherlv_11, grammarAccess.getGlobalDoAccess().getCommaKeyword_6_0()); - } -( -( - { - newCompositeNode(grammarAccess.getGlobalDoAccess().getRolesRoleInstantiationParserRuleCall_6_1_0()); - } - lv_roles_12_0=ruleRoleInstantiation { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getGlobalDoRule()); - } - add( - $current, - "roles", - lv_roles_12_0, - "RoleInstantiation"); - afterParserOrEnumRuleCall(); - } - -) -))* otherlv_13=')' - { - newLeafNode(otherlv_13, grammarAccess.getGlobalDoAccess().getRightParenthesisKeyword_7()); - } - otherlv_14=';' - { - newLeafNode(otherlv_14, grammarAccess.getGlobalDoAccess().getSemicolonKeyword_8()); - } -) -; - - - - - -// Entry rule entryRuleLocalProtocolDecl -entryRuleLocalProtocolDecl returns [EObject current=null] - : - { newCompositeNode(grammarAccess.getLocalProtocolDeclRule()); } - iv_ruleLocalProtocolDecl=ruleLocalProtocolDecl - { $current=$iv_ruleLocalProtocolDecl.current; } - EOF -; - -// Rule LocalProtocolDecl -ruleLocalProtocolDecl returns [EObject current=null] - @init { enterRule(); - } - @after { leaveRule(); }: -( otherlv_0='local' - { - newLeafNode(otherlv_0, grammarAccess.getLocalProtocolDeclAccess().getLocalKeyword_0()); - } - otherlv_1='protocol' - { - newLeafNode(otherlv_1, grammarAccess.getLocalProtocolDeclAccess().getProtocolKeyword_1()); - } -( -( - lv_name_2_0=RULE_ID - { - newLeafNode(lv_name_2_0, grammarAccess.getLocalProtocolDeclAccess().getNameIDTerminalRuleCall_2_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getLocalProtocolDeclRule()); - } - setWithLastConsumed( - $current, - "name", - lv_name_2_0, - "ID"); - } - -) -) otherlv_3='at' - { - newLeafNode(otherlv_3, grammarAccess.getLocalProtocolDeclAccess().getAtKeyword_3()); - } -( -( - lv_role_4_0=RULE_ID - { - newLeafNode(lv_role_4_0, grammarAccess.getLocalProtocolDeclAccess().getRoleIDTerminalRuleCall_4_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getLocalProtocolDeclRule()); - } - setWithLastConsumed( - $current, - "role", - lv_role_4_0, - "ID"); - } - -) -)( otherlv_5='<' - { - newLeafNode(otherlv_5, grammarAccess.getLocalProtocolDeclAccess().getLessThanSignKeyword_5_0()); - } -( -( - { - newCompositeNode(grammarAccess.getLocalProtocolDeclAccess().getParametersParameterDeclParserRuleCall_5_1_0()); - } - lv_parameters_6_0=ruleParameterDecl { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getLocalProtocolDeclRule()); - } - add( - $current, - "parameters", - lv_parameters_6_0, - "ParameterDecl"); - afterParserOrEnumRuleCall(); - } - -) -)( otherlv_7=',' - { - newLeafNode(otherlv_7, grammarAccess.getLocalProtocolDeclAccess().getCommaKeyword_5_2_0()); - } -( -( - { - newCompositeNode(grammarAccess.getLocalProtocolDeclAccess().getParametersParameterDeclParserRuleCall_5_2_1_0()); - } - lv_parameters_8_0=ruleParameterDecl { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getLocalProtocolDeclRule()); - } - add( - $current, - "parameters", - lv_parameters_8_0, - "ParameterDecl"); - afterParserOrEnumRuleCall(); - } - -) -))* otherlv_9='>' - { - newLeafNode(otherlv_9, grammarAccess.getLocalProtocolDeclAccess().getGreaterThanSignKeyword_5_3()); - } -)? otherlv_10='(' - { - newLeafNode(otherlv_10, grammarAccess.getLocalProtocolDeclAccess().getLeftParenthesisKeyword_6()); - } -( -( - { - newCompositeNode(grammarAccess.getLocalProtocolDeclAccess().getRolesRoleDeclParserRuleCall_7_0()); - } - lv_roles_11_0=ruleRoleDecl { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getLocalProtocolDeclRule()); - } - add( - $current, - "roles", - lv_roles_11_0, - "RoleDecl"); - afterParserOrEnumRuleCall(); - } - -) -)( otherlv_12=',' - { - newLeafNode(otherlv_12, grammarAccess.getLocalProtocolDeclAccess().getCommaKeyword_8_0()); - } -( -( - { - newCompositeNode(grammarAccess.getLocalProtocolDeclAccess().getRolesRoleDeclParserRuleCall_8_1_0()); - } - lv_roles_13_0=ruleRoleDecl { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getLocalProtocolDeclRule()); - } - add( - $current, - "roles", - lv_roles_13_0, - "RoleDecl"); - afterParserOrEnumRuleCall(); - } - -) -))* otherlv_14=')' - { - newLeafNode(otherlv_14, grammarAccess.getLocalProtocolDeclAccess().getRightParenthesisKeyword_9()); - } -(( -( - { - newCompositeNode(grammarAccess.getLocalProtocolDeclAccess().getBlockLocalProtocolBlockParserRuleCall_10_0_0()); - } - lv_block_15_0=ruleLocalProtocolBlock { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getLocalProtocolDeclRule()); - } - set( - $current, - "block", - lv_block_15_0, - "LocalProtocolBlock"); - afterParserOrEnumRuleCall(); - } - -) -) - |( otherlv_16='instantiates' - { - newLeafNode(otherlv_16, grammarAccess.getLocalProtocolDeclAccess().getInstantiatesKeyword_10_1_0()); - } -( -( - lv_instantiates_17_0=RULE_ID - { - newLeafNode(lv_instantiates_17_0, grammarAccess.getLocalProtocolDeclAccess().getInstantiatesIDTerminalRuleCall_10_1_1_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getLocalProtocolDeclRule()); - } - setWithLastConsumed( - $current, - "instantiates", - lv_instantiates_17_0, - "ID"); - } - -) -)( otherlv_18='<' - { - newLeafNode(otherlv_18, grammarAccess.getLocalProtocolDeclAccess().getLessThanSignKeyword_10_1_2_0()); - } -( -( - { - newCompositeNode(grammarAccess.getLocalProtocolDeclAccess().getArgumentsArgumentParserRuleCall_10_1_2_1_0()); - } - lv_arguments_19_0=ruleArgument { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getLocalProtocolDeclRule()); - } - add( - $current, - "arguments", - lv_arguments_19_0, - "Argument"); - afterParserOrEnumRuleCall(); - } - -) -)( otherlv_20=',' - { - newLeafNode(otherlv_20, grammarAccess.getLocalProtocolDeclAccess().getCommaKeyword_10_1_2_2_0()); - } -( -( - { - newCompositeNode(grammarAccess.getLocalProtocolDeclAccess().getArgumentsArgumentParserRuleCall_10_1_2_2_1_0()); - } - lv_arguments_21_0=ruleArgument { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getLocalProtocolDeclRule()); - } - add( - $current, - "arguments", - lv_arguments_21_0, - "Argument"); - afterParserOrEnumRuleCall(); - } - -) -))* otherlv_22='>' - { - newLeafNode(otherlv_22, grammarAccess.getLocalProtocolDeclAccess().getGreaterThanSignKeyword_10_1_2_3()); - } -)? otherlv_23='(' - { - newLeafNode(otherlv_23, grammarAccess.getLocalProtocolDeclAccess().getLeftParenthesisKeyword_10_1_3()); - } -( -( - { - newCompositeNode(grammarAccess.getLocalProtocolDeclAccess().getRoleInstantiationsRoleInstantiationParserRuleCall_10_1_4_0()); - } - lv_roleInstantiations_24_0=ruleRoleInstantiation { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getLocalProtocolDeclRule()); - } - add( - $current, - "roleInstantiations", - lv_roleInstantiations_24_0, - "RoleInstantiation"); - afterParserOrEnumRuleCall(); - } - -) -)( otherlv_25=',' - { - newLeafNode(otherlv_25, grammarAccess.getLocalProtocolDeclAccess().getCommaKeyword_10_1_5_0()); - } -( -( - { - newCompositeNode(grammarAccess.getLocalProtocolDeclAccess().getRoleInstantiationsRoleInstantiationParserRuleCall_10_1_5_1_0()); - } - lv_roleInstantiations_26_0=ruleRoleInstantiation { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getLocalProtocolDeclRule()); - } - add( - $current, - "roleInstantiations", - lv_roleInstantiations_26_0, - "RoleInstantiation"); - afterParserOrEnumRuleCall(); - } - -) -))* otherlv_27=')' - { - newLeafNode(otherlv_27, grammarAccess.getLocalProtocolDeclAccess().getRightParenthesisKeyword_10_1_6()); - } - otherlv_28=';' - { - newLeafNode(otherlv_28, grammarAccess.getLocalProtocolDeclAccess().getSemicolonKeyword_10_1_7()); - } -))) -; - - - - - -// Entry rule entryRuleLocalProtocolBlock -entryRuleLocalProtocolBlock returns [EObject current=null] - : - { newCompositeNode(grammarAccess.getLocalProtocolBlockRule()); } - iv_ruleLocalProtocolBlock=ruleLocalProtocolBlock - { $current=$iv_ruleLocalProtocolBlock.current; } - EOF -; - -// Rule LocalProtocolBlock -ruleLocalProtocolBlock returns [EObject current=null] - @init { enterRule(); - } - @after { leaveRule(); }: -(( - { - $current = forceCreateModelElement( - grammarAccess.getLocalProtocolBlockAccess().getLocalProtocolBlockAction_0(), - $current); - } -) otherlv_1='{' - { - newLeafNode(otherlv_1, grammarAccess.getLocalProtocolBlockAccess().getLeftCurlyBracketKeyword_1()); - } -( -( - { - newCompositeNode(grammarAccess.getLocalProtocolBlockAccess().getActivitiesLlobalInteractionParserRuleCall_2_0()); - } - lv_activities_2_0=ruleLlobalInteraction { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getLocalProtocolBlockRule()); - } - add( - $current, - "activities", - lv_activities_2_0, - "LlobalInteraction"); - afterParserOrEnumRuleCall(); - } - -) -)* otherlv_3='}' - { - newLeafNode(otherlv_3, grammarAccess.getLocalProtocolBlockAccess().getRightCurlyBracketKeyword_3()); - } -) -; - - - - - -// Entry rule entryRuleLlobalInteraction -entryRuleLlobalInteraction returns [EObject current=null] - : - { newCompositeNode(grammarAccess.getLlobalInteractionRule()); } - iv_ruleLlobalInteraction=ruleLlobalInteraction - { $current=$iv_ruleLlobalInteraction.current; } - EOF -; - -// Rule LlobalInteraction -ruleLlobalInteraction returns [EObject current=null] - @init { enterRule(); - } - @after { leaveRule(); }: -( - { - newCompositeNode(grammarAccess.getLlobalInteractionAccess().getLocalSendParserRuleCall_0()); - } - this_LocalSend_0=ruleLocalSend - { - $current = $this_LocalSend_0.current; - afterParserOrEnumRuleCall(); - } - - | - { - newCompositeNode(grammarAccess.getLlobalInteractionAccess().getLocalReceiveParserRuleCall_1()); - } - this_LocalReceive_1=ruleLocalReceive - { - $current = $this_LocalReceive_1.current; - afterParserOrEnumRuleCall(); - } - - | - { - newCompositeNode(grammarAccess.getLlobalInteractionAccess().getLocalChoiceParserRuleCall_2()); - } - this_LocalChoice_2=ruleLocalChoice - { - $current = $this_LocalChoice_2.current; - afterParserOrEnumRuleCall(); - } - - | - { - newCompositeNode(grammarAccess.getLlobalInteractionAccess().getLocalParallelParserRuleCall_3()); - } - this_LocalParallel_3=ruleLocalParallel - { - $current = $this_LocalParallel_3.current; - afterParserOrEnumRuleCall(); - } - - | - { - newCompositeNode(grammarAccess.getLlobalInteractionAccess().getLocalRecursionParserRuleCall_4()); - } - this_LocalRecursion_4=ruleLocalRecursion - { - $current = $this_LocalRecursion_4.current; - afterParserOrEnumRuleCall(); - } - - | - { - newCompositeNode(grammarAccess.getLlobalInteractionAccess().getLocalContinueParserRuleCall_5()); - } - this_LocalContinue_5=ruleLocalContinue - { - $current = $this_LocalContinue_5.current; - afterParserOrEnumRuleCall(); - } - - | - { - newCompositeNode(grammarAccess.getLlobalInteractionAccess().getLocalInterruptibleParserRuleCall_6()); - } - this_LocalInterruptible_6=ruleLocalInterruptible - { - $current = $this_LocalInterruptible_6.current; - afterParserOrEnumRuleCall(); - } - - | - { - newCompositeNode(grammarAccess.getLlobalInteractionAccess().getLocalDoParserRuleCall_7()); - } - this_LocalDo_7=ruleLocalDo - { - $current = $this_LocalDo_7.current; - afterParserOrEnumRuleCall(); - } -) -; - - - - - -// Entry rule entryRuleLocalSend -entryRuleLocalSend returns [EObject current=null] - : - { newCompositeNode(grammarAccess.getLocalSendRule()); } - iv_ruleLocalSend=ruleLocalSend - { $current=$iv_ruleLocalSend.current; } - EOF -; - -// Rule LocalSend -ruleLocalSend returns [EObject current=null] - @init { enterRule(); - } - @after { leaveRule(); }: -(( -( - { - newCompositeNode(grammarAccess.getLocalSendAccess().getMessageMessageParserRuleCall_0_0()); - } - lv_message_0_0=ruleMessage { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getLocalSendRule()); - } - set( - $current, - "message", - lv_message_0_0, - "Message"); - afterParserOrEnumRuleCall(); - } - -) -) otherlv_1='to' - { - newLeafNode(otherlv_1, grammarAccess.getLocalSendAccess().getToKeyword_1()); - } -( -( - lv_toRoles_2_0=RULE_ID - { - newLeafNode(lv_toRoles_2_0, grammarAccess.getLocalSendAccess().getToRolesIDTerminalRuleCall_2_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getLocalSendRule()); - } - addWithLastConsumed( - $current, - "toRoles", - lv_toRoles_2_0, - "ID"); - } - -) -)( otherlv_3=',' - { - newLeafNode(otherlv_3, grammarAccess.getLocalSendAccess().getCommaKeyword_3_0()); - } -( -( - lv_toRoles_4_0=RULE_ID - { - newLeafNode(lv_toRoles_4_0, grammarAccess.getLocalSendAccess().getToRolesIDTerminalRuleCall_3_1_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getLocalSendRule()); - } - addWithLastConsumed( - $current, - "toRoles", - lv_toRoles_4_0, - "ID"); - } - -) -))* otherlv_5=';' - { - newLeafNode(otherlv_5, grammarAccess.getLocalSendAccess().getSemicolonKeyword_4()); - } -) -; - - - - - -// Entry rule entryRuleLocalReceive -entryRuleLocalReceive returns [EObject current=null] - : - { newCompositeNode(grammarAccess.getLocalReceiveRule()); } - iv_ruleLocalReceive=ruleLocalReceive - { $current=$iv_ruleLocalReceive.current; } - EOF -; - -// Rule LocalReceive -ruleLocalReceive returns [EObject current=null] - @init { enterRule(); - } - @after { leaveRule(); }: -(( -( - { - newCompositeNode(grammarAccess.getLocalReceiveAccess().getMessageMessageParserRuleCall_0_0()); - } - lv_message_0_0=ruleMessage { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getLocalReceiveRule()); - } - set( - $current, - "message", - lv_message_0_0, - "Message"); - afterParserOrEnumRuleCall(); - } - -) -) otherlv_1='from' - { - newLeafNode(otherlv_1, grammarAccess.getLocalReceiveAccess().getFromKeyword_1()); - } -( -( - lv_fromRole_2_0=RULE_ID - { - newLeafNode(lv_fromRole_2_0, grammarAccess.getLocalReceiveAccess().getFromRoleIDTerminalRuleCall_2_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getLocalReceiveRule()); - } - setWithLastConsumed( - $current, - "fromRole", - lv_fromRole_2_0, - "ID"); - } - -) -) otherlv_3=';' - { - newLeafNode(otherlv_3, grammarAccess.getLocalReceiveAccess().getSemicolonKeyword_3()); - } -) -; - - - - - -// Entry rule entryRuleLocalChoice -entryRuleLocalChoice returns [EObject current=null] - : - { newCompositeNode(grammarAccess.getLocalChoiceRule()); } - iv_ruleLocalChoice=ruleLocalChoice - { $current=$iv_ruleLocalChoice.current; } - EOF -; - -// Rule LocalChoice -ruleLocalChoice returns [EObject current=null] - @init { enterRule(); - } - @after { leaveRule(); }: -( otherlv_0='choice' - { - newLeafNode(otherlv_0, grammarAccess.getLocalChoiceAccess().getChoiceKeyword_0()); - } - otherlv_1='at' - { - newLeafNode(otherlv_1, grammarAccess.getLocalChoiceAccess().getAtKeyword_1()); - } -( -( - lv_role_2_0=RULE_ID - { - newLeafNode(lv_role_2_0, grammarAccess.getLocalChoiceAccess().getRoleIDTerminalRuleCall_2_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getLocalChoiceRule()); - } - setWithLastConsumed( - $current, - "role", - lv_role_2_0, - "ID"); - } - -) -)( -( - { - newCompositeNode(grammarAccess.getLocalChoiceAccess().getBlocksLocalProtocolBlockParserRuleCall_3_0()); - } - lv_blocks_3_0=ruleLocalProtocolBlock { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getLocalChoiceRule()); - } - add( - $current, - "blocks", - lv_blocks_3_0, - "LocalProtocolBlock"); - afterParserOrEnumRuleCall(); - } - -) -)( otherlv_4='or' - { - newLeafNode(otherlv_4, grammarAccess.getLocalChoiceAccess().getOrKeyword_4_0()); - } -( -( - { - newCompositeNode(grammarAccess.getLocalChoiceAccess().getBlocksLocalProtocolBlockParserRuleCall_4_1_0()); - } - lv_blocks_5_0=ruleLocalProtocolBlock { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getLocalChoiceRule()); - } - add( - $current, - "blocks", - lv_blocks_5_0, - "LocalProtocolBlock"); - afterParserOrEnumRuleCall(); - } - -) -))*) -; - - - - - -// Entry rule entryRuleLocalRecursion -entryRuleLocalRecursion returns [EObject current=null] - : - { newCompositeNode(grammarAccess.getLocalRecursionRule()); } - iv_ruleLocalRecursion=ruleLocalRecursion - { $current=$iv_ruleLocalRecursion.current; } - EOF -; - -// Rule LocalRecursion -ruleLocalRecursion returns [EObject current=null] - @init { enterRule(); - } - @after { leaveRule(); }: -( otherlv_0='rec' - { - newLeafNode(otherlv_0, grammarAccess.getLocalRecursionAccess().getRecKeyword_0()); - } -( -( - lv_label_1_0=RULE_ID - { - newLeafNode(lv_label_1_0, grammarAccess.getLocalRecursionAccess().getLabelIDTerminalRuleCall_1_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getLocalRecursionRule()); - } - setWithLastConsumed( - $current, - "label", - lv_label_1_0, - "ID"); - } - -) -)( -( - { - newCompositeNode(grammarAccess.getLocalRecursionAccess().getBlockLocalProtocolBlockParserRuleCall_2_0()); - } - lv_block_2_0=ruleLocalProtocolBlock { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getLocalRecursionRule()); - } - set( - $current, - "block", - lv_block_2_0, - "LocalProtocolBlock"); - afterParserOrEnumRuleCall(); - } - -) -)) -; - - - - - -// Entry rule entryRuleLocalContinue -entryRuleLocalContinue returns [EObject current=null] - : - { newCompositeNode(grammarAccess.getLocalContinueRule()); } - iv_ruleLocalContinue=ruleLocalContinue - { $current=$iv_ruleLocalContinue.current; } - EOF -; - -// Rule LocalContinue -ruleLocalContinue returns [EObject current=null] - @init { enterRule(); - } - @after { leaveRule(); }: -( otherlv_0='continue' - { - newLeafNode(otherlv_0, grammarAccess.getLocalContinueAccess().getContinueKeyword_0()); - } -( -( - lv_label_1_0=RULE_ID - { - newLeafNode(lv_label_1_0, grammarAccess.getLocalContinueAccess().getLabelIDTerminalRuleCall_1_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getLocalContinueRule()); - } - setWithLastConsumed( - $current, - "label", - lv_label_1_0, - "ID"); - } - -) -) otherlv_2=';' - { - newLeafNode(otherlv_2, grammarAccess.getLocalContinueAccess().getSemicolonKeyword_2()); - } -) -; - - - - - -// Entry rule entryRuleLocalParallel -entryRuleLocalParallel returns [EObject current=null] - : - { newCompositeNode(grammarAccess.getLocalParallelRule()); } - iv_ruleLocalParallel=ruleLocalParallel - { $current=$iv_ruleLocalParallel.current; } - EOF -; - -// Rule LocalParallel -ruleLocalParallel returns [EObject current=null] - @init { enterRule(); - } - @after { leaveRule(); }: -( otherlv_0='par' - { - newLeafNode(otherlv_0, grammarAccess.getLocalParallelAccess().getParKeyword_0()); - } -( -( - { - newCompositeNode(grammarAccess.getLocalParallelAccess().getBlocksLocalProtocolBlockParserRuleCall_1_0()); - } - lv_blocks_1_0=ruleLocalProtocolBlock { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getLocalParallelRule()); - } - add( - $current, - "blocks", - lv_blocks_1_0, - "LocalProtocolBlock"); - afterParserOrEnumRuleCall(); - } - -) -)( otherlv_2='and' - { - newLeafNode(otherlv_2, grammarAccess.getLocalParallelAccess().getAndKeyword_2_0()); - } -( -( - { - newCompositeNode(grammarAccess.getLocalParallelAccess().getBlocksLocalProtocolBlockParserRuleCall_2_1_0()); - } - lv_blocks_3_0=ruleLocalProtocolBlock { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getLocalParallelRule()); - } - add( - $current, - "blocks", - lv_blocks_3_0, - "LocalProtocolBlock"); - afterParserOrEnumRuleCall(); - } - -) -))*) -; - - - - - -// Entry rule entryRuleLocalInterruptible -entryRuleLocalInterruptible returns [EObject current=null] - : - { newCompositeNode(grammarAccess.getLocalInterruptibleRule()); } - iv_ruleLocalInterruptible=ruleLocalInterruptible - { $current=$iv_ruleLocalInterruptible.current; } - EOF -; - -// Rule LocalInterruptible -ruleLocalInterruptible returns [EObject current=null] - @init { enterRule(); - } - @after { leaveRule(); }: -( otherlv_0='interruptible' - { - newLeafNode(otherlv_0, grammarAccess.getLocalInterruptibleAccess().getInterruptibleKeyword_0()); - } -(( -( - lv_scope_1_0=RULE_ID - { - newLeafNode(lv_scope_1_0, grammarAccess.getLocalInterruptibleAccess().getScopeIDTerminalRuleCall_1_0_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getLocalInterruptibleRule()); - } - setWithLastConsumed( - $current, - "scope", - lv_scope_1_0, - "ID"); - } - -) -) otherlv_2=':' - { - newLeafNode(otherlv_2, grammarAccess.getLocalInterruptibleAccess().getColonKeyword_1_1()); - } -)?( -( - { - newCompositeNode(grammarAccess.getLocalInterruptibleAccess().getBlockLocalProtocolBlockParserRuleCall_2_0()); - } - lv_block_3_0=ruleLocalProtocolBlock { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getLocalInterruptibleRule()); - } - set( - $current, - "block", - lv_block_3_0, - "LocalProtocolBlock"); - afterParserOrEnumRuleCall(); - } - -) -) otherlv_4='with' - { - newLeafNode(otherlv_4, grammarAccess.getLocalInterruptibleAccess().getWithKeyword_3()); - } - otherlv_5='{' - { - newLeafNode(otherlv_5, grammarAccess.getLocalInterruptibleAccess().getLeftCurlyBracketKeyword_4()); - } -( -( - { - newCompositeNode(grammarAccess.getLocalInterruptibleAccess().getThrowLocalThrowParserRuleCall_5_0()); - } - lv_throw_6_0=ruleLocalThrow { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getLocalInterruptibleRule()); - } - set( - $current, - "throw", - lv_throw_6_0, - "LocalThrow"); - afterParserOrEnumRuleCall(); - } - -) -)?( -( - { - newCompositeNode(grammarAccess.getLocalInterruptibleAccess().getCatchesLocalCatchParserRuleCall_6_0()); - } - lv_catches_7_0=ruleLocalCatch { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getLocalInterruptibleRule()); - } - add( - $current, - "catches", - lv_catches_7_0, - "LocalCatch"); - afterParserOrEnumRuleCall(); - } - -) -)* otherlv_8='}' - { - newLeafNode(otherlv_8, grammarAccess.getLocalInterruptibleAccess().getRightCurlyBracketKeyword_7()); - } -) -; - - - - - -// Entry rule entryRuleLocalThrow -entryRuleLocalThrow returns [EObject current=null] - : - { newCompositeNode(grammarAccess.getLocalThrowRule()); } - iv_ruleLocalThrow=ruleLocalThrow - { $current=$iv_ruleLocalThrow.current; } - EOF -; - -// Rule LocalThrow -ruleLocalThrow returns [EObject current=null] - @init { enterRule(); - } - @after { leaveRule(); }: -( otherlv_0='throw' - { - newLeafNode(otherlv_0, grammarAccess.getLocalThrowAccess().getThrowKeyword_0()); - } -( -( - { - newCompositeNode(grammarAccess.getLocalThrowAccess().getMessagesMessageParserRuleCall_1_0()); - } - lv_messages_1_0=ruleMessage { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getLocalThrowRule()); - } - add( - $current, - "messages", - lv_messages_1_0, - "Message"); - afterParserOrEnumRuleCall(); - } - -) -)( otherlv_2=',' - { - newLeafNode(otherlv_2, grammarAccess.getLocalThrowAccess().getCommaKeyword_2_0()); - } -( -( - { - newCompositeNode(grammarAccess.getLocalThrowAccess().getMessagesMessageParserRuleCall_2_1_0()); - } - lv_messages_3_0=ruleMessage { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getLocalThrowRule()); - } - add( - $current, - "messages", - lv_messages_3_0, - "Message"); - afterParserOrEnumRuleCall(); - } - -) -))* otherlv_4='to' - { - newLeafNode(otherlv_4, grammarAccess.getLocalThrowAccess().getToKeyword_3()); - } -( -( - lv_toRoles_5_0=RULE_ID - { - newLeafNode(lv_toRoles_5_0, grammarAccess.getLocalThrowAccess().getToRolesIDTerminalRuleCall_4_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getLocalThrowRule()); - } - addWithLastConsumed( - $current, - "toRoles", - lv_toRoles_5_0, - "ID"); - } - -) -)( otherlv_6=',' - { - newLeafNode(otherlv_6, grammarAccess.getLocalThrowAccess().getCommaKeyword_5_0()); - } -( -( - lv_toRoles_7_0=RULE_ID - { - newLeafNode(lv_toRoles_7_0, grammarAccess.getLocalThrowAccess().getToRolesIDTerminalRuleCall_5_1_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getLocalThrowRule()); - } - addWithLastConsumed( - $current, - "toRoles", - lv_toRoles_7_0, - "ID"); - } - -) -))* otherlv_8=';' - { - newLeafNode(otherlv_8, grammarAccess.getLocalThrowAccess().getSemicolonKeyword_6()); - } -) -; - - - - - -// Entry rule entryRuleLocalCatch -entryRuleLocalCatch returns [EObject current=null] - : - { newCompositeNode(grammarAccess.getLocalCatchRule()); } - iv_ruleLocalCatch=ruleLocalCatch - { $current=$iv_ruleLocalCatch.current; } - EOF -; - -// Rule LocalCatch -ruleLocalCatch returns [EObject current=null] - @init { enterRule(); - } - @after { leaveRule(); }: -( otherlv_0='catches' - { - newLeafNode(otherlv_0, grammarAccess.getLocalCatchAccess().getCatchesKeyword_0()); - } -( -( - { - newCompositeNode(grammarAccess.getLocalCatchAccess().getMessagesMessageParserRuleCall_1_0()); - } - lv_messages_1_0=ruleMessage { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getLocalCatchRule()); - } - add( - $current, - "messages", - lv_messages_1_0, - "Message"); - afterParserOrEnumRuleCall(); - } - -) -)( otherlv_2=',' - { - newLeafNode(otherlv_2, grammarAccess.getLocalCatchAccess().getCommaKeyword_2_0()); - } -( -( - { - newCompositeNode(grammarAccess.getLocalCatchAccess().getMessagesMessageParserRuleCall_2_1_0()); - } - lv_messages_3_0=ruleMessage { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getLocalCatchRule()); - } - add( - $current, - "messages", - lv_messages_3_0, - "Message"); - afterParserOrEnumRuleCall(); - } - -) -))* otherlv_4='from' - { - newLeafNode(otherlv_4, grammarAccess.getLocalCatchAccess().getFromKeyword_3()); - } -( -( - lv_fromRole_5_0=RULE_ID - { - newLeafNode(lv_fromRole_5_0, grammarAccess.getLocalCatchAccess().getFromRoleIDTerminalRuleCall_4_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getLocalCatchRule()); - } - setWithLastConsumed( - $current, - "fromRole", - lv_fromRole_5_0, - "ID"); - } - -) -) otherlv_6=';' - { - newLeafNode(otherlv_6, grammarAccess.getLocalCatchAccess().getSemicolonKeyword_5()); - } -) -; - - - - - -// Entry rule entryRuleLocalDo -entryRuleLocalDo returns [EObject current=null] - : - { newCompositeNode(grammarAccess.getLocalDoRule()); } - iv_ruleLocalDo=ruleLocalDo - { $current=$iv_ruleLocalDo.current; } - EOF -; - -// Rule LocalDo -ruleLocalDo returns [EObject current=null] - @init { enterRule(); - } - @after { leaveRule(); }: -( otherlv_0='do' - { - newLeafNode(otherlv_0, grammarAccess.getLocalDoAccess().getDoKeyword_0()); - } -(( -( - lv_scope_1_0=RULE_ID - { - newLeafNode(lv_scope_1_0, grammarAccess.getLocalDoAccess().getScopeIDTerminalRuleCall_1_0_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getLocalDoRule()); - } - setWithLastConsumed( - $current, - "scope", - lv_scope_1_0, - "ID"); - } - -) -) otherlv_2=':' - { - newLeafNode(otherlv_2, grammarAccess.getLocalDoAccess().getColonKeyword_1_1()); - } -)?( -( - lv_member_3_0=RULE_ID - { - newLeafNode(lv_member_3_0, grammarAccess.getLocalDoAccess().getMemberIDTerminalRuleCall_2_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getLocalDoRule()); - } - setWithLastConsumed( - $current, - "member", - lv_member_3_0, - "ID"); - } - -) -)( otherlv_4='<' - { - newLeafNode(otherlv_4, grammarAccess.getLocalDoAccess().getLessThanSignKeyword_3_0()); - } -( -( - { - newCompositeNode(grammarAccess.getLocalDoAccess().getArgumentsArgumentParserRuleCall_3_1_0()); - } - lv_arguments_5_0=ruleArgument { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getLocalDoRule()); - } - add( - $current, - "arguments", - lv_arguments_5_0, - "Argument"); - afterParserOrEnumRuleCall(); - } - -) -)( otherlv_6=',' - { - newLeafNode(otherlv_6, grammarAccess.getLocalDoAccess().getCommaKeyword_3_2_0()); - } -( -( - { - newCompositeNode(grammarAccess.getLocalDoAccess().getArgumentsArgumentParserRuleCall_3_2_1_0()); - } - lv_arguments_7_0=ruleArgument { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getLocalDoRule()); - } - add( - $current, - "arguments", - lv_arguments_7_0, - "Argument"); - afterParserOrEnumRuleCall(); - } - -) -))* otherlv_8='>' - { - newLeafNode(otherlv_8, grammarAccess.getLocalDoAccess().getGreaterThanSignKeyword_3_3()); - } -)? otherlv_9='(' - { - newLeafNode(otherlv_9, grammarAccess.getLocalDoAccess().getLeftParenthesisKeyword_4()); - } -( -( - { - newCompositeNode(grammarAccess.getLocalDoAccess().getRolesRoleInstantiationParserRuleCall_5_0()); - } - lv_roles_10_0=ruleRoleInstantiation { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getLocalDoRule()); - } - add( - $current, - "roles", - lv_roles_10_0, - "RoleInstantiation"); - afterParserOrEnumRuleCall(); - } - -) -)( otherlv_11=',' - { - newLeafNode(otherlv_11, grammarAccess.getLocalDoAccess().getCommaKeyword_6_0()); - } -( -( - { - newCompositeNode(grammarAccess.getLocalDoAccess().getRolesRoleInstantiationParserRuleCall_6_1_0()); - } - lv_roles_12_0=ruleRoleInstantiation { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getLocalDoRule()); - } - add( - $current, - "roles", - lv_roles_12_0, - "RoleInstantiation"); - afterParserOrEnumRuleCall(); - } - -) -))* otherlv_13=')' - { - newLeafNode(otherlv_13, grammarAccess.getLocalDoAccess().getRightParenthesisKeyword_7()); - } - otherlv_14=';' - { - newLeafNode(otherlv_14, grammarAccess.getLocalDoAccess().getSemicolonKeyword_8()); - } -) -; - - - - - -RULE_ID : '^'? ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*; - -RULE_INT : ('0'..'9')+; - -RULE_STRING : ('"' ('\\' ('b'|'t'|'n'|'f'|'r'|'u'|'"'|'\''|'\\')|~(('\\'|'"')))* '"'|'\'' ('\\' ('b'|'t'|'n'|'f'|'r'|'u'|'"'|'\''|'\\')|~(('\\'|'\'')))* '\''); - -RULE_ML_COMMENT : '/*' ( options {greedy=false;} : . )*'*/'; - -RULE_SL_COMMENT : '//' ~(('\n'|'\r'))* ('\r'? '\n')?; - -RULE_WS : (' '|'\t'|'\r'|'\n')+; - -RULE_ANY_OTHER : .; - - diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.tokens b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.tokens deleted file mode 100644 index 65abfb45d..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.tokens +++ /dev/null @@ -1,77 +0,0 @@ -RULE_ID=4 -T__29=29 -T__28=28 -T__27=27 -T__26=26 -T__25=25 -T__24=24 -T__23=23 -T__22=22 -RULE_ANY_OTHER=10 -T__21=21 -T__20=20 -T__19=19 -T__16=16 -T__15=15 -T__18=18 -T__17=17 -T__12=12 -T__11=11 -T__14=14 -T__13=13 -RULE_INT=6 -T__42=42 -T__43=43 -T__40=40 -T__41=41 -T__44=44 -T__45=45 -RULE_SL_COMMENT=8 -RULE_ML_COMMENT=7 -T__30=30 -T__31=31 -T__32=32 -RULE_STRING=5 -T__33=33 -T__34=34 -T__35=35 -T__36=36 -T__37=37 -T__38=38 -T__39=39 -RULE_WS=9 -'interruptible'=39 -'catches'=45 -'type'=17 -'protocol'=25 -'at'=33 -'>'=19 -'with'=40 -';'=12 -'module'=11 -'role'=27 -'par'=37 -'choice'=32 -'global'=24 -'throw'=44 -'sig'=28 -'rec'=35 -')'=22 -'.'=13 -'do'=42 -'import'=14 -'}'=30 -'by'=41 -'and'=38 -'{'=29 -'to'=31 -'as'=15 -'continue'=36 -'<'=18 -'instantiates'=26 -':'=23 -'('=20 -'or'=34 -'local'=43 -','=21 -'from'=16 diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDslLexer.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDslLexer.java deleted file mode 100644 index 1ee9df796..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDslLexer.java +++ /dev/null @@ -1,1984 +0,0 @@ -package org.scribble.editor.dsl.parser.antlr.internal; - -// Hack: Use our own Lexer superclass by means of import. -// Currently there is no other way to specify the superclass for the lexer. -import org.eclipse.xtext.parser.antlr.Lexer; - - -import org.antlr.runtime.*; -import java.util.Stack; -import java.util.List; -import java.util.ArrayList; - -@SuppressWarnings("all") -public class InternalScribbleDslLexer extends Lexer { - public static final int RULE_ID=4; - public static final int T__29=29; - public static final int T__28=28; - public static final int T__27=27; - public static final int T__26=26; - public static final int T__25=25; - public static final int T__24=24; - public static final int T__23=23; - public static final int T__22=22; - public static final int T__21=21; - public static final int RULE_ANY_OTHER=10; - public static final int T__20=20; - public static final int EOF=-1; - public static final int T__19=19; - public static final int T__16=16; - public static final int T__15=15; - public static final int T__18=18; - public static final int T__17=17; - public static final int T__12=12; - public static final int T__11=11; - public static final int T__14=14; - public static final int T__13=13; - public static final int RULE_INT=6; - public static final int T__42=42; - public static final int T__43=43; - public static final int T__40=40; - public static final int T__41=41; - public static final int T__44=44; - public static final int T__45=45; - public static final int RULE_SL_COMMENT=8; - public static final int RULE_ML_COMMENT=7; - public static final int T__30=30; - public static final int T__31=31; - public static final int T__32=32; - public static final int RULE_STRING=5; - public static final int T__33=33; - public static final int T__34=34; - public static final int T__35=35; - public static final int T__36=36; - public static final int T__37=37; - public static final int T__38=38; - public static final int T__39=39; - public static final int RULE_WS=9; - - // delegates - // delegators - - public InternalScribbleDslLexer() {;} - public InternalScribbleDslLexer(CharStream input) { - this(input, new RecognizerSharedState()); - } - public InternalScribbleDslLexer(CharStream input, RecognizerSharedState state) { - super(input,state); - - } - public String getGrammarFileName() { return "../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g"; } - - // $ANTLR start "T__11" - public final void mT__11() throws RecognitionException { - try { - int _type = T__11; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:11:7: ( 'module' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:11:9: 'module' - { - match("module"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__11" - - // $ANTLR start "T__12" - public final void mT__12() throws RecognitionException { - try { - int _type = T__12; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:12:7: ( ';' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:12:9: ';' - { - match(';'); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__12" - - // $ANTLR start "T__13" - public final void mT__13() throws RecognitionException { - try { - int _type = T__13; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:13:7: ( '.' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:13:9: '.' - { - match('.'); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__13" - - // $ANTLR start "T__14" - public final void mT__14() throws RecognitionException { - try { - int _type = T__14; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:14:7: ( 'import' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:14:9: 'import' - { - match("import"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__14" - - // $ANTLR start "T__15" - public final void mT__15() throws RecognitionException { - try { - int _type = T__15; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:15:7: ( 'as' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:15:9: 'as' - { - match("as"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__15" - - // $ANTLR start "T__16" - public final void mT__16() throws RecognitionException { - try { - int _type = T__16; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:16:7: ( 'from' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:16:9: 'from' - { - match("from"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__16" - - // $ANTLR start "T__17" - public final void mT__17() throws RecognitionException { - try { - int _type = T__17; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:17:7: ( 'type' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:17:9: 'type' - { - match("type"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__17" - - // $ANTLR start "T__18" - public final void mT__18() throws RecognitionException { - try { - int _type = T__18; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:18:7: ( '<' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:18:9: '<' - { - match('<'); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__18" - - // $ANTLR start "T__19" - public final void mT__19() throws RecognitionException { - try { - int _type = T__19; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:19:7: ( '>' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:19:9: '>' - { - match('>'); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__19" - - // $ANTLR start "T__20" - public final void mT__20() throws RecognitionException { - try { - int _type = T__20; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:20:7: ( '(' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:20:9: '(' - { - match('('); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__20" - - // $ANTLR start "T__21" - public final void mT__21() throws RecognitionException { - try { - int _type = T__21; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:21:7: ( ',' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:21:9: ',' - { - match(','); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__21" - - // $ANTLR start "T__22" - public final void mT__22() throws RecognitionException { - try { - int _type = T__22; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:22:7: ( ')' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:22:9: ')' - { - match(')'); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__22" - - // $ANTLR start "T__23" - public final void mT__23() throws RecognitionException { - try { - int _type = T__23; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:23:7: ( ':' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:23:9: ':' - { - match(':'); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__23" - - // $ANTLR start "T__24" - public final void mT__24() throws RecognitionException { - try { - int _type = T__24; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:24:7: ( 'global' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:24:9: 'global' - { - match("global"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__24" - - // $ANTLR start "T__25" - public final void mT__25() throws RecognitionException { - try { - int _type = T__25; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:25:7: ( 'protocol' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:25:9: 'protocol' - { - match("protocol"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__25" - - // $ANTLR start "T__26" - public final void mT__26() throws RecognitionException { - try { - int _type = T__26; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:26:7: ( 'instantiates' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:26:9: 'instantiates' - { - match("instantiates"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__26" - - // $ANTLR start "T__27" - public final void mT__27() throws RecognitionException { - try { - int _type = T__27; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:27:7: ( 'role' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:27:9: 'role' - { - match("role"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__27" - - // $ANTLR start "T__28" - public final void mT__28() throws RecognitionException { - try { - int _type = T__28; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:28:7: ( 'sig' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:28:9: 'sig' - { - match("sig"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__28" - - // $ANTLR start "T__29" - public final void mT__29() throws RecognitionException { - try { - int _type = T__29; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:29:7: ( '{' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:29:9: '{' - { - match('{'); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__29" - - // $ANTLR start "T__30" - public final void mT__30() throws RecognitionException { - try { - int _type = T__30; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:30:7: ( '}' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:30:9: '}' - { - match('}'); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__30" - - // $ANTLR start "T__31" - public final void mT__31() throws RecognitionException { - try { - int _type = T__31; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:31:7: ( 'to' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:31:9: 'to' - { - match("to"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__31" - - // $ANTLR start "T__32" - public final void mT__32() throws RecognitionException { - try { - int _type = T__32; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:32:7: ( 'choice' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:32:9: 'choice' - { - match("choice"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__32" - - // $ANTLR start "T__33" - public final void mT__33() throws RecognitionException { - try { - int _type = T__33; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:33:7: ( 'at' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:33:9: 'at' - { - match("at"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__33" - - // $ANTLR start "T__34" - public final void mT__34() throws RecognitionException { - try { - int _type = T__34; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:34:7: ( 'or' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:34:9: 'or' - { - match("or"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__34" - - // $ANTLR start "T__35" - public final void mT__35() throws RecognitionException { - try { - int _type = T__35; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:35:7: ( 'rec' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:35:9: 'rec' - { - match("rec"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__35" - - // $ANTLR start "T__36" - public final void mT__36() throws RecognitionException { - try { - int _type = T__36; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:36:7: ( 'continue' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:36:9: 'continue' - { - match("continue"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__36" - - // $ANTLR start "T__37" - public final void mT__37() throws RecognitionException { - try { - int _type = T__37; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:37:7: ( 'par' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:37:9: 'par' - { - match("par"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__37" - - // $ANTLR start "T__38" - public final void mT__38() throws RecognitionException { - try { - int _type = T__38; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:38:7: ( 'and' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:38:9: 'and' - { - match("and"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__38" - - // $ANTLR start "T__39" - public final void mT__39() throws RecognitionException { - try { - int _type = T__39; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:39:7: ( 'interruptible' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:39:9: 'interruptible' - { - match("interruptible"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__39" - - // $ANTLR start "T__40" - public final void mT__40() throws RecognitionException { - try { - int _type = T__40; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:40:7: ( 'with' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:40:9: 'with' - { - match("with"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__40" - - // $ANTLR start "T__41" - public final void mT__41() throws RecognitionException { - try { - int _type = T__41; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:41:7: ( 'by' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:41:9: 'by' - { - match("by"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__41" - - // $ANTLR start "T__42" - public final void mT__42() throws RecognitionException { - try { - int _type = T__42; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:42:7: ( 'do' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:42:9: 'do' - { - match("do"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__42" - - // $ANTLR start "T__43" - public final void mT__43() throws RecognitionException { - try { - int _type = T__43; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:43:7: ( 'local' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:43:9: 'local' - { - match("local"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__43" - - // $ANTLR start "T__44" - public final void mT__44() throws RecognitionException { - try { - int _type = T__44; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:44:7: ( 'throw' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:44:9: 'throw' - { - match("throw"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__44" - - // $ANTLR start "T__45" - public final void mT__45() throws RecognitionException { - try { - int _type = T__45; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:45:7: ( 'catches' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:45:9: 'catches' - { - match("catches"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__45" - - // $ANTLR start "RULE_ID" - public final void mRULE_ID() throws RecognitionException { - try { - int _type = RULE_ID; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3590:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3590:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3590:11: ( '^' )? - int alt1=2; - int LA1_0 = input.LA(1); - - if ( (LA1_0=='^') ) { - alt1=1; - } - switch (alt1) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3590:11: '^' - { - match('^'); - - } - break; - - } - - if ( (input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3590:40: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* - loop2: - do { - int alt2=2; - int LA2_0 = input.LA(1); - - if ( ((LA2_0>='0' && LA2_0<='9')||(LA2_0>='A' && LA2_0<='Z')||LA2_0=='_'||(LA2_0>='a' && LA2_0<='z')) ) { - alt2=1; - } - - - switch (alt2) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g: - { - if ( (input.LA(1)>='0' && input.LA(1)<='9')||(input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - - } - break; - - default : - break loop2; - } - } while (true); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "RULE_ID" - - // $ANTLR start "RULE_INT" - public final void mRULE_INT() throws RecognitionException { - try { - int _type = RULE_INT; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3592:10: ( ( '0' .. '9' )+ ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3592:12: ( '0' .. '9' )+ - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3592:12: ( '0' .. '9' )+ - int cnt3=0; - loop3: - do { - int alt3=2; - int LA3_0 = input.LA(1); - - if ( ((LA3_0>='0' && LA3_0<='9')) ) { - alt3=1; - } - - - switch (alt3) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3592:13: '0' .. '9' - { - matchRange('0','9'); - - } - break; - - default : - if ( cnt3 >= 1 ) break loop3; - EarlyExitException eee = - new EarlyExitException(3, input); - throw eee; - } - cnt3++; - } while (true); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "RULE_INT" - - // $ANTLR start "RULE_STRING" - public final void mRULE_STRING() throws RecognitionException { - try { - int _type = RULE_STRING; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3594:13: ( ( '\"' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | 'u' | '\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | 'u' | '\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3594:15: ( '\"' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | 'u' | '\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | 'u' | '\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3594:15: ( '\"' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | 'u' | '\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | 'u' | '\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) - int alt6=2; - int LA6_0 = input.LA(1); - - if ( (LA6_0=='\"') ) { - alt6=1; - } - else if ( (LA6_0=='\'') ) { - alt6=2; - } - else { - NoViableAltException nvae = - new NoViableAltException("", 6, 0, input); - - throw nvae; - } - switch (alt6) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3594:16: '\"' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | 'u' | '\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\"' ) ) )* '\"' - { - match('\"'); - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3594:20: ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | 'u' | '\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\"' ) ) )* - loop4: - do { - int alt4=3; - int LA4_0 = input.LA(1); - - if ( (LA4_0=='\\') ) { - alt4=1; - } - else if ( ((LA4_0>='\u0000' && LA4_0<='!')||(LA4_0>='#' && LA4_0<='[')||(LA4_0>=']' && LA4_0<='\uFFFF')) ) { - alt4=2; - } - - - switch (alt4) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3594:21: '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | 'u' | '\"' | '\\'' | '\\\\' ) - { - match('\\'); - if ( input.LA(1)=='\"'||input.LA(1)=='\''||input.LA(1)=='\\'||input.LA(1)=='b'||input.LA(1)=='f'||input.LA(1)=='n'||input.LA(1)=='r'||(input.LA(1)>='t' && input.LA(1)<='u') ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - - } - break; - case 2 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3594:66: ~ ( ( '\\\\' | '\"' ) ) - { - if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - - } - break; - - default : - break loop4; - } - } while (true); - - match('\"'); - - } - break; - case 2 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3594:86: '\\'' ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | 'u' | '\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' - { - match('\''); - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3594:91: ( '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | 'u' | '\"' | '\\'' | '\\\\' ) | ~ ( ( '\\\\' | '\\'' ) ) )* - loop5: - do { - int alt5=3; - int LA5_0 = input.LA(1); - - if ( (LA5_0=='\\') ) { - alt5=1; - } - else if ( ((LA5_0>='\u0000' && LA5_0<='&')||(LA5_0>='(' && LA5_0<='[')||(LA5_0>=']' && LA5_0<='\uFFFF')) ) { - alt5=2; - } - - - switch (alt5) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3594:92: '\\\\' ( 'b' | 't' | 'n' | 'f' | 'r' | 'u' | '\"' | '\\'' | '\\\\' ) - { - match('\\'); - if ( input.LA(1)=='\"'||input.LA(1)=='\''||input.LA(1)=='\\'||input.LA(1)=='b'||input.LA(1)=='f'||input.LA(1)=='n'||input.LA(1)=='r'||(input.LA(1)>='t' && input.LA(1)<='u') ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - - } - break; - case 2 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3594:137: ~ ( ( '\\\\' | '\\'' ) ) - { - if ( (input.LA(1)>='\u0000' && input.LA(1)<='&')||(input.LA(1)>='(' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - - } - break; - - default : - break loop5; - } - } while (true); - - match('\''); - - } - break; - - } - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "RULE_STRING" - - // $ANTLR start "RULE_ML_COMMENT" - public final void mRULE_ML_COMMENT() throws RecognitionException { - try { - int _type = RULE_ML_COMMENT; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3596:17: ( '/*' ( options {greedy=false; } : . )* '*/' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3596:19: '/*' ( options {greedy=false; } : . )* '*/' - { - match("/*"); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3596:24: ( options {greedy=false; } : . )* - loop7: - do { - int alt7=2; - int LA7_0 = input.LA(1); - - if ( (LA7_0=='*') ) { - int LA7_1 = input.LA(2); - - if ( (LA7_1=='/') ) { - alt7=2; - } - else if ( ((LA7_1>='\u0000' && LA7_1<='.')||(LA7_1>='0' && LA7_1<='\uFFFF')) ) { - alt7=1; - } - - - } - else if ( ((LA7_0>='\u0000' && LA7_0<=')')||(LA7_0>='+' && LA7_0<='\uFFFF')) ) { - alt7=1; - } - - - switch (alt7) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3596:52: . - { - matchAny(); - - } - break; - - default : - break loop7; - } - } while (true); - - match("*/"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "RULE_ML_COMMENT" - - // $ANTLR start "RULE_SL_COMMENT" - public final void mRULE_SL_COMMENT() throws RecognitionException { - try { - int _type = RULE_SL_COMMENT; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3598:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3598:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? - { - match("//"); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3598:24: (~ ( ( '\\n' | '\\r' ) ) )* - loop8: - do { - int alt8=2; - int LA8_0 = input.LA(1); - - if ( ((LA8_0>='\u0000' && LA8_0<='\t')||(LA8_0>='\u000B' && LA8_0<='\f')||(LA8_0>='\u000E' && LA8_0<='\uFFFF')) ) { - alt8=1; - } - - - switch (alt8) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3598:24: ~ ( ( '\\n' | '\\r' ) ) - { - if ( (input.LA(1)>='\u0000' && input.LA(1)<='\t')||(input.LA(1)>='\u000B' && input.LA(1)<='\f')||(input.LA(1)>='\u000E' && input.LA(1)<='\uFFFF') ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - - } - break; - - default : - break loop8; - } - } while (true); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3598:40: ( ( '\\r' )? '\\n' )? - int alt10=2; - int LA10_0 = input.LA(1); - - if ( (LA10_0=='\n'||LA10_0=='\r') ) { - alt10=1; - } - switch (alt10) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3598:41: ( '\\r' )? '\\n' - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3598:41: ( '\\r' )? - int alt9=2; - int LA9_0 = input.LA(1); - - if ( (LA9_0=='\r') ) { - alt9=1; - } - switch (alt9) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3598:41: '\\r' - { - match('\r'); - - } - break; - - } - - match('\n'); - - } - break; - - } - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "RULE_SL_COMMENT" - - // $ANTLR start "RULE_WS" - public final void mRULE_WS() throws RecognitionException { - try { - int _type = RULE_WS; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3600:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3600:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3600:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ - int cnt11=0; - loop11: - do { - int alt11=2; - int LA11_0 = input.LA(1); - - if ( ((LA11_0>='\t' && LA11_0<='\n')||LA11_0=='\r'||LA11_0==' ') ) { - alt11=1; - } - - - switch (alt11) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g: - { - if ( (input.LA(1)>='\t' && input.LA(1)<='\n')||input.LA(1)=='\r'||input.LA(1)==' ' ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - - } - break; - - default : - if ( cnt11 >= 1 ) break loop11; - EarlyExitException eee = - new EarlyExitException(11, input); - throw eee; - } - cnt11++; - } while (true); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "RULE_WS" - - // $ANTLR start "RULE_ANY_OTHER" - public final void mRULE_ANY_OTHER() throws RecognitionException { - try { - int _type = RULE_ANY_OTHER; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3602:16: ( . ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3602:18: . - { - matchAny(); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "RULE_ANY_OTHER" - - public void mTokens() throws RecognitionException { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:8: ( T__11 | T__12 | T__13 | T__14 | T__15 | T__16 | T__17 | T__18 | T__19 | T__20 | T__21 | T__22 | T__23 | T__24 | T__25 | T__26 | T__27 | T__28 | T__29 | T__30 | T__31 | T__32 | T__33 | T__34 | T__35 | T__36 | T__37 | T__38 | T__39 | T__40 | T__41 | T__42 | T__43 | T__44 | T__45 | RULE_ID | RULE_INT | RULE_STRING | RULE_ML_COMMENT | RULE_SL_COMMENT | RULE_WS | RULE_ANY_OTHER ) - int alt12=42; - alt12 = dfa12.predict(input); - switch (alt12) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:10: T__11 - { - mT__11(); - - } - break; - case 2 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:16: T__12 - { - mT__12(); - - } - break; - case 3 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:22: T__13 - { - mT__13(); - - } - break; - case 4 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:28: T__14 - { - mT__14(); - - } - break; - case 5 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:34: T__15 - { - mT__15(); - - } - break; - case 6 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:40: T__16 - { - mT__16(); - - } - break; - case 7 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:46: T__17 - { - mT__17(); - - } - break; - case 8 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:52: T__18 - { - mT__18(); - - } - break; - case 9 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:58: T__19 - { - mT__19(); - - } - break; - case 10 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:64: T__20 - { - mT__20(); - - } - break; - case 11 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:70: T__21 - { - mT__21(); - - } - break; - case 12 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:76: T__22 - { - mT__22(); - - } - break; - case 13 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:82: T__23 - { - mT__23(); - - } - break; - case 14 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:88: T__24 - { - mT__24(); - - } - break; - case 15 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:94: T__25 - { - mT__25(); - - } - break; - case 16 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:100: T__26 - { - mT__26(); - - } - break; - case 17 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:106: T__27 - { - mT__27(); - - } - break; - case 18 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:112: T__28 - { - mT__28(); - - } - break; - case 19 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:118: T__29 - { - mT__29(); - - } - break; - case 20 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:124: T__30 - { - mT__30(); - - } - break; - case 21 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:130: T__31 - { - mT__31(); - - } - break; - case 22 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:136: T__32 - { - mT__32(); - - } - break; - case 23 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:142: T__33 - { - mT__33(); - - } - break; - case 24 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:148: T__34 - { - mT__34(); - - } - break; - case 25 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:154: T__35 - { - mT__35(); - - } - break; - case 26 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:160: T__36 - { - mT__36(); - - } - break; - case 27 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:166: T__37 - { - mT__37(); - - } - break; - case 28 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:172: T__38 - { - mT__38(); - - } - break; - case 29 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:178: T__39 - { - mT__39(); - - } - break; - case 30 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:184: T__40 - { - mT__40(); - - } - break; - case 31 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:190: T__41 - { - mT__41(); - - } - break; - case 32 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:196: T__42 - { - mT__42(); - - } - break; - case 33 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:202: T__43 - { - mT__43(); - - } - break; - case 34 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:208: T__44 - { - mT__44(); - - } - break; - case 35 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:214: T__45 - { - mT__45(); - - } - break; - case 36 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:220: RULE_ID - { - mRULE_ID(); - - } - break; - case 37 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:228: RULE_INT - { - mRULE_INT(); - - } - break; - case 38 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:237: RULE_STRING - { - mRULE_STRING(); - - } - break; - case 39 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:249: RULE_ML_COMMENT - { - mRULE_ML_COMMENT(); - - } - break; - case 40 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:265: RULE_SL_COMMENT - { - mRULE_SL_COMMENT(); - - } - break; - case 41 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:281: RULE_WS - { - mRULE_WS(); - - } - break; - case 42 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1:289: RULE_ANY_OTHER - { - mRULE_ANY_OTHER(); - - } - break; - - } - - } - - - protected DFA12 dfa12 = new DFA12(this); - static final String DFA12_eotS = - "\1\uffff\1\43\2\uffff\4\43\6\uffff\4\43\2\uffff\6\43\1\41\2\uffff"+ - "\3\41\2\uffff\1\43\3\uffff\2\43\1\116\1\117\3\43\1\123\1\43\6\uffff"+ - "\6\43\2\uffff\3\43\1\136\1\43\1\140\1\141\1\43\5\uffff\4\43\2\uffff"+ - "\1\147\2\43\1\uffff\3\43\1\155\1\43\1\157\1\160\3\43\1\uffff\1\43"+ - "\2\uffff\5\43\1\uffff\1\172\1\173\3\43\1\uffff\1\177\2\uffff\3\43"+ - "\1\u0083\5\43\2\uffff\1\u0089\2\43\1\uffff\3\43\1\uffff\1\u008f"+ - "\1\u0090\1\u0091\2\43\1\uffff\1\u0094\1\43\1\u0096\2\43\3\uffff"+ - "\2\43\1\uffff\1\43\1\uffff\1\43\1\u009d\2\43\1\u00a0\1\u00a1\1\uffff"+ - "\2\43\2\uffff\4\43\1\u00a8\1\43\1\uffff\1\u00aa\1\uffff"; - static final String DFA12_eofS = - "\u00ab\uffff"; - static final String DFA12_minS = - "\1\0\1\157\2\uffff\1\155\1\156\1\162\1\150\6\uffff\1\154\1\141\1"+ - "\145\1\151\2\uffff\1\141\1\162\1\151\1\171\2\157\1\101\2\uffff\2"+ - "\0\1\52\2\uffff\1\144\3\uffff\1\160\1\163\2\60\1\144\1\157\1\160"+ - "\1\60\1\162\6\uffff\2\157\1\162\1\154\1\143\1\147\2\uffff\1\157"+ - "\1\156\1\164\1\60\1\164\2\60\1\143\5\uffff\1\165\1\157\1\164\1\145"+ - "\2\uffff\1\60\1\155\1\145\1\uffff\1\157\1\142\1\164\1\60\1\145\2"+ - "\60\1\151\1\164\1\143\1\uffff\1\150\2\uffff\1\141\1\154\1\162\1"+ - "\141\1\162\1\uffff\2\60\1\167\1\141\1\157\1\uffff\1\60\2\uffff\1"+ - "\143\1\151\1\150\1\60\1\154\1\145\1\164\1\156\1\162\2\uffff\1\60"+ - "\1\154\1\143\1\uffff\1\145\1\156\1\145\1\uffff\3\60\1\164\1\165"+ - "\1\uffff\1\60\1\157\1\60\1\165\1\163\3\uffff\1\151\1\160\1\uffff"+ - "\1\154\1\uffff\1\145\1\60\1\141\1\164\2\60\1\uffff\1\164\1\151\2"+ - "\uffff\1\145\1\142\1\163\1\154\1\60\1\145\1\uffff\1\60\1\uffff"; - static final String DFA12_maxS = - "\1\uffff\1\157\2\uffff\1\156\1\164\1\162\1\171\6\uffff\1\154\1\162"+ - "\1\157\1\151\2\uffff\1\157\1\162\1\151\1\171\2\157\1\172\2\uffff"+ - "\2\uffff\1\57\2\uffff\1\144\3\uffff\1\160\1\164\2\172\1\144\1\157"+ - "\1\160\1\172\1\162\6\uffff\2\157\1\162\1\154\1\143\1\147\2\uffff"+ - "\1\157\1\156\1\164\1\172\1\164\2\172\1\143\5\uffff\1\165\1\157\1"+ - "\164\1\145\2\uffff\1\172\1\155\1\145\1\uffff\1\157\1\142\1\164\1"+ - "\172\1\145\2\172\1\151\1\164\1\143\1\uffff\1\150\2\uffff\1\141\1"+ - "\154\1\162\1\141\1\162\1\uffff\2\172\1\167\1\141\1\157\1\uffff\1"+ - "\172\2\uffff\1\143\1\151\1\150\1\172\1\154\1\145\1\164\1\156\1\162"+ - "\2\uffff\1\172\1\154\1\143\1\uffff\1\145\1\156\1\145\1\uffff\3\172"+ - "\1\164\1\165\1\uffff\1\172\1\157\1\172\1\165\1\163\3\uffff\1\151"+ - "\1\160\1\uffff\1\154\1\uffff\1\145\1\172\1\141\1\164\2\172\1\uffff"+ - "\1\164\1\151\2\uffff\1\145\1\142\1\163\1\154\1\172\1\145\1\uffff"+ - "\1\172\1\uffff"; - static final String DFA12_acceptS = - "\2\uffff\1\2\1\3\4\uffff\1\10\1\11\1\12\1\13\1\14\1\15\4\uffff\1"+ - "\23\1\24\7\uffff\1\44\1\45\3\uffff\1\51\1\52\1\uffff\1\44\1\2\1"+ - "\3\11\uffff\1\10\1\11\1\12\1\13\1\14\1\15\6\uffff\1\23\1\24\10\uffff"+ - "\1\45\1\46\1\47\1\50\1\51\4\uffff\1\5\1\27\3\uffff\1\25\12\uffff"+ - "\1\30\1\uffff\1\37\1\40\5\uffff\1\34\5\uffff\1\33\1\uffff\1\31\1"+ - "\22\11\uffff\1\6\1\7\3\uffff\1\21\3\uffff\1\36\5\uffff\1\42\5\uffff"+ - "\1\41\1\1\1\4\2\uffff\1\16\1\uffff\1\26\6\uffff\1\43\2\uffff\1\17"+ - "\1\32\6\uffff\1\20\1\uffff\1\35"; - static final String DFA12_specialS = - "\1\2\34\uffff\1\1\1\0\u008c\uffff}>"; - static final String[] DFA12_transitionS = { - "\11\41\2\40\2\41\1\40\22\41\1\40\1\41\1\35\4\41\1\36\1\12\1"+ - "\14\2\41\1\13\1\41\1\3\1\37\12\34\1\15\1\2\1\10\1\41\1\11\2"+ - "\41\32\33\3\41\1\32\1\33\1\41\1\5\1\27\1\24\1\30\1\33\1\6\1"+ - "\16\1\33\1\4\2\33\1\31\1\1\1\33\1\25\1\17\1\33\1\20\1\21\1\7"+ - "\2\33\1\26\3\33\1\22\1\41\1\23\uff82\41", - "\1\42", - "", - "", - "\1\46\1\47", - "\1\52\4\uffff\1\50\1\51", - "\1\53", - "\1\56\6\uffff\1\55\11\uffff\1\54", - "", - "", - "", - "", - "", - "", - "\1\65", - "\1\67\20\uffff\1\66", - "\1\71\11\uffff\1\70", - "\1\72", - "", - "", - "\1\77\6\uffff\1\75\6\uffff\1\76", - "\1\100", - "\1\101", - "\1\102", - "\1\103", - "\1\104", - "\32\43\4\uffff\1\43\1\uffff\32\43", - "", - "", - "\0\106", - "\0\106", - "\1\107\4\uffff\1\110", - "", - "", - "\1\112", - "", - "", - "", - "\1\113", - "\1\114\1\115", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\1\120", - "\1\121", - "\1\122", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\1\124", - "", - "", - "", - "", - "", - "", - "\1\125", - "\1\126", - "\1\127", - "\1\130", - "\1\131", - "\1\132", - "", - "", - "\1\133", - "\1\134", - "\1\135", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\1\137", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\1\142", - "", - "", - "", - "", - "", - "\1\143", - "\1\144", - "\1\145", - "\1\146", - "", - "", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\1\150", - "\1\151", - "", - "\1\152", - "\1\153", - "\1\154", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\1\156", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\1\161", - "\1\162", - "\1\163", - "", - "\1\164", - "", - "", - "\1\165", - "\1\166", - "\1\167", - "\1\170", - "\1\171", - "", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\1\174", - "\1\175", - "\1\176", - "", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "", - "", - "\1\u0080", - "\1\u0081", - "\1\u0082", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\1\u0084", - "\1\u0085", - "\1\u0086", - "\1\u0087", - "\1\u0088", - "", - "", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\1\u008a", - "\1\u008b", - "", - "\1\u008c", - "\1\u008d", - "\1\u008e", - "", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\1\u0092", - "\1\u0093", - "", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\1\u0095", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\1\u0097", - "\1\u0098", - "", - "", - "", - "\1\u0099", - "\1\u009a", - "", - "\1\u009b", - "", - "\1\u009c", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\1\u009e", - "\1\u009f", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "", - "\1\u00a2", - "\1\u00a3", - "", - "", - "\1\u00a4", - "\1\u00a5", - "\1\u00a6", - "\1\u00a7", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "\1\u00a9", - "", - "\12\43\7\uffff\32\43\4\uffff\1\43\1\uffff\32\43", - "" - }; - - static final short[] DFA12_eot = DFA.unpackEncodedString(DFA12_eotS); - static final short[] DFA12_eof = DFA.unpackEncodedString(DFA12_eofS); - static final char[] DFA12_min = DFA.unpackEncodedStringToUnsignedChars(DFA12_minS); - static final char[] DFA12_max = DFA.unpackEncodedStringToUnsignedChars(DFA12_maxS); - static final short[] DFA12_accept = DFA.unpackEncodedString(DFA12_acceptS); - static final short[] DFA12_special = DFA.unpackEncodedString(DFA12_specialS); - static final short[][] DFA12_transition; - - static { - int numStates = DFA12_transitionS.length; - DFA12_transition = new short[numStates][]; - for (int i=0; i='\u0000' && LA12_30<='\uFFFF')) ) {s = 70;} - - else s = 33; - - if ( s>=0 ) return s; - break; - case 1 : - int LA12_29 = input.LA(1); - - s = -1; - if ( ((LA12_29>='\u0000' && LA12_29<='\uFFFF')) ) {s = 70;} - - else s = 33; - - if ( s>=0 ) return s; - break; - case 2 : - int LA12_0 = input.LA(1); - - s = -1; - if ( (LA12_0=='m') ) {s = 1;} - - else if ( (LA12_0==';') ) {s = 2;} - - else if ( (LA12_0=='.') ) {s = 3;} - - else if ( (LA12_0=='i') ) {s = 4;} - - else if ( (LA12_0=='a') ) {s = 5;} - - else if ( (LA12_0=='f') ) {s = 6;} - - else if ( (LA12_0=='t') ) {s = 7;} - - else if ( (LA12_0=='<') ) {s = 8;} - - else if ( (LA12_0=='>') ) {s = 9;} - - else if ( (LA12_0=='(') ) {s = 10;} - - else if ( (LA12_0==',') ) {s = 11;} - - else if ( (LA12_0==')') ) {s = 12;} - - else if ( (LA12_0==':') ) {s = 13;} - - else if ( (LA12_0=='g') ) {s = 14;} - - else if ( (LA12_0=='p') ) {s = 15;} - - else if ( (LA12_0=='r') ) {s = 16;} - - else if ( (LA12_0=='s') ) {s = 17;} - - else if ( (LA12_0=='{') ) {s = 18;} - - else if ( (LA12_0=='}') ) {s = 19;} - - else if ( (LA12_0=='c') ) {s = 20;} - - else if ( (LA12_0=='o') ) {s = 21;} - - else if ( (LA12_0=='w') ) {s = 22;} - - else if ( (LA12_0=='b') ) {s = 23;} - - else if ( (LA12_0=='d') ) {s = 24;} - - else if ( (LA12_0=='l') ) {s = 25;} - - else if ( (LA12_0=='^') ) {s = 26;} - - else if ( ((LA12_0>='A' && LA12_0<='Z')||LA12_0=='_'||LA12_0=='e'||LA12_0=='h'||(LA12_0>='j' && LA12_0<='k')||LA12_0=='n'||LA12_0=='q'||(LA12_0>='u' && LA12_0<='v')||(LA12_0>='x' && LA12_0<='z')) ) {s = 27;} - - else if ( ((LA12_0>='0' && LA12_0<='9')) ) {s = 28;} - - else if ( (LA12_0=='\"') ) {s = 29;} - - else if ( (LA12_0=='\'') ) {s = 30;} - - else if ( (LA12_0=='/') ) {s = 31;} - - else if ( ((LA12_0>='\t' && LA12_0<='\n')||LA12_0=='\r'||LA12_0==' ') ) {s = 32;} - - else if ( ((LA12_0>='\u0000' && LA12_0<='\b')||(LA12_0>='\u000B' && LA12_0<='\f')||(LA12_0>='\u000E' && LA12_0<='\u001F')||LA12_0=='!'||(LA12_0>='#' && LA12_0<='&')||(LA12_0>='*' && LA12_0<='+')||LA12_0=='-'||LA12_0=='='||(LA12_0>='?' && LA12_0<='@')||(LA12_0>='[' && LA12_0<=']')||LA12_0=='`'||LA12_0=='|'||(LA12_0>='~' && LA12_0<='\uFFFF')) ) {s = 33;} - - if ( s>=0 ) return s; - break; - } - NoViableAltException nvae = - new NoViableAltException(getDescription(), 12, _s, input); - error(nvae); - throw nvae; - } - } - - -} \ No newline at end of file diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDslParser.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDslParser.java deleted file mode 100644 index b0ba70721..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDslParser.java +++ /dev/null @@ -1,8946 +0,0 @@ -package org.scribble.editor.dsl.parser.antlr.internal; - -import org.eclipse.xtext.*; -import org.eclipse.xtext.parser.*; -import org.eclipse.xtext.parser.impl.*; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.xtext.parser.antlr.AbstractInternalAntlrParser; -import org.eclipse.xtext.parser.antlr.XtextTokenStream; -import org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens; -import org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken; -import org.scribble.editor.dsl.services.ScribbleDslGrammarAccess; - - - -import org.antlr.runtime.*; -import java.util.Stack; -import java.util.List; -import java.util.ArrayList; - -@SuppressWarnings("all") -public class InternalScribbleDslParser extends AbstractInternalAntlrParser { - public static final String[] tokenNames = new String[] { - "", "", "", "", "RULE_ID", "RULE_STRING", "RULE_INT", "RULE_ML_COMMENT", "RULE_SL_COMMENT", "RULE_WS", "RULE_ANY_OTHER", "'module'", "';'", "'.'", "'import'", "'as'", "'from'", "'type'", "'<'", "'>'", "'('", "','", "')'", "':'", "'global'", "'protocol'", "'instantiates'", "'role'", "'sig'", "'{'", "'}'", "'to'", "'choice'", "'at'", "'or'", "'rec'", "'continue'", "'par'", "'and'", "'interruptible'", "'with'", "'by'", "'do'", "'local'", "'throw'", "'catches'" - }; - public static final int RULE_ID=4; - public static final int T__29=29; - public static final int T__28=28; - public static final int T__27=27; - public static final int T__26=26; - public static final int T__25=25; - public static final int T__24=24; - public static final int T__23=23; - public static final int T__22=22; - public static final int RULE_ANY_OTHER=10; - public static final int T__21=21; - public static final int T__20=20; - public static final int EOF=-1; - public static final int T__19=19; - public static final int T__16=16; - public static final int T__15=15; - public static final int T__18=18; - public static final int T__17=17; - public static final int T__12=12; - public static final int T__11=11; - public static final int T__14=14; - public static final int T__13=13; - public static final int RULE_INT=6; - public static final int T__42=42; - public static final int T__43=43; - public static final int T__40=40; - public static final int T__41=41; - public static final int T__44=44; - public static final int T__45=45; - public static final int RULE_SL_COMMENT=8; - public static final int RULE_ML_COMMENT=7; - public static final int T__30=30; - public static final int T__31=31; - public static final int T__32=32; - public static final int RULE_STRING=5; - public static final int T__33=33; - public static final int T__34=34; - public static final int T__35=35; - public static final int T__36=36; - public static final int T__37=37; - public static final int T__38=38; - public static final int T__39=39; - public static final int RULE_WS=9; - - // delegates - // delegators - - - public InternalScribbleDslParser(TokenStream input) { - this(input, new RecognizerSharedState()); - } - public InternalScribbleDslParser(TokenStream input, RecognizerSharedState state) { - super(input, state); - - } - - - public String[] getTokenNames() { return InternalScribbleDslParser.tokenNames; } - public String getGrammarFileName() { return "../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g"; } - - - - private ScribbleDslGrammarAccess grammarAccess; - - public InternalScribbleDslParser(TokenStream input, ScribbleDslGrammarAccess grammarAccess) { - this(input); - this.grammarAccess = grammarAccess; - registerRules(grammarAccess.getGrammar()); - } - - @Override - protected String getFirstRuleName() { - return "Module"; - } - - @Override - protected ScribbleDslGrammarAccess getGrammarAccess() { - return grammarAccess; - } - - - - // $ANTLR start "entryRuleModule" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:67:1: entryRuleModule returns [EObject current=null] : iv_ruleModule= ruleModule EOF ; - public final EObject entryRuleModule() throws RecognitionException { - EObject current = null; - - EObject iv_ruleModule = null; - - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:68:2: (iv_ruleModule= ruleModule EOF ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:69:2: iv_ruleModule= ruleModule EOF - { - newCompositeNode(grammarAccess.getModuleRule()); - pushFollow(FOLLOW_ruleModule_in_entryRuleModule75); - iv_ruleModule=ruleModule(); - - state._fsp--; - - current =iv_ruleModule; - match(input,EOF,FOLLOW_EOF_in_entryRuleModule85); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleModule" - - - // $ANTLR start "ruleModule" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:76:1: ruleModule returns [EObject current=null] : (otherlv_0= 'module' ( (lv_name_1_0= ruleModuleName ) ) otherlv_2= ';' ( (lv_imports_3_0= ruleImportDecl ) )* ( (lv_types_4_0= rulePayloadTypeDecl ) )* ( ( (lv_globals_5_0= ruleGlobalProtocolDecl ) ) | ( (lv_locals_6_0= ruleLocalProtocolDecl ) ) )* ) ; - public final EObject ruleModule() throws RecognitionException { - EObject current = null; - - Token otherlv_0=null; - Token otherlv_2=null; - AntlrDatatypeRuleToken lv_name_1_0 = null; - - EObject lv_imports_3_0 = null; - - EObject lv_types_4_0 = null; - - EObject lv_globals_5_0 = null; - - EObject lv_locals_6_0 = null; - - - enterRule(); - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:79:28: ( (otherlv_0= 'module' ( (lv_name_1_0= ruleModuleName ) ) otherlv_2= ';' ( (lv_imports_3_0= ruleImportDecl ) )* ( (lv_types_4_0= rulePayloadTypeDecl ) )* ( ( (lv_globals_5_0= ruleGlobalProtocolDecl ) ) | ( (lv_locals_6_0= ruleLocalProtocolDecl ) ) )* ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:80:1: (otherlv_0= 'module' ( (lv_name_1_0= ruleModuleName ) ) otherlv_2= ';' ( (lv_imports_3_0= ruleImportDecl ) )* ( (lv_types_4_0= rulePayloadTypeDecl ) )* ( ( (lv_globals_5_0= ruleGlobalProtocolDecl ) ) | ( (lv_locals_6_0= ruleLocalProtocolDecl ) ) )* ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:80:1: (otherlv_0= 'module' ( (lv_name_1_0= ruleModuleName ) ) otherlv_2= ';' ( (lv_imports_3_0= ruleImportDecl ) )* ( (lv_types_4_0= rulePayloadTypeDecl ) )* ( ( (lv_globals_5_0= ruleGlobalProtocolDecl ) ) | ( (lv_locals_6_0= ruleLocalProtocolDecl ) ) )* ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:80:3: otherlv_0= 'module' ( (lv_name_1_0= ruleModuleName ) ) otherlv_2= ';' ( (lv_imports_3_0= ruleImportDecl ) )* ( (lv_types_4_0= rulePayloadTypeDecl ) )* ( ( (lv_globals_5_0= ruleGlobalProtocolDecl ) ) | ( (lv_locals_6_0= ruleLocalProtocolDecl ) ) )* - { - otherlv_0=(Token)match(input,11,FOLLOW_11_in_ruleModule122); - - newLeafNode(otherlv_0, grammarAccess.getModuleAccess().getModuleKeyword_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:84:1: ( (lv_name_1_0= ruleModuleName ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:85:1: (lv_name_1_0= ruleModuleName ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:85:1: (lv_name_1_0= ruleModuleName ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:86:3: lv_name_1_0= ruleModuleName - { - - newCompositeNode(grammarAccess.getModuleAccess().getNameModuleNameParserRuleCall_1_0()); - - pushFollow(FOLLOW_ruleModuleName_in_ruleModule143); - lv_name_1_0=ruleModuleName(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getModuleRule()); - } - set( - current, - "name", - lv_name_1_0, - "ModuleName"); - afterParserOrEnumRuleCall(); - - - } - - - } - - otherlv_2=(Token)match(input,12,FOLLOW_12_in_ruleModule155); - - newLeafNode(otherlv_2, grammarAccess.getModuleAccess().getSemicolonKeyword_2()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:106:1: ( (lv_imports_3_0= ruleImportDecl ) )* - loop1: - do { - int alt1=2; - int LA1_0 = input.LA(1); - - if ( (LA1_0==14||LA1_0==16) ) { - alt1=1; - } - - - switch (alt1) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:107:1: (lv_imports_3_0= ruleImportDecl ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:107:1: (lv_imports_3_0= ruleImportDecl ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:108:3: lv_imports_3_0= ruleImportDecl - { - - newCompositeNode(grammarAccess.getModuleAccess().getImportsImportDeclParserRuleCall_3_0()); - - pushFollow(FOLLOW_ruleImportDecl_in_ruleModule176); - lv_imports_3_0=ruleImportDecl(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getModuleRule()); - } - add( - current, - "imports", - lv_imports_3_0, - "ImportDecl"); - afterParserOrEnumRuleCall(); - - - } - - - } - break; - - default : - break loop1; - } - } while (true); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:124:3: ( (lv_types_4_0= rulePayloadTypeDecl ) )* - loop2: - do { - int alt2=2; - int LA2_0 = input.LA(1); - - if ( (LA2_0==17) ) { - alt2=1; - } - - - switch (alt2) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:125:1: (lv_types_4_0= rulePayloadTypeDecl ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:125:1: (lv_types_4_0= rulePayloadTypeDecl ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:126:3: lv_types_4_0= rulePayloadTypeDecl - { - - newCompositeNode(grammarAccess.getModuleAccess().getTypesPayloadTypeDeclParserRuleCall_4_0()); - - pushFollow(FOLLOW_rulePayloadTypeDecl_in_ruleModule198); - lv_types_4_0=rulePayloadTypeDecl(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getModuleRule()); - } - add( - current, - "types", - lv_types_4_0, - "PayloadTypeDecl"); - afterParserOrEnumRuleCall(); - - - } - - - } - break; - - default : - break loop2; - } - } while (true); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:142:3: ( ( (lv_globals_5_0= ruleGlobalProtocolDecl ) ) | ( (lv_locals_6_0= ruleLocalProtocolDecl ) ) )* - loop3: - do { - int alt3=3; - int LA3_0 = input.LA(1); - - if ( (LA3_0==24) ) { - alt3=1; - } - else if ( (LA3_0==43) ) { - alt3=2; - } - - - switch (alt3) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:142:4: ( (lv_globals_5_0= ruleGlobalProtocolDecl ) ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:142:4: ( (lv_globals_5_0= ruleGlobalProtocolDecl ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:143:1: (lv_globals_5_0= ruleGlobalProtocolDecl ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:143:1: (lv_globals_5_0= ruleGlobalProtocolDecl ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:144:3: lv_globals_5_0= ruleGlobalProtocolDecl - { - - newCompositeNode(grammarAccess.getModuleAccess().getGlobalsGlobalProtocolDeclParserRuleCall_5_0_0()); - - pushFollow(FOLLOW_ruleGlobalProtocolDecl_in_ruleModule221); - lv_globals_5_0=ruleGlobalProtocolDecl(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getModuleRule()); - } - add( - current, - "globals", - lv_globals_5_0, - "GlobalProtocolDecl"); - afterParserOrEnumRuleCall(); - - - } - - - } - - - } - break; - case 2 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:161:6: ( (lv_locals_6_0= ruleLocalProtocolDecl ) ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:161:6: ( (lv_locals_6_0= ruleLocalProtocolDecl ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:162:1: (lv_locals_6_0= ruleLocalProtocolDecl ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:162:1: (lv_locals_6_0= ruleLocalProtocolDecl ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:163:3: lv_locals_6_0= ruleLocalProtocolDecl - { - - newCompositeNode(grammarAccess.getModuleAccess().getLocalsLocalProtocolDeclParserRuleCall_5_1_0()); - - pushFollow(FOLLOW_ruleLocalProtocolDecl_in_ruleModule248); - lv_locals_6_0=ruleLocalProtocolDecl(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getModuleRule()); - } - add( - current, - "locals", - lv_locals_6_0, - "LocalProtocolDecl"); - afterParserOrEnumRuleCall(); - - - } - - - } - - - } - break; - - default : - break loop3; - } - } while (true); - - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleModule" - - - // $ANTLR start "entryRuleModuleName" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:187:1: entryRuleModuleName returns [String current=null] : iv_ruleModuleName= ruleModuleName EOF ; - public final String entryRuleModuleName() throws RecognitionException { - String current = null; - - AntlrDatatypeRuleToken iv_ruleModuleName = null; - - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:188:2: (iv_ruleModuleName= ruleModuleName EOF ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:189:2: iv_ruleModuleName= ruleModuleName EOF - { - newCompositeNode(grammarAccess.getModuleNameRule()); - pushFollow(FOLLOW_ruleModuleName_in_entryRuleModuleName287); - iv_ruleModuleName=ruleModuleName(); - - state._fsp--; - - current =iv_ruleModuleName.getText(); - match(input,EOF,FOLLOW_EOF_in_entryRuleModuleName298); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleModuleName" - - - // $ANTLR start "ruleModuleName" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:196:1: ruleModuleName returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : (this_ID_0= RULE_ID (kw= '.' this_ID_2= RULE_ID )* ) ; - public final AntlrDatatypeRuleToken ruleModuleName() throws RecognitionException { - AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken(); - - Token this_ID_0=null; - Token kw=null; - Token this_ID_2=null; - - enterRule(); - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:199:28: ( (this_ID_0= RULE_ID (kw= '.' this_ID_2= RULE_ID )* ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:200:1: (this_ID_0= RULE_ID (kw= '.' this_ID_2= RULE_ID )* ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:200:1: (this_ID_0= RULE_ID (kw= '.' this_ID_2= RULE_ID )* ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:200:6: this_ID_0= RULE_ID (kw= '.' this_ID_2= RULE_ID )* - { - this_ID_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleModuleName338); - - current.merge(this_ID_0); - - - newLeafNode(this_ID_0, grammarAccess.getModuleNameAccess().getIDTerminalRuleCall_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:207:1: (kw= '.' this_ID_2= RULE_ID )* - loop4: - do { - int alt4=2; - int LA4_0 = input.LA(1); - - if ( (LA4_0==13) ) { - alt4=1; - } - - - switch (alt4) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:208:2: kw= '.' this_ID_2= RULE_ID - { - kw=(Token)match(input,13,FOLLOW_13_in_ruleModuleName357); - - current.merge(kw); - newLeafNode(kw, grammarAccess.getModuleNameAccess().getFullStopKeyword_1_0()); - - this_ID_2=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleModuleName372); - - current.merge(this_ID_2); - - - newLeafNode(this_ID_2, grammarAccess.getModuleNameAccess().getIDTerminalRuleCall_1_1()); - - - } - break; - - default : - break loop4; - } - } while (true); - - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleModuleName" - - - // $ANTLR start "entryRuleImportDecl" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:228:1: entryRuleImportDecl returns [EObject current=null] : iv_ruleImportDecl= ruleImportDecl EOF ; - public final EObject entryRuleImportDecl() throws RecognitionException { - EObject current = null; - - EObject iv_ruleImportDecl = null; - - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:229:2: (iv_ruleImportDecl= ruleImportDecl EOF ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:230:2: iv_ruleImportDecl= ruleImportDecl EOF - { - newCompositeNode(grammarAccess.getImportDeclRule()); - pushFollow(FOLLOW_ruleImportDecl_in_entryRuleImportDecl419); - iv_ruleImportDecl=ruleImportDecl(); - - state._fsp--; - - current =iv_ruleImportDecl; - match(input,EOF,FOLLOW_EOF_in_entryRuleImportDecl429); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleImportDecl" - - - // $ANTLR start "ruleImportDecl" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:237:1: ruleImportDecl returns [EObject current=null] : (this_ImportModule_0= ruleImportModule | this_ImportMember_1= ruleImportMember ) ; - public final EObject ruleImportDecl() throws RecognitionException { - EObject current = null; - - EObject this_ImportModule_0 = null; - - EObject this_ImportMember_1 = null; - - - enterRule(); - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:240:28: ( (this_ImportModule_0= ruleImportModule | this_ImportMember_1= ruleImportMember ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:241:1: (this_ImportModule_0= ruleImportModule | this_ImportMember_1= ruleImportMember ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:241:1: (this_ImportModule_0= ruleImportModule | this_ImportMember_1= ruleImportMember ) - int alt5=2; - int LA5_0 = input.LA(1); - - if ( (LA5_0==14) ) { - alt5=1; - } - else if ( (LA5_0==16) ) { - alt5=2; - } - else { - NoViableAltException nvae = - new NoViableAltException("", 5, 0, input); - - throw nvae; - } - switch (alt5) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:242:5: this_ImportModule_0= ruleImportModule - { - - newCompositeNode(grammarAccess.getImportDeclAccess().getImportModuleParserRuleCall_0()); - - pushFollow(FOLLOW_ruleImportModule_in_ruleImportDecl476); - this_ImportModule_0=ruleImportModule(); - - state._fsp--; - - - current = this_ImportModule_0; - afterParserOrEnumRuleCall(); - - - } - break; - case 2 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:252:5: this_ImportMember_1= ruleImportMember - { - - newCompositeNode(grammarAccess.getImportDeclAccess().getImportMemberParserRuleCall_1()); - - pushFollow(FOLLOW_ruleImportMember_in_ruleImportDecl503); - this_ImportMember_1=ruleImportMember(); - - state._fsp--; - - - current = this_ImportMember_1; - afterParserOrEnumRuleCall(); - - - } - break; - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleImportDecl" - - - // $ANTLR start "entryRuleImportModule" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:268:1: entryRuleImportModule returns [EObject current=null] : iv_ruleImportModule= ruleImportModule EOF ; - public final EObject entryRuleImportModule() throws RecognitionException { - EObject current = null; - - EObject iv_ruleImportModule = null; - - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:269:2: (iv_ruleImportModule= ruleImportModule EOF ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:270:2: iv_ruleImportModule= ruleImportModule EOF - { - newCompositeNode(grammarAccess.getImportModuleRule()); - pushFollow(FOLLOW_ruleImportModule_in_entryRuleImportModule538); - iv_ruleImportModule=ruleImportModule(); - - state._fsp--; - - current =iv_ruleImportModule; - match(input,EOF,FOLLOW_EOF_in_entryRuleImportModule548); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleImportModule" - - - // $ANTLR start "ruleImportModule" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:277:1: ruleImportModule returns [EObject current=null] : (otherlv_0= 'import' ( (lv_name_1_0= ruleModuleName ) ) (otherlv_2= 'as' ( (lv_alias_3_0= RULE_ID ) ) )? otherlv_4= ';' ) ; - public final EObject ruleImportModule() throws RecognitionException { - EObject current = null; - - Token otherlv_0=null; - Token otherlv_2=null; - Token lv_alias_3_0=null; - Token otherlv_4=null; - AntlrDatatypeRuleToken lv_name_1_0 = null; - - - enterRule(); - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:280:28: ( (otherlv_0= 'import' ( (lv_name_1_0= ruleModuleName ) ) (otherlv_2= 'as' ( (lv_alias_3_0= RULE_ID ) ) )? otherlv_4= ';' ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:281:1: (otherlv_0= 'import' ( (lv_name_1_0= ruleModuleName ) ) (otherlv_2= 'as' ( (lv_alias_3_0= RULE_ID ) ) )? otherlv_4= ';' ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:281:1: (otherlv_0= 'import' ( (lv_name_1_0= ruleModuleName ) ) (otherlv_2= 'as' ( (lv_alias_3_0= RULE_ID ) ) )? otherlv_4= ';' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:281:3: otherlv_0= 'import' ( (lv_name_1_0= ruleModuleName ) ) (otherlv_2= 'as' ( (lv_alias_3_0= RULE_ID ) ) )? otherlv_4= ';' - { - otherlv_0=(Token)match(input,14,FOLLOW_14_in_ruleImportModule585); - - newLeafNode(otherlv_0, grammarAccess.getImportModuleAccess().getImportKeyword_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:285:1: ( (lv_name_1_0= ruleModuleName ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:286:1: (lv_name_1_0= ruleModuleName ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:286:1: (lv_name_1_0= ruleModuleName ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:287:3: lv_name_1_0= ruleModuleName - { - - newCompositeNode(grammarAccess.getImportModuleAccess().getNameModuleNameParserRuleCall_1_0()); - - pushFollow(FOLLOW_ruleModuleName_in_ruleImportModule606); - lv_name_1_0=ruleModuleName(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getImportModuleRule()); - } - set( - current, - "name", - lv_name_1_0, - "ModuleName"); - afterParserOrEnumRuleCall(); - - - } - - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:303:2: (otherlv_2= 'as' ( (lv_alias_3_0= RULE_ID ) ) )? - int alt6=2; - int LA6_0 = input.LA(1); - - if ( (LA6_0==15) ) { - alt6=1; - } - switch (alt6) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:303:4: otherlv_2= 'as' ( (lv_alias_3_0= RULE_ID ) ) - { - otherlv_2=(Token)match(input,15,FOLLOW_15_in_ruleImportModule619); - - newLeafNode(otherlv_2, grammarAccess.getImportModuleAccess().getAsKeyword_2_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:307:1: ( (lv_alias_3_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:308:1: (lv_alias_3_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:308:1: (lv_alias_3_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:309:3: lv_alias_3_0= RULE_ID - { - lv_alias_3_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleImportModule636); - - newLeafNode(lv_alias_3_0, grammarAccess.getImportModuleAccess().getAliasIDTerminalRuleCall_2_1_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getImportModuleRule()); - } - setWithLastConsumed( - current, - "alias", - lv_alias_3_0, - "ID"); - - - } - - - } - - - } - break; - - } - - otherlv_4=(Token)match(input,12,FOLLOW_12_in_ruleImportModule655); - - newLeafNode(otherlv_4, grammarAccess.getImportModuleAccess().getSemicolonKeyword_3()); - - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleImportModule" - - - // $ANTLR start "entryRuleImportMember" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:337:1: entryRuleImportMember returns [EObject current=null] : iv_ruleImportMember= ruleImportMember EOF ; - public final EObject entryRuleImportMember() throws RecognitionException { - EObject current = null; - - EObject iv_ruleImportMember = null; - - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:338:2: (iv_ruleImportMember= ruleImportMember EOF ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:339:2: iv_ruleImportMember= ruleImportMember EOF - { - newCompositeNode(grammarAccess.getImportMemberRule()); - pushFollow(FOLLOW_ruleImportMember_in_entryRuleImportMember691); - iv_ruleImportMember=ruleImportMember(); - - state._fsp--; - - current =iv_ruleImportMember; - match(input,EOF,FOLLOW_EOF_in_entryRuleImportMember701); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleImportMember" - - - // $ANTLR start "ruleImportMember" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:346:1: ruleImportMember returns [EObject current=null] : (otherlv_0= 'from' ( (lv_name_1_0= ruleModuleName ) ) otherlv_2= 'import' ( (lv_member_3_0= RULE_ID ) ) (otherlv_4= 'as' ( (lv_alias_5_0= RULE_ID ) ) )? otherlv_6= ';' ) ; - public final EObject ruleImportMember() throws RecognitionException { - EObject current = null; - - Token otherlv_0=null; - Token otherlv_2=null; - Token lv_member_3_0=null; - Token otherlv_4=null; - Token lv_alias_5_0=null; - Token otherlv_6=null; - AntlrDatatypeRuleToken lv_name_1_0 = null; - - - enterRule(); - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:349:28: ( (otherlv_0= 'from' ( (lv_name_1_0= ruleModuleName ) ) otherlv_2= 'import' ( (lv_member_3_0= RULE_ID ) ) (otherlv_4= 'as' ( (lv_alias_5_0= RULE_ID ) ) )? otherlv_6= ';' ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:350:1: (otherlv_0= 'from' ( (lv_name_1_0= ruleModuleName ) ) otherlv_2= 'import' ( (lv_member_3_0= RULE_ID ) ) (otherlv_4= 'as' ( (lv_alias_5_0= RULE_ID ) ) )? otherlv_6= ';' ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:350:1: (otherlv_0= 'from' ( (lv_name_1_0= ruleModuleName ) ) otherlv_2= 'import' ( (lv_member_3_0= RULE_ID ) ) (otherlv_4= 'as' ( (lv_alias_5_0= RULE_ID ) ) )? otherlv_6= ';' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:350:3: otherlv_0= 'from' ( (lv_name_1_0= ruleModuleName ) ) otherlv_2= 'import' ( (lv_member_3_0= RULE_ID ) ) (otherlv_4= 'as' ( (lv_alias_5_0= RULE_ID ) ) )? otherlv_6= ';' - { - otherlv_0=(Token)match(input,16,FOLLOW_16_in_ruleImportMember738); - - newLeafNode(otherlv_0, grammarAccess.getImportMemberAccess().getFromKeyword_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:354:1: ( (lv_name_1_0= ruleModuleName ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:355:1: (lv_name_1_0= ruleModuleName ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:355:1: (lv_name_1_0= ruleModuleName ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:356:3: lv_name_1_0= ruleModuleName - { - - newCompositeNode(grammarAccess.getImportMemberAccess().getNameModuleNameParserRuleCall_1_0()); - - pushFollow(FOLLOW_ruleModuleName_in_ruleImportMember759); - lv_name_1_0=ruleModuleName(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getImportMemberRule()); - } - set( - current, - "name", - lv_name_1_0, - "ModuleName"); - afterParserOrEnumRuleCall(); - - - } - - - } - - otherlv_2=(Token)match(input,14,FOLLOW_14_in_ruleImportMember771); - - newLeafNode(otherlv_2, grammarAccess.getImportMemberAccess().getImportKeyword_2()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:376:1: ( (lv_member_3_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:377:1: (lv_member_3_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:377:1: (lv_member_3_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:378:3: lv_member_3_0= RULE_ID - { - lv_member_3_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleImportMember788); - - newLeafNode(lv_member_3_0, grammarAccess.getImportMemberAccess().getMemberIDTerminalRuleCall_3_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getImportMemberRule()); - } - setWithLastConsumed( - current, - "member", - lv_member_3_0, - "ID"); - - - } - - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:394:2: (otherlv_4= 'as' ( (lv_alias_5_0= RULE_ID ) ) )? - int alt7=2; - int LA7_0 = input.LA(1); - - if ( (LA7_0==15) ) { - alt7=1; - } - switch (alt7) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:394:4: otherlv_4= 'as' ( (lv_alias_5_0= RULE_ID ) ) - { - otherlv_4=(Token)match(input,15,FOLLOW_15_in_ruleImportMember806); - - newLeafNode(otherlv_4, grammarAccess.getImportMemberAccess().getAsKeyword_4_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:398:1: ( (lv_alias_5_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:399:1: (lv_alias_5_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:399:1: (lv_alias_5_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:400:3: lv_alias_5_0= RULE_ID - { - lv_alias_5_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleImportMember823); - - newLeafNode(lv_alias_5_0, grammarAccess.getImportMemberAccess().getAliasIDTerminalRuleCall_4_1_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getImportMemberRule()); - } - setWithLastConsumed( - current, - "alias", - lv_alias_5_0, - "ID"); - - - } - - - } - - - } - break; - - } - - otherlv_6=(Token)match(input,12,FOLLOW_12_in_ruleImportMember842); - - newLeafNode(otherlv_6, grammarAccess.getImportMemberAccess().getSemicolonKeyword_5()); - - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleImportMember" - - - // $ANTLR start "entryRulePayloadTypeDecl" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:428:1: entryRulePayloadTypeDecl returns [EObject current=null] : iv_rulePayloadTypeDecl= rulePayloadTypeDecl EOF ; - public final EObject entryRulePayloadTypeDecl() throws RecognitionException { - EObject current = null; - - EObject iv_rulePayloadTypeDecl = null; - - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:429:2: (iv_rulePayloadTypeDecl= rulePayloadTypeDecl EOF ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:430:2: iv_rulePayloadTypeDecl= rulePayloadTypeDecl EOF - { - newCompositeNode(grammarAccess.getPayloadTypeDeclRule()); - pushFollow(FOLLOW_rulePayloadTypeDecl_in_entryRulePayloadTypeDecl878); - iv_rulePayloadTypeDecl=rulePayloadTypeDecl(); - - state._fsp--; - - current =iv_rulePayloadTypeDecl; - match(input,EOF,FOLLOW_EOF_in_entryRulePayloadTypeDecl888); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRulePayloadTypeDecl" - - - // $ANTLR start "rulePayloadTypeDecl" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:437:1: rulePayloadTypeDecl returns [EObject current=null] : (otherlv_0= 'type' otherlv_1= '<' ( (lv_schema_2_0= RULE_ID ) ) otherlv_3= '>' ( (lv_type_4_0= RULE_STRING ) ) otherlv_5= 'from' ( (lv_location_6_0= RULE_STRING ) ) otherlv_7= 'as' ( (lv_alias_8_0= RULE_ID ) ) otherlv_9= ';' ) ; - public final EObject rulePayloadTypeDecl() throws RecognitionException { - EObject current = null; - - Token otherlv_0=null; - Token otherlv_1=null; - Token lv_schema_2_0=null; - Token otherlv_3=null; - Token lv_type_4_0=null; - Token otherlv_5=null; - Token lv_location_6_0=null; - Token otherlv_7=null; - Token lv_alias_8_0=null; - Token otherlv_9=null; - - enterRule(); - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:440:28: ( (otherlv_0= 'type' otherlv_1= '<' ( (lv_schema_2_0= RULE_ID ) ) otherlv_3= '>' ( (lv_type_4_0= RULE_STRING ) ) otherlv_5= 'from' ( (lv_location_6_0= RULE_STRING ) ) otherlv_7= 'as' ( (lv_alias_8_0= RULE_ID ) ) otherlv_9= ';' ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:441:1: (otherlv_0= 'type' otherlv_1= '<' ( (lv_schema_2_0= RULE_ID ) ) otherlv_3= '>' ( (lv_type_4_0= RULE_STRING ) ) otherlv_5= 'from' ( (lv_location_6_0= RULE_STRING ) ) otherlv_7= 'as' ( (lv_alias_8_0= RULE_ID ) ) otherlv_9= ';' ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:441:1: (otherlv_0= 'type' otherlv_1= '<' ( (lv_schema_2_0= RULE_ID ) ) otherlv_3= '>' ( (lv_type_4_0= RULE_STRING ) ) otherlv_5= 'from' ( (lv_location_6_0= RULE_STRING ) ) otherlv_7= 'as' ( (lv_alias_8_0= RULE_ID ) ) otherlv_9= ';' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:441:3: otherlv_0= 'type' otherlv_1= '<' ( (lv_schema_2_0= RULE_ID ) ) otherlv_3= '>' ( (lv_type_4_0= RULE_STRING ) ) otherlv_5= 'from' ( (lv_location_6_0= RULE_STRING ) ) otherlv_7= 'as' ( (lv_alias_8_0= RULE_ID ) ) otherlv_9= ';' - { - otherlv_0=(Token)match(input,17,FOLLOW_17_in_rulePayloadTypeDecl925); - - newLeafNode(otherlv_0, grammarAccess.getPayloadTypeDeclAccess().getTypeKeyword_0()); - - otherlv_1=(Token)match(input,18,FOLLOW_18_in_rulePayloadTypeDecl937); - - newLeafNode(otherlv_1, grammarAccess.getPayloadTypeDeclAccess().getLessThanSignKeyword_1()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:449:1: ( (lv_schema_2_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:450:1: (lv_schema_2_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:450:1: (lv_schema_2_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:451:3: lv_schema_2_0= RULE_ID - { - lv_schema_2_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_rulePayloadTypeDecl954); - - newLeafNode(lv_schema_2_0, grammarAccess.getPayloadTypeDeclAccess().getSchemaIDTerminalRuleCall_2_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getPayloadTypeDeclRule()); - } - setWithLastConsumed( - current, - "schema", - lv_schema_2_0, - "ID"); - - - } - - - } - - otherlv_3=(Token)match(input,19,FOLLOW_19_in_rulePayloadTypeDecl971); - - newLeafNode(otherlv_3, grammarAccess.getPayloadTypeDeclAccess().getGreaterThanSignKeyword_3()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:471:1: ( (lv_type_4_0= RULE_STRING ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:472:1: (lv_type_4_0= RULE_STRING ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:472:1: (lv_type_4_0= RULE_STRING ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:473:3: lv_type_4_0= RULE_STRING - { - lv_type_4_0=(Token)match(input,RULE_STRING,FOLLOW_RULE_STRING_in_rulePayloadTypeDecl988); - - newLeafNode(lv_type_4_0, grammarAccess.getPayloadTypeDeclAccess().getTypeSTRINGTerminalRuleCall_4_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getPayloadTypeDeclRule()); - } - setWithLastConsumed( - current, - "type", - lv_type_4_0, - "STRING"); - - - } - - - } - - otherlv_5=(Token)match(input,16,FOLLOW_16_in_rulePayloadTypeDecl1005); - - newLeafNode(otherlv_5, grammarAccess.getPayloadTypeDeclAccess().getFromKeyword_5()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:493:1: ( (lv_location_6_0= RULE_STRING ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:494:1: (lv_location_6_0= RULE_STRING ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:494:1: (lv_location_6_0= RULE_STRING ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:495:3: lv_location_6_0= RULE_STRING - { - lv_location_6_0=(Token)match(input,RULE_STRING,FOLLOW_RULE_STRING_in_rulePayloadTypeDecl1022); - - newLeafNode(lv_location_6_0, grammarAccess.getPayloadTypeDeclAccess().getLocationSTRINGTerminalRuleCall_6_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getPayloadTypeDeclRule()); - } - setWithLastConsumed( - current, - "location", - lv_location_6_0, - "STRING"); - - - } - - - } - - otherlv_7=(Token)match(input,15,FOLLOW_15_in_rulePayloadTypeDecl1039); - - newLeafNode(otherlv_7, grammarAccess.getPayloadTypeDeclAccess().getAsKeyword_7()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:515:1: ( (lv_alias_8_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:516:1: (lv_alias_8_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:516:1: (lv_alias_8_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:517:3: lv_alias_8_0= RULE_ID - { - lv_alias_8_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_rulePayloadTypeDecl1056); - - newLeafNode(lv_alias_8_0, grammarAccess.getPayloadTypeDeclAccess().getAliasIDTerminalRuleCall_8_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getPayloadTypeDeclRule()); - } - setWithLastConsumed( - current, - "alias", - lv_alias_8_0, - "ID"); - - - } - - - } - - otherlv_9=(Token)match(input,12,FOLLOW_12_in_rulePayloadTypeDecl1073); - - newLeafNode(otherlv_9, grammarAccess.getPayloadTypeDeclAccess().getSemicolonKeyword_9()); - - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "rulePayloadTypeDecl" - - - // $ANTLR start "entryRuleMessageSignature" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:545:1: entryRuleMessageSignature returns [EObject current=null] : iv_ruleMessageSignature= ruleMessageSignature EOF ; - public final EObject entryRuleMessageSignature() throws RecognitionException { - EObject current = null; - - EObject iv_ruleMessageSignature = null; - - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:546:2: (iv_ruleMessageSignature= ruleMessageSignature EOF ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:547:2: iv_ruleMessageSignature= ruleMessageSignature EOF - { - newCompositeNode(grammarAccess.getMessageSignatureRule()); - pushFollow(FOLLOW_ruleMessageSignature_in_entryRuleMessageSignature1109); - iv_ruleMessageSignature=ruleMessageSignature(); - - state._fsp--; - - current =iv_ruleMessageSignature; - match(input,EOF,FOLLOW_EOF_in_entryRuleMessageSignature1119); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleMessageSignature" - - - // $ANTLR start "ruleMessageSignature" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:554:1: ruleMessageSignature returns [EObject current=null] : ( () ( (lv_operator_1_0= RULE_ID ) )? otherlv_2= '(' ( ( (lv_types_3_0= rulePayloadElement ) ) (otherlv_4= ',' ( (lv_types_5_0= rulePayloadElement ) ) )* )? otherlv_6= ')' ) ; - public final EObject ruleMessageSignature() throws RecognitionException { - EObject current = null; - - Token lv_operator_1_0=null; - Token otherlv_2=null; - Token otherlv_4=null; - Token otherlv_6=null; - EObject lv_types_3_0 = null; - - EObject lv_types_5_0 = null; - - - enterRule(); - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:557:28: ( ( () ( (lv_operator_1_0= RULE_ID ) )? otherlv_2= '(' ( ( (lv_types_3_0= rulePayloadElement ) ) (otherlv_4= ',' ( (lv_types_5_0= rulePayloadElement ) ) )* )? otherlv_6= ')' ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:558:1: ( () ( (lv_operator_1_0= RULE_ID ) )? otherlv_2= '(' ( ( (lv_types_3_0= rulePayloadElement ) ) (otherlv_4= ',' ( (lv_types_5_0= rulePayloadElement ) ) )* )? otherlv_6= ')' ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:558:1: ( () ( (lv_operator_1_0= RULE_ID ) )? otherlv_2= '(' ( ( (lv_types_3_0= rulePayloadElement ) ) (otherlv_4= ',' ( (lv_types_5_0= rulePayloadElement ) ) )* )? otherlv_6= ')' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:558:2: () ( (lv_operator_1_0= RULE_ID ) )? otherlv_2= '(' ( ( (lv_types_3_0= rulePayloadElement ) ) (otherlv_4= ',' ( (lv_types_5_0= rulePayloadElement ) ) )* )? otherlv_6= ')' - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:558:2: () - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:559:5: - { - - current = forceCreateModelElement( - grammarAccess.getMessageSignatureAccess().getMessageSignatureAction_0(), - current); - - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:564:2: ( (lv_operator_1_0= RULE_ID ) )? - int alt8=2; - int LA8_0 = input.LA(1); - - if ( (LA8_0==RULE_ID) ) { - alt8=1; - } - switch (alt8) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:565:1: (lv_operator_1_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:565:1: (lv_operator_1_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:566:3: lv_operator_1_0= RULE_ID - { - lv_operator_1_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleMessageSignature1170); - - newLeafNode(lv_operator_1_0, grammarAccess.getMessageSignatureAccess().getOperatorIDTerminalRuleCall_1_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getMessageSignatureRule()); - } - setWithLastConsumed( - current, - "operator", - lv_operator_1_0, - "ID"); - - - } - - - } - break; - - } - - otherlv_2=(Token)match(input,20,FOLLOW_20_in_ruleMessageSignature1188); - - newLeafNode(otherlv_2, grammarAccess.getMessageSignatureAccess().getLeftParenthesisKeyword_2()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:586:1: ( ( (lv_types_3_0= rulePayloadElement ) ) (otherlv_4= ',' ( (lv_types_5_0= rulePayloadElement ) ) )* )? - int alt10=2; - int LA10_0 = input.LA(1); - - if ( (LA10_0==RULE_ID) ) { - alt10=1; - } - switch (alt10) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:586:2: ( (lv_types_3_0= rulePayloadElement ) ) (otherlv_4= ',' ( (lv_types_5_0= rulePayloadElement ) ) )* - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:586:2: ( (lv_types_3_0= rulePayloadElement ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:587:1: (lv_types_3_0= rulePayloadElement ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:587:1: (lv_types_3_0= rulePayloadElement ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:588:3: lv_types_3_0= rulePayloadElement - { - - newCompositeNode(grammarAccess.getMessageSignatureAccess().getTypesPayloadElementParserRuleCall_3_0_0()); - - pushFollow(FOLLOW_rulePayloadElement_in_ruleMessageSignature1210); - lv_types_3_0=rulePayloadElement(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getMessageSignatureRule()); - } - add( - current, - "types", - lv_types_3_0, - "PayloadElement"); - afterParserOrEnumRuleCall(); - - - } - - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:604:2: (otherlv_4= ',' ( (lv_types_5_0= rulePayloadElement ) ) )* - loop9: - do { - int alt9=2; - int LA9_0 = input.LA(1); - - if ( (LA9_0==21) ) { - alt9=1; - } - - - switch (alt9) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:604:4: otherlv_4= ',' ( (lv_types_5_0= rulePayloadElement ) ) - { - otherlv_4=(Token)match(input,21,FOLLOW_21_in_ruleMessageSignature1223); - - newLeafNode(otherlv_4, grammarAccess.getMessageSignatureAccess().getCommaKeyword_3_1_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:608:1: ( (lv_types_5_0= rulePayloadElement ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:609:1: (lv_types_5_0= rulePayloadElement ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:609:1: (lv_types_5_0= rulePayloadElement ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:610:3: lv_types_5_0= rulePayloadElement - { - - newCompositeNode(grammarAccess.getMessageSignatureAccess().getTypesPayloadElementParserRuleCall_3_1_1_0()); - - pushFollow(FOLLOW_rulePayloadElement_in_ruleMessageSignature1244); - lv_types_5_0=rulePayloadElement(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getMessageSignatureRule()); - } - add( - current, - "types", - lv_types_5_0, - "PayloadElement"); - afterParserOrEnumRuleCall(); - - - } - - - } - - - } - break; - - default : - break loop9; - } - } while (true); - - - } - break; - - } - - otherlv_6=(Token)match(input,22,FOLLOW_22_in_ruleMessageSignature1260); - - newLeafNode(otherlv_6, grammarAccess.getMessageSignatureAccess().getRightParenthesisKeyword_4()); - - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleMessageSignature" - - - // $ANTLR start "entryRulePayloadElement" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:638:1: entryRulePayloadElement returns [EObject current=null] : iv_rulePayloadElement= rulePayloadElement EOF ; - public final EObject entryRulePayloadElement() throws RecognitionException { - EObject current = null; - - EObject iv_rulePayloadElement = null; - - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:639:2: (iv_rulePayloadElement= rulePayloadElement EOF ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:640:2: iv_rulePayloadElement= rulePayloadElement EOF - { - newCompositeNode(grammarAccess.getPayloadElementRule()); - pushFollow(FOLLOW_rulePayloadElement_in_entryRulePayloadElement1296); - iv_rulePayloadElement=rulePayloadElement(); - - state._fsp--; - - current =iv_rulePayloadElement; - match(input,EOF,FOLLOW_EOF_in_entryRulePayloadElement1306); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRulePayloadElement" - - - // $ANTLR start "rulePayloadElement" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:647:1: rulePayloadElement returns [EObject current=null] : ( ( ( (lv_name_0_0= RULE_ID ) ) otherlv_1= ':' )? ( (lv_type_2_0= RULE_ID ) ) ) ; - public final EObject rulePayloadElement() throws RecognitionException { - EObject current = null; - - Token lv_name_0_0=null; - Token otherlv_1=null; - Token lv_type_2_0=null; - - enterRule(); - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:650:28: ( ( ( ( (lv_name_0_0= RULE_ID ) ) otherlv_1= ':' )? ( (lv_type_2_0= RULE_ID ) ) ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:651:1: ( ( ( (lv_name_0_0= RULE_ID ) ) otherlv_1= ':' )? ( (lv_type_2_0= RULE_ID ) ) ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:651:1: ( ( ( (lv_name_0_0= RULE_ID ) ) otherlv_1= ':' )? ( (lv_type_2_0= RULE_ID ) ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:651:2: ( ( (lv_name_0_0= RULE_ID ) ) otherlv_1= ':' )? ( (lv_type_2_0= RULE_ID ) ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:651:2: ( ( (lv_name_0_0= RULE_ID ) ) otherlv_1= ':' )? - int alt11=2; - int LA11_0 = input.LA(1); - - if ( (LA11_0==RULE_ID) ) { - int LA11_1 = input.LA(2); - - if ( (LA11_1==23) ) { - alt11=1; - } - } - switch (alt11) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:651:3: ( (lv_name_0_0= RULE_ID ) ) otherlv_1= ':' - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:651:3: ( (lv_name_0_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:652:1: (lv_name_0_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:652:1: (lv_name_0_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:653:3: lv_name_0_0= RULE_ID - { - lv_name_0_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_rulePayloadElement1349); - - newLeafNode(lv_name_0_0, grammarAccess.getPayloadElementAccess().getNameIDTerminalRuleCall_0_0_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getPayloadElementRule()); - } - setWithLastConsumed( - current, - "name", - lv_name_0_0, - "ID"); - - - } - - - } - - otherlv_1=(Token)match(input,23,FOLLOW_23_in_rulePayloadElement1366); - - newLeafNode(otherlv_1, grammarAccess.getPayloadElementAccess().getColonKeyword_0_1()); - - - } - break; - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:673:3: ( (lv_type_2_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:674:1: (lv_type_2_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:674:1: (lv_type_2_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:675:3: lv_type_2_0= RULE_ID - { - lv_type_2_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_rulePayloadElement1385); - - newLeafNode(lv_type_2_0, grammarAccess.getPayloadElementAccess().getTypeIDTerminalRuleCall_1_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getPayloadElementRule()); - } - setWithLastConsumed( - current, - "type", - lv_type_2_0, - "ID"); - - - } - - - } - - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "rulePayloadElement" - - - // $ANTLR start "entryRuleGlobalProtocolDecl" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:699:1: entryRuleGlobalProtocolDecl returns [EObject current=null] : iv_ruleGlobalProtocolDecl= ruleGlobalProtocolDecl EOF ; - public final EObject entryRuleGlobalProtocolDecl() throws RecognitionException { - EObject current = null; - - EObject iv_ruleGlobalProtocolDecl = null; - - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:700:2: (iv_ruleGlobalProtocolDecl= ruleGlobalProtocolDecl EOF ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:701:2: iv_ruleGlobalProtocolDecl= ruleGlobalProtocolDecl EOF - { - newCompositeNode(grammarAccess.getGlobalProtocolDeclRule()); - pushFollow(FOLLOW_ruleGlobalProtocolDecl_in_entryRuleGlobalProtocolDecl1426); - iv_ruleGlobalProtocolDecl=ruleGlobalProtocolDecl(); - - state._fsp--; - - current =iv_ruleGlobalProtocolDecl; - match(input,EOF,FOLLOW_EOF_in_entryRuleGlobalProtocolDecl1436); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleGlobalProtocolDecl" - - - // $ANTLR start "ruleGlobalProtocolDecl" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:708:1: ruleGlobalProtocolDecl returns [EObject current=null] : (otherlv_0= 'global' otherlv_1= 'protocol' ( (lv_name_2_0= RULE_ID ) ) (otherlv_3= '<' ( (lv_parameters_4_0= ruleParameterDecl ) ) (otherlv_5= ',' ( (lv_parameters_6_0= ruleParameterDecl ) ) )* otherlv_7= '>' )? otherlv_8= '(' ( (lv_roles_9_0= ruleRoleDecl ) ) (otherlv_10= ',' ( (lv_roles_11_0= ruleRoleDecl ) ) )* otherlv_12= ')' ( ( (lv_block_13_0= ruleGlobalProtocolBlock ) ) | (otherlv_14= 'instantiates' ( (lv_instantiates_15_0= RULE_ID ) ) (otherlv_16= '<' ( (lv_arguments_17_0= ruleArgument ) ) (otherlv_18= ',' ( (lv_arguments_19_0= ruleArgument ) ) )* otherlv_20= '>' )? otherlv_21= '(' ( (lv_roleInstantiations_22_0= ruleRoleInstantiation ) ) (otherlv_23= ',' ( (lv_roleInstantiations_24_0= ruleRoleInstantiation ) ) )* otherlv_25= ')' otherlv_26= ';' ) ) ) ; - public final EObject ruleGlobalProtocolDecl() throws RecognitionException { - EObject current = null; - - Token otherlv_0=null; - Token otherlv_1=null; - Token lv_name_2_0=null; - Token otherlv_3=null; - Token otherlv_5=null; - Token otherlv_7=null; - Token otherlv_8=null; - Token otherlv_10=null; - Token otherlv_12=null; - Token otherlv_14=null; - Token lv_instantiates_15_0=null; - Token otherlv_16=null; - Token otherlv_18=null; - Token otherlv_20=null; - Token otherlv_21=null; - Token otherlv_23=null; - Token otherlv_25=null; - Token otherlv_26=null; - EObject lv_parameters_4_0 = null; - - EObject lv_parameters_6_0 = null; - - EObject lv_roles_9_0 = null; - - EObject lv_roles_11_0 = null; - - EObject lv_block_13_0 = null; - - EObject lv_arguments_17_0 = null; - - EObject lv_arguments_19_0 = null; - - EObject lv_roleInstantiations_22_0 = null; - - EObject lv_roleInstantiations_24_0 = null; - - - enterRule(); - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:711:28: ( (otherlv_0= 'global' otherlv_1= 'protocol' ( (lv_name_2_0= RULE_ID ) ) (otherlv_3= '<' ( (lv_parameters_4_0= ruleParameterDecl ) ) (otherlv_5= ',' ( (lv_parameters_6_0= ruleParameterDecl ) ) )* otherlv_7= '>' )? otherlv_8= '(' ( (lv_roles_9_0= ruleRoleDecl ) ) (otherlv_10= ',' ( (lv_roles_11_0= ruleRoleDecl ) ) )* otherlv_12= ')' ( ( (lv_block_13_0= ruleGlobalProtocolBlock ) ) | (otherlv_14= 'instantiates' ( (lv_instantiates_15_0= RULE_ID ) ) (otherlv_16= '<' ( (lv_arguments_17_0= ruleArgument ) ) (otherlv_18= ',' ( (lv_arguments_19_0= ruleArgument ) ) )* otherlv_20= '>' )? otherlv_21= '(' ( (lv_roleInstantiations_22_0= ruleRoleInstantiation ) ) (otherlv_23= ',' ( (lv_roleInstantiations_24_0= ruleRoleInstantiation ) ) )* otherlv_25= ')' otherlv_26= ';' ) ) ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:712:1: (otherlv_0= 'global' otherlv_1= 'protocol' ( (lv_name_2_0= RULE_ID ) ) (otherlv_3= '<' ( (lv_parameters_4_0= ruleParameterDecl ) ) (otherlv_5= ',' ( (lv_parameters_6_0= ruleParameterDecl ) ) )* otherlv_7= '>' )? otherlv_8= '(' ( (lv_roles_9_0= ruleRoleDecl ) ) (otherlv_10= ',' ( (lv_roles_11_0= ruleRoleDecl ) ) )* otherlv_12= ')' ( ( (lv_block_13_0= ruleGlobalProtocolBlock ) ) | (otherlv_14= 'instantiates' ( (lv_instantiates_15_0= RULE_ID ) ) (otherlv_16= '<' ( (lv_arguments_17_0= ruleArgument ) ) (otherlv_18= ',' ( (lv_arguments_19_0= ruleArgument ) ) )* otherlv_20= '>' )? otherlv_21= '(' ( (lv_roleInstantiations_22_0= ruleRoleInstantiation ) ) (otherlv_23= ',' ( (lv_roleInstantiations_24_0= ruleRoleInstantiation ) ) )* otherlv_25= ')' otherlv_26= ';' ) ) ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:712:1: (otherlv_0= 'global' otherlv_1= 'protocol' ( (lv_name_2_0= RULE_ID ) ) (otherlv_3= '<' ( (lv_parameters_4_0= ruleParameterDecl ) ) (otherlv_5= ',' ( (lv_parameters_6_0= ruleParameterDecl ) ) )* otherlv_7= '>' )? otherlv_8= '(' ( (lv_roles_9_0= ruleRoleDecl ) ) (otherlv_10= ',' ( (lv_roles_11_0= ruleRoleDecl ) ) )* otherlv_12= ')' ( ( (lv_block_13_0= ruleGlobalProtocolBlock ) ) | (otherlv_14= 'instantiates' ( (lv_instantiates_15_0= RULE_ID ) ) (otherlv_16= '<' ( (lv_arguments_17_0= ruleArgument ) ) (otherlv_18= ',' ( (lv_arguments_19_0= ruleArgument ) ) )* otherlv_20= '>' )? otherlv_21= '(' ( (lv_roleInstantiations_22_0= ruleRoleInstantiation ) ) (otherlv_23= ',' ( (lv_roleInstantiations_24_0= ruleRoleInstantiation ) ) )* otherlv_25= ')' otherlv_26= ';' ) ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:712:3: otherlv_0= 'global' otherlv_1= 'protocol' ( (lv_name_2_0= RULE_ID ) ) (otherlv_3= '<' ( (lv_parameters_4_0= ruleParameterDecl ) ) (otherlv_5= ',' ( (lv_parameters_6_0= ruleParameterDecl ) ) )* otherlv_7= '>' )? otherlv_8= '(' ( (lv_roles_9_0= ruleRoleDecl ) ) (otherlv_10= ',' ( (lv_roles_11_0= ruleRoleDecl ) ) )* otherlv_12= ')' ( ( (lv_block_13_0= ruleGlobalProtocolBlock ) ) | (otherlv_14= 'instantiates' ( (lv_instantiates_15_0= RULE_ID ) ) (otherlv_16= '<' ( (lv_arguments_17_0= ruleArgument ) ) (otherlv_18= ',' ( (lv_arguments_19_0= ruleArgument ) ) )* otherlv_20= '>' )? otherlv_21= '(' ( (lv_roleInstantiations_22_0= ruleRoleInstantiation ) ) (otherlv_23= ',' ( (lv_roleInstantiations_24_0= ruleRoleInstantiation ) ) )* otherlv_25= ')' otherlv_26= ';' ) ) - { - otherlv_0=(Token)match(input,24,FOLLOW_24_in_ruleGlobalProtocolDecl1473); - - newLeafNode(otherlv_0, grammarAccess.getGlobalProtocolDeclAccess().getGlobalKeyword_0()); - - otherlv_1=(Token)match(input,25,FOLLOW_25_in_ruleGlobalProtocolDecl1485); - - newLeafNode(otherlv_1, grammarAccess.getGlobalProtocolDeclAccess().getProtocolKeyword_1()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:720:1: ( (lv_name_2_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:721:1: (lv_name_2_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:721:1: (lv_name_2_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:722:3: lv_name_2_0= RULE_ID - { - lv_name_2_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleGlobalProtocolDecl1502); - - newLeafNode(lv_name_2_0, grammarAccess.getGlobalProtocolDeclAccess().getNameIDTerminalRuleCall_2_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getGlobalProtocolDeclRule()); - } - setWithLastConsumed( - current, - "name", - lv_name_2_0, - "ID"); - - - } - - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:738:2: (otherlv_3= '<' ( (lv_parameters_4_0= ruleParameterDecl ) ) (otherlv_5= ',' ( (lv_parameters_6_0= ruleParameterDecl ) ) )* otherlv_7= '>' )? - int alt13=2; - int LA13_0 = input.LA(1); - - if ( (LA13_0==18) ) { - alt13=1; - } - switch (alt13) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:738:4: otherlv_3= '<' ( (lv_parameters_4_0= ruleParameterDecl ) ) (otherlv_5= ',' ( (lv_parameters_6_0= ruleParameterDecl ) ) )* otherlv_7= '>' - { - otherlv_3=(Token)match(input,18,FOLLOW_18_in_ruleGlobalProtocolDecl1520); - - newLeafNode(otherlv_3, grammarAccess.getGlobalProtocolDeclAccess().getLessThanSignKeyword_3_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:742:1: ( (lv_parameters_4_0= ruleParameterDecl ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:743:1: (lv_parameters_4_0= ruleParameterDecl ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:743:1: (lv_parameters_4_0= ruleParameterDecl ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:744:3: lv_parameters_4_0= ruleParameterDecl - { - - newCompositeNode(grammarAccess.getGlobalProtocolDeclAccess().getParametersParameterDeclParserRuleCall_3_1_0()); - - pushFollow(FOLLOW_ruleParameterDecl_in_ruleGlobalProtocolDecl1541); - lv_parameters_4_0=ruleParameterDecl(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getGlobalProtocolDeclRule()); - } - add( - current, - "parameters", - lv_parameters_4_0, - "ParameterDecl"); - afterParserOrEnumRuleCall(); - - - } - - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:760:2: (otherlv_5= ',' ( (lv_parameters_6_0= ruleParameterDecl ) ) )* - loop12: - do { - int alt12=2; - int LA12_0 = input.LA(1); - - if ( (LA12_0==21) ) { - alt12=1; - } - - - switch (alt12) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:760:4: otherlv_5= ',' ( (lv_parameters_6_0= ruleParameterDecl ) ) - { - otherlv_5=(Token)match(input,21,FOLLOW_21_in_ruleGlobalProtocolDecl1554); - - newLeafNode(otherlv_5, grammarAccess.getGlobalProtocolDeclAccess().getCommaKeyword_3_2_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:764:1: ( (lv_parameters_6_0= ruleParameterDecl ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:765:1: (lv_parameters_6_0= ruleParameterDecl ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:765:1: (lv_parameters_6_0= ruleParameterDecl ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:766:3: lv_parameters_6_0= ruleParameterDecl - { - - newCompositeNode(grammarAccess.getGlobalProtocolDeclAccess().getParametersParameterDeclParserRuleCall_3_2_1_0()); - - pushFollow(FOLLOW_ruleParameterDecl_in_ruleGlobalProtocolDecl1575); - lv_parameters_6_0=ruleParameterDecl(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getGlobalProtocolDeclRule()); - } - add( - current, - "parameters", - lv_parameters_6_0, - "ParameterDecl"); - afterParserOrEnumRuleCall(); - - - } - - - } - - - } - break; - - default : - break loop12; - } - } while (true); - - otherlv_7=(Token)match(input,19,FOLLOW_19_in_ruleGlobalProtocolDecl1589); - - newLeafNode(otherlv_7, grammarAccess.getGlobalProtocolDeclAccess().getGreaterThanSignKeyword_3_3()); - - - } - break; - - } - - otherlv_8=(Token)match(input,20,FOLLOW_20_in_ruleGlobalProtocolDecl1603); - - newLeafNode(otherlv_8, grammarAccess.getGlobalProtocolDeclAccess().getLeftParenthesisKeyword_4()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:790:1: ( (lv_roles_9_0= ruleRoleDecl ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:791:1: (lv_roles_9_0= ruleRoleDecl ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:791:1: (lv_roles_9_0= ruleRoleDecl ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:792:3: lv_roles_9_0= ruleRoleDecl - { - - newCompositeNode(grammarAccess.getGlobalProtocolDeclAccess().getRolesRoleDeclParserRuleCall_5_0()); - - pushFollow(FOLLOW_ruleRoleDecl_in_ruleGlobalProtocolDecl1624); - lv_roles_9_0=ruleRoleDecl(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getGlobalProtocolDeclRule()); - } - add( - current, - "roles", - lv_roles_9_0, - "RoleDecl"); - afterParserOrEnumRuleCall(); - - - } - - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:808:2: (otherlv_10= ',' ( (lv_roles_11_0= ruleRoleDecl ) ) )* - loop14: - do { - int alt14=2; - int LA14_0 = input.LA(1); - - if ( (LA14_0==21) ) { - alt14=1; - } - - - switch (alt14) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:808:4: otherlv_10= ',' ( (lv_roles_11_0= ruleRoleDecl ) ) - { - otherlv_10=(Token)match(input,21,FOLLOW_21_in_ruleGlobalProtocolDecl1637); - - newLeafNode(otherlv_10, grammarAccess.getGlobalProtocolDeclAccess().getCommaKeyword_6_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:812:1: ( (lv_roles_11_0= ruleRoleDecl ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:813:1: (lv_roles_11_0= ruleRoleDecl ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:813:1: (lv_roles_11_0= ruleRoleDecl ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:814:3: lv_roles_11_0= ruleRoleDecl - { - - newCompositeNode(grammarAccess.getGlobalProtocolDeclAccess().getRolesRoleDeclParserRuleCall_6_1_0()); - - pushFollow(FOLLOW_ruleRoleDecl_in_ruleGlobalProtocolDecl1658); - lv_roles_11_0=ruleRoleDecl(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getGlobalProtocolDeclRule()); - } - add( - current, - "roles", - lv_roles_11_0, - "RoleDecl"); - afterParserOrEnumRuleCall(); - - - } - - - } - - - } - break; - - default : - break loop14; - } - } while (true); - - otherlv_12=(Token)match(input,22,FOLLOW_22_in_ruleGlobalProtocolDecl1672); - - newLeafNode(otherlv_12, grammarAccess.getGlobalProtocolDeclAccess().getRightParenthesisKeyword_7()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:834:1: ( ( (lv_block_13_0= ruleGlobalProtocolBlock ) ) | (otherlv_14= 'instantiates' ( (lv_instantiates_15_0= RULE_ID ) ) (otherlv_16= '<' ( (lv_arguments_17_0= ruleArgument ) ) (otherlv_18= ',' ( (lv_arguments_19_0= ruleArgument ) ) )* otherlv_20= '>' )? otherlv_21= '(' ( (lv_roleInstantiations_22_0= ruleRoleInstantiation ) ) (otherlv_23= ',' ( (lv_roleInstantiations_24_0= ruleRoleInstantiation ) ) )* otherlv_25= ')' otherlv_26= ';' ) ) - int alt18=2; - int LA18_0 = input.LA(1); - - if ( (LA18_0==29) ) { - alt18=1; - } - else if ( (LA18_0==26) ) { - alt18=2; - } - else { - NoViableAltException nvae = - new NoViableAltException("", 18, 0, input); - - throw nvae; - } - switch (alt18) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:834:2: ( (lv_block_13_0= ruleGlobalProtocolBlock ) ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:834:2: ( (lv_block_13_0= ruleGlobalProtocolBlock ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:835:1: (lv_block_13_0= ruleGlobalProtocolBlock ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:835:1: (lv_block_13_0= ruleGlobalProtocolBlock ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:836:3: lv_block_13_0= ruleGlobalProtocolBlock - { - - newCompositeNode(grammarAccess.getGlobalProtocolDeclAccess().getBlockGlobalProtocolBlockParserRuleCall_8_0_0()); - - pushFollow(FOLLOW_ruleGlobalProtocolBlock_in_ruleGlobalProtocolDecl1694); - lv_block_13_0=ruleGlobalProtocolBlock(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getGlobalProtocolDeclRule()); - } - set( - current, - "block", - lv_block_13_0, - "GlobalProtocolBlock"); - afterParserOrEnumRuleCall(); - - - } - - - } - - - } - break; - case 2 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:853:6: (otherlv_14= 'instantiates' ( (lv_instantiates_15_0= RULE_ID ) ) (otherlv_16= '<' ( (lv_arguments_17_0= ruleArgument ) ) (otherlv_18= ',' ( (lv_arguments_19_0= ruleArgument ) ) )* otherlv_20= '>' )? otherlv_21= '(' ( (lv_roleInstantiations_22_0= ruleRoleInstantiation ) ) (otherlv_23= ',' ( (lv_roleInstantiations_24_0= ruleRoleInstantiation ) ) )* otherlv_25= ')' otherlv_26= ';' ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:853:6: (otherlv_14= 'instantiates' ( (lv_instantiates_15_0= RULE_ID ) ) (otherlv_16= '<' ( (lv_arguments_17_0= ruleArgument ) ) (otherlv_18= ',' ( (lv_arguments_19_0= ruleArgument ) ) )* otherlv_20= '>' )? otherlv_21= '(' ( (lv_roleInstantiations_22_0= ruleRoleInstantiation ) ) (otherlv_23= ',' ( (lv_roleInstantiations_24_0= ruleRoleInstantiation ) ) )* otherlv_25= ')' otherlv_26= ';' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:853:8: otherlv_14= 'instantiates' ( (lv_instantiates_15_0= RULE_ID ) ) (otherlv_16= '<' ( (lv_arguments_17_0= ruleArgument ) ) (otherlv_18= ',' ( (lv_arguments_19_0= ruleArgument ) ) )* otherlv_20= '>' )? otherlv_21= '(' ( (lv_roleInstantiations_22_0= ruleRoleInstantiation ) ) (otherlv_23= ',' ( (lv_roleInstantiations_24_0= ruleRoleInstantiation ) ) )* otherlv_25= ')' otherlv_26= ';' - { - otherlv_14=(Token)match(input,26,FOLLOW_26_in_ruleGlobalProtocolDecl1713); - - newLeafNode(otherlv_14, grammarAccess.getGlobalProtocolDeclAccess().getInstantiatesKeyword_8_1_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:857:1: ( (lv_instantiates_15_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:858:1: (lv_instantiates_15_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:858:1: (lv_instantiates_15_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:859:3: lv_instantiates_15_0= RULE_ID - { - lv_instantiates_15_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleGlobalProtocolDecl1730); - - newLeafNode(lv_instantiates_15_0, grammarAccess.getGlobalProtocolDeclAccess().getInstantiatesIDTerminalRuleCall_8_1_1_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getGlobalProtocolDeclRule()); - } - setWithLastConsumed( - current, - "instantiates", - lv_instantiates_15_0, - "ID"); - - - } - - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:875:2: (otherlv_16= '<' ( (lv_arguments_17_0= ruleArgument ) ) (otherlv_18= ',' ( (lv_arguments_19_0= ruleArgument ) ) )* otherlv_20= '>' )? - int alt16=2; - int LA16_0 = input.LA(1); - - if ( (LA16_0==18) ) { - alt16=1; - } - switch (alt16) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:875:4: otherlv_16= '<' ( (lv_arguments_17_0= ruleArgument ) ) (otherlv_18= ',' ( (lv_arguments_19_0= ruleArgument ) ) )* otherlv_20= '>' - { - otherlv_16=(Token)match(input,18,FOLLOW_18_in_ruleGlobalProtocolDecl1748); - - newLeafNode(otherlv_16, grammarAccess.getGlobalProtocolDeclAccess().getLessThanSignKeyword_8_1_2_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:879:1: ( (lv_arguments_17_0= ruleArgument ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:880:1: (lv_arguments_17_0= ruleArgument ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:880:1: (lv_arguments_17_0= ruleArgument ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:881:3: lv_arguments_17_0= ruleArgument - { - - newCompositeNode(grammarAccess.getGlobalProtocolDeclAccess().getArgumentsArgumentParserRuleCall_8_1_2_1_0()); - - pushFollow(FOLLOW_ruleArgument_in_ruleGlobalProtocolDecl1769); - lv_arguments_17_0=ruleArgument(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getGlobalProtocolDeclRule()); - } - add( - current, - "arguments", - lv_arguments_17_0, - "Argument"); - afterParserOrEnumRuleCall(); - - - } - - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:897:2: (otherlv_18= ',' ( (lv_arguments_19_0= ruleArgument ) ) )* - loop15: - do { - int alt15=2; - int LA15_0 = input.LA(1); - - if ( (LA15_0==21) ) { - alt15=1; - } - - - switch (alt15) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:897:4: otherlv_18= ',' ( (lv_arguments_19_0= ruleArgument ) ) - { - otherlv_18=(Token)match(input,21,FOLLOW_21_in_ruleGlobalProtocolDecl1782); - - newLeafNode(otherlv_18, grammarAccess.getGlobalProtocolDeclAccess().getCommaKeyword_8_1_2_2_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:901:1: ( (lv_arguments_19_0= ruleArgument ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:902:1: (lv_arguments_19_0= ruleArgument ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:902:1: (lv_arguments_19_0= ruleArgument ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:903:3: lv_arguments_19_0= ruleArgument - { - - newCompositeNode(grammarAccess.getGlobalProtocolDeclAccess().getArgumentsArgumentParserRuleCall_8_1_2_2_1_0()); - - pushFollow(FOLLOW_ruleArgument_in_ruleGlobalProtocolDecl1803); - lv_arguments_19_0=ruleArgument(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getGlobalProtocolDeclRule()); - } - add( - current, - "arguments", - lv_arguments_19_0, - "Argument"); - afterParserOrEnumRuleCall(); - - - } - - - } - - - } - break; - - default : - break loop15; - } - } while (true); - - otherlv_20=(Token)match(input,19,FOLLOW_19_in_ruleGlobalProtocolDecl1817); - - newLeafNode(otherlv_20, grammarAccess.getGlobalProtocolDeclAccess().getGreaterThanSignKeyword_8_1_2_3()); - - - } - break; - - } - - otherlv_21=(Token)match(input,20,FOLLOW_20_in_ruleGlobalProtocolDecl1831); - - newLeafNode(otherlv_21, grammarAccess.getGlobalProtocolDeclAccess().getLeftParenthesisKeyword_8_1_3()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:927:1: ( (lv_roleInstantiations_22_0= ruleRoleInstantiation ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:928:1: (lv_roleInstantiations_22_0= ruleRoleInstantiation ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:928:1: (lv_roleInstantiations_22_0= ruleRoleInstantiation ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:929:3: lv_roleInstantiations_22_0= ruleRoleInstantiation - { - - newCompositeNode(grammarAccess.getGlobalProtocolDeclAccess().getRoleInstantiationsRoleInstantiationParserRuleCall_8_1_4_0()); - - pushFollow(FOLLOW_ruleRoleInstantiation_in_ruleGlobalProtocolDecl1852); - lv_roleInstantiations_22_0=ruleRoleInstantiation(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getGlobalProtocolDeclRule()); - } - add( - current, - "roleInstantiations", - lv_roleInstantiations_22_0, - "RoleInstantiation"); - afterParserOrEnumRuleCall(); - - - } - - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:945:2: (otherlv_23= ',' ( (lv_roleInstantiations_24_0= ruleRoleInstantiation ) ) )* - loop17: - do { - int alt17=2; - int LA17_0 = input.LA(1); - - if ( (LA17_0==21) ) { - alt17=1; - } - - - switch (alt17) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:945:4: otherlv_23= ',' ( (lv_roleInstantiations_24_0= ruleRoleInstantiation ) ) - { - otherlv_23=(Token)match(input,21,FOLLOW_21_in_ruleGlobalProtocolDecl1865); - - newLeafNode(otherlv_23, grammarAccess.getGlobalProtocolDeclAccess().getCommaKeyword_8_1_5_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:949:1: ( (lv_roleInstantiations_24_0= ruleRoleInstantiation ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:950:1: (lv_roleInstantiations_24_0= ruleRoleInstantiation ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:950:1: (lv_roleInstantiations_24_0= ruleRoleInstantiation ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:951:3: lv_roleInstantiations_24_0= ruleRoleInstantiation - { - - newCompositeNode(grammarAccess.getGlobalProtocolDeclAccess().getRoleInstantiationsRoleInstantiationParserRuleCall_8_1_5_1_0()); - - pushFollow(FOLLOW_ruleRoleInstantiation_in_ruleGlobalProtocolDecl1886); - lv_roleInstantiations_24_0=ruleRoleInstantiation(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getGlobalProtocolDeclRule()); - } - add( - current, - "roleInstantiations", - lv_roleInstantiations_24_0, - "RoleInstantiation"); - afterParserOrEnumRuleCall(); - - - } - - - } - - - } - break; - - default : - break loop17; - } - } while (true); - - otherlv_25=(Token)match(input,22,FOLLOW_22_in_ruleGlobalProtocolDecl1900); - - newLeafNode(otherlv_25, grammarAccess.getGlobalProtocolDeclAccess().getRightParenthesisKeyword_8_1_6()); - - otherlv_26=(Token)match(input,12,FOLLOW_12_in_ruleGlobalProtocolDecl1912); - - newLeafNode(otherlv_26, grammarAccess.getGlobalProtocolDeclAccess().getSemicolonKeyword_8_1_7()); - - - } - - - } - break; - - } - - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleGlobalProtocolDecl" - - - // $ANTLR start "entryRuleRoleDecl" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:983:1: entryRuleRoleDecl returns [EObject current=null] : iv_ruleRoleDecl= ruleRoleDecl EOF ; - public final EObject entryRuleRoleDecl() throws RecognitionException { - EObject current = null; - - EObject iv_ruleRoleDecl = null; - - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:984:2: (iv_ruleRoleDecl= ruleRoleDecl EOF ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:985:2: iv_ruleRoleDecl= ruleRoleDecl EOF - { - newCompositeNode(grammarAccess.getRoleDeclRule()); - pushFollow(FOLLOW_ruleRoleDecl_in_entryRuleRoleDecl1950); - iv_ruleRoleDecl=ruleRoleDecl(); - - state._fsp--; - - current =iv_ruleRoleDecl; - match(input,EOF,FOLLOW_EOF_in_entryRuleRoleDecl1960); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleRoleDecl" - - - // $ANTLR start "ruleRoleDecl" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:992:1: ruleRoleDecl returns [EObject current=null] : (otherlv_0= 'role' ( (lv_name_1_0= RULE_ID ) ) (otherlv_2= 'as' ( (lv_alias_3_0= RULE_ID ) ) )? ) ; - public final EObject ruleRoleDecl() throws RecognitionException { - EObject current = null; - - Token otherlv_0=null; - Token lv_name_1_0=null; - Token otherlv_2=null; - Token lv_alias_3_0=null; - - enterRule(); - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:995:28: ( (otherlv_0= 'role' ( (lv_name_1_0= RULE_ID ) ) (otherlv_2= 'as' ( (lv_alias_3_0= RULE_ID ) ) )? ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:996:1: (otherlv_0= 'role' ( (lv_name_1_0= RULE_ID ) ) (otherlv_2= 'as' ( (lv_alias_3_0= RULE_ID ) ) )? ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:996:1: (otherlv_0= 'role' ( (lv_name_1_0= RULE_ID ) ) (otherlv_2= 'as' ( (lv_alias_3_0= RULE_ID ) ) )? ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:996:3: otherlv_0= 'role' ( (lv_name_1_0= RULE_ID ) ) (otherlv_2= 'as' ( (lv_alias_3_0= RULE_ID ) ) )? - { - otherlv_0=(Token)match(input,27,FOLLOW_27_in_ruleRoleDecl1997); - - newLeafNode(otherlv_0, grammarAccess.getRoleDeclAccess().getRoleKeyword_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1000:1: ( (lv_name_1_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1001:1: (lv_name_1_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1001:1: (lv_name_1_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1002:3: lv_name_1_0= RULE_ID - { - lv_name_1_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleRoleDecl2014); - - newLeafNode(lv_name_1_0, grammarAccess.getRoleDeclAccess().getNameIDTerminalRuleCall_1_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getRoleDeclRule()); - } - setWithLastConsumed( - current, - "name", - lv_name_1_0, - "ID"); - - - } - - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1018:2: (otherlv_2= 'as' ( (lv_alias_3_0= RULE_ID ) ) )? - int alt19=2; - int LA19_0 = input.LA(1); - - if ( (LA19_0==15) ) { - alt19=1; - } - switch (alt19) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1018:4: otherlv_2= 'as' ( (lv_alias_3_0= RULE_ID ) ) - { - otherlv_2=(Token)match(input,15,FOLLOW_15_in_ruleRoleDecl2032); - - newLeafNode(otherlv_2, grammarAccess.getRoleDeclAccess().getAsKeyword_2_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1022:1: ( (lv_alias_3_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1023:1: (lv_alias_3_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1023:1: (lv_alias_3_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1024:3: lv_alias_3_0= RULE_ID - { - lv_alias_3_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleRoleDecl2049); - - newLeafNode(lv_alias_3_0, grammarAccess.getRoleDeclAccess().getAliasIDTerminalRuleCall_2_1_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getRoleDeclRule()); - } - setWithLastConsumed( - current, - "alias", - lv_alias_3_0, - "ID"); - - - } - - - } - - - } - break; - - } - - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleRoleDecl" - - - // $ANTLR start "entryRuleParameterDecl" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1048:1: entryRuleParameterDecl returns [EObject current=null] : iv_ruleParameterDecl= ruleParameterDecl EOF ; - public final EObject entryRuleParameterDecl() throws RecognitionException { - EObject current = null; - - EObject iv_ruleParameterDecl = null; - - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1049:2: (iv_ruleParameterDecl= ruleParameterDecl EOF ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1050:2: iv_ruleParameterDecl= ruleParameterDecl EOF - { - newCompositeNode(grammarAccess.getParameterDeclRule()); - pushFollow(FOLLOW_ruleParameterDecl_in_entryRuleParameterDecl2092); - iv_ruleParameterDecl=ruleParameterDecl(); - - state._fsp--; - - current =iv_ruleParameterDecl; - match(input,EOF,FOLLOW_EOF_in_entryRuleParameterDecl2102); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleParameterDecl" - - - // $ANTLR start "ruleParameterDecl" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1057:1: ruleParameterDecl returns [EObject current=null] : ( (otherlv_0= 'type' ( (lv_name_1_0= RULE_ID ) ) (otherlv_2= 'as' ( (lv_alias_3_0= RULE_ID ) ) )? ) | (otherlv_4= 'sig' ( (lv_name_5_0= RULE_ID ) ) (otherlv_6= 'as' ( (lv_alias_7_0= RULE_ID ) ) )? ) ) ; - public final EObject ruleParameterDecl() throws RecognitionException { - EObject current = null; - - Token otherlv_0=null; - Token lv_name_1_0=null; - Token otherlv_2=null; - Token lv_alias_3_0=null; - Token otherlv_4=null; - Token lv_name_5_0=null; - Token otherlv_6=null; - Token lv_alias_7_0=null; - - enterRule(); - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1060:28: ( ( (otherlv_0= 'type' ( (lv_name_1_0= RULE_ID ) ) (otherlv_2= 'as' ( (lv_alias_3_0= RULE_ID ) ) )? ) | (otherlv_4= 'sig' ( (lv_name_5_0= RULE_ID ) ) (otherlv_6= 'as' ( (lv_alias_7_0= RULE_ID ) ) )? ) ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1061:1: ( (otherlv_0= 'type' ( (lv_name_1_0= RULE_ID ) ) (otherlv_2= 'as' ( (lv_alias_3_0= RULE_ID ) ) )? ) | (otherlv_4= 'sig' ( (lv_name_5_0= RULE_ID ) ) (otherlv_6= 'as' ( (lv_alias_7_0= RULE_ID ) ) )? ) ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1061:1: ( (otherlv_0= 'type' ( (lv_name_1_0= RULE_ID ) ) (otherlv_2= 'as' ( (lv_alias_3_0= RULE_ID ) ) )? ) | (otherlv_4= 'sig' ( (lv_name_5_0= RULE_ID ) ) (otherlv_6= 'as' ( (lv_alias_7_0= RULE_ID ) ) )? ) ) - int alt22=2; - int LA22_0 = input.LA(1); - - if ( (LA22_0==17) ) { - alt22=1; - } - else if ( (LA22_0==28) ) { - alt22=2; - } - else { - NoViableAltException nvae = - new NoViableAltException("", 22, 0, input); - - throw nvae; - } - switch (alt22) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1061:2: (otherlv_0= 'type' ( (lv_name_1_0= RULE_ID ) ) (otherlv_2= 'as' ( (lv_alias_3_0= RULE_ID ) ) )? ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1061:2: (otherlv_0= 'type' ( (lv_name_1_0= RULE_ID ) ) (otherlv_2= 'as' ( (lv_alias_3_0= RULE_ID ) ) )? ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1061:4: otherlv_0= 'type' ( (lv_name_1_0= RULE_ID ) ) (otherlv_2= 'as' ( (lv_alias_3_0= RULE_ID ) ) )? - { - otherlv_0=(Token)match(input,17,FOLLOW_17_in_ruleParameterDecl2140); - - newLeafNode(otherlv_0, grammarAccess.getParameterDeclAccess().getTypeKeyword_0_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1065:1: ( (lv_name_1_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1066:1: (lv_name_1_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1066:1: (lv_name_1_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1067:3: lv_name_1_0= RULE_ID - { - lv_name_1_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleParameterDecl2157); - - newLeafNode(lv_name_1_0, grammarAccess.getParameterDeclAccess().getNameIDTerminalRuleCall_0_1_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getParameterDeclRule()); - } - setWithLastConsumed( - current, - "name", - lv_name_1_0, - "ID"); - - - } - - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1083:2: (otherlv_2= 'as' ( (lv_alias_3_0= RULE_ID ) ) )? - int alt20=2; - int LA20_0 = input.LA(1); - - if ( (LA20_0==15) ) { - alt20=1; - } - switch (alt20) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1083:4: otherlv_2= 'as' ( (lv_alias_3_0= RULE_ID ) ) - { - otherlv_2=(Token)match(input,15,FOLLOW_15_in_ruleParameterDecl2175); - - newLeafNode(otherlv_2, grammarAccess.getParameterDeclAccess().getAsKeyword_0_2_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1087:1: ( (lv_alias_3_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1088:1: (lv_alias_3_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1088:1: (lv_alias_3_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1089:3: lv_alias_3_0= RULE_ID - { - lv_alias_3_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleParameterDecl2192); - - newLeafNode(lv_alias_3_0, grammarAccess.getParameterDeclAccess().getAliasIDTerminalRuleCall_0_2_1_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getParameterDeclRule()); - } - setWithLastConsumed( - current, - "alias", - lv_alias_3_0, - "ID"); - - - } - - - } - - - } - break; - - } - - - } - - - } - break; - case 2 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1106:6: (otherlv_4= 'sig' ( (lv_name_5_0= RULE_ID ) ) (otherlv_6= 'as' ( (lv_alias_7_0= RULE_ID ) ) )? ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1106:6: (otherlv_4= 'sig' ( (lv_name_5_0= RULE_ID ) ) (otherlv_6= 'as' ( (lv_alias_7_0= RULE_ID ) ) )? ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1106:8: otherlv_4= 'sig' ( (lv_name_5_0= RULE_ID ) ) (otherlv_6= 'as' ( (lv_alias_7_0= RULE_ID ) ) )? - { - otherlv_4=(Token)match(input,28,FOLLOW_28_in_ruleParameterDecl2219); - - newLeafNode(otherlv_4, grammarAccess.getParameterDeclAccess().getSigKeyword_1_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1110:1: ( (lv_name_5_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1111:1: (lv_name_5_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1111:1: (lv_name_5_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1112:3: lv_name_5_0= RULE_ID - { - lv_name_5_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleParameterDecl2236); - - newLeafNode(lv_name_5_0, grammarAccess.getParameterDeclAccess().getNameIDTerminalRuleCall_1_1_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getParameterDeclRule()); - } - setWithLastConsumed( - current, - "name", - lv_name_5_0, - "ID"); - - - } - - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1128:2: (otherlv_6= 'as' ( (lv_alias_7_0= RULE_ID ) ) )? - int alt21=2; - int LA21_0 = input.LA(1); - - if ( (LA21_0==15) ) { - alt21=1; - } - switch (alt21) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1128:4: otherlv_6= 'as' ( (lv_alias_7_0= RULE_ID ) ) - { - otherlv_6=(Token)match(input,15,FOLLOW_15_in_ruleParameterDecl2254); - - newLeafNode(otherlv_6, grammarAccess.getParameterDeclAccess().getAsKeyword_1_2_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1132:1: ( (lv_alias_7_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1133:1: (lv_alias_7_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1133:1: (lv_alias_7_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1134:3: lv_alias_7_0= RULE_ID - { - lv_alias_7_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleParameterDecl2271); - - newLeafNode(lv_alias_7_0, grammarAccess.getParameterDeclAccess().getAliasIDTerminalRuleCall_1_2_1_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getParameterDeclRule()); - } - setWithLastConsumed( - current, - "alias", - lv_alias_7_0, - "ID"); - - - } - - - } - - - } - break; - - } - - - } - - - } - break; - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleParameterDecl" - - - // $ANTLR start "entryRuleRoleInstantiation" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1158:1: entryRuleRoleInstantiation returns [EObject current=null] : iv_ruleRoleInstantiation= ruleRoleInstantiation EOF ; - public final EObject entryRuleRoleInstantiation() throws RecognitionException { - EObject current = null; - - EObject iv_ruleRoleInstantiation = null; - - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1159:2: (iv_ruleRoleInstantiation= ruleRoleInstantiation EOF ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1160:2: iv_ruleRoleInstantiation= ruleRoleInstantiation EOF - { - newCompositeNode(grammarAccess.getRoleInstantiationRule()); - pushFollow(FOLLOW_ruleRoleInstantiation_in_entryRuleRoleInstantiation2315); - iv_ruleRoleInstantiation=ruleRoleInstantiation(); - - state._fsp--; - - current =iv_ruleRoleInstantiation; - match(input,EOF,FOLLOW_EOF_in_entryRuleRoleInstantiation2325); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleRoleInstantiation" - - - // $ANTLR start "ruleRoleInstantiation" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1167:1: ruleRoleInstantiation returns [EObject current=null] : ( ( (lv_name_0_0= RULE_ID ) ) (otherlv_1= 'as' ( (lv_alias_2_0= RULE_ID ) ) )? ) ; - public final EObject ruleRoleInstantiation() throws RecognitionException { - EObject current = null; - - Token lv_name_0_0=null; - Token otherlv_1=null; - Token lv_alias_2_0=null; - - enterRule(); - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1170:28: ( ( ( (lv_name_0_0= RULE_ID ) ) (otherlv_1= 'as' ( (lv_alias_2_0= RULE_ID ) ) )? ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1171:1: ( ( (lv_name_0_0= RULE_ID ) ) (otherlv_1= 'as' ( (lv_alias_2_0= RULE_ID ) ) )? ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1171:1: ( ( (lv_name_0_0= RULE_ID ) ) (otherlv_1= 'as' ( (lv_alias_2_0= RULE_ID ) ) )? ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1171:2: ( (lv_name_0_0= RULE_ID ) ) (otherlv_1= 'as' ( (lv_alias_2_0= RULE_ID ) ) )? - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1171:2: ( (lv_name_0_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1172:1: (lv_name_0_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1172:1: (lv_name_0_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1173:3: lv_name_0_0= RULE_ID - { - lv_name_0_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleRoleInstantiation2367); - - newLeafNode(lv_name_0_0, grammarAccess.getRoleInstantiationAccess().getNameIDTerminalRuleCall_0_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getRoleInstantiationRule()); - } - setWithLastConsumed( - current, - "name", - lv_name_0_0, - "ID"); - - - } - - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1189:2: (otherlv_1= 'as' ( (lv_alias_2_0= RULE_ID ) ) )? - int alt23=2; - int LA23_0 = input.LA(1); - - if ( (LA23_0==15) ) { - alt23=1; - } - switch (alt23) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1189:4: otherlv_1= 'as' ( (lv_alias_2_0= RULE_ID ) ) - { - otherlv_1=(Token)match(input,15,FOLLOW_15_in_ruleRoleInstantiation2385); - - newLeafNode(otherlv_1, grammarAccess.getRoleInstantiationAccess().getAsKeyword_1_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1193:1: ( (lv_alias_2_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1194:1: (lv_alias_2_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1194:1: (lv_alias_2_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1195:3: lv_alias_2_0= RULE_ID - { - lv_alias_2_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleRoleInstantiation2402); - - newLeafNode(lv_alias_2_0, grammarAccess.getRoleInstantiationAccess().getAliasIDTerminalRuleCall_1_1_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getRoleInstantiationRule()); - } - setWithLastConsumed( - current, - "alias", - lv_alias_2_0, - "ID"); - - - } - - - } - - - } - break; - - } - - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleRoleInstantiation" - - - // $ANTLR start "entryRuleArgument" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1219:1: entryRuleArgument returns [EObject current=null] : iv_ruleArgument= ruleArgument EOF ; - public final EObject entryRuleArgument() throws RecognitionException { - EObject current = null; - - EObject iv_ruleArgument = null; - - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1220:2: (iv_ruleArgument= ruleArgument EOF ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1221:2: iv_ruleArgument= ruleArgument EOF - { - newCompositeNode(grammarAccess.getArgumentRule()); - pushFollow(FOLLOW_ruleArgument_in_entryRuleArgument2445); - iv_ruleArgument=ruleArgument(); - - state._fsp--; - - current =iv_ruleArgument; - match(input,EOF,FOLLOW_EOF_in_entryRuleArgument2455); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleArgument" - - - // $ANTLR start "ruleArgument" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1228:1: ruleArgument returns [EObject current=null] : ( ( ( (lv_signature_0_0= ruleMessageSignature ) ) (otherlv_1= 'as' ( (lv_alias_2_0= RULE_ID ) ) )? ) | ( ( (lv_name_3_0= RULE_ID ) ) (otherlv_4= 'as' ( (lv_alias_5_0= RULE_ID ) ) )? ) ) ; - public final EObject ruleArgument() throws RecognitionException { - EObject current = null; - - Token otherlv_1=null; - Token lv_alias_2_0=null; - Token lv_name_3_0=null; - Token otherlv_4=null; - Token lv_alias_5_0=null; - EObject lv_signature_0_0 = null; - - - enterRule(); - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1231:28: ( ( ( ( (lv_signature_0_0= ruleMessageSignature ) ) (otherlv_1= 'as' ( (lv_alias_2_0= RULE_ID ) ) )? ) | ( ( (lv_name_3_0= RULE_ID ) ) (otherlv_4= 'as' ( (lv_alias_5_0= RULE_ID ) ) )? ) ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1232:1: ( ( ( (lv_signature_0_0= ruleMessageSignature ) ) (otherlv_1= 'as' ( (lv_alias_2_0= RULE_ID ) ) )? ) | ( ( (lv_name_3_0= RULE_ID ) ) (otherlv_4= 'as' ( (lv_alias_5_0= RULE_ID ) ) )? ) ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1232:1: ( ( ( (lv_signature_0_0= ruleMessageSignature ) ) (otherlv_1= 'as' ( (lv_alias_2_0= RULE_ID ) ) )? ) | ( ( (lv_name_3_0= RULE_ID ) ) (otherlv_4= 'as' ( (lv_alias_5_0= RULE_ID ) ) )? ) ) - int alt26=2; - int LA26_0 = input.LA(1); - - if ( (LA26_0==RULE_ID) ) { - int LA26_1 = input.LA(2); - - if ( (LA26_1==EOF||LA26_1==15||LA26_1==19||LA26_1==21) ) { - alt26=2; - } - else if ( (LA26_1==20) ) { - alt26=1; - } - else { - NoViableAltException nvae = - new NoViableAltException("", 26, 1, input); - - throw nvae; - } - } - else if ( (LA26_0==20) ) { - alt26=1; - } - else { - NoViableAltException nvae = - new NoViableAltException("", 26, 0, input); - - throw nvae; - } - switch (alt26) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1232:2: ( ( (lv_signature_0_0= ruleMessageSignature ) ) (otherlv_1= 'as' ( (lv_alias_2_0= RULE_ID ) ) )? ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1232:2: ( ( (lv_signature_0_0= ruleMessageSignature ) ) (otherlv_1= 'as' ( (lv_alias_2_0= RULE_ID ) ) )? ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1232:3: ( (lv_signature_0_0= ruleMessageSignature ) ) (otherlv_1= 'as' ( (lv_alias_2_0= RULE_ID ) ) )? - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1232:3: ( (lv_signature_0_0= ruleMessageSignature ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1233:1: (lv_signature_0_0= ruleMessageSignature ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1233:1: (lv_signature_0_0= ruleMessageSignature ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1234:3: lv_signature_0_0= ruleMessageSignature - { - - newCompositeNode(grammarAccess.getArgumentAccess().getSignatureMessageSignatureParserRuleCall_0_0_0()); - - pushFollow(FOLLOW_ruleMessageSignature_in_ruleArgument2502); - lv_signature_0_0=ruleMessageSignature(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getArgumentRule()); - } - set( - current, - "signature", - lv_signature_0_0, - "MessageSignature"); - afterParserOrEnumRuleCall(); - - - } - - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1250:2: (otherlv_1= 'as' ( (lv_alias_2_0= RULE_ID ) ) )? - int alt24=2; - int LA24_0 = input.LA(1); - - if ( (LA24_0==15) ) { - alt24=1; - } - switch (alt24) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1250:4: otherlv_1= 'as' ( (lv_alias_2_0= RULE_ID ) ) - { - otherlv_1=(Token)match(input,15,FOLLOW_15_in_ruleArgument2515); - - newLeafNode(otherlv_1, grammarAccess.getArgumentAccess().getAsKeyword_0_1_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1254:1: ( (lv_alias_2_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1255:1: (lv_alias_2_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1255:1: (lv_alias_2_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1256:3: lv_alias_2_0= RULE_ID - { - lv_alias_2_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleArgument2532); - - newLeafNode(lv_alias_2_0, grammarAccess.getArgumentAccess().getAliasIDTerminalRuleCall_0_1_1_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getArgumentRule()); - } - setWithLastConsumed( - current, - "alias", - lv_alias_2_0, - "ID"); - - - } - - - } - - - } - break; - - } - - - } - - - } - break; - case 2 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1273:6: ( ( (lv_name_3_0= RULE_ID ) ) (otherlv_4= 'as' ( (lv_alias_5_0= RULE_ID ) ) )? ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1273:6: ( ( (lv_name_3_0= RULE_ID ) ) (otherlv_4= 'as' ( (lv_alias_5_0= RULE_ID ) ) )? ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1273:7: ( (lv_name_3_0= RULE_ID ) ) (otherlv_4= 'as' ( (lv_alias_5_0= RULE_ID ) ) )? - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1273:7: ( (lv_name_3_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1274:1: (lv_name_3_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1274:1: (lv_name_3_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1275:3: lv_name_3_0= RULE_ID - { - lv_name_3_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleArgument2564); - - newLeafNode(lv_name_3_0, grammarAccess.getArgumentAccess().getNameIDTerminalRuleCall_1_0_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getArgumentRule()); - } - setWithLastConsumed( - current, - "name", - lv_name_3_0, - "ID"); - - - } - - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1291:2: (otherlv_4= 'as' ( (lv_alias_5_0= RULE_ID ) ) )? - int alt25=2; - int LA25_0 = input.LA(1); - - if ( (LA25_0==15) ) { - alt25=1; - } - switch (alt25) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1291:4: otherlv_4= 'as' ( (lv_alias_5_0= RULE_ID ) ) - { - otherlv_4=(Token)match(input,15,FOLLOW_15_in_ruleArgument2582); - - newLeafNode(otherlv_4, grammarAccess.getArgumentAccess().getAsKeyword_1_1_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1295:1: ( (lv_alias_5_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1296:1: (lv_alias_5_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1296:1: (lv_alias_5_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1297:3: lv_alias_5_0= RULE_ID - { - lv_alias_5_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleArgument2599); - - newLeafNode(lv_alias_5_0, grammarAccess.getArgumentAccess().getAliasIDTerminalRuleCall_1_1_1_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getArgumentRule()); - } - setWithLastConsumed( - current, - "alias", - lv_alias_5_0, - "ID"); - - - } - - - } - - - } - break; - - } - - - } - - - } - break; - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleArgument" - - - // $ANTLR start "entryRuleGlobalProtocolBlock" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1321:1: entryRuleGlobalProtocolBlock returns [EObject current=null] : iv_ruleGlobalProtocolBlock= ruleGlobalProtocolBlock EOF ; - public final EObject entryRuleGlobalProtocolBlock() throws RecognitionException { - EObject current = null; - - EObject iv_ruleGlobalProtocolBlock = null; - - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1322:2: (iv_ruleGlobalProtocolBlock= ruleGlobalProtocolBlock EOF ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1323:2: iv_ruleGlobalProtocolBlock= ruleGlobalProtocolBlock EOF - { - newCompositeNode(grammarAccess.getGlobalProtocolBlockRule()); - pushFollow(FOLLOW_ruleGlobalProtocolBlock_in_entryRuleGlobalProtocolBlock2643); - iv_ruleGlobalProtocolBlock=ruleGlobalProtocolBlock(); - - state._fsp--; - - current =iv_ruleGlobalProtocolBlock; - match(input,EOF,FOLLOW_EOF_in_entryRuleGlobalProtocolBlock2653); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleGlobalProtocolBlock" - - - // $ANTLR start "ruleGlobalProtocolBlock" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1330:1: ruleGlobalProtocolBlock returns [EObject current=null] : ( () otherlv_1= '{' ( (lv_activities_2_0= ruleGlobalInteraction ) )* otherlv_3= '}' ) ; - public final EObject ruleGlobalProtocolBlock() throws RecognitionException { - EObject current = null; - - Token otherlv_1=null; - Token otherlv_3=null; - EObject lv_activities_2_0 = null; - - - enterRule(); - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1333:28: ( ( () otherlv_1= '{' ( (lv_activities_2_0= ruleGlobalInteraction ) )* otherlv_3= '}' ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1334:1: ( () otherlv_1= '{' ( (lv_activities_2_0= ruleGlobalInteraction ) )* otherlv_3= '}' ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1334:1: ( () otherlv_1= '{' ( (lv_activities_2_0= ruleGlobalInteraction ) )* otherlv_3= '}' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1334:2: () otherlv_1= '{' ( (lv_activities_2_0= ruleGlobalInteraction ) )* otherlv_3= '}' - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1334:2: () - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1335:5: - { - - current = forceCreateModelElement( - grammarAccess.getGlobalProtocolBlockAccess().getGlobalProtocolBlockAction_0(), - current); - - - } - - otherlv_1=(Token)match(input,29,FOLLOW_29_in_ruleGlobalProtocolBlock2699); - - newLeafNode(otherlv_1, grammarAccess.getGlobalProtocolBlockAccess().getLeftCurlyBracketKeyword_1()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1344:1: ( (lv_activities_2_0= ruleGlobalInteraction ) )* - loop27: - do { - int alt27=2; - int LA27_0 = input.LA(1); - - if ( (LA27_0==RULE_ID||LA27_0==20||LA27_0==32||(LA27_0>=35 && LA27_0<=37)||LA27_0==39||LA27_0==42) ) { - alt27=1; - } - - - switch (alt27) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1345:1: (lv_activities_2_0= ruleGlobalInteraction ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1345:1: (lv_activities_2_0= ruleGlobalInteraction ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1346:3: lv_activities_2_0= ruleGlobalInteraction - { - - newCompositeNode(grammarAccess.getGlobalProtocolBlockAccess().getActivitiesGlobalInteractionParserRuleCall_2_0()); - - pushFollow(FOLLOW_ruleGlobalInteraction_in_ruleGlobalProtocolBlock2720); - lv_activities_2_0=ruleGlobalInteraction(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getGlobalProtocolBlockRule()); - } - add( - current, - "activities", - lv_activities_2_0, - "GlobalInteraction"); - afterParserOrEnumRuleCall(); - - - } - - - } - break; - - default : - break loop27; - } - } while (true); - - otherlv_3=(Token)match(input,30,FOLLOW_30_in_ruleGlobalProtocolBlock2733); - - newLeafNode(otherlv_3, grammarAccess.getGlobalProtocolBlockAccess().getRightCurlyBracketKeyword_3()); - - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleGlobalProtocolBlock" - - - // $ANTLR start "entryRuleGlobalInteraction" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1374:1: entryRuleGlobalInteraction returns [EObject current=null] : iv_ruleGlobalInteraction= ruleGlobalInteraction EOF ; - public final EObject entryRuleGlobalInteraction() throws RecognitionException { - EObject current = null; - - EObject iv_ruleGlobalInteraction = null; - - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1375:2: (iv_ruleGlobalInteraction= ruleGlobalInteraction EOF ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1376:2: iv_ruleGlobalInteraction= ruleGlobalInteraction EOF - { - newCompositeNode(grammarAccess.getGlobalInteractionRule()); - pushFollow(FOLLOW_ruleGlobalInteraction_in_entryRuleGlobalInteraction2769); - iv_ruleGlobalInteraction=ruleGlobalInteraction(); - - state._fsp--; - - current =iv_ruleGlobalInteraction; - match(input,EOF,FOLLOW_EOF_in_entryRuleGlobalInteraction2779); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleGlobalInteraction" - - - // $ANTLR start "ruleGlobalInteraction" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1383:1: ruleGlobalInteraction returns [EObject current=null] : (this_GlobalMessageTransfer_0= ruleGlobalMessageTransfer | this_GlobalChoice_1= ruleGlobalChoice | this_GlobalRecursion_2= ruleGlobalRecursion | this_GlobalContinue_3= ruleGlobalContinue | this_GlobalParallel_4= ruleGlobalParallel | this_GlobalInterruptible_5= ruleGlobalInterruptible | this_GlobalDo_6= ruleGlobalDo ) ; - public final EObject ruleGlobalInteraction() throws RecognitionException { - EObject current = null; - - EObject this_GlobalMessageTransfer_0 = null; - - EObject this_GlobalChoice_1 = null; - - EObject this_GlobalRecursion_2 = null; - - EObject this_GlobalContinue_3 = null; - - EObject this_GlobalParallel_4 = null; - - EObject this_GlobalInterruptible_5 = null; - - EObject this_GlobalDo_6 = null; - - - enterRule(); - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1386:28: ( (this_GlobalMessageTransfer_0= ruleGlobalMessageTransfer | this_GlobalChoice_1= ruleGlobalChoice | this_GlobalRecursion_2= ruleGlobalRecursion | this_GlobalContinue_3= ruleGlobalContinue | this_GlobalParallel_4= ruleGlobalParallel | this_GlobalInterruptible_5= ruleGlobalInterruptible | this_GlobalDo_6= ruleGlobalDo ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1387:1: (this_GlobalMessageTransfer_0= ruleGlobalMessageTransfer | this_GlobalChoice_1= ruleGlobalChoice | this_GlobalRecursion_2= ruleGlobalRecursion | this_GlobalContinue_3= ruleGlobalContinue | this_GlobalParallel_4= ruleGlobalParallel | this_GlobalInterruptible_5= ruleGlobalInterruptible | this_GlobalDo_6= ruleGlobalDo ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1387:1: (this_GlobalMessageTransfer_0= ruleGlobalMessageTransfer | this_GlobalChoice_1= ruleGlobalChoice | this_GlobalRecursion_2= ruleGlobalRecursion | this_GlobalContinue_3= ruleGlobalContinue | this_GlobalParallel_4= ruleGlobalParallel | this_GlobalInterruptible_5= ruleGlobalInterruptible | this_GlobalDo_6= ruleGlobalDo ) - int alt28=7; - switch ( input.LA(1) ) { - case RULE_ID: - case 20: - { - alt28=1; - } - break; - case 32: - { - alt28=2; - } - break; - case 35: - { - alt28=3; - } - break; - case 36: - { - alt28=4; - } - break; - case 37: - { - alt28=5; - } - break; - case 39: - { - alt28=6; - } - break; - case 42: - { - alt28=7; - } - break; - default: - NoViableAltException nvae = - new NoViableAltException("", 28, 0, input); - - throw nvae; - } - - switch (alt28) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1388:5: this_GlobalMessageTransfer_0= ruleGlobalMessageTransfer - { - - newCompositeNode(grammarAccess.getGlobalInteractionAccess().getGlobalMessageTransferParserRuleCall_0()); - - pushFollow(FOLLOW_ruleGlobalMessageTransfer_in_ruleGlobalInteraction2826); - this_GlobalMessageTransfer_0=ruleGlobalMessageTransfer(); - - state._fsp--; - - - current = this_GlobalMessageTransfer_0; - afterParserOrEnumRuleCall(); - - - } - break; - case 2 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1398:5: this_GlobalChoice_1= ruleGlobalChoice - { - - newCompositeNode(grammarAccess.getGlobalInteractionAccess().getGlobalChoiceParserRuleCall_1()); - - pushFollow(FOLLOW_ruleGlobalChoice_in_ruleGlobalInteraction2853); - this_GlobalChoice_1=ruleGlobalChoice(); - - state._fsp--; - - - current = this_GlobalChoice_1; - afterParserOrEnumRuleCall(); - - - } - break; - case 3 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1408:5: this_GlobalRecursion_2= ruleGlobalRecursion - { - - newCompositeNode(grammarAccess.getGlobalInteractionAccess().getGlobalRecursionParserRuleCall_2()); - - pushFollow(FOLLOW_ruleGlobalRecursion_in_ruleGlobalInteraction2880); - this_GlobalRecursion_2=ruleGlobalRecursion(); - - state._fsp--; - - - current = this_GlobalRecursion_2; - afterParserOrEnumRuleCall(); - - - } - break; - case 4 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1418:5: this_GlobalContinue_3= ruleGlobalContinue - { - - newCompositeNode(grammarAccess.getGlobalInteractionAccess().getGlobalContinueParserRuleCall_3()); - - pushFollow(FOLLOW_ruleGlobalContinue_in_ruleGlobalInteraction2907); - this_GlobalContinue_3=ruleGlobalContinue(); - - state._fsp--; - - - current = this_GlobalContinue_3; - afterParserOrEnumRuleCall(); - - - } - break; - case 5 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1428:5: this_GlobalParallel_4= ruleGlobalParallel - { - - newCompositeNode(grammarAccess.getGlobalInteractionAccess().getGlobalParallelParserRuleCall_4()); - - pushFollow(FOLLOW_ruleGlobalParallel_in_ruleGlobalInteraction2934); - this_GlobalParallel_4=ruleGlobalParallel(); - - state._fsp--; - - - current = this_GlobalParallel_4; - afterParserOrEnumRuleCall(); - - - } - break; - case 6 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1438:5: this_GlobalInterruptible_5= ruleGlobalInterruptible - { - - newCompositeNode(grammarAccess.getGlobalInteractionAccess().getGlobalInterruptibleParserRuleCall_5()); - - pushFollow(FOLLOW_ruleGlobalInterruptible_in_ruleGlobalInteraction2961); - this_GlobalInterruptible_5=ruleGlobalInterruptible(); - - state._fsp--; - - - current = this_GlobalInterruptible_5; - afterParserOrEnumRuleCall(); - - - } - break; - case 7 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1448:5: this_GlobalDo_6= ruleGlobalDo - { - - newCompositeNode(grammarAccess.getGlobalInteractionAccess().getGlobalDoParserRuleCall_6()); - - pushFollow(FOLLOW_ruleGlobalDo_in_ruleGlobalInteraction2988); - this_GlobalDo_6=ruleGlobalDo(); - - state._fsp--; - - - current = this_GlobalDo_6; - afterParserOrEnumRuleCall(); - - - } - break; - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleGlobalInteraction" - - - // $ANTLR start "entryRuleGlobalMessageTransfer" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1464:1: entryRuleGlobalMessageTransfer returns [EObject current=null] : iv_ruleGlobalMessageTransfer= ruleGlobalMessageTransfer EOF ; - public final EObject entryRuleGlobalMessageTransfer() throws RecognitionException { - EObject current = null; - - EObject iv_ruleGlobalMessageTransfer = null; - - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1465:2: (iv_ruleGlobalMessageTransfer= ruleGlobalMessageTransfer EOF ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1466:2: iv_ruleGlobalMessageTransfer= ruleGlobalMessageTransfer EOF - { - newCompositeNode(grammarAccess.getGlobalMessageTransferRule()); - pushFollow(FOLLOW_ruleGlobalMessageTransfer_in_entryRuleGlobalMessageTransfer3023); - iv_ruleGlobalMessageTransfer=ruleGlobalMessageTransfer(); - - state._fsp--; - - current =iv_ruleGlobalMessageTransfer; - match(input,EOF,FOLLOW_EOF_in_entryRuleGlobalMessageTransfer3033); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleGlobalMessageTransfer" - - - // $ANTLR start "ruleGlobalMessageTransfer" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1473:1: ruleGlobalMessageTransfer returns [EObject current=null] : ( ( (lv_message_0_0= ruleMessage ) ) otherlv_1= 'from' ( (lv_fromRole_2_0= RULE_ID ) ) otherlv_3= 'to' ( (lv_toRoles_4_0= RULE_ID ) ) (otherlv_5= ',' ( (lv_toRoles_6_0= RULE_ID ) ) )* otherlv_7= ';' ) ; - public final EObject ruleGlobalMessageTransfer() throws RecognitionException { - EObject current = null; - - Token otherlv_1=null; - Token lv_fromRole_2_0=null; - Token otherlv_3=null; - Token lv_toRoles_4_0=null; - Token otherlv_5=null; - Token lv_toRoles_6_0=null; - Token otherlv_7=null; - EObject lv_message_0_0 = null; - - - enterRule(); - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1476:28: ( ( ( (lv_message_0_0= ruleMessage ) ) otherlv_1= 'from' ( (lv_fromRole_2_0= RULE_ID ) ) otherlv_3= 'to' ( (lv_toRoles_4_0= RULE_ID ) ) (otherlv_5= ',' ( (lv_toRoles_6_0= RULE_ID ) ) )* otherlv_7= ';' ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1477:1: ( ( (lv_message_0_0= ruleMessage ) ) otherlv_1= 'from' ( (lv_fromRole_2_0= RULE_ID ) ) otherlv_3= 'to' ( (lv_toRoles_4_0= RULE_ID ) ) (otherlv_5= ',' ( (lv_toRoles_6_0= RULE_ID ) ) )* otherlv_7= ';' ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1477:1: ( ( (lv_message_0_0= ruleMessage ) ) otherlv_1= 'from' ( (lv_fromRole_2_0= RULE_ID ) ) otherlv_3= 'to' ( (lv_toRoles_4_0= RULE_ID ) ) (otherlv_5= ',' ( (lv_toRoles_6_0= RULE_ID ) ) )* otherlv_7= ';' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1477:2: ( (lv_message_0_0= ruleMessage ) ) otherlv_1= 'from' ( (lv_fromRole_2_0= RULE_ID ) ) otherlv_3= 'to' ( (lv_toRoles_4_0= RULE_ID ) ) (otherlv_5= ',' ( (lv_toRoles_6_0= RULE_ID ) ) )* otherlv_7= ';' - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1477:2: ( (lv_message_0_0= ruleMessage ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1478:1: (lv_message_0_0= ruleMessage ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1478:1: (lv_message_0_0= ruleMessage ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1479:3: lv_message_0_0= ruleMessage - { - - newCompositeNode(grammarAccess.getGlobalMessageTransferAccess().getMessageMessageParserRuleCall_0_0()); - - pushFollow(FOLLOW_ruleMessage_in_ruleGlobalMessageTransfer3079); - lv_message_0_0=ruleMessage(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getGlobalMessageTransferRule()); - } - set( - current, - "message", - lv_message_0_0, - "Message"); - afterParserOrEnumRuleCall(); - - - } - - - } - - otherlv_1=(Token)match(input,16,FOLLOW_16_in_ruleGlobalMessageTransfer3091); - - newLeafNode(otherlv_1, grammarAccess.getGlobalMessageTransferAccess().getFromKeyword_1()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1499:1: ( (lv_fromRole_2_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1500:1: (lv_fromRole_2_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1500:1: (lv_fromRole_2_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1501:3: lv_fromRole_2_0= RULE_ID - { - lv_fromRole_2_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleGlobalMessageTransfer3108); - - newLeafNode(lv_fromRole_2_0, grammarAccess.getGlobalMessageTransferAccess().getFromRoleIDTerminalRuleCall_2_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getGlobalMessageTransferRule()); - } - setWithLastConsumed( - current, - "fromRole", - lv_fromRole_2_0, - "ID"); - - - } - - - } - - otherlv_3=(Token)match(input,31,FOLLOW_31_in_ruleGlobalMessageTransfer3125); - - newLeafNode(otherlv_3, grammarAccess.getGlobalMessageTransferAccess().getToKeyword_3()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1521:1: ( (lv_toRoles_4_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1522:1: (lv_toRoles_4_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1522:1: (lv_toRoles_4_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1523:3: lv_toRoles_4_0= RULE_ID - { - lv_toRoles_4_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleGlobalMessageTransfer3142); - - newLeafNode(lv_toRoles_4_0, grammarAccess.getGlobalMessageTransferAccess().getToRolesIDTerminalRuleCall_4_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getGlobalMessageTransferRule()); - } - addWithLastConsumed( - current, - "toRoles", - lv_toRoles_4_0, - "ID"); - - - } - - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1539:2: (otherlv_5= ',' ( (lv_toRoles_6_0= RULE_ID ) ) )* - loop29: - do { - int alt29=2; - int LA29_0 = input.LA(1); - - if ( (LA29_0==21) ) { - alt29=1; - } - - - switch (alt29) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1539:4: otherlv_5= ',' ( (lv_toRoles_6_0= RULE_ID ) ) - { - otherlv_5=(Token)match(input,21,FOLLOW_21_in_ruleGlobalMessageTransfer3160); - - newLeafNode(otherlv_5, grammarAccess.getGlobalMessageTransferAccess().getCommaKeyword_5_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1543:1: ( (lv_toRoles_6_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1544:1: (lv_toRoles_6_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1544:1: (lv_toRoles_6_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1545:3: lv_toRoles_6_0= RULE_ID - { - lv_toRoles_6_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleGlobalMessageTransfer3177); - - newLeafNode(lv_toRoles_6_0, grammarAccess.getGlobalMessageTransferAccess().getToRolesIDTerminalRuleCall_5_1_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getGlobalMessageTransferRule()); - } - addWithLastConsumed( - current, - "toRoles", - lv_toRoles_6_0, - "ID"); - - - } - - - } - - - } - break; - - default : - break loop29; - } - } while (true); - - otherlv_7=(Token)match(input,12,FOLLOW_12_in_ruleGlobalMessageTransfer3196); - - newLeafNode(otherlv_7, grammarAccess.getGlobalMessageTransferAccess().getSemicolonKeyword_6()); - - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleGlobalMessageTransfer" - - - // $ANTLR start "entryRuleMessage" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1573:1: entryRuleMessage returns [EObject current=null] : iv_ruleMessage= ruleMessage EOF ; - public final EObject entryRuleMessage() throws RecognitionException { - EObject current = null; - - EObject iv_ruleMessage = null; - - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1574:2: (iv_ruleMessage= ruleMessage EOF ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1575:2: iv_ruleMessage= ruleMessage EOF - { - newCompositeNode(grammarAccess.getMessageRule()); - pushFollow(FOLLOW_ruleMessage_in_entryRuleMessage3232); - iv_ruleMessage=ruleMessage(); - - state._fsp--; - - current =iv_ruleMessage; - match(input,EOF,FOLLOW_EOF_in_entryRuleMessage3242); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleMessage" - - - // $ANTLR start "ruleMessage" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1582:1: ruleMessage returns [EObject current=null] : ( ( (lv_signature_0_0= ruleMessageSignature ) ) | ( (lv_parameter_1_0= RULE_ID ) ) ) ; - public final EObject ruleMessage() throws RecognitionException { - EObject current = null; - - Token lv_parameter_1_0=null; - EObject lv_signature_0_0 = null; - - - enterRule(); - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1585:28: ( ( ( (lv_signature_0_0= ruleMessageSignature ) ) | ( (lv_parameter_1_0= RULE_ID ) ) ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1586:1: ( ( (lv_signature_0_0= ruleMessageSignature ) ) | ( (lv_parameter_1_0= RULE_ID ) ) ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1586:1: ( ( (lv_signature_0_0= ruleMessageSignature ) ) | ( (lv_parameter_1_0= RULE_ID ) ) ) - int alt30=2; - int LA30_0 = input.LA(1); - - if ( (LA30_0==RULE_ID) ) { - int LA30_1 = input.LA(2); - - if ( (LA30_1==EOF||LA30_1==16||LA30_1==21||LA30_1==31||LA30_1==41) ) { - alt30=2; - } - else if ( (LA30_1==20) ) { - alt30=1; - } - else { - NoViableAltException nvae = - new NoViableAltException("", 30, 1, input); - - throw nvae; - } - } - else if ( (LA30_0==20) ) { - alt30=1; - } - else { - NoViableAltException nvae = - new NoViableAltException("", 30, 0, input); - - throw nvae; - } - switch (alt30) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1586:2: ( (lv_signature_0_0= ruleMessageSignature ) ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1586:2: ( (lv_signature_0_0= ruleMessageSignature ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1587:1: (lv_signature_0_0= ruleMessageSignature ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1587:1: (lv_signature_0_0= ruleMessageSignature ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1588:3: lv_signature_0_0= ruleMessageSignature - { - - newCompositeNode(grammarAccess.getMessageAccess().getSignatureMessageSignatureParserRuleCall_0_0()); - - pushFollow(FOLLOW_ruleMessageSignature_in_ruleMessage3288); - lv_signature_0_0=ruleMessageSignature(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getMessageRule()); - } - set( - current, - "signature", - lv_signature_0_0, - "MessageSignature"); - afterParserOrEnumRuleCall(); - - - } - - - } - - - } - break; - case 2 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1605:6: ( (lv_parameter_1_0= RULE_ID ) ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1605:6: ( (lv_parameter_1_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1606:1: (lv_parameter_1_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1606:1: (lv_parameter_1_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1607:3: lv_parameter_1_0= RULE_ID - { - lv_parameter_1_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleMessage3311); - - newLeafNode(lv_parameter_1_0, grammarAccess.getMessageAccess().getParameterIDTerminalRuleCall_1_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getMessageRule()); - } - setWithLastConsumed( - current, - "parameter", - lv_parameter_1_0, - "ID"); - - - } - - - } - - - } - break; - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleMessage" - - - // $ANTLR start "entryRuleGlobalChoice" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1631:1: entryRuleGlobalChoice returns [EObject current=null] : iv_ruleGlobalChoice= ruleGlobalChoice EOF ; - public final EObject entryRuleGlobalChoice() throws RecognitionException { - EObject current = null; - - EObject iv_ruleGlobalChoice = null; - - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1632:2: (iv_ruleGlobalChoice= ruleGlobalChoice EOF ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1633:2: iv_ruleGlobalChoice= ruleGlobalChoice EOF - { - newCompositeNode(grammarAccess.getGlobalChoiceRule()); - pushFollow(FOLLOW_ruleGlobalChoice_in_entryRuleGlobalChoice3352); - iv_ruleGlobalChoice=ruleGlobalChoice(); - - state._fsp--; - - current =iv_ruleGlobalChoice; - match(input,EOF,FOLLOW_EOF_in_entryRuleGlobalChoice3362); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleGlobalChoice" - - - // $ANTLR start "ruleGlobalChoice" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1640:1: ruleGlobalChoice returns [EObject current=null] : (otherlv_0= 'choice' otherlv_1= 'at' ( (lv_role_2_0= RULE_ID ) ) ( (lv_blocks_3_0= ruleGlobalProtocolBlock ) ) (otherlv_4= 'or' ( (lv_blocks_5_0= ruleGlobalProtocolBlock ) ) )* ) ; - public final EObject ruleGlobalChoice() throws RecognitionException { - EObject current = null; - - Token otherlv_0=null; - Token otherlv_1=null; - Token lv_role_2_0=null; - Token otherlv_4=null; - EObject lv_blocks_3_0 = null; - - EObject lv_blocks_5_0 = null; - - - enterRule(); - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1643:28: ( (otherlv_0= 'choice' otherlv_1= 'at' ( (lv_role_2_0= RULE_ID ) ) ( (lv_blocks_3_0= ruleGlobalProtocolBlock ) ) (otherlv_4= 'or' ( (lv_blocks_5_0= ruleGlobalProtocolBlock ) ) )* ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1644:1: (otherlv_0= 'choice' otherlv_1= 'at' ( (lv_role_2_0= RULE_ID ) ) ( (lv_blocks_3_0= ruleGlobalProtocolBlock ) ) (otherlv_4= 'or' ( (lv_blocks_5_0= ruleGlobalProtocolBlock ) ) )* ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1644:1: (otherlv_0= 'choice' otherlv_1= 'at' ( (lv_role_2_0= RULE_ID ) ) ( (lv_blocks_3_0= ruleGlobalProtocolBlock ) ) (otherlv_4= 'or' ( (lv_blocks_5_0= ruleGlobalProtocolBlock ) ) )* ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1644:3: otherlv_0= 'choice' otherlv_1= 'at' ( (lv_role_2_0= RULE_ID ) ) ( (lv_blocks_3_0= ruleGlobalProtocolBlock ) ) (otherlv_4= 'or' ( (lv_blocks_5_0= ruleGlobalProtocolBlock ) ) )* - { - otherlv_0=(Token)match(input,32,FOLLOW_32_in_ruleGlobalChoice3399); - - newLeafNode(otherlv_0, grammarAccess.getGlobalChoiceAccess().getChoiceKeyword_0()); - - otherlv_1=(Token)match(input,33,FOLLOW_33_in_ruleGlobalChoice3411); - - newLeafNode(otherlv_1, grammarAccess.getGlobalChoiceAccess().getAtKeyword_1()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1652:1: ( (lv_role_2_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1653:1: (lv_role_2_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1653:1: (lv_role_2_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1654:3: lv_role_2_0= RULE_ID - { - lv_role_2_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleGlobalChoice3428); - - newLeafNode(lv_role_2_0, grammarAccess.getGlobalChoiceAccess().getRoleIDTerminalRuleCall_2_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getGlobalChoiceRule()); - } - setWithLastConsumed( - current, - "role", - lv_role_2_0, - "ID"); - - - } - - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1670:2: ( (lv_blocks_3_0= ruleGlobalProtocolBlock ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1671:1: (lv_blocks_3_0= ruleGlobalProtocolBlock ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1671:1: (lv_blocks_3_0= ruleGlobalProtocolBlock ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1672:3: lv_blocks_3_0= ruleGlobalProtocolBlock - { - - newCompositeNode(grammarAccess.getGlobalChoiceAccess().getBlocksGlobalProtocolBlockParserRuleCall_3_0()); - - pushFollow(FOLLOW_ruleGlobalProtocolBlock_in_ruleGlobalChoice3454); - lv_blocks_3_0=ruleGlobalProtocolBlock(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getGlobalChoiceRule()); - } - add( - current, - "blocks", - lv_blocks_3_0, - "GlobalProtocolBlock"); - afterParserOrEnumRuleCall(); - - - } - - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1688:2: (otherlv_4= 'or' ( (lv_blocks_5_0= ruleGlobalProtocolBlock ) ) )* - loop31: - do { - int alt31=2; - int LA31_0 = input.LA(1); - - if ( (LA31_0==34) ) { - alt31=1; - } - - - switch (alt31) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1688:4: otherlv_4= 'or' ( (lv_blocks_5_0= ruleGlobalProtocolBlock ) ) - { - otherlv_4=(Token)match(input,34,FOLLOW_34_in_ruleGlobalChoice3467); - - newLeafNode(otherlv_4, grammarAccess.getGlobalChoiceAccess().getOrKeyword_4_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1692:1: ( (lv_blocks_5_0= ruleGlobalProtocolBlock ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1693:1: (lv_blocks_5_0= ruleGlobalProtocolBlock ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1693:1: (lv_blocks_5_0= ruleGlobalProtocolBlock ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1694:3: lv_blocks_5_0= ruleGlobalProtocolBlock - { - - newCompositeNode(grammarAccess.getGlobalChoiceAccess().getBlocksGlobalProtocolBlockParserRuleCall_4_1_0()); - - pushFollow(FOLLOW_ruleGlobalProtocolBlock_in_ruleGlobalChoice3488); - lv_blocks_5_0=ruleGlobalProtocolBlock(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getGlobalChoiceRule()); - } - add( - current, - "blocks", - lv_blocks_5_0, - "GlobalProtocolBlock"); - afterParserOrEnumRuleCall(); - - - } - - - } - - - } - break; - - default : - break loop31; - } - } while (true); - - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleGlobalChoice" - - - // $ANTLR start "entryRuleGlobalRecursion" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1718:1: entryRuleGlobalRecursion returns [EObject current=null] : iv_ruleGlobalRecursion= ruleGlobalRecursion EOF ; - public final EObject entryRuleGlobalRecursion() throws RecognitionException { - EObject current = null; - - EObject iv_ruleGlobalRecursion = null; - - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1719:2: (iv_ruleGlobalRecursion= ruleGlobalRecursion EOF ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1720:2: iv_ruleGlobalRecursion= ruleGlobalRecursion EOF - { - newCompositeNode(grammarAccess.getGlobalRecursionRule()); - pushFollow(FOLLOW_ruleGlobalRecursion_in_entryRuleGlobalRecursion3526); - iv_ruleGlobalRecursion=ruleGlobalRecursion(); - - state._fsp--; - - current =iv_ruleGlobalRecursion; - match(input,EOF,FOLLOW_EOF_in_entryRuleGlobalRecursion3536); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleGlobalRecursion" - - - // $ANTLR start "ruleGlobalRecursion" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1727:1: ruleGlobalRecursion returns [EObject current=null] : (otherlv_0= 'rec' ( (lv_label_1_0= RULE_ID ) ) ( (lv_block_2_0= ruleGlobalProtocolBlock ) ) ) ; - public final EObject ruleGlobalRecursion() throws RecognitionException { - EObject current = null; - - Token otherlv_0=null; - Token lv_label_1_0=null; - EObject lv_block_2_0 = null; - - - enterRule(); - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1730:28: ( (otherlv_0= 'rec' ( (lv_label_1_0= RULE_ID ) ) ( (lv_block_2_0= ruleGlobalProtocolBlock ) ) ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1731:1: (otherlv_0= 'rec' ( (lv_label_1_0= RULE_ID ) ) ( (lv_block_2_0= ruleGlobalProtocolBlock ) ) ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1731:1: (otherlv_0= 'rec' ( (lv_label_1_0= RULE_ID ) ) ( (lv_block_2_0= ruleGlobalProtocolBlock ) ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1731:3: otherlv_0= 'rec' ( (lv_label_1_0= RULE_ID ) ) ( (lv_block_2_0= ruleGlobalProtocolBlock ) ) - { - otherlv_0=(Token)match(input,35,FOLLOW_35_in_ruleGlobalRecursion3573); - - newLeafNode(otherlv_0, grammarAccess.getGlobalRecursionAccess().getRecKeyword_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1735:1: ( (lv_label_1_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1736:1: (lv_label_1_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1736:1: (lv_label_1_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1737:3: lv_label_1_0= RULE_ID - { - lv_label_1_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleGlobalRecursion3590); - - newLeafNode(lv_label_1_0, grammarAccess.getGlobalRecursionAccess().getLabelIDTerminalRuleCall_1_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getGlobalRecursionRule()); - } - setWithLastConsumed( - current, - "label", - lv_label_1_0, - "ID"); - - - } - - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1753:2: ( (lv_block_2_0= ruleGlobalProtocolBlock ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1754:1: (lv_block_2_0= ruleGlobalProtocolBlock ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1754:1: (lv_block_2_0= ruleGlobalProtocolBlock ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1755:3: lv_block_2_0= ruleGlobalProtocolBlock - { - - newCompositeNode(grammarAccess.getGlobalRecursionAccess().getBlockGlobalProtocolBlockParserRuleCall_2_0()); - - pushFollow(FOLLOW_ruleGlobalProtocolBlock_in_ruleGlobalRecursion3616); - lv_block_2_0=ruleGlobalProtocolBlock(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getGlobalRecursionRule()); - } - set( - current, - "block", - lv_block_2_0, - "GlobalProtocolBlock"); - afterParserOrEnumRuleCall(); - - - } - - - } - - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleGlobalRecursion" - - - // $ANTLR start "entryRuleGlobalContinue" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1779:1: entryRuleGlobalContinue returns [EObject current=null] : iv_ruleGlobalContinue= ruleGlobalContinue EOF ; - public final EObject entryRuleGlobalContinue() throws RecognitionException { - EObject current = null; - - EObject iv_ruleGlobalContinue = null; - - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1780:2: (iv_ruleGlobalContinue= ruleGlobalContinue EOF ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1781:2: iv_ruleGlobalContinue= ruleGlobalContinue EOF - { - newCompositeNode(grammarAccess.getGlobalContinueRule()); - pushFollow(FOLLOW_ruleGlobalContinue_in_entryRuleGlobalContinue3652); - iv_ruleGlobalContinue=ruleGlobalContinue(); - - state._fsp--; - - current =iv_ruleGlobalContinue; - match(input,EOF,FOLLOW_EOF_in_entryRuleGlobalContinue3662); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleGlobalContinue" - - - // $ANTLR start "ruleGlobalContinue" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1788:1: ruleGlobalContinue returns [EObject current=null] : (otherlv_0= 'continue' ( (lv_label_1_0= RULE_ID ) ) otherlv_2= ';' ) ; - public final EObject ruleGlobalContinue() throws RecognitionException { - EObject current = null; - - Token otherlv_0=null; - Token lv_label_1_0=null; - Token otherlv_2=null; - - enterRule(); - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1791:28: ( (otherlv_0= 'continue' ( (lv_label_1_0= RULE_ID ) ) otherlv_2= ';' ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1792:1: (otherlv_0= 'continue' ( (lv_label_1_0= RULE_ID ) ) otherlv_2= ';' ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1792:1: (otherlv_0= 'continue' ( (lv_label_1_0= RULE_ID ) ) otherlv_2= ';' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1792:3: otherlv_0= 'continue' ( (lv_label_1_0= RULE_ID ) ) otherlv_2= ';' - { - otherlv_0=(Token)match(input,36,FOLLOW_36_in_ruleGlobalContinue3699); - - newLeafNode(otherlv_0, grammarAccess.getGlobalContinueAccess().getContinueKeyword_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1796:1: ( (lv_label_1_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1797:1: (lv_label_1_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1797:1: (lv_label_1_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1798:3: lv_label_1_0= RULE_ID - { - lv_label_1_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleGlobalContinue3716); - - newLeafNode(lv_label_1_0, grammarAccess.getGlobalContinueAccess().getLabelIDTerminalRuleCall_1_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getGlobalContinueRule()); - } - setWithLastConsumed( - current, - "label", - lv_label_1_0, - "ID"); - - - } - - - } - - otherlv_2=(Token)match(input,12,FOLLOW_12_in_ruleGlobalContinue3733); - - newLeafNode(otherlv_2, grammarAccess.getGlobalContinueAccess().getSemicolonKeyword_2()); - - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleGlobalContinue" - - - // $ANTLR start "entryRuleGlobalParallel" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1826:1: entryRuleGlobalParallel returns [EObject current=null] : iv_ruleGlobalParallel= ruleGlobalParallel EOF ; - public final EObject entryRuleGlobalParallel() throws RecognitionException { - EObject current = null; - - EObject iv_ruleGlobalParallel = null; - - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1827:2: (iv_ruleGlobalParallel= ruleGlobalParallel EOF ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1828:2: iv_ruleGlobalParallel= ruleGlobalParallel EOF - { - newCompositeNode(grammarAccess.getGlobalParallelRule()); - pushFollow(FOLLOW_ruleGlobalParallel_in_entryRuleGlobalParallel3769); - iv_ruleGlobalParallel=ruleGlobalParallel(); - - state._fsp--; - - current =iv_ruleGlobalParallel; - match(input,EOF,FOLLOW_EOF_in_entryRuleGlobalParallel3779); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleGlobalParallel" - - - // $ANTLR start "ruleGlobalParallel" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1835:1: ruleGlobalParallel returns [EObject current=null] : (otherlv_0= 'par' ( (lv_blocks_1_0= ruleGlobalProtocolBlock ) ) (otherlv_2= 'and' ( (lv_blocks_3_0= ruleGlobalProtocolBlock ) ) )* ) ; - public final EObject ruleGlobalParallel() throws RecognitionException { - EObject current = null; - - Token otherlv_0=null; - Token otherlv_2=null; - EObject lv_blocks_1_0 = null; - - EObject lv_blocks_3_0 = null; - - - enterRule(); - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1838:28: ( (otherlv_0= 'par' ( (lv_blocks_1_0= ruleGlobalProtocolBlock ) ) (otherlv_2= 'and' ( (lv_blocks_3_0= ruleGlobalProtocolBlock ) ) )* ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1839:1: (otherlv_0= 'par' ( (lv_blocks_1_0= ruleGlobalProtocolBlock ) ) (otherlv_2= 'and' ( (lv_blocks_3_0= ruleGlobalProtocolBlock ) ) )* ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1839:1: (otherlv_0= 'par' ( (lv_blocks_1_0= ruleGlobalProtocolBlock ) ) (otherlv_2= 'and' ( (lv_blocks_3_0= ruleGlobalProtocolBlock ) ) )* ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1839:3: otherlv_0= 'par' ( (lv_blocks_1_0= ruleGlobalProtocolBlock ) ) (otherlv_2= 'and' ( (lv_blocks_3_0= ruleGlobalProtocolBlock ) ) )* - { - otherlv_0=(Token)match(input,37,FOLLOW_37_in_ruleGlobalParallel3816); - - newLeafNode(otherlv_0, grammarAccess.getGlobalParallelAccess().getParKeyword_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1843:1: ( (lv_blocks_1_0= ruleGlobalProtocolBlock ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1844:1: (lv_blocks_1_0= ruleGlobalProtocolBlock ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1844:1: (lv_blocks_1_0= ruleGlobalProtocolBlock ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1845:3: lv_blocks_1_0= ruleGlobalProtocolBlock - { - - newCompositeNode(grammarAccess.getGlobalParallelAccess().getBlocksGlobalProtocolBlockParserRuleCall_1_0()); - - pushFollow(FOLLOW_ruleGlobalProtocolBlock_in_ruleGlobalParallel3837); - lv_blocks_1_0=ruleGlobalProtocolBlock(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getGlobalParallelRule()); - } - add( - current, - "blocks", - lv_blocks_1_0, - "GlobalProtocolBlock"); - afterParserOrEnumRuleCall(); - - - } - - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1861:2: (otherlv_2= 'and' ( (lv_blocks_3_0= ruleGlobalProtocolBlock ) ) )* - loop32: - do { - int alt32=2; - int LA32_0 = input.LA(1); - - if ( (LA32_0==38) ) { - alt32=1; - } - - - switch (alt32) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1861:4: otherlv_2= 'and' ( (lv_blocks_3_0= ruleGlobalProtocolBlock ) ) - { - otherlv_2=(Token)match(input,38,FOLLOW_38_in_ruleGlobalParallel3850); - - newLeafNode(otherlv_2, grammarAccess.getGlobalParallelAccess().getAndKeyword_2_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1865:1: ( (lv_blocks_3_0= ruleGlobalProtocolBlock ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1866:1: (lv_blocks_3_0= ruleGlobalProtocolBlock ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1866:1: (lv_blocks_3_0= ruleGlobalProtocolBlock ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1867:3: lv_blocks_3_0= ruleGlobalProtocolBlock - { - - newCompositeNode(grammarAccess.getGlobalParallelAccess().getBlocksGlobalProtocolBlockParserRuleCall_2_1_0()); - - pushFollow(FOLLOW_ruleGlobalProtocolBlock_in_ruleGlobalParallel3871); - lv_blocks_3_0=ruleGlobalProtocolBlock(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getGlobalParallelRule()); - } - add( - current, - "blocks", - lv_blocks_3_0, - "GlobalProtocolBlock"); - afterParserOrEnumRuleCall(); - - - } - - - } - - - } - break; - - default : - break loop32; - } - } while (true); - - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleGlobalParallel" - - - // $ANTLR start "entryRuleGlobalInterruptible" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1891:1: entryRuleGlobalInterruptible returns [EObject current=null] : iv_ruleGlobalInterruptible= ruleGlobalInterruptible EOF ; - public final EObject entryRuleGlobalInterruptible() throws RecognitionException { - EObject current = null; - - EObject iv_ruleGlobalInterruptible = null; - - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1892:2: (iv_ruleGlobalInterruptible= ruleGlobalInterruptible EOF ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1893:2: iv_ruleGlobalInterruptible= ruleGlobalInterruptible EOF - { - newCompositeNode(grammarAccess.getGlobalInterruptibleRule()); - pushFollow(FOLLOW_ruleGlobalInterruptible_in_entryRuleGlobalInterruptible3909); - iv_ruleGlobalInterruptible=ruleGlobalInterruptible(); - - state._fsp--; - - current =iv_ruleGlobalInterruptible; - match(input,EOF,FOLLOW_EOF_in_entryRuleGlobalInterruptible3919); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleGlobalInterruptible" - - - // $ANTLR start "ruleGlobalInterruptible" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1900:1: ruleGlobalInterruptible returns [EObject current=null] : (otherlv_0= 'interruptible' ( ( (lv_scope_1_0= RULE_ID ) ) otherlv_2= ':' )? ( (lv_block_3_0= ruleGlobalProtocolBlock ) ) otherlv_4= 'with' otherlv_5= '{' ( (lv_interrupts_6_0= ruleGlobalInterrupt ) )* otherlv_7= '}' ) ; - public final EObject ruleGlobalInterruptible() throws RecognitionException { - EObject current = null; - - Token otherlv_0=null; - Token lv_scope_1_0=null; - Token otherlv_2=null; - Token otherlv_4=null; - Token otherlv_5=null; - Token otherlv_7=null; - EObject lv_block_3_0 = null; - - EObject lv_interrupts_6_0 = null; - - - enterRule(); - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1903:28: ( (otherlv_0= 'interruptible' ( ( (lv_scope_1_0= RULE_ID ) ) otherlv_2= ':' )? ( (lv_block_3_0= ruleGlobalProtocolBlock ) ) otherlv_4= 'with' otherlv_5= '{' ( (lv_interrupts_6_0= ruleGlobalInterrupt ) )* otherlv_7= '}' ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1904:1: (otherlv_0= 'interruptible' ( ( (lv_scope_1_0= RULE_ID ) ) otherlv_2= ':' )? ( (lv_block_3_0= ruleGlobalProtocolBlock ) ) otherlv_4= 'with' otherlv_5= '{' ( (lv_interrupts_6_0= ruleGlobalInterrupt ) )* otherlv_7= '}' ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1904:1: (otherlv_0= 'interruptible' ( ( (lv_scope_1_0= RULE_ID ) ) otherlv_2= ':' )? ( (lv_block_3_0= ruleGlobalProtocolBlock ) ) otherlv_4= 'with' otherlv_5= '{' ( (lv_interrupts_6_0= ruleGlobalInterrupt ) )* otherlv_7= '}' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1904:3: otherlv_0= 'interruptible' ( ( (lv_scope_1_0= RULE_ID ) ) otherlv_2= ':' )? ( (lv_block_3_0= ruleGlobalProtocolBlock ) ) otherlv_4= 'with' otherlv_5= '{' ( (lv_interrupts_6_0= ruleGlobalInterrupt ) )* otherlv_7= '}' - { - otherlv_0=(Token)match(input,39,FOLLOW_39_in_ruleGlobalInterruptible3956); - - newLeafNode(otherlv_0, grammarAccess.getGlobalInterruptibleAccess().getInterruptibleKeyword_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1908:1: ( ( (lv_scope_1_0= RULE_ID ) ) otherlv_2= ':' )? - int alt33=2; - int LA33_0 = input.LA(1); - - if ( (LA33_0==RULE_ID) ) { - alt33=1; - } - switch (alt33) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1908:2: ( (lv_scope_1_0= RULE_ID ) ) otherlv_2= ':' - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1908:2: ( (lv_scope_1_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1909:1: (lv_scope_1_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1909:1: (lv_scope_1_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1910:3: lv_scope_1_0= RULE_ID - { - lv_scope_1_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleGlobalInterruptible3974); - - newLeafNode(lv_scope_1_0, grammarAccess.getGlobalInterruptibleAccess().getScopeIDTerminalRuleCall_1_0_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getGlobalInterruptibleRule()); - } - setWithLastConsumed( - current, - "scope", - lv_scope_1_0, - "ID"); - - - } - - - } - - otherlv_2=(Token)match(input,23,FOLLOW_23_in_ruleGlobalInterruptible3991); - - newLeafNode(otherlv_2, grammarAccess.getGlobalInterruptibleAccess().getColonKeyword_1_1()); - - - } - break; - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1930:3: ( (lv_block_3_0= ruleGlobalProtocolBlock ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1931:1: (lv_block_3_0= ruleGlobalProtocolBlock ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1931:1: (lv_block_3_0= ruleGlobalProtocolBlock ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1932:3: lv_block_3_0= ruleGlobalProtocolBlock - { - - newCompositeNode(grammarAccess.getGlobalInterruptibleAccess().getBlockGlobalProtocolBlockParserRuleCall_2_0()); - - pushFollow(FOLLOW_ruleGlobalProtocolBlock_in_ruleGlobalInterruptible4014); - lv_block_3_0=ruleGlobalProtocolBlock(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getGlobalInterruptibleRule()); - } - set( - current, - "block", - lv_block_3_0, - "GlobalProtocolBlock"); - afterParserOrEnumRuleCall(); - - - } - - - } - - otherlv_4=(Token)match(input,40,FOLLOW_40_in_ruleGlobalInterruptible4026); - - newLeafNode(otherlv_4, grammarAccess.getGlobalInterruptibleAccess().getWithKeyword_3()); - - otherlv_5=(Token)match(input,29,FOLLOW_29_in_ruleGlobalInterruptible4038); - - newLeafNode(otherlv_5, grammarAccess.getGlobalInterruptibleAccess().getLeftCurlyBracketKeyword_4()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1956:1: ( (lv_interrupts_6_0= ruleGlobalInterrupt ) )* - loop34: - do { - int alt34=2; - int LA34_0 = input.LA(1); - - if ( (LA34_0==RULE_ID||LA34_0==20) ) { - alt34=1; - } - - - switch (alt34) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1957:1: (lv_interrupts_6_0= ruleGlobalInterrupt ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1957:1: (lv_interrupts_6_0= ruleGlobalInterrupt ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1958:3: lv_interrupts_6_0= ruleGlobalInterrupt - { - - newCompositeNode(grammarAccess.getGlobalInterruptibleAccess().getInterruptsGlobalInterruptParserRuleCall_5_0()); - - pushFollow(FOLLOW_ruleGlobalInterrupt_in_ruleGlobalInterruptible4059); - lv_interrupts_6_0=ruleGlobalInterrupt(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getGlobalInterruptibleRule()); - } - add( - current, - "interrupts", - lv_interrupts_6_0, - "GlobalInterrupt"); - afterParserOrEnumRuleCall(); - - - } - - - } - break; - - default : - break loop34; - } - } while (true); - - otherlv_7=(Token)match(input,30,FOLLOW_30_in_ruleGlobalInterruptible4072); - - newLeafNode(otherlv_7, grammarAccess.getGlobalInterruptibleAccess().getRightCurlyBracketKeyword_6()); - - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleGlobalInterruptible" - - - // $ANTLR start "entryRuleGlobalInterrupt" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1986:1: entryRuleGlobalInterrupt returns [EObject current=null] : iv_ruleGlobalInterrupt= ruleGlobalInterrupt EOF ; - public final EObject entryRuleGlobalInterrupt() throws RecognitionException { - EObject current = null; - - EObject iv_ruleGlobalInterrupt = null; - - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1987:2: (iv_ruleGlobalInterrupt= ruleGlobalInterrupt EOF ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1988:2: iv_ruleGlobalInterrupt= ruleGlobalInterrupt EOF - { - newCompositeNode(grammarAccess.getGlobalInterruptRule()); - pushFollow(FOLLOW_ruleGlobalInterrupt_in_entryRuleGlobalInterrupt4108); - iv_ruleGlobalInterrupt=ruleGlobalInterrupt(); - - state._fsp--; - - current =iv_ruleGlobalInterrupt; - match(input,EOF,FOLLOW_EOF_in_entryRuleGlobalInterrupt4118); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleGlobalInterrupt" - - - // $ANTLR start "ruleGlobalInterrupt" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1995:1: ruleGlobalInterrupt returns [EObject current=null] : ( ( (lv_messages_0_0= ruleMessage ) ) (otherlv_1= ',' ( (lv_messages_2_0= ruleMessage ) ) )* otherlv_3= 'by' ( (lv_role_4_0= RULE_ID ) ) otherlv_5= ';' ) ; - public final EObject ruleGlobalInterrupt() throws RecognitionException { - EObject current = null; - - Token otherlv_1=null; - Token otherlv_3=null; - Token lv_role_4_0=null; - Token otherlv_5=null; - EObject lv_messages_0_0 = null; - - EObject lv_messages_2_0 = null; - - - enterRule(); - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1998:28: ( ( ( (lv_messages_0_0= ruleMessage ) ) (otherlv_1= ',' ( (lv_messages_2_0= ruleMessage ) ) )* otherlv_3= 'by' ( (lv_role_4_0= RULE_ID ) ) otherlv_5= ';' ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1999:1: ( ( (lv_messages_0_0= ruleMessage ) ) (otherlv_1= ',' ( (lv_messages_2_0= ruleMessage ) ) )* otherlv_3= 'by' ( (lv_role_4_0= RULE_ID ) ) otherlv_5= ';' ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1999:1: ( ( (lv_messages_0_0= ruleMessage ) ) (otherlv_1= ',' ( (lv_messages_2_0= ruleMessage ) ) )* otherlv_3= 'by' ( (lv_role_4_0= RULE_ID ) ) otherlv_5= ';' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1999:2: ( (lv_messages_0_0= ruleMessage ) ) (otherlv_1= ',' ( (lv_messages_2_0= ruleMessage ) ) )* otherlv_3= 'by' ( (lv_role_4_0= RULE_ID ) ) otherlv_5= ';' - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:1999:2: ( (lv_messages_0_0= ruleMessage ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2000:1: (lv_messages_0_0= ruleMessage ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2000:1: (lv_messages_0_0= ruleMessage ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2001:3: lv_messages_0_0= ruleMessage - { - - newCompositeNode(grammarAccess.getGlobalInterruptAccess().getMessagesMessageParserRuleCall_0_0()); - - pushFollow(FOLLOW_ruleMessage_in_ruleGlobalInterrupt4164); - lv_messages_0_0=ruleMessage(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getGlobalInterruptRule()); - } - add( - current, - "messages", - lv_messages_0_0, - "Message"); - afterParserOrEnumRuleCall(); - - - } - - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2017:2: (otherlv_1= ',' ( (lv_messages_2_0= ruleMessage ) ) )* - loop35: - do { - int alt35=2; - int LA35_0 = input.LA(1); - - if ( (LA35_0==21) ) { - alt35=1; - } - - - switch (alt35) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2017:4: otherlv_1= ',' ( (lv_messages_2_0= ruleMessage ) ) - { - otherlv_1=(Token)match(input,21,FOLLOW_21_in_ruleGlobalInterrupt4177); - - newLeafNode(otherlv_1, grammarAccess.getGlobalInterruptAccess().getCommaKeyword_1_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2021:1: ( (lv_messages_2_0= ruleMessage ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2022:1: (lv_messages_2_0= ruleMessage ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2022:1: (lv_messages_2_0= ruleMessage ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2023:3: lv_messages_2_0= ruleMessage - { - - newCompositeNode(grammarAccess.getGlobalInterruptAccess().getMessagesMessageParserRuleCall_1_1_0()); - - pushFollow(FOLLOW_ruleMessage_in_ruleGlobalInterrupt4198); - lv_messages_2_0=ruleMessage(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getGlobalInterruptRule()); - } - add( - current, - "messages", - lv_messages_2_0, - "Message"); - afterParserOrEnumRuleCall(); - - - } - - - } - - - } - break; - - default : - break loop35; - } - } while (true); - - otherlv_3=(Token)match(input,41,FOLLOW_41_in_ruleGlobalInterrupt4212); - - newLeafNode(otherlv_3, grammarAccess.getGlobalInterruptAccess().getByKeyword_2()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2043:1: ( (lv_role_4_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2044:1: (lv_role_4_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2044:1: (lv_role_4_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2045:3: lv_role_4_0= RULE_ID - { - lv_role_4_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleGlobalInterrupt4229); - - newLeafNode(lv_role_4_0, grammarAccess.getGlobalInterruptAccess().getRoleIDTerminalRuleCall_3_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getGlobalInterruptRule()); - } - setWithLastConsumed( - current, - "role", - lv_role_4_0, - "ID"); - - - } - - - } - - otherlv_5=(Token)match(input,12,FOLLOW_12_in_ruleGlobalInterrupt4246); - - newLeafNode(otherlv_5, grammarAccess.getGlobalInterruptAccess().getSemicolonKeyword_4()); - - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleGlobalInterrupt" - - - // $ANTLR start "entryRuleGlobalDo" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2073:1: entryRuleGlobalDo returns [EObject current=null] : iv_ruleGlobalDo= ruleGlobalDo EOF ; - public final EObject entryRuleGlobalDo() throws RecognitionException { - EObject current = null; - - EObject iv_ruleGlobalDo = null; - - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2074:2: (iv_ruleGlobalDo= ruleGlobalDo EOF ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2075:2: iv_ruleGlobalDo= ruleGlobalDo EOF - { - newCompositeNode(grammarAccess.getGlobalDoRule()); - pushFollow(FOLLOW_ruleGlobalDo_in_entryRuleGlobalDo4282); - iv_ruleGlobalDo=ruleGlobalDo(); - - state._fsp--; - - current =iv_ruleGlobalDo; - match(input,EOF,FOLLOW_EOF_in_entryRuleGlobalDo4292); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleGlobalDo" - - - // $ANTLR start "ruleGlobalDo" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2082:1: ruleGlobalDo returns [EObject current=null] : (otherlv_0= 'do' ( ( (lv_scope_1_0= RULE_ID ) ) otherlv_2= ':' )? ( (lv_member_3_0= RULE_ID ) ) (otherlv_4= '<' ( (lv_arguments_5_0= ruleArgument ) ) (otherlv_6= ',' ( (lv_arguments_7_0= ruleArgument ) ) )* otherlv_8= '>' )? otherlv_9= '(' ( (lv_roles_10_0= ruleRoleInstantiation ) ) (otherlv_11= ',' ( (lv_roles_12_0= ruleRoleInstantiation ) ) )* otherlv_13= ')' otherlv_14= ';' ) ; - public final EObject ruleGlobalDo() throws RecognitionException { - EObject current = null; - - Token otherlv_0=null; - Token lv_scope_1_0=null; - Token otherlv_2=null; - Token lv_member_3_0=null; - Token otherlv_4=null; - Token otherlv_6=null; - Token otherlv_8=null; - Token otherlv_9=null; - Token otherlv_11=null; - Token otherlv_13=null; - Token otherlv_14=null; - EObject lv_arguments_5_0 = null; - - EObject lv_arguments_7_0 = null; - - EObject lv_roles_10_0 = null; - - EObject lv_roles_12_0 = null; - - - enterRule(); - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2085:28: ( (otherlv_0= 'do' ( ( (lv_scope_1_0= RULE_ID ) ) otherlv_2= ':' )? ( (lv_member_3_0= RULE_ID ) ) (otherlv_4= '<' ( (lv_arguments_5_0= ruleArgument ) ) (otherlv_6= ',' ( (lv_arguments_7_0= ruleArgument ) ) )* otherlv_8= '>' )? otherlv_9= '(' ( (lv_roles_10_0= ruleRoleInstantiation ) ) (otherlv_11= ',' ( (lv_roles_12_0= ruleRoleInstantiation ) ) )* otherlv_13= ')' otherlv_14= ';' ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2086:1: (otherlv_0= 'do' ( ( (lv_scope_1_0= RULE_ID ) ) otherlv_2= ':' )? ( (lv_member_3_0= RULE_ID ) ) (otherlv_4= '<' ( (lv_arguments_5_0= ruleArgument ) ) (otherlv_6= ',' ( (lv_arguments_7_0= ruleArgument ) ) )* otherlv_8= '>' )? otherlv_9= '(' ( (lv_roles_10_0= ruleRoleInstantiation ) ) (otherlv_11= ',' ( (lv_roles_12_0= ruleRoleInstantiation ) ) )* otherlv_13= ')' otherlv_14= ';' ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2086:1: (otherlv_0= 'do' ( ( (lv_scope_1_0= RULE_ID ) ) otherlv_2= ':' )? ( (lv_member_3_0= RULE_ID ) ) (otherlv_4= '<' ( (lv_arguments_5_0= ruleArgument ) ) (otherlv_6= ',' ( (lv_arguments_7_0= ruleArgument ) ) )* otherlv_8= '>' )? otherlv_9= '(' ( (lv_roles_10_0= ruleRoleInstantiation ) ) (otherlv_11= ',' ( (lv_roles_12_0= ruleRoleInstantiation ) ) )* otherlv_13= ')' otherlv_14= ';' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2086:3: otherlv_0= 'do' ( ( (lv_scope_1_0= RULE_ID ) ) otherlv_2= ':' )? ( (lv_member_3_0= RULE_ID ) ) (otherlv_4= '<' ( (lv_arguments_5_0= ruleArgument ) ) (otherlv_6= ',' ( (lv_arguments_7_0= ruleArgument ) ) )* otherlv_8= '>' )? otherlv_9= '(' ( (lv_roles_10_0= ruleRoleInstantiation ) ) (otherlv_11= ',' ( (lv_roles_12_0= ruleRoleInstantiation ) ) )* otherlv_13= ')' otherlv_14= ';' - { - otherlv_0=(Token)match(input,42,FOLLOW_42_in_ruleGlobalDo4329); - - newLeafNode(otherlv_0, grammarAccess.getGlobalDoAccess().getDoKeyword_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2090:1: ( ( (lv_scope_1_0= RULE_ID ) ) otherlv_2= ':' )? - int alt36=2; - int LA36_0 = input.LA(1); - - if ( (LA36_0==RULE_ID) ) { - int LA36_1 = input.LA(2); - - if ( (LA36_1==23) ) { - alt36=1; - } - } - switch (alt36) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2090:2: ( (lv_scope_1_0= RULE_ID ) ) otherlv_2= ':' - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2090:2: ( (lv_scope_1_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2091:1: (lv_scope_1_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2091:1: (lv_scope_1_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2092:3: lv_scope_1_0= RULE_ID - { - lv_scope_1_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleGlobalDo4347); - - newLeafNode(lv_scope_1_0, grammarAccess.getGlobalDoAccess().getScopeIDTerminalRuleCall_1_0_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getGlobalDoRule()); - } - setWithLastConsumed( - current, - "scope", - lv_scope_1_0, - "ID"); - - - } - - - } - - otherlv_2=(Token)match(input,23,FOLLOW_23_in_ruleGlobalDo4364); - - newLeafNode(otherlv_2, grammarAccess.getGlobalDoAccess().getColonKeyword_1_1()); - - - } - break; - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2112:3: ( (lv_member_3_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2113:1: (lv_member_3_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2113:1: (lv_member_3_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2114:3: lv_member_3_0= RULE_ID - { - lv_member_3_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleGlobalDo4383); - - newLeafNode(lv_member_3_0, grammarAccess.getGlobalDoAccess().getMemberIDTerminalRuleCall_2_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getGlobalDoRule()); - } - setWithLastConsumed( - current, - "member", - lv_member_3_0, - "ID"); - - - } - - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2130:2: (otherlv_4= '<' ( (lv_arguments_5_0= ruleArgument ) ) (otherlv_6= ',' ( (lv_arguments_7_0= ruleArgument ) ) )* otherlv_8= '>' )? - int alt38=2; - int LA38_0 = input.LA(1); - - if ( (LA38_0==18) ) { - alt38=1; - } - switch (alt38) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2130:4: otherlv_4= '<' ( (lv_arguments_5_0= ruleArgument ) ) (otherlv_6= ',' ( (lv_arguments_7_0= ruleArgument ) ) )* otherlv_8= '>' - { - otherlv_4=(Token)match(input,18,FOLLOW_18_in_ruleGlobalDo4401); - - newLeafNode(otherlv_4, grammarAccess.getGlobalDoAccess().getLessThanSignKeyword_3_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2134:1: ( (lv_arguments_5_0= ruleArgument ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2135:1: (lv_arguments_5_0= ruleArgument ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2135:1: (lv_arguments_5_0= ruleArgument ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2136:3: lv_arguments_5_0= ruleArgument - { - - newCompositeNode(grammarAccess.getGlobalDoAccess().getArgumentsArgumentParserRuleCall_3_1_0()); - - pushFollow(FOLLOW_ruleArgument_in_ruleGlobalDo4422); - lv_arguments_5_0=ruleArgument(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getGlobalDoRule()); - } - add( - current, - "arguments", - lv_arguments_5_0, - "Argument"); - afterParserOrEnumRuleCall(); - - - } - - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2152:2: (otherlv_6= ',' ( (lv_arguments_7_0= ruleArgument ) ) )* - loop37: - do { - int alt37=2; - int LA37_0 = input.LA(1); - - if ( (LA37_0==21) ) { - alt37=1; - } - - - switch (alt37) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2152:4: otherlv_6= ',' ( (lv_arguments_7_0= ruleArgument ) ) - { - otherlv_6=(Token)match(input,21,FOLLOW_21_in_ruleGlobalDo4435); - - newLeafNode(otherlv_6, grammarAccess.getGlobalDoAccess().getCommaKeyword_3_2_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2156:1: ( (lv_arguments_7_0= ruleArgument ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2157:1: (lv_arguments_7_0= ruleArgument ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2157:1: (lv_arguments_7_0= ruleArgument ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2158:3: lv_arguments_7_0= ruleArgument - { - - newCompositeNode(grammarAccess.getGlobalDoAccess().getArgumentsArgumentParserRuleCall_3_2_1_0()); - - pushFollow(FOLLOW_ruleArgument_in_ruleGlobalDo4456); - lv_arguments_7_0=ruleArgument(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getGlobalDoRule()); - } - add( - current, - "arguments", - lv_arguments_7_0, - "Argument"); - afterParserOrEnumRuleCall(); - - - } - - - } - - - } - break; - - default : - break loop37; - } - } while (true); - - otherlv_8=(Token)match(input,19,FOLLOW_19_in_ruleGlobalDo4470); - - newLeafNode(otherlv_8, grammarAccess.getGlobalDoAccess().getGreaterThanSignKeyword_3_3()); - - - } - break; - - } - - otherlv_9=(Token)match(input,20,FOLLOW_20_in_ruleGlobalDo4484); - - newLeafNode(otherlv_9, grammarAccess.getGlobalDoAccess().getLeftParenthesisKeyword_4()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2182:1: ( (lv_roles_10_0= ruleRoleInstantiation ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2183:1: (lv_roles_10_0= ruleRoleInstantiation ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2183:1: (lv_roles_10_0= ruleRoleInstantiation ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2184:3: lv_roles_10_0= ruleRoleInstantiation - { - - newCompositeNode(grammarAccess.getGlobalDoAccess().getRolesRoleInstantiationParserRuleCall_5_0()); - - pushFollow(FOLLOW_ruleRoleInstantiation_in_ruleGlobalDo4505); - lv_roles_10_0=ruleRoleInstantiation(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getGlobalDoRule()); - } - add( - current, - "roles", - lv_roles_10_0, - "RoleInstantiation"); - afterParserOrEnumRuleCall(); - - - } - - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2200:2: (otherlv_11= ',' ( (lv_roles_12_0= ruleRoleInstantiation ) ) )* - loop39: - do { - int alt39=2; - int LA39_0 = input.LA(1); - - if ( (LA39_0==21) ) { - alt39=1; - } - - - switch (alt39) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2200:4: otherlv_11= ',' ( (lv_roles_12_0= ruleRoleInstantiation ) ) - { - otherlv_11=(Token)match(input,21,FOLLOW_21_in_ruleGlobalDo4518); - - newLeafNode(otherlv_11, grammarAccess.getGlobalDoAccess().getCommaKeyword_6_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2204:1: ( (lv_roles_12_0= ruleRoleInstantiation ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2205:1: (lv_roles_12_0= ruleRoleInstantiation ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2205:1: (lv_roles_12_0= ruleRoleInstantiation ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2206:3: lv_roles_12_0= ruleRoleInstantiation - { - - newCompositeNode(grammarAccess.getGlobalDoAccess().getRolesRoleInstantiationParserRuleCall_6_1_0()); - - pushFollow(FOLLOW_ruleRoleInstantiation_in_ruleGlobalDo4539); - lv_roles_12_0=ruleRoleInstantiation(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getGlobalDoRule()); - } - add( - current, - "roles", - lv_roles_12_0, - "RoleInstantiation"); - afterParserOrEnumRuleCall(); - - - } - - - } - - - } - break; - - default : - break loop39; - } - } while (true); - - otherlv_13=(Token)match(input,22,FOLLOW_22_in_ruleGlobalDo4553); - - newLeafNode(otherlv_13, grammarAccess.getGlobalDoAccess().getRightParenthesisKeyword_7()); - - otherlv_14=(Token)match(input,12,FOLLOW_12_in_ruleGlobalDo4565); - - newLeafNode(otherlv_14, grammarAccess.getGlobalDoAccess().getSemicolonKeyword_8()); - - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleGlobalDo" - - - // $ANTLR start "entryRuleLocalProtocolDecl" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2238:1: entryRuleLocalProtocolDecl returns [EObject current=null] : iv_ruleLocalProtocolDecl= ruleLocalProtocolDecl EOF ; - public final EObject entryRuleLocalProtocolDecl() throws RecognitionException { - EObject current = null; - - EObject iv_ruleLocalProtocolDecl = null; - - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2239:2: (iv_ruleLocalProtocolDecl= ruleLocalProtocolDecl EOF ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2240:2: iv_ruleLocalProtocolDecl= ruleLocalProtocolDecl EOF - { - newCompositeNode(grammarAccess.getLocalProtocolDeclRule()); - pushFollow(FOLLOW_ruleLocalProtocolDecl_in_entryRuleLocalProtocolDecl4601); - iv_ruleLocalProtocolDecl=ruleLocalProtocolDecl(); - - state._fsp--; - - current =iv_ruleLocalProtocolDecl; - match(input,EOF,FOLLOW_EOF_in_entryRuleLocalProtocolDecl4611); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleLocalProtocolDecl" - - - // $ANTLR start "ruleLocalProtocolDecl" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2247:1: ruleLocalProtocolDecl returns [EObject current=null] : (otherlv_0= 'local' otherlv_1= 'protocol' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= 'at' ( (lv_role_4_0= RULE_ID ) ) (otherlv_5= '<' ( (lv_parameters_6_0= ruleParameterDecl ) ) (otherlv_7= ',' ( (lv_parameters_8_0= ruleParameterDecl ) ) )* otherlv_9= '>' )? otherlv_10= '(' ( (lv_roles_11_0= ruleRoleDecl ) ) (otherlv_12= ',' ( (lv_roles_13_0= ruleRoleDecl ) ) )* otherlv_14= ')' ( ( (lv_block_15_0= ruleLocalProtocolBlock ) ) | (otherlv_16= 'instantiates' ( (lv_instantiates_17_0= RULE_ID ) ) (otherlv_18= '<' ( (lv_arguments_19_0= ruleArgument ) ) (otherlv_20= ',' ( (lv_arguments_21_0= ruleArgument ) ) )* otherlv_22= '>' )? otherlv_23= '(' ( (lv_roleInstantiations_24_0= ruleRoleInstantiation ) ) (otherlv_25= ',' ( (lv_roleInstantiations_26_0= ruleRoleInstantiation ) ) )* otherlv_27= ')' otherlv_28= ';' ) ) ) ; - public final EObject ruleLocalProtocolDecl() throws RecognitionException { - EObject current = null; - - Token otherlv_0=null; - Token otherlv_1=null; - Token lv_name_2_0=null; - Token otherlv_3=null; - Token lv_role_4_0=null; - Token otherlv_5=null; - Token otherlv_7=null; - Token otherlv_9=null; - Token otherlv_10=null; - Token otherlv_12=null; - Token otherlv_14=null; - Token otherlv_16=null; - Token lv_instantiates_17_0=null; - Token otherlv_18=null; - Token otherlv_20=null; - Token otherlv_22=null; - Token otherlv_23=null; - Token otherlv_25=null; - Token otherlv_27=null; - Token otherlv_28=null; - EObject lv_parameters_6_0 = null; - - EObject lv_parameters_8_0 = null; - - EObject lv_roles_11_0 = null; - - EObject lv_roles_13_0 = null; - - EObject lv_block_15_0 = null; - - EObject lv_arguments_19_0 = null; - - EObject lv_arguments_21_0 = null; - - EObject lv_roleInstantiations_24_0 = null; - - EObject lv_roleInstantiations_26_0 = null; - - - enterRule(); - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2250:28: ( (otherlv_0= 'local' otherlv_1= 'protocol' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= 'at' ( (lv_role_4_0= RULE_ID ) ) (otherlv_5= '<' ( (lv_parameters_6_0= ruleParameterDecl ) ) (otherlv_7= ',' ( (lv_parameters_8_0= ruleParameterDecl ) ) )* otherlv_9= '>' )? otherlv_10= '(' ( (lv_roles_11_0= ruleRoleDecl ) ) (otherlv_12= ',' ( (lv_roles_13_0= ruleRoleDecl ) ) )* otherlv_14= ')' ( ( (lv_block_15_0= ruleLocalProtocolBlock ) ) | (otherlv_16= 'instantiates' ( (lv_instantiates_17_0= RULE_ID ) ) (otherlv_18= '<' ( (lv_arguments_19_0= ruleArgument ) ) (otherlv_20= ',' ( (lv_arguments_21_0= ruleArgument ) ) )* otherlv_22= '>' )? otherlv_23= '(' ( (lv_roleInstantiations_24_0= ruleRoleInstantiation ) ) (otherlv_25= ',' ( (lv_roleInstantiations_26_0= ruleRoleInstantiation ) ) )* otherlv_27= ')' otherlv_28= ';' ) ) ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2251:1: (otherlv_0= 'local' otherlv_1= 'protocol' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= 'at' ( (lv_role_4_0= RULE_ID ) ) (otherlv_5= '<' ( (lv_parameters_6_0= ruleParameterDecl ) ) (otherlv_7= ',' ( (lv_parameters_8_0= ruleParameterDecl ) ) )* otherlv_9= '>' )? otherlv_10= '(' ( (lv_roles_11_0= ruleRoleDecl ) ) (otherlv_12= ',' ( (lv_roles_13_0= ruleRoleDecl ) ) )* otherlv_14= ')' ( ( (lv_block_15_0= ruleLocalProtocolBlock ) ) | (otherlv_16= 'instantiates' ( (lv_instantiates_17_0= RULE_ID ) ) (otherlv_18= '<' ( (lv_arguments_19_0= ruleArgument ) ) (otherlv_20= ',' ( (lv_arguments_21_0= ruleArgument ) ) )* otherlv_22= '>' )? otherlv_23= '(' ( (lv_roleInstantiations_24_0= ruleRoleInstantiation ) ) (otherlv_25= ',' ( (lv_roleInstantiations_26_0= ruleRoleInstantiation ) ) )* otherlv_27= ')' otherlv_28= ';' ) ) ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2251:1: (otherlv_0= 'local' otherlv_1= 'protocol' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= 'at' ( (lv_role_4_0= RULE_ID ) ) (otherlv_5= '<' ( (lv_parameters_6_0= ruleParameterDecl ) ) (otherlv_7= ',' ( (lv_parameters_8_0= ruleParameterDecl ) ) )* otherlv_9= '>' )? otherlv_10= '(' ( (lv_roles_11_0= ruleRoleDecl ) ) (otherlv_12= ',' ( (lv_roles_13_0= ruleRoleDecl ) ) )* otherlv_14= ')' ( ( (lv_block_15_0= ruleLocalProtocolBlock ) ) | (otherlv_16= 'instantiates' ( (lv_instantiates_17_0= RULE_ID ) ) (otherlv_18= '<' ( (lv_arguments_19_0= ruleArgument ) ) (otherlv_20= ',' ( (lv_arguments_21_0= ruleArgument ) ) )* otherlv_22= '>' )? otherlv_23= '(' ( (lv_roleInstantiations_24_0= ruleRoleInstantiation ) ) (otherlv_25= ',' ( (lv_roleInstantiations_26_0= ruleRoleInstantiation ) ) )* otherlv_27= ')' otherlv_28= ';' ) ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2251:3: otherlv_0= 'local' otherlv_1= 'protocol' ( (lv_name_2_0= RULE_ID ) ) otherlv_3= 'at' ( (lv_role_4_0= RULE_ID ) ) (otherlv_5= '<' ( (lv_parameters_6_0= ruleParameterDecl ) ) (otherlv_7= ',' ( (lv_parameters_8_0= ruleParameterDecl ) ) )* otherlv_9= '>' )? otherlv_10= '(' ( (lv_roles_11_0= ruleRoleDecl ) ) (otherlv_12= ',' ( (lv_roles_13_0= ruleRoleDecl ) ) )* otherlv_14= ')' ( ( (lv_block_15_0= ruleLocalProtocolBlock ) ) | (otherlv_16= 'instantiates' ( (lv_instantiates_17_0= RULE_ID ) ) (otherlv_18= '<' ( (lv_arguments_19_0= ruleArgument ) ) (otherlv_20= ',' ( (lv_arguments_21_0= ruleArgument ) ) )* otherlv_22= '>' )? otherlv_23= '(' ( (lv_roleInstantiations_24_0= ruleRoleInstantiation ) ) (otherlv_25= ',' ( (lv_roleInstantiations_26_0= ruleRoleInstantiation ) ) )* otherlv_27= ')' otherlv_28= ';' ) ) - { - otherlv_0=(Token)match(input,43,FOLLOW_43_in_ruleLocalProtocolDecl4648); - - newLeafNode(otherlv_0, grammarAccess.getLocalProtocolDeclAccess().getLocalKeyword_0()); - - otherlv_1=(Token)match(input,25,FOLLOW_25_in_ruleLocalProtocolDecl4660); - - newLeafNode(otherlv_1, grammarAccess.getLocalProtocolDeclAccess().getProtocolKeyword_1()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2259:1: ( (lv_name_2_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2260:1: (lv_name_2_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2260:1: (lv_name_2_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2261:3: lv_name_2_0= RULE_ID - { - lv_name_2_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleLocalProtocolDecl4677); - - newLeafNode(lv_name_2_0, grammarAccess.getLocalProtocolDeclAccess().getNameIDTerminalRuleCall_2_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getLocalProtocolDeclRule()); - } - setWithLastConsumed( - current, - "name", - lv_name_2_0, - "ID"); - - - } - - - } - - otherlv_3=(Token)match(input,33,FOLLOW_33_in_ruleLocalProtocolDecl4694); - - newLeafNode(otherlv_3, grammarAccess.getLocalProtocolDeclAccess().getAtKeyword_3()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2281:1: ( (lv_role_4_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2282:1: (lv_role_4_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2282:1: (lv_role_4_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2283:3: lv_role_4_0= RULE_ID - { - lv_role_4_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleLocalProtocolDecl4711); - - newLeafNode(lv_role_4_0, grammarAccess.getLocalProtocolDeclAccess().getRoleIDTerminalRuleCall_4_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getLocalProtocolDeclRule()); - } - setWithLastConsumed( - current, - "role", - lv_role_4_0, - "ID"); - - - } - - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2299:2: (otherlv_5= '<' ( (lv_parameters_6_0= ruleParameterDecl ) ) (otherlv_7= ',' ( (lv_parameters_8_0= ruleParameterDecl ) ) )* otherlv_9= '>' )? - int alt41=2; - int LA41_0 = input.LA(1); - - if ( (LA41_0==18) ) { - alt41=1; - } - switch (alt41) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2299:4: otherlv_5= '<' ( (lv_parameters_6_0= ruleParameterDecl ) ) (otherlv_7= ',' ( (lv_parameters_8_0= ruleParameterDecl ) ) )* otherlv_9= '>' - { - otherlv_5=(Token)match(input,18,FOLLOW_18_in_ruleLocalProtocolDecl4729); - - newLeafNode(otherlv_5, grammarAccess.getLocalProtocolDeclAccess().getLessThanSignKeyword_5_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2303:1: ( (lv_parameters_6_0= ruleParameterDecl ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2304:1: (lv_parameters_6_0= ruleParameterDecl ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2304:1: (lv_parameters_6_0= ruleParameterDecl ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2305:3: lv_parameters_6_0= ruleParameterDecl - { - - newCompositeNode(grammarAccess.getLocalProtocolDeclAccess().getParametersParameterDeclParserRuleCall_5_1_0()); - - pushFollow(FOLLOW_ruleParameterDecl_in_ruleLocalProtocolDecl4750); - lv_parameters_6_0=ruleParameterDecl(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getLocalProtocolDeclRule()); - } - add( - current, - "parameters", - lv_parameters_6_0, - "ParameterDecl"); - afterParserOrEnumRuleCall(); - - - } - - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2321:2: (otherlv_7= ',' ( (lv_parameters_8_0= ruleParameterDecl ) ) )* - loop40: - do { - int alt40=2; - int LA40_0 = input.LA(1); - - if ( (LA40_0==21) ) { - alt40=1; - } - - - switch (alt40) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2321:4: otherlv_7= ',' ( (lv_parameters_8_0= ruleParameterDecl ) ) - { - otherlv_7=(Token)match(input,21,FOLLOW_21_in_ruleLocalProtocolDecl4763); - - newLeafNode(otherlv_7, grammarAccess.getLocalProtocolDeclAccess().getCommaKeyword_5_2_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2325:1: ( (lv_parameters_8_0= ruleParameterDecl ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2326:1: (lv_parameters_8_0= ruleParameterDecl ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2326:1: (lv_parameters_8_0= ruleParameterDecl ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2327:3: lv_parameters_8_0= ruleParameterDecl - { - - newCompositeNode(grammarAccess.getLocalProtocolDeclAccess().getParametersParameterDeclParserRuleCall_5_2_1_0()); - - pushFollow(FOLLOW_ruleParameterDecl_in_ruleLocalProtocolDecl4784); - lv_parameters_8_0=ruleParameterDecl(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getLocalProtocolDeclRule()); - } - add( - current, - "parameters", - lv_parameters_8_0, - "ParameterDecl"); - afterParserOrEnumRuleCall(); - - - } - - - } - - - } - break; - - default : - break loop40; - } - } while (true); - - otherlv_9=(Token)match(input,19,FOLLOW_19_in_ruleLocalProtocolDecl4798); - - newLeafNode(otherlv_9, grammarAccess.getLocalProtocolDeclAccess().getGreaterThanSignKeyword_5_3()); - - - } - break; - - } - - otherlv_10=(Token)match(input,20,FOLLOW_20_in_ruleLocalProtocolDecl4812); - - newLeafNode(otherlv_10, grammarAccess.getLocalProtocolDeclAccess().getLeftParenthesisKeyword_6()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2351:1: ( (lv_roles_11_0= ruleRoleDecl ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2352:1: (lv_roles_11_0= ruleRoleDecl ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2352:1: (lv_roles_11_0= ruleRoleDecl ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2353:3: lv_roles_11_0= ruleRoleDecl - { - - newCompositeNode(grammarAccess.getLocalProtocolDeclAccess().getRolesRoleDeclParserRuleCall_7_0()); - - pushFollow(FOLLOW_ruleRoleDecl_in_ruleLocalProtocolDecl4833); - lv_roles_11_0=ruleRoleDecl(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getLocalProtocolDeclRule()); - } - add( - current, - "roles", - lv_roles_11_0, - "RoleDecl"); - afterParserOrEnumRuleCall(); - - - } - - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2369:2: (otherlv_12= ',' ( (lv_roles_13_0= ruleRoleDecl ) ) )* - loop42: - do { - int alt42=2; - int LA42_0 = input.LA(1); - - if ( (LA42_0==21) ) { - alt42=1; - } - - - switch (alt42) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2369:4: otherlv_12= ',' ( (lv_roles_13_0= ruleRoleDecl ) ) - { - otherlv_12=(Token)match(input,21,FOLLOW_21_in_ruleLocalProtocolDecl4846); - - newLeafNode(otherlv_12, grammarAccess.getLocalProtocolDeclAccess().getCommaKeyword_8_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2373:1: ( (lv_roles_13_0= ruleRoleDecl ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2374:1: (lv_roles_13_0= ruleRoleDecl ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2374:1: (lv_roles_13_0= ruleRoleDecl ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2375:3: lv_roles_13_0= ruleRoleDecl - { - - newCompositeNode(grammarAccess.getLocalProtocolDeclAccess().getRolesRoleDeclParserRuleCall_8_1_0()); - - pushFollow(FOLLOW_ruleRoleDecl_in_ruleLocalProtocolDecl4867); - lv_roles_13_0=ruleRoleDecl(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getLocalProtocolDeclRule()); - } - add( - current, - "roles", - lv_roles_13_0, - "RoleDecl"); - afterParserOrEnumRuleCall(); - - - } - - - } - - - } - break; - - default : - break loop42; - } - } while (true); - - otherlv_14=(Token)match(input,22,FOLLOW_22_in_ruleLocalProtocolDecl4881); - - newLeafNode(otherlv_14, grammarAccess.getLocalProtocolDeclAccess().getRightParenthesisKeyword_9()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2395:1: ( ( (lv_block_15_0= ruleLocalProtocolBlock ) ) | (otherlv_16= 'instantiates' ( (lv_instantiates_17_0= RULE_ID ) ) (otherlv_18= '<' ( (lv_arguments_19_0= ruleArgument ) ) (otherlv_20= ',' ( (lv_arguments_21_0= ruleArgument ) ) )* otherlv_22= '>' )? otherlv_23= '(' ( (lv_roleInstantiations_24_0= ruleRoleInstantiation ) ) (otherlv_25= ',' ( (lv_roleInstantiations_26_0= ruleRoleInstantiation ) ) )* otherlv_27= ')' otherlv_28= ';' ) ) - int alt46=2; - int LA46_0 = input.LA(1); - - if ( (LA46_0==29) ) { - alt46=1; - } - else if ( (LA46_0==26) ) { - alt46=2; - } - else { - NoViableAltException nvae = - new NoViableAltException("", 46, 0, input); - - throw nvae; - } - switch (alt46) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2395:2: ( (lv_block_15_0= ruleLocalProtocolBlock ) ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2395:2: ( (lv_block_15_0= ruleLocalProtocolBlock ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2396:1: (lv_block_15_0= ruleLocalProtocolBlock ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2396:1: (lv_block_15_0= ruleLocalProtocolBlock ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2397:3: lv_block_15_0= ruleLocalProtocolBlock - { - - newCompositeNode(grammarAccess.getLocalProtocolDeclAccess().getBlockLocalProtocolBlockParserRuleCall_10_0_0()); - - pushFollow(FOLLOW_ruleLocalProtocolBlock_in_ruleLocalProtocolDecl4903); - lv_block_15_0=ruleLocalProtocolBlock(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getLocalProtocolDeclRule()); - } - set( - current, - "block", - lv_block_15_0, - "LocalProtocolBlock"); - afterParserOrEnumRuleCall(); - - - } - - - } - - - } - break; - case 2 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2414:6: (otherlv_16= 'instantiates' ( (lv_instantiates_17_0= RULE_ID ) ) (otherlv_18= '<' ( (lv_arguments_19_0= ruleArgument ) ) (otherlv_20= ',' ( (lv_arguments_21_0= ruleArgument ) ) )* otherlv_22= '>' )? otherlv_23= '(' ( (lv_roleInstantiations_24_0= ruleRoleInstantiation ) ) (otherlv_25= ',' ( (lv_roleInstantiations_26_0= ruleRoleInstantiation ) ) )* otherlv_27= ')' otherlv_28= ';' ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2414:6: (otherlv_16= 'instantiates' ( (lv_instantiates_17_0= RULE_ID ) ) (otherlv_18= '<' ( (lv_arguments_19_0= ruleArgument ) ) (otherlv_20= ',' ( (lv_arguments_21_0= ruleArgument ) ) )* otherlv_22= '>' )? otherlv_23= '(' ( (lv_roleInstantiations_24_0= ruleRoleInstantiation ) ) (otherlv_25= ',' ( (lv_roleInstantiations_26_0= ruleRoleInstantiation ) ) )* otherlv_27= ')' otherlv_28= ';' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2414:8: otherlv_16= 'instantiates' ( (lv_instantiates_17_0= RULE_ID ) ) (otherlv_18= '<' ( (lv_arguments_19_0= ruleArgument ) ) (otherlv_20= ',' ( (lv_arguments_21_0= ruleArgument ) ) )* otherlv_22= '>' )? otherlv_23= '(' ( (lv_roleInstantiations_24_0= ruleRoleInstantiation ) ) (otherlv_25= ',' ( (lv_roleInstantiations_26_0= ruleRoleInstantiation ) ) )* otherlv_27= ')' otherlv_28= ';' - { - otherlv_16=(Token)match(input,26,FOLLOW_26_in_ruleLocalProtocolDecl4922); - - newLeafNode(otherlv_16, grammarAccess.getLocalProtocolDeclAccess().getInstantiatesKeyword_10_1_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2418:1: ( (lv_instantiates_17_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2419:1: (lv_instantiates_17_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2419:1: (lv_instantiates_17_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2420:3: lv_instantiates_17_0= RULE_ID - { - lv_instantiates_17_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleLocalProtocolDecl4939); - - newLeafNode(lv_instantiates_17_0, grammarAccess.getLocalProtocolDeclAccess().getInstantiatesIDTerminalRuleCall_10_1_1_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getLocalProtocolDeclRule()); - } - setWithLastConsumed( - current, - "instantiates", - lv_instantiates_17_0, - "ID"); - - - } - - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2436:2: (otherlv_18= '<' ( (lv_arguments_19_0= ruleArgument ) ) (otherlv_20= ',' ( (lv_arguments_21_0= ruleArgument ) ) )* otherlv_22= '>' )? - int alt44=2; - int LA44_0 = input.LA(1); - - if ( (LA44_0==18) ) { - alt44=1; - } - switch (alt44) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2436:4: otherlv_18= '<' ( (lv_arguments_19_0= ruleArgument ) ) (otherlv_20= ',' ( (lv_arguments_21_0= ruleArgument ) ) )* otherlv_22= '>' - { - otherlv_18=(Token)match(input,18,FOLLOW_18_in_ruleLocalProtocolDecl4957); - - newLeafNode(otherlv_18, grammarAccess.getLocalProtocolDeclAccess().getLessThanSignKeyword_10_1_2_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2440:1: ( (lv_arguments_19_0= ruleArgument ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2441:1: (lv_arguments_19_0= ruleArgument ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2441:1: (lv_arguments_19_0= ruleArgument ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2442:3: lv_arguments_19_0= ruleArgument - { - - newCompositeNode(grammarAccess.getLocalProtocolDeclAccess().getArgumentsArgumentParserRuleCall_10_1_2_1_0()); - - pushFollow(FOLLOW_ruleArgument_in_ruleLocalProtocolDecl4978); - lv_arguments_19_0=ruleArgument(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getLocalProtocolDeclRule()); - } - add( - current, - "arguments", - lv_arguments_19_0, - "Argument"); - afterParserOrEnumRuleCall(); - - - } - - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2458:2: (otherlv_20= ',' ( (lv_arguments_21_0= ruleArgument ) ) )* - loop43: - do { - int alt43=2; - int LA43_0 = input.LA(1); - - if ( (LA43_0==21) ) { - alt43=1; - } - - - switch (alt43) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2458:4: otherlv_20= ',' ( (lv_arguments_21_0= ruleArgument ) ) - { - otherlv_20=(Token)match(input,21,FOLLOW_21_in_ruleLocalProtocolDecl4991); - - newLeafNode(otherlv_20, grammarAccess.getLocalProtocolDeclAccess().getCommaKeyword_10_1_2_2_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2462:1: ( (lv_arguments_21_0= ruleArgument ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2463:1: (lv_arguments_21_0= ruleArgument ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2463:1: (lv_arguments_21_0= ruleArgument ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2464:3: lv_arguments_21_0= ruleArgument - { - - newCompositeNode(grammarAccess.getLocalProtocolDeclAccess().getArgumentsArgumentParserRuleCall_10_1_2_2_1_0()); - - pushFollow(FOLLOW_ruleArgument_in_ruleLocalProtocolDecl5012); - lv_arguments_21_0=ruleArgument(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getLocalProtocolDeclRule()); - } - add( - current, - "arguments", - lv_arguments_21_0, - "Argument"); - afterParserOrEnumRuleCall(); - - - } - - - } - - - } - break; - - default : - break loop43; - } - } while (true); - - otherlv_22=(Token)match(input,19,FOLLOW_19_in_ruleLocalProtocolDecl5026); - - newLeafNode(otherlv_22, grammarAccess.getLocalProtocolDeclAccess().getGreaterThanSignKeyword_10_1_2_3()); - - - } - break; - - } - - otherlv_23=(Token)match(input,20,FOLLOW_20_in_ruleLocalProtocolDecl5040); - - newLeafNode(otherlv_23, grammarAccess.getLocalProtocolDeclAccess().getLeftParenthesisKeyword_10_1_3()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2488:1: ( (lv_roleInstantiations_24_0= ruleRoleInstantiation ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2489:1: (lv_roleInstantiations_24_0= ruleRoleInstantiation ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2489:1: (lv_roleInstantiations_24_0= ruleRoleInstantiation ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2490:3: lv_roleInstantiations_24_0= ruleRoleInstantiation - { - - newCompositeNode(grammarAccess.getLocalProtocolDeclAccess().getRoleInstantiationsRoleInstantiationParserRuleCall_10_1_4_0()); - - pushFollow(FOLLOW_ruleRoleInstantiation_in_ruleLocalProtocolDecl5061); - lv_roleInstantiations_24_0=ruleRoleInstantiation(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getLocalProtocolDeclRule()); - } - add( - current, - "roleInstantiations", - lv_roleInstantiations_24_0, - "RoleInstantiation"); - afterParserOrEnumRuleCall(); - - - } - - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2506:2: (otherlv_25= ',' ( (lv_roleInstantiations_26_0= ruleRoleInstantiation ) ) )* - loop45: - do { - int alt45=2; - int LA45_0 = input.LA(1); - - if ( (LA45_0==21) ) { - alt45=1; - } - - - switch (alt45) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2506:4: otherlv_25= ',' ( (lv_roleInstantiations_26_0= ruleRoleInstantiation ) ) - { - otherlv_25=(Token)match(input,21,FOLLOW_21_in_ruleLocalProtocolDecl5074); - - newLeafNode(otherlv_25, grammarAccess.getLocalProtocolDeclAccess().getCommaKeyword_10_1_5_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2510:1: ( (lv_roleInstantiations_26_0= ruleRoleInstantiation ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2511:1: (lv_roleInstantiations_26_0= ruleRoleInstantiation ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2511:1: (lv_roleInstantiations_26_0= ruleRoleInstantiation ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2512:3: lv_roleInstantiations_26_0= ruleRoleInstantiation - { - - newCompositeNode(grammarAccess.getLocalProtocolDeclAccess().getRoleInstantiationsRoleInstantiationParserRuleCall_10_1_5_1_0()); - - pushFollow(FOLLOW_ruleRoleInstantiation_in_ruleLocalProtocolDecl5095); - lv_roleInstantiations_26_0=ruleRoleInstantiation(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getLocalProtocolDeclRule()); - } - add( - current, - "roleInstantiations", - lv_roleInstantiations_26_0, - "RoleInstantiation"); - afterParserOrEnumRuleCall(); - - - } - - - } - - - } - break; - - default : - break loop45; - } - } while (true); - - otherlv_27=(Token)match(input,22,FOLLOW_22_in_ruleLocalProtocolDecl5109); - - newLeafNode(otherlv_27, grammarAccess.getLocalProtocolDeclAccess().getRightParenthesisKeyword_10_1_6()); - - otherlv_28=(Token)match(input,12,FOLLOW_12_in_ruleLocalProtocolDecl5121); - - newLeafNode(otherlv_28, grammarAccess.getLocalProtocolDeclAccess().getSemicolonKeyword_10_1_7()); - - - } - - - } - break; - - } - - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleLocalProtocolDecl" - - - // $ANTLR start "entryRuleLocalProtocolBlock" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2544:1: entryRuleLocalProtocolBlock returns [EObject current=null] : iv_ruleLocalProtocolBlock= ruleLocalProtocolBlock EOF ; - public final EObject entryRuleLocalProtocolBlock() throws RecognitionException { - EObject current = null; - - EObject iv_ruleLocalProtocolBlock = null; - - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2545:2: (iv_ruleLocalProtocolBlock= ruleLocalProtocolBlock EOF ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2546:2: iv_ruleLocalProtocolBlock= ruleLocalProtocolBlock EOF - { - newCompositeNode(grammarAccess.getLocalProtocolBlockRule()); - pushFollow(FOLLOW_ruleLocalProtocolBlock_in_entryRuleLocalProtocolBlock5159); - iv_ruleLocalProtocolBlock=ruleLocalProtocolBlock(); - - state._fsp--; - - current =iv_ruleLocalProtocolBlock; - match(input,EOF,FOLLOW_EOF_in_entryRuleLocalProtocolBlock5169); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleLocalProtocolBlock" - - - // $ANTLR start "ruleLocalProtocolBlock" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2553:1: ruleLocalProtocolBlock returns [EObject current=null] : ( () otherlv_1= '{' ( (lv_activities_2_0= ruleLlobalInteraction ) )* otherlv_3= '}' ) ; - public final EObject ruleLocalProtocolBlock() throws RecognitionException { - EObject current = null; - - Token otherlv_1=null; - Token otherlv_3=null; - EObject lv_activities_2_0 = null; - - - enterRule(); - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2556:28: ( ( () otherlv_1= '{' ( (lv_activities_2_0= ruleLlobalInteraction ) )* otherlv_3= '}' ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2557:1: ( () otherlv_1= '{' ( (lv_activities_2_0= ruleLlobalInteraction ) )* otherlv_3= '}' ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2557:1: ( () otherlv_1= '{' ( (lv_activities_2_0= ruleLlobalInteraction ) )* otherlv_3= '}' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2557:2: () otherlv_1= '{' ( (lv_activities_2_0= ruleLlobalInteraction ) )* otherlv_3= '}' - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2557:2: () - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2558:5: - { - - current = forceCreateModelElement( - grammarAccess.getLocalProtocolBlockAccess().getLocalProtocolBlockAction_0(), - current); - - - } - - otherlv_1=(Token)match(input,29,FOLLOW_29_in_ruleLocalProtocolBlock5215); - - newLeafNode(otherlv_1, grammarAccess.getLocalProtocolBlockAccess().getLeftCurlyBracketKeyword_1()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2567:1: ( (lv_activities_2_0= ruleLlobalInteraction ) )* - loop47: - do { - int alt47=2; - int LA47_0 = input.LA(1); - - if ( (LA47_0==RULE_ID||LA47_0==20||LA47_0==32||(LA47_0>=35 && LA47_0<=37)||LA47_0==39||LA47_0==42) ) { - alt47=1; - } - - - switch (alt47) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2568:1: (lv_activities_2_0= ruleLlobalInteraction ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2568:1: (lv_activities_2_0= ruleLlobalInteraction ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2569:3: lv_activities_2_0= ruleLlobalInteraction - { - - newCompositeNode(grammarAccess.getLocalProtocolBlockAccess().getActivitiesLlobalInteractionParserRuleCall_2_0()); - - pushFollow(FOLLOW_ruleLlobalInteraction_in_ruleLocalProtocolBlock5236); - lv_activities_2_0=ruleLlobalInteraction(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getLocalProtocolBlockRule()); - } - add( - current, - "activities", - lv_activities_2_0, - "LlobalInteraction"); - afterParserOrEnumRuleCall(); - - - } - - - } - break; - - default : - break loop47; - } - } while (true); - - otherlv_3=(Token)match(input,30,FOLLOW_30_in_ruleLocalProtocolBlock5249); - - newLeafNode(otherlv_3, grammarAccess.getLocalProtocolBlockAccess().getRightCurlyBracketKeyword_3()); - - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleLocalProtocolBlock" - - - // $ANTLR start "entryRuleLlobalInteraction" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2597:1: entryRuleLlobalInteraction returns [EObject current=null] : iv_ruleLlobalInteraction= ruleLlobalInteraction EOF ; - public final EObject entryRuleLlobalInteraction() throws RecognitionException { - EObject current = null; - - EObject iv_ruleLlobalInteraction = null; - - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2598:2: (iv_ruleLlobalInteraction= ruleLlobalInteraction EOF ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2599:2: iv_ruleLlobalInteraction= ruleLlobalInteraction EOF - { - newCompositeNode(grammarAccess.getLlobalInteractionRule()); - pushFollow(FOLLOW_ruleLlobalInteraction_in_entryRuleLlobalInteraction5285); - iv_ruleLlobalInteraction=ruleLlobalInteraction(); - - state._fsp--; - - current =iv_ruleLlobalInteraction; - match(input,EOF,FOLLOW_EOF_in_entryRuleLlobalInteraction5295); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleLlobalInteraction" - - - // $ANTLR start "ruleLlobalInteraction" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2606:1: ruleLlobalInteraction returns [EObject current=null] : (this_LocalSend_0= ruleLocalSend | this_LocalReceive_1= ruleLocalReceive | this_LocalChoice_2= ruleLocalChoice | this_LocalParallel_3= ruleLocalParallel | this_LocalRecursion_4= ruleLocalRecursion | this_LocalContinue_5= ruleLocalContinue | this_LocalInterruptible_6= ruleLocalInterruptible | this_LocalDo_7= ruleLocalDo ) ; - public final EObject ruleLlobalInteraction() throws RecognitionException { - EObject current = null; - - EObject this_LocalSend_0 = null; - - EObject this_LocalReceive_1 = null; - - EObject this_LocalChoice_2 = null; - - EObject this_LocalParallel_3 = null; - - EObject this_LocalRecursion_4 = null; - - EObject this_LocalContinue_5 = null; - - EObject this_LocalInterruptible_6 = null; - - EObject this_LocalDo_7 = null; - - - enterRule(); - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2609:28: ( (this_LocalSend_0= ruleLocalSend | this_LocalReceive_1= ruleLocalReceive | this_LocalChoice_2= ruleLocalChoice | this_LocalParallel_3= ruleLocalParallel | this_LocalRecursion_4= ruleLocalRecursion | this_LocalContinue_5= ruleLocalContinue | this_LocalInterruptible_6= ruleLocalInterruptible | this_LocalDo_7= ruleLocalDo ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2610:1: (this_LocalSend_0= ruleLocalSend | this_LocalReceive_1= ruleLocalReceive | this_LocalChoice_2= ruleLocalChoice | this_LocalParallel_3= ruleLocalParallel | this_LocalRecursion_4= ruleLocalRecursion | this_LocalContinue_5= ruleLocalContinue | this_LocalInterruptible_6= ruleLocalInterruptible | this_LocalDo_7= ruleLocalDo ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2610:1: (this_LocalSend_0= ruleLocalSend | this_LocalReceive_1= ruleLocalReceive | this_LocalChoice_2= ruleLocalChoice | this_LocalParallel_3= ruleLocalParallel | this_LocalRecursion_4= ruleLocalRecursion | this_LocalContinue_5= ruleLocalContinue | this_LocalInterruptible_6= ruleLocalInterruptible | this_LocalDo_7= ruleLocalDo ) - int alt48=8; - alt48 = dfa48.predict(input); - switch (alt48) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2611:5: this_LocalSend_0= ruleLocalSend - { - - newCompositeNode(grammarAccess.getLlobalInteractionAccess().getLocalSendParserRuleCall_0()); - - pushFollow(FOLLOW_ruleLocalSend_in_ruleLlobalInteraction5342); - this_LocalSend_0=ruleLocalSend(); - - state._fsp--; - - - current = this_LocalSend_0; - afterParserOrEnumRuleCall(); - - - } - break; - case 2 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2621:5: this_LocalReceive_1= ruleLocalReceive - { - - newCompositeNode(grammarAccess.getLlobalInteractionAccess().getLocalReceiveParserRuleCall_1()); - - pushFollow(FOLLOW_ruleLocalReceive_in_ruleLlobalInteraction5369); - this_LocalReceive_1=ruleLocalReceive(); - - state._fsp--; - - - current = this_LocalReceive_1; - afterParserOrEnumRuleCall(); - - - } - break; - case 3 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2631:5: this_LocalChoice_2= ruleLocalChoice - { - - newCompositeNode(grammarAccess.getLlobalInteractionAccess().getLocalChoiceParserRuleCall_2()); - - pushFollow(FOLLOW_ruleLocalChoice_in_ruleLlobalInteraction5396); - this_LocalChoice_2=ruleLocalChoice(); - - state._fsp--; - - - current = this_LocalChoice_2; - afterParserOrEnumRuleCall(); - - - } - break; - case 4 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2641:5: this_LocalParallel_3= ruleLocalParallel - { - - newCompositeNode(grammarAccess.getLlobalInteractionAccess().getLocalParallelParserRuleCall_3()); - - pushFollow(FOLLOW_ruleLocalParallel_in_ruleLlobalInteraction5423); - this_LocalParallel_3=ruleLocalParallel(); - - state._fsp--; - - - current = this_LocalParallel_3; - afterParserOrEnumRuleCall(); - - - } - break; - case 5 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2651:5: this_LocalRecursion_4= ruleLocalRecursion - { - - newCompositeNode(grammarAccess.getLlobalInteractionAccess().getLocalRecursionParserRuleCall_4()); - - pushFollow(FOLLOW_ruleLocalRecursion_in_ruleLlobalInteraction5450); - this_LocalRecursion_4=ruleLocalRecursion(); - - state._fsp--; - - - current = this_LocalRecursion_4; - afterParserOrEnumRuleCall(); - - - } - break; - case 6 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2661:5: this_LocalContinue_5= ruleLocalContinue - { - - newCompositeNode(grammarAccess.getLlobalInteractionAccess().getLocalContinueParserRuleCall_5()); - - pushFollow(FOLLOW_ruleLocalContinue_in_ruleLlobalInteraction5477); - this_LocalContinue_5=ruleLocalContinue(); - - state._fsp--; - - - current = this_LocalContinue_5; - afterParserOrEnumRuleCall(); - - - } - break; - case 7 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2671:5: this_LocalInterruptible_6= ruleLocalInterruptible - { - - newCompositeNode(grammarAccess.getLlobalInteractionAccess().getLocalInterruptibleParserRuleCall_6()); - - pushFollow(FOLLOW_ruleLocalInterruptible_in_ruleLlobalInteraction5504); - this_LocalInterruptible_6=ruleLocalInterruptible(); - - state._fsp--; - - - current = this_LocalInterruptible_6; - afterParserOrEnumRuleCall(); - - - } - break; - case 8 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2681:5: this_LocalDo_7= ruleLocalDo - { - - newCompositeNode(grammarAccess.getLlobalInteractionAccess().getLocalDoParserRuleCall_7()); - - pushFollow(FOLLOW_ruleLocalDo_in_ruleLlobalInteraction5531); - this_LocalDo_7=ruleLocalDo(); - - state._fsp--; - - - current = this_LocalDo_7; - afterParserOrEnumRuleCall(); - - - } - break; - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleLlobalInteraction" - - - // $ANTLR start "entryRuleLocalSend" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2697:1: entryRuleLocalSend returns [EObject current=null] : iv_ruleLocalSend= ruleLocalSend EOF ; - public final EObject entryRuleLocalSend() throws RecognitionException { - EObject current = null; - - EObject iv_ruleLocalSend = null; - - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2698:2: (iv_ruleLocalSend= ruleLocalSend EOF ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2699:2: iv_ruleLocalSend= ruleLocalSend EOF - { - newCompositeNode(grammarAccess.getLocalSendRule()); - pushFollow(FOLLOW_ruleLocalSend_in_entryRuleLocalSend5566); - iv_ruleLocalSend=ruleLocalSend(); - - state._fsp--; - - current =iv_ruleLocalSend; - match(input,EOF,FOLLOW_EOF_in_entryRuleLocalSend5576); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleLocalSend" - - - // $ANTLR start "ruleLocalSend" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2706:1: ruleLocalSend returns [EObject current=null] : ( ( (lv_message_0_0= ruleMessage ) ) otherlv_1= 'to' ( (lv_toRoles_2_0= RULE_ID ) ) (otherlv_3= ',' ( (lv_toRoles_4_0= RULE_ID ) ) )* otherlv_5= ';' ) ; - public final EObject ruleLocalSend() throws RecognitionException { - EObject current = null; - - Token otherlv_1=null; - Token lv_toRoles_2_0=null; - Token otherlv_3=null; - Token lv_toRoles_4_0=null; - Token otherlv_5=null; - EObject lv_message_0_0 = null; - - - enterRule(); - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2709:28: ( ( ( (lv_message_0_0= ruleMessage ) ) otherlv_1= 'to' ( (lv_toRoles_2_0= RULE_ID ) ) (otherlv_3= ',' ( (lv_toRoles_4_0= RULE_ID ) ) )* otherlv_5= ';' ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2710:1: ( ( (lv_message_0_0= ruleMessage ) ) otherlv_1= 'to' ( (lv_toRoles_2_0= RULE_ID ) ) (otherlv_3= ',' ( (lv_toRoles_4_0= RULE_ID ) ) )* otherlv_5= ';' ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2710:1: ( ( (lv_message_0_0= ruleMessage ) ) otherlv_1= 'to' ( (lv_toRoles_2_0= RULE_ID ) ) (otherlv_3= ',' ( (lv_toRoles_4_0= RULE_ID ) ) )* otherlv_5= ';' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2710:2: ( (lv_message_0_0= ruleMessage ) ) otherlv_1= 'to' ( (lv_toRoles_2_0= RULE_ID ) ) (otherlv_3= ',' ( (lv_toRoles_4_0= RULE_ID ) ) )* otherlv_5= ';' - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2710:2: ( (lv_message_0_0= ruleMessage ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2711:1: (lv_message_0_0= ruleMessage ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2711:1: (lv_message_0_0= ruleMessage ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2712:3: lv_message_0_0= ruleMessage - { - - newCompositeNode(grammarAccess.getLocalSendAccess().getMessageMessageParserRuleCall_0_0()); - - pushFollow(FOLLOW_ruleMessage_in_ruleLocalSend5622); - lv_message_0_0=ruleMessage(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getLocalSendRule()); - } - set( - current, - "message", - lv_message_0_0, - "Message"); - afterParserOrEnumRuleCall(); - - - } - - - } - - otherlv_1=(Token)match(input,31,FOLLOW_31_in_ruleLocalSend5634); - - newLeafNode(otherlv_1, grammarAccess.getLocalSendAccess().getToKeyword_1()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2732:1: ( (lv_toRoles_2_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2733:1: (lv_toRoles_2_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2733:1: (lv_toRoles_2_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2734:3: lv_toRoles_2_0= RULE_ID - { - lv_toRoles_2_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleLocalSend5651); - - newLeafNode(lv_toRoles_2_0, grammarAccess.getLocalSendAccess().getToRolesIDTerminalRuleCall_2_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getLocalSendRule()); - } - addWithLastConsumed( - current, - "toRoles", - lv_toRoles_2_0, - "ID"); - - - } - - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2750:2: (otherlv_3= ',' ( (lv_toRoles_4_0= RULE_ID ) ) )* - loop49: - do { - int alt49=2; - int LA49_0 = input.LA(1); - - if ( (LA49_0==21) ) { - alt49=1; - } - - - switch (alt49) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2750:4: otherlv_3= ',' ( (lv_toRoles_4_0= RULE_ID ) ) - { - otherlv_3=(Token)match(input,21,FOLLOW_21_in_ruleLocalSend5669); - - newLeafNode(otherlv_3, grammarAccess.getLocalSendAccess().getCommaKeyword_3_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2754:1: ( (lv_toRoles_4_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2755:1: (lv_toRoles_4_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2755:1: (lv_toRoles_4_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2756:3: lv_toRoles_4_0= RULE_ID - { - lv_toRoles_4_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleLocalSend5686); - - newLeafNode(lv_toRoles_4_0, grammarAccess.getLocalSendAccess().getToRolesIDTerminalRuleCall_3_1_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getLocalSendRule()); - } - addWithLastConsumed( - current, - "toRoles", - lv_toRoles_4_0, - "ID"); - - - } - - - } - - - } - break; - - default : - break loop49; - } - } while (true); - - otherlv_5=(Token)match(input,12,FOLLOW_12_in_ruleLocalSend5705); - - newLeafNode(otherlv_5, grammarAccess.getLocalSendAccess().getSemicolonKeyword_4()); - - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleLocalSend" - - - // $ANTLR start "entryRuleLocalReceive" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2784:1: entryRuleLocalReceive returns [EObject current=null] : iv_ruleLocalReceive= ruleLocalReceive EOF ; - public final EObject entryRuleLocalReceive() throws RecognitionException { - EObject current = null; - - EObject iv_ruleLocalReceive = null; - - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2785:2: (iv_ruleLocalReceive= ruleLocalReceive EOF ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2786:2: iv_ruleLocalReceive= ruleLocalReceive EOF - { - newCompositeNode(grammarAccess.getLocalReceiveRule()); - pushFollow(FOLLOW_ruleLocalReceive_in_entryRuleLocalReceive5741); - iv_ruleLocalReceive=ruleLocalReceive(); - - state._fsp--; - - current =iv_ruleLocalReceive; - match(input,EOF,FOLLOW_EOF_in_entryRuleLocalReceive5751); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleLocalReceive" - - - // $ANTLR start "ruleLocalReceive" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2793:1: ruleLocalReceive returns [EObject current=null] : ( ( (lv_message_0_0= ruleMessage ) ) otherlv_1= 'from' ( (lv_fromRole_2_0= RULE_ID ) ) otherlv_3= ';' ) ; - public final EObject ruleLocalReceive() throws RecognitionException { - EObject current = null; - - Token otherlv_1=null; - Token lv_fromRole_2_0=null; - Token otherlv_3=null; - EObject lv_message_0_0 = null; - - - enterRule(); - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2796:28: ( ( ( (lv_message_0_0= ruleMessage ) ) otherlv_1= 'from' ( (lv_fromRole_2_0= RULE_ID ) ) otherlv_3= ';' ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2797:1: ( ( (lv_message_0_0= ruleMessage ) ) otherlv_1= 'from' ( (lv_fromRole_2_0= RULE_ID ) ) otherlv_3= ';' ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2797:1: ( ( (lv_message_0_0= ruleMessage ) ) otherlv_1= 'from' ( (lv_fromRole_2_0= RULE_ID ) ) otherlv_3= ';' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2797:2: ( (lv_message_0_0= ruleMessage ) ) otherlv_1= 'from' ( (lv_fromRole_2_0= RULE_ID ) ) otherlv_3= ';' - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2797:2: ( (lv_message_0_0= ruleMessage ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2798:1: (lv_message_0_0= ruleMessage ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2798:1: (lv_message_0_0= ruleMessage ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2799:3: lv_message_0_0= ruleMessage - { - - newCompositeNode(grammarAccess.getLocalReceiveAccess().getMessageMessageParserRuleCall_0_0()); - - pushFollow(FOLLOW_ruleMessage_in_ruleLocalReceive5797); - lv_message_0_0=ruleMessage(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getLocalReceiveRule()); - } - set( - current, - "message", - lv_message_0_0, - "Message"); - afterParserOrEnumRuleCall(); - - - } - - - } - - otherlv_1=(Token)match(input,16,FOLLOW_16_in_ruleLocalReceive5809); - - newLeafNode(otherlv_1, grammarAccess.getLocalReceiveAccess().getFromKeyword_1()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2819:1: ( (lv_fromRole_2_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2820:1: (lv_fromRole_2_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2820:1: (lv_fromRole_2_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2821:3: lv_fromRole_2_0= RULE_ID - { - lv_fromRole_2_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleLocalReceive5826); - - newLeafNode(lv_fromRole_2_0, grammarAccess.getLocalReceiveAccess().getFromRoleIDTerminalRuleCall_2_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getLocalReceiveRule()); - } - setWithLastConsumed( - current, - "fromRole", - lv_fromRole_2_0, - "ID"); - - - } - - - } - - otherlv_3=(Token)match(input,12,FOLLOW_12_in_ruleLocalReceive5843); - - newLeafNode(otherlv_3, grammarAccess.getLocalReceiveAccess().getSemicolonKeyword_3()); - - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleLocalReceive" - - - // $ANTLR start "entryRuleLocalChoice" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2849:1: entryRuleLocalChoice returns [EObject current=null] : iv_ruleLocalChoice= ruleLocalChoice EOF ; - public final EObject entryRuleLocalChoice() throws RecognitionException { - EObject current = null; - - EObject iv_ruleLocalChoice = null; - - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2850:2: (iv_ruleLocalChoice= ruleLocalChoice EOF ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2851:2: iv_ruleLocalChoice= ruleLocalChoice EOF - { - newCompositeNode(grammarAccess.getLocalChoiceRule()); - pushFollow(FOLLOW_ruleLocalChoice_in_entryRuleLocalChoice5879); - iv_ruleLocalChoice=ruleLocalChoice(); - - state._fsp--; - - current =iv_ruleLocalChoice; - match(input,EOF,FOLLOW_EOF_in_entryRuleLocalChoice5889); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleLocalChoice" - - - // $ANTLR start "ruleLocalChoice" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2858:1: ruleLocalChoice returns [EObject current=null] : (otherlv_0= 'choice' otherlv_1= 'at' ( (lv_role_2_0= RULE_ID ) ) ( (lv_blocks_3_0= ruleLocalProtocolBlock ) ) (otherlv_4= 'or' ( (lv_blocks_5_0= ruleLocalProtocolBlock ) ) )* ) ; - public final EObject ruleLocalChoice() throws RecognitionException { - EObject current = null; - - Token otherlv_0=null; - Token otherlv_1=null; - Token lv_role_2_0=null; - Token otherlv_4=null; - EObject lv_blocks_3_0 = null; - - EObject lv_blocks_5_0 = null; - - - enterRule(); - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2861:28: ( (otherlv_0= 'choice' otherlv_1= 'at' ( (lv_role_2_0= RULE_ID ) ) ( (lv_blocks_3_0= ruleLocalProtocolBlock ) ) (otherlv_4= 'or' ( (lv_blocks_5_0= ruleLocalProtocolBlock ) ) )* ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2862:1: (otherlv_0= 'choice' otherlv_1= 'at' ( (lv_role_2_0= RULE_ID ) ) ( (lv_blocks_3_0= ruleLocalProtocolBlock ) ) (otherlv_4= 'or' ( (lv_blocks_5_0= ruleLocalProtocolBlock ) ) )* ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2862:1: (otherlv_0= 'choice' otherlv_1= 'at' ( (lv_role_2_0= RULE_ID ) ) ( (lv_blocks_3_0= ruleLocalProtocolBlock ) ) (otherlv_4= 'or' ( (lv_blocks_5_0= ruleLocalProtocolBlock ) ) )* ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2862:3: otherlv_0= 'choice' otherlv_1= 'at' ( (lv_role_2_0= RULE_ID ) ) ( (lv_blocks_3_0= ruleLocalProtocolBlock ) ) (otherlv_4= 'or' ( (lv_blocks_5_0= ruleLocalProtocolBlock ) ) )* - { - otherlv_0=(Token)match(input,32,FOLLOW_32_in_ruleLocalChoice5926); - - newLeafNode(otherlv_0, grammarAccess.getLocalChoiceAccess().getChoiceKeyword_0()); - - otherlv_1=(Token)match(input,33,FOLLOW_33_in_ruleLocalChoice5938); - - newLeafNode(otherlv_1, grammarAccess.getLocalChoiceAccess().getAtKeyword_1()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2870:1: ( (lv_role_2_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2871:1: (lv_role_2_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2871:1: (lv_role_2_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2872:3: lv_role_2_0= RULE_ID - { - lv_role_2_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleLocalChoice5955); - - newLeafNode(lv_role_2_0, grammarAccess.getLocalChoiceAccess().getRoleIDTerminalRuleCall_2_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getLocalChoiceRule()); - } - setWithLastConsumed( - current, - "role", - lv_role_2_0, - "ID"); - - - } - - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2888:2: ( (lv_blocks_3_0= ruleLocalProtocolBlock ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2889:1: (lv_blocks_3_0= ruleLocalProtocolBlock ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2889:1: (lv_blocks_3_0= ruleLocalProtocolBlock ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2890:3: lv_blocks_3_0= ruleLocalProtocolBlock - { - - newCompositeNode(grammarAccess.getLocalChoiceAccess().getBlocksLocalProtocolBlockParserRuleCall_3_0()); - - pushFollow(FOLLOW_ruleLocalProtocolBlock_in_ruleLocalChoice5981); - lv_blocks_3_0=ruleLocalProtocolBlock(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getLocalChoiceRule()); - } - add( - current, - "blocks", - lv_blocks_3_0, - "LocalProtocolBlock"); - afterParserOrEnumRuleCall(); - - - } - - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2906:2: (otherlv_4= 'or' ( (lv_blocks_5_0= ruleLocalProtocolBlock ) ) )* - loop50: - do { - int alt50=2; - int LA50_0 = input.LA(1); - - if ( (LA50_0==34) ) { - alt50=1; - } - - - switch (alt50) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2906:4: otherlv_4= 'or' ( (lv_blocks_5_0= ruleLocalProtocolBlock ) ) - { - otherlv_4=(Token)match(input,34,FOLLOW_34_in_ruleLocalChoice5994); - - newLeafNode(otherlv_4, grammarAccess.getLocalChoiceAccess().getOrKeyword_4_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2910:1: ( (lv_blocks_5_0= ruleLocalProtocolBlock ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2911:1: (lv_blocks_5_0= ruleLocalProtocolBlock ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2911:1: (lv_blocks_5_0= ruleLocalProtocolBlock ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2912:3: lv_blocks_5_0= ruleLocalProtocolBlock - { - - newCompositeNode(grammarAccess.getLocalChoiceAccess().getBlocksLocalProtocolBlockParserRuleCall_4_1_0()); - - pushFollow(FOLLOW_ruleLocalProtocolBlock_in_ruleLocalChoice6015); - lv_blocks_5_0=ruleLocalProtocolBlock(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getLocalChoiceRule()); - } - add( - current, - "blocks", - lv_blocks_5_0, - "LocalProtocolBlock"); - afterParserOrEnumRuleCall(); - - - } - - - } - - - } - break; - - default : - break loop50; - } - } while (true); - - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleLocalChoice" - - - // $ANTLR start "entryRuleLocalRecursion" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2936:1: entryRuleLocalRecursion returns [EObject current=null] : iv_ruleLocalRecursion= ruleLocalRecursion EOF ; - public final EObject entryRuleLocalRecursion() throws RecognitionException { - EObject current = null; - - EObject iv_ruleLocalRecursion = null; - - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2937:2: (iv_ruleLocalRecursion= ruleLocalRecursion EOF ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2938:2: iv_ruleLocalRecursion= ruleLocalRecursion EOF - { - newCompositeNode(grammarAccess.getLocalRecursionRule()); - pushFollow(FOLLOW_ruleLocalRecursion_in_entryRuleLocalRecursion6053); - iv_ruleLocalRecursion=ruleLocalRecursion(); - - state._fsp--; - - current =iv_ruleLocalRecursion; - match(input,EOF,FOLLOW_EOF_in_entryRuleLocalRecursion6063); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleLocalRecursion" - - - // $ANTLR start "ruleLocalRecursion" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2945:1: ruleLocalRecursion returns [EObject current=null] : (otherlv_0= 'rec' ( (lv_label_1_0= RULE_ID ) ) ( (lv_block_2_0= ruleLocalProtocolBlock ) ) ) ; - public final EObject ruleLocalRecursion() throws RecognitionException { - EObject current = null; - - Token otherlv_0=null; - Token lv_label_1_0=null; - EObject lv_block_2_0 = null; - - - enterRule(); - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2948:28: ( (otherlv_0= 'rec' ( (lv_label_1_0= RULE_ID ) ) ( (lv_block_2_0= ruleLocalProtocolBlock ) ) ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2949:1: (otherlv_0= 'rec' ( (lv_label_1_0= RULE_ID ) ) ( (lv_block_2_0= ruleLocalProtocolBlock ) ) ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2949:1: (otherlv_0= 'rec' ( (lv_label_1_0= RULE_ID ) ) ( (lv_block_2_0= ruleLocalProtocolBlock ) ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2949:3: otherlv_0= 'rec' ( (lv_label_1_0= RULE_ID ) ) ( (lv_block_2_0= ruleLocalProtocolBlock ) ) - { - otherlv_0=(Token)match(input,35,FOLLOW_35_in_ruleLocalRecursion6100); - - newLeafNode(otherlv_0, grammarAccess.getLocalRecursionAccess().getRecKeyword_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2953:1: ( (lv_label_1_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2954:1: (lv_label_1_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2954:1: (lv_label_1_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2955:3: lv_label_1_0= RULE_ID - { - lv_label_1_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleLocalRecursion6117); - - newLeafNode(lv_label_1_0, grammarAccess.getLocalRecursionAccess().getLabelIDTerminalRuleCall_1_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getLocalRecursionRule()); - } - setWithLastConsumed( - current, - "label", - lv_label_1_0, - "ID"); - - - } - - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2971:2: ( (lv_block_2_0= ruleLocalProtocolBlock ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2972:1: (lv_block_2_0= ruleLocalProtocolBlock ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2972:1: (lv_block_2_0= ruleLocalProtocolBlock ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2973:3: lv_block_2_0= ruleLocalProtocolBlock - { - - newCompositeNode(grammarAccess.getLocalRecursionAccess().getBlockLocalProtocolBlockParserRuleCall_2_0()); - - pushFollow(FOLLOW_ruleLocalProtocolBlock_in_ruleLocalRecursion6143); - lv_block_2_0=ruleLocalProtocolBlock(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getLocalRecursionRule()); - } - set( - current, - "block", - lv_block_2_0, - "LocalProtocolBlock"); - afterParserOrEnumRuleCall(); - - - } - - - } - - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleLocalRecursion" - - - // $ANTLR start "entryRuleLocalContinue" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2997:1: entryRuleLocalContinue returns [EObject current=null] : iv_ruleLocalContinue= ruleLocalContinue EOF ; - public final EObject entryRuleLocalContinue() throws RecognitionException { - EObject current = null; - - EObject iv_ruleLocalContinue = null; - - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2998:2: (iv_ruleLocalContinue= ruleLocalContinue EOF ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:2999:2: iv_ruleLocalContinue= ruleLocalContinue EOF - { - newCompositeNode(grammarAccess.getLocalContinueRule()); - pushFollow(FOLLOW_ruleLocalContinue_in_entryRuleLocalContinue6179); - iv_ruleLocalContinue=ruleLocalContinue(); - - state._fsp--; - - current =iv_ruleLocalContinue; - match(input,EOF,FOLLOW_EOF_in_entryRuleLocalContinue6189); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleLocalContinue" - - - // $ANTLR start "ruleLocalContinue" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3006:1: ruleLocalContinue returns [EObject current=null] : (otherlv_0= 'continue' ( (lv_label_1_0= RULE_ID ) ) otherlv_2= ';' ) ; - public final EObject ruleLocalContinue() throws RecognitionException { - EObject current = null; - - Token otherlv_0=null; - Token lv_label_1_0=null; - Token otherlv_2=null; - - enterRule(); - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3009:28: ( (otherlv_0= 'continue' ( (lv_label_1_0= RULE_ID ) ) otherlv_2= ';' ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3010:1: (otherlv_0= 'continue' ( (lv_label_1_0= RULE_ID ) ) otherlv_2= ';' ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3010:1: (otherlv_0= 'continue' ( (lv_label_1_0= RULE_ID ) ) otherlv_2= ';' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3010:3: otherlv_0= 'continue' ( (lv_label_1_0= RULE_ID ) ) otherlv_2= ';' - { - otherlv_0=(Token)match(input,36,FOLLOW_36_in_ruleLocalContinue6226); - - newLeafNode(otherlv_0, grammarAccess.getLocalContinueAccess().getContinueKeyword_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3014:1: ( (lv_label_1_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3015:1: (lv_label_1_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3015:1: (lv_label_1_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3016:3: lv_label_1_0= RULE_ID - { - lv_label_1_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleLocalContinue6243); - - newLeafNode(lv_label_1_0, grammarAccess.getLocalContinueAccess().getLabelIDTerminalRuleCall_1_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getLocalContinueRule()); - } - setWithLastConsumed( - current, - "label", - lv_label_1_0, - "ID"); - - - } - - - } - - otherlv_2=(Token)match(input,12,FOLLOW_12_in_ruleLocalContinue6260); - - newLeafNode(otherlv_2, grammarAccess.getLocalContinueAccess().getSemicolonKeyword_2()); - - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleLocalContinue" - - - // $ANTLR start "entryRuleLocalParallel" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3044:1: entryRuleLocalParallel returns [EObject current=null] : iv_ruleLocalParallel= ruleLocalParallel EOF ; - public final EObject entryRuleLocalParallel() throws RecognitionException { - EObject current = null; - - EObject iv_ruleLocalParallel = null; - - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3045:2: (iv_ruleLocalParallel= ruleLocalParallel EOF ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3046:2: iv_ruleLocalParallel= ruleLocalParallel EOF - { - newCompositeNode(grammarAccess.getLocalParallelRule()); - pushFollow(FOLLOW_ruleLocalParallel_in_entryRuleLocalParallel6296); - iv_ruleLocalParallel=ruleLocalParallel(); - - state._fsp--; - - current =iv_ruleLocalParallel; - match(input,EOF,FOLLOW_EOF_in_entryRuleLocalParallel6306); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleLocalParallel" - - - // $ANTLR start "ruleLocalParallel" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3053:1: ruleLocalParallel returns [EObject current=null] : (otherlv_0= 'par' ( (lv_blocks_1_0= ruleLocalProtocolBlock ) ) (otherlv_2= 'and' ( (lv_blocks_3_0= ruleLocalProtocolBlock ) ) )* ) ; - public final EObject ruleLocalParallel() throws RecognitionException { - EObject current = null; - - Token otherlv_0=null; - Token otherlv_2=null; - EObject lv_blocks_1_0 = null; - - EObject lv_blocks_3_0 = null; - - - enterRule(); - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3056:28: ( (otherlv_0= 'par' ( (lv_blocks_1_0= ruleLocalProtocolBlock ) ) (otherlv_2= 'and' ( (lv_blocks_3_0= ruleLocalProtocolBlock ) ) )* ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3057:1: (otherlv_0= 'par' ( (lv_blocks_1_0= ruleLocalProtocolBlock ) ) (otherlv_2= 'and' ( (lv_blocks_3_0= ruleLocalProtocolBlock ) ) )* ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3057:1: (otherlv_0= 'par' ( (lv_blocks_1_0= ruleLocalProtocolBlock ) ) (otherlv_2= 'and' ( (lv_blocks_3_0= ruleLocalProtocolBlock ) ) )* ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3057:3: otherlv_0= 'par' ( (lv_blocks_1_0= ruleLocalProtocolBlock ) ) (otherlv_2= 'and' ( (lv_blocks_3_0= ruleLocalProtocolBlock ) ) )* - { - otherlv_0=(Token)match(input,37,FOLLOW_37_in_ruleLocalParallel6343); - - newLeafNode(otherlv_0, grammarAccess.getLocalParallelAccess().getParKeyword_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3061:1: ( (lv_blocks_1_0= ruleLocalProtocolBlock ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3062:1: (lv_blocks_1_0= ruleLocalProtocolBlock ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3062:1: (lv_blocks_1_0= ruleLocalProtocolBlock ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3063:3: lv_blocks_1_0= ruleLocalProtocolBlock - { - - newCompositeNode(grammarAccess.getLocalParallelAccess().getBlocksLocalProtocolBlockParserRuleCall_1_0()); - - pushFollow(FOLLOW_ruleLocalProtocolBlock_in_ruleLocalParallel6364); - lv_blocks_1_0=ruleLocalProtocolBlock(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getLocalParallelRule()); - } - add( - current, - "blocks", - lv_blocks_1_0, - "LocalProtocolBlock"); - afterParserOrEnumRuleCall(); - - - } - - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3079:2: (otherlv_2= 'and' ( (lv_blocks_3_0= ruleLocalProtocolBlock ) ) )* - loop51: - do { - int alt51=2; - int LA51_0 = input.LA(1); - - if ( (LA51_0==38) ) { - alt51=1; - } - - - switch (alt51) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3079:4: otherlv_2= 'and' ( (lv_blocks_3_0= ruleLocalProtocolBlock ) ) - { - otherlv_2=(Token)match(input,38,FOLLOW_38_in_ruleLocalParallel6377); - - newLeafNode(otherlv_2, grammarAccess.getLocalParallelAccess().getAndKeyword_2_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3083:1: ( (lv_blocks_3_0= ruleLocalProtocolBlock ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3084:1: (lv_blocks_3_0= ruleLocalProtocolBlock ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3084:1: (lv_blocks_3_0= ruleLocalProtocolBlock ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3085:3: lv_blocks_3_0= ruleLocalProtocolBlock - { - - newCompositeNode(grammarAccess.getLocalParallelAccess().getBlocksLocalProtocolBlockParserRuleCall_2_1_0()); - - pushFollow(FOLLOW_ruleLocalProtocolBlock_in_ruleLocalParallel6398); - lv_blocks_3_0=ruleLocalProtocolBlock(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getLocalParallelRule()); - } - add( - current, - "blocks", - lv_blocks_3_0, - "LocalProtocolBlock"); - afterParserOrEnumRuleCall(); - - - } - - - } - - - } - break; - - default : - break loop51; - } - } while (true); - - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleLocalParallel" - - - // $ANTLR start "entryRuleLocalInterruptible" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3109:1: entryRuleLocalInterruptible returns [EObject current=null] : iv_ruleLocalInterruptible= ruleLocalInterruptible EOF ; - public final EObject entryRuleLocalInterruptible() throws RecognitionException { - EObject current = null; - - EObject iv_ruleLocalInterruptible = null; - - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3110:2: (iv_ruleLocalInterruptible= ruleLocalInterruptible EOF ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3111:2: iv_ruleLocalInterruptible= ruleLocalInterruptible EOF - { - newCompositeNode(grammarAccess.getLocalInterruptibleRule()); - pushFollow(FOLLOW_ruleLocalInterruptible_in_entryRuleLocalInterruptible6436); - iv_ruleLocalInterruptible=ruleLocalInterruptible(); - - state._fsp--; - - current =iv_ruleLocalInterruptible; - match(input,EOF,FOLLOW_EOF_in_entryRuleLocalInterruptible6446); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleLocalInterruptible" - - - // $ANTLR start "ruleLocalInterruptible" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3118:1: ruleLocalInterruptible returns [EObject current=null] : (otherlv_0= 'interruptible' ( ( (lv_scope_1_0= RULE_ID ) ) otherlv_2= ':' )? ( (lv_block_3_0= ruleLocalProtocolBlock ) ) otherlv_4= 'with' otherlv_5= '{' ( (lv_throw_6_0= ruleLocalThrow ) )? ( (lv_catches_7_0= ruleLocalCatch ) )* otherlv_8= '}' ) ; - public final EObject ruleLocalInterruptible() throws RecognitionException { - EObject current = null; - - Token otherlv_0=null; - Token lv_scope_1_0=null; - Token otherlv_2=null; - Token otherlv_4=null; - Token otherlv_5=null; - Token otherlv_8=null; - EObject lv_block_3_0 = null; - - EObject lv_throw_6_0 = null; - - EObject lv_catches_7_0 = null; - - - enterRule(); - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3121:28: ( (otherlv_0= 'interruptible' ( ( (lv_scope_1_0= RULE_ID ) ) otherlv_2= ':' )? ( (lv_block_3_0= ruleLocalProtocolBlock ) ) otherlv_4= 'with' otherlv_5= '{' ( (lv_throw_6_0= ruleLocalThrow ) )? ( (lv_catches_7_0= ruleLocalCatch ) )* otherlv_8= '}' ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3122:1: (otherlv_0= 'interruptible' ( ( (lv_scope_1_0= RULE_ID ) ) otherlv_2= ':' )? ( (lv_block_3_0= ruleLocalProtocolBlock ) ) otherlv_4= 'with' otherlv_5= '{' ( (lv_throw_6_0= ruleLocalThrow ) )? ( (lv_catches_7_0= ruleLocalCatch ) )* otherlv_8= '}' ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3122:1: (otherlv_0= 'interruptible' ( ( (lv_scope_1_0= RULE_ID ) ) otherlv_2= ':' )? ( (lv_block_3_0= ruleLocalProtocolBlock ) ) otherlv_4= 'with' otherlv_5= '{' ( (lv_throw_6_0= ruleLocalThrow ) )? ( (lv_catches_7_0= ruleLocalCatch ) )* otherlv_8= '}' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3122:3: otherlv_0= 'interruptible' ( ( (lv_scope_1_0= RULE_ID ) ) otherlv_2= ':' )? ( (lv_block_3_0= ruleLocalProtocolBlock ) ) otherlv_4= 'with' otherlv_5= '{' ( (lv_throw_6_0= ruleLocalThrow ) )? ( (lv_catches_7_0= ruleLocalCatch ) )* otherlv_8= '}' - { - otherlv_0=(Token)match(input,39,FOLLOW_39_in_ruleLocalInterruptible6483); - - newLeafNode(otherlv_0, grammarAccess.getLocalInterruptibleAccess().getInterruptibleKeyword_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3126:1: ( ( (lv_scope_1_0= RULE_ID ) ) otherlv_2= ':' )? - int alt52=2; - int LA52_0 = input.LA(1); - - if ( (LA52_0==RULE_ID) ) { - alt52=1; - } - switch (alt52) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3126:2: ( (lv_scope_1_0= RULE_ID ) ) otherlv_2= ':' - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3126:2: ( (lv_scope_1_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3127:1: (lv_scope_1_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3127:1: (lv_scope_1_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3128:3: lv_scope_1_0= RULE_ID - { - lv_scope_1_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleLocalInterruptible6501); - - newLeafNode(lv_scope_1_0, grammarAccess.getLocalInterruptibleAccess().getScopeIDTerminalRuleCall_1_0_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getLocalInterruptibleRule()); - } - setWithLastConsumed( - current, - "scope", - lv_scope_1_0, - "ID"); - - - } - - - } - - otherlv_2=(Token)match(input,23,FOLLOW_23_in_ruleLocalInterruptible6518); - - newLeafNode(otherlv_2, grammarAccess.getLocalInterruptibleAccess().getColonKeyword_1_1()); - - - } - break; - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3148:3: ( (lv_block_3_0= ruleLocalProtocolBlock ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3149:1: (lv_block_3_0= ruleLocalProtocolBlock ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3149:1: (lv_block_3_0= ruleLocalProtocolBlock ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3150:3: lv_block_3_0= ruleLocalProtocolBlock - { - - newCompositeNode(grammarAccess.getLocalInterruptibleAccess().getBlockLocalProtocolBlockParserRuleCall_2_0()); - - pushFollow(FOLLOW_ruleLocalProtocolBlock_in_ruleLocalInterruptible6541); - lv_block_3_0=ruleLocalProtocolBlock(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getLocalInterruptibleRule()); - } - set( - current, - "block", - lv_block_3_0, - "LocalProtocolBlock"); - afterParserOrEnumRuleCall(); - - - } - - - } - - otherlv_4=(Token)match(input,40,FOLLOW_40_in_ruleLocalInterruptible6553); - - newLeafNode(otherlv_4, grammarAccess.getLocalInterruptibleAccess().getWithKeyword_3()); - - otherlv_5=(Token)match(input,29,FOLLOW_29_in_ruleLocalInterruptible6565); - - newLeafNode(otherlv_5, grammarAccess.getLocalInterruptibleAccess().getLeftCurlyBracketKeyword_4()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3174:1: ( (lv_throw_6_0= ruleLocalThrow ) )? - int alt53=2; - int LA53_0 = input.LA(1); - - if ( (LA53_0==44) ) { - alt53=1; - } - switch (alt53) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3175:1: (lv_throw_6_0= ruleLocalThrow ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3175:1: (lv_throw_6_0= ruleLocalThrow ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3176:3: lv_throw_6_0= ruleLocalThrow - { - - newCompositeNode(grammarAccess.getLocalInterruptibleAccess().getThrowLocalThrowParserRuleCall_5_0()); - - pushFollow(FOLLOW_ruleLocalThrow_in_ruleLocalInterruptible6586); - lv_throw_6_0=ruleLocalThrow(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getLocalInterruptibleRule()); - } - set( - current, - "throw", - lv_throw_6_0, - "LocalThrow"); - afterParserOrEnumRuleCall(); - - - } - - - } - break; - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3192:3: ( (lv_catches_7_0= ruleLocalCatch ) )* - loop54: - do { - int alt54=2; - int LA54_0 = input.LA(1); - - if ( (LA54_0==45) ) { - alt54=1; - } - - - switch (alt54) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3193:1: (lv_catches_7_0= ruleLocalCatch ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3193:1: (lv_catches_7_0= ruleLocalCatch ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3194:3: lv_catches_7_0= ruleLocalCatch - { - - newCompositeNode(grammarAccess.getLocalInterruptibleAccess().getCatchesLocalCatchParserRuleCall_6_0()); - - pushFollow(FOLLOW_ruleLocalCatch_in_ruleLocalInterruptible6608); - lv_catches_7_0=ruleLocalCatch(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getLocalInterruptibleRule()); - } - add( - current, - "catches", - lv_catches_7_0, - "LocalCatch"); - afterParserOrEnumRuleCall(); - - - } - - - } - break; - - default : - break loop54; - } - } while (true); - - otherlv_8=(Token)match(input,30,FOLLOW_30_in_ruleLocalInterruptible6621); - - newLeafNode(otherlv_8, grammarAccess.getLocalInterruptibleAccess().getRightCurlyBracketKeyword_7()); - - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleLocalInterruptible" - - - // $ANTLR start "entryRuleLocalThrow" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3222:1: entryRuleLocalThrow returns [EObject current=null] : iv_ruleLocalThrow= ruleLocalThrow EOF ; - public final EObject entryRuleLocalThrow() throws RecognitionException { - EObject current = null; - - EObject iv_ruleLocalThrow = null; - - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3223:2: (iv_ruleLocalThrow= ruleLocalThrow EOF ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3224:2: iv_ruleLocalThrow= ruleLocalThrow EOF - { - newCompositeNode(grammarAccess.getLocalThrowRule()); - pushFollow(FOLLOW_ruleLocalThrow_in_entryRuleLocalThrow6657); - iv_ruleLocalThrow=ruleLocalThrow(); - - state._fsp--; - - current =iv_ruleLocalThrow; - match(input,EOF,FOLLOW_EOF_in_entryRuleLocalThrow6667); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleLocalThrow" - - - // $ANTLR start "ruleLocalThrow" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3231:1: ruleLocalThrow returns [EObject current=null] : (otherlv_0= 'throw' ( (lv_messages_1_0= ruleMessage ) ) (otherlv_2= ',' ( (lv_messages_3_0= ruleMessage ) ) )* otherlv_4= 'to' ( (lv_toRoles_5_0= RULE_ID ) ) (otherlv_6= ',' ( (lv_toRoles_7_0= RULE_ID ) ) )* otherlv_8= ';' ) ; - public final EObject ruleLocalThrow() throws RecognitionException { - EObject current = null; - - Token otherlv_0=null; - Token otherlv_2=null; - Token otherlv_4=null; - Token lv_toRoles_5_0=null; - Token otherlv_6=null; - Token lv_toRoles_7_0=null; - Token otherlv_8=null; - EObject lv_messages_1_0 = null; - - EObject lv_messages_3_0 = null; - - - enterRule(); - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3234:28: ( (otherlv_0= 'throw' ( (lv_messages_1_0= ruleMessage ) ) (otherlv_2= ',' ( (lv_messages_3_0= ruleMessage ) ) )* otherlv_4= 'to' ( (lv_toRoles_5_0= RULE_ID ) ) (otherlv_6= ',' ( (lv_toRoles_7_0= RULE_ID ) ) )* otherlv_8= ';' ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3235:1: (otherlv_0= 'throw' ( (lv_messages_1_0= ruleMessage ) ) (otherlv_2= ',' ( (lv_messages_3_0= ruleMessage ) ) )* otherlv_4= 'to' ( (lv_toRoles_5_0= RULE_ID ) ) (otherlv_6= ',' ( (lv_toRoles_7_0= RULE_ID ) ) )* otherlv_8= ';' ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3235:1: (otherlv_0= 'throw' ( (lv_messages_1_0= ruleMessage ) ) (otherlv_2= ',' ( (lv_messages_3_0= ruleMessage ) ) )* otherlv_4= 'to' ( (lv_toRoles_5_0= RULE_ID ) ) (otherlv_6= ',' ( (lv_toRoles_7_0= RULE_ID ) ) )* otherlv_8= ';' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3235:3: otherlv_0= 'throw' ( (lv_messages_1_0= ruleMessage ) ) (otherlv_2= ',' ( (lv_messages_3_0= ruleMessage ) ) )* otherlv_4= 'to' ( (lv_toRoles_5_0= RULE_ID ) ) (otherlv_6= ',' ( (lv_toRoles_7_0= RULE_ID ) ) )* otherlv_8= ';' - { - otherlv_0=(Token)match(input,44,FOLLOW_44_in_ruleLocalThrow6704); - - newLeafNode(otherlv_0, grammarAccess.getLocalThrowAccess().getThrowKeyword_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3239:1: ( (lv_messages_1_0= ruleMessage ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3240:1: (lv_messages_1_0= ruleMessage ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3240:1: (lv_messages_1_0= ruleMessage ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3241:3: lv_messages_1_0= ruleMessage - { - - newCompositeNode(grammarAccess.getLocalThrowAccess().getMessagesMessageParserRuleCall_1_0()); - - pushFollow(FOLLOW_ruleMessage_in_ruleLocalThrow6725); - lv_messages_1_0=ruleMessage(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getLocalThrowRule()); - } - add( - current, - "messages", - lv_messages_1_0, - "Message"); - afterParserOrEnumRuleCall(); - - - } - - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3257:2: (otherlv_2= ',' ( (lv_messages_3_0= ruleMessage ) ) )* - loop55: - do { - int alt55=2; - int LA55_0 = input.LA(1); - - if ( (LA55_0==21) ) { - alt55=1; - } - - - switch (alt55) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3257:4: otherlv_2= ',' ( (lv_messages_3_0= ruleMessage ) ) - { - otherlv_2=(Token)match(input,21,FOLLOW_21_in_ruleLocalThrow6738); - - newLeafNode(otherlv_2, grammarAccess.getLocalThrowAccess().getCommaKeyword_2_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3261:1: ( (lv_messages_3_0= ruleMessage ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3262:1: (lv_messages_3_0= ruleMessage ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3262:1: (lv_messages_3_0= ruleMessage ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3263:3: lv_messages_3_0= ruleMessage - { - - newCompositeNode(grammarAccess.getLocalThrowAccess().getMessagesMessageParserRuleCall_2_1_0()); - - pushFollow(FOLLOW_ruleMessage_in_ruleLocalThrow6759); - lv_messages_3_0=ruleMessage(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getLocalThrowRule()); - } - add( - current, - "messages", - lv_messages_3_0, - "Message"); - afterParserOrEnumRuleCall(); - - - } - - - } - - - } - break; - - default : - break loop55; - } - } while (true); - - otherlv_4=(Token)match(input,31,FOLLOW_31_in_ruleLocalThrow6773); - - newLeafNode(otherlv_4, grammarAccess.getLocalThrowAccess().getToKeyword_3()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3283:1: ( (lv_toRoles_5_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3284:1: (lv_toRoles_5_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3284:1: (lv_toRoles_5_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3285:3: lv_toRoles_5_0= RULE_ID - { - lv_toRoles_5_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleLocalThrow6790); - - newLeafNode(lv_toRoles_5_0, grammarAccess.getLocalThrowAccess().getToRolesIDTerminalRuleCall_4_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getLocalThrowRule()); - } - addWithLastConsumed( - current, - "toRoles", - lv_toRoles_5_0, - "ID"); - - - } - - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3301:2: (otherlv_6= ',' ( (lv_toRoles_7_0= RULE_ID ) ) )* - loop56: - do { - int alt56=2; - int LA56_0 = input.LA(1); - - if ( (LA56_0==21) ) { - alt56=1; - } - - - switch (alt56) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3301:4: otherlv_6= ',' ( (lv_toRoles_7_0= RULE_ID ) ) - { - otherlv_6=(Token)match(input,21,FOLLOW_21_in_ruleLocalThrow6808); - - newLeafNode(otherlv_6, grammarAccess.getLocalThrowAccess().getCommaKeyword_5_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3305:1: ( (lv_toRoles_7_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3306:1: (lv_toRoles_7_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3306:1: (lv_toRoles_7_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3307:3: lv_toRoles_7_0= RULE_ID - { - lv_toRoles_7_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleLocalThrow6825); - - newLeafNode(lv_toRoles_7_0, grammarAccess.getLocalThrowAccess().getToRolesIDTerminalRuleCall_5_1_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getLocalThrowRule()); - } - addWithLastConsumed( - current, - "toRoles", - lv_toRoles_7_0, - "ID"); - - - } - - - } - - - } - break; - - default : - break loop56; - } - } while (true); - - otherlv_8=(Token)match(input,12,FOLLOW_12_in_ruleLocalThrow6844); - - newLeafNode(otherlv_8, grammarAccess.getLocalThrowAccess().getSemicolonKeyword_6()); - - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleLocalThrow" - - - // $ANTLR start "entryRuleLocalCatch" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3335:1: entryRuleLocalCatch returns [EObject current=null] : iv_ruleLocalCatch= ruleLocalCatch EOF ; - public final EObject entryRuleLocalCatch() throws RecognitionException { - EObject current = null; - - EObject iv_ruleLocalCatch = null; - - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3336:2: (iv_ruleLocalCatch= ruleLocalCatch EOF ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3337:2: iv_ruleLocalCatch= ruleLocalCatch EOF - { - newCompositeNode(grammarAccess.getLocalCatchRule()); - pushFollow(FOLLOW_ruleLocalCatch_in_entryRuleLocalCatch6880); - iv_ruleLocalCatch=ruleLocalCatch(); - - state._fsp--; - - current =iv_ruleLocalCatch; - match(input,EOF,FOLLOW_EOF_in_entryRuleLocalCatch6890); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleLocalCatch" - - - // $ANTLR start "ruleLocalCatch" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3344:1: ruleLocalCatch returns [EObject current=null] : (otherlv_0= 'catches' ( (lv_messages_1_0= ruleMessage ) ) (otherlv_2= ',' ( (lv_messages_3_0= ruleMessage ) ) )* otherlv_4= 'from' ( (lv_fromRole_5_0= RULE_ID ) ) otherlv_6= ';' ) ; - public final EObject ruleLocalCatch() throws RecognitionException { - EObject current = null; - - Token otherlv_0=null; - Token otherlv_2=null; - Token otherlv_4=null; - Token lv_fromRole_5_0=null; - Token otherlv_6=null; - EObject lv_messages_1_0 = null; - - EObject lv_messages_3_0 = null; - - - enterRule(); - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3347:28: ( (otherlv_0= 'catches' ( (lv_messages_1_0= ruleMessage ) ) (otherlv_2= ',' ( (lv_messages_3_0= ruleMessage ) ) )* otherlv_4= 'from' ( (lv_fromRole_5_0= RULE_ID ) ) otherlv_6= ';' ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3348:1: (otherlv_0= 'catches' ( (lv_messages_1_0= ruleMessage ) ) (otherlv_2= ',' ( (lv_messages_3_0= ruleMessage ) ) )* otherlv_4= 'from' ( (lv_fromRole_5_0= RULE_ID ) ) otherlv_6= ';' ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3348:1: (otherlv_0= 'catches' ( (lv_messages_1_0= ruleMessage ) ) (otherlv_2= ',' ( (lv_messages_3_0= ruleMessage ) ) )* otherlv_4= 'from' ( (lv_fromRole_5_0= RULE_ID ) ) otherlv_6= ';' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3348:3: otherlv_0= 'catches' ( (lv_messages_1_0= ruleMessage ) ) (otherlv_2= ',' ( (lv_messages_3_0= ruleMessage ) ) )* otherlv_4= 'from' ( (lv_fromRole_5_0= RULE_ID ) ) otherlv_6= ';' - { - otherlv_0=(Token)match(input,45,FOLLOW_45_in_ruleLocalCatch6927); - - newLeafNode(otherlv_0, grammarAccess.getLocalCatchAccess().getCatchesKeyword_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3352:1: ( (lv_messages_1_0= ruleMessage ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3353:1: (lv_messages_1_0= ruleMessage ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3353:1: (lv_messages_1_0= ruleMessage ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3354:3: lv_messages_1_0= ruleMessage - { - - newCompositeNode(grammarAccess.getLocalCatchAccess().getMessagesMessageParserRuleCall_1_0()); - - pushFollow(FOLLOW_ruleMessage_in_ruleLocalCatch6948); - lv_messages_1_0=ruleMessage(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getLocalCatchRule()); - } - add( - current, - "messages", - lv_messages_1_0, - "Message"); - afterParserOrEnumRuleCall(); - - - } - - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3370:2: (otherlv_2= ',' ( (lv_messages_3_0= ruleMessage ) ) )* - loop57: - do { - int alt57=2; - int LA57_0 = input.LA(1); - - if ( (LA57_0==21) ) { - alt57=1; - } - - - switch (alt57) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3370:4: otherlv_2= ',' ( (lv_messages_3_0= ruleMessage ) ) - { - otherlv_2=(Token)match(input,21,FOLLOW_21_in_ruleLocalCatch6961); - - newLeafNode(otherlv_2, grammarAccess.getLocalCatchAccess().getCommaKeyword_2_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3374:1: ( (lv_messages_3_0= ruleMessage ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3375:1: (lv_messages_3_0= ruleMessage ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3375:1: (lv_messages_3_0= ruleMessage ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3376:3: lv_messages_3_0= ruleMessage - { - - newCompositeNode(grammarAccess.getLocalCatchAccess().getMessagesMessageParserRuleCall_2_1_0()); - - pushFollow(FOLLOW_ruleMessage_in_ruleLocalCatch6982); - lv_messages_3_0=ruleMessage(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getLocalCatchRule()); - } - add( - current, - "messages", - lv_messages_3_0, - "Message"); - afterParserOrEnumRuleCall(); - - - } - - - } - - - } - break; - - default : - break loop57; - } - } while (true); - - otherlv_4=(Token)match(input,16,FOLLOW_16_in_ruleLocalCatch6996); - - newLeafNode(otherlv_4, grammarAccess.getLocalCatchAccess().getFromKeyword_3()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3396:1: ( (lv_fromRole_5_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3397:1: (lv_fromRole_5_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3397:1: (lv_fromRole_5_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3398:3: lv_fromRole_5_0= RULE_ID - { - lv_fromRole_5_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleLocalCatch7013); - - newLeafNode(lv_fromRole_5_0, grammarAccess.getLocalCatchAccess().getFromRoleIDTerminalRuleCall_4_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getLocalCatchRule()); - } - setWithLastConsumed( - current, - "fromRole", - lv_fromRole_5_0, - "ID"); - - - } - - - } - - otherlv_6=(Token)match(input,12,FOLLOW_12_in_ruleLocalCatch7030); - - newLeafNode(otherlv_6, grammarAccess.getLocalCatchAccess().getSemicolonKeyword_5()); - - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleLocalCatch" - - - // $ANTLR start "entryRuleLocalDo" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3426:1: entryRuleLocalDo returns [EObject current=null] : iv_ruleLocalDo= ruleLocalDo EOF ; - public final EObject entryRuleLocalDo() throws RecognitionException { - EObject current = null; - - EObject iv_ruleLocalDo = null; - - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3427:2: (iv_ruleLocalDo= ruleLocalDo EOF ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3428:2: iv_ruleLocalDo= ruleLocalDo EOF - { - newCompositeNode(grammarAccess.getLocalDoRule()); - pushFollow(FOLLOW_ruleLocalDo_in_entryRuleLocalDo7066); - iv_ruleLocalDo=ruleLocalDo(); - - state._fsp--; - - current =iv_ruleLocalDo; - match(input,EOF,FOLLOW_EOF_in_entryRuleLocalDo7076); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleLocalDo" - - - // $ANTLR start "ruleLocalDo" - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3435:1: ruleLocalDo returns [EObject current=null] : (otherlv_0= 'do' ( ( (lv_scope_1_0= RULE_ID ) ) otherlv_2= ':' )? ( (lv_member_3_0= RULE_ID ) ) (otherlv_4= '<' ( (lv_arguments_5_0= ruleArgument ) ) (otherlv_6= ',' ( (lv_arguments_7_0= ruleArgument ) ) )* otherlv_8= '>' )? otherlv_9= '(' ( (lv_roles_10_0= ruleRoleInstantiation ) ) (otherlv_11= ',' ( (lv_roles_12_0= ruleRoleInstantiation ) ) )* otherlv_13= ')' otherlv_14= ';' ) ; - public final EObject ruleLocalDo() throws RecognitionException { - EObject current = null; - - Token otherlv_0=null; - Token lv_scope_1_0=null; - Token otherlv_2=null; - Token lv_member_3_0=null; - Token otherlv_4=null; - Token otherlv_6=null; - Token otherlv_8=null; - Token otherlv_9=null; - Token otherlv_11=null; - Token otherlv_13=null; - Token otherlv_14=null; - EObject lv_arguments_5_0 = null; - - EObject lv_arguments_7_0 = null; - - EObject lv_roles_10_0 = null; - - EObject lv_roles_12_0 = null; - - - enterRule(); - - try { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3438:28: ( (otherlv_0= 'do' ( ( (lv_scope_1_0= RULE_ID ) ) otherlv_2= ':' )? ( (lv_member_3_0= RULE_ID ) ) (otherlv_4= '<' ( (lv_arguments_5_0= ruleArgument ) ) (otherlv_6= ',' ( (lv_arguments_7_0= ruleArgument ) ) )* otherlv_8= '>' )? otherlv_9= '(' ( (lv_roles_10_0= ruleRoleInstantiation ) ) (otherlv_11= ',' ( (lv_roles_12_0= ruleRoleInstantiation ) ) )* otherlv_13= ')' otherlv_14= ';' ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3439:1: (otherlv_0= 'do' ( ( (lv_scope_1_0= RULE_ID ) ) otherlv_2= ':' )? ( (lv_member_3_0= RULE_ID ) ) (otherlv_4= '<' ( (lv_arguments_5_0= ruleArgument ) ) (otherlv_6= ',' ( (lv_arguments_7_0= ruleArgument ) ) )* otherlv_8= '>' )? otherlv_9= '(' ( (lv_roles_10_0= ruleRoleInstantiation ) ) (otherlv_11= ',' ( (lv_roles_12_0= ruleRoleInstantiation ) ) )* otherlv_13= ')' otherlv_14= ';' ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3439:1: (otherlv_0= 'do' ( ( (lv_scope_1_0= RULE_ID ) ) otherlv_2= ':' )? ( (lv_member_3_0= RULE_ID ) ) (otherlv_4= '<' ( (lv_arguments_5_0= ruleArgument ) ) (otherlv_6= ',' ( (lv_arguments_7_0= ruleArgument ) ) )* otherlv_8= '>' )? otherlv_9= '(' ( (lv_roles_10_0= ruleRoleInstantiation ) ) (otherlv_11= ',' ( (lv_roles_12_0= ruleRoleInstantiation ) ) )* otherlv_13= ')' otherlv_14= ';' ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3439:3: otherlv_0= 'do' ( ( (lv_scope_1_0= RULE_ID ) ) otherlv_2= ':' )? ( (lv_member_3_0= RULE_ID ) ) (otherlv_4= '<' ( (lv_arguments_5_0= ruleArgument ) ) (otherlv_6= ',' ( (lv_arguments_7_0= ruleArgument ) ) )* otherlv_8= '>' )? otherlv_9= '(' ( (lv_roles_10_0= ruleRoleInstantiation ) ) (otherlv_11= ',' ( (lv_roles_12_0= ruleRoleInstantiation ) ) )* otherlv_13= ')' otherlv_14= ';' - { - otherlv_0=(Token)match(input,42,FOLLOW_42_in_ruleLocalDo7113); - - newLeafNode(otherlv_0, grammarAccess.getLocalDoAccess().getDoKeyword_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3443:1: ( ( (lv_scope_1_0= RULE_ID ) ) otherlv_2= ':' )? - int alt58=2; - int LA58_0 = input.LA(1); - - if ( (LA58_0==RULE_ID) ) { - int LA58_1 = input.LA(2); - - if ( (LA58_1==23) ) { - alt58=1; - } - } - switch (alt58) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3443:2: ( (lv_scope_1_0= RULE_ID ) ) otherlv_2= ':' - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3443:2: ( (lv_scope_1_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3444:1: (lv_scope_1_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3444:1: (lv_scope_1_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3445:3: lv_scope_1_0= RULE_ID - { - lv_scope_1_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleLocalDo7131); - - newLeafNode(lv_scope_1_0, grammarAccess.getLocalDoAccess().getScopeIDTerminalRuleCall_1_0_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getLocalDoRule()); - } - setWithLastConsumed( - current, - "scope", - lv_scope_1_0, - "ID"); - - - } - - - } - - otherlv_2=(Token)match(input,23,FOLLOW_23_in_ruleLocalDo7148); - - newLeafNode(otherlv_2, grammarAccess.getLocalDoAccess().getColonKeyword_1_1()); - - - } - break; - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3465:3: ( (lv_member_3_0= RULE_ID ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3466:1: (lv_member_3_0= RULE_ID ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3466:1: (lv_member_3_0= RULE_ID ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3467:3: lv_member_3_0= RULE_ID - { - lv_member_3_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleLocalDo7167); - - newLeafNode(lv_member_3_0, grammarAccess.getLocalDoAccess().getMemberIDTerminalRuleCall_2_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getLocalDoRule()); - } - setWithLastConsumed( - current, - "member", - lv_member_3_0, - "ID"); - - - } - - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3483:2: (otherlv_4= '<' ( (lv_arguments_5_0= ruleArgument ) ) (otherlv_6= ',' ( (lv_arguments_7_0= ruleArgument ) ) )* otherlv_8= '>' )? - int alt60=2; - int LA60_0 = input.LA(1); - - if ( (LA60_0==18) ) { - alt60=1; - } - switch (alt60) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3483:4: otherlv_4= '<' ( (lv_arguments_5_0= ruleArgument ) ) (otherlv_6= ',' ( (lv_arguments_7_0= ruleArgument ) ) )* otherlv_8= '>' - { - otherlv_4=(Token)match(input,18,FOLLOW_18_in_ruleLocalDo7185); - - newLeafNode(otherlv_4, grammarAccess.getLocalDoAccess().getLessThanSignKeyword_3_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3487:1: ( (lv_arguments_5_0= ruleArgument ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3488:1: (lv_arguments_5_0= ruleArgument ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3488:1: (lv_arguments_5_0= ruleArgument ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3489:3: lv_arguments_5_0= ruleArgument - { - - newCompositeNode(grammarAccess.getLocalDoAccess().getArgumentsArgumentParserRuleCall_3_1_0()); - - pushFollow(FOLLOW_ruleArgument_in_ruleLocalDo7206); - lv_arguments_5_0=ruleArgument(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getLocalDoRule()); - } - add( - current, - "arguments", - lv_arguments_5_0, - "Argument"); - afterParserOrEnumRuleCall(); - - - } - - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3505:2: (otherlv_6= ',' ( (lv_arguments_7_0= ruleArgument ) ) )* - loop59: - do { - int alt59=2; - int LA59_0 = input.LA(1); - - if ( (LA59_0==21) ) { - alt59=1; - } - - - switch (alt59) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3505:4: otherlv_6= ',' ( (lv_arguments_7_0= ruleArgument ) ) - { - otherlv_6=(Token)match(input,21,FOLLOW_21_in_ruleLocalDo7219); - - newLeafNode(otherlv_6, grammarAccess.getLocalDoAccess().getCommaKeyword_3_2_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3509:1: ( (lv_arguments_7_0= ruleArgument ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3510:1: (lv_arguments_7_0= ruleArgument ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3510:1: (lv_arguments_7_0= ruleArgument ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3511:3: lv_arguments_7_0= ruleArgument - { - - newCompositeNode(grammarAccess.getLocalDoAccess().getArgumentsArgumentParserRuleCall_3_2_1_0()); - - pushFollow(FOLLOW_ruleArgument_in_ruleLocalDo7240); - lv_arguments_7_0=ruleArgument(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getLocalDoRule()); - } - add( - current, - "arguments", - lv_arguments_7_0, - "Argument"); - afterParserOrEnumRuleCall(); - - - } - - - } - - - } - break; - - default : - break loop59; - } - } while (true); - - otherlv_8=(Token)match(input,19,FOLLOW_19_in_ruleLocalDo7254); - - newLeafNode(otherlv_8, grammarAccess.getLocalDoAccess().getGreaterThanSignKeyword_3_3()); - - - } - break; - - } - - otherlv_9=(Token)match(input,20,FOLLOW_20_in_ruleLocalDo7268); - - newLeafNode(otherlv_9, grammarAccess.getLocalDoAccess().getLeftParenthesisKeyword_4()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3535:1: ( (lv_roles_10_0= ruleRoleInstantiation ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3536:1: (lv_roles_10_0= ruleRoleInstantiation ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3536:1: (lv_roles_10_0= ruleRoleInstantiation ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3537:3: lv_roles_10_0= ruleRoleInstantiation - { - - newCompositeNode(grammarAccess.getLocalDoAccess().getRolesRoleInstantiationParserRuleCall_5_0()); - - pushFollow(FOLLOW_ruleRoleInstantiation_in_ruleLocalDo7289); - lv_roles_10_0=ruleRoleInstantiation(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getLocalDoRule()); - } - add( - current, - "roles", - lv_roles_10_0, - "RoleInstantiation"); - afterParserOrEnumRuleCall(); - - - } - - - } - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3553:2: (otherlv_11= ',' ( (lv_roles_12_0= ruleRoleInstantiation ) ) )* - loop61: - do { - int alt61=2; - int LA61_0 = input.LA(1); - - if ( (LA61_0==21) ) { - alt61=1; - } - - - switch (alt61) { - case 1 : - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3553:4: otherlv_11= ',' ( (lv_roles_12_0= ruleRoleInstantiation ) ) - { - otherlv_11=(Token)match(input,21,FOLLOW_21_in_ruleLocalDo7302); - - newLeafNode(otherlv_11, grammarAccess.getLocalDoAccess().getCommaKeyword_6_0()); - - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3557:1: ( (lv_roles_12_0= ruleRoleInstantiation ) ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3558:1: (lv_roles_12_0= ruleRoleInstantiation ) - { - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3558:1: (lv_roles_12_0= ruleRoleInstantiation ) - // ../org.scribble.editor/src-gen/org/scribble/editor/dsl/parser/antlr/internal/InternalScribbleDsl.g:3559:3: lv_roles_12_0= ruleRoleInstantiation - { - - newCompositeNode(grammarAccess.getLocalDoAccess().getRolesRoleInstantiationParserRuleCall_6_1_0()); - - pushFollow(FOLLOW_ruleRoleInstantiation_in_ruleLocalDo7323); - lv_roles_12_0=ruleRoleInstantiation(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getLocalDoRule()); - } - add( - current, - "roles", - lv_roles_12_0, - "RoleInstantiation"); - afterParserOrEnumRuleCall(); - - - } - - - } - - - } - break; - - default : - break loop61; - } - } while (true); - - otherlv_13=(Token)match(input,22,FOLLOW_22_in_ruleLocalDo7337); - - newLeafNode(otherlv_13, grammarAccess.getLocalDoAccess().getRightParenthesisKeyword_7()); - - otherlv_14=(Token)match(input,12,FOLLOW_12_in_ruleLocalDo7349); - - newLeafNode(otherlv_14, grammarAccess.getLocalDoAccess().getSemicolonKeyword_8()); - - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleLocalDo" - - // Delegated rules - - - protected DFA48 dfa48 = new DFA48(this); - static final String DFA48_eotS = - "\23\uffff"; - static final String DFA48_eofS = - "\23\uffff"; - static final String DFA48_minS = - "\1\4\1\20\1\4\10\uffff\1\25\1\20\2\4\2\25\1\4\1\25"; - static final String DFA48_maxS = - "\1\52\1\37\1\26\10\uffff\1\27\1\37\2\4\1\26\1\27\1\4\1\26"; - static final String DFA48_acceptS = - "\3\uffff\1\3\1\4\1\5\1\6\1\7\1\10\1\2\1\1\10\uffff"; - static final String DFA48_specialS = - "\23\uffff}>"; - static final String[] DFA48_transitionS = { - "\1\1\17\uffff\1\2\13\uffff\1\3\2\uffff\1\5\1\6\1\4\1\uffff\1"+ - "\7\2\uffff\1\10", - "\1\11\3\uffff\1\2\12\uffff\1\12", - "\1\13\21\uffff\1\14", - "", - "", - "", - "", - "", - "", - "", - "", - "\1\16\1\14\1\15", - "\1\11\16\uffff\1\12", - "\1\17", - "\1\20", - "\1\16\1\14", - "\1\16\1\14\1\21", - "\1\22", - "\1\16\1\14" - }; - - static final short[] DFA48_eot = DFA.unpackEncodedString(DFA48_eotS); - static final short[] DFA48_eof = DFA.unpackEncodedString(DFA48_eofS); - static final char[] DFA48_min = DFA.unpackEncodedStringToUnsignedChars(DFA48_minS); - static final char[] DFA48_max = DFA.unpackEncodedStringToUnsignedChars(DFA48_maxS); - static final short[] DFA48_accept = DFA.unpackEncodedString(DFA48_acceptS); - static final short[] DFA48_special = DFA.unpackEncodedString(DFA48_specialS); - static final short[][] DFA48_transition; - - static { - int numStates = DFA48_transitionS.length; - DFA48_transition = new short[numStates][]; - for (int i=0; i - * A representation of the model object 'Argument'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.Argument#getSignature Signature}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.Argument#getAlias Alias}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.Argument#getName Name}
  • - *
- *

- * - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getArgument() - * @model - * @generated - */ -public interface Argument extends EObject -{ - /** - * Returns the value of the 'Signature' containment reference. - * - *

- * If the meaning of the 'Signature' containment reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Signature' containment reference. - * @see #setSignature(MessageSignature) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getArgument_Signature() - * @model containment="true" - * @generated - */ - MessageSignature getSignature(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.Argument#getSignature Signature}' containment reference. - * - * - * @param value the new value of the 'Signature' containment reference. - * @see #getSignature() - * @generated - */ - void setSignature(MessageSignature value); - - /** - * Returns the value of the 'Alias' attribute. - * - *

- * If the meaning of the 'Alias' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Alias' attribute. - * @see #setAlias(String) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getArgument_Alias() - * @model - * @generated - */ - String getAlias(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.Argument#getAlias Alias}' attribute. - * - * - * @param value the new value of the 'Alias' attribute. - * @see #getAlias() - * @generated - */ - void setAlias(String value); - - /** - * Returns the value of the 'Name' attribute. - * - *

- * If the meaning of the 'Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Name' attribute. - * @see #setName(String) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getArgument_Name() - * @model - * @generated - */ - String getName(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.Argument#getName Name}' attribute. - * - * - * @param value the new value of the 'Name' attribute. - * @see #getName() - * @generated - */ - void setName(String value); - -} // Argument diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/GlobalChoice.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/GlobalChoice.java deleted file mode 100644 index 7a912a382..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/GlobalChoice.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl; - -import org.eclipse.emf.common.util.EList; - -/** - * - * A representation of the model object 'Global Choice'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.GlobalChoice#getRole Role}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.GlobalChoice#getBlocks Blocks}
  • - *
- *

- * - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getGlobalChoice() - * @model - * @generated - */ -public interface GlobalChoice extends GlobalInteraction -{ - /** - * Returns the value of the 'Role' attribute. - * - *

- * If the meaning of the 'Role' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Role' attribute. - * @see #setRole(String) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getGlobalChoice_Role() - * @model - * @generated - */ - String getRole(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.GlobalChoice#getRole Role}' attribute. - * - * - * @param value the new value of the 'Role' attribute. - * @see #getRole() - * @generated - */ - void setRole(String value); - - /** - * Returns the value of the 'Blocks' containment reference list. - * The list contents are of type {@link org.scribble.editor.dsl.scribbleDsl.GlobalProtocolBlock}. - * - *

- * If the meaning of the 'Blocks' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Blocks' containment reference list. - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getGlobalChoice_Blocks() - * @model containment="true" - * @generated - */ - EList getBlocks(); - -} // GlobalChoice diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/GlobalContinue.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/GlobalContinue.java deleted file mode 100644 index f237a0e0b..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/GlobalContinue.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl; - - -/** - * - * A representation of the model object 'Global Continue'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.GlobalContinue#getLabel Label}
  • - *
- *

- * - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getGlobalContinue() - * @model - * @generated - */ -public interface GlobalContinue extends GlobalInteraction -{ - /** - * Returns the value of the 'Label' attribute. - * - *

- * If the meaning of the 'Label' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Label' attribute. - * @see #setLabel(String) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getGlobalContinue_Label() - * @model - * @generated - */ - String getLabel(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.GlobalContinue#getLabel Label}' attribute. - * - * - * @param value the new value of the 'Label' attribute. - * @see #getLabel() - * @generated - */ - void setLabel(String value); - -} // GlobalContinue diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/GlobalDo.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/GlobalDo.java deleted file mode 100644 index d48579d8a..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/GlobalDo.java +++ /dev/null @@ -1,112 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl; - -import org.eclipse.emf.common.util.EList; - -/** - * - * A representation of the model object 'Global Do'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.GlobalDo#getScope Scope}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.GlobalDo#getMember Member}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.GlobalDo#getArguments Arguments}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.GlobalDo#getRoles Roles}
  • - *
- *

- * - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getGlobalDo() - * @model - * @generated - */ -public interface GlobalDo extends GlobalInteraction -{ - /** - * Returns the value of the 'Scope' attribute. - * - *

- * If the meaning of the 'Scope' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Scope' attribute. - * @see #setScope(String) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getGlobalDo_Scope() - * @model - * @generated - */ - String getScope(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.GlobalDo#getScope Scope}' attribute. - * - * - * @param value the new value of the 'Scope' attribute. - * @see #getScope() - * @generated - */ - void setScope(String value); - - /** - * Returns the value of the 'Member' attribute. - * - *

- * If the meaning of the 'Member' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Member' attribute. - * @see #setMember(String) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getGlobalDo_Member() - * @model - * @generated - */ - String getMember(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.GlobalDo#getMember Member}' attribute. - * - * - * @param value the new value of the 'Member' attribute. - * @see #getMember() - * @generated - */ - void setMember(String value); - - /** - * Returns the value of the 'Arguments' containment reference list. - * The list contents are of type {@link org.scribble.editor.dsl.scribbleDsl.Argument}. - * - *

- * If the meaning of the 'Arguments' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Arguments' containment reference list. - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getGlobalDo_Arguments() - * @model containment="true" - * @generated - */ - EList getArguments(); - - /** - * Returns the value of the 'Roles' containment reference list. - * The list contents are of type {@link org.scribble.editor.dsl.scribbleDsl.RoleInstantiation}. - * - *

- * If the meaning of the 'Roles' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Roles' containment reference list. - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getGlobalDo_Roles() - * @model containment="true" - * @generated - */ - EList getRoles(); - -} // GlobalDo diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/GlobalInteraction.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/GlobalInteraction.java deleted file mode 100644 index 591c264db..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/GlobalInteraction.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Global Interaction'. - * - * - * - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getGlobalInteraction() - * @model - * @generated - */ -public interface GlobalInteraction extends EObject -{ -} // GlobalInteraction diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/GlobalInterrupt.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/GlobalInterrupt.java deleted file mode 100644 index 5efd9a484..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/GlobalInterrupt.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Global Interrupt'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.GlobalInterrupt#getMessages Messages}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.GlobalInterrupt#getRole Role}
  • - *
- *

- * - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getGlobalInterrupt() - * @model - * @generated - */ -public interface GlobalInterrupt extends EObject -{ - /** - * Returns the value of the 'Messages' containment reference list. - * The list contents are of type {@link org.scribble.editor.dsl.scribbleDsl.Message}. - * - *

- * If the meaning of the 'Messages' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Messages' containment reference list. - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getGlobalInterrupt_Messages() - * @model containment="true" - * @generated - */ - EList getMessages(); - - /** - * Returns the value of the 'Role' attribute. - * - *

- * If the meaning of the 'Role' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Role' attribute. - * @see #setRole(String) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getGlobalInterrupt_Role() - * @model - * @generated - */ - String getRole(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.GlobalInterrupt#getRole Role}' attribute. - * - * - * @param value the new value of the 'Role' attribute. - * @see #getRole() - * @generated - */ - void setRole(String value); - -} // GlobalInterrupt diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/GlobalInterruptible.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/GlobalInterruptible.java deleted file mode 100644 index 8a96e6c09..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/GlobalInterruptible.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl; - -import org.eclipse.emf.common.util.EList; - -/** - * - * A representation of the model object 'Global Interruptible'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.GlobalInterruptible#getScope Scope}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.GlobalInterruptible#getBlock Block}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.GlobalInterruptible#getInterrupts Interrupts}
  • - *
- *

- * - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getGlobalInterruptible() - * @model - * @generated - */ -public interface GlobalInterruptible extends GlobalInteraction -{ - /** - * Returns the value of the 'Scope' attribute. - * - *

- * If the meaning of the 'Scope' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Scope' attribute. - * @see #setScope(String) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getGlobalInterruptible_Scope() - * @model - * @generated - */ - String getScope(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.GlobalInterruptible#getScope Scope}' attribute. - * - * - * @param value the new value of the 'Scope' attribute. - * @see #getScope() - * @generated - */ - void setScope(String value); - - /** - * Returns the value of the 'Block' containment reference. - * - *

- * If the meaning of the 'Block' containment reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Block' containment reference. - * @see #setBlock(GlobalProtocolBlock) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getGlobalInterruptible_Block() - * @model containment="true" - * @generated - */ - GlobalProtocolBlock getBlock(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.GlobalInterruptible#getBlock Block}' containment reference. - * - * - * @param value the new value of the 'Block' containment reference. - * @see #getBlock() - * @generated - */ - void setBlock(GlobalProtocolBlock value); - - /** - * Returns the value of the 'Interrupts' containment reference list. - * The list contents are of type {@link org.scribble.editor.dsl.scribbleDsl.GlobalInterrupt}. - * - *

- * If the meaning of the 'Interrupts' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Interrupts' containment reference list. - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getGlobalInterruptible_Interrupts() - * @model containment="true" - * @generated - */ - EList getInterrupts(); - -} // GlobalInterruptible diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/GlobalMessageTransfer.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/GlobalMessageTransfer.java deleted file mode 100644 index 3f6638658..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/GlobalMessageTransfer.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl; - -import org.eclipse.emf.common.util.EList; - -/** - * - * A representation of the model object 'Global Message Transfer'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.GlobalMessageTransfer#getMessage Message}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.GlobalMessageTransfer#getFromRole From Role}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.GlobalMessageTransfer#getToRoles To Roles}
  • - *
- *

- * - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getGlobalMessageTransfer() - * @model - * @generated - */ -public interface GlobalMessageTransfer extends GlobalInteraction -{ - /** - * Returns the value of the 'Message' containment reference. - * - *

- * If the meaning of the 'Message' containment reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Message' containment reference. - * @see #setMessage(Message) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getGlobalMessageTransfer_Message() - * @model containment="true" - * @generated - */ - Message getMessage(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.GlobalMessageTransfer#getMessage Message}' containment reference. - * - * - * @param value the new value of the 'Message' containment reference. - * @see #getMessage() - * @generated - */ - void setMessage(Message value); - - /** - * Returns the value of the 'From Role' attribute. - * - *

- * If the meaning of the 'From Role' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'From Role' attribute. - * @see #setFromRole(String) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getGlobalMessageTransfer_FromRole() - * @model - * @generated - */ - String getFromRole(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.GlobalMessageTransfer#getFromRole From Role}' attribute. - * - * - * @param value the new value of the 'From Role' attribute. - * @see #getFromRole() - * @generated - */ - void setFromRole(String value); - - /** - * Returns the value of the 'To Roles' attribute list. - * The list contents are of type {@link java.lang.String}. - * - *

- * If the meaning of the 'To Roles' attribute list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'To Roles' attribute list. - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getGlobalMessageTransfer_ToRoles() - * @model unique="false" - * @generated - */ - EList getToRoles(); - -} // GlobalMessageTransfer diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/GlobalParallel.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/GlobalParallel.java deleted file mode 100644 index 12ed84897..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/GlobalParallel.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl; - -import org.eclipse.emf.common.util.EList; - -/** - * - * A representation of the model object 'Global Parallel'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.GlobalParallel#getBlocks Blocks}
  • - *
- *

- * - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getGlobalParallel() - * @model - * @generated - */ -public interface GlobalParallel extends GlobalInteraction -{ - /** - * Returns the value of the 'Blocks' containment reference list. - * The list contents are of type {@link org.scribble.editor.dsl.scribbleDsl.GlobalProtocolBlock}. - * - *

- * If the meaning of the 'Blocks' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Blocks' containment reference list. - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getGlobalParallel_Blocks() - * @model containment="true" - * @generated - */ - EList getBlocks(); - -} // GlobalParallel diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/GlobalProtocolBlock.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/GlobalProtocolBlock.java deleted file mode 100644 index 021691156..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/GlobalProtocolBlock.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Global Protocol Block'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.GlobalProtocolBlock#getActivities Activities}
  • - *
- *

- * - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getGlobalProtocolBlock() - * @model - * @generated - */ -public interface GlobalProtocolBlock extends EObject -{ - /** - * Returns the value of the 'Activities' containment reference list. - * The list contents are of type {@link org.scribble.editor.dsl.scribbleDsl.GlobalInteraction}. - * - *

- * If the meaning of the 'Activities' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Activities' containment reference list. - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getGlobalProtocolBlock_Activities() - * @model containment="true" - * @generated - */ - EList getActivities(); - -} // GlobalProtocolBlock diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/GlobalProtocolDecl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/GlobalProtocolDecl.java deleted file mode 100644 index 2e1a67488..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/GlobalProtocolDecl.java +++ /dev/null @@ -1,175 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Global Protocol Decl'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.GlobalProtocolDecl#getName Name}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.GlobalProtocolDecl#getParameters Parameters}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.GlobalProtocolDecl#getRoles Roles}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.GlobalProtocolDecl#getBlock Block}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.GlobalProtocolDecl#getInstantiates Instantiates}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.GlobalProtocolDecl#getArguments Arguments}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.GlobalProtocolDecl#getRoleInstantiations Role Instantiations}
  • - *
- *

- * - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getGlobalProtocolDecl() - * @model - * @generated - */ -public interface GlobalProtocolDecl extends EObject -{ - /** - * Returns the value of the 'Name' attribute. - * - *

- * If the meaning of the 'Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Name' attribute. - * @see #setName(String) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getGlobalProtocolDecl_Name() - * @model - * @generated - */ - String getName(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.GlobalProtocolDecl#getName Name}' attribute. - * - * - * @param value the new value of the 'Name' attribute. - * @see #getName() - * @generated - */ - void setName(String value); - - /** - * Returns the value of the 'Parameters' containment reference list. - * The list contents are of type {@link org.scribble.editor.dsl.scribbleDsl.ParameterDecl}. - * - *

- * If the meaning of the 'Parameters' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Parameters' containment reference list. - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getGlobalProtocolDecl_Parameters() - * @model containment="true" - * @generated - */ - EList getParameters(); - - /** - * Returns the value of the 'Roles' containment reference list. - * The list contents are of type {@link org.scribble.editor.dsl.scribbleDsl.RoleDecl}. - * - *

- * If the meaning of the 'Roles' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Roles' containment reference list. - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getGlobalProtocolDecl_Roles() - * @model containment="true" - * @generated - */ - EList getRoles(); - - /** - * Returns the value of the 'Block' containment reference. - * - *

- * If the meaning of the 'Block' containment reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Block' containment reference. - * @see #setBlock(GlobalProtocolBlock) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getGlobalProtocolDecl_Block() - * @model containment="true" - * @generated - */ - GlobalProtocolBlock getBlock(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.GlobalProtocolDecl#getBlock Block}' containment reference. - * - * - * @param value the new value of the 'Block' containment reference. - * @see #getBlock() - * @generated - */ - void setBlock(GlobalProtocolBlock value); - - /** - * Returns the value of the 'Instantiates' attribute. - * - *

- * If the meaning of the 'Instantiates' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Instantiates' attribute. - * @see #setInstantiates(String) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getGlobalProtocolDecl_Instantiates() - * @model - * @generated - */ - String getInstantiates(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.GlobalProtocolDecl#getInstantiates Instantiates}' attribute. - * - * - * @param value the new value of the 'Instantiates' attribute. - * @see #getInstantiates() - * @generated - */ - void setInstantiates(String value); - - /** - * Returns the value of the 'Arguments' containment reference list. - * The list contents are of type {@link org.scribble.editor.dsl.scribbleDsl.Argument}. - * - *

- * If the meaning of the 'Arguments' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Arguments' containment reference list. - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getGlobalProtocolDecl_Arguments() - * @model containment="true" - * @generated - */ - EList getArguments(); - - /** - * Returns the value of the 'Role Instantiations' containment reference list. - * The list contents are of type {@link org.scribble.editor.dsl.scribbleDsl.RoleInstantiation}. - * - *

- * If the meaning of the 'Role Instantiations' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Role Instantiations' containment reference list. - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getGlobalProtocolDecl_RoleInstantiations() - * @model containment="true" - * @generated - */ - EList getRoleInstantiations(); - -} // GlobalProtocolDecl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/GlobalRecursion.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/GlobalRecursion.java deleted file mode 100644 index a6063a0c4..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/GlobalRecursion.java +++ /dev/null @@ -1,77 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl; - - -/** - * - * A representation of the model object 'Global Recursion'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.GlobalRecursion#getLabel Label}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.GlobalRecursion#getBlock Block}
  • - *
- *

- * - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getGlobalRecursion() - * @model - * @generated - */ -public interface GlobalRecursion extends GlobalInteraction -{ - /** - * Returns the value of the 'Label' attribute. - * - *

- * If the meaning of the 'Label' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Label' attribute. - * @see #setLabel(String) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getGlobalRecursion_Label() - * @model - * @generated - */ - String getLabel(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.GlobalRecursion#getLabel Label}' attribute. - * - * - * @param value the new value of the 'Label' attribute. - * @see #getLabel() - * @generated - */ - void setLabel(String value); - - /** - * Returns the value of the 'Block' containment reference. - * - *

- * If the meaning of the 'Block' containment reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Block' containment reference. - * @see #setBlock(GlobalProtocolBlock) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getGlobalRecursion_Block() - * @model containment="true" - * @generated - */ - GlobalProtocolBlock getBlock(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.GlobalRecursion#getBlock Block}' containment reference. - * - * - * @param value the new value of the 'Block' containment reference. - * @see #getBlock() - * @generated - */ - void setBlock(GlobalProtocolBlock value); - -} // GlobalRecursion diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/ImportDecl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/ImportDecl.java deleted file mode 100644 index 46e5580cd..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/ImportDecl.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Import Decl'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.ImportDecl#getName Name}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.ImportDecl#getAlias Alias}
  • - *
- *

- * - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getImportDecl() - * @model - * @generated - */ -public interface ImportDecl extends EObject -{ - /** - * Returns the value of the 'Name' attribute. - * - *

- * If the meaning of the 'Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Name' attribute. - * @see #setName(String) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getImportDecl_Name() - * @model - * @generated - */ - String getName(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.ImportDecl#getName Name}' attribute. - * - * - * @param value the new value of the 'Name' attribute. - * @see #getName() - * @generated - */ - void setName(String value); - - /** - * Returns the value of the 'Alias' attribute. - * - *

- * If the meaning of the 'Alias' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Alias' attribute. - * @see #setAlias(String) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getImportDecl_Alias() - * @model - * @generated - */ - String getAlias(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.ImportDecl#getAlias Alias}' attribute. - * - * - * @param value the new value of the 'Alias' attribute. - * @see #getAlias() - * @generated - */ - void setAlias(String value); - -} // ImportDecl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/ImportMember.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/ImportMember.java deleted file mode 100644 index 28edb0dd0..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/ImportMember.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl; - - -/** - * - * A representation of the model object 'Import Member'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.ImportMember#getMember Member}
  • - *
- *

- * - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getImportMember() - * @model - * @generated - */ -public interface ImportMember extends ImportDecl -{ - /** - * Returns the value of the 'Member' attribute. - * - *

- * If the meaning of the 'Member' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Member' attribute. - * @see #setMember(String) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getImportMember_Member() - * @model - * @generated - */ - String getMember(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.ImportMember#getMember Member}' attribute. - * - * - * @param value the new value of the 'Member' attribute. - * @see #getMember() - * @generated - */ - void setMember(String value); - -} // ImportMember diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/ImportModule.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/ImportModule.java deleted file mode 100644 index 3777aade1..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/ImportModule.java +++ /dev/null @@ -1,18 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl; - - -/** - * - * A representation of the model object 'Import Module'. - * - * - * - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getImportModule() - * @model - * @generated - */ -public interface ImportModule extends ImportDecl -{ -} // ImportModule diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/LlobalInteraction.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/LlobalInteraction.java deleted file mode 100644 index 483beb6ba..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/LlobalInteraction.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Llobal Interaction'. - * - * - * - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLlobalInteraction() - * @model - * @generated - */ -public interface LlobalInteraction extends EObject -{ -} // LlobalInteraction diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/LocalCatch.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/LocalCatch.java deleted file mode 100644 index a4879f213..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/LocalCatch.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Local Catch'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.LocalCatch#getMessages Messages}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.LocalCatch#getFromRole From Role}
  • - *
- *

- * - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalCatch() - * @model - * @generated - */ -public interface LocalCatch extends EObject -{ - /** - * Returns the value of the 'Messages' containment reference list. - * The list contents are of type {@link org.scribble.editor.dsl.scribbleDsl.Message}. - * - *

- * If the meaning of the 'Messages' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Messages' containment reference list. - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalCatch_Messages() - * @model containment="true" - * @generated - */ - EList getMessages(); - - /** - * Returns the value of the 'From Role' attribute. - * - *

- * If the meaning of the 'From Role' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'From Role' attribute. - * @see #setFromRole(String) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalCatch_FromRole() - * @model - * @generated - */ - String getFromRole(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.LocalCatch#getFromRole From Role}' attribute. - * - * - * @param value the new value of the 'From Role' attribute. - * @see #getFromRole() - * @generated - */ - void setFromRole(String value); - -} // LocalCatch diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/LocalChoice.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/LocalChoice.java deleted file mode 100644 index 5df6e118c..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/LocalChoice.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl; - -import org.eclipse.emf.common.util.EList; - -/** - * - * A representation of the model object 'Local Choice'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.LocalChoice#getRole Role}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.LocalChoice#getBlocks Blocks}
  • - *
- *

- * - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalChoice() - * @model - * @generated - */ -public interface LocalChoice extends LlobalInteraction -{ - /** - * Returns the value of the 'Role' attribute. - * - *

- * If the meaning of the 'Role' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Role' attribute. - * @see #setRole(String) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalChoice_Role() - * @model - * @generated - */ - String getRole(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.LocalChoice#getRole Role}' attribute. - * - * - * @param value the new value of the 'Role' attribute. - * @see #getRole() - * @generated - */ - void setRole(String value); - - /** - * Returns the value of the 'Blocks' containment reference list. - * The list contents are of type {@link org.scribble.editor.dsl.scribbleDsl.LocalProtocolBlock}. - * - *

- * If the meaning of the 'Blocks' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Blocks' containment reference list. - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalChoice_Blocks() - * @model containment="true" - * @generated - */ - EList getBlocks(); - -} // LocalChoice diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/LocalContinue.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/LocalContinue.java deleted file mode 100644 index 717205261..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/LocalContinue.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl; - - -/** - * - * A representation of the model object 'Local Continue'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.LocalContinue#getLabel Label}
  • - *
- *

- * - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalContinue() - * @model - * @generated - */ -public interface LocalContinue extends LlobalInteraction -{ - /** - * Returns the value of the 'Label' attribute. - * - *

- * If the meaning of the 'Label' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Label' attribute. - * @see #setLabel(String) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalContinue_Label() - * @model - * @generated - */ - String getLabel(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.LocalContinue#getLabel Label}' attribute. - * - * - * @param value the new value of the 'Label' attribute. - * @see #getLabel() - * @generated - */ - void setLabel(String value); - -} // LocalContinue diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/LocalDo.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/LocalDo.java deleted file mode 100644 index e53a218be..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/LocalDo.java +++ /dev/null @@ -1,112 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl; - -import org.eclipse.emf.common.util.EList; - -/** - * - * A representation of the model object 'Local Do'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.LocalDo#getScope Scope}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.LocalDo#getMember Member}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.LocalDo#getArguments Arguments}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.LocalDo#getRoles Roles}
  • - *
- *

- * - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalDo() - * @model - * @generated - */ -public interface LocalDo extends LlobalInteraction -{ - /** - * Returns the value of the 'Scope' attribute. - * - *

- * If the meaning of the 'Scope' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Scope' attribute. - * @see #setScope(String) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalDo_Scope() - * @model - * @generated - */ - String getScope(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.LocalDo#getScope Scope}' attribute. - * - * - * @param value the new value of the 'Scope' attribute. - * @see #getScope() - * @generated - */ - void setScope(String value); - - /** - * Returns the value of the 'Member' attribute. - * - *

- * If the meaning of the 'Member' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Member' attribute. - * @see #setMember(String) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalDo_Member() - * @model - * @generated - */ - String getMember(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.LocalDo#getMember Member}' attribute. - * - * - * @param value the new value of the 'Member' attribute. - * @see #getMember() - * @generated - */ - void setMember(String value); - - /** - * Returns the value of the 'Arguments' containment reference list. - * The list contents are of type {@link org.scribble.editor.dsl.scribbleDsl.Argument}. - * - *

- * If the meaning of the 'Arguments' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Arguments' containment reference list. - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalDo_Arguments() - * @model containment="true" - * @generated - */ - EList getArguments(); - - /** - * Returns the value of the 'Roles' containment reference list. - * The list contents are of type {@link org.scribble.editor.dsl.scribbleDsl.RoleInstantiation}. - * - *

- * If the meaning of the 'Roles' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Roles' containment reference list. - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalDo_Roles() - * @model containment="true" - * @generated - */ - EList getRoles(); - -} // LocalDo diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/LocalInterruptible.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/LocalInterruptible.java deleted file mode 100644 index 1eb0d1ec3..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/LocalInterruptible.java +++ /dev/null @@ -1,122 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl; - -import org.eclipse.emf.common.util.EList; - -/** - * - * A representation of the model object 'Local Interruptible'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.LocalInterruptible#getScope Scope}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.LocalInterruptible#getBlock Block}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.LocalInterruptible#getThrow Throw}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.LocalInterruptible#getCatches Catches}
  • - *
- *

- * - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalInterruptible() - * @model - * @generated - */ -public interface LocalInterruptible extends LlobalInteraction -{ - /** - * Returns the value of the 'Scope' attribute. - * - *

- * If the meaning of the 'Scope' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Scope' attribute. - * @see #setScope(String) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalInterruptible_Scope() - * @model - * @generated - */ - String getScope(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.LocalInterruptible#getScope Scope}' attribute. - * - * - * @param value the new value of the 'Scope' attribute. - * @see #getScope() - * @generated - */ - void setScope(String value); - - /** - * Returns the value of the 'Block' containment reference. - * - *

- * If the meaning of the 'Block' containment reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Block' containment reference. - * @see #setBlock(LocalProtocolBlock) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalInterruptible_Block() - * @model containment="true" - * @generated - */ - LocalProtocolBlock getBlock(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.LocalInterruptible#getBlock Block}' containment reference. - * - * - * @param value the new value of the 'Block' containment reference. - * @see #getBlock() - * @generated - */ - void setBlock(LocalProtocolBlock value); - - /** - * Returns the value of the 'Throw' containment reference. - * - *

- * If the meaning of the 'Throw' containment reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Throw' containment reference. - * @see #setThrow(LocalThrow) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalInterruptible_Throw() - * @model containment="true" - * @generated - */ - LocalThrow getThrow(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.LocalInterruptible#getThrow Throw}' containment reference. - * - * - * @param value the new value of the 'Throw' containment reference. - * @see #getThrow() - * @generated - */ - void setThrow(LocalThrow value); - - /** - * Returns the value of the 'Catches' containment reference list. - * The list contents are of type {@link org.scribble.editor.dsl.scribbleDsl.LocalCatch}. - * - *

- * If the meaning of the 'Catches' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Catches' containment reference list. - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalInterruptible_Catches() - * @model containment="true" - * @generated - */ - EList getCatches(); - -} // LocalInterruptible diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/LocalParallel.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/LocalParallel.java deleted file mode 100644 index 100e0f1e4..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/LocalParallel.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl; - -import org.eclipse.emf.common.util.EList; - -/** - * - * A representation of the model object 'Local Parallel'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.LocalParallel#getBlocks Blocks}
  • - *
- *

- * - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalParallel() - * @model - * @generated - */ -public interface LocalParallel extends LlobalInteraction -{ - /** - * Returns the value of the 'Blocks' containment reference list. - * The list contents are of type {@link org.scribble.editor.dsl.scribbleDsl.LocalProtocolBlock}. - * - *

- * If the meaning of the 'Blocks' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Blocks' containment reference list. - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalParallel_Blocks() - * @model containment="true" - * @generated - */ - EList getBlocks(); - -} // LocalParallel diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/LocalProtocolBlock.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/LocalProtocolBlock.java deleted file mode 100644 index adb8c8801..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/LocalProtocolBlock.java +++ /dev/null @@ -1,43 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Local Protocol Block'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.LocalProtocolBlock#getActivities Activities}
  • - *
- *

- * - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalProtocolBlock() - * @model - * @generated - */ -public interface LocalProtocolBlock extends EObject -{ - /** - * Returns the value of the 'Activities' containment reference list. - * The list contents are of type {@link org.scribble.editor.dsl.scribbleDsl.LlobalInteraction}. - * - *

- * If the meaning of the 'Activities' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Activities' containment reference list. - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalProtocolBlock_Activities() - * @model containment="true" - * @generated - */ - EList getActivities(); - -} // LocalProtocolBlock diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/LocalProtocolDecl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/LocalProtocolDecl.java deleted file mode 100644 index b5dfd7430..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/LocalProtocolDecl.java +++ /dev/null @@ -1,202 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Local Protocol Decl'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.LocalProtocolDecl#getName Name}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.LocalProtocolDecl#getRole Role}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.LocalProtocolDecl#getParameters Parameters}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.LocalProtocolDecl#getRoles Roles}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.LocalProtocolDecl#getBlock Block}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.LocalProtocolDecl#getInstantiates Instantiates}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.LocalProtocolDecl#getArguments Arguments}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.LocalProtocolDecl#getRoleInstantiations Role Instantiations}
  • - *
- *

- * - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalProtocolDecl() - * @model - * @generated - */ -public interface LocalProtocolDecl extends EObject -{ - /** - * Returns the value of the 'Name' attribute. - * - *

- * If the meaning of the 'Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Name' attribute. - * @see #setName(String) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalProtocolDecl_Name() - * @model - * @generated - */ - String getName(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.LocalProtocolDecl#getName Name}' attribute. - * - * - * @param value the new value of the 'Name' attribute. - * @see #getName() - * @generated - */ - void setName(String value); - - /** - * Returns the value of the 'Role' attribute. - * - *

- * If the meaning of the 'Role' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Role' attribute. - * @see #setRole(String) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalProtocolDecl_Role() - * @model - * @generated - */ - String getRole(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.LocalProtocolDecl#getRole Role}' attribute. - * - * - * @param value the new value of the 'Role' attribute. - * @see #getRole() - * @generated - */ - void setRole(String value); - - /** - * Returns the value of the 'Parameters' containment reference list. - * The list contents are of type {@link org.scribble.editor.dsl.scribbleDsl.ParameterDecl}. - * - *

- * If the meaning of the 'Parameters' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Parameters' containment reference list. - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalProtocolDecl_Parameters() - * @model containment="true" - * @generated - */ - EList getParameters(); - - /** - * Returns the value of the 'Roles' containment reference list. - * The list contents are of type {@link org.scribble.editor.dsl.scribbleDsl.RoleDecl}. - * - *

- * If the meaning of the 'Roles' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Roles' containment reference list. - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalProtocolDecl_Roles() - * @model containment="true" - * @generated - */ - EList getRoles(); - - /** - * Returns the value of the 'Block' containment reference. - * - *

- * If the meaning of the 'Block' containment reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Block' containment reference. - * @see #setBlock(LocalProtocolBlock) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalProtocolDecl_Block() - * @model containment="true" - * @generated - */ - LocalProtocolBlock getBlock(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.LocalProtocolDecl#getBlock Block}' containment reference. - * - * - * @param value the new value of the 'Block' containment reference. - * @see #getBlock() - * @generated - */ - void setBlock(LocalProtocolBlock value); - - /** - * Returns the value of the 'Instantiates' attribute. - * - *

- * If the meaning of the 'Instantiates' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Instantiates' attribute. - * @see #setInstantiates(String) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalProtocolDecl_Instantiates() - * @model - * @generated - */ - String getInstantiates(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.LocalProtocolDecl#getInstantiates Instantiates}' attribute. - * - * - * @param value the new value of the 'Instantiates' attribute. - * @see #getInstantiates() - * @generated - */ - void setInstantiates(String value); - - /** - * Returns the value of the 'Arguments' containment reference list. - * The list contents are of type {@link org.scribble.editor.dsl.scribbleDsl.Argument}. - * - *

- * If the meaning of the 'Arguments' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Arguments' containment reference list. - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalProtocolDecl_Arguments() - * @model containment="true" - * @generated - */ - EList getArguments(); - - /** - * Returns the value of the 'Role Instantiations' containment reference list. - * The list contents are of type {@link org.scribble.editor.dsl.scribbleDsl.RoleInstantiation}. - * - *

- * If the meaning of the 'Role Instantiations' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Role Instantiations' containment reference list. - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalProtocolDecl_RoleInstantiations() - * @model containment="true" - * @generated - */ - EList getRoleInstantiations(); - -} // LocalProtocolDecl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/LocalReceive.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/LocalReceive.java deleted file mode 100644 index c4a22df0d..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/LocalReceive.java +++ /dev/null @@ -1,77 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl; - - -/** - * - * A representation of the model object 'Local Receive'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.LocalReceive#getMessage Message}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.LocalReceive#getFromRole From Role}
  • - *
- *

- * - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalReceive() - * @model - * @generated - */ -public interface LocalReceive extends LlobalInteraction -{ - /** - * Returns the value of the 'Message' containment reference. - * - *

- * If the meaning of the 'Message' containment reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Message' containment reference. - * @see #setMessage(Message) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalReceive_Message() - * @model containment="true" - * @generated - */ - Message getMessage(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.LocalReceive#getMessage Message}' containment reference. - * - * - * @param value the new value of the 'Message' containment reference. - * @see #getMessage() - * @generated - */ - void setMessage(Message value); - - /** - * Returns the value of the 'From Role' attribute. - * - *

- * If the meaning of the 'From Role' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'From Role' attribute. - * @see #setFromRole(String) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalReceive_FromRole() - * @model - * @generated - */ - String getFromRole(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.LocalReceive#getFromRole From Role}' attribute. - * - * - * @param value the new value of the 'From Role' attribute. - * @see #getFromRole() - * @generated - */ - void setFromRole(String value); - -} // LocalReceive diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/LocalRecursion.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/LocalRecursion.java deleted file mode 100644 index 25af15a2c..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/LocalRecursion.java +++ /dev/null @@ -1,77 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl; - - -/** - * - * A representation of the model object 'Local Recursion'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.LocalRecursion#getLabel Label}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.LocalRecursion#getBlock Block}
  • - *
- *

- * - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalRecursion() - * @model - * @generated - */ -public interface LocalRecursion extends LlobalInteraction -{ - /** - * Returns the value of the 'Label' attribute. - * - *

- * If the meaning of the 'Label' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Label' attribute. - * @see #setLabel(String) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalRecursion_Label() - * @model - * @generated - */ - String getLabel(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.LocalRecursion#getLabel Label}' attribute. - * - * - * @param value the new value of the 'Label' attribute. - * @see #getLabel() - * @generated - */ - void setLabel(String value); - - /** - * Returns the value of the 'Block' containment reference. - * - *

- * If the meaning of the 'Block' containment reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Block' containment reference. - * @see #setBlock(LocalProtocolBlock) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalRecursion_Block() - * @model containment="true" - * @generated - */ - LocalProtocolBlock getBlock(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.LocalRecursion#getBlock Block}' containment reference. - * - * - * @param value the new value of the 'Block' containment reference. - * @see #getBlock() - * @generated - */ - void setBlock(LocalProtocolBlock value); - -} // LocalRecursion diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/LocalSend.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/LocalSend.java deleted file mode 100644 index 68d6d620e..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/LocalSend.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl; - -import org.eclipse.emf.common.util.EList; - -/** - * - * A representation of the model object 'Local Send'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.LocalSend#getMessage Message}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.LocalSend#getToRoles To Roles}
  • - *
- *

- * - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalSend() - * @model - * @generated - */ -public interface LocalSend extends LlobalInteraction -{ - /** - * Returns the value of the 'Message' containment reference. - * - *

- * If the meaning of the 'Message' containment reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Message' containment reference. - * @see #setMessage(Message) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalSend_Message() - * @model containment="true" - * @generated - */ - Message getMessage(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.LocalSend#getMessage Message}' containment reference. - * - * - * @param value the new value of the 'Message' containment reference. - * @see #getMessage() - * @generated - */ - void setMessage(Message value); - - /** - * Returns the value of the 'To Roles' attribute list. - * The list contents are of type {@link java.lang.String}. - * - *

- * If the meaning of the 'To Roles' attribute list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'To Roles' attribute list. - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalSend_ToRoles() - * @model unique="false" - * @generated - */ - EList getToRoles(); - -} // LocalSend diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/LocalThrow.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/LocalThrow.java deleted file mode 100644 index ee8bbb5a6..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/LocalThrow.java +++ /dev/null @@ -1,60 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Local Throw'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.LocalThrow#getMessages Messages}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.LocalThrow#getToRoles To Roles}
  • - *
- *

- * - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalThrow() - * @model - * @generated - */ -public interface LocalThrow extends EObject -{ - /** - * Returns the value of the 'Messages' containment reference list. - * The list contents are of type {@link org.scribble.editor.dsl.scribbleDsl.Message}. - * - *

- * If the meaning of the 'Messages' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Messages' containment reference list. - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalThrow_Messages() - * @model containment="true" - * @generated - */ - EList getMessages(); - - /** - * Returns the value of the 'To Roles' attribute list. - * The list contents are of type {@link java.lang.String}. - * - *

- * If the meaning of the 'To Roles' attribute list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'To Roles' attribute list. - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getLocalThrow_ToRoles() - * @model unique="false" - * @generated - */ - EList getToRoles(); - -} // LocalThrow diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/Message.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/Message.java deleted file mode 100644 index 23f322fa3..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/Message.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Message'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.Message#getSignature Signature}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.Message#getParameter Parameter}
  • - *
- *

- * - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getMessage() - * @model - * @generated - */ -public interface Message extends EObject -{ - /** - * Returns the value of the 'Signature' containment reference. - * - *

- * If the meaning of the 'Signature' containment reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Signature' containment reference. - * @see #setSignature(MessageSignature) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getMessage_Signature() - * @model containment="true" - * @generated - */ - MessageSignature getSignature(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.Message#getSignature Signature}' containment reference. - * - * - * @param value the new value of the 'Signature' containment reference. - * @see #getSignature() - * @generated - */ - void setSignature(MessageSignature value); - - /** - * Returns the value of the 'Parameter' attribute. - * - *

- * If the meaning of the 'Parameter' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Parameter' attribute. - * @see #setParameter(String) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getMessage_Parameter() - * @model - * @generated - */ - String getParameter(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.Message#getParameter Parameter}' attribute. - * - * - * @param value the new value of the 'Parameter' attribute. - * @see #getParameter() - * @generated - */ - void setParameter(String value); - -} // Message diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/MessageSignature.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/MessageSignature.java deleted file mode 100644 index 3c29b2edc..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/MessageSignature.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Message Signature'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.MessageSignature#getOperator Operator}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.MessageSignature#getTypes Types}
  • - *
- *

- * - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getMessageSignature() - * @model - * @generated - */ -public interface MessageSignature extends EObject -{ - /** - * Returns the value of the 'Operator' attribute. - * - *

- * If the meaning of the 'Operator' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Operator' attribute. - * @see #setOperator(String) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getMessageSignature_Operator() - * @model - * @generated - */ - String getOperator(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.MessageSignature#getOperator Operator}' attribute. - * - * - * @param value the new value of the 'Operator' attribute. - * @see #getOperator() - * @generated - */ - void setOperator(String value); - - /** - * Returns the value of the 'Types' containment reference list. - * The list contents are of type {@link org.scribble.editor.dsl.scribbleDsl.PayloadElement}. - * - *

- * If the meaning of the 'Types' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Types' containment reference list. - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getMessageSignature_Types() - * @model containment="true" - * @generated - */ - EList getTypes(); - -} // MessageSignature diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/Module.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/Module.java deleted file mode 100644 index e4d54b6a5..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/Module.java +++ /dev/null @@ -1,121 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Module'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.Module#getName Name}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.Module#getImports Imports}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.Module#getTypes Types}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.Module#getGlobals Globals}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.Module#getLocals Locals}
  • - *
- *

- * - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getModule() - * @model - * @generated - */ -public interface Module extends EObject -{ - /** - * Returns the value of the 'Name' attribute. - * - *

- * If the meaning of the 'Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Name' attribute. - * @see #setName(String) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getModule_Name() - * @model - * @generated - */ - String getName(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.Module#getName Name}' attribute. - * - * - * @param value the new value of the 'Name' attribute. - * @see #getName() - * @generated - */ - void setName(String value); - - /** - * Returns the value of the 'Imports' containment reference list. - * The list contents are of type {@link org.scribble.editor.dsl.scribbleDsl.ImportDecl}. - * - *

- * If the meaning of the 'Imports' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Imports' containment reference list. - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getModule_Imports() - * @model containment="true" - * @generated - */ - EList getImports(); - - /** - * Returns the value of the 'Types' containment reference list. - * The list contents are of type {@link org.scribble.editor.dsl.scribbleDsl.PayloadTypeDecl}. - * - *

- * If the meaning of the 'Types' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Types' containment reference list. - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getModule_Types() - * @model containment="true" - * @generated - */ - EList getTypes(); - - /** - * Returns the value of the 'Globals' containment reference list. - * The list contents are of type {@link org.scribble.editor.dsl.scribbleDsl.GlobalProtocolDecl}. - * - *

- * If the meaning of the 'Globals' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Globals' containment reference list. - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getModule_Globals() - * @model containment="true" - * @generated - */ - EList getGlobals(); - - /** - * Returns the value of the 'Locals' containment reference list. - * The list contents are of type {@link org.scribble.editor.dsl.scribbleDsl.LocalProtocolDecl}. - * - *

- * If the meaning of the 'Locals' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Locals' containment reference list. - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getModule_Locals() - * @model containment="true" - * @generated - */ - EList getLocals(); - -} // Module diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/ParameterDecl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/ParameterDecl.java deleted file mode 100644 index 14b08bbbd..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/ParameterDecl.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Parameter Decl'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.ParameterDecl#getName Name}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.ParameterDecl#getAlias Alias}
  • - *
- *

- * - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getParameterDecl() - * @model - * @generated - */ -public interface ParameterDecl extends EObject -{ - /** - * Returns the value of the 'Name' attribute. - * - *

- * If the meaning of the 'Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Name' attribute. - * @see #setName(String) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getParameterDecl_Name() - * @model - * @generated - */ - String getName(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.ParameterDecl#getName Name}' attribute. - * - * - * @param value the new value of the 'Name' attribute. - * @see #getName() - * @generated - */ - void setName(String value); - - /** - * Returns the value of the 'Alias' attribute. - * - *

- * If the meaning of the 'Alias' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Alias' attribute. - * @see #setAlias(String) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getParameterDecl_Alias() - * @model - * @generated - */ - String getAlias(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.ParameterDecl#getAlias Alias}' attribute. - * - * - * @param value the new value of the 'Alias' attribute. - * @see #getAlias() - * @generated - */ - void setAlias(String value); - -} // ParameterDecl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/PayloadElement.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/PayloadElement.java deleted file mode 100644 index befd951b3..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/PayloadElement.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Payload Element'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.PayloadElement#getName Name}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.PayloadElement#getType Type}
  • - *
- *

- * - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getPayloadElement() - * @model - * @generated - */ -public interface PayloadElement extends EObject -{ - /** - * Returns the value of the 'Name' attribute. - * - *

- * If the meaning of the 'Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Name' attribute. - * @see #setName(String) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getPayloadElement_Name() - * @model - * @generated - */ - String getName(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.PayloadElement#getName Name}' attribute. - * - * - * @param value the new value of the 'Name' attribute. - * @see #getName() - * @generated - */ - void setName(String value); - - /** - * Returns the value of the 'Type' attribute. - * - *

- * If the meaning of the 'Type' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Type' attribute. - * @see #setType(String) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getPayloadElement_Type() - * @model - * @generated - */ - String getType(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.PayloadElement#getType Type}' attribute. - * - * - * @param value the new value of the 'Type' attribute. - * @see #getType() - * @generated - */ - void setType(String value); - -} // PayloadElement diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/PayloadTypeDecl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/PayloadTypeDecl.java deleted file mode 100644 index 797339833..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/PayloadTypeDecl.java +++ /dev/null @@ -1,132 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Payload Type Decl'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.PayloadTypeDecl#getSchema Schema}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.PayloadTypeDecl#getType Type}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.PayloadTypeDecl#getLocation Location}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.PayloadTypeDecl#getAlias Alias}
  • - *
- *

- * - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getPayloadTypeDecl() - * @model - * @generated - */ -public interface PayloadTypeDecl extends EObject -{ - /** - * Returns the value of the 'Schema' attribute. - * - *

- * If the meaning of the 'Schema' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Schema' attribute. - * @see #setSchema(String) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getPayloadTypeDecl_Schema() - * @model - * @generated - */ - String getSchema(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.PayloadTypeDecl#getSchema Schema}' attribute. - * - * - * @param value the new value of the 'Schema' attribute. - * @see #getSchema() - * @generated - */ - void setSchema(String value); - - /** - * Returns the value of the 'Type' attribute. - * - *

- * If the meaning of the 'Type' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Type' attribute. - * @see #setType(String) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getPayloadTypeDecl_Type() - * @model - * @generated - */ - String getType(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.PayloadTypeDecl#getType Type}' attribute. - * - * - * @param value the new value of the 'Type' attribute. - * @see #getType() - * @generated - */ - void setType(String value); - - /** - * Returns the value of the 'Location' attribute. - * - *

- * If the meaning of the 'Location' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Location' attribute. - * @see #setLocation(String) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getPayloadTypeDecl_Location() - * @model - * @generated - */ - String getLocation(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.PayloadTypeDecl#getLocation Location}' attribute. - * - * - * @param value the new value of the 'Location' attribute. - * @see #getLocation() - * @generated - */ - void setLocation(String value); - - /** - * Returns the value of the 'Alias' attribute. - * - *

- * If the meaning of the 'Alias' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Alias' attribute. - * @see #setAlias(String) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getPayloadTypeDecl_Alias() - * @model - * @generated - */ - String getAlias(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.PayloadTypeDecl#getAlias Alias}' attribute. - * - * - * @param value the new value of the 'Alias' attribute. - * @see #getAlias() - * @generated - */ - void setAlias(String value); - -} // PayloadTypeDecl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/RoleDecl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/RoleDecl.java deleted file mode 100644 index 67e7a2252..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/RoleDecl.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Role Decl'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.RoleDecl#getName Name}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.RoleDecl#getAlias Alias}
  • - *
- *

- * - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getRoleDecl() - * @model - * @generated - */ -public interface RoleDecl extends EObject -{ - /** - * Returns the value of the 'Name' attribute. - * - *

- * If the meaning of the 'Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Name' attribute. - * @see #setName(String) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getRoleDecl_Name() - * @model - * @generated - */ - String getName(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.RoleDecl#getName Name}' attribute. - * - * - * @param value the new value of the 'Name' attribute. - * @see #getName() - * @generated - */ - void setName(String value); - - /** - * Returns the value of the 'Alias' attribute. - * - *

- * If the meaning of the 'Alias' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Alias' attribute. - * @see #setAlias(String) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getRoleDecl_Alias() - * @model - * @generated - */ - String getAlias(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.RoleDecl#getAlias Alias}' attribute. - * - * - * @param value the new value of the 'Alias' attribute. - * @see #getAlias() - * @generated - */ - void setAlias(String value); - -} // RoleDecl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/RoleInstantiation.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/RoleInstantiation.java deleted file mode 100644 index 44ed0072c..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/RoleInstantiation.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Role Instantiation'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.RoleInstantiation#getName Name}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.RoleInstantiation#getAlias Alias}
  • - *
- *

- * - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getRoleInstantiation() - * @model - * @generated - */ -public interface RoleInstantiation extends EObject -{ - /** - * Returns the value of the 'Name' attribute. - * - *

- * If the meaning of the 'Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Name' attribute. - * @see #setName(String) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getRoleInstantiation_Name() - * @model - * @generated - */ - String getName(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.RoleInstantiation#getName Name}' attribute. - * - * - * @param value the new value of the 'Name' attribute. - * @see #getName() - * @generated - */ - void setName(String value); - - /** - * Returns the value of the 'Alias' attribute. - * - *

- * If the meaning of the 'Alias' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Alias' attribute. - * @see #setAlias(String) - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#getRoleInstantiation_Alias() - * @model - * @generated - */ - String getAlias(); - - /** - * Sets the value of the '{@link org.scribble.editor.dsl.scribbleDsl.RoleInstantiation#getAlias Alias}' attribute. - * - * - * @param value the new value of the 'Alias' attribute. - * @see #getAlias() - * @generated - */ - void setAlias(String value); - -} // RoleInstantiation diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/ScribbleDslFactory.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/ScribbleDslFactory.java deleted file mode 100644 index e1961ce9c..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/ScribbleDslFactory.java +++ /dev/null @@ -1,358 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl; - -import org.eclipse.emf.ecore.EFactory; - -/** - * - * The Factory for the model. - * It provides a create method for each non-abstract class of the model. - * - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage - * @generated - */ -public interface ScribbleDslFactory extends EFactory -{ - /** - * The singleton instance of the factory. - * - * - * @generated - */ - ScribbleDslFactory eINSTANCE = org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslFactoryImpl.init(); - - /** - * Returns a new object of class 'Module'. - * - * - * @return a new object of class 'Module'. - * @generated - */ - Module createModule(); - - /** - * Returns a new object of class 'Import Decl'. - * - * - * @return a new object of class 'Import Decl'. - * @generated - */ - ImportDecl createImportDecl(); - - /** - * Returns a new object of class 'Import Module'. - * - * - * @return a new object of class 'Import Module'. - * @generated - */ - ImportModule createImportModule(); - - /** - * Returns a new object of class 'Import Member'. - * - * - * @return a new object of class 'Import Member'. - * @generated - */ - ImportMember createImportMember(); - - /** - * Returns a new object of class 'Payload Type Decl'. - * - * - * @return a new object of class 'Payload Type Decl'. - * @generated - */ - PayloadTypeDecl createPayloadTypeDecl(); - - /** - * Returns a new object of class 'Message Signature'. - * - * - * @return a new object of class 'Message Signature'. - * @generated - */ - MessageSignature createMessageSignature(); - - /** - * Returns a new object of class 'Payload Element'. - * - * - * @return a new object of class 'Payload Element'. - * @generated - */ - PayloadElement createPayloadElement(); - - /** - * Returns a new object of class 'Global Protocol Decl'. - * - * - * @return a new object of class 'Global Protocol Decl'. - * @generated - */ - GlobalProtocolDecl createGlobalProtocolDecl(); - - /** - * Returns a new object of class 'Role Decl'. - * - * - * @return a new object of class 'Role Decl'. - * @generated - */ - RoleDecl createRoleDecl(); - - /** - * Returns a new object of class 'Parameter Decl'. - * - * - * @return a new object of class 'Parameter Decl'. - * @generated - */ - ParameterDecl createParameterDecl(); - - /** - * Returns a new object of class 'Role Instantiation'. - * - * - * @return a new object of class 'Role Instantiation'. - * @generated - */ - RoleInstantiation createRoleInstantiation(); - - /** - * Returns a new object of class 'Argument'. - * - * - * @return a new object of class 'Argument'. - * @generated - */ - Argument createArgument(); - - /** - * Returns a new object of class 'Global Protocol Block'. - * - * - * @return a new object of class 'Global Protocol Block'. - * @generated - */ - GlobalProtocolBlock createGlobalProtocolBlock(); - - /** - * Returns a new object of class 'Global Interaction'. - * - * - * @return a new object of class 'Global Interaction'. - * @generated - */ - GlobalInteraction createGlobalInteraction(); - - /** - * Returns a new object of class 'Global Message Transfer'. - * - * - * @return a new object of class 'Global Message Transfer'. - * @generated - */ - GlobalMessageTransfer createGlobalMessageTransfer(); - - /** - * Returns a new object of class 'Message'. - * - * - * @return a new object of class 'Message'. - * @generated - */ - Message createMessage(); - - /** - * Returns a new object of class 'Global Choice'. - * - * - * @return a new object of class 'Global Choice'. - * @generated - */ - GlobalChoice createGlobalChoice(); - - /** - * Returns a new object of class 'Global Recursion'. - * - * - * @return a new object of class 'Global Recursion'. - * @generated - */ - GlobalRecursion createGlobalRecursion(); - - /** - * Returns a new object of class 'Global Continue'. - * - * - * @return a new object of class 'Global Continue'. - * @generated - */ - GlobalContinue createGlobalContinue(); - - /** - * Returns a new object of class 'Global Parallel'. - * - * - * @return a new object of class 'Global Parallel'. - * @generated - */ - GlobalParallel createGlobalParallel(); - - /** - * Returns a new object of class 'Global Interruptible'. - * - * - * @return a new object of class 'Global Interruptible'. - * @generated - */ - GlobalInterruptible createGlobalInterruptible(); - - /** - * Returns a new object of class 'Global Interrupt'. - * - * - * @return a new object of class 'Global Interrupt'. - * @generated - */ - GlobalInterrupt createGlobalInterrupt(); - - /** - * Returns a new object of class 'Global Do'. - * - * - * @return a new object of class 'Global Do'. - * @generated - */ - GlobalDo createGlobalDo(); - - /** - * Returns a new object of class 'Local Protocol Decl'. - * - * - * @return a new object of class 'Local Protocol Decl'. - * @generated - */ - LocalProtocolDecl createLocalProtocolDecl(); - - /** - * Returns a new object of class 'Local Protocol Block'. - * - * - * @return a new object of class 'Local Protocol Block'. - * @generated - */ - LocalProtocolBlock createLocalProtocolBlock(); - - /** - * Returns a new object of class 'Llobal Interaction'. - * - * - * @return a new object of class 'Llobal Interaction'. - * @generated - */ - LlobalInteraction createLlobalInteraction(); - - /** - * Returns a new object of class 'Local Send'. - * - * - * @return a new object of class 'Local Send'. - * @generated - */ - LocalSend createLocalSend(); - - /** - * Returns a new object of class 'Local Receive'. - * - * - * @return a new object of class 'Local Receive'. - * @generated - */ - LocalReceive createLocalReceive(); - - /** - * Returns a new object of class 'Local Choice'. - * - * - * @return a new object of class 'Local Choice'. - * @generated - */ - LocalChoice createLocalChoice(); - - /** - * Returns a new object of class 'Local Recursion'. - * - * - * @return a new object of class 'Local Recursion'. - * @generated - */ - LocalRecursion createLocalRecursion(); - - /** - * Returns a new object of class 'Local Continue'. - * - * - * @return a new object of class 'Local Continue'. - * @generated - */ - LocalContinue createLocalContinue(); - - /** - * Returns a new object of class 'Local Parallel'. - * - * - * @return a new object of class 'Local Parallel'. - * @generated - */ - LocalParallel createLocalParallel(); - - /** - * Returns a new object of class 'Local Interruptible'. - * - * - * @return a new object of class 'Local Interruptible'. - * @generated - */ - LocalInterruptible createLocalInterruptible(); - - /** - * Returns a new object of class 'Local Throw'. - * - * - * @return a new object of class 'Local Throw'. - * @generated - */ - LocalThrow createLocalThrow(); - - /** - * Returns a new object of class 'Local Catch'. - * - * - * @return a new object of class 'Local Catch'. - * @generated - */ - LocalCatch createLocalCatch(); - - /** - * Returns a new object of class 'Local Do'. - * - * - * @return a new object of class 'Local Do'. - * @generated - */ - LocalDo createLocalDo(); - - /** - * Returns the package supported by this factory. - * - * - * @return the package supported by this factory. - * @generated - */ - ScribbleDslPackage getScribbleDslPackage(); - -} //ScribbleDslFactory diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/ScribbleDslPackage.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/ScribbleDslPackage.java deleted file mode 100644 index 75f9d2676..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/ScribbleDslPackage.java +++ /dev/null @@ -1,3877 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl; - -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; - -/** - * - * The Package for the model. - * It contains accessors for the meta objects to represent - *
    - *
  • each class,
  • - *
  • each feature of each class,
  • - *
  • each enum,
  • - *
  • and each data type
  • - *
- * - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslFactory - * @model kind="package" - * @generated - */ -public interface ScribbleDslPackage extends EPackage -{ - /** - * The package name. - * - * - * @generated - */ - String eNAME = "scribbleDsl"; - - /** - * The package namespace URI. - * - * - * @generated - */ - String eNS_URI = "http://www.scribble.org/editor/dsl/ScribbleDsl"; - - /** - * The package namespace name. - * - * - * @generated - */ - String eNS_PREFIX = "scribbleDsl"; - - /** - * The singleton instance of the package. - * - * - * @generated - */ - ScribbleDslPackage eINSTANCE = org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl.init(); - - /** - * The meta object id for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.ModuleImpl Module}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.ModuleImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getModule() - * @generated - */ - int MODULE = 0; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - int MODULE__NAME = 0; - - /** - * The feature id for the 'Imports' containment reference list. - * - * - * @generated - * @ordered - */ - int MODULE__IMPORTS = 1; - - /** - * The feature id for the 'Types' containment reference list. - * - * - * @generated - * @ordered - */ - int MODULE__TYPES = 2; - - /** - * The feature id for the 'Globals' containment reference list. - * - * - * @generated - * @ordered - */ - int MODULE__GLOBALS = 3; - - /** - * The feature id for the 'Locals' containment reference list. - * - * - * @generated - * @ordered - */ - int MODULE__LOCALS = 4; - - /** - * The number of structural features of the 'Module' class. - * - * - * @generated - * @ordered - */ - int MODULE_FEATURE_COUNT = 5; - - /** - * The meta object id for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.ImportDeclImpl Import Decl}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.ImportDeclImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getImportDecl() - * @generated - */ - int IMPORT_DECL = 1; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - int IMPORT_DECL__NAME = 0; - - /** - * The feature id for the 'Alias' attribute. - * - * - * @generated - * @ordered - */ - int IMPORT_DECL__ALIAS = 1; - - /** - * The number of structural features of the 'Import Decl' class. - * - * - * @generated - * @ordered - */ - int IMPORT_DECL_FEATURE_COUNT = 2; - - /** - * The meta object id for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.ImportModuleImpl Import Module}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.ImportModuleImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getImportModule() - * @generated - */ - int IMPORT_MODULE = 2; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - int IMPORT_MODULE__NAME = IMPORT_DECL__NAME; - - /** - * The feature id for the 'Alias' attribute. - * - * - * @generated - * @ordered - */ - int IMPORT_MODULE__ALIAS = IMPORT_DECL__ALIAS; - - /** - * The number of structural features of the 'Import Module' class. - * - * - * @generated - * @ordered - */ - int IMPORT_MODULE_FEATURE_COUNT = IMPORT_DECL_FEATURE_COUNT + 0; - - /** - * The meta object id for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.ImportMemberImpl Import Member}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.ImportMemberImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getImportMember() - * @generated - */ - int IMPORT_MEMBER = 3; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - int IMPORT_MEMBER__NAME = IMPORT_DECL__NAME; - - /** - * The feature id for the 'Alias' attribute. - * - * - * @generated - * @ordered - */ - int IMPORT_MEMBER__ALIAS = IMPORT_DECL__ALIAS; - - /** - * The feature id for the 'Member' attribute. - * - * - * @generated - * @ordered - */ - int IMPORT_MEMBER__MEMBER = IMPORT_DECL_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'Import Member' class. - * - * - * @generated - * @ordered - */ - int IMPORT_MEMBER_FEATURE_COUNT = IMPORT_DECL_FEATURE_COUNT + 1; - - /** - * The meta object id for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.PayloadTypeDeclImpl Payload Type Decl}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.PayloadTypeDeclImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getPayloadTypeDecl() - * @generated - */ - int PAYLOAD_TYPE_DECL = 4; - - /** - * The feature id for the 'Schema' attribute. - * - * - * @generated - * @ordered - */ - int PAYLOAD_TYPE_DECL__SCHEMA = 0; - - /** - * The feature id for the 'Type' attribute. - * - * - * @generated - * @ordered - */ - int PAYLOAD_TYPE_DECL__TYPE = 1; - - /** - * The feature id for the 'Location' attribute. - * - * - * @generated - * @ordered - */ - int PAYLOAD_TYPE_DECL__LOCATION = 2; - - /** - * The feature id for the 'Alias' attribute. - * - * - * @generated - * @ordered - */ - int PAYLOAD_TYPE_DECL__ALIAS = 3; - - /** - * The number of structural features of the 'Payload Type Decl' class. - * - * - * @generated - * @ordered - */ - int PAYLOAD_TYPE_DECL_FEATURE_COUNT = 4; - - /** - * The meta object id for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.MessageSignatureImpl Message Signature}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.MessageSignatureImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getMessageSignature() - * @generated - */ - int MESSAGE_SIGNATURE = 5; - - /** - * The feature id for the 'Operator' attribute. - * - * - * @generated - * @ordered - */ - int MESSAGE_SIGNATURE__OPERATOR = 0; - - /** - * The feature id for the 'Types' containment reference list. - * - * - * @generated - * @ordered - */ - int MESSAGE_SIGNATURE__TYPES = 1; - - /** - * The number of structural features of the 'Message Signature' class. - * - * - * @generated - * @ordered - */ - int MESSAGE_SIGNATURE_FEATURE_COUNT = 2; - - /** - * The meta object id for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.PayloadElementImpl Payload Element}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.PayloadElementImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getPayloadElement() - * @generated - */ - int PAYLOAD_ELEMENT = 6; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - int PAYLOAD_ELEMENT__NAME = 0; - - /** - * The feature id for the 'Type' attribute. - * - * - * @generated - * @ordered - */ - int PAYLOAD_ELEMENT__TYPE = 1; - - /** - * The number of structural features of the 'Payload Element' class. - * - * - * @generated - * @ordered - */ - int PAYLOAD_ELEMENT_FEATURE_COUNT = 2; - - /** - * The meta object id for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalProtocolDeclImpl Global Protocol Decl}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.GlobalProtocolDeclImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getGlobalProtocolDecl() - * @generated - */ - int GLOBAL_PROTOCOL_DECL = 7; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - int GLOBAL_PROTOCOL_DECL__NAME = 0; - - /** - * The feature id for the 'Parameters' containment reference list. - * - * - * @generated - * @ordered - */ - int GLOBAL_PROTOCOL_DECL__PARAMETERS = 1; - - /** - * The feature id for the 'Roles' containment reference list. - * - * - * @generated - * @ordered - */ - int GLOBAL_PROTOCOL_DECL__ROLES = 2; - - /** - * The feature id for the 'Block' containment reference. - * - * - * @generated - * @ordered - */ - int GLOBAL_PROTOCOL_DECL__BLOCK = 3; - - /** - * The feature id for the 'Instantiates' attribute. - * - * - * @generated - * @ordered - */ - int GLOBAL_PROTOCOL_DECL__INSTANTIATES = 4; - - /** - * The feature id for the 'Arguments' containment reference list. - * - * - * @generated - * @ordered - */ - int GLOBAL_PROTOCOL_DECL__ARGUMENTS = 5; - - /** - * The feature id for the 'Role Instantiations' containment reference list. - * - * - * @generated - * @ordered - */ - int GLOBAL_PROTOCOL_DECL__ROLE_INSTANTIATIONS = 6; - - /** - * The number of structural features of the 'Global Protocol Decl' class. - * - * - * @generated - * @ordered - */ - int GLOBAL_PROTOCOL_DECL_FEATURE_COUNT = 7; - - /** - * The meta object id for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.RoleDeclImpl Role Decl}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.RoleDeclImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getRoleDecl() - * @generated - */ - int ROLE_DECL = 8; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - int ROLE_DECL__NAME = 0; - - /** - * The feature id for the 'Alias' attribute. - * - * - * @generated - * @ordered - */ - int ROLE_DECL__ALIAS = 1; - - /** - * The number of structural features of the 'Role Decl' class. - * - * - * @generated - * @ordered - */ - int ROLE_DECL_FEATURE_COUNT = 2; - - /** - * The meta object id for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.ParameterDeclImpl Parameter Decl}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.ParameterDeclImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getParameterDecl() - * @generated - */ - int PARAMETER_DECL = 9; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - int PARAMETER_DECL__NAME = 0; - - /** - * The feature id for the 'Alias' attribute. - * - * - * @generated - * @ordered - */ - int PARAMETER_DECL__ALIAS = 1; - - /** - * The number of structural features of the 'Parameter Decl' class. - * - * - * @generated - * @ordered - */ - int PARAMETER_DECL_FEATURE_COUNT = 2; - - /** - * The meta object id for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.RoleInstantiationImpl Role Instantiation}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.RoleInstantiationImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getRoleInstantiation() - * @generated - */ - int ROLE_INSTANTIATION = 10; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - int ROLE_INSTANTIATION__NAME = 0; - - /** - * The feature id for the 'Alias' attribute. - * - * - * @generated - * @ordered - */ - int ROLE_INSTANTIATION__ALIAS = 1; - - /** - * The number of structural features of the 'Role Instantiation' class. - * - * - * @generated - * @ordered - */ - int ROLE_INSTANTIATION_FEATURE_COUNT = 2; - - /** - * The meta object id for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.ArgumentImpl Argument}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.ArgumentImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getArgument() - * @generated - */ - int ARGUMENT = 11; - - /** - * The feature id for the 'Signature' containment reference. - * - * - * @generated - * @ordered - */ - int ARGUMENT__SIGNATURE = 0; - - /** - * The feature id for the 'Alias' attribute. - * - * - * @generated - * @ordered - */ - int ARGUMENT__ALIAS = 1; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - int ARGUMENT__NAME = 2; - - /** - * The number of structural features of the 'Argument' class. - * - * - * @generated - * @ordered - */ - int ARGUMENT_FEATURE_COUNT = 3; - - /** - * The meta object id for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalProtocolBlockImpl Global Protocol Block}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.GlobalProtocolBlockImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getGlobalProtocolBlock() - * @generated - */ - int GLOBAL_PROTOCOL_BLOCK = 12; - - /** - * The feature id for the 'Activities' containment reference list. - * - * - * @generated - * @ordered - */ - int GLOBAL_PROTOCOL_BLOCK__ACTIVITIES = 0; - - /** - * The number of structural features of the 'Global Protocol Block' class. - * - * - * @generated - * @ordered - */ - int GLOBAL_PROTOCOL_BLOCK_FEATURE_COUNT = 1; - - /** - * The meta object id for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalInteractionImpl Global Interaction}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.GlobalInteractionImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getGlobalInteraction() - * @generated - */ - int GLOBAL_INTERACTION = 13; - - /** - * The number of structural features of the 'Global Interaction' class. - * - * - * @generated - * @ordered - */ - int GLOBAL_INTERACTION_FEATURE_COUNT = 0; - - /** - * The meta object id for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalMessageTransferImpl Global Message Transfer}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.GlobalMessageTransferImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getGlobalMessageTransfer() - * @generated - */ - int GLOBAL_MESSAGE_TRANSFER = 14; - - /** - * The feature id for the 'Message' containment reference. - * - * - * @generated - * @ordered - */ - int GLOBAL_MESSAGE_TRANSFER__MESSAGE = GLOBAL_INTERACTION_FEATURE_COUNT + 0; - - /** - * The feature id for the 'From Role' attribute. - * - * - * @generated - * @ordered - */ - int GLOBAL_MESSAGE_TRANSFER__FROM_ROLE = GLOBAL_INTERACTION_FEATURE_COUNT + 1; - - /** - * The feature id for the 'To Roles' attribute list. - * - * - * @generated - * @ordered - */ - int GLOBAL_MESSAGE_TRANSFER__TO_ROLES = GLOBAL_INTERACTION_FEATURE_COUNT + 2; - - /** - * The number of structural features of the 'Global Message Transfer' class. - * - * - * @generated - * @ordered - */ - int GLOBAL_MESSAGE_TRANSFER_FEATURE_COUNT = GLOBAL_INTERACTION_FEATURE_COUNT + 3; - - /** - * The meta object id for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.MessageImpl Message}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.MessageImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getMessage() - * @generated - */ - int MESSAGE = 15; - - /** - * The feature id for the 'Signature' containment reference. - * - * - * @generated - * @ordered - */ - int MESSAGE__SIGNATURE = 0; - - /** - * The feature id for the 'Parameter' attribute. - * - * - * @generated - * @ordered - */ - int MESSAGE__PARAMETER = 1; - - /** - * The number of structural features of the 'Message' class. - * - * - * @generated - * @ordered - */ - int MESSAGE_FEATURE_COUNT = 2; - - /** - * The meta object id for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalChoiceImpl Global Choice}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.GlobalChoiceImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getGlobalChoice() - * @generated - */ - int GLOBAL_CHOICE = 16; - - /** - * The feature id for the 'Role' attribute. - * - * - * @generated - * @ordered - */ - int GLOBAL_CHOICE__ROLE = GLOBAL_INTERACTION_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Blocks' containment reference list. - * - * - * @generated - * @ordered - */ - int GLOBAL_CHOICE__BLOCKS = GLOBAL_INTERACTION_FEATURE_COUNT + 1; - - /** - * The number of structural features of the 'Global Choice' class. - * - * - * @generated - * @ordered - */ - int GLOBAL_CHOICE_FEATURE_COUNT = GLOBAL_INTERACTION_FEATURE_COUNT + 2; - - /** - * The meta object id for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalRecursionImpl Global Recursion}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.GlobalRecursionImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getGlobalRecursion() - * @generated - */ - int GLOBAL_RECURSION = 17; - - /** - * The feature id for the 'Label' attribute. - * - * - * @generated - * @ordered - */ - int GLOBAL_RECURSION__LABEL = GLOBAL_INTERACTION_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Block' containment reference. - * - * - * @generated - * @ordered - */ - int GLOBAL_RECURSION__BLOCK = GLOBAL_INTERACTION_FEATURE_COUNT + 1; - - /** - * The number of structural features of the 'Global Recursion' class. - * - * - * @generated - * @ordered - */ - int GLOBAL_RECURSION_FEATURE_COUNT = GLOBAL_INTERACTION_FEATURE_COUNT + 2; - - /** - * The meta object id for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalContinueImpl Global Continue}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.GlobalContinueImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getGlobalContinue() - * @generated - */ - int GLOBAL_CONTINUE = 18; - - /** - * The feature id for the 'Label' attribute. - * - * - * @generated - * @ordered - */ - int GLOBAL_CONTINUE__LABEL = GLOBAL_INTERACTION_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'Global Continue' class. - * - * - * @generated - * @ordered - */ - int GLOBAL_CONTINUE_FEATURE_COUNT = GLOBAL_INTERACTION_FEATURE_COUNT + 1; - - /** - * The meta object id for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalParallelImpl Global Parallel}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.GlobalParallelImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getGlobalParallel() - * @generated - */ - int GLOBAL_PARALLEL = 19; - - /** - * The feature id for the 'Blocks' containment reference list. - * - * - * @generated - * @ordered - */ - int GLOBAL_PARALLEL__BLOCKS = GLOBAL_INTERACTION_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'Global Parallel' class. - * - * - * @generated - * @ordered - */ - int GLOBAL_PARALLEL_FEATURE_COUNT = GLOBAL_INTERACTION_FEATURE_COUNT + 1; - - /** - * The meta object id for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalInterruptibleImpl Global Interruptible}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.GlobalInterruptibleImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getGlobalInterruptible() - * @generated - */ - int GLOBAL_INTERRUPTIBLE = 20; - - /** - * The feature id for the 'Scope' attribute. - * - * - * @generated - * @ordered - */ - int GLOBAL_INTERRUPTIBLE__SCOPE = GLOBAL_INTERACTION_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Block' containment reference. - * - * - * @generated - * @ordered - */ - int GLOBAL_INTERRUPTIBLE__BLOCK = GLOBAL_INTERACTION_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Interrupts' containment reference list. - * - * - * @generated - * @ordered - */ - int GLOBAL_INTERRUPTIBLE__INTERRUPTS = GLOBAL_INTERACTION_FEATURE_COUNT + 2; - - /** - * The number of structural features of the 'Global Interruptible' class. - * - * - * @generated - * @ordered - */ - int GLOBAL_INTERRUPTIBLE_FEATURE_COUNT = GLOBAL_INTERACTION_FEATURE_COUNT + 3; - - /** - * The meta object id for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalInterruptImpl Global Interrupt}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.GlobalInterruptImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getGlobalInterrupt() - * @generated - */ - int GLOBAL_INTERRUPT = 21; - - /** - * The feature id for the 'Messages' containment reference list. - * - * - * @generated - * @ordered - */ - int GLOBAL_INTERRUPT__MESSAGES = 0; - - /** - * The feature id for the 'Role' attribute. - * - * - * @generated - * @ordered - */ - int GLOBAL_INTERRUPT__ROLE = 1; - - /** - * The number of structural features of the 'Global Interrupt' class. - * - * - * @generated - * @ordered - */ - int GLOBAL_INTERRUPT_FEATURE_COUNT = 2; - - /** - * The meta object id for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalDoImpl Global Do}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.GlobalDoImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getGlobalDo() - * @generated - */ - int GLOBAL_DO = 22; - - /** - * The feature id for the 'Scope' attribute. - * - * - * @generated - * @ordered - */ - int GLOBAL_DO__SCOPE = GLOBAL_INTERACTION_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Member' attribute. - * - * - * @generated - * @ordered - */ - int GLOBAL_DO__MEMBER = GLOBAL_INTERACTION_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Arguments' containment reference list. - * - * - * @generated - * @ordered - */ - int GLOBAL_DO__ARGUMENTS = GLOBAL_INTERACTION_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Roles' containment reference list. - * - * - * @generated - * @ordered - */ - int GLOBAL_DO__ROLES = GLOBAL_INTERACTION_FEATURE_COUNT + 3; - - /** - * The number of structural features of the 'Global Do' class. - * - * - * @generated - * @ordered - */ - int GLOBAL_DO_FEATURE_COUNT = GLOBAL_INTERACTION_FEATURE_COUNT + 4; - - /** - * The meta object id for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.LocalProtocolDeclImpl Local Protocol Decl}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.LocalProtocolDeclImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getLocalProtocolDecl() - * @generated - */ - int LOCAL_PROTOCOL_DECL = 23; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - int LOCAL_PROTOCOL_DECL__NAME = 0; - - /** - * The feature id for the 'Role' attribute. - * - * - * @generated - * @ordered - */ - int LOCAL_PROTOCOL_DECL__ROLE = 1; - - /** - * The feature id for the 'Parameters' containment reference list. - * - * - * @generated - * @ordered - */ - int LOCAL_PROTOCOL_DECL__PARAMETERS = 2; - - /** - * The feature id for the 'Roles' containment reference list. - * - * - * @generated - * @ordered - */ - int LOCAL_PROTOCOL_DECL__ROLES = 3; - - /** - * The feature id for the 'Block' containment reference. - * - * - * @generated - * @ordered - */ - int LOCAL_PROTOCOL_DECL__BLOCK = 4; - - /** - * The feature id for the 'Instantiates' attribute. - * - * - * @generated - * @ordered - */ - int LOCAL_PROTOCOL_DECL__INSTANTIATES = 5; - - /** - * The feature id for the 'Arguments' containment reference list. - * - * - * @generated - * @ordered - */ - int LOCAL_PROTOCOL_DECL__ARGUMENTS = 6; - - /** - * The feature id for the 'Role Instantiations' containment reference list. - * - * - * @generated - * @ordered - */ - int LOCAL_PROTOCOL_DECL__ROLE_INSTANTIATIONS = 7; - - /** - * The number of structural features of the 'Local Protocol Decl' class. - * - * - * @generated - * @ordered - */ - int LOCAL_PROTOCOL_DECL_FEATURE_COUNT = 8; - - /** - * The meta object id for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.LocalProtocolBlockImpl Local Protocol Block}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.LocalProtocolBlockImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getLocalProtocolBlock() - * @generated - */ - int LOCAL_PROTOCOL_BLOCK = 24; - - /** - * The feature id for the 'Activities' containment reference list. - * - * - * @generated - * @ordered - */ - int LOCAL_PROTOCOL_BLOCK__ACTIVITIES = 0; - - /** - * The number of structural features of the 'Local Protocol Block' class. - * - * - * @generated - * @ordered - */ - int LOCAL_PROTOCOL_BLOCK_FEATURE_COUNT = 1; - - /** - * The meta object id for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.LlobalInteractionImpl Llobal Interaction}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.LlobalInteractionImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getLlobalInteraction() - * @generated - */ - int LLOBAL_INTERACTION = 25; - - /** - * The number of structural features of the 'Llobal Interaction' class. - * - * - * @generated - * @ordered - */ - int LLOBAL_INTERACTION_FEATURE_COUNT = 0; - - /** - * The meta object id for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.LocalSendImpl Local Send}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.LocalSendImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getLocalSend() - * @generated - */ - int LOCAL_SEND = 26; - - /** - * The feature id for the 'Message' containment reference. - * - * - * @generated - * @ordered - */ - int LOCAL_SEND__MESSAGE = LLOBAL_INTERACTION_FEATURE_COUNT + 0; - - /** - * The feature id for the 'To Roles' attribute list. - * - * - * @generated - * @ordered - */ - int LOCAL_SEND__TO_ROLES = LLOBAL_INTERACTION_FEATURE_COUNT + 1; - - /** - * The number of structural features of the 'Local Send' class. - * - * - * @generated - * @ordered - */ - int LOCAL_SEND_FEATURE_COUNT = LLOBAL_INTERACTION_FEATURE_COUNT + 2; - - /** - * The meta object id for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.LocalReceiveImpl Local Receive}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.LocalReceiveImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getLocalReceive() - * @generated - */ - int LOCAL_RECEIVE = 27; - - /** - * The feature id for the 'Message' containment reference. - * - * - * @generated - * @ordered - */ - int LOCAL_RECEIVE__MESSAGE = LLOBAL_INTERACTION_FEATURE_COUNT + 0; - - /** - * The feature id for the 'From Role' attribute. - * - * - * @generated - * @ordered - */ - int LOCAL_RECEIVE__FROM_ROLE = LLOBAL_INTERACTION_FEATURE_COUNT + 1; - - /** - * The number of structural features of the 'Local Receive' class. - * - * - * @generated - * @ordered - */ - int LOCAL_RECEIVE_FEATURE_COUNT = LLOBAL_INTERACTION_FEATURE_COUNT + 2; - - /** - * The meta object id for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.LocalChoiceImpl Local Choice}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.LocalChoiceImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getLocalChoice() - * @generated - */ - int LOCAL_CHOICE = 28; - - /** - * The feature id for the 'Role' attribute. - * - * - * @generated - * @ordered - */ - int LOCAL_CHOICE__ROLE = LLOBAL_INTERACTION_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Blocks' containment reference list. - * - * - * @generated - * @ordered - */ - int LOCAL_CHOICE__BLOCKS = LLOBAL_INTERACTION_FEATURE_COUNT + 1; - - /** - * The number of structural features of the 'Local Choice' class. - * - * - * @generated - * @ordered - */ - int LOCAL_CHOICE_FEATURE_COUNT = LLOBAL_INTERACTION_FEATURE_COUNT + 2; - - /** - * The meta object id for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.LocalRecursionImpl Local Recursion}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.LocalRecursionImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getLocalRecursion() - * @generated - */ - int LOCAL_RECURSION = 29; - - /** - * The feature id for the 'Label' attribute. - * - * - * @generated - * @ordered - */ - int LOCAL_RECURSION__LABEL = LLOBAL_INTERACTION_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Block' containment reference. - * - * - * @generated - * @ordered - */ - int LOCAL_RECURSION__BLOCK = LLOBAL_INTERACTION_FEATURE_COUNT + 1; - - /** - * The number of structural features of the 'Local Recursion' class. - * - * - * @generated - * @ordered - */ - int LOCAL_RECURSION_FEATURE_COUNT = LLOBAL_INTERACTION_FEATURE_COUNT + 2; - - /** - * The meta object id for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.LocalContinueImpl Local Continue}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.LocalContinueImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getLocalContinue() - * @generated - */ - int LOCAL_CONTINUE = 30; - - /** - * The feature id for the 'Label' attribute. - * - * - * @generated - * @ordered - */ - int LOCAL_CONTINUE__LABEL = LLOBAL_INTERACTION_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'Local Continue' class. - * - * - * @generated - * @ordered - */ - int LOCAL_CONTINUE_FEATURE_COUNT = LLOBAL_INTERACTION_FEATURE_COUNT + 1; - - /** - * The meta object id for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.LocalParallelImpl Local Parallel}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.LocalParallelImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getLocalParallel() - * @generated - */ - int LOCAL_PARALLEL = 31; - - /** - * The feature id for the 'Blocks' containment reference list. - * - * - * @generated - * @ordered - */ - int LOCAL_PARALLEL__BLOCKS = LLOBAL_INTERACTION_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'Local Parallel' class. - * - * - * @generated - * @ordered - */ - int LOCAL_PARALLEL_FEATURE_COUNT = LLOBAL_INTERACTION_FEATURE_COUNT + 1; - - /** - * The meta object id for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.LocalInterruptibleImpl Local Interruptible}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.LocalInterruptibleImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getLocalInterruptible() - * @generated - */ - int LOCAL_INTERRUPTIBLE = 32; - - /** - * The feature id for the 'Scope' attribute. - * - * - * @generated - * @ordered - */ - int LOCAL_INTERRUPTIBLE__SCOPE = LLOBAL_INTERACTION_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Block' containment reference. - * - * - * @generated - * @ordered - */ - int LOCAL_INTERRUPTIBLE__BLOCK = LLOBAL_INTERACTION_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Throw' containment reference. - * - * - * @generated - * @ordered - */ - int LOCAL_INTERRUPTIBLE__THROW = LLOBAL_INTERACTION_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Catches' containment reference list. - * - * - * @generated - * @ordered - */ - int LOCAL_INTERRUPTIBLE__CATCHES = LLOBAL_INTERACTION_FEATURE_COUNT + 3; - - /** - * The number of structural features of the 'Local Interruptible' class. - * - * - * @generated - * @ordered - */ - int LOCAL_INTERRUPTIBLE_FEATURE_COUNT = LLOBAL_INTERACTION_FEATURE_COUNT + 4; - - /** - * The meta object id for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.LocalThrowImpl Local Throw}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.LocalThrowImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getLocalThrow() - * @generated - */ - int LOCAL_THROW = 33; - - /** - * The feature id for the 'Messages' containment reference list. - * - * - * @generated - * @ordered - */ - int LOCAL_THROW__MESSAGES = 0; - - /** - * The feature id for the 'To Roles' attribute list. - * - * - * @generated - * @ordered - */ - int LOCAL_THROW__TO_ROLES = 1; - - /** - * The number of structural features of the 'Local Throw' class. - * - * - * @generated - * @ordered - */ - int LOCAL_THROW_FEATURE_COUNT = 2; - - /** - * The meta object id for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.LocalCatchImpl Local Catch}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.LocalCatchImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getLocalCatch() - * @generated - */ - int LOCAL_CATCH = 34; - - /** - * The feature id for the 'Messages' containment reference list. - * - * - * @generated - * @ordered - */ - int LOCAL_CATCH__MESSAGES = 0; - - /** - * The feature id for the 'From Role' attribute. - * - * - * @generated - * @ordered - */ - int LOCAL_CATCH__FROM_ROLE = 1; - - /** - * The number of structural features of the 'Local Catch' class. - * - * - * @generated - * @ordered - */ - int LOCAL_CATCH_FEATURE_COUNT = 2; - - /** - * The meta object id for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.LocalDoImpl Local Do}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.LocalDoImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getLocalDo() - * @generated - */ - int LOCAL_DO = 35; - - /** - * The feature id for the 'Scope' attribute. - * - * - * @generated - * @ordered - */ - int LOCAL_DO__SCOPE = LLOBAL_INTERACTION_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Member' attribute. - * - * - * @generated - * @ordered - */ - int LOCAL_DO__MEMBER = LLOBAL_INTERACTION_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Arguments' containment reference list. - * - * - * @generated - * @ordered - */ - int LOCAL_DO__ARGUMENTS = LLOBAL_INTERACTION_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Roles' containment reference list. - * - * - * @generated - * @ordered - */ - int LOCAL_DO__ROLES = LLOBAL_INTERACTION_FEATURE_COUNT + 3; - - /** - * The number of structural features of the 'Local Do' class. - * - * - * @generated - * @ordered - */ - int LOCAL_DO_FEATURE_COUNT = LLOBAL_INTERACTION_FEATURE_COUNT + 4; - - - /** - * Returns the meta object for class '{@link org.scribble.editor.dsl.scribbleDsl.Module Module}'. - * - * - * @return the meta object for class 'Module'. - * @see org.scribble.editor.dsl.scribbleDsl.Module - * @generated - */ - EClass getModule(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.editor.dsl.scribbleDsl.Module#getName Name}'. - * - * - * @return the meta object for the attribute 'Name'. - * @see org.scribble.editor.dsl.scribbleDsl.Module#getName() - * @see #getModule() - * @generated - */ - EAttribute getModule_Name(); - - /** - * Returns the meta object for the containment reference list '{@link org.scribble.editor.dsl.scribbleDsl.Module#getImports Imports}'. - * - * - * @return the meta object for the containment reference list 'Imports'. - * @see org.scribble.editor.dsl.scribbleDsl.Module#getImports() - * @see #getModule() - * @generated - */ - EReference getModule_Imports(); - - /** - * Returns the meta object for the containment reference list '{@link org.scribble.editor.dsl.scribbleDsl.Module#getTypes Types}'. - * - * - * @return the meta object for the containment reference list 'Types'. - * @see org.scribble.editor.dsl.scribbleDsl.Module#getTypes() - * @see #getModule() - * @generated - */ - EReference getModule_Types(); - - /** - * Returns the meta object for the containment reference list '{@link org.scribble.editor.dsl.scribbleDsl.Module#getGlobals Globals}'. - * - * - * @return the meta object for the containment reference list 'Globals'. - * @see org.scribble.editor.dsl.scribbleDsl.Module#getGlobals() - * @see #getModule() - * @generated - */ - EReference getModule_Globals(); - - /** - * Returns the meta object for the containment reference list '{@link org.scribble.editor.dsl.scribbleDsl.Module#getLocals Locals}'. - * - * - * @return the meta object for the containment reference list 'Locals'. - * @see org.scribble.editor.dsl.scribbleDsl.Module#getLocals() - * @see #getModule() - * @generated - */ - EReference getModule_Locals(); - - /** - * Returns the meta object for class '{@link org.scribble.editor.dsl.scribbleDsl.ImportDecl Import Decl}'. - * - * - * @return the meta object for class 'Import Decl'. - * @see org.scribble.editor.dsl.scribbleDsl.ImportDecl - * @generated - */ - EClass getImportDecl(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.editor.dsl.scribbleDsl.ImportDecl#getName Name}'. - * - * - * @return the meta object for the attribute 'Name'. - * @see org.scribble.editor.dsl.scribbleDsl.ImportDecl#getName() - * @see #getImportDecl() - * @generated - */ - EAttribute getImportDecl_Name(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.editor.dsl.scribbleDsl.ImportDecl#getAlias Alias}'. - * - * - * @return the meta object for the attribute 'Alias'. - * @see org.scribble.editor.dsl.scribbleDsl.ImportDecl#getAlias() - * @see #getImportDecl() - * @generated - */ - EAttribute getImportDecl_Alias(); - - /** - * Returns the meta object for class '{@link org.scribble.editor.dsl.scribbleDsl.ImportModule Import Module}'. - * - * - * @return the meta object for class 'Import Module'. - * @see org.scribble.editor.dsl.scribbleDsl.ImportModule - * @generated - */ - EClass getImportModule(); - - /** - * Returns the meta object for class '{@link org.scribble.editor.dsl.scribbleDsl.ImportMember Import Member}'. - * - * - * @return the meta object for class 'Import Member'. - * @see org.scribble.editor.dsl.scribbleDsl.ImportMember - * @generated - */ - EClass getImportMember(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.editor.dsl.scribbleDsl.ImportMember#getMember Member}'. - * - * - * @return the meta object for the attribute 'Member'. - * @see org.scribble.editor.dsl.scribbleDsl.ImportMember#getMember() - * @see #getImportMember() - * @generated - */ - EAttribute getImportMember_Member(); - - /** - * Returns the meta object for class '{@link org.scribble.editor.dsl.scribbleDsl.PayloadTypeDecl Payload Type Decl}'. - * - * - * @return the meta object for class 'Payload Type Decl'. - * @see org.scribble.editor.dsl.scribbleDsl.PayloadTypeDecl - * @generated - */ - EClass getPayloadTypeDecl(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.editor.dsl.scribbleDsl.PayloadTypeDecl#getSchema Schema}'. - * - * - * @return the meta object for the attribute 'Schema'. - * @see org.scribble.editor.dsl.scribbleDsl.PayloadTypeDecl#getSchema() - * @see #getPayloadTypeDecl() - * @generated - */ - EAttribute getPayloadTypeDecl_Schema(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.editor.dsl.scribbleDsl.PayloadTypeDecl#getType Type}'. - * - * - * @return the meta object for the attribute 'Type'. - * @see org.scribble.editor.dsl.scribbleDsl.PayloadTypeDecl#getType() - * @see #getPayloadTypeDecl() - * @generated - */ - EAttribute getPayloadTypeDecl_Type(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.editor.dsl.scribbleDsl.PayloadTypeDecl#getLocation Location}'. - * - * - * @return the meta object for the attribute 'Location'. - * @see org.scribble.editor.dsl.scribbleDsl.PayloadTypeDecl#getLocation() - * @see #getPayloadTypeDecl() - * @generated - */ - EAttribute getPayloadTypeDecl_Location(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.editor.dsl.scribbleDsl.PayloadTypeDecl#getAlias Alias}'. - * - * - * @return the meta object for the attribute 'Alias'. - * @see org.scribble.editor.dsl.scribbleDsl.PayloadTypeDecl#getAlias() - * @see #getPayloadTypeDecl() - * @generated - */ - EAttribute getPayloadTypeDecl_Alias(); - - /** - * Returns the meta object for class '{@link org.scribble.editor.dsl.scribbleDsl.MessageSignature Message Signature}'. - * - * - * @return the meta object for class 'Message Signature'. - * @see org.scribble.editor.dsl.scribbleDsl.MessageSignature - * @generated - */ - EClass getMessageSignature(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.editor.dsl.scribbleDsl.MessageSignature#getOperator Operator}'. - * - * - * @return the meta object for the attribute 'Operator'. - * @see org.scribble.editor.dsl.scribbleDsl.MessageSignature#getOperator() - * @see #getMessageSignature() - * @generated - */ - EAttribute getMessageSignature_Operator(); - - /** - * Returns the meta object for the containment reference list '{@link org.scribble.editor.dsl.scribbleDsl.MessageSignature#getTypes Types}'. - * - * - * @return the meta object for the containment reference list 'Types'. - * @see org.scribble.editor.dsl.scribbleDsl.MessageSignature#getTypes() - * @see #getMessageSignature() - * @generated - */ - EReference getMessageSignature_Types(); - - /** - * Returns the meta object for class '{@link org.scribble.editor.dsl.scribbleDsl.PayloadElement Payload Element}'. - * - * - * @return the meta object for class 'Payload Element'. - * @see org.scribble.editor.dsl.scribbleDsl.PayloadElement - * @generated - */ - EClass getPayloadElement(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.editor.dsl.scribbleDsl.PayloadElement#getName Name}'. - * - * - * @return the meta object for the attribute 'Name'. - * @see org.scribble.editor.dsl.scribbleDsl.PayloadElement#getName() - * @see #getPayloadElement() - * @generated - */ - EAttribute getPayloadElement_Name(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.editor.dsl.scribbleDsl.PayloadElement#getType Type}'. - * - * - * @return the meta object for the attribute 'Type'. - * @see org.scribble.editor.dsl.scribbleDsl.PayloadElement#getType() - * @see #getPayloadElement() - * @generated - */ - EAttribute getPayloadElement_Type(); - - /** - * Returns the meta object for class '{@link org.scribble.editor.dsl.scribbleDsl.GlobalProtocolDecl Global Protocol Decl}'. - * - * - * @return the meta object for class 'Global Protocol Decl'. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalProtocolDecl - * @generated - */ - EClass getGlobalProtocolDecl(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.editor.dsl.scribbleDsl.GlobalProtocolDecl#getName Name}'. - * - * - * @return the meta object for the attribute 'Name'. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalProtocolDecl#getName() - * @see #getGlobalProtocolDecl() - * @generated - */ - EAttribute getGlobalProtocolDecl_Name(); - - /** - * Returns the meta object for the containment reference list '{@link org.scribble.editor.dsl.scribbleDsl.GlobalProtocolDecl#getParameters Parameters}'. - * - * - * @return the meta object for the containment reference list 'Parameters'. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalProtocolDecl#getParameters() - * @see #getGlobalProtocolDecl() - * @generated - */ - EReference getGlobalProtocolDecl_Parameters(); - - /** - * Returns the meta object for the containment reference list '{@link org.scribble.editor.dsl.scribbleDsl.GlobalProtocolDecl#getRoles Roles}'. - * - * - * @return the meta object for the containment reference list 'Roles'. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalProtocolDecl#getRoles() - * @see #getGlobalProtocolDecl() - * @generated - */ - EReference getGlobalProtocolDecl_Roles(); - - /** - * Returns the meta object for the containment reference '{@link org.scribble.editor.dsl.scribbleDsl.GlobalProtocolDecl#getBlock Block}'. - * - * - * @return the meta object for the containment reference 'Block'. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalProtocolDecl#getBlock() - * @see #getGlobalProtocolDecl() - * @generated - */ - EReference getGlobalProtocolDecl_Block(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.editor.dsl.scribbleDsl.GlobalProtocolDecl#getInstantiates Instantiates}'. - * - * - * @return the meta object for the attribute 'Instantiates'. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalProtocolDecl#getInstantiates() - * @see #getGlobalProtocolDecl() - * @generated - */ - EAttribute getGlobalProtocolDecl_Instantiates(); - - /** - * Returns the meta object for the containment reference list '{@link org.scribble.editor.dsl.scribbleDsl.GlobalProtocolDecl#getArguments Arguments}'. - * - * - * @return the meta object for the containment reference list 'Arguments'. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalProtocolDecl#getArguments() - * @see #getGlobalProtocolDecl() - * @generated - */ - EReference getGlobalProtocolDecl_Arguments(); - - /** - * Returns the meta object for the containment reference list '{@link org.scribble.editor.dsl.scribbleDsl.GlobalProtocolDecl#getRoleInstantiations Role Instantiations}'. - * - * - * @return the meta object for the containment reference list 'Role Instantiations'. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalProtocolDecl#getRoleInstantiations() - * @see #getGlobalProtocolDecl() - * @generated - */ - EReference getGlobalProtocolDecl_RoleInstantiations(); - - /** - * Returns the meta object for class '{@link org.scribble.editor.dsl.scribbleDsl.RoleDecl Role Decl}'. - * - * - * @return the meta object for class 'Role Decl'. - * @see org.scribble.editor.dsl.scribbleDsl.RoleDecl - * @generated - */ - EClass getRoleDecl(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.editor.dsl.scribbleDsl.RoleDecl#getName Name}'. - * - * - * @return the meta object for the attribute 'Name'. - * @see org.scribble.editor.dsl.scribbleDsl.RoleDecl#getName() - * @see #getRoleDecl() - * @generated - */ - EAttribute getRoleDecl_Name(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.editor.dsl.scribbleDsl.RoleDecl#getAlias Alias}'. - * - * - * @return the meta object for the attribute 'Alias'. - * @see org.scribble.editor.dsl.scribbleDsl.RoleDecl#getAlias() - * @see #getRoleDecl() - * @generated - */ - EAttribute getRoleDecl_Alias(); - - /** - * Returns the meta object for class '{@link org.scribble.editor.dsl.scribbleDsl.ParameterDecl Parameter Decl}'. - * - * - * @return the meta object for class 'Parameter Decl'. - * @see org.scribble.editor.dsl.scribbleDsl.ParameterDecl - * @generated - */ - EClass getParameterDecl(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.editor.dsl.scribbleDsl.ParameterDecl#getName Name}'. - * - * - * @return the meta object for the attribute 'Name'. - * @see org.scribble.editor.dsl.scribbleDsl.ParameterDecl#getName() - * @see #getParameterDecl() - * @generated - */ - EAttribute getParameterDecl_Name(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.editor.dsl.scribbleDsl.ParameterDecl#getAlias Alias}'. - * - * - * @return the meta object for the attribute 'Alias'. - * @see org.scribble.editor.dsl.scribbleDsl.ParameterDecl#getAlias() - * @see #getParameterDecl() - * @generated - */ - EAttribute getParameterDecl_Alias(); - - /** - * Returns the meta object for class '{@link org.scribble.editor.dsl.scribbleDsl.RoleInstantiation Role Instantiation}'. - * - * - * @return the meta object for class 'Role Instantiation'. - * @see org.scribble.editor.dsl.scribbleDsl.RoleInstantiation - * @generated - */ - EClass getRoleInstantiation(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.editor.dsl.scribbleDsl.RoleInstantiation#getName Name}'. - * - * - * @return the meta object for the attribute 'Name'. - * @see org.scribble.editor.dsl.scribbleDsl.RoleInstantiation#getName() - * @see #getRoleInstantiation() - * @generated - */ - EAttribute getRoleInstantiation_Name(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.editor.dsl.scribbleDsl.RoleInstantiation#getAlias Alias}'. - * - * - * @return the meta object for the attribute 'Alias'. - * @see org.scribble.editor.dsl.scribbleDsl.RoleInstantiation#getAlias() - * @see #getRoleInstantiation() - * @generated - */ - EAttribute getRoleInstantiation_Alias(); - - /** - * Returns the meta object for class '{@link org.scribble.editor.dsl.scribbleDsl.Argument Argument}'. - * - * - * @return the meta object for class 'Argument'. - * @see org.scribble.editor.dsl.scribbleDsl.Argument - * @generated - */ - EClass getArgument(); - - /** - * Returns the meta object for the containment reference '{@link org.scribble.editor.dsl.scribbleDsl.Argument#getSignature Signature}'. - * - * - * @return the meta object for the containment reference 'Signature'. - * @see org.scribble.editor.dsl.scribbleDsl.Argument#getSignature() - * @see #getArgument() - * @generated - */ - EReference getArgument_Signature(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.editor.dsl.scribbleDsl.Argument#getAlias Alias}'. - * - * - * @return the meta object for the attribute 'Alias'. - * @see org.scribble.editor.dsl.scribbleDsl.Argument#getAlias() - * @see #getArgument() - * @generated - */ - EAttribute getArgument_Alias(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.editor.dsl.scribbleDsl.Argument#getName Name}'. - * - * - * @return the meta object for the attribute 'Name'. - * @see org.scribble.editor.dsl.scribbleDsl.Argument#getName() - * @see #getArgument() - * @generated - */ - EAttribute getArgument_Name(); - - /** - * Returns the meta object for class '{@link org.scribble.editor.dsl.scribbleDsl.GlobalProtocolBlock Global Protocol Block}'. - * - * - * @return the meta object for class 'Global Protocol Block'. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalProtocolBlock - * @generated - */ - EClass getGlobalProtocolBlock(); - - /** - * Returns the meta object for the containment reference list '{@link org.scribble.editor.dsl.scribbleDsl.GlobalProtocolBlock#getActivities Activities}'. - * - * - * @return the meta object for the containment reference list 'Activities'. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalProtocolBlock#getActivities() - * @see #getGlobalProtocolBlock() - * @generated - */ - EReference getGlobalProtocolBlock_Activities(); - - /** - * Returns the meta object for class '{@link org.scribble.editor.dsl.scribbleDsl.GlobalInteraction Global Interaction}'. - * - * - * @return the meta object for class 'Global Interaction'. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalInteraction - * @generated - */ - EClass getGlobalInteraction(); - - /** - * Returns the meta object for class '{@link org.scribble.editor.dsl.scribbleDsl.GlobalMessageTransfer Global Message Transfer}'. - * - * - * @return the meta object for class 'Global Message Transfer'. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalMessageTransfer - * @generated - */ - EClass getGlobalMessageTransfer(); - - /** - * Returns the meta object for the containment reference '{@link org.scribble.editor.dsl.scribbleDsl.GlobalMessageTransfer#getMessage Message}'. - * - * - * @return the meta object for the containment reference 'Message'. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalMessageTransfer#getMessage() - * @see #getGlobalMessageTransfer() - * @generated - */ - EReference getGlobalMessageTransfer_Message(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.editor.dsl.scribbleDsl.GlobalMessageTransfer#getFromRole From Role}'. - * - * - * @return the meta object for the attribute 'From Role'. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalMessageTransfer#getFromRole() - * @see #getGlobalMessageTransfer() - * @generated - */ - EAttribute getGlobalMessageTransfer_FromRole(); - - /** - * Returns the meta object for the attribute list '{@link org.scribble.editor.dsl.scribbleDsl.GlobalMessageTransfer#getToRoles To Roles}'. - * - * - * @return the meta object for the attribute list 'To Roles'. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalMessageTransfer#getToRoles() - * @see #getGlobalMessageTransfer() - * @generated - */ - EAttribute getGlobalMessageTransfer_ToRoles(); - - /** - * Returns the meta object for class '{@link org.scribble.editor.dsl.scribbleDsl.Message Message}'. - * - * - * @return the meta object for class 'Message'. - * @see org.scribble.editor.dsl.scribbleDsl.Message - * @generated - */ - EClass getMessage(); - - /** - * Returns the meta object for the containment reference '{@link org.scribble.editor.dsl.scribbleDsl.Message#getSignature Signature}'. - * - * - * @return the meta object for the containment reference 'Signature'. - * @see org.scribble.editor.dsl.scribbleDsl.Message#getSignature() - * @see #getMessage() - * @generated - */ - EReference getMessage_Signature(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.editor.dsl.scribbleDsl.Message#getParameter Parameter}'. - * - * - * @return the meta object for the attribute 'Parameter'. - * @see org.scribble.editor.dsl.scribbleDsl.Message#getParameter() - * @see #getMessage() - * @generated - */ - EAttribute getMessage_Parameter(); - - /** - * Returns the meta object for class '{@link org.scribble.editor.dsl.scribbleDsl.GlobalChoice Global Choice}'. - * - * - * @return the meta object for class 'Global Choice'. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalChoice - * @generated - */ - EClass getGlobalChoice(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.editor.dsl.scribbleDsl.GlobalChoice#getRole Role}'. - * - * - * @return the meta object for the attribute 'Role'. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalChoice#getRole() - * @see #getGlobalChoice() - * @generated - */ - EAttribute getGlobalChoice_Role(); - - /** - * Returns the meta object for the containment reference list '{@link org.scribble.editor.dsl.scribbleDsl.GlobalChoice#getBlocks Blocks}'. - * - * - * @return the meta object for the containment reference list 'Blocks'. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalChoice#getBlocks() - * @see #getGlobalChoice() - * @generated - */ - EReference getGlobalChoice_Blocks(); - - /** - * Returns the meta object for class '{@link org.scribble.editor.dsl.scribbleDsl.GlobalRecursion Global Recursion}'. - * - * - * @return the meta object for class 'Global Recursion'. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalRecursion - * @generated - */ - EClass getGlobalRecursion(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.editor.dsl.scribbleDsl.GlobalRecursion#getLabel Label}'. - * - * - * @return the meta object for the attribute 'Label'. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalRecursion#getLabel() - * @see #getGlobalRecursion() - * @generated - */ - EAttribute getGlobalRecursion_Label(); - - /** - * Returns the meta object for the containment reference '{@link org.scribble.editor.dsl.scribbleDsl.GlobalRecursion#getBlock Block}'. - * - * - * @return the meta object for the containment reference 'Block'. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalRecursion#getBlock() - * @see #getGlobalRecursion() - * @generated - */ - EReference getGlobalRecursion_Block(); - - /** - * Returns the meta object for class '{@link org.scribble.editor.dsl.scribbleDsl.GlobalContinue Global Continue}'. - * - * - * @return the meta object for class 'Global Continue'. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalContinue - * @generated - */ - EClass getGlobalContinue(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.editor.dsl.scribbleDsl.GlobalContinue#getLabel Label}'. - * - * - * @return the meta object for the attribute 'Label'. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalContinue#getLabel() - * @see #getGlobalContinue() - * @generated - */ - EAttribute getGlobalContinue_Label(); - - /** - * Returns the meta object for class '{@link org.scribble.editor.dsl.scribbleDsl.GlobalParallel Global Parallel}'. - * - * - * @return the meta object for class 'Global Parallel'. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalParallel - * @generated - */ - EClass getGlobalParallel(); - - /** - * Returns the meta object for the containment reference list '{@link org.scribble.editor.dsl.scribbleDsl.GlobalParallel#getBlocks Blocks}'. - * - * - * @return the meta object for the containment reference list 'Blocks'. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalParallel#getBlocks() - * @see #getGlobalParallel() - * @generated - */ - EReference getGlobalParallel_Blocks(); - - /** - * Returns the meta object for class '{@link org.scribble.editor.dsl.scribbleDsl.GlobalInterruptible Global Interruptible}'. - * - * - * @return the meta object for class 'Global Interruptible'. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalInterruptible - * @generated - */ - EClass getGlobalInterruptible(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.editor.dsl.scribbleDsl.GlobalInterruptible#getScope Scope}'. - * - * - * @return the meta object for the attribute 'Scope'. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalInterruptible#getScope() - * @see #getGlobalInterruptible() - * @generated - */ - EAttribute getGlobalInterruptible_Scope(); - - /** - * Returns the meta object for the containment reference '{@link org.scribble.editor.dsl.scribbleDsl.GlobalInterruptible#getBlock Block}'. - * - * - * @return the meta object for the containment reference 'Block'. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalInterruptible#getBlock() - * @see #getGlobalInterruptible() - * @generated - */ - EReference getGlobalInterruptible_Block(); - - /** - * Returns the meta object for the containment reference list '{@link org.scribble.editor.dsl.scribbleDsl.GlobalInterruptible#getInterrupts Interrupts}'. - * - * - * @return the meta object for the containment reference list 'Interrupts'. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalInterruptible#getInterrupts() - * @see #getGlobalInterruptible() - * @generated - */ - EReference getGlobalInterruptible_Interrupts(); - - /** - * Returns the meta object for class '{@link org.scribble.editor.dsl.scribbleDsl.GlobalInterrupt Global Interrupt}'. - * - * - * @return the meta object for class 'Global Interrupt'. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalInterrupt - * @generated - */ - EClass getGlobalInterrupt(); - - /** - * Returns the meta object for the containment reference list '{@link org.scribble.editor.dsl.scribbleDsl.GlobalInterrupt#getMessages Messages}'. - * - * - * @return the meta object for the containment reference list 'Messages'. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalInterrupt#getMessages() - * @see #getGlobalInterrupt() - * @generated - */ - EReference getGlobalInterrupt_Messages(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.editor.dsl.scribbleDsl.GlobalInterrupt#getRole Role}'. - * - * - * @return the meta object for the attribute 'Role'. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalInterrupt#getRole() - * @see #getGlobalInterrupt() - * @generated - */ - EAttribute getGlobalInterrupt_Role(); - - /** - * Returns the meta object for class '{@link org.scribble.editor.dsl.scribbleDsl.GlobalDo Global Do}'. - * - * - * @return the meta object for class 'Global Do'. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalDo - * @generated - */ - EClass getGlobalDo(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.editor.dsl.scribbleDsl.GlobalDo#getScope Scope}'. - * - * - * @return the meta object for the attribute 'Scope'. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalDo#getScope() - * @see #getGlobalDo() - * @generated - */ - EAttribute getGlobalDo_Scope(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.editor.dsl.scribbleDsl.GlobalDo#getMember Member}'. - * - * - * @return the meta object for the attribute 'Member'. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalDo#getMember() - * @see #getGlobalDo() - * @generated - */ - EAttribute getGlobalDo_Member(); - - /** - * Returns the meta object for the containment reference list '{@link org.scribble.editor.dsl.scribbleDsl.GlobalDo#getArguments Arguments}'. - * - * - * @return the meta object for the containment reference list 'Arguments'. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalDo#getArguments() - * @see #getGlobalDo() - * @generated - */ - EReference getGlobalDo_Arguments(); - - /** - * Returns the meta object for the containment reference list '{@link org.scribble.editor.dsl.scribbleDsl.GlobalDo#getRoles Roles}'. - * - * - * @return the meta object for the containment reference list 'Roles'. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalDo#getRoles() - * @see #getGlobalDo() - * @generated - */ - EReference getGlobalDo_Roles(); - - /** - * Returns the meta object for class '{@link org.scribble.editor.dsl.scribbleDsl.LocalProtocolDecl Local Protocol Decl}'. - * - * - * @return the meta object for class 'Local Protocol Decl'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalProtocolDecl - * @generated - */ - EClass getLocalProtocolDecl(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.editor.dsl.scribbleDsl.LocalProtocolDecl#getName Name}'. - * - * - * @return the meta object for the attribute 'Name'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalProtocolDecl#getName() - * @see #getLocalProtocolDecl() - * @generated - */ - EAttribute getLocalProtocolDecl_Name(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.editor.dsl.scribbleDsl.LocalProtocolDecl#getRole Role}'. - * - * - * @return the meta object for the attribute 'Role'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalProtocolDecl#getRole() - * @see #getLocalProtocolDecl() - * @generated - */ - EAttribute getLocalProtocolDecl_Role(); - - /** - * Returns the meta object for the containment reference list '{@link org.scribble.editor.dsl.scribbleDsl.LocalProtocolDecl#getParameters Parameters}'. - * - * - * @return the meta object for the containment reference list 'Parameters'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalProtocolDecl#getParameters() - * @see #getLocalProtocolDecl() - * @generated - */ - EReference getLocalProtocolDecl_Parameters(); - - /** - * Returns the meta object for the containment reference list '{@link org.scribble.editor.dsl.scribbleDsl.LocalProtocolDecl#getRoles Roles}'. - * - * - * @return the meta object for the containment reference list 'Roles'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalProtocolDecl#getRoles() - * @see #getLocalProtocolDecl() - * @generated - */ - EReference getLocalProtocolDecl_Roles(); - - /** - * Returns the meta object for the containment reference '{@link org.scribble.editor.dsl.scribbleDsl.LocalProtocolDecl#getBlock Block}'. - * - * - * @return the meta object for the containment reference 'Block'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalProtocolDecl#getBlock() - * @see #getLocalProtocolDecl() - * @generated - */ - EReference getLocalProtocolDecl_Block(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.editor.dsl.scribbleDsl.LocalProtocolDecl#getInstantiates Instantiates}'. - * - * - * @return the meta object for the attribute 'Instantiates'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalProtocolDecl#getInstantiates() - * @see #getLocalProtocolDecl() - * @generated - */ - EAttribute getLocalProtocolDecl_Instantiates(); - - /** - * Returns the meta object for the containment reference list '{@link org.scribble.editor.dsl.scribbleDsl.LocalProtocolDecl#getArguments Arguments}'. - * - * - * @return the meta object for the containment reference list 'Arguments'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalProtocolDecl#getArguments() - * @see #getLocalProtocolDecl() - * @generated - */ - EReference getLocalProtocolDecl_Arguments(); - - /** - * Returns the meta object for the containment reference list '{@link org.scribble.editor.dsl.scribbleDsl.LocalProtocolDecl#getRoleInstantiations Role Instantiations}'. - * - * - * @return the meta object for the containment reference list 'Role Instantiations'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalProtocolDecl#getRoleInstantiations() - * @see #getLocalProtocolDecl() - * @generated - */ - EReference getLocalProtocolDecl_RoleInstantiations(); - - /** - * Returns the meta object for class '{@link org.scribble.editor.dsl.scribbleDsl.LocalProtocolBlock Local Protocol Block}'. - * - * - * @return the meta object for class 'Local Protocol Block'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalProtocolBlock - * @generated - */ - EClass getLocalProtocolBlock(); - - /** - * Returns the meta object for the containment reference list '{@link org.scribble.editor.dsl.scribbleDsl.LocalProtocolBlock#getActivities Activities}'. - * - * - * @return the meta object for the containment reference list 'Activities'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalProtocolBlock#getActivities() - * @see #getLocalProtocolBlock() - * @generated - */ - EReference getLocalProtocolBlock_Activities(); - - /** - * Returns the meta object for class '{@link org.scribble.editor.dsl.scribbleDsl.LlobalInteraction Llobal Interaction}'. - * - * - * @return the meta object for class 'Llobal Interaction'. - * @see org.scribble.editor.dsl.scribbleDsl.LlobalInteraction - * @generated - */ - EClass getLlobalInteraction(); - - /** - * Returns the meta object for class '{@link org.scribble.editor.dsl.scribbleDsl.LocalSend Local Send}'. - * - * - * @return the meta object for class 'Local Send'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalSend - * @generated - */ - EClass getLocalSend(); - - /** - * Returns the meta object for the containment reference '{@link org.scribble.editor.dsl.scribbleDsl.LocalSend#getMessage Message}'. - * - * - * @return the meta object for the containment reference 'Message'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalSend#getMessage() - * @see #getLocalSend() - * @generated - */ - EReference getLocalSend_Message(); - - /** - * Returns the meta object for the attribute list '{@link org.scribble.editor.dsl.scribbleDsl.LocalSend#getToRoles To Roles}'. - * - * - * @return the meta object for the attribute list 'To Roles'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalSend#getToRoles() - * @see #getLocalSend() - * @generated - */ - EAttribute getLocalSend_ToRoles(); - - /** - * Returns the meta object for class '{@link org.scribble.editor.dsl.scribbleDsl.LocalReceive Local Receive}'. - * - * - * @return the meta object for class 'Local Receive'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalReceive - * @generated - */ - EClass getLocalReceive(); - - /** - * Returns the meta object for the containment reference '{@link org.scribble.editor.dsl.scribbleDsl.LocalReceive#getMessage Message}'. - * - * - * @return the meta object for the containment reference 'Message'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalReceive#getMessage() - * @see #getLocalReceive() - * @generated - */ - EReference getLocalReceive_Message(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.editor.dsl.scribbleDsl.LocalReceive#getFromRole From Role}'. - * - * - * @return the meta object for the attribute 'From Role'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalReceive#getFromRole() - * @see #getLocalReceive() - * @generated - */ - EAttribute getLocalReceive_FromRole(); - - /** - * Returns the meta object for class '{@link org.scribble.editor.dsl.scribbleDsl.LocalChoice Local Choice}'. - * - * - * @return the meta object for class 'Local Choice'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalChoice - * @generated - */ - EClass getLocalChoice(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.editor.dsl.scribbleDsl.LocalChoice#getRole Role}'. - * - * - * @return the meta object for the attribute 'Role'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalChoice#getRole() - * @see #getLocalChoice() - * @generated - */ - EAttribute getLocalChoice_Role(); - - /** - * Returns the meta object for the containment reference list '{@link org.scribble.editor.dsl.scribbleDsl.LocalChoice#getBlocks Blocks}'. - * - * - * @return the meta object for the containment reference list 'Blocks'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalChoice#getBlocks() - * @see #getLocalChoice() - * @generated - */ - EReference getLocalChoice_Blocks(); - - /** - * Returns the meta object for class '{@link org.scribble.editor.dsl.scribbleDsl.LocalRecursion Local Recursion}'. - * - * - * @return the meta object for class 'Local Recursion'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalRecursion - * @generated - */ - EClass getLocalRecursion(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.editor.dsl.scribbleDsl.LocalRecursion#getLabel Label}'. - * - * - * @return the meta object for the attribute 'Label'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalRecursion#getLabel() - * @see #getLocalRecursion() - * @generated - */ - EAttribute getLocalRecursion_Label(); - - /** - * Returns the meta object for the containment reference '{@link org.scribble.editor.dsl.scribbleDsl.LocalRecursion#getBlock Block}'. - * - * - * @return the meta object for the containment reference 'Block'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalRecursion#getBlock() - * @see #getLocalRecursion() - * @generated - */ - EReference getLocalRecursion_Block(); - - /** - * Returns the meta object for class '{@link org.scribble.editor.dsl.scribbleDsl.LocalContinue Local Continue}'. - * - * - * @return the meta object for class 'Local Continue'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalContinue - * @generated - */ - EClass getLocalContinue(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.editor.dsl.scribbleDsl.LocalContinue#getLabel Label}'. - * - * - * @return the meta object for the attribute 'Label'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalContinue#getLabel() - * @see #getLocalContinue() - * @generated - */ - EAttribute getLocalContinue_Label(); - - /** - * Returns the meta object for class '{@link org.scribble.editor.dsl.scribbleDsl.LocalParallel Local Parallel}'. - * - * - * @return the meta object for class 'Local Parallel'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalParallel - * @generated - */ - EClass getLocalParallel(); - - /** - * Returns the meta object for the containment reference list '{@link org.scribble.editor.dsl.scribbleDsl.LocalParallel#getBlocks Blocks}'. - * - * - * @return the meta object for the containment reference list 'Blocks'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalParallel#getBlocks() - * @see #getLocalParallel() - * @generated - */ - EReference getLocalParallel_Blocks(); - - /** - * Returns the meta object for class '{@link org.scribble.editor.dsl.scribbleDsl.LocalInterruptible Local Interruptible}'. - * - * - * @return the meta object for class 'Local Interruptible'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalInterruptible - * @generated - */ - EClass getLocalInterruptible(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.editor.dsl.scribbleDsl.LocalInterruptible#getScope Scope}'. - * - * - * @return the meta object for the attribute 'Scope'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalInterruptible#getScope() - * @see #getLocalInterruptible() - * @generated - */ - EAttribute getLocalInterruptible_Scope(); - - /** - * Returns the meta object for the containment reference '{@link org.scribble.editor.dsl.scribbleDsl.LocalInterruptible#getBlock Block}'. - * - * - * @return the meta object for the containment reference 'Block'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalInterruptible#getBlock() - * @see #getLocalInterruptible() - * @generated - */ - EReference getLocalInterruptible_Block(); - - /** - * Returns the meta object for the containment reference '{@link org.scribble.editor.dsl.scribbleDsl.LocalInterruptible#getThrow Throw}'. - * - * - * @return the meta object for the containment reference 'Throw'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalInterruptible#getThrow() - * @see #getLocalInterruptible() - * @generated - */ - EReference getLocalInterruptible_Throw(); - - /** - * Returns the meta object for the containment reference list '{@link org.scribble.editor.dsl.scribbleDsl.LocalInterruptible#getCatches Catches}'. - * - * - * @return the meta object for the containment reference list 'Catches'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalInterruptible#getCatches() - * @see #getLocalInterruptible() - * @generated - */ - EReference getLocalInterruptible_Catches(); - - /** - * Returns the meta object for class '{@link org.scribble.editor.dsl.scribbleDsl.LocalThrow Local Throw}'. - * - * - * @return the meta object for class 'Local Throw'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalThrow - * @generated - */ - EClass getLocalThrow(); - - /** - * Returns the meta object for the containment reference list '{@link org.scribble.editor.dsl.scribbleDsl.LocalThrow#getMessages Messages}'. - * - * - * @return the meta object for the containment reference list 'Messages'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalThrow#getMessages() - * @see #getLocalThrow() - * @generated - */ - EReference getLocalThrow_Messages(); - - /** - * Returns the meta object for the attribute list '{@link org.scribble.editor.dsl.scribbleDsl.LocalThrow#getToRoles To Roles}'. - * - * - * @return the meta object for the attribute list 'To Roles'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalThrow#getToRoles() - * @see #getLocalThrow() - * @generated - */ - EAttribute getLocalThrow_ToRoles(); - - /** - * Returns the meta object for class '{@link org.scribble.editor.dsl.scribbleDsl.LocalCatch Local Catch}'. - * - * - * @return the meta object for class 'Local Catch'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalCatch - * @generated - */ - EClass getLocalCatch(); - - /** - * Returns the meta object for the containment reference list '{@link org.scribble.editor.dsl.scribbleDsl.LocalCatch#getMessages Messages}'. - * - * - * @return the meta object for the containment reference list 'Messages'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalCatch#getMessages() - * @see #getLocalCatch() - * @generated - */ - EReference getLocalCatch_Messages(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.editor.dsl.scribbleDsl.LocalCatch#getFromRole From Role}'. - * - * - * @return the meta object for the attribute 'From Role'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalCatch#getFromRole() - * @see #getLocalCatch() - * @generated - */ - EAttribute getLocalCatch_FromRole(); - - /** - * Returns the meta object for class '{@link org.scribble.editor.dsl.scribbleDsl.LocalDo Local Do}'. - * - * - * @return the meta object for class 'Local Do'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalDo - * @generated - */ - EClass getLocalDo(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.editor.dsl.scribbleDsl.LocalDo#getScope Scope}'. - * - * - * @return the meta object for the attribute 'Scope'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalDo#getScope() - * @see #getLocalDo() - * @generated - */ - EAttribute getLocalDo_Scope(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.editor.dsl.scribbleDsl.LocalDo#getMember Member}'. - * - * - * @return the meta object for the attribute 'Member'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalDo#getMember() - * @see #getLocalDo() - * @generated - */ - EAttribute getLocalDo_Member(); - - /** - * Returns the meta object for the containment reference list '{@link org.scribble.editor.dsl.scribbleDsl.LocalDo#getArguments Arguments}'. - * - * - * @return the meta object for the containment reference list 'Arguments'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalDo#getArguments() - * @see #getLocalDo() - * @generated - */ - EReference getLocalDo_Arguments(); - - /** - * Returns the meta object for the containment reference list '{@link org.scribble.editor.dsl.scribbleDsl.LocalDo#getRoles Roles}'. - * - * - * @return the meta object for the containment reference list 'Roles'. - * @see org.scribble.editor.dsl.scribbleDsl.LocalDo#getRoles() - * @see #getLocalDo() - * @generated - */ - EReference getLocalDo_Roles(); - - /** - * Returns the factory that creates the instances of the model. - * - * - * @return the factory that creates the instances of the model. - * @generated - */ - ScribbleDslFactory getScribbleDslFactory(); - - /** - * - * Defines literals for the meta objects that represent - *
    - *
  • each class,
  • - *
  • each feature of each class,
  • - *
  • each enum,
  • - *
  • and each data type
  • - *
- * - * @generated - */ - interface Literals - { - /** - * The meta object literal for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.ModuleImpl Module}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.ModuleImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getModule() - * @generated - */ - EClass MODULE = eINSTANCE.getModule(); - - /** - * The meta object literal for the 'Name' attribute feature. - * - * - * @generated - */ - EAttribute MODULE__NAME = eINSTANCE.getModule_Name(); - - /** - * The meta object literal for the 'Imports' containment reference list feature. - * - * - * @generated - */ - EReference MODULE__IMPORTS = eINSTANCE.getModule_Imports(); - - /** - * The meta object literal for the 'Types' containment reference list feature. - * - * - * @generated - */ - EReference MODULE__TYPES = eINSTANCE.getModule_Types(); - - /** - * The meta object literal for the 'Globals' containment reference list feature. - * - * - * @generated - */ - EReference MODULE__GLOBALS = eINSTANCE.getModule_Globals(); - - /** - * The meta object literal for the 'Locals' containment reference list feature. - * - * - * @generated - */ - EReference MODULE__LOCALS = eINSTANCE.getModule_Locals(); - - /** - * The meta object literal for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.ImportDeclImpl Import Decl}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.ImportDeclImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getImportDecl() - * @generated - */ - EClass IMPORT_DECL = eINSTANCE.getImportDecl(); - - /** - * The meta object literal for the 'Name' attribute feature. - * - * - * @generated - */ - EAttribute IMPORT_DECL__NAME = eINSTANCE.getImportDecl_Name(); - - /** - * The meta object literal for the 'Alias' attribute feature. - * - * - * @generated - */ - EAttribute IMPORT_DECL__ALIAS = eINSTANCE.getImportDecl_Alias(); - - /** - * The meta object literal for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.ImportModuleImpl Import Module}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.ImportModuleImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getImportModule() - * @generated - */ - EClass IMPORT_MODULE = eINSTANCE.getImportModule(); - - /** - * The meta object literal for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.ImportMemberImpl Import Member}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.ImportMemberImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getImportMember() - * @generated - */ - EClass IMPORT_MEMBER = eINSTANCE.getImportMember(); - - /** - * The meta object literal for the 'Member' attribute feature. - * - * - * @generated - */ - EAttribute IMPORT_MEMBER__MEMBER = eINSTANCE.getImportMember_Member(); - - /** - * The meta object literal for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.PayloadTypeDeclImpl Payload Type Decl}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.PayloadTypeDeclImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getPayloadTypeDecl() - * @generated - */ - EClass PAYLOAD_TYPE_DECL = eINSTANCE.getPayloadTypeDecl(); - - /** - * The meta object literal for the 'Schema' attribute feature. - * - * - * @generated - */ - EAttribute PAYLOAD_TYPE_DECL__SCHEMA = eINSTANCE.getPayloadTypeDecl_Schema(); - - /** - * The meta object literal for the 'Type' attribute feature. - * - * - * @generated - */ - EAttribute PAYLOAD_TYPE_DECL__TYPE = eINSTANCE.getPayloadTypeDecl_Type(); - - /** - * The meta object literal for the 'Location' attribute feature. - * - * - * @generated - */ - EAttribute PAYLOAD_TYPE_DECL__LOCATION = eINSTANCE.getPayloadTypeDecl_Location(); - - /** - * The meta object literal for the 'Alias' attribute feature. - * - * - * @generated - */ - EAttribute PAYLOAD_TYPE_DECL__ALIAS = eINSTANCE.getPayloadTypeDecl_Alias(); - - /** - * The meta object literal for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.MessageSignatureImpl Message Signature}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.MessageSignatureImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getMessageSignature() - * @generated - */ - EClass MESSAGE_SIGNATURE = eINSTANCE.getMessageSignature(); - - /** - * The meta object literal for the 'Operator' attribute feature. - * - * - * @generated - */ - EAttribute MESSAGE_SIGNATURE__OPERATOR = eINSTANCE.getMessageSignature_Operator(); - - /** - * The meta object literal for the 'Types' containment reference list feature. - * - * - * @generated - */ - EReference MESSAGE_SIGNATURE__TYPES = eINSTANCE.getMessageSignature_Types(); - - /** - * The meta object literal for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.PayloadElementImpl Payload Element}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.PayloadElementImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getPayloadElement() - * @generated - */ - EClass PAYLOAD_ELEMENT = eINSTANCE.getPayloadElement(); - - /** - * The meta object literal for the 'Name' attribute feature. - * - * - * @generated - */ - EAttribute PAYLOAD_ELEMENT__NAME = eINSTANCE.getPayloadElement_Name(); - - /** - * The meta object literal for the 'Type' attribute feature. - * - * - * @generated - */ - EAttribute PAYLOAD_ELEMENT__TYPE = eINSTANCE.getPayloadElement_Type(); - - /** - * The meta object literal for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalProtocolDeclImpl Global Protocol Decl}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.GlobalProtocolDeclImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getGlobalProtocolDecl() - * @generated - */ - EClass GLOBAL_PROTOCOL_DECL = eINSTANCE.getGlobalProtocolDecl(); - - /** - * The meta object literal for the 'Name' attribute feature. - * - * - * @generated - */ - EAttribute GLOBAL_PROTOCOL_DECL__NAME = eINSTANCE.getGlobalProtocolDecl_Name(); - - /** - * The meta object literal for the 'Parameters' containment reference list feature. - * - * - * @generated - */ - EReference GLOBAL_PROTOCOL_DECL__PARAMETERS = eINSTANCE.getGlobalProtocolDecl_Parameters(); - - /** - * The meta object literal for the 'Roles' containment reference list feature. - * - * - * @generated - */ - EReference GLOBAL_PROTOCOL_DECL__ROLES = eINSTANCE.getGlobalProtocolDecl_Roles(); - - /** - * The meta object literal for the 'Block' containment reference feature. - * - * - * @generated - */ - EReference GLOBAL_PROTOCOL_DECL__BLOCK = eINSTANCE.getGlobalProtocolDecl_Block(); - - /** - * The meta object literal for the 'Instantiates' attribute feature. - * - * - * @generated - */ - EAttribute GLOBAL_PROTOCOL_DECL__INSTANTIATES = eINSTANCE.getGlobalProtocolDecl_Instantiates(); - - /** - * The meta object literal for the 'Arguments' containment reference list feature. - * - * - * @generated - */ - EReference GLOBAL_PROTOCOL_DECL__ARGUMENTS = eINSTANCE.getGlobalProtocolDecl_Arguments(); - - /** - * The meta object literal for the 'Role Instantiations' containment reference list feature. - * - * - * @generated - */ - EReference GLOBAL_PROTOCOL_DECL__ROLE_INSTANTIATIONS = eINSTANCE.getGlobalProtocolDecl_RoleInstantiations(); - - /** - * The meta object literal for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.RoleDeclImpl Role Decl}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.RoleDeclImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getRoleDecl() - * @generated - */ - EClass ROLE_DECL = eINSTANCE.getRoleDecl(); - - /** - * The meta object literal for the 'Name' attribute feature. - * - * - * @generated - */ - EAttribute ROLE_DECL__NAME = eINSTANCE.getRoleDecl_Name(); - - /** - * The meta object literal for the 'Alias' attribute feature. - * - * - * @generated - */ - EAttribute ROLE_DECL__ALIAS = eINSTANCE.getRoleDecl_Alias(); - - /** - * The meta object literal for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.ParameterDeclImpl Parameter Decl}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.ParameterDeclImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getParameterDecl() - * @generated - */ - EClass PARAMETER_DECL = eINSTANCE.getParameterDecl(); - - /** - * The meta object literal for the 'Name' attribute feature. - * - * - * @generated - */ - EAttribute PARAMETER_DECL__NAME = eINSTANCE.getParameterDecl_Name(); - - /** - * The meta object literal for the 'Alias' attribute feature. - * - * - * @generated - */ - EAttribute PARAMETER_DECL__ALIAS = eINSTANCE.getParameterDecl_Alias(); - - /** - * The meta object literal for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.RoleInstantiationImpl Role Instantiation}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.RoleInstantiationImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getRoleInstantiation() - * @generated - */ - EClass ROLE_INSTANTIATION = eINSTANCE.getRoleInstantiation(); - - /** - * The meta object literal for the 'Name' attribute feature. - * - * - * @generated - */ - EAttribute ROLE_INSTANTIATION__NAME = eINSTANCE.getRoleInstantiation_Name(); - - /** - * The meta object literal for the 'Alias' attribute feature. - * - * - * @generated - */ - EAttribute ROLE_INSTANTIATION__ALIAS = eINSTANCE.getRoleInstantiation_Alias(); - - /** - * The meta object literal for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.ArgumentImpl Argument}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.ArgumentImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getArgument() - * @generated - */ - EClass ARGUMENT = eINSTANCE.getArgument(); - - /** - * The meta object literal for the 'Signature' containment reference feature. - * - * - * @generated - */ - EReference ARGUMENT__SIGNATURE = eINSTANCE.getArgument_Signature(); - - /** - * The meta object literal for the 'Alias' attribute feature. - * - * - * @generated - */ - EAttribute ARGUMENT__ALIAS = eINSTANCE.getArgument_Alias(); - - /** - * The meta object literal for the 'Name' attribute feature. - * - * - * @generated - */ - EAttribute ARGUMENT__NAME = eINSTANCE.getArgument_Name(); - - /** - * The meta object literal for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalProtocolBlockImpl Global Protocol Block}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.GlobalProtocolBlockImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getGlobalProtocolBlock() - * @generated - */ - EClass GLOBAL_PROTOCOL_BLOCK = eINSTANCE.getGlobalProtocolBlock(); - - /** - * The meta object literal for the 'Activities' containment reference list feature. - * - * - * @generated - */ - EReference GLOBAL_PROTOCOL_BLOCK__ACTIVITIES = eINSTANCE.getGlobalProtocolBlock_Activities(); - - /** - * The meta object literal for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalInteractionImpl Global Interaction}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.GlobalInteractionImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getGlobalInteraction() - * @generated - */ - EClass GLOBAL_INTERACTION = eINSTANCE.getGlobalInteraction(); - - /** - * The meta object literal for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalMessageTransferImpl Global Message Transfer}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.GlobalMessageTransferImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getGlobalMessageTransfer() - * @generated - */ - EClass GLOBAL_MESSAGE_TRANSFER = eINSTANCE.getGlobalMessageTransfer(); - - /** - * The meta object literal for the 'Message' containment reference feature. - * - * - * @generated - */ - EReference GLOBAL_MESSAGE_TRANSFER__MESSAGE = eINSTANCE.getGlobalMessageTransfer_Message(); - - /** - * The meta object literal for the 'From Role' attribute feature. - * - * - * @generated - */ - EAttribute GLOBAL_MESSAGE_TRANSFER__FROM_ROLE = eINSTANCE.getGlobalMessageTransfer_FromRole(); - - /** - * The meta object literal for the 'To Roles' attribute list feature. - * - * - * @generated - */ - EAttribute GLOBAL_MESSAGE_TRANSFER__TO_ROLES = eINSTANCE.getGlobalMessageTransfer_ToRoles(); - - /** - * The meta object literal for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.MessageImpl Message}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.MessageImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getMessage() - * @generated - */ - EClass MESSAGE = eINSTANCE.getMessage(); - - /** - * The meta object literal for the 'Signature' containment reference feature. - * - * - * @generated - */ - EReference MESSAGE__SIGNATURE = eINSTANCE.getMessage_Signature(); - - /** - * The meta object literal for the 'Parameter' attribute feature. - * - * - * @generated - */ - EAttribute MESSAGE__PARAMETER = eINSTANCE.getMessage_Parameter(); - - /** - * The meta object literal for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalChoiceImpl Global Choice}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.GlobalChoiceImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getGlobalChoice() - * @generated - */ - EClass GLOBAL_CHOICE = eINSTANCE.getGlobalChoice(); - - /** - * The meta object literal for the 'Role' attribute feature. - * - * - * @generated - */ - EAttribute GLOBAL_CHOICE__ROLE = eINSTANCE.getGlobalChoice_Role(); - - /** - * The meta object literal for the 'Blocks' containment reference list feature. - * - * - * @generated - */ - EReference GLOBAL_CHOICE__BLOCKS = eINSTANCE.getGlobalChoice_Blocks(); - - /** - * The meta object literal for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalRecursionImpl Global Recursion}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.GlobalRecursionImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getGlobalRecursion() - * @generated - */ - EClass GLOBAL_RECURSION = eINSTANCE.getGlobalRecursion(); - - /** - * The meta object literal for the 'Label' attribute feature. - * - * - * @generated - */ - EAttribute GLOBAL_RECURSION__LABEL = eINSTANCE.getGlobalRecursion_Label(); - - /** - * The meta object literal for the 'Block' containment reference feature. - * - * - * @generated - */ - EReference GLOBAL_RECURSION__BLOCK = eINSTANCE.getGlobalRecursion_Block(); - - /** - * The meta object literal for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalContinueImpl Global Continue}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.GlobalContinueImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getGlobalContinue() - * @generated - */ - EClass GLOBAL_CONTINUE = eINSTANCE.getGlobalContinue(); - - /** - * The meta object literal for the 'Label' attribute feature. - * - * - * @generated - */ - EAttribute GLOBAL_CONTINUE__LABEL = eINSTANCE.getGlobalContinue_Label(); - - /** - * The meta object literal for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalParallelImpl Global Parallel}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.GlobalParallelImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getGlobalParallel() - * @generated - */ - EClass GLOBAL_PARALLEL = eINSTANCE.getGlobalParallel(); - - /** - * The meta object literal for the 'Blocks' containment reference list feature. - * - * - * @generated - */ - EReference GLOBAL_PARALLEL__BLOCKS = eINSTANCE.getGlobalParallel_Blocks(); - - /** - * The meta object literal for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalInterruptibleImpl Global Interruptible}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.GlobalInterruptibleImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getGlobalInterruptible() - * @generated - */ - EClass GLOBAL_INTERRUPTIBLE = eINSTANCE.getGlobalInterruptible(); - - /** - * The meta object literal for the 'Scope' attribute feature. - * - * - * @generated - */ - EAttribute GLOBAL_INTERRUPTIBLE__SCOPE = eINSTANCE.getGlobalInterruptible_Scope(); - - /** - * The meta object literal for the 'Block' containment reference feature. - * - * - * @generated - */ - EReference GLOBAL_INTERRUPTIBLE__BLOCK = eINSTANCE.getGlobalInterruptible_Block(); - - /** - * The meta object literal for the 'Interrupts' containment reference list feature. - * - * - * @generated - */ - EReference GLOBAL_INTERRUPTIBLE__INTERRUPTS = eINSTANCE.getGlobalInterruptible_Interrupts(); - - /** - * The meta object literal for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalInterruptImpl Global Interrupt}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.GlobalInterruptImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getGlobalInterrupt() - * @generated - */ - EClass GLOBAL_INTERRUPT = eINSTANCE.getGlobalInterrupt(); - - /** - * The meta object literal for the 'Messages' containment reference list feature. - * - * - * @generated - */ - EReference GLOBAL_INTERRUPT__MESSAGES = eINSTANCE.getGlobalInterrupt_Messages(); - - /** - * The meta object literal for the 'Role' attribute feature. - * - * - * @generated - */ - EAttribute GLOBAL_INTERRUPT__ROLE = eINSTANCE.getGlobalInterrupt_Role(); - - /** - * The meta object literal for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalDoImpl Global Do}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.GlobalDoImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getGlobalDo() - * @generated - */ - EClass GLOBAL_DO = eINSTANCE.getGlobalDo(); - - /** - * The meta object literal for the 'Scope' attribute feature. - * - * - * @generated - */ - EAttribute GLOBAL_DO__SCOPE = eINSTANCE.getGlobalDo_Scope(); - - /** - * The meta object literal for the 'Member' attribute feature. - * - * - * @generated - */ - EAttribute GLOBAL_DO__MEMBER = eINSTANCE.getGlobalDo_Member(); - - /** - * The meta object literal for the 'Arguments' containment reference list feature. - * - * - * @generated - */ - EReference GLOBAL_DO__ARGUMENTS = eINSTANCE.getGlobalDo_Arguments(); - - /** - * The meta object literal for the 'Roles' containment reference list feature. - * - * - * @generated - */ - EReference GLOBAL_DO__ROLES = eINSTANCE.getGlobalDo_Roles(); - - /** - * The meta object literal for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.LocalProtocolDeclImpl Local Protocol Decl}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.LocalProtocolDeclImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getLocalProtocolDecl() - * @generated - */ - EClass LOCAL_PROTOCOL_DECL = eINSTANCE.getLocalProtocolDecl(); - - /** - * The meta object literal for the 'Name' attribute feature. - * - * - * @generated - */ - EAttribute LOCAL_PROTOCOL_DECL__NAME = eINSTANCE.getLocalProtocolDecl_Name(); - - /** - * The meta object literal for the 'Role' attribute feature. - * - * - * @generated - */ - EAttribute LOCAL_PROTOCOL_DECL__ROLE = eINSTANCE.getLocalProtocolDecl_Role(); - - /** - * The meta object literal for the 'Parameters' containment reference list feature. - * - * - * @generated - */ - EReference LOCAL_PROTOCOL_DECL__PARAMETERS = eINSTANCE.getLocalProtocolDecl_Parameters(); - - /** - * The meta object literal for the 'Roles' containment reference list feature. - * - * - * @generated - */ - EReference LOCAL_PROTOCOL_DECL__ROLES = eINSTANCE.getLocalProtocolDecl_Roles(); - - /** - * The meta object literal for the 'Block' containment reference feature. - * - * - * @generated - */ - EReference LOCAL_PROTOCOL_DECL__BLOCK = eINSTANCE.getLocalProtocolDecl_Block(); - - /** - * The meta object literal for the 'Instantiates' attribute feature. - * - * - * @generated - */ - EAttribute LOCAL_PROTOCOL_DECL__INSTANTIATES = eINSTANCE.getLocalProtocolDecl_Instantiates(); - - /** - * The meta object literal for the 'Arguments' containment reference list feature. - * - * - * @generated - */ - EReference LOCAL_PROTOCOL_DECL__ARGUMENTS = eINSTANCE.getLocalProtocolDecl_Arguments(); - - /** - * The meta object literal for the 'Role Instantiations' containment reference list feature. - * - * - * @generated - */ - EReference LOCAL_PROTOCOL_DECL__ROLE_INSTANTIATIONS = eINSTANCE.getLocalProtocolDecl_RoleInstantiations(); - - /** - * The meta object literal for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.LocalProtocolBlockImpl Local Protocol Block}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.LocalProtocolBlockImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getLocalProtocolBlock() - * @generated - */ - EClass LOCAL_PROTOCOL_BLOCK = eINSTANCE.getLocalProtocolBlock(); - - /** - * The meta object literal for the 'Activities' containment reference list feature. - * - * - * @generated - */ - EReference LOCAL_PROTOCOL_BLOCK__ACTIVITIES = eINSTANCE.getLocalProtocolBlock_Activities(); - - /** - * The meta object literal for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.LlobalInteractionImpl Llobal Interaction}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.LlobalInteractionImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getLlobalInteraction() - * @generated - */ - EClass LLOBAL_INTERACTION = eINSTANCE.getLlobalInteraction(); - - /** - * The meta object literal for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.LocalSendImpl Local Send}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.LocalSendImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getLocalSend() - * @generated - */ - EClass LOCAL_SEND = eINSTANCE.getLocalSend(); - - /** - * The meta object literal for the 'Message' containment reference feature. - * - * - * @generated - */ - EReference LOCAL_SEND__MESSAGE = eINSTANCE.getLocalSend_Message(); - - /** - * The meta object literal for the 'To Roles' attribute list feature. - * - * - * @generated - */ - EAttribute LOCAL_SEND__TO_ROLES = eINSTANCE.getLocalSend_ToRoles(); - - /** - * The meta object literal for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.LocalReceiveImpl Local Receive}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.LocalReceiveImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getLocalReceive() - * @generated - */ - EClass LOCAL_RECEIVE = eINSTANCE.getLocalReceive(); - - /** - * The meta object literal for the 'Message' containment reference feature. - * - * - * @generated - */ - EReference LOCAL_RECEIVE__MESSAGE = eINSTANCE.getLocalReceive_Message(); - - /** - * The meta object literal for the 'From Role' attribute feature. - * - * - * @generated - */ - EAttribute LOCAL_RECEIVE__FROM_ROLE = eINSTANCE.getLocalReceive_FromRole(); - - /** - * The meta object literal for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.LocalChoiceImpl Local Choice}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.LocalChoiceImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getLocalChoice() - * @generated - */ - EClass LOCAL_CHOICE = eINSTANCE.getLocalChoice(); - - /** - * The meta object literal for the 'Role' attribute feature. - * - * - * @generated - */ - EAttribute LOCAL_CHOICE__ROLE = eINSTANCE.getLocalChoice_Role(); - - /** - * The meta object literal for the 'Blocks' containment reference list feature. - * - * - * @generated - */ - EReference LOCAL_CHOICE__BLOCKS = eINSTANCE.getLocalChoice_Blocks(); - - /** - * The meta object literal for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.LocalRecursionImpl Local Recursion}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.LocalRecursionImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getLocalRecursion() - * @generated - */ - EClass LOCAL_RECURSION = eINSTANCE.getLocalRecursion(); - - /** - * The meta object literal for the 'Label' attribute feature. - * - * - * @generated - */ - EAttribute LOCAL_RECURSION__LABEL = eINSTANCE.getLocalRecursion_Label(); - - /** - * The meta object literal for the 'Block' containment reference feature. - * - * - * @generated - */ - EReference LOCAL_RECURSION__BLOCK = eINSTANCE.getLocalRecursion_Block(); - - /** - * The meta object literal for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.LocalContinueImpl Local Continue}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.LocalContinueImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getLocalContinue() - * @generated - */ - EClass LOCAL_CONTINUE = eINSTANCE.getLocalContinue(); - - /** - * The meta object literal for the 'Label' attribute feature. - * - * - * @generated - */ - EAttribute LOCAL_CONTINUE__LABEL = eINSTANCE.getLocalContinue_Label(); - - /** - * The meta object literal for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.LocalParallelImpl Local Parallel}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.LocalParallelImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getLocalParallel() - * @generated - */ - EClass LOCAL_PARALLEL = eINSTANCE.getLocalParallel(); - - /** - * The meta object literal for the 'Blocks' containment reference list feature. - * - * - * @generated - */ - EReference LOCAL_PARALLEL__BLOCKS = eINSTANCE.getLocalParallel_Blocks(); - - /** - * The meta object literal for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.LocalInterruptibleImpl Local Interruptible}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.LocalInterruptibleImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getLocalInterruptible() - * @generated - */ - EClass LOCAL_INTERRUPTIBLE = eINSTANCE.getLocalInterruptible(); - - /** - * The meta object literal for the 'Scope' attribute feature. - * - * - * @generated - */ - EAttribute LOCAL_INTERRUPTIBLE__SCOPE = eINSTANCE.getLocalInterruptible_Scope(); - - /** - * The meta object literal for the 'Block' containment reference feature. - * - * - * @generated - */ - EReference LOCAL_INTERRUPTIBLE__BLOCK = eINSTANCE.getLocalInterruptible_Block(); - - /** - * The meta object literal for the 'Throw' containment reference feature. - * - * - * @generated - */ - EReference LOCAL_INTERRUPTIBLE__THROW = eINSTANCE.getLocalInterruptible_Throw(); - - /** - * The meta object literal for the 'Catches' containment reference list feature. - * - * - * @generated - */ - EReference LOCAL_INTERRUPTIBLE__CATCHES = eINSTANCE.getLocalInterruptible_Catches(); - - /** - * The meta object literal for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.LocalThrowImpl Local Throw}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.LocalThrowImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getLocalThrow() - * @generated - */ - EClass LOCAL_THROW = eINSTANCE.getLocalThrow(); - - /** - * The meta object literal for the 'Messages' containment reference list feature. - * - * - * @generated - */ - EReference LOCAL_THROW__MESSAGES = eINSTANCE.getLocalThrow_Messages(); - - /** - * The meta object literal for the 'To Roles' attribute list feature. - * - * - * @generated - */ - EAttribute LOCAL_THROW__TO_ROLES = eINSTANCE.getLocalThrow_ToRoles(); - - /** - * The meta object literal for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.LocalCatchImpl Local Catch}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.LocalCatchImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getLocalCatch() - * @generated - */ - EClass LOCAL_CATCH = eINSTANCE.getLocalCatch(); - - /** - * The meta object literal for the 'Messages' containment reference list feature. - * - * - * @generated - */ - EReference LOCAL_CATCH__MESSAGES = eINSTANCE.getLocalCatch_Messages(); - - /** - * The meta object literal for the 'From Role' attribute feature. - * - * - * @generated - */ - EAttribute LOCAL_CATCH__FROM_ROLE = eINSTANCE.getLocalCatch_FromRole(); - - /** - * The meta object literal for the '{@link org.scribble.editor.dsl.scribbleDsl.impl.LocalDoImpl Local Do}' class. - * - * - * @see org.scribble.editor.dsl.scribbleDsl.impl.LocalDoImpl - * @see org.scribble.editor.dsl.scribbleDsl.impl.ScribbleDslPackageImpl#getLocalDo() - * @generated - */ - EClass LOCAL_DO = eINSTANCE.getLocalDo(); - - /** - * The meta object literal for the 'Scope' attribute feature. - * - * - * @generated - */ - EAttribute LOCAL_DO__SCOPE = eINSTANCE.getLocalDo_Scope(); - - /** - * The meta object literal for the 'Member' attribute feature. - * - * - * @generated - */ - EAttribute LOCAL_DO__MEMBER = eINSTANCE.getLocalDo_Member(); - - /** - * The meta object literal for the 'Arguments' containment reference list feature. - * - * - * @generated - */ - EReference LOCAL_DO__ARGUMENTS = eINSTANCE.getLocalDo_Arguments(); - - /** - * The meta object literal for the 'Roles' containment reference list feature. - * - * - * @generated - */ - EReference LOCAL_DO__ROLES = eINSTANCE.getLocalDo_Roles(); - - } - -} //ScribbleDslPackage diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/ArgumentImpl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/ArgumentImpl.java deleted file mode 100644 index 5ea33905e..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/ArgumentImpl.java +++ /dev/null @@ -1,321 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; - -import org.scribble.editor.dsl.scribbleDsl.Argument; -import org.scribble.editor.dsl.scribbleDsl.MessageSignature; -import org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage; - -/** - * - * An implementation of the model object 'Argument'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.ArgumentImpl#getSignature Signature}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.ArgumentImpl#getAlias Alias}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.ArgumentImpl#getName Name}
  • - *
- *

- * - * @generated - */ -public class ArgumentImpl extends MinimalEObjectImpl.Container implements Argument -{ - /** - * The cached value of the '{@link #getSignature() Signature}' containment reference. - * - * - * @see #getSignature() - * @generated - * @ordered - */ - protected MessageSignature signature; - - /** - * The default value of the '{@link #getAlias() Alias}' attribute. - * - * - * @see #getAlias() - * @generated - * @ordered - */ - protected static final String ALIAS_EDEFAULT = null; - - /** - * The cached value of the '{@link #getAlias() Alias}' attribute. - * - * - * @see #getAlias() - * @generated - * @ordered - */ - protected String alias = ALIAS_EDEFAULT; - - /** - * The default value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * - * - * @generated - */ - protected ArgumentImpl() - { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() - { - return ScribbleDslPackage.Literals.ARGUMENT; - } - - /** - * - * - * @generated - */ - public MessageSignature getSignature() - { - return signature; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetSignature(MessageSignature newSignature, NotificationChain msgs) - { - MessageSignature oldSignature = signature; - signature = newSignature; - if (eNotificationRequired()) - { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.ARGUMENT__SIGNATURE, oldSignature, newSignature); - if (msgs == null) msgs = notification; else msgs.add(notification); - } - return msgs; - } - - /** - * - * - * @generated - */ - public void setSignature(MessageSignature newSignature) - { - if (newSignature != signature) - { - NotificationChain msgs = null; - if (signature != null) - msgs = ((InternalEObject)signature).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ScribbleDslPackage.ARGUMENT__SIGNATURE, null, msgs); - if (newSignature != null) - msgs = ((InternalEObject)newSignature).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ScribbleDslPackage.ARGUMENT__SIGNATURE, null, msgs); - msgs = basicSetSignature(newSignature, msgs); - if (msgs != null) msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.ARGUMENT__SIGNATURE, newSignature, newSignature)); - } - - /** - * - * - * @generated - */ - public String getAlias() - { - return alias; - } - - /** - * - * - * @generated - */ - public void setAlias(String newAlias) - { - String oldAlias = alias; - alias = newAlias; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.ARGUMENT__ALIAS, oldAlias, alias)); - } - - /** - * - * - * @generated - */ - public String getName() - { - return name; - } - - /** - * - * - * @generated - */ - public void setName(String newName) - { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.ARGUMENT__NAME, oldName, name)); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case ScribbleDslPackage.ARGUMENT__SIGNATURE: - return basicSetSignature(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ScribbleDslPackage.ARGUMENT__SIGNATURE: - return getSignature(); - case ScribbleDslPackage.ARGUMENT__ALIAS: - return getAlias(); - case ScribbleDslPackage.ARGUMENT__NAME: - return getName(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ScribbleDslPackage.ARGUMENT__SIGNATURE: - setSignature((MessageSignature)newValue); - return; - case ScribbleDslPackage.ARGUMENT__ALIAS: - setAlias((String)newValue); - return; - case ScribbleDslPackage.ARGUMENT__NAME: - setName((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.ARGUMENT__SIGNATURE: - setSignature((MessageSignature)null); - return; - case ScribbleDslPackage.ARGUMENT__ALIAS: - setAlias(ALIAS_EDEFAULT); - return; - case ScribbleDslPackage.ARGUMENT__NAME: - setName(NAME_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.ARGUMENT__SIGNATURE: - return signature != null; - case ScribbleDslPackage.ARGUMENT__ALIAS: - return ALIAS_EDEFAULT == null ? alias != null : !ALIAS_EDEFAULT.equals(alias); - case ScribbleDslPackage.ARGUMENT__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (alias: "); - result.append(alias); - result.append(", name: "); - result.append(name); - result.append(')'); - return result.toString(); - } - -} //ArgumentImpl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/GlobalChoiceImpl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/GlobalChoiceImpl.java deleted file mode 100644 index b7be14d37..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/GlobalChoiceImpl.java +++ /dev/null @@ -1,239 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl.impl; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -import org.scribble.editor.dsl.scribbleDsl.GlobalChoice; -import org.scribble.editor.dsl.scribbleDsl.GlobalProtocolBlock; -import org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage; - -/** - * - * An implementation of the model object 'Global Choice'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalChoiceImpl#getRole Role}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalChoiceImpl#getBlocks Blocks}
  • - *
- *

- * - * @generated - */ -public class GlobalChoiceImpl extends GlobalInteractionImpl implements GlobalChoice -{ - /** - * The default value of the '{@link #getRole() Role}' attribute. - * - * - * @see #getRole() - * @generated - * @ordered - */ - protected static final String ROLE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getRole() Role}' attribute. - * - * - * @see #getRole() - * @generated - * @ordered - */ - protected String role = ROLE_EDEFAULT; - - /** - * The cached value of the '{@link #getBlocks() Blocks}' containment reference list. - * - * - * @see #getBlocks() - * @generated - * @ordered - */ - protected EList blocks; - - /** - * - * - * @generated - */ - protected GlobalChoiceImpl() - { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() - { - return ScribbleDslPackage.Literals.GLOBAL_CHOICE; - } - - /** - * - * - * @generated - */ - public String getRole() - { - return role; - } - - /** - * - * - * @generated - */ - public void setRole(String newRole) - { - String oldRole = role; - role = newRole; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.GLOBAL_CHOICE__ROLE, oldRole, role)); - } - - /** - * - * - * @generated - */ - public EList getBlocks() - { - if (blocks == null) - { - blocks = new EObjectContainmentEList(GlobalProtocolBlock.class, this, ScribbleDslPackage.GLOBAL_CHOICE__BLOCKS); - } - return blocks; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_CHOICE__BLOCKS: - return ((InternalEList)getBlocks()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_CHOICE__ROLE: - return getRole(); - case ScribbleDslPackage.GLOBAL_CHOICE__BLOCKS: - return getBlocks(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_CHOICE__ROLE: - setRole((String)newValue); - return; - case ScribbleDslPackage.GLOBAL_CHOICE__BLOCKS: - getBlocks().clear(); - getBlocks().addAll((Collection)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_CHOICE__ROLE: - setRole(ROLE_EDEFAULT); - return; - case ScribbleDslPackage.GLOBAL_CHOICE__BLOCKS: - getBlocks().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_CHOICE__ROLE: - return ROLE_EDEFAULT == null ? role != null : !ROLE_EDEFAULT.equals(role); - case ScribbleDslPackage.GLOBAL_CHOICE__BLOCKS: - return blocks != null && !blocks.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (role: "); - result.append(role); - result.append(')'); - return result.toString(); - } - -} //GlobalChoiceImpl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/GlobalContinueImpl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/GlobalContinueImpl.java deleted file mode 100644 index ba4b96ab6..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/GlobalContinueImpl.java +++ /dev/null @@ -1,176 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl.impl; - -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.ecore.EClass; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -import org.scribble.editor.dsl.scribbleDsl.GlobalContinue; -import org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage; - -/** - * - * An implementation of the model object 'Global Continue'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalContinueImpl#getLabel Label}
  • - *
- *

- * - * @generated - */ -public class GlobalContinueImpl extends GlobalInteractionImpl implements GlobalContinue -{ - /** - * The default value of the '{@link #getLabel() Label}' attribute. - * - * - * @see #getLabel() - * @generated - * @ordered - */ - protected static final String LABEL_EDEFAULT = null; - - /** - * The cached value of the '{@link #getLabel() Label}' attribute. - * - * - * @see #getLabel() - * @generated - * @ordered - */ - protected String label = LABEL_EDEFAULT; - - /** - * - * - * @generated - */ - protected GlobalContinueImpl() - { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() - { - return ScribbleDslPackage.Literals.GLOBAL_CONTINUE; - } - - /** - * - * - * @generated - */ - public String getLabel() - { - return label; - } - - /** - * - * - * @generated - */ - public void setLabel(String newLabel) - { - String oldLabel = label; - label = newLabel; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.GLOBAL_CONTINUE__LABEL, oldLabel, label)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_CONTINUE__LABEL: - return getLabel(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_CONTINUE__LABEL: - setLabel((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_CONTINUE__LABEL: - setLabel(LABEL_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_CONTINUE__LABEL: - return LABEL_EDEFAULT == null ? label != null : !LABEL_EDEFAULT.equals(label); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (label: "); - result.append(label); - result.append(')'); - return result.toString(); - } - -} //GlobalContinueImpl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/GlobalDoImpl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/GlobalDoImpl.java deleted file mode 100644 index 1b63bd09a..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/GlobalDoImpl.java +++ /dev/null @@ -1,334 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl.impl; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -import org.scribble.editor.dsl.scribbleDsl.Argument; -import org.scribble.editor.dsl.scribbleDsl.GlobalDo; -import org.scribble.editor.dsl.scribbleDsl.RoleInstantiation; -import org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage; - -/** - * - * An implementation of the model object 'Global Do'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalDoImpl#getScope Scope}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalDoImpl#getMember Member}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalDoImpl#getArguments Arguments}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalDoImpl#getRoles Roles}
  • - *
- *

- * - * @generated - */ -public class GlobalDoImpl extends GlobalInteractionImpl implements GlobalDo -{ - /** - * The default value of the '{@link #getScope() Scope}' attribute. - * - * - * @see #getScope() - * @generated - * @ordered - */ - protected static final String SCOPE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getScope() Scope}' attribute. - * - * - * @see #getScope() - * @generated - * @ordered - */ - protected String scope = SCOPE_EDEFAULT; - - /** - * The default value of the '{@link #getMember() Member}' attribute. - * - * - * @see #getMember() - * @generated - * @ordered - */ - protected static final String MEMBER_EDEFAULT = null; - - /** - * The cached value of the '{@link #getMember() Member}' attribute. - * - * - * @see #getMember() - * @generated - * @ordered - */ - protected String member = MEMBER_EDEFAULT; - - /** - * The cached value of the '{@link #getArguments() Arguments}' containment reference list. - * - * - * @see #getArguments() - * @generated - * @ordered - */ - protected EList arguments; - - /** - * The cached value of the '{@link #getRoles() Roles}' containment reference list. - * - * - * @see #getRoles() - * @generated - * @ordered - */ - protected EList roles; - - /** - * - * - * @generated - */ - protected GlobalDoImpl() - { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() - { - return ScribbleDslPackage.Literals.GLOBAL_DO; - } - - /** - * - * - * @generated - */ - public String getScope() - { - return scope; - } - - /** - * - * - * @generated - */ - public void setScope(String newScope) - { - String oldScope = scope; - scope = newScope; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.GLOBAL_DO__SCOPE, oldScope, scope)); - } - - /** - * - * - * @generated - */ - public String getMember() - { - return member; - } - - /** - * - * - * @generated - */ - public void setMember(String newMember) - { - String oldMember = member; - member = newMember; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.GLOBAL_DO__MEMBER, oldMember, member)); - } - - /** - * - * - * @generated - */ - public EList getArguments() - { - if (arguments == null) - { - arguments = new EObjectContainmentEList(Argument.class, this, ScribbleDslPackage.GLOBAL_DO__ARGUMENTS); - } - return arguments; - } - - /** - * - * - * @generated - */ - public EList getRoles() - { - if (roles == null) - { - roles = new EObjectContainmentEList(RoleInstantiation.class, this, ScribbleDslPackage.GLOBAL_DO__ROLES); - } - return roles; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_DO__ARGUMENTS: - return ((InternalEList)getArguments()).basicRemove(otherEnd, msgs); - case ScribbleDslPackage.GLOBAL_DO__ROLES: - return ((InternalEList)getRoles()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_DO__SCOPE: - return getScope(); - case ScribbleDslPackage.GLOBAL_DO__MEMBER: - return getMember(); - case ScribbleDslPackage.GLOBAL_DO__ARGUMENTS: - return getArguments(); - case ScribbleDslPackage.GLOBAL_DO__ROLES: - return getRoles(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_DO__SCOPE: - setScope((String)newValue); - return; - case ScribbleDslPackage.GLOBAL_DO__MEMBER: - setMember((String)newValue); - return; - case ScribbleDslPackage.GLOBAL_DO__ARGUMENTS: - getArguments().clear(); - getArguments().addAll((Collection)newValue); - return; - case ScribbleDslPackage.GLOBAL_DO__ROLES: - getRoles().clear(); - getRoles().addAll((Collection)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_DO__SCOPE: - setScope(SCOPE_EDEFAULT); - return; - case ScribbleDslPackage.GLOBAL_DO__MEMBER: - setMember(MEMBER_EDEFAULT); - return; - case ScribbleDslPackage.GLOBAL_DO__ARGUMENTS: - getArguments().clear(); - return; - case ScribbleDslPackage.GLOBAL_DO__ROLES: - getRoles().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_DO__SCOPE: - return SCOPE_EDEFAULT == null ? scope != null : !SCOPE_EDEFAULT.equals(scope); - case ScribbleDslPackage.GLOBAL_DO__MEMBER: - return MEMBER_EDEFAULT == null ? member != null : !MEMBER_EDEFAULT.equals(member); - case ScribbleDslPackage.GLOBAL_DO__ARGUMENTS: - return arguments != null && !arguments.isEmpty(); - case ScribbleDslPackage.GLOBAL_DO__ROLES: - return roles != null && !roles.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (scope: "); - result.append(scope); - result.append(", member: "); - result.append(member); - result.append(')'); - return result.toString(); - } - -} //GlobalDoImpl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/GlobalInteractionImpl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/GlobalInteractionImpl.java deleted file mode 100644 index 0fb5e085f..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/GlobalInteractionImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl.impl; - -import org.eclipse.emf.ecore.EClass; - -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; - -import org.scribble.editor.dsl.scribbleDsl.GlobalInteraction; -import org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage; - -/** - * - * An implementation of the model object 'Global Interaction'. - * - *

- *

- * - * @generated - */ -public class GlobalInteractionImpl extends MinimalEObjectImpl.Container implements GlobalInteraction -{ - /** - * - * - * @generated - */ - protected GlobalInteractionImpl() - { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() - { - return ScribbleDslPackage.Literals.GLOBAL_INTERACTION; - } - -} //GlobalInteractionImpl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/GlobalInterruptImpl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/GlobalInterruptImpl.java deleted file mode 100644 index 2cac3219b..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/GlobalInterruptImpl.java +++ /dev/null @@ -1,240 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl.impl; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; - -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -import org.scribble.editor.dsl.scribbleDsl.GlobalInterrupt; -import org.scribble.editor.dsl.scribbleDsl.Message; -import org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage; - -/** - * - * An implementation of the model object 'Global Interrupt'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalInterruptImpl#getMessages Messages}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalInterruptImpl#getRole Role}
  • - *
- *

- * - * @generated - */ -public class GlobalInterruptImpl extends MinimalEObjectImpl.Container implements GlobalInterrupt -{ - /** - * The cached value of the '{@link #getMessages() Messages}' containment reference list. - * - * - * @see #getMessages() - * @generated - * @ordered - */ - protected EList messages; - - /** - * The default value of the '{@link #getRole() Role}' attribute. - * - * - * @see #getRole() - * @generated - * @ordered - */ - protected static final String ROLE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getRole() Role}' attribute. - * - * - * @see #getRole() - * @generated - * @ordered - */ - protected String role = ROLE_EDEFAULT; - - /** - * - * - * @generated - */ - protected GlobalInterruptImpl() - { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() - { - return ScribbleDslPackage.Literals.GLOBAL_INTERRUPT; - } - - /** - * - * - * @generated - */ - public EList getMessages() - { - if (messages == null) - { - messages = new EObjectContainmentEList(Message.class, this, ScribbleDslPackage.GLOBAL_INTERRUPT__MESSAGES); - } - return messages; - } - - /** - * - * - * @generated - */ - public String getRole() - { - return role; - } - - /** - * - * - * @generated - */ - public void setRole(String newRole) - { - String oldRole = role; - role = newRole; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.GLOBAL_INTERRUPT__ROLE, oldRole, role)); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_INTERRUPT__MESSAGES: - return ((InternalEList)getMessages()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_INTERRUPT__MESSAGES: - return getMessages(); - case ScribbleDslPackage.GLOBAL_INTERRUPT__ROLE: - return getRole(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_INTERRUPT__MESSAGES: - getMessages().clear(); - getMessages().addAll((Collection)newValue); - return; - case ScribbleDslPackage.GLOBAL_INTERRUPT__ROLE: - setRole((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_INTERRUPT__MESSAGES: - getMessages().clear(); - return; - case ScribbleDslPackage.GLOBAL_INTERRUPT__ROLE: - setRole(ROLE_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_INTERRUPT__MESSAGES: - return messages != null && !messages.isEmpty(); - case ScribbleDslPackage.GLOBAL_INTERRUPT__ROLE: - return ROLE_EDEFAULT == null ? role != null : !ROLE_EDEFAULT.equals(role); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (role: "); - result.append(role); - result.append(')'); - return result.toString(); - } - -} //GlobalInterruptImpl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/GlobalInterruptibleImpl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/GlobalInterruptibleImpl.java deleted file mode 100644 index 6841c785b..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/GlobalInterruptibleImpl.java +++ /dev/null @@ -1,311 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl.impl; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -import org.scribble.editor.dsl.scribbleDsl.GlobalInterrupt; -import org.scribble.editor.dsl.scribbleDsl.GlobalInterruptible; -import org.scribble.editor.dsl.scribbleDsl.GlobalProtocolBlock; -import org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage; - -/** - * - * An implementation of the model object 'Global Interruptible'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalInterruptibleImpl#getScope Scope}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalInterruptibleImpl#getBlock Block}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalInterruptibleImpl#getInterrupts Interrupts}
  • - *
- *

- * - * @generated - */ -public class GlobalInterruptibleImpl extends GlobalInteractionImpl implements GlobalInterruptible -{ - /** - * The default value of the '{@link #getScope() Scope}' attribute. - * - * - * @see #getScope() - * @generated - * @ordered - */ - protected static final String SCOPE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getScope() Scope}' attribute. - * - * - * @see #getScope() - * @generated - * @ordered - */ - protected String scope = SCOPE_EDEFAULT; - - /** - * The cached value of the '{@link #getBlock() Block}' containment reference. - * - * - * @see #getBlock() - * @generated - * @ordered - */ - protected GlobalProtocolBlock block; - - /** - * The cached value of the '{@link #getInterrupts() Interrupts}' containment reference list. - * - * - * @see #getInterrupts() - * @generated - * @ordered - */ - protected EList interrupts; - - /** - * - * - * @generated - */ - protected GlobalInterruptibleImpl() - { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() - { - return ScribbleDslPackage.Literals.GLOBAL_INTERRUPTIBLE; - } - - /** - * - * - * @generated - */ - public String getScope() - { - return scope; - } - - /** - * - * - * @generated - */ - public void setScope(String newScope) - { - String oldScope = scope; - scope = newScope; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.GLOBAL_INTERRUPTIBLE__SCOPE, oldScope, scope)); - } - - /** - * - * - * @generated - */ - public GlobalProtocolBlock getBlock() - { - return block; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetBlock(GlobalProtocolBlock newBlock, NotificationChain msgs) - { - GlobalProtocolBlock oldBlock = block; - block = newBlock; - if (eNotificationRequired()) - { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.GLOBAL_INTERRUPTIBLE__BLOCK, oldBlock, newBlock); - if (msgs == null) msgs = notification; else msgs.add(notification); - } - return msgs; - } - - /** - * - * - * @generated - */ - public void setBlock(GlobalProtocolBlock newBlock) - { - if (newBlock != block) - { - NotificationChain msgs = null; - if (block != null) - msgs = ((InternalEObject)block).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ScribbleDslPackage.GLOBAL_INTERRUPTIBLE__BLOCK, null, msgs); - if (newBlock != null) - msgs = ((InternalEObject)newBlock).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ScribbleDslPackage.GLOBAL_INTERRUPTIBLE__BLOCK, null, msgs); - msgs = basicSetBlock(newBlock, msgs); - if (msgs != null) msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.GLOBAL_INTERRUPTIBLE__BLOCK, newBlock, newBlock)); - } - - /** - * - * - * @generated - */ - public EList getInterrupts() - { - if (interrupts == null) - { - interrupts = new EObjectContainmentEList(GlobalInterrupt.class, this, ScribbleDslPackage.GLOBAL_INTERRUPTIBLE__INTERRUPTS); - } - return interrupts; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_INTERRUPTIBLE__BLOCK: - return basicSetBlock(null, msgs); - case ScribbleDslPackage.GLOBAL_INTERRUPTIBLE__INTERRUPTS: - return ((InternalEList)getInterrupts()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_INTERRUPTIBLE__SCOPE: - return getScope(); - case ScribbleDslPackage.GLOBAL_INTERRUPTIBLE__BLOCK: - return getBlock(); - case ScribbleDslPackage.GLOBAL_INTERRUPTIBLE__INTERRUPTS: - return getInterrupts(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_INTERRUPTIBLE__SCOPE: - setScope((String)newValue); - return; - case ScribbleDslPackage.GLOBAL_INTERRUPTIBLE__BLOCK: - setBlock((GlobalProtocolBlock)newValue); - return; - case ScribbleDslPackage.GLOBAL_INTERRUPTIBLE__INTERRUPTS: - getInterrupts().clear(); - getInterrupts().addAll((Collection)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_INTERRUPTIBLE__SCOPE: - setScope(SCOPE_EDEFAULT); - return; - case ScribbleDslPackage.GLOBAL_INTERRUPTIBLE__BLOCK: - setBlock((GlobalProtocolBlock)null); - return; - case ScribbleDslPackage.GLOBAL_INTERRUPTIBLE__INTERRUPTS: - getInterrupts().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_INTERRUPTIBLE__SCOPE: - return SCOPE_EDEFAULT == null ? scope != null : !SCOPE_EDEFAULT.equals(scope); - case ScribbleDslPackage.GLOBAL_INTERRUPTIBLE__BLOCK: - return block != null; - case ScribbleDslPackage.GLOBAL_INTERRUPTIBLE__INTERRUPTS: - return interrupts != null && !interrupts.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (scope: "); - result.append(scope); - result.append(')'); - return result.toString(); - } - -} //GlobalInterruptibleImpl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/GlobalMessageTransferImpl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/GlobalMessageTransferImpl.java deleted file mode 100644 index 964c2ff14..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/GlobalMessageTransferImpl.java +++ /dev/null @@ -1,309 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl.impl; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -import org.eclipse.emf.ecore.util.EDataTypeEList; - -import org.scribble.editor.dsl.scribbleDsl.GlobalMessageTransfer; -import org.scribble.editor.dsl.scribbleDsl.Message; -import org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage; - -/** - * - * An implementation of the model object 'Global Message Transfer'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalMessageTransferImpl#getMessage Message}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalMessageTransferImpl#getFromRole From Role}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalMessageTransferImpl#getToRoles To Roles}
  • - *
- *

- * - * @generated - */ -public class GlobalMessageTransferImpl extends GlobalInteractionImpl implements GlobalMessageTransfer -{ - /** - * The cached value of the '{@link #getMessage() Message}' containment reference. - * - * - * @see #getMessage() - * @generated - * @ordered - */ - protected Message message; - - /** - * The default value of the '{@link #getFromRole() From Role}' attribute. - * - * - * @see #getFromRole() - * @generated - * @ordered - */ - protected static final String FROM_ROLE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getFromRole() From Role}' attribute. - * - * - * @see #getFromRole() - * @generated - * @ordered - */ - protected String fromRole = FROM_ROLE_EDEFAULT; - - /** - * The cached value of the '{@link #getToRoles() To Roles}' attribute list. - * - * - * @see #getToRoles() - * @generated - * @ordered - */ - protected EList toRoles; - - /** - * - * - * @generated - */ - protected GlobalMessageTransferImpl() - { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() - { - return ScribbleDslPackage.Literals.GLOBAL_MESSAGE_TRANSFER; - } - - /** - * - * - * @generated - */ - public Message getMessage() - { - return message; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetMessage(Message newMessage, NotificationChain msgs) - { - Message oldMessage = message; - message = newMessage; - if (eNotificationRequired()) - { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.GLOBAL_MESSAGE_TRANSFER__MESSAGE, oldMessage, newMessage); - if (msgs == null) msgs = notification; else msgs.add(notification); - } - return msgs; - } - - /** - * - * - * @generated - */ - public void setMessage(Message newMessage) - { - if (newMessage != message) - { - NotificationChain msgs = null; - if (message != null) - msgs = ((InternalEObject)message).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ScribbleDslPackage.GLOBAL_MESSAGE_TRANSFER__MESSAGE, null, msgs); - if (newMessage != null) - msgs = ((InternalEObject)newMessage).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ScribbleDslPackage.GLOBAL_MESSAGE_TRANSFER__MESSAGE, null, msgs); - msgs = basicSetMessage(newMessage, msgs); - if (msgs != null) msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.GLOBAL_MESSAGE_TRANSFER__MESSAGE, newMessage, newMessage)); - } - - /** - * - * - * @generated - */ - public String getFromRole() - { - return fromRole; - } - - /** - * - * - * @generated - */ - public void setFromRole(String newFromRole) - { - String oldFromRole = fromRole; - fromRole = newFromRole; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.GLOBAL_MESSAGE_TRANSFER__FROM_ROLE, oldFromRole, fromRole)); - } - - /** - * - * - * @generated - */ - public EList getToRoles() - { - if (toRoles == null) - { - toRoles = new EDataTypeEList(String.class, this, ScribbleDslPackage.GLOBAL_MESSAGE_TRANSFER__TO_ROLES); - } - return toRoles; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_MESSAGE_TRANSFER__MESSAGE: - return basicSetMessage(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_MESSAGE_TRANSFER__MESSAGE: - return getMessage(); - case ScribbleDslPackage.GLOBAL_MESSAGE_TRANSFER__FROM_ROLE: - return getFromRole(); - case ScribbleDslPackage.GLOBAL_MESSAGE_TRANSFER__TO_ROLES: - return getToRoles(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_MESSAGE_TRANSFER__MESSAGE: - setMessage((Message)newValue); - return; - case ScribbleDslPackage.GLOBAL_MESSAGE_TRANSFER__FROM_ROLE: - setFromRole((String)newValue); - return; - case ScribbleDslPackage.GLOBAL_MESSAGE_TRANSFER__TO_ROLES: - getToRoles().clear(); - getToRoles().addAll((Collection)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_MESSAGE_TRANSFER__MESSAGE: - setMessage((Message)null); - return; - case ScribbleDslPackage.GLOBAL_MESSAGE_TRANSFER__FROM_ROLE: - setFromRole(FROM_ROLE_EDEFAULT); - return; - case ScribbleDslPackage.GLOBAL_MESSAGE_TRANSFER__TO_ROLES: - getToRoles().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_MESSAGE_TRANSFER__MESSAGE: - return message != null; - case ScribbleDslPackage.GLOBAL_MESSAGE_TRANSFER__FROM_ROLE: - return FROM_ROLE_EDEFAULT == null ? fromRole != null : !FROM_ROLE_EDEFAULT.equals(fromRole); - case ScribbleDslPackage.GLOBAL_MESSAGE_TRANSFER__TO_ROLES: - return toRoles != null && !toRoles.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (fromRole: "); - result.append(fromRole); - result.append(", toRoles: "); - result.append(toRoles); - result.append(')'); - return result.toString(); - } - -} //GlobalMessageTransferImpl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/GlobalParallelImpl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/GlobalParallelImpl.java deleted file mode 100644 index d8e32e715..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/GlobalParallelImpl.java +++ /dev/null @@ -1,165 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl.impl; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -import org.scribble.editor.dsl.scribbleDsl.GlobalParallel; -import org.scribble.editor.dsl.scribbleDsl.GlobalProtocolBlock; -import org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage; - -/** - * - * An implementation of the model object 'Global Parallel'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalParallelImpl#getBlocks Blocks}
  • - *
- *

- * - * @generated - */ -public class GlobalParallelImpl extends GlobalInteractionImpl implements GlobalParallel -{ - /** - * The cached value of the '{@link #getBlocks() Blocks}' containment reference list. - * - * - * @see #getBlocks() - * @generated - * @ordered - */ - protected EList blocks; - - /** - * - * - * @generated - */ - protected GlobalParallelImpl() - { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() - { - return ScribbleDslPackage.Literals.GLOBAL_PARALLEL; - } - - /** - * - * - * @generated - */ - public EList getBlocks() - { - if (blocks == null) - { - blocks = new EObjectContainmentEList(GlobalProtocolBlock.class, this, ScribbleDslPackage.GLOBAL_PARALLEL__BLOCKS); - } - return blocks; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_PARALLEL__BLOCKS: - return ((InternalEList)getBlocks()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_PARALLEL__BLOCKS: - return getBlocks(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_PARALLEL__BLOCKS: - getBlocks().clear(); - getBlocks().addAll((Collection)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_PARALLEL__BLOCKS: - getBlocks().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_PARALLEL__BLOCKS: - return blocks != null && !blocks.isEmpty(); - } - return super.eIsSet(featureID); - } - -} //GlobalParallelImpl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/GlobalProtocolBlockImpl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/GlobalProtocolBlockImpl.java deleted file mode 100644 index 7a1166bce..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/GlobalProtocolBlockImpl.java +++ /dev/null @@ -1,167 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl.impl; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; - -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -import org.scribble.editor.dsl.scribbleDsl.GlobalInteraction; -import org.scribble.editor.dsl.scribbleDsl.GlobalProtocolBlock; -import org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage; - -/** - * - * An implementation of the model object 'Global Protocol Block'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalProtocolBlockImpl#getActivities Activities}
  • - *
- *

- * - * @generated - */ -public class GlobalProtocolBlockImpl extends MinimalEObjectImpl.Container implements GlobalProtocolBlock -{ - /** - * The cached value of the '{@link #getActivities() Activities}' containment reference list. - * - * - * @see #getActivities() - * @generated - * @ordered - */ - protected EList activities; - - /** - * - * - * @generated - */ - protected GlobalProtocolBlockImpl() - { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() - { - return ScribbleDslPackage.Literals.GLOBAL_PROTOCOL_BLOCK; - } - - /** - * - * - * @generated - */ - public EList getActivities() - { - if (activities == null) - { - activities = new EObjectContainmentEList(GlobalInteraction.class, this, ScribbleDslPackage.GLOBAL_PROTOCOL_BLOCK__ACTIVITIES); - } - return activities; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_PROTOCOL_BLOCK__ACTIVITIES: - return ((InternalEList)getActivities()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_PROTOCOL_BLOCK__ACTIVITIES: - return getActivities(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_PROTOCOL_BLOCK__ACTIVITIES: - getActivities().clear(); - getActivities().addAll((Collection)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_PROTOCOL_BLOCK__ACTIVITIES: - getActivities().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_PROTOCOL_BLOCK__ACTIVITIES: - return activities != null && !activities.isEmpty(); - } - return super.eIsSet(featureID); - } - -} //GlobalProtocolBlockImpl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/GlobalProtocolDeclImpl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/GlobalProtocolDeclImpl.java deleted file mode 100644 index 26acef7b8..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/GlobalProtocolDeclImpl.java +++ /dev/null @@ -1,485 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl.impl; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; - -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -import org.scribble.editor.dsl.scribbleDsl.Argument; -import org.scribble.editor.dsl.scribbleDsl.GlobalProtocolBlock; -import org.scribble.editor.dsl.scribbleDsl.GlobalProtocolDecl; -import org.scribble.editor.dsl.scribbleDsl.ParameterDecl; -import org.scribble.editor.dsl.scribbleDsl.RoleDecl; -import org.scribble.editor.dsl.scribbleDsl.RoleInstantiation; -import org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage; - -/** - * - * An implementation of the model object 'Global Protocol Decl'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalProtocolDeclImpl#getName Name}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalProtocolDeclImpl#getParameters Parameters}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalProtocolDeclImpl#getRoles Roles}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalProtocolDeclImpl#getBlock Block}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalProtocolDeclImpl#getInstantiates Instantiates}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalProtocolDeclImpl#getArguments Arguments}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalProtocolDeclImpl#getRoleInstantiations Role Instantiations}
  • - *
- *

- * - * @generated - */ -public class GlobalProtocolDeclImpl extends MinimalEObjectImpl.Container implements GlobalProtocolDecl -{ - /** - * The default value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * The cached value of the '{@link #getParameters() Parameters}' containment reference list. - * - * - * @see #getParameters() - * @generated - * @ordered - */ - protected EList parameters; - - /** - * The cached value of the '{@link #getRoles() Roles}' containment reference list. - * - * - * @see #getRoles() - * @generated - * @ordered - */ - protected EList roles; - - /** - * The cached value of the '{@link #getBlock() Block}' containment reference. - * - * - * @see #getBlock() - * @generated - * @ordered - */ - protected GlobalProtocolBlock block; - - /** - * The default value of the '{@link #getInstantiates() Instantiates}' attribute. - * - * - * @see #getInstantiates() - * @generated - * @ordered - */ - protected static final String INSTANTIATES_EDEFAULT = null; - - /** - * The cached value of the '{@link #getInstantiates() Instantiates}' attribute. - * - * - * @see #getInstantiates() - * @generated - * @ordered - */ - protected String instantiates = INSTANTIATES_EDEFAULT; - - /** - * The cached value of the '{@link #getArguments() Arguments}' containment reference list. - * - * - * @see #getArguments() - * @generated - * @ordered - */ - protected EList arguments; - - /** - * The cached value of the '{@link #getRoleInstantiations() Role Instantiations}' containment reference list. - * - * - * @see #getRoleInstantiations() - * @generated - * @ordered - */ - protected EList roleInstantiations; - - /** - * - * - * @generated - */ - protected GlobalProtocolDeclImpl() - { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() - { - return ScribbleDslPackage.Literals.GLOBAL_PROTOCOL_DECL; - } - - /** - * - * - * @generated - */ - public String getName() - { - return name; - } - - /** - * - * - * @generated - */ - public void setName(String newName) - { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__NAME, oldName, name)); - } - - /** - * - * - * @generated - */ - public EList getParameters() - { - if (parameters == null) - { - parameters = new EObjectContainmentEList(ParameterDecl.class, this, ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__PARAMETERS); - } - return parameters; - } - - /** - * - * - * @generated - */ - public EList getRoles() - { - if (roles == null) - { - roles = new EObjectContainmentEList(RoleDecl.class, this, ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__ROLES); - } - return roles; - } - - /** - * - * - * @generated - */ - public GlobalProtocolBlock getBlock() - { - return block; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetBlock(GlobalProtocolBlock newBlock, NotificationChain msgs) - { - GlobalProtocolBlock oldBlock = block; - block = newBlock; - if (eNotificationRequired()) - { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__BLOCK, oldBlock, newBlock); - if (msgs == null) msgs = notification; else msgs.add(notification); - } - return msgs; - } - - /** - * - * - * @generated - */ - public void setBlock(GlobalProtocolBlock newBlock) - { - if (newBlock != block) - { - NotificationChain msgs = null; - if (block != null) - msgs = ((InternalEObject)block).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__BLOCK, null, msgs); - if (newBlock != null) - msgs = ((InternalEObject)newBlock).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__BLOCK, null, msgs); - msgs = basicSetBlock(newBlock, msgs); - if (msgs != null) msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__BLOCK, newBlock, newBlock)); - } - - /** - * - * - * @generated - */ - public String getInstantiates() - { - return instantiates; - } - - /** - * - * - * @generated - */ - public void setInstantiates(String newInstantiates) - { - String oldInstantiates = instantiates; - instantiates = newInstantiates; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__INSTANTIATES, oldInstantiates, instantiates)); - } - - /** - * - * - * @generated - */ - public EList getArguments() - { - if (arguments == null) - { - arguments = new EObjectContainmentEList(Argument.class, this, ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__ARGUMENTS); - } - return arguments; - } - - /** - * - * - * @generated - */ - public EList getRoleInstantiations() - { - if (roleInstantiations == null) - { - roleInstantiations = new EObjectContainmentEList(RoleInstantiation.class, this, ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__ROLE_INSTANTIATIONS); - } - return roleInstantiations; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__PARAMETERS: - return ((InternalEList)getParameters()).basicRemove(otherEnd, msgs); - case ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__ROLES: - return ((InternalEList)getRoles()).basicRemove(otherEnd, msgs); - case ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__BLOCK: - return basicSetBlock(null, msgs); - case ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__ARGUMENTS: - return ((InternalEList)getArguments()).basicRemove(otherEnd, msgs); - case ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__ROLE_INSTANTIATIONS: - return ((InternalEList)getRoleInstantiations()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__NAME: - return getName(); - case ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__PARAMETERS: - return getParameters(); - case ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__ROLES: - return getRoles(); - case ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__BLOCK: - return getBlock(); - case ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__INSTANTIATES: - return getInstantiates(); - case ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__ARGUMENTS: - return getArguments(); - case ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__ROLE_INSTANTIATIONS: - return getRoleInstantiations(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__NAME: - setName((String)newValue); - return; - case ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__PARAMETERS: - getParameters().clear(); - getParameters().addAll((Collection)newValue); - return; - case ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__ROLES: - getRoles().clear(); - getRoles().addAll((Collection)newValue); - return; - case ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__BLOCK: - setBlock((GlobalProtocolBlock)newValue); - return; - case ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__INSTANTIATES: - setInstantiates((String)newValue); - return; - case ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__ARGUMENTS: - getArguments().clear(); - getArguments().addAll((Collection)newValue); - return; - case ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__ROLE_INSTANTIATIONS: - getRoleInstantiations().clear(); - getRoleInstantiations().addAll((Collection)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__NAME: - setName(NAME_EDEFAULT); - return; - case ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__PARAMETERS: - getParameters().clear(); - return; - case ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__ROLES: - getRoles().clear(); - return; - case ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__BLOCK: - setBlock((GlobalProtocolBlock)null); - return; - case ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__INSTANTIATES: - setInstantiates(INSTANTIATES_EDEFAULT); - return; - case ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__ARGUMENTS: - getArguments().clear(); - return; - case ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__ROLE_INSTANTIATIONS: - getRoleInstantiations().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__PARAMETERS: - return parameters != null && !parameters.isEmpty(); - case ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__ROLES: - return roles != null && !roles.isEmpty(); - case ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__BLOCK: - return block != null; - case ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__INSTANTIATES: - return INSTANTIATES_EDEFAULT == null ? instantiates != null : !INSTANTIATES_EDEFAULT.equals(instantiates); - case ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__ARGUMENTS: - return arguments != null && !arguments.isEmpty(); - case ScribbleDslPackage.GLOBAL_PROTOCOL_DECL__ROLE_INSTANTIATIONS: - return roleInstantiations != null && !roleInstantiations.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (name: "); - result.append(name); - result.append(", instantiates: "); - result.append(instantiates); - result.append(')'); - return result.toString(); - } - -} //GlobalProtocolDeclImpl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/GlobalRecursionImpl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/GlobalRecursionImpl.java deleted file mode 100644 index 151c85c3e..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/GlobalRecursionImpl.java +++ /dev/null @@ -1,264 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -import org.scribble.editor.dsl.scribbleDsl.GlobalProtocolBlock; -import org.scribble.editor.dsl.scribbleDsl.GlobalRecursion; -import org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage; - -/** - * - * An implementation of the model object 'Global Recursion'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalRecursionImpl#getLabel Label}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.GlobalRecursionImpl#getBlock Block}
  • - *
- *

- * - * @generated - */ -public class GlobalRecursionImpl extends GlobalInteractionImpl implements GlobalRecursion -{ - /** - * The default value of the '{@link #getLabel() Label}' attribute. - * - * - * @see #getLabel() - * @generated - * @ordered - */ - protected static final String LABEL_EDEFAULT = null; - - /** - * The cached value of the '{@link #getLabel() Label}' attribute. - * - * - * @see #getLabel() - * @generated - * @ordered - */ - protected String label = LABEL_EDEFAULT; - - /** - * The cached value of the '{@link #getBlock() Block}' containment reference. - * - * - * @see #getBlock() - * @generated - * @ordered - */ - protected GlobalProtocolBlock block; - - /** - * - * - * @generated - */ - protected GlobalRecursionImpl() - { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() - { - return ScribbleDslPackage.Literals.GLOBAL_RECURSION; - } - - /** - * - * - * @generated - */ - public String getLabel() - { - return label; - } - - /** - * - * - * @generated - */ - public void setLabel(String newLabel) - { - String oldLabel = label; - label = newLabel; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.GLOBAL_RECURSION__LABEL, oldLabel, label)); - } - - /** - * - * - * @generated - */ - public GlobalProtocolBlock getBlock() - { - return block; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetBlock(GlobalProtocolBlock newBlock, NotificationChain msgs) - { - GlobalProtocolBlock oldBlock = block; - block = newBlock; - if (eNotificationRequired()) - { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.GLOBAL_RECURSION__BLOCK, oldBlock, newBlock); - if (msgs == null) msgs = notification; else msgs.add(notification); - } - return msgs; - } - - /** - * - * - * @generated - */ - public void setBlock(GlobalProtocolBlock newBlock) - { - if (newBlock != block) - { - NotificationChain msgs = null; - if (block != null) - msgs = ((InternalEObject)block).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ScribbleDslPackage.GLOBAL_RECURSION__BLOCK, null, msgs); - if (newBlock != null) - msgs = ((InternalEObject)newBlock).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ScribbleDslPackage.GLOBAL_RECURSION__BLOCK, null, msgs); - msgs = basicSetBlock(newBlock, msgs); - if (msgs != null) msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.GLOBAL_RECURSION__BLOCK, newBlock, newBlock)); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_RECURSION__BLOCK: - return basicSetBlock(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_RECURSION__LABEL: - return getLabel(); - case ScribbleDslPackage.GLOBAL_RECURSION__BLOCK: - return getBlock(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_RECURSION__LABEL: - setLabel((String)newValue); - return; - case ScribbleDslPackage.GLOBAL_RECURSION__BLOCK: - setBlock((GlobalProtocolBlock)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_RECURSION__LABEL: - setLabel(LABEL_EDEFAULT); - return; - case ScribbleDslPackage.GLOBAL_RECURSION__BLOCK: - setBlock((GlobalProtocolBlock)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.GLOBAL_RECURSION__LABEL: - return LABEL_EDEFAULT == null ? label != null : !LABEL_EDEFAULT.equals(label); - case ScribbleDslPackage.GLOBAL_RECURSION__BLOCK: - return block != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (label: "); - result.append(label); - result.append(')'); - return result.toString(); - } - -} //GlobalRecursionImpl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/ImportDeclImpl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/ImportDeclImpl.java deleted file mode 100644 index 15eaba742..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/ImportDeclImpl.java +++ /dev/null @@ -1,233 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl.impl; - -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.ecore.EClass; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; - -import org.scribble.editor.dsl.scribbleDsl.ImportDecl; -import org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage; - -/** - * - * An implementation of the model object 'Import Decl'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.ImportDeclImpl#getName Name}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.ImportDeclImpl#getAlias Alias}
  • - *
- *

- * - * @generated - */ -public class ImportDeclImpl extends MinimalEObjectImpl.Container implements ImportDecl -{ - /** - * The default value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * The default value of the '{@link #getAlias() Alias}' attribute. - * - * - * @see #getAlias() - * @generated - * @ordered - */ - protected static final String ALIAS_EDEFAULT = null; - - /** - * The cached value of the '{@link #getAlias() Alias}' attribute. - * - * - * @see #getAlias() - * @generated - * @ordered - */ - protected String alias = ALIAS_EDEFAULT; - - /** - * - * - * @generated - */ - protected ImportDeclImpl() - { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() - { - return ScribbleDslPackage.Literals.IMPORT_DECL; - } - - /** - * - * - * @generated - */ - public String getName() - { - return name; - } - - /** - * - * - * @generated - */ - public void setName(String newName) - { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.IMPORT_DECL__NAME, oldName, name)); - } - - /** - * - * - * @generated - */ - public String getAlias() - { - return alias; - } - - /** - * - * - * @generated - */ - public void setAlias(String newAlias) - { - String oldAlias = alias; - alias = newAlias; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.IMPORT_DECL__ALIAS, oldAlias, alias)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ScribbleDslPackage.IMPORT_DECL__NAME: - return getName(); - case ScribbleDslPackage.IMPORT_DECL__ALIAS: - return getAlias(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ScribbleDslPackage.IMPORT_DECL__NAME: - setName((String)newValue); - return; - case ScribbleDslPackage.IMPORT_DECL__ALIAS: - setAlias((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.IMPORT_DECL__NAME: - setName(NAME_EDEFAULT); - return; - case ScribbleDslPackage.IMPORT_DECL__ALIAS: - setAlias(ALIAS_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.IMPORT_DECL__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case ScribbleDslPackage.IMPORT_DECL__ALIAS: - return ALIAS_EDEFAULT == null ? alias != null : !ALIAS_EDEFAULT.equals(alias); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (name: "); - result.append(name); - result.append(", alias: "); - result.append(alias); - result.append(')'); - return result.toString(); - } - -} //ImportDeclImpl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/ImportMemberImpl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/ImportMemberImpl.java deleted file mode 100644 index adade2239..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/ImportMemberImpl.java +++ /dev/null @@ -1,176 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl.impl; - -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.ecore.EClass; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -import org.scribble.editor.dsl.scribbleDsl.ImportMember; -import org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage; - -/** - * - * An implementation of the model object 'Import Member'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.ImportMemberImpl#getMember Member}
  • - *
- *

- * - * @generated - */ -public class ImportMemberImpl extends ImportDeclImpl implements ImportMember -{ - /** - * The default value of the '{@link #getMember() Member}' attribute. - * - * - * @see #getMember() - * @generated - * @ordered - */ - protected static final String MEMBER_EDEFAULT = null; - - /** - * The cached value of the '{@link #getMember() Member}' attribute. - * - * - * @see #getMember() - * @generated - * @ordered - */ - protected String member = MEMBER_EDEFAULT; - - /** - * - * - * @generated - */ - protected ImportMemberImpl() - { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() - { - return ScribbleDslPackage.Literals.IMPORT_MEMBER; - } - - /** - * - * - * @generated - */ - public String getMember() - { - return member; - } - - /** - * - * - * @generated - */ - public void setMember(String newMember) - { - String oldMember = member; - member = newMember; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.IMPORT_MEMBER__MEMBER, oldMember, member)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ScribbleDslPackage.IMPORT_MEMBER__MEMBER: - return getMember(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ScribbleDslPackage.IMPORT_MEMBER__MEMBER: - setMember((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.IMPORT_MEMBER__MEMBER: - setMember(MEMBER_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.IMPORT_MEMBER__MEMBER: - return MEMBER_EDEFAULT == null ? member != null : !MEMBER_EDEFAULT.equals(member); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (member: "); - result.append(member); - result.append(')'); - return result.toString(); - } - -} //ImportMemberImpl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/ImportModuleImpl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/ImportModuleImpl.java deleted file mode 100644 index f68409c00..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/ImportModuleImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl.impl; - -import org.eclipse.emf.ecore.EClass; - -import org.scribble.editor.dsl.scribbleDsl.ImportModule; -import org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage; - -/** - * - * An implementation of the model object 'Import Module'. - * - *

- *

- * - * @generated - */ -public class ImportModuleImpl extends ImportDeclImpl implements ImportModule -{ - /** - * - * - * @generated - */ - protected ImportModuleImpl() - { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() - { - return ScribbleDslPackage.Literals.IMPORT_MODULE; - } - -} //ImportModuleImpl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/LlobalInteractionImpl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/LlobalInteractionImpl.java deleted file mode 100644 index f1447e008..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/LlobalInteractionImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl.impl; - -import org.eclipse.emf.ecore.EClass; - -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; - -import org.scribble.editor.dsl.scribbleDsl.LlobalInteraction; -import org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage; - -/** - * - * An implementation of the model object 'Llobal Interaction'. - * - *

- *

- * - * @generated - */ -public class LlobalInteractionImpl extends MinimalEObjectImpl.Container implements LlobalInteraction -{ - /** - * - * - * @generated - */ - protected LlobalInteractionImpl() - { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() - { - return ScribbleDslPackage.Literals.LLOBAL_INTERACTION; - } - -} //LlobalInteractionImpl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/LocalCatchImpl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/LocalCatchImpl.java deleted file mode 100644 index 2dbdd6a87..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/LocalCatchImpl.java +++ /dev/null @@ -1,240 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl.impl; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; - -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -import org.scribble.editor.dsl.scribbleDsl.LocalCatch; -import org.scribble.editor.dsl.scribbleDsl.Message; -import org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage; - -/** - * - * An implementation of the model object 'Local Catch'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.LocalCatchImpl#getMessages Messages}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.LocalCatchImpl#getFromRole From Role}
  • - *
- *

- * - * @generated - */ -public class LocalCatchImpl extends MinimalEObjectImpl.Container implements LocalCatch -{ - /** - * The cached value of the '{@link #getMessages() Messages}' containment reference list. - * - * - * @see #getMessages() - * @generated - * @ordered - */ - protected EList messages; - - /** - * The default value of the '{@link #getFromRole() From Role}' attribute. - * - * - * @see #getFromRole() - * @generated - * @ordered - */ - protected static final String FROM_ROLE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getFromRole() From Role}' attribute. - * - * - * @see #getFromRole() - * @generated - * @ordered - */ - protected String fromRole = FROM_ROLE_EDEFAULT; - - /** - * - * - * @generated - */ - protected LocalCatchImpl() - { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() - { - return ScribbleDslPackage.Literals.LOCAL_CATCH; - } - - /** - * - * - * @generated - */ - public EList getMessages() - { - if (messages == null) - { - messages = new EObjectContainmentEList(Message.class, this, ScribbleDslPackage.LOCAL_CATCH__MESSAGES); - } - return messages; - } - - /** - * - * - * @generated - */ - public String getFromRole() - { - return fromRole; - } - - /** - * - * - * @generated - */ - public void setFromRole(String newFromRole) - { - String oldFromRole = fromRole; - fromRole = newFromRole; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.LOCAL_CATCH__FROM_ROLE, oldFromRole, fromRole)); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_CATCH__MESSAGES: - return ((InternalEList)getMessages()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_CATCH__MESSAGES: - return getMessages(); - case ScribbleDslPackage.LOCAL_CATCH__FROM_ROLE: - return getFromRole(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_CATCH__MESSAGES: - getMessages().clear(); - getMessages().addAll((Collection)newValue); - return; - case ScribbleDslPackage.LOCAL_CATCH__FROM_ROLE: - setFromRole((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_CATCH__MESSAGES: - getMessages().clear(); - return; - case ScribbleDslPackage.LOCAL_CATCH__FROM_ROLE: - setFromRole(FROM_ROLE_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_CATCH__MESSAGES: - return messages != null && !messages.isEmpty(); - case ScribbleDslPackage.LOCAL_CATCH__FROM_ROLE: - return FROM_ROLE_EDEFAULT == null ? fromRole != null : !FROM_ROLE_EDEFAULT.equals(fromRole); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (fromRole: "); - result.append(fromRole); - result.append(')'); - return result.toString(); - } - -} //LocalCatchImpl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/LocalChoiceImpl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/LocalChoiceImpl.java deleted file mode 100644 index a81cb7ba8..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/LocalChoiceImpl.java +++ /dev/null @@ -1,239 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl.impl; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -import org.scribble.editor.dsl.scribbleDsl.LocalChoice; -import org.scribble.editor.dsl.scribbleDsl.LocalProtocolBlock; -import org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage; - -/** - * - * An implementation of the model object 'Local Choice'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.LocalChoiceImpl#getRole Role}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.LocalChoiceImpl#getBlocks Blocks}
  • - *
- *

- * - * @generated - */ -public class LocalChoiceImpl extends LlobalInteractionImpl implements LocalChoice -{ - /** - * The default value of the '{@link #getRole() Role}' attribute. - * - * - * @see #getRole() - * @generated - * @ordered - */ - protected static final String ROLE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getRole() Role}' attribute. - * - * - * @see #getRole() - * @generated - * @ordered - */ - protected String role = ROLE_EDEFAULT; - - /** - * The cached value of the '{@link #getBlocks() Blocks}' containment reference list. - * - * - * @see #getBlocks() - * @generated - * @ordered - */ - protected EList blocks; - - /** - * - * - * @generated - */ - protected LocalChoiceImpl() - { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() - { - return ScribbleDslPackage.Literals.LOCAL_CHOICE; - } - - /** - * - * - * @generated - */ - public String getRole() - { - return role; - } - - /** - * - * - * @generated - */ - public void setRole(String newRole) - { - String oldRole = role; - role = newRole; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.LOCAL_CHOICE__ROLE, oldRole, role)); - } - - /** - * - * - * @generated - */ - public EList getBlocks() - { - if (blocks == null) - { - blocks = new EObjectContainmentEList(LocalProtocolBlock.class, this, ScribbleDslPackage.LOCAL_CHOICE__BLOCKS); - } - return blocks; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_CHOICE__BLOCKS: - return ((InternalEList)getBlocks()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_CHOICE__ROLE: - return getRole(); - case ScribbleDslPackage.LOCAL_CHOICE__BLOCKS: - return getBlocks(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_CHOICE__ROLE: - setRole((String)newValue); - return; - case ScribbleDslPackage.LOCAL_CHOICE__BLOCKS: - getBlocks().clear(); - getBlocks().addAll((Collection)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_CHOICE__ROLE: - setRole(ROLE_EDEFAULT); - return; - case ScribbleDslPackage.LOCAL_CHOICE__BLOCKS: - getBlocks().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_CHOICE__ROLE: - return ROLE_EDEFAULT == null ? role != null : !ROLE_EDEFAULT.equals(role); - case ScribbleDslPackage.LOCAL_CHOICE__BLOCKS: - return blocks != null && !blocks.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (role: "); - result.append(role); - result.append(')'); - return result.toString(); - } - -} //LocalChoiceImpl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/LocalContinueImpl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/LocalContinueImpl.java deleted file mode 100644 index 55740cd09..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/LocalContinueImpl.java +++ /dev/null @@ -1,176 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl.impl; - -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.ecore.EClass; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -import org.scribble.editor.dsl.scribbleDsl.LocalContinue; -import org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage; - -/** - * - * An implementation of the model object 'Local Continue'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.LocalContinueImpl#getLabel Label}
  • - *
- *

- * - * @generated - */ -public class LocalContinueImpl extends LlobalInteractionImpl implements LocalContinue -{ - /** - * The default value of the '{@link #getLabel() Label}' attribute. - * - * - * @see #getLabel() - * @generated - * @ordered - */ - protected static final String LABEL_EDEFAULT = null; - - /** - * The cached value of the '{@link #getLabel() Label}' attribute. - * - * - * @see #getLabel() - * @generated - * @ordered - */ - protected String label = LABEL_EDEFAULT; - - /** - * - * - * @generated - */ - protected LocalContinueImpl() - { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() - { - return ScribbleDslPackage.Literals.LOCAL_CONTINUE; - } - - /** - * - * - * @generated - */ - public String getLabel() - { - return label; - } - - /** - * - * - * @generated - */ - public void setLabel(String newLabel) - { - String oldLabel = label; - label = newLabel; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.LOCAL_CONTINUE__LABEL, oldLabel, label)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_CONTINUE__LABEL: - return getLabel(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_CONTINUE__LABEL: - setLabel((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_CONTINUE__LABEL: - setLabel(LABEL_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_CONTINUE__LABEL: - return LABEL_EDEFAULT == null ? label != null : !LABEL_EDEFAULT.equals(label); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (label: "); - result.append(label); - result.append(')'); - return result.toString(); - } - -} //LocalContinueImpl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/LocalDoImpl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/LocalDoImpl.java deleted file mode 100644 index 63297441c..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/LocalDoImpl.java +++ /dev/null @@ -1,334 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl.impl; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -import org.scribble.editor.dsl.scribbleDsl.Argument; -import org.scribble.editor.dsl.scribbleDsl.LocalDo; -import org.scribble.editor.dsl.scribbleDsl.RoleInstantiation; -import org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage; - -/** - * - * An implementation of the model object 'Local Do'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.LocalDoImpl#getScope Scope}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.LocalDoImpl#getMember Member}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.LocalDoImpl#getArguments Arguments}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.LocalDoImpl#getRoles Roles}
  • - *
- *

- * - * @generated - */ -public class LocalDoImpl extends LlobalInteractionImpl implements LocalDo -{ - /** - * The default value of the '{@link #getScope() Scope}' attribute. - * - * - * @see #getScope() - * @generated - * @ordered - */ - protected static final String SCOPE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getScope() Scope}' attribute. - * - * - * @see #getScope() - * @generated - * @ordered - */ - protected String scope = SCOPE_EDEFAULT; - - /** - * The default value of the '{@link #getMember() Member}' attribute. - * - * - * @see #getMember() - * @generated - * @ordered - */ - protected static final String MEMBER_EDEFAULT = null; - - /** - * The cached value of the '{@link #getMember() Member}' attribute. - * - * - * @see #getMember() - * @generated - * @ordered - */ - protected String member = MEMBER_EDEFAULT; - - /** - * The cached value of the '{@link #getArguments() Arguments}' containment reference list. - * - * - * @see #getArguments() - * @generated - * @ordered - */ - protected EList arguments; - - /** - * The cached value of the '{@link #getRoles() Roles}' containment reference list. - * - * - * @see #getRoles() - * @generated - * @ordered - */ - protected EList roles; - - /** - * - * - * @generated - */ - protected LocalDoImpl() - { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() - { - return ScribbleDslPackage.Literals.LOCAL_DO; - } - - /** - * - * - * @generated - */ - public String getScope() - { - return scope; - } - - /** - * - * - * @generated - */ - public void setScope(String newScope) - { - String oldScope = scope; - scope = newScope; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.LOCAL_DO__SCOPE, oldScope, scope)); - } - - /** - * - * - * @generated - */ - public String getMember() - { - return member; - } - - /** - * - * - * @generated - */ - public void setMember(String newMember) - { - String oldMember = member; - member = newMember; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.LOCAL_DO__MEMBER, oldMember, member)); - } - - /** - * - * - * @generated - */ - public EList getArguments() - { - if (arguments == null) - { - arguments = new EObjectContainmentEList(Argument.class, this, ScribbleDslPackage.LOCAL_DO__ARGUMENTS); - } - return arguments; - } - - /** - * - * - * @generated - */ - public EList getRoles() - { - if (roles == null) - { - roles = new EObjectContainmentEList(RoleInstantiation.class, this, ScribbleDslPackage.LOCAL_DO__ROLES); - } - return roles; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_DO__ARGUMENTS: - return ((InternalEList)getArguments()).basicRemove(otherEnd, msgs); - case ScribbleDslPackage.LOCAL_DO__ROLES: - return ((InternalEList)getRoles()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_DO__SCOPE: - return getScope(); - case ScribbleDslPackage.LOCAL_DO__MEMBER: - return getMember(); - case ScribbleDslPackage.LOCAL_DO__ARGUMENTS: - return getArguments(); - case ScribbleDslPackage.LOCAL_DO__ROLES: - return getRoles(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_DO__SCOPE: - setScope((String)newValue); - return; - case ScribbleDslPackage.LOCAL_DO__MEMBER: - setMember((String)newValue); - return; - case ScribbleDslPackage.LOCAL_DO__ARGUMENTS: - getArguments().clear(); - getArguments().addAll((Collection)newValue); - return; - case ScribbleDslPackage.LOCAL_DO__ROLES: - getRoles().clear(); - getRoles().addAll((Collection)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_DO__SCOPE: - setScope(SCOPE_EDEFAULT); - return; - case ScribbleDslPackage.LOCAL_DO__MEMBER: - setMember(MEMBER_EDEFAULT); - return; - case ScribbleDslPackage.LOCAL_DO__ARGUMENTS: - getArguments().clear(); - return; - case ScribbleDslPackage.LOCAL_DO__ROLES: - getRoles().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_DO__SCOPE: - return SCOPE_EDEFAULT == null ? scope != null : !SCOPE_EDEFAULT.equals(scope); - case ScribbleDslPackage.LOCAL_DO__MEMBER: - return MEMBER_EDEFAULT == null ? member != null : !MEMBER_EDEFAULT.equals(member); - case ScribbleDslPackage.LOCAL_DO__ARGUMENTS: - return arguments != null && !arguments.isEmpty(); - case ScribbleDslPackage.LOCAL_DO__ROLES: - return roles != null && !roles.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (scope: "); - result.append(scope); - result.append(", member: "); - result.append(member); - result.append(')'); - return result.toString(); - } - -} //LocalDoImpl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/LocalInterruptibleImpl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/LocalInterruptibleImpl.java deleted file mode 100644 index 4bd8d3956..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/LocalInterruptibleImpl.java +++ /dev/null @@ -1,383 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl.impl; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -import org.scribble.editor.dsl.scribbleDsl.LocalCatch; -import org.scribble.editor.dsl.scribbleDsl.LocalInterruptible; -import org.scribble.editor.dsl.scribbleDsl.LocalProtocolBlock; -import org.scribble.editor.dsl.scribbleDsl.LocalThrow; -import org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage; - -/** - * - * An implementation of the model object 'Local Interruptible'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.LocalInterruptibleImpl#getScope Scope}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.LocalInterruptibleImpl#getBlock Block}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.LocalInterruptibleImpl#getThrow Throw}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.LocalInterruptibleImpl#getCatches Catches}
  • - *
- *

- * - * @generated - */ -public class LocalInterruptibleImpl extends LlobalInteractionImpl implements LocalInterruptible -{ - /** - * The default value of the '{@link #getScope() Scope}' attribute. - * - * - * @see #getScope() - * @generated - * @ordered - */ - protected static final String SCOPE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getScope() Scope}' attribute. - * - * - * @see #getScope() - * @generated - * @ordered - */ - protected String scope = SCOPE_EDEFAULT; - - /** - * The cached value of the '{@link #getBlock() Block}' containment reference. - * - * - * @see #getBlock() - * @generated - * @ordered - */ - protected LocalProtocolBlock block; - - /** - * The cached value of the '{@link #getThrow() Throw}' containment reference. - * - * - * @see #getThrow() - * @generated - * @ordered - */ - protected LocalThrow throw_; - - /** - * The cached value of the '{@link #getCatches() Catches}' containment reference list. - * - * - * @see #getCatches() - * @generated - * @ordered - */ - protected EList catches; - - /** - * - * - * @generated - */ - protected LocalInterruptibleImpl() - { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() - { - return ScribbleDslPackage.Literals.LOCAL_INTERRUPTIBLE; - } - - /** - * - * - * @generated - */ - public String getScope() - { - return scope; - } - - /** - * - * - * @generated - */ - public void setScope(String newScope) - { - String oldScope = scope; - scope = newScope; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.LOCAL_INTERRUPTIBLE__SCOPE, oldScope, scope)); - } - - /** - * - * - * @generated - */ - public LocalProtocolBlock getBlock() - { - return block; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetBlock(LocalProtocolBlock newBlock, NotificationChain msgs) - { - LocalProtocolBlock oldBlock = block; - block = newBlock; - if (eNotificationRequired()) - { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.LOCAL_INTERRUPTIBLE__BLOCK, oldBlock, newBlock); - if (msgs == null) msgs = notification; else msgs.add(notification); - } - return msgs; - } - - /** - * - * - * @generated - */ - public void setBlock(LocalProtocolBlock newBlock) - { - if (newBlock != block) - { - NotificationChain msgs = null; - if (block != null) - msgs = ((InternalEObject)block).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ScribbleDslPackage.LOCAL_INTERRUPTIBLE__BLOCK, null, msgs); - if (newBlock != null) - msgs = ((InternalEObject)newBlock).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ScribbleDslPackage.LOCAL_INTERRUPTIBLE__BLOCK, null, msgs); - msgs = basicSetBlock(newBlock, msgs); - if (msgs != null) msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.LOCAL_INTERRUPTIBLE__BLOCK, newBlock, newBlock)); - } - - /** - * - * - * @generated - */ - public LocalThrow getThrow() - { - return throw_; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetThrow(LocalThrow newThrow, NotificationChain msgs) - { - LocalThrow oldThrow = throw_; - throw_ = newThrow; - if (eNotificationRequired()) - { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.LOCAL_INTERRUPTIBLE__THROW, oldThrow, newThrow); - if (msgs == null) msgs = notification; else msgs.add(notification); - } - return msgs; - } - - /** - * - * - * @generated - */ - public void setThrow(LocalThrow newThrow) - { - if (newThrow != throw_) - { - NotificationChain msgs = null; - if (throw_ != null) - msgs = ((InternalEObject)throw_).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ScribbleDslPackage.LOCAL_INTERRUPTIBLE__THROW, null, msgs); - if (newThrow != null) - msgs = ((InternalEObject)newThrow).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ScribbleDslPackage.LOCAL_INTERRUPTIBLE__THROW, null, msgs); - msgs = basicSetThrow(newThrow, msgs); - if (msgs != null) msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.LOCAL_INTERRUPTIBLE__THROW, newThrow, newThrow)); - } - - /** - * - * - * @generated - */ - public EList getCatches() - { - if (catches == null) - { - catches = new EObjectContainmentEList(LocalCatch.class, this, ScribbleDslPackage.LOCAL_INTERRUPTIBLE__CATCHES); - } - return catches; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_INTERRUPTIBLE__BLOCK: - return basicSetBlock(null, msgs); - case ScribbleDslPackage.LOCAL_INTERRUPTIBLE__THROW: - return basicSetThrow(null, msgs); - case ScribbleDslPackage.LOCAL_INTERRUPTIBLE__CATCHES: - return ((InternalEList)getCatches()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_INTERRUPTIBLE__SCOPE: - return getScope(); - case ScribbleDslPackage.LOCAL_INTERRUPTIBLE__BLOCK: - return getBlock(); - case ScribbleDslPackage.LOCAL_INTERRUPTIBLE__THROW: - return getThrow(); - case ScribbleDslPackage.LOCAL_INTERRUPTIBLE__CATCHES: - return getCatches(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_INTERRUPTIBLE__SCOPE: - setScope((String)newValue); - return; - case ScribbleDslPackage.LOCAL_INTERRUPTIBLE__BLOCK: - setBlock((LocalProtocolBlock)newValue); - return; - case ScribbleDslPackage.LOCAL_INTERRUPTIBLE__THROW: - setThrow((LocalThrow)newValue); - return; - case ScribbleDslPackage.LOCAL_INTERRUPTIBLE__CATCHES: - getCatches().clear(); - getCatches().addAll((Collection)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_INTERRUPTIBLE__SCOPE: - setScope(SCOPE_EDEFAULT); - return; - case ScribbleDslPackage.LOCAL_INTERRUPTIBLE__BLOCK: - setBlock((LocalProtocolBlock)null); - return; - case ScribbleDslPackage.LOCAL_INTERRUPTIBLE__THROW: - setThrow((LocalThrow)null); - return; - case ScribbleDslPackage.LOCAL_INTERRUPTIBLE__CATCHES: - getCatches().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_INTERRUPTIBLE__SCOPE: - return SCOPE_EDEFAULT == null ? scope != null : !SCOPE_EDEFAULT.equals(scope); - case ScribbleDslPackage.LOCAL_INTERRUPTIBLE__BLOCK: - return block != null; - case ScribbleDslPackage.LOCAL_INTERRUPTIBLE__THROW: - return throw_ != null; - case ScribbleDslPackage.LOCAL_INTERRUPTIBLE__CATCHES: - return catches != null && !catches.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (scope: "); - result.append(scope); - result.append(')'); - return result.toString(); - } - -} //LocalInterruptibleImpl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/LocalParallelImpl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/LocalParallelImpl.java deleted file mode 100644 index 013b1e2c9..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/LocalParallelImpl.java +++ /dev/null @@ -1,165 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl.impl; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -import org.scribble.editor.dsl.scribbleDsl.LocalParallel; -import org.scribble.editor.dsl.scribbleDsl.LocalProtocolBlock; -import org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage; - -/** - * - * An implementation of the model object 'Local Parallel'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.LocalParallelImpl#getBlocks Blocks}
  • - *
- *

- * - * @generated - */ -public class LocalParallelImpl extends LlobalInteractionImpl implements LocalParallel -{ - /** - * The cached value of the '{@link #getBlocks() Blocks}' containment reference list. - * - * - * @see #getBlocks() - * @generated - * @ordered - */ - protected EList blocks; - - /** - * - * - * @generated - */ - protected LocalParallelImpl() - { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() - { - return ScribbleDslPackage.Literals.LOCAL_PARALLEL; - } - - /** - * - * - * @generated - */ - public EList getBlocks() - { - if (blocks == null) - { - blocks = new EObjectContainmentEList(LocalProtocolBlock.class, this, ScribbleDslPackage.LOCAL_PARALLEL__BLOCKS); - } - return blocks; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_PARALLEL__BLOCKS: - return ((InternalEList)getBlocks()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_PARALLEL__BLOCKS: - return getBlocks(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_PARALLEL__BLOCKS: - getBlocks().clear(); - getBlocks().addAll((Collection)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_PARALLEL__BLOCKS: - getBlocks().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_PARALLEL__BLOCKS: - return blocks != null && !blocks.isEmpty(); - } - return super.eIsSet(featureID); - } - -} //LocalParallelImpl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/LocalProtocolBlockImpl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/LocalProtocolBlockImpl.java deleted file mode 100644 index 86773e7d8..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/LocalProtocolBlockImpl.java +++ /dev/null @@ -1,167 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl.impl; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; - -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -import org.scribble.editor.dsl.scribbleDsl.LlobalInteraction; -import org.scribble.editor.dsl.scribbleDsl.LocalProtocolBlock; -import org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage; - -/** - * - * An implementation of the model object 'Local Protocol Block'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.LocalProtocolBlockImpl#getActivities Activities}
  • - *
- *

- * - * @generated - */ -public class LocalProtocolBlockImpl extends MinimalEObjectImpl.Container implements LocalProtocolBlock -{ - /** - * The cached value of the '{@link #getActivities() Activities}' containment reference list. - * - * - * @see #getActivities() - * @generated - * @ordered - */ - protected EList activities; - - /** - * - * - * @generated - */ - protected LocalProtocolBlockImpl() - { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() - { - return ScribbleDslPackage.Literals.LOCAL_PROTOCOL_BLOCK; - } - - /** - * - * - * @generated - */ - public EList getActivities() - { - if (activities == null) - { - activities = new EObjectContainmentEList(LlobalInteraction.class, this, ScribbleDslPackage.LOCAL_PROTOCOL_BLOCK__ACTIVITIES); - } - return activities; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_PROTOCOL_BLOCK__ACTIVITIES: - return ((InternalEList)getActivities()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_PROTOCOL_BLOCK__ACTIVITIES: - return getActivities(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_PROTOCOL_BLOCK__ACTIVITIES: - getActivities().clear(); - getActivities().addAll((Collection)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_PROTOCOL_BLOCK__ACTIVITIES: - getActivities().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_PROTOCOL_BLOCK__ACTIVITIES: - return activities != null && !activities.isEmpty(); - } - return super.eIsSet(featureID); - } - -} //LocalProtocolBlockImpl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/LocalProtocolDeclImpl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/LocalProtocolDeclImpl.java deleted file mode 100644 index 454e0743d..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/LocalProtocolDeclImpl.java +++ /dev/null @@ -1,541 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl.impl; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; - -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -import org.scribble.editor.dsl.scribbleDsl.Argument; -import org.scribble.editor.dsl.scribbleDsl.LocalProtocolBlock; -import org.scribble.editor.dsl.scribbleDsl.LocalProtocolDecl; -import org.scribble.editor.dsl.scribbleDsl.ParameterDecl; -import org.scribble.editor.dsl.scribbleDsl.RoleDecl; -import org.scribble.editor.dsl.scribbleDsl.RoleInstantiation; -import org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage; - -/** - * - * An implementation of the model object 'Local Protocol Decl'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.LocalProtocolDeclImpl#getName Name}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.LocalProtocolDeclImpl#getRole Role}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.LocalProtocolDeclImpl#getParameters Parameters}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.LocalProtocolDeclImpl#getRoles Roles}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.LocalProtocolDeclImpl#getBlock Block}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.LocalProtocolDeclImpl#getInstantiates Instantiates}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.LocalProtocolDeclImpl#getArguments Arguments}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.LocalProtocolDeclImpl#getRoleInstantiations Role Instantiations}
  • - *
- *

- * - * @generated - */ -public class LocalProtocolDeclImpl extends MinimalEObjectImpl.Container implements LocalProtocolDecl -{ - /** - * The default value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * The default value of the '{@link #getRole() Role}' attribute. - * - * - * @see #getRole() - * @generated - * @ordered - */ - protected static final String ROLE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getRole() Role}' attribute. - * - * - * @see #getRole() - * @generated - * @ordered - */ - protected String role = ROLE_EDEFAULT; - - /** - * The cached value of the '{@link #getParameters() Parameters}' containment reference list. - * - * - * @see #getParameters() - * @generated - * @ordered - */ - protected EList parameters; - - /** - * The cached value of the '{@link #getRoles() Roles}' containment reference list. - * - * - * @see #getRoles() - * @generated - * @ordered - */ - protected EList roles; - - /** - * The cached value of the '{@link #getBlock() Block}' containment reference. - * - * - * @see #getBlock() - * @generated - * @ordered - */ - protected LocalProtocolBlock block; - - /** - * The default value of the '{@link #getInstantiates() Instantiates}' attribute. - * - * - * @see #getInstantiates() - * @generated - * @ordered - */ - protected static final String INSTANTIATES_EDEFAULT = null; - - /** - * The cached value of the '{@link #getInstantiates() Instantiates}' attribute. - * - * - * @see #getInstantiates() - * @generated - * @ordered - */ - protected String instantiates = INSTANTIATES_EDEFAULT; - - /** - * The cached value of the '{@link #getArguments() Arguments}' containment reference list. - * - * - * @see #getArguments() - * @generated - * @ordered - */ - protected EList arguments; - - /** - * The cached value of the '{@link #getRoleInstantiations() Role Instantiations}' containment reference list. - * - * - * @see #getRoleInstantiations() - * @generated - * @ordered - */ - protected EList roleInstantiations; - - /** - * - * - * @generated - */ - protected LocalProtocolDeclImpl() - { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() - { - return ScribbleDslPackage.Literals.LOCAL_PROTOCOL_DECL; - } - - /** - * - * - * @generated - */ - public String getName() - { - return name; - } - - /** - * - * - * @generated - */ - public void setName(String newName) - { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.LOCAL_PROTOCOL_DECL__NAME, oldName, name)); - } - - /** - * - * - * @generated - */ - public String getRole() - { - return role; - } - - /** - * - * - * @generated - */ - public void setRole(String newRole) - { - String oldRole = role; - role = newRole; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.LOCAL_PROTOCOL_DECL__ROLE, oldRole, role)); - } - - /** - * - * - * @generated - */ - public EList getParameters() - { - if (parameters == null) - { - parameters = new EObjectContainmentEList(ParameterDecl.class, this, ScribbleDslPackage.LOCAL_PROTOCOL_DECL__PARAMETERS); - } - return parameters; - } - - /** - * - * - * @generated - */ - public EList getRoles() - { - if (roles == null) - { - roles = new EObjectContainmentEList(RoleDecl.class, this, ScribbleDslPackage.LOCAL_PROTOCOL_DECL__ROLES); - } - return roles; - } - - /** - * - * - * @generated - */ - public LocalProtocolBlock getBlock() - { - return block; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetBlock(LocalProtocolBlock newBlock, NotificationChain msgs) - { - LocalProtocolBlock oldBlock = block; - block = newBlock; - if (eNotificationRequired()) - { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.LOCAL_PROTOCOL_DECL__BLOCK, oldBlock, newBlock); - if (msgs == null) msgs = notification; else msgs.add(notification); - } - return msgs; - } - - /** - * - * - * @generated - */ - public void setBlock(LocalProtocolBlock newBlock) - { - if (newBlock != block) - { - NotificationChain msgs = null; - if (block != null) - msgs = ((InternalEObject)block).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ScribbleDslPackage.LOCAL_PROTOCOL_DECL__BLOCK, null, msgs); - if (newBlock != null) - msgs = ((InternalEObject)newBlock).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ScribbleDslPackage.LOCAL_PROTOCOL_DECL__BLOCK, null, msgs); - msgs = basicSetBlock(newBlock, msgs); - if (msgs != null) msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.LOCAL_PROTOCOL_DECL__BLOCK, newBlock, newBlock)); - } - - /** - * - * - * @generated - */ - public String getInstantiates() - { - return instantiates; - } - - /** - * - * - * @generated - */ - public void setInstantiates(String newInstantiates) - { - String oldInstantiates = instantiates; - instantiates = newInstantiates; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.LOCAL_PROTOCOL_DECL__INSTANTIATES, oldInstantiates, instantiates)); - } - - /** - * - * - * @generated - */ - public EList getArguments() - { - if (arguments == null) - { - arguments = new EObjectContainmentEList(Argument.class, this, ScribbleDslPackage.LOCAL_PROTOCOL_DECL__ARGUMENTS); - } - return arguments; - } - - /** - * - * - * @generated - */ - public EList getRoleInstantiations() - { - if (roleInstantiations == null) - { - roleInstantiations = new EObjectContainmentEList(RoleInstantiation.class, this, ScribbleDslPackage.LOCAL_PROTOCOL_DECL__ROLE_INSTANTIATIONS); - } - return roleInstantiations; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_PROTOCOL_DECL__PARAMETERS: - return ((InternalEList)getParameters()).basicRemove(otherEnd, msgs); - case ScribbleDslPackage.LOCAL_PROTOCOL_DECL__ROLES: - return ((InternalEList)getRoles()).basicRemove(otherEnd, msgs); - case ScribbleDslPackage.LOCAL_PROTOCOL_DECL__BLOCK: - return basicSetBlock(null, msgs); - case ScribbleDslPackage.LOCAL_PROTOCOL_DECL__ARGUMENTS: - return ((InternalEList)getArguments()).basicRemove(otherEnd, msgs); - case ScribbleDslPackage.LOCAL_PROTOCOL_DECL__ROLE_INSTANTIATIONS: - return ((InternalEList)getRoleInstantiations()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_PROTOCOL_DECL__NAME: - return getName(); - case ScribbleDslPackage.LOCAL_PROTOCOL_DECL__ROLE: - return getRole(); - case ScribbleDslPackage.LOCAL_PROTOCOL_DECL__PARAMETERS: - return getParameters(); - case ScribbleDslPackage.LOCAL_PROTOCOL_DECL__ROLES: - return getRoles(); - case ScribbleDslPackage.LOCAL_PROTOCOL_DECL__BLOCK: - return getBlock(); - case ScribbleDslPackage.LOCAL_PROTOCOL_DECL__INSTANTIATES: - return getInstantiates(); - case ScribbleDslPackage.LOCAL_PROTOCOL_DECL__ARGUMENTS: - return getArguments(); - case ScribbleDslPackage.LOCAL_PROTOCOL_DECL__ROLE_INSTANTIATIONS: - return getRoleInstantiations(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_PROTOCOL_DECL__NAME: - setName((String)newValue); - return; - case ScribbleDslPackage.LOCAL_PROTOCOL_DECL__ROLE: - setRole((String)newValue); - return; - case ScribbleDslPackage.LOCAL_PROTOCOL_DECL__PARAMETERS: - getParameters().clear(); - getParameters().addAll((Collection)newValue); - return; - case ScribbleDslPackage.LOCAL_PROTOCOL_DECL__ROLES: - getRoles().clear(); - getRoles().addAll((Collection)newValue); - return; - case ScribbleDslPackage.LOCAL_PROTOCOL_DECL__BLOCK: - setBlock((LocalProtocolBlock)newValue); - return; - case ScribbleDslPackage.LOCAL_PROTOCOL_DECL__INSTANTIATES: - setInstantiates((String)newValue); - return; - case ScribbleDslPackage.LOCAL_PROTOCOL_DECL__ARGUMENTS: - getArguments().clear(); - getArguments().addAll((Collection)newValue); - return; - case ScribbleDslPackage.LOCAL_PROTOCOL_DECL__ROLE_INSTANTIATIONS: - getRoleInstantiations().clear(); - getRoleInstantiations().addAll((Collection)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_PROTOCOL_DECL__NAME: - setName(NAME_EDEFAULT); - return; - case ScribbleDslPackage.LOCAL_PROTOCOL_DECL__ROLE: - setRole(ROLE_EDEFAULT); - return; - case ScribbleDslPackage.LOCAL_PROTOCOL_DECL__PARAMETERS: - getParameters().clear(); - return; - case ScribbleDslPackage.LOCAL_PROTOCOL_DECL__ROLES: - getRoles().clear(); - return; - case ScribbleDslPackage.LOCAL_PROTOCOL_DECL__BLOCK: - setBlock((LocalProtocolBlock)null); - return; - case ScribbleDslPackage.LOCAL_PROTOCOL_DECL__INSTANTIATES: - setInstantiates(INSTANTIATES_EDEFAULT); - return; - case ScribbleDslPackage.LOCAL_PROTOCOL_DECL__ARGUMENTS: - getArguments().clear(); - return; - case ScribbleDslPackage.LOCAL_PROTOCOL_DECL__ROLE_INSTANTIATIONS: - getRoleInstantiations().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_PROTOCOL_DECL__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case ScribbleDslPackage.LOCAL_PROTOCOL_DECL__ROLE: - return ROLE_EDEFAULT == null ? role != null : !ROLE_EDEFAULT.equals(role); - case ScribbleDslPackage.LOCAL_PROTOCOL_DECL__PARAMETERS: - return parameters != null && !parameters.isEmpty(); - case ScribbleDslPackage.LOCAL_PROTOCOL_DECL__ROLES: - return roles != null && !roles.isEmpty(); - case ScribbleDslPackage.LOCAL_PROTOCOL_DECL__BLOCK: - return block != null; - case ScribbleDslPackage.LOCAL_PROTOCOL_DECL__INSTANTIATES: - return INSTANTIATES_EDEFAULT == null ? instantiates != null : !INSTANTIATES_EDEFAULT.equals(instantiates); - case ScribbleDslPackage.LOCAL_PROTOCOL_DECL__ARGUMENTS: - return arguments != null && !arguments.isEmpty(); - case ScribbleDslPackage.LOCAL_PROTOCOL_DECL__ROLE_INSTANTIATIONS: - return roleInstantiations != null && !roleInstantiations.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (name: "); - result.append(name); - result.append(", role: "); - result.append(role); - result.append(", instantiates: "); - result.append(instantiates); - result.append(')'); - return result.toString(); - } - -} //LocalProtocolDeclImpl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/LocalReceiveImpl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/LocalReceiveImpl.java deleted file mode 100644 index 440f17f87..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/LocalReceiveImpl.java +++ /dev/null @@ -1,264 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -import org.scribble.editor.dsl.scribbleDsl.LocalReceive; -import org.scribble.editor.dsl.scribbleDsl.Message; -import org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage; - -/** - * - * An implementation of the model object 'Local Receive'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.LocalReceiveImpl#getMessage Message}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.LocalReceiveImpl#getFromRole From Role}
  • - *
- *

- * - * @generated - */ -public class LocalReceiveImpl extends LlobalInteractionImpl implements LocalReceive -{ - /** - * The cached value of the '{@link #getMessage() Message}' containment reference. - * - * - * @see #getMessage() - * @generated - * @ordered - */ - protected Message message; - - /** - * The default value of the '{@link #getFromRole() From Role}' attribute. - * - * - * @see #getFromRole() - * @generated - * @ordered - */ - protected static final String FROM_ROLE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getFromRole() From Role}' attribute. - * - * - * @see #getFromRole() - * @generated - * @ordered - */ - protected String fromRole = FROM_ROLE_EDEFAULT; - - /** - * - * - * @generated - */ - protected LocalReceiveImpl() - { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() - { - return ScribbleDslPackage.Literals.LOCAL_RECEIVE; - } - - /** - * - * - * @generated - */ - public Message getMessage() - { - return message; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetMessage(Message newMessage, NotificationChain msgs) - { - Message oldMessage = message; - message = newMessage; - if (eNotificationRequired()) - { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.LOCAL_RECEIVE__MESSAGE, oldMessage, newMessage); - if (msgs == null) msgs = notification; else msgs.add(notification); - } - return msgs; - } - - /** - * - * - * @generated - */ - public void setMessage(Message newMessage) - { - if (newMessage != message) - { - NotificationChain msgs = null; - if (message != null) - msgs = ((InternalEObject)message).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ScribbleDslPackage.LOCAL_RECEIVE__MESSAGE, null, msgs); - if (newMessage != null) - msgs = ((InternalEObject)newMessage).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ScribbleDslPackage.LOCAL_RECEIVE__MESSAGE, null, msgs); - msgs = basicSetMessage(newMessage, msgs); - if (msgs != null) msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.LOCAL_RECEIVE__MESSAGE, newMessage, newMessage)); - } - - /** - * - * - * @generated - */ - public String getFromRole() - { - return fromRole; - } - - /** - * - * - * @generated - */ - public void setFromRole(String newFromRole) - { - String oldFromRole = fromRole; - fromRole = newFromRole; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.LOCAL_RECEIVE__FROM_ROLE, oldFromRole, fromRole)); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_RECEIVE__MESSAGE: - return basicSetMessage(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_RECEIVE__MESSAGE: - return getMessage(); - case ScribbleDslPackage.LOCAL_RECEIVE__FROM_ROLE: - return getFromRole(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_RECEIVE__MESSAGE: - setMessage((Message)newValue); - return; - case ScribbleDslPackage.LOCAL_RECEIVE__FROM_ROLE: - setFromRole((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_RECEIVE__MESSAGE: - setMessage((Message)null); - return; - case ScribbleDslPackage.LOCAL_RECEIVE__FROM_ROLE: - setFromRole(FROM_ROLE_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_RECEIVE__MESSAGE: - return message != null; - case ScribbleDslPackage.LOCAL_RECEIVE__FROM_ROLE: - return FROM_ROLE_EDEFAULT == null ? fromRole != null : !FROM_ROLE_EDEFAULT.equals(fromRole); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (fromRole: "); - result.append(fromRole); - result.append(')'); - return result.toString(); - } - -} //LocalReceiveImpl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/LocalRecursionImpl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/LocalRecursionImpl.java deleted file mode 100644 index 5c05c624e..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/LocalRecursionImpl.java +++ /dev/null @@ -1,264 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -import org.scribble.editor.dsl.scribbleDsl.LocalProtocolBlock; -import org.scribble.editor.dsl.scribbleDsl.LocalRecursion; -import org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage; - -/** - * - * An implementation of the model object 'Local Recursion'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.LocalRecursionImpl#getLabel Label}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.LocalRecursionImpl#getBlock Block}
  • - *
- *

- * - * @generated - */ -public class LocalRecursionImpl extends LlobalInteractionImpl implements LocalRecursion -{ - /** - * The default value of the '{@link #getLabel() Label}' attribute. - * - * - * @see #getLabel() - * @generated - * @ordered - */ - protected static final String LABEL_EDEFAULT = null; - - /** - * The cached value of the '{@link #getLabel() Label}' attribute. - * - * - * @see #getLabel() - * @generated - * @ordered - */ - protected String label = LABEL_EDEFAULT; - - /** - * The cached value of the '{@link #getBlock() Block}' containment reference. - * - * - * @see #getBlock() - * @generated - * @ordered - */ - protected LocalProtocolBlock block; - - /** - * - * - * @generated - */ - protected LocalRecursionImpl() - { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() - { - return ScribbleDslPackage.Literals.LOCAL_RECURSION; - } - - /** - * - * - * @generated - */ - public String getLabel() - { - return label; - } - - /** - * - * - * @generated - */ - public void setLabel(String newLabel) - { - String oldLabel = label; - label = newLabel; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.LOCAL_RECURSION__LABEL, oldLabel, label)); - } - - /** - * - * - * @generated - */ - public LocalProtocolBlock getBlock() - { - return block; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetBlock(LocalProtocolBlock newBlock, NotificationChain msgs) - { - LocalProtocolBlock oldBlock = block; - block = newBlock; - if (eNotificationRequired()) - { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.LOCAL_RECURSION__BLOCK, oldBlock, newBlock); - if (msgs == null) msgs = notification; else msgs.add(notification); - } - return msgs; - } - - /** - * - * - * @generated - */ - public void setBlock(LocalProtocolBlock newBlock) - { - if (newBlock != block) - { - NotificationChain msgs = null; - if (block != null) - msgs = ((InternalEObject)block).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ScribbleDslPackage.LOCAL_RECURSION__BLOCK, null, msgs); - if (newBlock != null) - msgs = ((InternalEObject)newBlock).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ScribbleDslPackage.LOCAL_RECURSION__BLOCK, null, msgs); - msgs = basicSetBlock(newBlock, msgs); - if (msgs != null) msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.LOCAL_RECURSION__BLOCK, newBlock, newBlock)); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_RECURSION__BLOCK: - return basicSetBlock(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_RECURSION__LABEL: - return getLabel(); - case ScribbleDslPackage.LOCAL_RECURSION__BLOCK: - return getBlock(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_RECURSION__LABEL: - setLabel((String)newValue); - return; - case ScribbleDslPackage.LOCAL_RECURSION__BLOCK: - setBlock((LocalProtocolBlock)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_RECURSION__LABEL: - setLabel(LABEL_EDEFAULT); - return; - case ScribbleDslPackage.LOCAL_RECURSION__BLOCK: - setBlock((LocalProtocolBlock)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_RECURSION__LABEL: - return LABEL_EDEFAULT == null ? label != null : !LABEL_EDEFAULT.equals(label); - case ScribbleDslPackage.LOCAL_RECURSION__BLOCK: - return block != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (label: "); - result.append(label); - result.append(')'); - return result.toString(); - } - -} //LocalRecursionImpl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/LocalSendImpl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/LocalSendImpl.java deleted file mode 100644 index d103fc956..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/LocalSendImpl.java +++ /dev/null @@ -1,253 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl.impl; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; - -import org.eclipse.emf.ecore.util.EDataTypeEList; - -import org.scribble.editor.dsl.scribbleDsl.LocalSend; -import org.scribble.editor.dsl.scribbleDsl.Message; -import org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage; - -/** - * - * An implementation of the model object 'Local Send'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.LocalSendImpl#getMessage Message}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.LocalSendImpl#getToRoles To Roles}
  • - *
- *

- * - * @generated - */ -public class LocalSendImpl extends LlobalInteractionImpl implements LocalSend -{ - /** - * The cached value of the '{@link #getMessage() Message}' containment reference. - * - * - * @see #getMessage() - * @generated - * @ordered - */ - protected Message message; - - /** - * The cached value of the '{@link #getToRoles() To Roles}' attribute list. - * - * - * @see #getToRoles() - * @generated - * @ordered - */ - protected EList toRoles; - - /** - * - * - * @generated - */ - protected LocalSendImpl() - { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() - { - return ScribbleDslPackage.Literals.LOCAL_SEND; - } - - /** - * - * - * @generated - */ - public Message getMessage() - { - return message; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetMessage(Message newMessage, NotificationChain msgs) - { - Message oldMessage = message; - message = newMessage; - if (eNotificationRequired()) - { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.LOCAL_SEND__MESSAGE, oldMessage, newMessage); - if (msgs == null) msgs = notification; else msgs.add(notification); - } - return msgs; - } - - /** - * - * - * @generated - */ - public void setMessage(Message newMessage) - { - if (newMessage != message) - { - NotificationChain msgs = null; - if (message != null) - msgs = ((InternalEObject)message).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ScribbleDslPackage.LOCAL_SEND__MESSAGE, null, msgs); - if (newMessage != null) - msgs = ((InternalEObject)newMessage).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ScribbleDslPackage.LOCAL_SEND__MESSAGE, null, msgs); - msgs = basicSetMessage(newMessage, msgs); - if (msgs != null) msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.LOCAL_SEND__MESSAGE, newMessage, newMessage)); - } - - /** - * - * - * @generated - */ - public EList getToRoles() - { - if (toRoles == null) - { - toRoles = new EDataTypeEList(String.class, this, ScribbleDslPackage.LOCAL_SEND__TO_ROLES); - } - return toRoles; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_SEND__MESSAGE: - return basicSetMessage(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_SEND__MESSAGE: - return getMessage(); - case ScribbleDslPackage.LOCAL_SEND__TO_ROLES: - return getToRoles(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_SEND__MESSAGE: - setMessage((Message)newValue); - return; - case ScribbleDslPackage.LOCAL_SEND__TO_ROLES: - getToRoles().clear(); - getToRoles().addAll((Collection)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_SEND__MESSAGE: - setMessage((Message)null); - return; - case ScribbleDslPackage.LOCAL_SEND__TO_ROLES: - getToRoles().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_SEND__MESSAGE: - return message != null; - case ScribbleDslPackage.LOCAL_SEND__TO_ROLES: - return toRoles != null && !toRoles.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (toRoles: "); - result.append(toRoles); - result.append(')'); - return result.toString(); - } - -} //LocalSendImpl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/LocalThrowImpl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/LocalThrowImpl.java deleted file mode 100644 index 710444c17..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/LocalThrowImpl.java +++ /dev/null @@ -1,221 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl.impl; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; - -import org.eclipse.emf.ecore.util.EDataTypeEList; -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -import org.scribble.editor.dsl.scribbleDsl.LocalThrow; -import org.scribble.editor.dsl.scribbleDsl.Message; -import org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage; - -/** - * - * An implementation of the model object 'Local Throw'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.LocalThrowImpl#getMessages Messages}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.LocalThrowImpl#getToRoles To Roles}
  • - *
- *

- * - * @generated - */ -public class LocalThrowImpl extends MinimalEObjectImpl.Container implements LocalThrow -{ - /** - * The cached value of the '{@link #getMessages() Messages}' containment reference list. - * - * - * @see #getMessages() - * @generated - * @ordered - */ - protected EList messages; - - /** - * The cached value of the '{@link #getToRoles() To Roles}' attribute list. - * - * - * @see #getToRoles() - * @generated - * @ordered - */ - protected EList toRoles; - - /** - * - * - * @generated - */ - protected LocalThrowImpl() - { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() - { - return ScribbleDslPackage.Literals.LOCAL_THROW; - } - - /** - * - * - * @generated - */ - public EList getMessages() - { - if (messages == null) - { - messages = new EObjectContainmentEList(Message.class, this, ScribbleDslPackage.LOCAL_THROW__MESSAGES); - } - return messages; - } - - /** - * - * - * @generated - */ - public EList getToRoles() - { - if (toRoles == null) - { - toRoles = new EDataTypeEList(String.class, this, ScribbleDslPackage.LOCAL_THROW__TO_ROLES); - } - return toRoles; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_THROW__MESSAGES: - return ((InternalEList)getMessages()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_THROW__MESSAGES: - return getMessages(); - case ScribbleDslPackage.LOCAL_THROW__TO_ROLES: - return getToRoles(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_THROW__MESSAGES: - getMessages().clear(); - getMessages().addAll((Collection)newValue); - return; - case ScribbleDslPackage.LOCAL_THROW__TO_ROLES: - getToRoles().clear(); - getToRoles().addAll((Collection)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_THROW__MESSAGES: - getMessages().clear(); - return; - case ScribbleDslPackage.LOCAL_THROW__TO_ROLES: - getToRoles().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.LOCAL_THROW__MESSAGES: - return messages != null && !messages.isEmpty(); - case ScribbleDslPackage.LOCAL_THROW__TO_ROLES: - return toRoles != null && !toRoles.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (toRoles: "); - result.append(toRoles); - result.append(')'); - return result.toString(); - } - -} //LocalThrowImpl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/MessageImpl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/MessageImpl.java deleted file mode 100644 index 6a41887b9..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/MessageImpl.java +++ /dev/null @@ -1,265 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl.impl; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; - -import org.scribble.editor.dsl.scribbleDsl.Message; -import org.scribble.editor.dsl.scribbleDsl.MessageSignature; -import org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage; - -/** - * - * An implementation of the model object 'Message'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.MessageImpl#getSignature Signature}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.MessageImpl#getParameter Parameter}
  • - *
- *

- * - * @generated - */ -public class MessageImpl extends MinimalEObjectImpl.Container implements Message -{ - /** - * The cached value of the '{@link #getSignature() Signature}' containment reference. - * - * - * @see #getSignature() - * @generated - * @ordered - */ - protected MessageSignature signature; - - /** - * The default value of the '{@link #getParameter() Parameter}' attribute. - * - * - * @see #getParameter() - * @generated - * @ordered - */ - protected static final String PARAMETER_EDEFAULT = null; - - /** - * The cached value of the '{@link #getParameter() Parameter}' attribute. - * - * - * @see #getParameter() - * @generated - * @ordered - */ - protected String parameter = PARAMETER_EDEFAULT; - - /** - * - * - * @generated - */ - protected MessageImpl() - { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() - { - return ScribbleDslPackage.Literals.MESSAGE; - } - - /** - * - * - * @generated - */ - public MessageSignature getSignature() - { - return signature; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetSignature(MessageSignature newSignature, NotificationChain msgs) - { - MessageSignature oldSignature = signature; - signature = newSignature; - if (eNotificationRequired()) - { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.MESSAGE__SIGNATURE, oldSignature, newSignature); - if (msgs == null) msgs = notification; else msgs.add(notification); - } - return msgs; - } - - /** - * - * - * @generated - */ - public void setSignature(MessageSignature newSignature) - { - if (newSignature != signature) - { - NotificationChain msgs = null; - if (signature != null) - msgs = ((InternalEObject)signature).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - ScribbleDslPackage.MESSAGE__SIGNATURE, null, msgs); - if (newSignature != null) - msgs = ((InternalEObject)newSignature).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - ScribbleDslPackage.MESSAGE__SIGNATURE, null, msgs); - msgs = basicSetSignature(newSignature, msgs); - if (msgs != null) msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.MESSAGE__SIGNATURE, newSignature, newSignature)); - } - - /** - * - * - * @generated - */ - public String getParameter() - { - return parameter; - } - - /** - * - * - * @generated - */ - public void setParameter(String newParameter) - { - String oldParameter = parameter; - parameter = newParameter; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.MESSAGE__PARAMETER, oldParameter, parameter)); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case ScribbleDslPackage.MESSAGE__SIGNATURE: - return basicSetSignature(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ScribbleDslPackage.MESSAGE__SIGNATURE: - return getSignature(); - case ScribbleDslPackage.MESSAGE__PARAMETER: - return getParameter(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ScribbleDslPackage.MESSAGE__SIGNATURE: - setSignature((MessageSignature)newValue); - return; - case ScribbleDslPackage.MESSAGE__PARAMETER: - setParameter((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.MESSAGE__SIGNATURE: - setSignature((MessageSignature)null); - return; - case ScribbleDslPackage.MESSAGE__PARAMETER: - setParameter(PARAMETER_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.MESSAGE__SIGNATURE: - return signature != null; - case ScribbleDslPackage.MESSAGE__PARAMETER: - return PARAMETER_EDEFAULT == null ? parameter != null : !PARAMETER_EDEFAULT.equals(parameter); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (parameter: "); - result.append(parameter); - result.append(')'); - return result.toString(); - } - -} //MessageImpl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/MessageSignatureImpl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/MessageSignatureImpl.java deleted file mode 100644 index 467196353..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/MessageSignatureImpl.java +++ /dev/null @@ -1,240 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl.impl; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; - -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -import org.scribble.editor.dsl.scribbleDsl.MessageSignature; -import org.scribble.editor.dsl.scribbleDsl.PayloadElement; -import org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage; - -/** - * - * An implementation of the model object 'Message Signature'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.MessageSignatureImpl#getOperator Operator}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.MessageSignatureImpl#getTypes Types}
  • - *
- *

- * - * @generated - */ -public class MessageSignatureImpl extends MinimalEObjectImpl.Container implements MessageSignature -{ - /** - * The default value of the '{@link #getOperator() Operator}' attribute. - * - * - * @see #getOperator() - * @generated - * @ordered - */ - protected static final String OPERATOR_EDEFAULT = null; - - /** - * The cached value of the '{@link #getOperator() Operator}' attribute. - * - * - * @see #getOperator() - * @generated - * @ordered - */ - protected String operator = OPERATOR_EDEFAULT; - - /** - * The cached value of the '{@link #getTypes() Types}' containment reference list. - * - * - * @see #getTypes() - * @generated - * @ordered - */ - protected EList types; - - /** - * - * - * @generated - */ - protected MessageSignatureImpl() - { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() - { - return ScribbleDslPackage.Literals.MESSAGE_SIGNATURE; - } - - /** - * - * - * @generated - */ - public String getOperator() - { - return operator; - } - - /** - * - * - * @generated - */ - public void setOperator(String newOperator) - { - String oldOperator = operator; - operator = newOperator; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.MESSAGE_SIGNATURE__OPERATOR, oldOperator, operator)); - } - - /** - * - * - * @generated - */ - public EList getTypes() - { - if (types == null) - { - types = new EObjectContainmentEList(PayloadElement.class, this, ScribbleDslPackage.MESSAGE_SIGNATURE__TYPES); - } - return types; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case ScribbleDslPackage.MESSAGE_SIGNATURE__TYPES: - return ((InternalEList)getTypes()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ScribbleDslPackage.MESSAGE_SIGNATURE__OPERATOR: - return getOperator(); - case ScribbleDslPackage.MESSAGE_SIGNATURE__TYPES: - return getTypes(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ScribbleDslPackage.MESSAGE_SIGNATURE__OPERATOR: - setOperator((String)newValue); - return; - case ScribbleDslPackage.MESSAGE_SIGNATURE__TYPES: - getTypes().clear(); - getTypes().addAll((Collection)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.MESSAGE_SIGNATURE__OPERATOR: - setOperator(OPERATOR_EDEFAULT); - return; - case ScribbleDslPackage.MESSAGE_SIGNATURE__TYPES: - getTypes().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.MESSAGE_SIGNATURE__OPERATOR: - return OPERATOR_EDEFAULT == null ? operator != null : !OPERATOR_EDEFAULT.equals(operator); - case ScribbleDslPackage.MESSAGE_SIGNATURE__TYPES: - return types != null && !types.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (operator: "); - result.append(operator); - result.append(')'); - return result.toString(); - } - -} //MessageSignatureImpl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/ModuleImpl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/ModuleImpl.java deleted file mode 100644 index 90ab1247e..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/ModuleImpl.java +++ /dev/null @@ -1,357 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl.impl; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; - -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -import org.scribble.editor.dsl.scribbleDsl.GlobalProtocolDecl; -import org.scribble.editor.dsl.scribbleDsl.ImportDecl; -import org.scribble.editor.dsl.scribbleDsl.LocalProtocolDecl; -import org.scribble.editor.dsl.scribbleDsl.Module; -import org.scribble.editor.dsl.scribbleDsl.PayloadTypeDecl; -import org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage; - -/** - * - * An implementation of the model object 'Module'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.ModuleImpl#getName Name}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.ModuleImpl#getImports Imports}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.ModuleImpl#getTypes Types}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.ModuleImpl#getGlobals Globals}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.ModuleImpl#getLocals Locals}
  • - *
- *

- * - * @generated - */ -public class ModuleImpl extends MinimalEObjectImpl.Container implements Module -{ - /** - * The default value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * The cached value of the '{@link #getImports() Imports}' containment reference list. - * - * - * @see #getImports() - * @generated - * @ordered - */ - protected EList imports; - - /** - * The cached value of the '{@link #getTypes() Types}' containment reference list. - * - * - * @see #getTypes() - * @generated - * @ordered - */ - protected EList types; - - /** - * The cached value of the '{@link #getGlobals() Globals}' containment reference list. - * - * - * @see #getGlobals() - * @generated - * @ordered - */ - protected EList globals; - - /** - * The cached value of the '{@link #getLocals() Locals}' containment reference list. - * - * - * @see #getLocals() - * @generated - * @ordered - */ - protected EList locals; - - /** - * - * - * @generated - */ - protected ModuleImpl() - { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() - { - return ScribbleDslPackage.Literals.MODULE; - } - - /** - * - * - * @generated - */ - public String getName() - { - return name; - } - - /** - * - * - * @generated - */ - public void setName(String newName) - { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.MODULE__NAME, oldName, name)); - } - - /** - * - * - * @generated - */ - public EList getImports() - { - if (imports == null) - { - imports = new EObjectContainmentEList(ImportDecl.class, this, ScribbleDslPackage.MODULE__IMPORTS); - } - return imports; - } - - /** - * - * - * @generated - */ - public EList getTypes() - { - if (types == null) - { - types = new EObjectContainmentEList(PayloadTypeDecl.class, this, ScribbleDslPackage.MODULE__TYPES); - } - return types; - } - - /** - * - * - * @generated - */ - public EList getGlobals() - { - if (globals == null) - { - globals = new EObjectContainmentEList(GlobalProtocolDecl.class, this, ScribbleDslPackage.MODULE__GLOBALS); - } - return globals; - } - - /** - * - * - * @generated - */ - public EList getLocals() - { - if (locals == null) - { - locals = new EObjectContainmentEList(LocalProtocolDecl.class, this, ScribbleDslPackage.MODULE__LOCALS); - } - return locals; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case ScribbleDslPackage.MODULE__IMPORTS: - return ((InternalEList)getImports()).basicRemove(otherEnd, msgs); - case ScribbleDslPackage.MODULE__TYPES: - return ((InternalEList)getTypes()).basicRemove(otherEnd, msgs); - case ScribbleDslPackage.MODULE__GLOBALS: - return ((InternalEList)getGlobals()).basicRemove(otherEnd, msgs); - case ScribbleDslPackage.MODULE__LOCALS: - return ((InternalEList)getLocals()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ScribbleDslPackage.MODULE__NAME: - return getName(); - case ScribbleDslPackage.MODULE__IMPORTS: - return getImports(); - case ScribbleDslPackage.MODULE__TYPES: - return getTypes(); - case ScribbleDslPackage.MODULE__GLOBALS: - return getGlobals(); - case ScribbleDslPackage.MODULE__LOCALS: - return getLocals(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ScribbleDslPackage.MODULE__NAME: - setName((String)newValue); - return; - case ScribbleDslPackage.MODULE__IMPORTS: - getImports().clear(); - getImports().addAll((Collection)newValue); - return; - case ScribbleDslPackage.MODULE__TYPES: - getTypes().clear(); - getTypes().addAll((Collection)newValue); - return; - case ScribbleDslPackage.MODULE__GLOBALS: - getGlobals().clear(); - getGlobals().addAll((Collection)newValue); - return; - case ScribbleDslPackage.MODULE__LOCALS: - getLocals().clear(); - getLocals().addAll((Collection)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.MODULE__NAME: - setName(NAME_EDEFAULT); - return; - case ScribbleDslPackage.MODULE__IMPORTS: - getImports().clear(); - return; - case ScribbleDslPackage.MODULE__TYPES: - getTypes().clear(); - return; - case ScribbleDslPackage.MODULE__GLOBALS: - getGlobals().clear(); - return; - case ScribbleDslPackage.MODULE__LOCALS: - getLocals().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.MODULE__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case ScribbleDslPackage.MODULE__IMPORTS: - return imports != null && !imports.isEmpty(); - case ScribbleDslPackage.MODULE__TYPES: - return types != null && !types.isEmpty(); - case ScribbleDslPackage.MODULE__GLOBALS: - return globals != null && !globals.isEmpty(); - case ScribbleDslPackage.MODULE__LOCALS: - return locals != null && !locals.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (name: "); - result.append(name); - result.append(')'); - return result.toString(); - } - -} //ModuleImpl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/ParameterDeclImpl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/ParameterDeclImpl.java deleted file mode 100644 index ca35dbeab..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/ParameterDeclImpl.java +++ /dev/null @@ -1,233 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl.impl; - -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.ecore.EClass; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; - -import org.scribble.editor.dsl.scribbleDsl.ParameterDecl; -import org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage; - -/** - * - * An implementation of the model object 'Parameter Decl'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.ParameterDeclImpl#getName Name}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.ParameterDeclImpl#getAlias Alias}
  • - *
- *

- * - * @generated - */ -public class ParameterDeclImpl extends MinimalEObjectImpl.Container implements ParameterDecl -{ - /** - * The default value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * The default value of the '{@link #getAlias() Alias}' attribute. - * - * - * @see #getAlias() - * @generated - * @ordered - */ - protected static final String ALIAS_EDEFAULT = null; - - /** - * The cached value of the '{@link #getAlias() Alias}' attribute. - * - * - * @see #getAlias() - * @generated - * @ordered - */ - protected String alias = ALIAS_EDEFAULT; - - /** - * - * - * @generated - */ - protected ParameterDeclImpl() - { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() - { - return ScribbleDslPackage.Literals.PARAMETER_DECL; - } - - /** - * - * - * @generated - */ - public String getName() - { - return name; - } - - /** - * - * - * @generated - */ - public void setName(String newName) - { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.PARAMETER_DECL__NAME, oldName, name)); - } - - /** - * - * - * @generated - */ - public String getAlias() - { - return alias; - } - - /** - * - * - * @generated - */ - public void setAlias(String newAlias) - { - String oldAlias = alias; - alias = newAlias; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.PARAMETER_DECL__ALIAS, oldAlias, alias)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ScribbleDslPackage.PARAMETER_DECL__NAME: - return getName(); - case ScribbleDslPackage.PARAMETER_DECL__ALIAS: - return getAlias(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ScribbleDslPackage.PARAMETER_DECL__NAME: - setName((String)newValue); - return; - case ScribbleDslPackage.PARAMETER_DECL__ALIAS: - setAlias((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.PARAMETER_DECL__NAME: - setName(NAME_EDEFAULT); - return; - case ScribbleDslPackage.PARAMETER_DECL__ALIAS: - setAlias(ALIAS_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.PARAMETER_DECL__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case ScribbleDslPackage.PARAMETER_DECL__ALIAS: - return ALIAS_EDEFAULT == null ? alias != null : !ALIAS_EDEFAULT.equals(alias); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (name: "); - result.append(name); - result.append(", alias: "); - result.append(alias); - result.append(')'); - return result.toString(); - } - -} //ParameterDeclImpl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/PayloadElementImpl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/PayloadElementImpl.java deleted file mode 100644 index 6eeb6ed8d..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/PayloadElementImpl.java +++ /dev/null @@ -1,233 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl.impl; - -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.ecore.EClass; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; - -import org.scribble.editor.dsl.scribbleDsl.PayloadElement; -import org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage; - -/** - * - * An implementation of the model object 'Payload Element'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.PayloadElementImpl#getName Name}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.PayloadElementImpl#getType Type}
  • - *
- *

- * - * @generated - */ -public class PayloadElementImpl extends MinimalEObjectImpl.Container implements PayloadElement -{ - /** - * The default value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * The default value of the '{@link #getType() Type}' attribute. - * - * - * @see #getType() - * @generated - * @ordered - */ - protected static final String TYPE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getType() Type}' attribute. - * - * - * @see #getType() - * @generated - * @ordered - */ - protected String type = TYPE_EDEFAULT; - - /** - * - * - * @generated - */ - protected PayloadElementImpl() - { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() - { - return ScribbleDslPackage.Literals.PAYLOAD_ELEMENT; - } - - /** - * - * - * @generated - */ - public String getName() - { - return name; - } - - /** - * - * - * @generated - */ - public void setName(String newName) - { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.PAYLOAD_ELEMENT__NAME, oldName, name)); - } - - /** - * - * - * @generated - */ - public String getType() - { - return type; - } - - /** - * - * - * @generated - */ - public void setType(String newType) - { - String oldType = type; - type = newType; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.PAYLOAD_ELEMENT__TYPE, oldType, type)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ScribbleDslPackage.PAYLOAD_ELEMENT__NAME: - return getName(); - case ScribbleDslPackage.PAYLOAD_ELEMENT__TYPE: - return getType(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ScribbleDslPackage.PAYLOAD_ELEMENT__NAME: - setName((String)newValue); - return; - case ScribbleDslPackage.PAYLOAD_ELEMENT__TYPE: - setType((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.PAYLOAD_ELEMENT__NAME: - setName(NAME_EDEFAULT); - return; - case ScribbleDslPackage.PAYLOAD_ELEMENT__TYPE: - setType(TYPE_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.PAYLOAD_ELEMENT__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case ScribbleDslPackage.PAYLOAD_ELEMENT__TYPE: - return TYPE_EDEFAULT == null ? type != null : !TYPE_EDEFAULT.equals(type); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (name: "); - result.append(name); - result.append(", type: "); - result.append(type); - result.append(')'); - return result.toString(); - } - -} //PayloadElementImpl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/PayloadTypeDeclImpl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/PayloadTypeDeclImpl.java deleted file mode 100644 index 6c4b90f7a..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/PayloadTypeDeclImpl.java +++ /dev/null @@ -1,345 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl.impl; - -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.ecore.EClass; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; - -import org.scribble.editor.dsl.scribbleDsl.PayloadTypeDecl; -import org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage; - -/** - * - * An implementation of the model object 'Payload Type Decl'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.PayloadTypeDeclImpl#getSchema Schema}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.PayloadTypeDeclImpl#getType Type}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.PayloadTypeDeclImpl#getLocation Location}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.PayloadTypeDeclImpl#getAlias Alias}
  • - *
- *

- * - * @generated - */ -public class PayloadTypeDeclImpl extends MinimalEObjectImpl.Container implements PayloadTypeDecl -{ - /** - * The default value of the '{@link #getSchema() Schema}' attribute. - * - * - * @see #getSchema() - * @generated - * @ordered - */ - protected static final String SCHEMA_EDEFAULT = null; - - /** - * The cached value of the '{@link #getSchema() Schema}' attribute. - * - * - * @see #getSchema() - * @generated - * @ordered - */ - protected String schema = SCHEMA_EDEFAULT; - - /** - * The default value of the '{@link #getType() Type}' attribute. - * - * - * @see #getType() - * @generated - * @ordered - */ - protected static final String TYPE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getType() Type}' attribute. - * - * - * @see #getType() - * @generated - * @ordered - */ - protected String type = TYPE_EDEFAULT; - - /** - * The default value of the '{@link #getLocation() Location}' attribute. - * - * - * @see #getLocation() - * @generated - * @ordered - */ - protected static final String LOCATION_EDEFAULT = null; - - /** - * The cached value of the '{@link #getLocation() Location}' attribute. - * - * - * @see #getLocation() - * @generated - * @ordered - */ - protected String location = LOCATION_EDEFAULT; - - /** - * The default value of the '{@link #getAlias() Alias}' attribute. - * - * - * @see #getAlias() - * @generated - * @ordered - */ - protected static final String ALIAS_EDEFAULT = null; - - /** - * The cached value of the '{@link #getAlias() Alias}' attribute. - * - * - * @see #getAlias() - * @generated - * @ordered - */ - protected String alias = ALIAS_EDEFAULT; - - /** - * - * - * @generated - */ - protected PayloadTypeDeclImpl() - { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() - { - return ScribbleDslPackage.Literals.PAYLOAD_TYPE_DECL; - } - - /** - * - * - * @generated - */ - public String getSchema() - { - return schema; - } - - /** - * - * - * @generated - */ - public void setSchema(String newSchema) - { - String oldSchema = schema; - schema = newSchema; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.PAYLOAD_TYPE_DECL__SCHEMA, oldSchema, schema)); - } - - /** - * - * - * @generated - */ - public String getType() - { - return type; - } - - /** - * - * - * @generated - */ - public void setType(String newType) - { - String oldType = type; - type = newType; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.PAYLOAD_TYPE_DECL__TYPE, oldType, type)); - } - - /** - * - * - * @generated - */ - public String getLocation() - { - return location; - } - - /** - * - * - * @generated - */ - public void setLocation(String newLocation) - { - String oldLocation = location; - location = newLocation; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.PAYLOAD_TYPE_DECL__LOCATION, oldLocation, location)); - } - - /** - * - * - * @generated - */ - public String getAlias() - { - return alias; - } - - /** - * - * - * @generated - */ - public void setAlias(String newAlias) - { - String oldAlias = alias; - alias = newAlias; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.PAYLOAD_TYPE_DECL__ALIAS, oldAlias, alias)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ScribbleDslPackage.PAYLOAD_TYPE_DECL__SCHEMA: - return getSchema(); - case ScribbleDslPackage.PAYLOAD_TYPE_DECL__TYPE: - return getType(); - case ScribbleDslPackage.PAYLOAD_TYPE_DECL__LOCATION: - return getLocation(); - case ScribbleDslPackage.PAYLOAD_TYPE_DECL__ALIAS: - return getAlias(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ScribbleDslPackage.PAYLOAD_TYPE_DECL__SCHEMA: - setSchema((String)newValue); - return; - case ScribbleDslPackage.PAYLOAD_TYPE_DECL__TYPE: - setType((String)newValue); - return; - case ScribbleDslPackage.PAYLOAD_TYPE_DECL__LOCATION: - setLocation((String)newValue); - return; - case ScribbleDslPackage.PAYLOAD_TYPE_DECL__ALIAS: - setAlias((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.PAYLOAD_TYPE_DECL__SCHEMA: - setSchema(SCHEMA_EDEFAULT); - return; - case ScribbleDslPackage.PAYLOAD_TYPE_DECL__TYPE: - setType(TYPE_EDEFAULT); - return; - case ScribbleDslPackage.PAYLOAD_TYPE_DECL__LOCATION: - setLocation(LOCATION_EDEFAULT); - return; - case ScribbleDslPackage.PAYLOAD_TYPE_DECL__ALIAS: - setAlias(ALIAS_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.PAYLOAD_TYPE_DECL__SCHEMA: - return SCHEMA_EDEFAULT == null ? schema != null : !SCHEMA_EDEFAULT.equals(schema); - case ScribbleDslPackage.PAYLOAD_TYPE_DECL__TYPE: - return TYPE_EDEFAULT == null ? type != null : !TYPE_EDEFAULT.equals(type); - case ScribbleDslPackage.PAYLOAD_TYPE_DECL__LOCATION: - return LOCATION_EDEFAULT == null ? location != null : !LOCATION_EDEFAULT.equals(location); - case ScribbleDslPackage.PAYLOAD_TYPE_DECL__ALIAS: - return ALIAS_EDEFAULT == null ? alias != null : !ALIAS_EDEFAULT.equals(alias); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (schema: "); - result.append(schema); - result.append(", type: "); - result.append(type); - result.append(", location: "); - result.append(location); - result.append(", alias: "); - result.append(alias); - result.append(')'); - return result.toString(); - } - -} //PayloadTypeDeclImpl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/RoleDeclImpl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/RoleDeclImpl.java deleted file mode 100644 index ab5e2d19f..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/RoleDeclImpl.java +++ /dev/null @@ -1,233 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl.impl; - -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.ecore.EClass; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; - -import org.scribble.editor.dsl.scribbleDsl.RoleDecl; -import org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage; - -/** - * - * An implementation of the model object 'Role Decl'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.RoleDeclImpl#getName Name}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.RoleDeclImpl#getAlias Alias}
  • - *
- *

- * - * @generated - */ -public class RoleDeclImpl extends MinimalEObjectImpl.Container implements RoleDecl -{ - /** - * The default value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * The default value of the '{@link #getAlias() Alias}' attribute. - * - * - * @see #getAlias() - * @generated - * @ordered - */ - protected static final String ALIAS_EDEFAULT = null; - - /** - * The cached value of the '{@link #getAlias() Alias}' attribute. - * - * - * @see #getAlias() - * @generated - * @ordered - */ - protected String alias = ALIAS_EDEFAULT; - - /** - * - * - * @generated - */ - protected RoleDeclImpl() - { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() - { - return ScribbleDslPackage.Literals.ROLE_DECL; - } - - /** - * - * - * @generated - */ - public String getName() - { - return name; - } - - /** - * - * - * @generated - */ - public void setName(String newName) - { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.ROLE_DECL__NAME, oldName, name)); - } - - /** - * - * - * @generated - */ - public String getAlias() - { - return alias; - } - - /** - * - * - * @generated - */ - public void setAlias(String newAlias) - { - String oldAlias = alias; - alias = newAlias; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.ROLE_DECL__ALIAS, oldAlias, alias)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ScribbleDslPackage.ROLE_DECL__NAME: - return getName(); - case ScribbleDslPackage.ROLE_DECL__ALIAS: - return getAlias(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ScribbleDslPackage.ROLE_DECL__NAME: - setName((String)newValue); - return; - case ScribbleDslPackage.ROLE_DECL__ALIAS: - setAlias((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.ROLE_DECL__NAME: - setName(NAME_EDEFAULT); - return; - case ScribbleDslPackage.ROLE_DECL__ALIAS: - setAlias(ALIAS_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.ROLE_DECL__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case ScribbleDslPackage.ROLE_DECL__ALIAS: - return ALIAS_EDEFAULT == null ? alias != null : !ALIAS_EDEFAULT.equals(alias); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (name: "); - result.append(name); - result.append(", alias: "); - result.append(alias); - result.append(')'); - return result.toString(); - } - -} //RoleDeclImpl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/RoleInstantiationImpl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/RoleInstantiationImpl.java deleted file mode 100644 index b785163d9..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/RoleInstantiationImpl.java +++ /dev/null @@ -1,233 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl.impl; - -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.ecore.EClass; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; - -import org.scribble.editor.dsl.scribbleDsl.RoleInstantiation; -import org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage; - -/** - * - * An implementation of the model object 'Role Instantiation'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.RoleInstantiationImpl#getName Name}
  • - *
  • {@link org.scribble.editor.dsl.scribbleDsl.impl.RoleInstantiationImpl#getAlias Alias}
  • - *
- *

- * - * @generated - */ -public class RoleInstantiationImpl extends MinimalEObjectImpl.Container implements RoleInstantiation -{ - /** - * The default value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected String name = NAME_EDEFAULT; - - /** - * The default value of the '{@link #getAlias() Alias}' attribute. - * - * - * @see #getAlias() - * @generated - * @ordered - */ - protected static final String ALIAS_EDEFAULT = null; - - /** - * The cached value of the '{@link #getAlias() Alias}' attribute. - * - * - * @see #getAlias() - * @generated - * @ordered - */ - protected String alias = ALIAS_EDEFAULT; - - /** - * - * - * @generated - */ - protected RoleInstantiationImpl() - { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() - { - return ScribbleDslPackage.Literals.ROLE_INSTANTIATION; - } - - /** - * - * - * @generated - */ - public String getName() - { - return name; - } - - /** - * - * - * @generated - */ - public void setName(String newName) - { - String oldName = name; - name = newName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.ROLE_INSTANTIATION__NAME, oldName, name)); - } - - /** - * - * - * @generated - */ - public String getAlias() - { - return alias; - } - - /** - * - * - * @generated - */ - public void setAlias(String newAlias) - { - String oldAlias = alias; - alias = newAlias; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleDslPackage.ROLE_INSTANTIATION__ALIAS, oldAlias, alias)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ScribbleDslPackage.ROLE_INSTANTIATION__NAME: - return getName(); - case ScribbleDslPackage.ROLE_INSTANTIATION__ALIAS: - return getAlias(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ScribbleDslPackage.ROLE_INSTANTIATION__NAME: - setName((String)newValue); - return; - case ScribbleDslPackage.ROLE_INSTANTIATION__ALIAS: - setAlias((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.ROLE_INSTANTIATION__NAME: - setName(NAME_EDEFAULT); - return; - case ScribbleDslPackage.ROLE_INSTANTIATION__ALIAS: - setAlias(ALIAS_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ScribbleDslPackage.ROLE_INSTANTIATION__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case ScribbleDslPackage.ROLE_INSTANTIATION__ALIAS: - return ALIAS_EDEFAULT == null ? alias != null : !ALIAS_EDEFAULT.equals(alias); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (name: "); - result.append(name); - result.append(", alias: "); - result.append(alias); - result.append(')'); - return result.toString(); - } - -} //RoleInstantiationImpl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/ScribbleDslFactoryImpl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/ScribbleDslFactoryImpl.java deleted file mode 100644 index 81e092746..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/ScribbleDslFactoryImpl.java +++ /dev/null @@ -1,526 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl.impl; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; - -import org.eclipse.emf.ecore.impl.EFactoryImpl; - -import org.eclipse.emf.ecore.plugin.EcorePlugin; - -import org.scribble.editor.dsl.scribbleDsl.*; - -/** - * - * An implementation of the model Factory. - * - * @generated - */ -public class ScribbleDslFactoryImpl extends EFactoryImpl implements ScribbleDslFactory -{ - /** - * Creates the default factory implementation. - * - * - * @generated - */ - public static ScribbleDslFactory init() - { - try - { - ScribbleDslFactory theScribbleDslFactory = (ScribbleDslFactory)EPackage.Registry.INSTANCE.getEFactory(ScribbleDslPackage.eNS_URI); - if (theScribbleDslFactory != null) - { - return theScribbleDslFactory; - } - } - catch (Exception exception) - { - EcorePlugin.INSTANCE.log(exception); - } - return new ScribbleDslFactoryImpl(); - } - - /** - * Creates an instance of the factory. - * - * - * @generated - */ - public ScribbleDslFactoryImpl() - { - super(); - } - - /** - * - * - * @generated - */ - @Override - public EObject create(EClass eClass) - { - switch (eClass.getClassifierID()) - { - case ScribbleDslPackage.MODULE: return createModule(); - case ScribbleDslPackage.IMPORT_DECL: return createImportDecl(); - case ScribbleDslPackage.IMPORT_MODULE: return createImportModule(); - case ScribbleDslPackage.IMPORT_MEMBER: return createImportMember(); - case ScribbleDslPackage.PAYLOAD_TYPE_DECL: return createPayloadTypeDecl(); - case ScribbleDslPackage.MESSAGE_SIGNATURE: return createMessageSignature(); - case ScribbleDslPackage.PAYLOAD_ELEMENT: return createPayloadElement(); - case ScribbleDslPackage.GLOBAL_PROTOCOL_DECL: return createGlobalProtocolDecl(); - case ScribbleDslPackage.ROLE_DECL: return createRoleDecl(); - case ScribbleDslPackage.PARAMETER_DECL: return createParameterDecl(); - case ScribbleDslPackage.ROLE_INSTANTIATION: return createRoleInstantiation(); - case ScribbleDslPackage.ARGUMENT: return createArgument(); - case ScribbleDslPackage.GLOBAL_PROTOCOL_BLOCK: return createGlobalProtocolBlock(); - case ScribbleDslPackage.GLOBAL_INTERACTION: return createGlobalInteraction(); - case ScribbleDslPackage.GLOBAL_MESSAGE_TRANSFER: return createGlobalMessageTransfer(); - case ScribbleDslPackage.MESSAGE: return createMessage(); - case ScribbleDslPackage.GLOBAL_CHOICE: return createGlobalChoice(); - case ScribbleDslPackage.GLOBAL_RECURSION: return createGlobalRecursion(); - case ScribbleDslPackage.GLOBAL_CONTINUE: return createGlobalContinue(); - case ScribbleDslPackage.GLOBAL_PARALLEL: return createGlobalParallel(); - case ScribbleDslPackage.GLOBAL_INTERRUPTIBLE: return createGlobalInterruptible(); - case ScribbleDslPackage.GLOBAL_INTERRUPT: return createGlobalInterrupt(); - case ScribbleDslPackage.GLOBAL_DO: return createGlobalDo(); - case ScribbleDslPackage.LOCAL_PROTOCOL_DECL: return createLocalProtocolDecl(); - case ScribbleDslPackage.LOCAL_PROTOCOL_BLOCK: return createLocalProtocolBlock(); - case ScribbleDslPackage.LLOBAL_INTERACTION: return createLlobalInteraction(); - case ScribbleDslPackage.LOCAL_SEND: return createLocalSend(); - case ScribbleDslPackage.LOCAL_RECEIVE: return createLocalReceive(); - case ScribbleDslPackage.LOCAL_CHOICE: return createLocalChoice(); - case ScribbleDslPackage.LOCAL_RECURSION: return createLocalRecursion(); - case ScribbleDslPackage.LOCAL_CONTINUE: return createLocalContinue(); - case ScribbleDslPackage.LOCAL_PARALLEL: return createLocalParallel(); - case ScribbleDslPackage.LOCAL_INTERRUPTIBLE: return createLocalInterruptible(); - case ScribbleDslPackage.LOCAL_THROW: return createLocalThrow(); - case ScribbleDslPackage.LOCAL_CATCH: return createLocalCatch(); - case ScribbleDslPackage.LOCAL_DO: return createLocalDo(); - default: - throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); - } - } - - /** - * - * - * @generated - */ - public Module createModule() - { - ModuleImpl module = new ModuleImpl(); - return module; - } - - /** - * - * - * @generated - */ - public ImportDecl createImportDecl() - { - ImportDeclImpl importDecl = new ImportDeclImpl(); - return importDecl; - } - - /** - * - * - * @generated - */ - public ImportModule createImportModule() - { - ImportModuleImpl importModule = new ImportModuleImpl(); - return importModule; - } - - /** - * - * - * @generated - */ - public ImportMember createImportMember() - { - ImportMemberImpl importMember = new ImportMemberImpl(); - return importMember; - } - - /** - * - * - * @generated - */ - public PayloadTypeDecl createPayloadTypeDecl() - { - PayloadTypeDeclImpl payloadTypeDecl = new PayloadTypeDeclImpl(); - return payloadTypeDecl; - } - - /** - * - * - * @generated - */ - public MessageSignature createMessageSignature() - { - MessageSignatureImpl messageSignature = new MessageSignatureImpl(); - return messageSignature; - } - - /** - * - * - * @generated - */ - public PayloadElement createPayloadElement() - { - PayloadElementImpl payloadElement = new PayloadElementImpl(); - return payloadElement; - } - - /** - * - * - * @generated - */ - public GlobalProtocolDecl createGlobalProtocolDecl() - { - GlobalProtocolDeclImpl globalProtocolDecl = new GlobalProtocolDeclImpl(); - return globalProtocolDecl; - } - - /** - * - * - * @generated - */ - public RoleDecl createRoleDecl() - { - RoleDeclImpl roleDecl = new RoleDeclImpl(); - return roleDecl; - } - - /** - * - * - * @generated - */ - public ParameterDecl createParameterDecl() - { - ParameterDeclImpl parameterDecl = new ParameterDeclImpl(); - return parameterDecl; - } - - /** - * - * - * @generated - */ - public RoleInstantiation createRoleInstantiation() - { - RoleInstantiationImpl roleInstantiation = new RoleInstantiationImpl(); - return roleInstantiation; - } - - /** - * - * - * @generated - */ - public Argument createArgument() - { - ArgumentImpl argument = new ArgumentImpl(); - return argument; - } - - /** - * - * - * @generated - */ - public GlobalProtocolBlock createGlobalProtocolBlock() - { - GlobalProtocolBlockImpl globalProtocolBlock = new GlobalProtocolBlockImpl(); - return globalProtocolBlock; - } - - /** - * - * - * @generated - */ - public GlobalInteraction createGlobalInteraction() - { - GlobalInteractionImpl globalInteraction = new GlobalInteractionImpl(); - return globalInteraction; - } - - /** - * - * - * @generated - */ - public GlobalMessageTransfer createGlobalMessageTransfer() - { - GlobalMessageTransferImpl globalMessageTransfer = new GlobalMessageTransferImpl(); - return globalMessageTransfer; - } - - /** - * - * - * @generated - */ - public Message createMessage() - { - MessageImpl message = new MessageImpl(); - return message; - } - - /** - * - * - * @generated - */ - public GlobalChoice createGlobalChoice() - { - GlobalChoiceImpl globalChoice = new GlobalChoiceImpl(); - return globalChoice; - } - - /** - * - * - * @generated - */ - public GlobalRecursion createGlobalRecursion() - { - GlobalRecursionImpl globalRecursion = new GlobalRecursionImpl(); - return globalRecursion; - } - - /** - * - * - * @generated - */ - public GlobalContinue createGlobalContinue() - { - GlobalContinueImpl globalContinue = new GlobalContinueImpl(); - return globalContinue; - } - - /** - * - * - * @generated - */ - public GlobalParallel createGlobalParallel() - { - GlobalParallelImpl globalParallel = new GlobalParallelImpl(); - return globalParallel; - } - - /** - * - * - * @generated - */ - public GlobalInterruptible createGlobalInterruptible() - { - GlobalInterruptibleImpl globalInterruptible = new GlobalInterruptibleImpl(); - return globalInterruptible; - } - - /** - * - * - * @generated - */ - public GlobalInterrupt createGlobalInterrupt() - { - GlobalInterruptImpl globalInterrupt = new GlobalInterruptImpl(); - return globalInterrupt; - } - - /** - * - * - * @generated - */ - public GlobalDo createGlobalDo() - { - GlobalDoImpl globalDo = new GlobalDoImpl(); - return globalDo; - } - - /** - * - * - * @generated - */ - public LocalProtocolDecl createLocalProtocolDecl() - { - LocalProtocolDeclImpl localProtocolDecl = new LocalProtocolDeclImpl(); - return localProtocolDecl; - } - - /** - * - * - * @generated - */ - public LocalProtocolBlock createLocalProtocolBlock() - { - LocalProtocolBlockImpl localProtocolBlock = new LocalProtocolBlockImpl(); - return localProtocolBlock; - } - - /** - * - * - * @generated - */ - public LlobalInteraction createLlobalInteraction() - { - LlobalInteractionImpl llobalInteraction = new LlobalInteractionImpl(); - return llobalInteraction; - } - - /** - * - * - * @generated - */ - public LocalSend createLocalSend() - { - LocalSendImpl localSend = new LocalSendImpl(); - return localSend; - } - - /** - * - * - * @generated - */ - public LocalReceive createLocalReceive() - { - LocalReceiveImpl localReceive = new LocalReceiveImpl(); - return localReceive; - } - - /** - * - * - * @generated - */ - public LocalChoice createLocalChoice() - { - LocalChoiceImpl localChoice = new LocalChoiceImpl(); - return localChoice; - } - - /** - * - * - * @generated - */ - public LocalRecursion createLocalRecursion() - { - LocalRecursionImpl localRecursion = new LocalRecursionImpl(); - return localRecursion; - } - - /** - * - * - * @generated - */ - public LocalContinue createLocalContinue() - { - LocalContinueImpl localContinue = new LocalContinueImpl(); - return localContinue; - } - - /** - * - * - * @generated - */ - public LocalParallel createLocalParallel() - { - LocalParallelImpl localParallel = new LocalParallelImpl(); - return localParallel; - } - - /** - * - * - * @generated - */ - public LocalInterruptible createLocalInterruptible() - { - LocalInterruptibleImpl localInterruptible = new LocalInterruptibleImpl(); - return localInterruptible; - } - - /** - * - * - * @generated - */ - public LocalThrow createLocalThrow() - { - LocalThrowImpl localThrow = new LocalThrowImpl(); - return localThrow; - } - - /** - * - * - * @generated - */ - public LocalCatch createLocalCatch() - { - LocalCatchImpl localCatch = new LocalCatchImpl(); - return localCatch; - } - - /** - * - * - * @generated - */ - public LocalDo createLocalDo() - { - LocalDoImpl localDo = new LocalDoImpl(); - return localDo; - } - - /** - * - * - * @generated - */ - public ScribbleDslPackage getScribbleDslPackage() - { - return (ScribbleDslPackage)getEPackage(); - } - - /** - * - * - * @deprecated - * @generated - */ - @Deprecated - public static ScribbleDslPackage getPackage() - { - return ScribbleDslPackage.eINSTANCE; - } - -} //ScribbleDslFactoryImpl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/ScribbleDslPackageImpl.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/ScribbleDslPackageImpl.java deleted file mode 100644 index a217ef273..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/impl/ScribbleDslPackageImpl.java +++ /dev/null @@ -1,1969 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl.impl; - -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; - -import org.eclipse.emf.ecore.impl.EPackageImpl; - -import org.scribble.editor.dsl.scribbleDsl.Argument; -import org.scribble.editor.dsl.scribbleDsl.GlobalChoice; -import org.scribble.editor.dsl.scribbleDsl.GlobalContinue; -import org.scribble.editor.dsl.scribbleDsl.GlobalDo; -import org.scribble.editor.dsl.scribbleDsl.GlobalInteraction; -import org.scribble.editor.dsl.scribbleDsl.GlobalInterrupt; -import org.scribble.editor.dsl.scribbleDsl.GlobalInterruptible; -import org.scribble.editor.dsl.scribbleDsl.GlobalMessageTransfer; -import org.scribble.editor.dsl.scribbleDsl.GlobalParallel; -import org.scribble.editor.dsl.scribbleDsl.GlobalProtocolBlock; -import org.scribble.editor.dsl.scribbleDsl.GlobalProtocolDecl; -import org.scribble.editor.dsl.scribbleDsl.GlobalRecursion; -import org.scribble.editor.dsl.scribbleDsl.ImportDecl; -import org.scribble.editor.dsl.scribbleDsl.ImportMember; -import org.scribble.editor.dsl.scribbleDsl.ImportModule; -import org.scribble.editor.dsl.scribbleDsl.LlobalInteraction; -import org.scribble.editor.dsl.scribbleDsl.LocalCatch; -import org.scribble.editor.dsl.scribbleDsl.LocalChoice; -import org.scribble.editor.dsl.scribbleDsl.LocalContinue; -import org.scribble.editor.dsl.scribbleDsl.LocalDo; -import org.scribble.editor.dsl.scribbleDsl.LocalInterruptible; -import org.scribble.editor.dsl.scribbleDsl.LocalParallel; -import org.scribble.editor.dsl.scribbleDsl.LocalProtocolBlock; -import org.scribble.editor.dsl.scribbleDsl.LocalProtocolDecl; -import org.scribble.editor.dsl.scribbleDsl.LocalReceive; -import org.scribble.editor.dsl.scribbleDsl.LocalRecursion; -import org.scribble.editor.dsl.scribbleDsl.LocalSend; -import org.scribble.editor.dsl.scribbleDsl.LocalThrow; -import org.scribble.editor.dsl.scribbleDsl.Message; -import org.scribble.editor.dsl.scribbleDsl.MessageSignature; -import org.scribble.editor.dsl.scribbleDsl.Module; -import org.scribble.editor.dsl.scribbleDsl.ParameterDecl; -import org.scribble.editor.dsl.scribbleDsl.PayloadElement; -import org.scribble.editor.dsl.scribbleDsl.PayloadTypeDecl; -import org.scribble.editor.dsl.scribbleDsl.RoleDecl; -import org.scribble.editor.dsl.scribbleDsl.RoleInstantiation; -import org.scribble.editor.dsl.scribbleDsl.ScribbleDslFactory; -import org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage; - -/** - * - * An implementation of the model Package. - * - * @generated - */ -public class ScribbleDslPackageImpl extends EPackageImpl implements ScribbleDslPackage -{ - /** - * - * - * @generated - */ - private EClass moduleEClass = null; - - /** - * - * - * @generated - */ - private EClass importDeclEClass = null; - - /** - * - * - * @generated - */ - private EClass importModuleEClass = null; - - /** - * - * - * @generated - */ - private EClass importMemberEClass = null; - - /** - * - * - * @generated - */ - private EClass payloadTypeDeclEClass = null; - - /** - * - * - * @generated - */ - private EClass messageSignatureEClass = null; - - /** - * - * - * @generated - */ - private EClass payloadElementEClass = null; - - /** - * - * - * @generated - */ - private EClass globalProtocolDeclEClass = null; - - /** - * - * - * @generated - */ - private EClass roleDeclEClass = null; - - /** - * - * - * @generated - */ - private EClass parameterDeclEClass = null; - - /** - * - * - * @generated - */ - private EClass roleInstantiationEClass = null; - - /** - * - * - * @generated - */ - private EClass argumentEClass = null; - - /** - * - * - * @generated - */ - private EClass globalProtocolBlockEClass = null; - - /** - * - * - * @generated - */ - private EClass globalInteractionEClass = null; - - /** - * - * - * @generated - */ - private EClass globalMessageTransferEClass = null; - - /** - * - * - * @generated - */ - private EClass messageEClass = null; - - /** - * - * - * @generated - */ - private EClass globalChoiceEClass = null; - - /** - * - * - * @generated - */ - private EClass globalRecursionEClass = null; - - /** - * - * - * @generated - */ - private EClass globalContinueEClass = null; - - /** - * - * - * @generated - */ - private EClass globalParallelEClass = null; - - /** - * - * - * @generated - */ - private EClass globalInterruptibleEClass = null; - - /** - * - * - * @generated - */ - private EClass globalInterruptEClass = null; - - /** - * - * - * @generated - */ - private EClass globalDoEClass = null; - - /** - * - * - * @generated - */ - private EClass localProtocolDeclEClass = null; - - /** - * - * - * @generated - */ - private EClass localProtocolBlockEClass = null; - - /** - * - * - * @generated - */ - private EClass llobalInteractionEClass = null; - - /** - * - * - * @generated - */ - private EClass localSendEClass = null; - - /** - * - * - * @generated - */ - private EClass localReceiveEClass = null; - - /** - * - * - * @generated - */ - private EClass localChoiceEClass = null; - - /** - * - * - * @generated - */ - private EClass localRecursionEClass = null; - - /** - * - * - * @generated - */ - private EClass localContinueEClass = null; - - /** - * - * - * @generated - */ - private EClass localParallelEClass = null; - - /** - * - * - * @generated - */ - private EClass localInterruptibleEClass = null; - - /** - * - * - * @generated - */ - private EClass localThrowEClass = null; - - /** - * - * - * @generated - */ - private EClass localCatchEClass = null; - - /** - * - * - * @generated - */ - private EClass localDoEClass = null; - - /** - * Creates an instance of the model Package, registered with - * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package - * package URI value. - *

Note: the correct way to create the package is via the static - * factory method {@link #init init()}, which also performs - * initialization of the package, or returns the registered package, - * if one already exists. - * - * - * @see org.eclipse.emf.ecore.EPackage.Registry - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage#eNS_URI - * @see #init() - * @generated - */ - private ScribbleDslPackageImpl() - { - super(eNS_URI, ScribbleDslFactory.eINSTANCE); - } - - /** - * - * - * @generated - */ - private static boolean isInited = false; - - /** - * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. - * - *

This method is used to initialize {@link ScribbleDslPackage#eINSTANCE} when that field is accessed. - * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. - * - * - * @see #eNS_URI - * @see #createPackageContents() - * @see #initializePackageContents() - * @generated - */ - public static ScribbleDslPackage init() - { - if (isInited) return (ScribbleDslPackage)EPackage.Registry.INSTANCE.getEPackage(ScribbleDslPackage.eNS_URI); - - // Obtain or create and register package - ScribbleDslPackageImpl theScribbleDslPackage = (ScribbleDslPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof ScribbleDslPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new ScribbleDslPackageImpl()); - - isInited = true; - - // Create package meta-data objects - theScribbleDslPackage.createPackageContents(); - - // Initialize created meta-data - theScribbleDslPackage.initializePackageContents(); - - // Mark meta-data to indicate it can't be changed - theScribbleDslPackage.freeze(); - - - // Update the registry and return the package - EPackage.Registry.INSTANCE.put(ScribbleDslPackage.eNS_URI, theScribbleDslPackage); - return theScribbleDslPackage; - } - - /** - * - * - * @generated - */ - public EClass getModule() - { - return moduleEClass; - } - - /** - * - * - * @generated - */ - public EAttribute getModule_Name() - { - return (EAttribute)moduleEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EReference getModule_Imports() - { - return (EReference)moduleEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public EReference getModule_Types() - { - return (EReference)moduleEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - public EReference getModule_Globals() - { - return (EReference)moduleEClass.getEStructuralFeatures().get(3); - } - - /** - * - * - * @generated - */ - public EReference getModule_Locals() - { - return (EReference)moduleEClass.getEStructuralFeatures().get(4); - } - - /** - * - * - * @generated - */ - public EClass getImportDecl() - { - return importDeclEClass; - } - - /** - * - * - * @generated - */ - public EAttribute getImportDecl_Name() - { - return (EAttribute)importDeclEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EAttribute getImportDecl_Alias() - { - return (EAttribute)importDeclEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public EClass getImportModule() - { - return importModuleEClass; - } - - /** - * - * - * @generated - */ - public EClass getImportMember() - { - return importMemberEClass; - } - - /** - * - * - * @generated - */ - public EAttribute getImportMember_Member() - { - return (EAttribute)importMemberEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EClass getPayloadTypeDecl() - { - return payloadTypeDeclEClass; - } - - /** - * - * - * @generated - */ - public EAttribute getPayloadTypeDecl_Schema() - { - return (EAttribute)payloadTypeDeclEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EAttribute getPayloadTypeDecl_Type() - { - return (EAttribute)payloadTypeDeclEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public EAttribute getPayloadTypeDecl_Location() - { - return (EAttribute)payloadTypeDeclEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - public EAttribute getPayloadTypeDecl_Alias() - { - return (EAttribute)payloadTypeDeclEClass.getEStructuralFeatures().get(3); - } - - /** - * - * - * @generated - */ - public EClass getMessageSignature() - { - return messageSignatureEClass; - } - - /** - * - * - * @generated - */ - public EAttribute getMessageSignature_Operator() - { - return (EAttribute)messageSignatureEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EReference getMessageSignature_Types() - { - return (EReference)messageSignatureEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public EClass getPayloadElement() - { - return payloadElementEClass; - } - - /** - * - * - * @generated - */ - public EAttribute getPayloadElement_Name() - { - return (EAttribute)payloadElementEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EAttribute getPayloadElement_Type() - { - return (EAttribute)payloadElementEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public EClass getGlobalProtocolDecl() - { - return globalProtocolDeclEClass; - } - - /** - * - * - * @generated - */ - public EAttribute getGlobalProtocolDecl_Name() - { - return (EAttribute)globalProtocolDeclEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EReference getGlobalProtocolDecl_Parameters() - { - return (EReference)globalProtocolDeclEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public EReference getGlobalProtocolDecl_Roles() - { - return (EReference)globalProtocolDeclEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - public EReference getGlobalProtocolDecl_Block() - { - return (EReference)globalProtocolDeclEClass.getEStructuralFeatures().get(3); - } - - /** - * - * - * @generated - */ - public EAttribute getGlobalProtocolDecl_Instantiates() - { - return (EAttribute)globalProtocolDeclEClass.getEStructuralFeatures().get(4); - } - - /** - * - * - * @generated - */ - public EReference getGlobalProtocolDecl_Arguments() - { - return (EReference)globalProtocolDeclEClass.getEStructuralFeatures().get(5); - } - - /** - * - * - * @generated - */ - public EReference getGlobalProtocolDecl_RoleInstantiations() - { - return (EReference)globalProtocolDeclEClass.getEStructuralFeatures().get(6); - } - - /** - * - * - * @generated - */ - public EClass getRoleDecl() - { - return roleDeclEClass; - } - - /** - * - * - * @generated - */ - public EAttribute getRoleDecl_Name() - { - return (EAttribute)roleDeclEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EAttribute getRoleDecl_Alias() - { - return (EAttribute)roleDeclEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public EClass getParameterDecl() - { - return parameterDeclEClass; - } - - /** - * - * - * @generated - */ - public EAttribute getParameterDecl_Name() - { - return (EAttribute)parameterDeclEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EAttribute getParameterDecl_Alias() - { - return (EAttribute)parameterDeclEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public EClass getRoleInstantiation() - { - return roleInstantiationEClass; - } - - /** - * - * - * @generated - */ - public EAttribute getRoleInstantiation_Name() - { - return (EAttribute)roleInstantiationEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EAttribute getRoleInstantiation_Alias() - { - return (EAttribute)roleInstantiationEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public EClass getArgument() - { - return argumentEClass; - } - - /** - * - * - * @generated - */ - public EReference getArgument_Signature() - { - return (EReference)argumentEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EAttribute getArgument_Alias() - { - return (EAttribute)argumentEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public EAttribute getArgument_Name() - { - return (EAttribute)argumentEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - public EClass getGlobalProtocolBlock() - { - return globalProtocolBlockEClass; - } - - /** - * - * - * @generated - */ - public EReference getGlobalProtocolBlock_Activities() - { - return (EReference)globalProtocolBlockEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EClass getGlobalInteraction() - { - return globalInteractionEClass; - } - - /** - * - * - * @generated - */ - public EClass getGlobalMessageTransfer() - { - return globalMessageTransferEClass; - } - - /** - * - * - * @generated - */ - public EReference getGlobalMessageTransfer_Message() - { - return (EReference)globalMessageTransferEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EAttribute getGlobalMessageTransfer_FromRole() - { - return (EAttribute)globalMessageTransferEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public EAttribute getGlobalMessageTransfer_ToRoles() - { - return (EAttribute)globalMessageTransferEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - public EClass getMessage() - { - return messageEClass; - } - - /** - * - * - * @generated - */ - public EReference getMessage_Signature() - { - return (EReference)messageEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EAttribute getMessage_Parameter() - { - return (EAttribute)messageEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public EClass getGlobalChoice() - { - return globalChoiceEClass; - } - - /** - * - * - * @generated - */ - public EAttribute getGlobalChoice_Role() - { - return (EAttribute)globalChoiceEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EReference getGlobalChoice_Blocks() - { - return (EReference)globalChoiceEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public EClass getGlobalRecursion() - { - return globalRecursionEClass; - } - - /** - * - * - * @generated - */ - public EAttribute getGlobalRecursion_Label() - { - return (EAttribute)globalRecursionEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EReference getGlobalRecursion_Block() - { - return (EReference)globalRecursionEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public EClass getGlobalContinue() - { - return globalContinueEClass; - } - - /** - * - * - * @generated - */ - public EAttribute getGlobalContinue_Label() - { - return (EAttribute)globalContinueEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EClass getGlobalParallel() - { - return globalParallelEClass; - } - - /** - * - * - * @generated - */ - public EReference getGlobalParallel_Blocks() - { - return (EReference)globalParallelEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EClass getGlobalInterruptible() - { - return globalInterruptibleEClass; - } - - /** - * - * - * @generated - */ - public EAttribute getGlobalInterruptible_Scope() - { - return (EAttribute)globalInterruptibleEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EReference getGlobalInterruptible_Block() - { - return (EReference)globalInterruptibleEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public EReference getGlobalInterruptible_Interrupts() - { - return (EReference)globalInterruptibleEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - public EClass getGlobalInterrupt() - { - return globalInterruptEClass; - } - - /** - * - * - * @generated - */ - public EReference getGlobalInterrupt_Messages() - { - return (EReference)globalInterruptEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EAttribute getGlobalInterrupt_Role() - { - return (EAttribute)globalInterruptEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public EClass getGlobalDo() - { - return globalDoEClass; - } - - /** - * - * - * @generated - */ - public EAttribute getGlobalDo_Scope() - { - return (EAttribute)globalDoEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EAttribute getGlobalDo_Member() - { - return (EAttribute)globalDoEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public EReference getGlobalDo_Arguments() - { - return (EReference)globalDoEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - public EReference getGlobalDo_Roles() - { - return (EReference)globalDoEClass.getEStructuralFeatures().get(3); - } - - /** - * - * - * @generated - */ - public EClass getLocalProtocolDecl() - { - return localProtocolDeclEClass; - } - - /** - * - * - * @generated - */ - public EAttribute getLocalProtocolDecl_Name() - { - return (EAttribute)localProtocolDeclEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EAttribute getLocalProtocolDecl_Role() - { - return (EAttribute)localProtocolDeclEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public EReference getLocalProtocolDecl_Parameters() - { - return (EReference)localProtocolDeclEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - public EReference getLocalProtocolDecl_Roles() - { - return (EReference)localProtocolDeclEClass.getEStructuralFeatures().get(3); - } - - /** - * - * - * @generated - */ - public EReference getLocalProtocolDecl_Block() - { - return (EReference)localProtocolDeclEClass.getEStructuralFeatures().get(4); - } - - /** - * - * - * @generated - */ - public EAttribute getLocalProtocolDecl_Instantiates() - { - return (EAttribute)localProtocolDeclEClass.getEStructuralFeatures().get(5); - } - - /** - * - * - * @generated - */ - public EReference getLocalProtocolDecl_Arguments() - { - return (EReference)localProtocolDeclEClass.getEStructuralFeatures().get(6); - } - - /** - * - * - * @generated - */ - public EReference getLocalProtocolDecl_RoleInstantiations() - { - return (EReference)localProtocolDeclEClass.getEStructuralFeatures().get(7); - } - - /** - * - * - * @generated - */ - public EClass getLocalProtocolBlock() - { - return localProtocolBlockEClass; - } - - /** - * - * - * @generated - */ - public EReference getLocalProtocolBlock_Activities() - { - return (EReference)localProtocolBlockEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EClass getLlobalInteraction() - { - return llobalInteractionEClass; - } - - /** - * - * - * @generated - */ - public EClass getLocalSend() - { - return localSendEClass; - } - - /** - * - * - * @generated - */ - public EReference getLocalSend_Message() - { - return (EReference)localSendEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EAttribute getLocalSend_ToRoles() - { - return (EAttribute)localSendEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public EClass getLocalReceive() - { - return localReceiveEClass; - } - - /** - * - * - * @generated - */ - public EReference getLocalReceive_Message() - { - return (EReference)localReceiveEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EAttribute getLocalReceive_FromRole() - { - return (EAttribute)localReceiveEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public EClass getLocalChoice() - { - return localChoiceEClass; - } - - /** - * - * - * @generated - */ - public EAttribute getLocalChoice_Role() - { - return (EAttribute)localChoiceEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EReference getLocalChoice_Blocks() - { - return (EReference)localChoiceEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public EClass getLocalRecursion() - { - return localRecursionEClass; - } - - /** - * - * - * @generated - */ - public EAttribute getLocalRecursion_Label() - { - return (EAttribute)localRecursionEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EReference getLocalRecursion_Block() - { - return (EReference)localRecursionEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public EClass getLocalContinue() - { - return localContinueEClass; - } - - /** - * - * - * @generated - */ - public EAttribute getLocalContinue_Label() - { - return (EAttribute)localContinueEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EClass getLocalParallel() - { - return localParallelEClass; - } - - /** - * - * - * @generated - */ - public EReference getLocalParallel_Blocks() - { - return (EReference)localParallelEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EClass getLocalInterruptible() - { - return localInterruptibleEClass; - } - - /** - * - * - * @generated - */ - public EAttribute getLocalInterruptible_Scope() - { - return (EAttribute)localInterruptibleEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EReference getLocalInterruptible_Block() - { - return (EReference)localInterruptibleEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public EReference getLocalInterruptible_Throw() - { - return (EReference)localInterruptibleEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - public EReference getLocalInterruptible_Catches() - { - return (EReference)localInterruptibleEClass.getEStructuralFeatures().get(3); - } - - /** - * - * - * @generated - */ - public EClass getLocalThrow() - { - return localThrowEClass; - } - - /** - * - * - * @generated - */ - public EReference getLocalThrow_Messages() - { - return (EReference)localThrowEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EAttribute getLocalThrow_ToRoles() - { - return (EAttribute)localThrowEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public EClass getLocalCatch() - { - return localCatchEClass; - } - - /** - * - * - * @generated - */ - public EReference getLocalCatch_Messages() - { - return (EReference)localCatchEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EAttribute getLocalCatch_FromRole() - { - return (EAttribute)localCatchEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public EClass getLocalDo() - { - return localDoEClass; - } - - /** - * - * - * @generated - */ - public EAttribute getLocalDo_Scope() - { - return (EAttribute)localDoEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EAttribute getLocalDo_Member() - { - return (EAttribute)localDoEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public EReference getLocalDo_Arguments() - { - return (EReference)localDoEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - public EReference getLocalDo_Roles() - { - return (EReference)localDoEClass.getEStructuralFeatures().get(3); - } - - /** - * - * - * @generated - */ - public ScribbleDslFactory getScribbleDslFactory() - { - return (ScribbleDslFactory)getEFactoryInstance(); - } - - /** - * - * - * @generated - */ - private boolean isCreated = false; - - /** - * Creates the meta-model objects for the package. This method is - * guarded to have no affect on any invocation but its first. - * - * - * @generated - */ - public void createPackageContents() - { - if (isCreated) return; - isCreated = true; - - // Create classes and their features - moduleEClass = createEClass(MODULE); - createEAttribute(moduleEClass, MODULE__NAME); - createEReference(moduleEClass, MODULE__IMPORTS); - createEReference(moduleEClass, MODULE__TYPES); - createEReference(moduleEClass, MODULE__GLOBALS); - createEReference(moduleEClass, MODULE__LOCALS); - - importDeclEClass = createEClass(IMPORT_DECL); - createEAttribute(importDeclEClass, IMPORT_DECL__NAME); - createEAttribute(importDeclEClass, IMPORT_DECL__ALIAS); - - importModuleEClass = createEClass(IMPORT_MODULE); - - importMemberEClass = createEClass(IMPORT_MEMBER); - createEAttribute(importMemberEClass, IMPORT_MEMBER__MEMBER); - - payloadTypeDeclEClass = createEClass(PAYLOAD_TYPE_DECL); - createEAttribute(payloadTypeDeclEClass, PAYLOAD_TYPE_DECL__SCHEMA); - createEAttribute(payloadTypeDeclEClass, PAYLOAD_TYPE_DECL__TYPE); - createEAttribute(payloadTypeDeclEClass, PAYLOAD_TYPE_DECL__LOCATION); - createEAttribute(payloadTypeDeclEClass, PAYLOAD_TYPE_DECL__ALIAS); - - messageSignatureEClass = createEClass(MESSAGE_SIGNATURE); - createEAttribute(messageSignatureEClass, MESSAGE_SIGNATURE__OPERATOR); - createEReference(messageSignatureEClass, MESSAGE_SIGNATURE__TYPES); - - payloadElementEClass = createEClass(PAYLOAD_ELEMENT); - createEAttribute(payloadElementEClass, PAYLOAD_ELEMENT__NAME); - createEAttribute(payloadElementEClass, PAYLOAD_ELEMENT__TYPE); - - globalProtocolDeclEClass = createEClass(GLOBAL_PROTOCOL_DECL); - createEAttribute(globalProtocolDeclEClass, GLOBAL_PROTOCOL_DECL__NAME); - createEReference(globalProtocolDeclEClass, GLOBAL_PROTOCOL_DECL__PARAMETERS); - createEReference(globalProtocolDeclEClass, GLOBAL_PROTOCOL_DECL__ROLES); - createEReference(globalProtocolDeclEClass, GLOBAL_PROTOCOL_DECL__BLOCK); - createEAttribute(globalProtocolDeclEClass, GLOBAL_PROTOCOL_DECL__INSTANTIATES); - createEReference(globalProtocolDeclEClass, GLOBAL_PROTOCOL_DECL__ARGUMENTS); - createEReference(globalProtocolDeclEClass, GLOBAL_PROTOCOL_DECL__ROLE_INSTANTIATIONS); - - roleDeclEClass = createEClass(ROLE_DECL); - createEAttribute(roleDeclEClass, ROLE_DECL__NAME); - createEAttribute(roleDeclEClass, ROLE_DECL__ALIAS); - - parameterDeclEClass = createEClass(PARAMETER_DECL); - createEAttribute(parameterDeclEClass, PARAMETER_DECL__NAME); - createEAttribute(parameterDeclEClass, PARAMETER_DECL__ALIAS); - - roleInstantiationEClass = createEClass(ROLE_INSTANTIATION); - createEAttribute(roleInstantiationEClass, ROLE_INSTANTIATION__NAME); - createEAttribute(roleInstantiationEClass, ROLE_INSTANTIATION__ALIAS); - - argumentEClass = createEClass(ARGUMENT); - createEReference(argumentEClass, ARGUMENT__SIGNATURE); - createEAttribute(argumentEClass, ARGUMENT__ALIAS); - createEAttribute(argumentEClass, ARGUMENT__NAME); - - globalProtocolBlockEClass = createEClass(GLOBAL_PROTOCOL_BLOCK); - createEReference(globalProtocolBlockEClass, GLOBAL_PROTOCOL_BLOCK__ACTIVITIES); - - globalInteractionEClass = createEClass(GLOBAL_INTERACTION); - - globalMessageTransferEClass = createEClass(GLOBAL_MESSAGE_TRANSFER); - createEReference(globalMessageTransferEClass, GLOBAL_MESSAGE_TRANSFER__MESSAGE); - createEAttribute(globalMessageTransferEClass, GLOBAL_MESSAGE_TRANSFER__FROM_ROLE); - createEAttribute(globalMessageTransferEClass, GLOBAL_MESSAGE_TRANSFER__TO_ROLES); - - messageEClass = createEClass(MESSAGE); - createEReference(messageEClass, MESSAGE__SIGNATURE); - createEAttribute(messageEClass, MESSAGE__PARAMETER); - - globalChoiceEClass = createEClass(GLOBAL_CHOICE); - createEAttribute(globalChoiceEClass, GLOBAL_CHOICE__ROLE); - createEReference(globalChoiceEClass, GLOBAL_CHOICE__BLOCKS); - - globalRecursionEClass = createEClass(GLOBAL_RECURSION); - createEAttribute(globalRecursionEClass, GLOBAL_RECURSION__LABEL); - createEReference(globalRecursionEClass, GLOBAL_RECURSION__BLOCK); - - globalContinueEClass = createEClass(GLOBAL_CONTINUE); - createEAttribute(globalContinueEClass, GLOBAL_CONTINUE__LABEL); - - globalParallelEClass = createEClass(GLOBAL_PARALLEL); - createEReference(globalParallelEClass, GLOBAL_PARALLEL__BLOCKS); - - globalInterruptibleEClass = createEClass(GLOBAL_INTERRUPTIBLE); - createEAttribute(globalInterruptibleEClass, GLOBAL_INTERRUPTIBLE__SCOPE); - createEReference(globalInterruptibleEClass, GLOBAL_INTERRUPTIBLE__BLOCK); - createEReference(globalInterruptibleEClass, GLOBAL_INTERRUPTIBLE__INTERRUPTS); - - globalInterruptEClass = createEClass(GLOBAL_INTERRUPT); - createEReference(globalInterruptEClass, GLOBAL_INTERRUPT__MESSAGES); - createEAttribute(globalInterruptEClass, GLOBAL_INTERRUPT__ROLE); - - globalDoEClass = createEClass(GLOBAL_DO); - createEAttribute(globalDoEClass, GLOBAL_DO__SCOPE); - createEAttribute(globalDoEClass, GLOBAL_DO__MEMBER); - createEReference(globalDoEClass, GLOBAL_DO__ARGUMENTS); - createEReference(globalDoEClass, GLOBAL_DO__ROLES); - - localProtocolDeclEClass = createEClass(LOCAL_PROTOCOL_DECL); - createEAttribute(localProtocolDeclEClass, LOCAL_PROTOCOL_DECL__NAME); - createEAttribute(localProtocolDeclEClass, LOCAL_PROTOCOL_DECL__ROLE); - createEReference(localProtocolDeclEClass, LOCAL_PROTOCOL_DECL__PARAMETERS); - createEReference(localProtocolDeclEClass, LOCAL_PROTOCOL_DECL__ROLES); - createEReference(localProtocolDeclEClass, LOCAL_PROTOCOL_DECL__BLOCK); - createEAttribute(localProtocolDeclEClass, LOCAL_PROTOCOL_DECL__INSTANTIATES); - createEReference(localProtocolDeclEClass, LOCAL_PROTOCOL_DECL__ARGUMENTS); - createEReference(localProtocolDeclEClass, LOCAL_PROTOCOL_DECL__ROLE_INSTANTIATIONS); - - localProtocolBlockEClass = createEClass(LOCAL_PROTOCOL_BLOCK); - createEReference(localProtocolBlockEClass, LOCAL_PROTOCOL_BLOCK__ACTIVITIES); - - llobalInteractionEClass = createEClass(LLOBAL_INTERACTION); - - localSendEClass = createEClass(LOCAL_SEND); - createEReference(localSendEClass, LOCAL_SEND__MESSAGE); - createEAttribute(localSendEClass, LOCAL_SEND__TO_ROLES); - - localReceiveEClass = createEClass(LOCAL_RECEIVE); - createEReference(localReceiveEClass, LOCAL_RECEIVE__MESSAGE); - createEAttribute(localReceiveEClass, LOCAL_RECEIVE__FROM_ROLE); - - localChoiceEClass = createEClass(LOCAL_CHOICE); - createEAttribute(localChoiceEClass, LOCAL_CHOICE__ROLE); - createEReference(localChoiceEClass, LOCAL_CHOICE__BLOCKS); - - localRecursionEClass = createEClass(LOCAL_RECURSION); - createEAttribute(localRecursionEClass, LOCAL_RECURSION__LABEL); - createEReference(localRecursionEClass, LOCAL_RECURSION__BLOCK); - - localContinueEClass = createEClass(LOCAL_CONTINUE); - createEAttribute(localContinueEClass, LOCAL_CONTINUE__LABEL); - - localParallelEClass = createEClass(LOCAL_PARALLEL); - createEReference(localParallelEClass, LOCAL_PARALLEL__BLOCKS); - - localInterruptibleEClass = createEClass(LOCAL_INTERRUPTIBLE); - createEAttribute(localInterruptibleEClass, LOCAL_INTERRUPTIBLE__SCOPE); - createEReference(localInterruptibleEClass, LOCAL_INTERRUPTIBLE__BLOCK); - createEReference(localInterruptibleEClass, LOCAL_INTERRUPTIBLE__THROW); - createEReference(localInterruptibleEClass, LOCAL_INTERRUPTIBLE__CATCHES); - - localThrowEClass = createEClass(LOCAL_THROW); - createEReference(localThrowEClass, LOCAL_THROW__MESSAGES); - createEAttribute(localThrowEClass, LOCAL_THROW__TO_ROLES); - - localCatchEClass = createEClass(LOCAL_CATCH); - createEReference(localCatchEClass, LOCAL_CATCH__MESSAGES); - createEAttribute(localCatchEClass, LOCAL_CATCH__FROM_ROLE); - - localDoEClass = createEClass(LOCAL_DO); - createEAttribute(localDoEClass, LOCAL_DO__SCOPE); - createEAttribute(localDoEClass, LOCAL_DO__MEMBER); - createEReference(localDoEClass, LOCAL_DO__ARGUMENTS); - createEReference(localDoEClass, LOCAL_DO__ROLES); - } - - /** - * - * - * @generated - */ - private boolean isInitialized = false; - - /** - * Complete the initialization of the package and its meta-model. This - * method is guarded to have no affect on any invocation but its first. - * - * - * @generated - */ - public void initializePackageContents() - { - if (isInitialized) return; - isInitialized = true; - - // Initialize package - setName(eNAME); - setNsPrefix(eNS_PREFIX); - setNsURI(eNS_URI); - - // Create type parameters - - // Set bounds for type parameters - - // Add supertypes to classes - importModuleEClass.getESuperTypes().add(this.getImportDecl()); - importMemberEClass.getESuperTypes().add(this.getImportDecl()); - globalMessageTransferEClass.getESuperTypes().add(this.getGlobalInteraction()); - globalChoiceEClass.getESuperTypes().add(this.getGlobalInteraction()); - globalRecursionEClass.getESuperTypes().add(this.getGlobalInteraction()); - globalContinueEClass.getESuperTypes().add(this.getGlobalInteraction()); - globalParallelEClass.getESuperTypes().add(this.getGlobalInteraction()); - globalInterruptibleEClass.getESuperTypes().add(this.getGlobalInteraction()); - globalDoEClass.getESuperTypes().add(this.getGlobalInteraction()); - localSendEClass.getESuperTypes().add(this.getLlobalInteraction()); - localReceiveEClass.getESuperTypes().add(this.getLlobalInteraction()); - localChoiceEClass.getESuperTypes().add(this.getLlobalInteraction()); - localRecursionEClass.getESuperTypes().add(this.getLlobalInteraction()); - localContinueEClass.getESuperTypes().add(this.getLlobalInteraction()); - localParallelEClass.getESuperTypes().add(this.getLlobalInteraction()); - localInterruptibleEClass.getESuperTypes().add(this.getLlobalInteraction()); - localDoEClass.getESuperTypes().add(this.getLlobalInteraction()); - - // Initialize classes and features; add operations and parameters - initEClass(moduleEClass, Module.class, "Module", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getModule_Name(), ecorePackage.getEString(), "name", null, 0, 1, Module.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getModule_Imports(), this.getImportDecl(), null, "imports", null, 0, -1, Module.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getModule_Types(), this.getPayloadTypeDecl(), null, "types", null, 0, -1, Module.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getModule_Globals(), this.getGlobalProtocolDecl(), null, "globals", null, 0, -1, Module.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getModule_Locals(), this.getLocalProtocolDecl(), null, "locals", null, 0, -1, Module.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(importDeclEClass, ImportDecl.class, "ImportDecl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getImportDecl_Name(), ecorePackage.getEString(), "name", null, 0, 1, ImportDecl.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getImportDecl_Alias(), ecorePackage.getEString(), "alias", null, 0, 1, ImportDecl.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(importModuleEClass, ImportModule.class, "ImportModule", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - - initEClass(importMemberEClass, ImportMember.class, "ImportMember", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getImportMember_Member(), ecorePackage.getEString(), "member", null, 0, 1, ImportMember.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(payloadTypeDeclEClass, PayloadTypeDecl.class, "PayloadTypeDecl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getPayloadTypeDecl_Schema(), ecorePackage.getEString(), "schema", null, 0, 1, PayloadTypeDecl.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getPayloadTypeDecl_Type(), ecorePackage.getEString(), "type", null, 0, 1, PayloadTypeDecl.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getPayloadTypeDecl_Location(), ecorePackage.getEString(), "location", null, 0, 1, PayloadTypeDecl.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getPayloadTypeDecl_Alias(), ecorePackage.getEString(), "alias", null, 0, 1, PayloadTypeDecl.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(messageSignatureEClass, MessageSignature.class, "MessageSignature", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getMessageSignature_Operator(), ecorePackage.getEString(), "operator", null, 0, 1, MessageSignature.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getMessageSignature_Types(), this.getPayloadElement(), null, "types", null, 0, -1, MessageSignature.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(payloadElementEClass, PayloadElement.class, "PayloadElement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getPayloadElement_Name(), ecorePackage.getEString(), "name", null, 0, 1, PayloadElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getPayloadElement_Type(), ecorePackage.getEString(), "type", null, 0, 1, PayloadElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(globalProtocolDeclEClass, GlobalProtocolDecl.class, "GlobalProtocolDecl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getGlobalProtocolDecl_Name(), ecorePackage.getEString(), "name", null, 0, 1, GlobalProtocolDecl.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getGlobalProtocolDecl_Parameters(), this.getParameterDecl(), null, "parameters", null, 0, -1, GlobalProtocolDecl.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getGlobalProtocolDecl_Roles(), this.getRoleDecl(), null, "roles", null, 0, -1, GlobalProtocolDecl.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getGlobalProtocolDecl_Block(), this.getGlobalProtocolBlock(), null, "block", null, 0, 1, GlobalProtocolDecl.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getGlobalProtocolDecl_Instantiates(), ecorePackage.getEString(), "instantiates", null, 0, 1, GlobalProtocolDecl.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getGlobalProtocolDecl_Arguments(), this.getArgument(), null, "arguments", null, 0, -1, GlobalProtocolDecl.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getGlobalProtocolDecl_RoleInstantiations(), this.getRoleInstantiation(), null, "roleInstantiations", null, 0, -1, GlobalProtocolDecl.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(roleDeclEClass, RoleDecl.class, "RoleDecl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getRoleDecl_Name(), ecorePackage.getEString(), "name", null, 0, 1, RoleDecl.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getRoleDecl_Alias(), ecorePackage.getEString(), "alias", null, 0, 1, RoleDecl.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(parameterDeclEClass, ParameterDecl.class, "ParameterDecl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getParameterDecl_Name(), ecorePackage.getEString(), "name", null, 0, 1, ParameterDecl.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getParameterDecl_Alias(), ecorePackage.getEString(), "alias", null, 0, 1, ParameterDecl.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(roleInstantiationEClass, RoleInstantiation.class, "RoleInstantiation", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getRoleInstantiation_Name(), ecorePackage.getEString(), "name", null, 0, 1, RoleInstantiation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getRoleInstantiation_Alias(), ecorePackage.getEString(), "alias", null, 0, 1, RoleInstantiation.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(argumentEClass, Argument.class, "Argument", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getArgument_Signature(), this.getMessageSignature(), null, "signature", null, 0, 1, Argument.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getArgument_Alias(), ecorePackage.getEString(), "alias", null, 0, 1, Argument.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getArgument_Name(), ecorePackage.getEString(), "name", null, 0, 1, Argument.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(globalProtocolBlockEClass, GlobalProtocolBlock.class, "GlobalProtocolBlock", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getGlobalProtocolBlock_Activities(), this.getGlobalInteraction(), null, "activities", null, 0, -1, GlobalProtocolBlock.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(globalInteractionEClass, GlobalInteraction.class, "GlobalInteraction", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - - initEClass(globalMessageTransferEClass, GlobalMessageTransfer.class, "GlobalMessageTransfer", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getGlobalMessageTransfer_Message(), this.getMessage(), null, "message", null, 0, 1, GlobalMessageTransfer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getGlobalMessageTransfer_FromRole(), ecorePackage.getEString(), "fromRole", null, 0, 1, GlobalMessageTransfer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getGlobalMessageTransfer_ToRoles(), ecorePackage.getEString(), "toRoles", null, 0, -1, GlobalMessageTransfer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(messageEClass, Message.class, "Message", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getMessage_Signature(), this.getMessageSignature(), null, "signature", null, 0, 1, Message.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getMessage_Parameter(), ecorePackage.getEString(), "parameter", null, 0, 1, Message.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(globalChoiceEClass, GlobalChoice.class, "GlobalChoice", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getGlobalChoice_Role(), ecorePackage.getEString(), "role", null, 0, 1, GlobalChoice.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getGlobalChoice_Blocks(), this.getGlobalProtocolBlock(), null, "blocks", null, 0, -1, GlobalChoice.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(globalRecursionEClass, GlobalRecursion.class, "GlobalRecursion", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getGlobalRecursion_Label(), ecorePackage.getEString(), "label", null, 0, 1, GlobalRecursion.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getGlobalRecursion_Block(), this.getGlobalProtocolBlock(), null, "block", null, 0, 1, GlobalRecursion.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(globalContinueEClass, GlobalContinue.class, "GlobalContinue", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getGlobalContinue_Label(), ecorePackage.getEString(), "label", null, 0, 1, GlobalContinue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(globalParallelEClass, GlobalParallel.class, "GlobalParallel", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getGlobalParallel_Blocks(), this.getGlobalProtocolBlock(), null, "blocks", null, 0, -1, GlobalParallel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(globalInterruptibleEClass, GlobalInterruptible.class, "GlobalInterruptible", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getGlobalInterruptible_Scope(), ecorePackage.getEString(), "scope", null, 0, 1, GlobalInterruptible.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getGlobalInterruptible_Block(), this.getGlobalProtocolBlock(), null, "block", null, 0, 1, GlobalInterruptible.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getGlobalInterruptible_Interrupts(), this.getGlobalInterrupt(), null, "interrupts", null, 0, -1, GlobalInterruptible.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(globalInterruptEClass, GlobalInterrupt.class, "GlobalInterrupt", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getGlobalInterrupt_Messages(), this.getMessage(), null, "messages", null, 0, -1, GlobalInterrupt.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getGlobalInterrupt_Role(), ecorePackage.getEString(), "role", null, 0, 1, GlobalInterrupt.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(globalDoEClass, GlobalDo.class, "GlobalDo", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getGlobalDo_Scope(), ecorePackage.getEString(), "scope", null, 0, 1, GlobalDo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getGlobalDo_Member(), ecorePackage.getEString(), "member", null, 0, 1, GlobalDo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getGlobalDo_Arguments(), this.getArgument(), null, "arguments", null, 0, -1, GlobalDo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getGlobalDo_Roles(), this.getRoleInstantiation(), null, "roles", null, 0, -1, GlobalDo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(localProtocolDeclEClass, LocalProtocolDecl.class, "LocalProtocolDecl", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getLocalProtocolDecl_Name(), ecorePackage.getEString(), "name", null, 0, 1, LocalProtocolDecl.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getLocalProtocolDecl_Role(), ecorePackage.getEString(), "role", null, 0, 1, LocalProtocolDecl.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getLocalProtocolDecl_Parameters(), this.getParameterDecl(), null, "parameters", null, 0, -1, LocalProtocolDecl.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getLocalProtocolDecl_Roles(), this.getRoleDecl(), null, "roles", null, 0, -1, LocalProtocolDecl.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getLocalProtocolDecl_Block(), this.getLocalProtocolBlock(), null, "block", null, 0, 1, LocalProtocolDecl.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getLocalProtocolDecl_Instantiates(), ecorePackage.getEString(), "instantiates", null, 0, 1, LocalProtocolDecl.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getLocalProtocolDecl_Arguments(), this.getArgument(), null, "arguments", null, 0, -1, LocalProtocolDecl.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getLocalProtocolDecl_RoleInstantiations(), this.getRoleInstantiation(), null, "roleInstantiations", null, 0, -1, LocalProtocolDecl.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(localProtocolBlockEClass, LocalProtocolBlock.class, "LocalProtocolBlock", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getLocalProtocolBlock_Activities(), this.getLlobalInteraction(), null, "activities", null, 0, -1, LocalProtocolBlock.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(llobalInteractionEClass, LlobalInteraction.class, "LlobalInteraction", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - - initEClass(localSendEClass, LocalSend.class, "LocalSend", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getLocalSend_Message(), this.getMessage(), null, "message", null, 0, 1, LocalSend.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getLocalSend_ToRoles(), ecorePackage.getEString(), "toRoles", null, 0, -1, LocalSend.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(localReceiveEClass, LocalReceive.class, "LocalReceive", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getLocalReceive_Message(), this.getMessage(), null, "message", null, 0, 1, LocalReceive.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getLocalReceive_FromRole(), ecorePackage.getEString(), "fromRole", null, 0, 1, LocalReceive.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(localChoiceEClass, LocalChoice.class, "LocalChoice", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getLocalChoice_Role(), ecorePackage.getEString(), "role", null, 0, 1, LocalChoice.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getLocalChoice_Blocks(), this.getLocalProtocolBlock(), null, "blocks", null, 0, -1, LocalChoice.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(localRecursionEClass, LocalRecursion.class, "LocalRecursion", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getLocalRecursion_Label(), ecorePackage.getEString(), "label", null, 0, 1, LocalRecursion.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getLocalRecursion_Block(), this.getLocalProtocolBlock(), null, "block", null, 0, 1, LocalRecursion.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(localContinueEClass, LocalContinue.class, "LocalContinue", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getLocalContinue_Label(), ecorePackage.getEString(), "label", null, 0, 1, LocalContinue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(localParallelEClass, LocalParallel.class, "LocalParallel", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getLocalParallel_Blocks(), this.getLocalProtocolBlock(), null, "blocks", null, 0, -1, LocalParallel.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(localInterruptibleEClass, LocalInterruptible.class, "LocalInterruptible", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getLocalInterruptible_Scope(), ecorePackage.getEString(), "scope", null, 0, 1, LocalInterruptible.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getLocalInterruptible_Block(), this.getLocalProtocolBlock(), null, "block", null, 0, 1, LocalInterruptible.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getLocalInterruptible_Throw(), this.getLocalThrow(), null, "throw", null, 0, 1, LocalInterruptible.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getLocalInterruptible_Catches(), this.getLocalCatch(), null, "catches", null, 0, -1, LocalInterruptible.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(localThrowEClass, LocalThrow.class, "LocalThrow", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getLocalThrow_Messages(), this.getMessage(), null, "messages", null, 0, -1, LocalThrow.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getLocalThrow_ToRoles(), ecorePackage.getEString(), "toRoles", null, 0, -1, LocalThrow.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(localCatchEClass, LocalCatch.class, "LocalCatch", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getLocalCatch_Messages(), this.getMessage(), null, "messages", null, 0, -1, LocalCatch.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getLocalCatch_FromRole(), ecorePackage.getEString(), "fromRole", null, 0, 1, LocalCatch.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(localDoEClass, LocalDo.class, "LocalDo", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getLocalDo_Scope(), ecorePackage.getEString(), "scope", null, 0, 1, LocalDo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getLocalDo_Member(), ecorePackage.getEString(), "member", null, 0, 1, LocalDo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getLocalDo_Arguments(), this.getArgument(), null, "arguments", null, 0, -1, LocalDo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getLocalDo_Roles(), this.getRoleInstantiation(), null, "roles", null, 0, -1, LocalDo.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - // Create resource - createResource(eNS_URI); - } - -} //ScribbleDslPackageImpl diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/util/ScribbleDslAdapterFactory.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/util/ScribbleDslAdapterFactory.java deleted file mode 100644 index eb6ca2788..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/util/ScribbleDslAdapterFactory.java +++ /dev/null @@ -1,832 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl.util; - -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notifier; - -import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; - -import org.eclipse.emf.ecore.EObject; - -import org.scribble.editor.dsl.scribbleDsl.*; - -/** - * - * The Adapter Factory for the model. - * It provides an adapter createXXX method for each class of the model. - * - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage - * @generated - */ -public class ScribbleDslAdapterFactory extends AdapterFactoryImpl -{ - /** - * The cached model package. - * - * - * @generated - */ - protected static ScribbleDslPackage modelPackage; - - /** - * Creates an instance of the adapter factory. - * - * - * @generated - */ - public ScribbleDslAdapterFactory() - { - if (modelPackage == null) - { - modelPackage = ScribbleDslPackage.eINSTANCE; - } - } - - /** - * Returns whether this factory is applicable for the type of the object. - * - * This implementation returns true if the object is either the model's package or is an instance object of the model. - * - * @return whether this factory is applicable for the type of the object. - * @generated - */ - @Override - public boolean isFactoryForType(Object object) - { - if (object == modelPackage) - { - return true; - } - if (object instanceof EObject) - { - return ((EObject)object).eClass().getEPackage() == modelPackage; - } - return false; - } - - /** - * The switch that delegates to the createXXX methods. - * - * - * @generated - */ - protected ScribbleDslSwitch modelSwitch = - new ScribbleDslSwitch() - { - @Override - public Adapter caseModule(Module object) - { - return createModuleAdapter(); - } - @Override - public Adapter caseImportDecl(ImportDecl object) - { - return createImportDeclAdapter(); - } - @Override - public Adapter caseImportModule(ImportModule object) - { - return createImportModuleAdapter(); - } - @Override - public Adapter caseImportMember(ImportMember object) - { - return createImportMemberAdapter(); - } - @Override - public Adapter casePayloadTypeDecl(PayloadTypeDecl object) - { - return createPayloadTypeDeclAdapter(); - } - @Override - public Adapter caseMessageSignature(MessageSignature object) - { - return createMessageSignatureAdapter(); - } - @Override - public Adapter casePayloadElement(PayloadElement object) - { - return createPayloadElementAdapter(); - } - @Override - public Adapter caseGlobalProtocolDecl(GlobalProtocolDecl object) - { - return createGlobalProtocolDeclAdapter(); - } - @Override - public Adapter caseRoleDecl(RoleDecl object) - { - return createRoleDeclAdapter(); - } - @Override - public Adapter caseParameterDecl(ParameterDecl object) - { - return createParameterDeclAdapter(); - } - @Override - public Adapter caseRoleInstantiation(RoleInstantiation object) - { - return createRoleInstantiationAdapter(); - } - @Override - public Adapter caseArgument(Argument object) - { - return createArgumentAdapter(); - } - @Override - public Adapter caseGlobalProtocolBlock(GlobalProtocolBlock object) - { - return createGlobalProtocolBlockAdapter(); - } - @Override - public Adapter caseGlobalInteraction(GlobalInteraction object) - { - return createGlobalInteractionAdapter(); - } - @Override - public Adapter caseGlobalMessageTransfer(GlobalMessageTransfer object) - { - return createGlobalMessageTransferAdapter(); - } - @Override - public Adapter caseMessage(Message object) - { - return createMessageAdapter(); - } - @Override - public Adapter caseGlobalChoice(GlobalChoice object) - { - return createGlobalChoiceAdapter(); - } - @Override - public Adapter caseGlobalRecursion(GlobalRecursion object) - { - return createGlobalRecursionAdapter(); - } - @Override - public Adapter caseGlobalContinue(GlobalContinue object) - { - return createGlobalContinueAdapter(); - } - @Override - public Adapter caseGlobalParallel(GlobalParallel object) - { - return createGlobalParallelAdapter(); - } - @Override - public Adapter caseGlobalInterruptible(GlobalInterruptible object) - { - return createGlobalInterruptibleAdapter(); - } - @Override - public Adapter caseGlobalInterrupt(GlobalInterrupt object) - { - return createGlobalInterruptAdapter(); - } - @Override - public Adapter caseGlobalDo(GlobalDo object) - { - return createGlobalDoAdapter(); - } - @Override - public Adapter caseLocalProtocolDecl(LocalProtocolDecl object) - { - return createLocalProtocolDeclAdapter(); - } - @Override - public Adapter caseLocalProtocolBlock(LocalProtocolBlock object) - { - return createLocalProtocolBlockAdapter(); - } - @Override - public Adapter caseLlobalInteraction(LlobalInteraction object) - { - return createLlobalInteractionAdapter(); - } - @Override - public Adapter caseLocalSend(LocalSend object) - { - return createLocalSendAdapter(); - } - @Override - public Adapter caseLocalReceive(LocalReceive object) - { - return createLocalReceiveAdapter(); - } - @Override - public Adapter caseLocalChoice(LocalChoice object) - { - return createLocalChoiceAdapter(); - } - @Override - public Adapter caseLocalRecursion(LocalRecursion object) - { - return createLocalRecursionAdapter(); - } - @Override - public Adapter caseLocalContinue(LocalContinue object) - { - return createLocalContinueAdapter(); - } - @Override - public Adapter caseLocalParallel(LocalParallel object) - { - return createLocalParallelAdapter(); - } - @Override - public Adapter caseLocalInterruptible(LocalInterruptible object) - { - return createLocalInterruptibleAdapter(); - } - @Override - public Adapter caseLocalThrow(LocalThrow object) - { - return createLocalThrowAdapter(); - } - @Override - public Adapter caseLocalCatch(LocalCatch object) - { - return createLocalCatchAdapter(); - } - @Override - public Adapter caseLocalDo(LocalDo object) - { - return createLocalDoAdapter(); - } - @Override - public Adapter defaultCase(EObject object) - { - return createEObjectAdapter(); - } - }; - - /** - * Creates an adapter for the target. - * - * - * @param target the object to adapt. - * @return the adapter for the target. - * @generated - */ - @Override - public Adapter createAdapter(Notifier target) - { - return modelSwitch.doSwitch((EObject)target); - } - - - /** - * Creates a new adapter for an object of class '{@link org.scribble.editor.dsl.scribbleDsl.Module Module}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.scribble.editor.dsl.scribbleDsl.Module - * @generated - */ - public Adapter createModuleAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.scribble.editor.dsl.scribbleDsl.ImportDecl Import Decl}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.scribble.editor.dsl.scribbleDsl.ImportDecl - * @generated - */ - public Adapter createImportDeclAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.scribble.editor.dsl.scribbleDsl.ImportModule Import Module}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.scribble.editor.dsl.scribbleDsl.ImportModule - * @generated - */ - public Adapter createImportModuleAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.scribble.editor.dsl.scribbleDsl.ImportMember Import Member}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.scribble.editor.dsl.scribbleDsl.ImportMember - * @generated - */ - public Adapter createImportMemberAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.scribble.editor.dsl.scribbleDsl.PayloadTypeDecl Payload Type Decl}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.scribble.editor.dsl.scribbleDsl.PayloadTypeDecl - * @generated - */ - public Adapter createPayloadTypeDeclAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.scribble.editor.dsl.scribbleDsl.MessageSignature Message Signature}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.scribble.editor.dsl.scribbleDsl.MessageSignature - * @generated - */ - public Adapter createMessageSignatureAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.scribble.editor.dsl.scribbleDsl.PayloadElement Payload Element}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.scribble.editor.dsl.scribbleDsl.PayloadElement - * @generated - */ - public Adapter createPayloadElementAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.scribble.editor.dsl.scribbleDsl.GlobalProtocolDecl Global Protocol Decl}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalProtocolDecl - * @generated - */ - public Adapter createGlobalProtocolDeclAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.scribble.editor.dsl.scribbleDsl.RoleDecl Role Decl}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.scribble.editor.dsl.scribbleDsl.RoleDecl - * @generated - */ - public Adapter createRoleDeclAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.scribble.editor.dsl.scribbleDsl.ParameterDecl Parameter Decl}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.scribble.editor.dsl.scribbleDsl.ParameterDecl - * @generated - */ - public Adapter createParameterDeclAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.scribble.editor.dsl.scribbleDsl.RoleInstantiation Role Instantiation}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.scribble.editor.dsl.scribbleDsl.RoleInstantiation - * @generated - */ - public Adapter createRoleInstantiationAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.scribble.editor.dsl.scribbleDsl.Argument Argument}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.scribble.editor.dsl.scribbleDsl.Argument - * @generated - */ - public Adapter createArgumentAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.scribble.editor.dsl.scribbleDsl.GlobalProtocolBlock Global Protocol Block}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalProtocolBlock - * @generated - */ - public Adapter createGlobalProtocolBlockAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.scribble.editor.dsl.scribbleDsl.GlobalInteraction Global Interaction}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalInteraction - * @generated - */ - public Adapter createGlobalInteractionAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.scribble.editor.dsl.scribbleDsl.GlobalMessageTransfer Global Message Transfer}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalMessageTransfer - * @generated - */ - public Adapter createGlobalMessageTransferAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.scribble.editor.dsl.scribbleDsl.Message Message}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.scribble.editor.dsl.scribbleDsl.Message - * @generated - */ - public Adapter createMessageAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.scribble.editor.dsl.scribbleDsl.GlobalChoice Global Choice}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalChoice - * @generated - */ - public Adapter createGlobalChoiceAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.scribble.editor.dsl.scribbleDsl.GlobalRecursion Global Recursion}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalRecursion - * @generated - */ - public Adapter createGlobalRecursionAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.scribble.editor.dsl.scribbleDsl.GlobalContinue Global Continue}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalContinue - * @generated - */ - public Adapter createGlobalContinueAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.scribble.editor.dsl.scribbleDsl.GlobalParallel Global Parallel}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalParallel - * @generated - */ - public Adapter createGlobalParallelAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.scribble.editor.dsl.scribbleDsl.GlobalInterruptible Global Interruptible}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalInterruptible - * @generated - */ - public Adapter createGlobalInterruptibleAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.scribble.editor.dsl.scribbleDsl.GlobalInterrupt Global Interrupt}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalInterrupt - * @generated - */ - public Adapter createGlobalInterruptAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.scribble.editor.dsl.scribbleDsl.GlobalDo Global Do}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.scribble.editor.dsl.scribbleDsl.GlobalDo - * @generated - */ - public Adapter createGlobalDoAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.scribble.editor.dsl.scribbleDsl.LocalProtocolDecl Local Protocol Decl}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.scribble.editor.dsl.scribbleDsl.LocalProtocolDecl - * @generated - */ - public Adapter createLocalProtocolDeclAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.scribble.editor.dsl.scribbleDsl.LocalProtocolBlock Local Protocol Block}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.scribble.editor.dsl.scribbleDsl.LocalProtocolBlock - * @generated - */ - public Adapter createLocalProtocolBlockAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.scribble.editor.dsl.scribbleDsl.LlobalInteraction Llobal Interaction}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.scribble.editor.dsl.scribbleDsl.LlobalInteraction - * @generated - */ - public Adapter createLlobalInteractionAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.scribble.editor.dsl.scribbleDsl.LocalSend Local Send}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.scribble.editor.dsl.scribbleDsl.LocalSend - * @generated - */ - public Adapter createLocalSendAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.scribble.editor.dsl.scribbleDsl.LocalReceive Local Receive}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.scribble.editor.dsl.scribbleDsl.LocalReceive - * @generated - */ - public Adapter createLocalReceiveAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.scribble.editor.dsl.scribbleDsl.LocalChoice Local Choice}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.scribble.editor.dsl.scribbleDsl.LocalChoice - * @generated - */ - public Adapter createLocalChoiceAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.scribble.editor.dsl.scribbleDsl.LocalRecursion Local Recursion}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.scribble.editor.dsl.scribbleDsl.LocalRecursion - * @generated - */ - public Adapter createLocalRecursionAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.scribble.editor.dsl.scribbleDsl.LocalContinue Local Continue}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.scribble.editor.dsl.scribbleDsl.LocalContinue - * @generated - */ - public Adapter createLocalContinueAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.scribble.editor.dsl.scribbleDsl.LocalParallel Local Parallel}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.scribble.editor.dsl.scribbleDsl.LocalParallel - * @generated - */ - public Adapter createLocalParallelAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.scribble.editor.dsl.scribbleDsl.LocalInterruptible Local Interruptible}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.scribble.editor.dsl.scribbleDsl.LocalInterruptible - * @generated - */ - public Adapter createLocalInterruptibleAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.scribble.editor.dsl.scribbleDsl.LocalThrow Local Throw}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.scribble.editor.dsl.scribbleDsl.LocalThrow - * @generated - */ - public Adapter createLocalThrowAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.scribble.editor.dsl.scribbleDsl.LocalCatch Local Catch}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.scribble.editor.dsl.scribbleDsl.LocalCatch - * @generated - */ - public Adapter createLocalCatchAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.scribble.editor.dsl.scribbleDsl.LocalDo Local Do}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.scribble.editor.dsl.scribbleDsl.LocalDo - * @generated - */ - public Adapter createLocalDoAdapter() - { - return null; - } - - /** - * Creates a new adapter for the default case. - * - * This default implementation returns null. - * - * @return the new adapter. - * @generated - */ - public Adapter createEObjectAdapter() - { - return null; - } - -} //ScribbleDslAdapterFactory diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/util/ScribbleDslSwitch.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/util/ScribbleDslSwitch.java deleted file mode 100644 index d3aca6856..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/scribbleDsl/util/ScribbleDslSwitch.java +++ /dev/null @@ -1,941 +0,0 @@ -/** - */ -package org.scribble.editor.dsl.scribbleDsl.util; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; - -import org.eclipse.emf.ecore.util.Switch; - -import org.scribble.editor.dsl.scribbleDsl.*; - -/** - * - * The Switch for the model's inheritance hierarchy. - * It supports the call {@link #doSwitch(EObject) doSwitch(object)} - * to invoke the caseXXX method for each class of the model, - * starting with the actual class of the object - * and proceeding up the inheritance hierarchy - * until a non-null result is returned, - * which is the result of the switch. - * - * @see org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage - * @generated - */ -public class ScribbleDslSwitch extends Switch -{ - /** - * The cached model package - * - * - * @generated - */ - protected static ScribbleDslPackage modelPackage; - - /** - * Creates an instance of the switch. - * - * - * @generated - */ - public ScribbleDslSwitch() - { - if (modelPackage == null) - { - modelPackage = ScribbleDslPackage.eINSTANCE; - } - } - - /** - * Checks whether this is a switch for the given package. - * - * - * @parameter ePackage the package in question. - * @return whether this is a switch for the given package. - * @generated - */ - @Override - protected boolean isSwitchFor(EPackage ePackage) - { - return ePackage == modelPackage; - } - - /** - * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. - * - * - * @return the first non-null result returned by a caseXXX call. - * @generated - */ - @Override - protected T doSwitch(int classifierID, EObject theEObject) - { - switch (classifierID) - { - case ScribbleDslPackage.MODULE: - { - Module module = (Module)theEObject; - T result = caseModule(module); - if (result == null) result = defaultCase(theEObject); - return result; - } - case ScribbleDslPackage.IMPORT_DECL: - { - ImportDecl importDecl = (ImportDecl)theEObject; - T result = caseImportDecl(importDecl); - if (result == null) result = defaultCase(theEObject); - return result; - } - case ScribbleDslPackage.IMPORT_MODULE: - { - ImportModule importModule = (ImportModule)theEObject; - T result = caseImportModule(importModule); - if (result == null) result = caseImportDecl(importModule); - if (result == null) result = defaultCase(theEObject); - return result; - } - case ScribbleDslPackage.IMPORT_MEMBER: - { - ImportMember importMember = (ImportMember)theEObject; - T result = caseImportMember(importMember); - if (result == null) result = caseImportDecl(importMember); - if (result == null) result = defaultCase(theEObject); - return result; - } - case ScribbleDslPackage.PAYLOAD_TYPE_DECL: - { - PayloadTypeDecl payloadTypeDecl = (PayloadTypeDecl)theEObject; - T result = casePayloadTypeDecl(payloadTypeDecl); - if (result == null) result = defaultCase(theEObject); - return result; - } - case ScribbleDslPackage.MESSAGE_SIGNATURE: - { - MessageSignature messageSignature = (MessageSignature)theEObject; - T result = caseMessageSignature(messageSignature); - if (result == null) result = defaultCase(theEObject); - return result; - } - case ScribbleDslPackage.PAYLOAD_ELEMENT: - { - PayloadElement payloadElement = (PayloadElement)theEObject; - T result = casePayloadElement(payloadElement); - if (result == null) result = defaultCase(theEObject); - return result; - } - case ScribbleDslPackage.GLOBAL_PROTOCOL_DECL: - { - GlobalProtocolDecl globalProtocolDecl = (GlobalProtocolDecl)theEObject; - T result = caseGlobalProtocolDecl(globalProtocolDecl); - if (result == null) result = defaultCase(theEObject); - return result; - } - case ScribbleDslPackage.ROLE_DECL: - { - RoleDecl roleDecl = (RoleDecl)theEObject; - T result = caseRoleDecl(roleDecl); - if (result == null) result = defaultCase(theEObject); - return result; - } - case ScribbleDslPackage.PARAMETER_DECL: - { - ParameterDecl parameterDecl = (ParameterDecl)theEObject; - T result = caseParameterDecl(parameterDecl); - if (result == null) result = defaultCase(theEObject); - return result; - } - case ScribbleDslPackage.ROLE_INSTANTIATION: - { - RoleInstantiation roleInstantiation = (RoleInstantiation)theEObject; - T result = caseRoleInstantiation(roleInstantiation); - if (result == null) result = defaultCase(theEObject); - return result; - } - case ScribbleDslPackage.ARGUMENT: - { - Argument argument = (Argument)theEObject; - T result = caseArgument(argument); - if (result == null) result = defaultCase(theEObject); - return result; - } - case ScribbleDslPackage.GLOBAL_PROTOCOL_BLOCK: - { - GlobalProtocolBlock globalProtocolBlock = (GlobalProtocolBlock)theEObject; - T result = caseGlobalProtocolBlock(globalProtocolBlock); - if (result == null) result = defaultCase(theEObject); - return result; - } - case ScribbleDslPackage.GLOBAL_INTERACTION: - { - GlobalInteraction globalInteraction = (GlobalInteraction)theEObject; - T result = caseGlobalInteraction(globalInteraction); - if (result == null) result = defaultCase(theEObject); - return result; - } - case ScribbleDslPackage.GLOBAL_MESSAGE_TRANSFER: - { - GlobalMessageTransfer globalMessageTransfer = (GlobalMessageTransfer)theEObject; - T result = caseGlobalMessageTransfer(globalMessageTransfer); - if (result == null) result = caseGlobalInteraction(globalMessageTransfer); - if (result == null) result = defaultCase(theEObject); - return result; - } - case ScribbleDslPackage.MESSAGE: - { - Message message = (Message)theEObject; - T result = caseMessage(message); - if (result == null) result = defaultCase(theEObject); - return result; - } - case ScribbleDslPackage.GLOBAL_CHOICE: - { - GlobalChoice globalChoice = (GlobalChoice)theEObject; - T result = caseGlobalChoice(globalChoice); - if (result == null) result = caseGlobalInteraction(globalChoice); - if (result == null) result = defaultCase(theEObject); - return result; - } - case ScribbleDslPackage.GLOBAL_RECURSION: - { - GlobalRecursion globalRecursion = (GlobalRecursion)theEObject; - T result = caseGlobalRecursion(globalRecursion); - if (result == null) result = caseGlobalInteraction(globalRecursion); - if (result == null) result = defaultCase(theEObject); - return result; - } - case ScribbleDslPackage.GLOBAL_CONTINUE: - { - GlobalContinue globalContinue = (GlobalContinue)theEObject; - T result = caseGlobalContinue(globalContinue); - if (result == null) result = caseGlobalInteraction(globalContinue); - if (result == null) result = defaultCase(theEObject); - return result; - } - case ScribbleDslPackage.GLOBAL_PARALLEL: - { - GlobalParallel globalParallel = (GlobalParallel)theEObject; - T result = caseGlobalParallel(globalParallel); - if (result == null) result = caseGlobalInteraction(globalParallel); - if (result == null) result = defaultCase(theEObject); - return result; - } - case ScribbleDslPackage.GLOBAL_INTERRUPTIBLE: - { - GlobalInterruptible globalInterruptible = (GlobalInterruptible)theEObject; - T result = caseGlobalInterruptible(globalInterruptible); - if (result == null) result = caseGlobalInteraction(globalInterruptible); - if (result == null) result = defaultCase(theEObject); - return result; - } - case ScribbleDslPackage.GLOBAL_INTERRUPT: - { - GlobalInterrupt globalInterrupt = (GlobalInterrupt)theEObject; - T result = caseGlobalInterrupt(globalInterrupt); - if (result == null) result = defaultCase(theEObject); - return result; - } - case ScribbleDslPackage.GLOBAL_DO: - { - GlobalDo globalDo = (GlobalDo)theEObject; - T result = caseGlobalDo(globalDo); - if (result == null) result = caseGlobalInteraction(globalDo); - if (result == null) result = defaultCase(theEObject); - return result; - } - case ScribbleDslPackage.LOCAL_PROTOCOL_DECL: - { - LocalProtocolDecl localProtocolDecl = (LocalProtocolDecl)theEObject; - T result = caseLocalProtocolDecl(localProtocolDecl); - if (result == null) result = defaultCase(theEObject); - return result; - } - case ScribbleDslPackage.LOCAL_PROTOCOL_BLOCK: - { - LocalProtocolBlock localProtocolBlock = (LocalProtocolBlock)theEObject; - T result = caseLocalProtocolBlock(localProtocolBlock); - if (result == null) result = defaultCase(theEObject); - return result; - } - case ScribbleDslPackage.LLOBAL_INTERACTION: - { - LlobalInteraction llobalInteraction = (LlobalInteraction)theEObject; - T result = caseLlobalInteraction(llobalInteraction); - if (result == null) result = defaultCase(theEObject); - return result; - } - case ScribbleDslPackage.LOCAL_SEND: - { - LocalSend localSend = (LocalSend)theEObject; - T result = caseLocalSend(localSend); - if (result == null) result = caseLlobalInteraction(localSend); - if (result == null) result = defaultCase(theEObject); - return result; - } - case ScribbleDslPackage.LOCAL_RECEIVE: - { - LocalReceive localReceive = (LocalReceive)theEObject; - T result = caseLocalReceive(localReceive); - if (result == null) result = caseLlobalInteraction(localReceive); - if (result == null) result = defaultCase(theEObject); - return result; - } - case ScribbleDslPackage.LOCAL_CHOICE: - { - LocalChoice localChoice = (LocalChoice)theEObject; - T result = caseLocalChoice(localChoice); - if (result == null) result = caseLlobalInteraction(localChoice); - if (result == null) result = defaultCase(theEObject); - return result; - } - case ScribbleDslPackage.LOCAL_RECURSION: - { - LocalRecursion localRecursion = (LocalRecursion)theEObject; - T result = caseLocalRecursion(localRecursion); - if (result == null) result = caseLlobalInteraction(localRecursion); - if (result == null) result = defaultCase(theEObject); - return result; - } - case ScribbleDslPackage.LOCAL_CONTINUE: - { - LocalContinue localContinue = (LocalContinue)theEObject; - T result = caseLocalContinue(localContinue); - if (result == null) result = caseLlobalInteraction(localContinue); - if (result == null) result = defaultCase(theEObject); - return result; - } - case ScribbleDslPackage.LOCAL_PARALLEL: - { - LocalParallel localParallel = (LocalParallel)theEObject; - T result = caseLocalParallel(localParallel); - if (result == null) result = caseLlobalInteraction(localParallel); - if (result == null) result = defaultCase(theEObject); - return result; - } - case ScribbleDslPackage.LOCAL_INTERRUPTIBLE: - { - LocalInterruptible localInterruptible = (LocalInterruptible)theEObject; - T result = caseLocalInterruptible(localInterruptible); - if (result == null) result = caseLlobalInteraction(localInterruptible); - if (result == null) result = defaultCase(theEObject); - return result; - } - case ScribbleDslPackage.LOCAL_THROW: - { - LocalThrow localThrow = (LocalThrow)theEObject; - T result = caseLocalThrow(localThrow); - if (result == null) result = defaultCase(theEObject); - return result; - } - case ScribbleDslPackage.LOCAL_CATCH: - { - LocalCatch localCatch = (LocalCatch)theEObject; - T result = caseLocalCatch(localCatch); - if (result == null) result = defaultCase(theEObject); - return result; - } - case ScribbleDslPackage.LOCAL_DO: - { - LocalDo localDo = (LocalDo)theEObject; - T result = caseLocalDo(localDo); - if (result == null) result = caseLlobalInteraction(localDo); - if (result == null) result = defaultCase(theEObject); - return result; - } - default: return defaultCase(theEObject); - } - } - - /** - * Returns the result of interpreting the object as an instance of 'Module'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Module'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseModule(Module object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Import Decl'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Import Decl'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseImportDecl(ImportDecl object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Import Module'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Import Module'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseImportModule(ImportModule object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Import Member'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Import Member'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseImportMember(ImportMember object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Payload Type Decl'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Payload Type Decl'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T casePayloadTypeDecl(PayloadTypeDecl object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Message Signature'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Message Signature'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseMessageSignature(MessageSignature object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Payload Element'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Payload Element'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T casePayloadElement(PayloadElement object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Global Protocol Decl'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Global Protocol Decl'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseGlobalProtocolDecl(GlobalProtocolDecl object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Role Decl'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Role Decl'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseRoleDecl(RoleDecl object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Parameter Decl'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Parameter Decl'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseParameterDecl(ParameterDecl object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Role Instantiation'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Role Instantiation'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseRoleInstantiation(RoleInstantiation object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Argument'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Argument'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseArgument(Argument object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Global Protocol Block'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Global Protocol Block'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseGlobalProtocolBlock(GlobalProtocolBlock object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Global Interaction'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Global Interaction'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseGlobalInteraction(GlobalInteraction object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Global Message Transfer'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Global Message Transfer'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseGlobalMessageTransfer(GlobalMessageTransfer object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Message'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Message'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseMessage(Message object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Global Choice'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Global Choice'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseGlobalChoice(GlobalChoice object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Global Recursion'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Global Recursion'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseGlobalRecursion(GlobalRecursion object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Global Continue'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Global Continue'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseGlobalContinue(GlobalContinue object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Global Parallel'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Global Parallel'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseGlobalParallel(GlobalParallel object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Global Interruptible'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Global Interruptible'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseGlobalInterruptible(GlobalInterruptible object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Global Interrupt'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Global Interrupt'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseGlobalInterrupt(GlobalInterrupt object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Global Do'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Global Do'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseGlobalDo(GlobalDo object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Local Protocol Decl'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Local Protocol Decl'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseLocalProtocolDecl(LocalProtocolDecl object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Local Protocol Block'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Local Protocol Block'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseLocalProtocolBlock(LocalProtocolBlock object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Llobal Interaction'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Llobal Interaction'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseLlobalInteraction(LlobalInteraction object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Local Send'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Local Send'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseLocalSend(LocalSend object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Local Receive'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Local Receive'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseLocalReceive(LocalReceive object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Local Choice'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Local Choice'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseLocalChoice(LocalChoice object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Local Recursion'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Local Recursion'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseLocalRecursion(LocalRecursion object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Local Continue'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Local Continue'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseLocalContinue(LocalContinue object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Local Parallel'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Local Parallel'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseLocalParallel(LocalParallel object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Local Interruptible'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Local Interruptible'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseLocalInterruptible(LocalInterruptible object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Local Throw'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Local Throw'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseLocalThrow(LocalThrow object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Local Catch'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Local Catch'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseLocalCatch(LocalCatch object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Local Do'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Local Do'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseLocalDo(LocalDo object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'EObject'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch, but this is the last case anyway. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'EObject'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) - * @generated - */ - @Override - public T defaultCase(EObject object) - { - return null; - } - -} //ScribbleDslSwitch diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/serializer/ScribbleDslSemanticSequencer.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/serializer/ScribbleDslSemanticSequencer.java deleted file mode 100644 index 8ce4ab6ae..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/serializer/ScribbleDslSemanticSequencer.java +++ /dev/null @@ -1,653 +0,0 @@ -package org.scribble.editor.dsl.serializer; - -import com.google.inject.Inject; -import com.google.inject.Provider; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.xtext.serializer.acceptor.ISemanticSequenceAcceptor; -import org.eclipse.xtext.serializer.acceptor.SequenceFeeder; -import org.eclipse.xtext.serializer.diagnostic.ISemanticSequencerDiagnosticProvider; -import org.eclipse.xtext.serializer.diagnostic.ISerializationDiagnostic.Acceptor; -import org.eclipse.xtext.serializer.sequencer.AbstractDelegatingSemanticSequencer; -import org.eclipse.xtext.serializer.sequencer.GenericSequencer; -import org.eclipse.xtext.serializer.sequencer.ISemanticNodeProvider.INodesForEObjectProvider; -import org.eclipse.xtext.serializer.sequencer.ISemanticSequencer; -import org.eclipse.xtext.serializer.sequencer.ITransientValueService; -import org.eclipse.xtext.serializer.sequencer.ITransientValueService.ValueTransient; -import org.scribble.editor.dsl.scribbleDsl.Argument; -import org.scribble.editor.dsl.scribbleDsl.GlobalChoice; -import org.scribble.editor.dsl.scribbleDsl.GlobalContinue; -import org.scribble.editor.dsl.scribbleDsl.GlobalDo; -import org.scribble.editor.dsl.scribbleDsl.GlobalInterrupt; -import org.scribble.editor.dsl.scribbleDsl.GlobalInterruptible; -import org.scribble.editor.dsl.scribbleDsl.GlobalMessageTransfer; -import org.scribble.editor.dsl.scribbleDsl.GlobalParallel; -import org.scribble.editor.dsl.scribbleDsl.GlobalProtocolBlock; -import org.scribble.editor.dsl.scribbleDsl.GlobalProtocolDecl; -import org.scribble.editor.dsl.scribbleDsl.GlobalRecursion; -import org.scribble.editor.dsl.scribbleDsl.ImportMember; -import org.scribble.editor.dsl.scribbleDsl.ImportModule; -import org.scribble.editor.dsl.scribbleDsl.LocalCatch; -import org.scribble.editor.dsl.scribbleDsl.LocalChoice; -import org.scribble.editor.dsl.scribbleDsl.LocalContinue; -import org.scribble.editor.dsl.scribbleDsl.LocalDo; -import org.scribble.editor.dsl.scribbleDsl.LocalInterruptible; -import org.scribble.editor.dsl.scribbleDsl.LocalParallel; -import org.scribble.editor.dsl.scribbleDsl.LocalProtocolBlock; -import org.scribble.editor.dsl.scribbleDsl.LocalProtocolDecl; -import org.scribble.editor.dsl.scribbleDsl.LocalReceive; -import org.scribble.editor.dsl.scribbleDsl.LocalRecursion; -import org.scribble.editor.dsl.scribbleDsl.LocalSend; -import org.scribble.editor.dsl.scribbleDsl.LocalThrow; -import org.scribble.editor.dsl.scribbleDsl.Message; -import org.scribble.editor.dsl.scribbleDsl.MessageSignature; -import org.scribble.editor.dsl.scribbleDsl.Module; -import org.scribble.editor.dsl.scribbleDsl.ParameterDecl; -import org.scribble.editor.dsl.scribbleDsl.PayloadElement; -import org.scribble.editor.dsl.scribbleDsl.PayloadTypeDecl; -import org.scribble.editor.dsl.scribbleDsl.RoleDecl; -import org.scribble.editor.dsl.scribbleDsl.RoleInstantiation; -import org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage; -import org.scribble.editor.dsl.services.ScribbleDslGrammarAccess; - -@SuppressWarnings("all") -public class ScribbleDslSemanticSequencer extends AbstractDelegatingSemanticSequencer { - - @Inject - private ScribbleDslGrammarAccess grammarAccess; - - public void createSequence(EObject context, EObject semanticObject) { - if(semanticObject.eClass().getEPackage() == ScribbleDslPackage.eINSTANCE) switch(semanticObject.eClass().getClassifierID()) { - case ScribbleDslPackage.ARGUMENT: - if(context == grammarAccess.getArgumentRule()) { - sequence_Argument(context, (Argument) semanticObject); - return; - } - else break; - case ScribbleDslPackage.GLOBAL_CHOICE: - if(context == grammarAccess.getGlobalChoiceRule() || - context == grammarAccess.getGlobalInteractionRule()) { - sequence_GlobalChoice(context, (GlobalChoice) semanticObject); - return; - } - else break; - case ScribbleDslPackage.GLOBAL_CONTINUE: - if(context == grammarAccess.getGlobalContinueRule() || - context == grammarAccess.getGlobalInteractionRule()) { - sequence_GlobalContinue(context, (GlobalContinue) semanticObject); - return; - } - else break; - case ScribbleDslPackage.GLOBAL_DO: - if(context == grammarAccess.getGlobalDoRule() || - context == grammarAccess.getGlobalInteractionRule()) { - sequence_GlobalDo(context, (GlobalDo) semanticObject); - return; - } - else break; - case ScribbleDslPackage.GLOBAL_INTERRUPT: - if(context == grammarAccess.getGlobalInterruptRule()) { - sequence_GlobalInterrupt(context, (GlobalInterrupt) semanticObject); - return; - } - else break; - case ScribbleDslPackage.GLOBAL_INTERRUPTIBLE: - if(context == grammarAccess.getGlobalInteractionRule() || - context == grammarAccess.getGlobalInterruptibleRule()) { - sequence_GlobalInterruptible(context, (GlobalInterruptible) semanticObject); - return; - } - else break; - case ScribbleDslPackage.GLOBAL_MESSAGE_TRANSFER: - if(context == grammarAccess.getGlobalInteractionRule() || - context == grammarAccess.getGlobalMessageTransferRule()) { - sequence_GlobalMessageTransfer(context, (GlobalMessageTransfer) semanticObject); - return; - } - else break; - case ScribbleDslPackage.GLOBAL_PARALLEL: - if(context == grammarAccess.getGlobalInteractionRule() || - context == grammarAccess.getGlobalParallelRule()) { - sequence_GlobalParallel(context, (GlobalParallel) semanticObject); - return; - } - else break; - case ScribbleDslPackage.GLOBAL_PROTOCOL_BLOCK: - if(context == grammarAccess.getGlobalProtocolBlockRule()) { - sequence_GlobalProtocolBlock(context, (GlobalProtocolBlock) semanticObject); - return; - } - else break; - case ScribbleDslPackage.GLOBAL_PROTOCOL_DECL: - if(context == grammarAccess.getGlobalProtocolDeclRule()) { - sequence_GlobalProtocolDecl(context, (GlobalProtocolDecl) semanticObject); - return; - } - else break; - case ScribbleDslPackage.GLOBAL_RECURSION: - if(context == grammarAccess.getGlobalInteractionRule() || - context == grammarAccess.getGlobalRecursionRule()) { - sequence_GlobalRecursion(context, (GlobalRecursion) semanticObject); - return; - } - else break; - case ScribbleDslPackage.IMPORT_MEMBER: - if(context == grammarAccess.getImportDeclRule() || - context == grammarAccess.getImportMemberRule()) { - sequence_ImportMember(context, (ImportMember) semanticObject); - return; - } - else break; - case ScribbleDslPackage.IMPORT_MODULE: - if(context == grammarAccess.getImportDeclRule() || - context == grammarAccess.getImportModuleRule()) { - sequence_ImportModule(context, (ImportModule) semanticObject); - return; - } - else break; - case ScribbleDslPackage.LOCAL_CATCH: - if(context == grammarAccess.getLocalCatchRule()) { - sequence_LocalCatch(context, (LocalCatch) semanticObject); - return; - } - else break; - case ScribbleDslPackage.LOCAL_CHOICE: - if(context == grammarAccess.getLlobalInteractionRule() || - context == grammarAccess.getLocalChoiceRule()) { - sequence_LocalChoice(context, (LocalChoice) semanticObject); - return; - } - else break; - case ScribbleDslPackage.LOCAL_CONTINUE: - if(context == grammarAccess.getLlobalInteractionRule() || - context == grammarAccess.getLocalContinueRule()) { - sequence_LocalContinue(context, (LocalContinue) semanticObject); - return; - } - else break; - case ScribbleDslPackage.LOCAL_DO: - if(context == grammarAccess.getLlobalInteractionRule() || - context == grammarAccess.getLocalDoRule()) { - sequence_LocalDo(context, (LocalDo) semanticObject); - return; - } - else break; - case ScribbleDslPackage.LOCAL_INTERRUPTIBLE: - if(context == grammarAccess.getLlobalInteractionRule() || - context == grammarAccess.getLocalInterruptibleRule()) { - sequence_LocalInterruptible(context, (LocalInterruptible) semanticObject); - return; - } - else break; - case ScribbleDslPackage.LOCAL_PARALLEL: - if(context == grammarAccess.getLlobalInteractionRule() || - context == grammarAccess.getLocalParallelRule()) { - sequence_LocalParallel(context, (LocalParallel) semanticObject); - return; - } - else break; - case ScribbleDslPackage.LOCAL_PROTOCOL_BLOCK: - if(context == grammarAccess.getLocalProtocolBlockRule()) { - sequence_LocalProtocolBlock(context, (LocalProtocolBlock) semanticObject); - return; - } - else break; - case ScribbleDslPackage.LOCAL_PROTOCOL_DECL: - if(context == grammarAccess.getLocalProtocolDeclRule()) { - sequence_LocalProtocolDecl(context, (LocalProtocolDecl) semanticObject); - return; - } - else break; - case ScribbleDslPackage.LOCAL_RECEIVE: - if(context == grammarAccess.getLlobalInteractionRule() || - context == grammarAccess.getLocalReceiveRule()) { - sequence_LocalReceive(context, (LocalReceive) semanticObject); - return; - } - else break; - case ScribbleDslPackage.LOCAL_RECURSION: - if(context == grammarAccess.getLlobalInteractionRule() || - context == grammarAccess.getLocalRecursionRule()) { - sequence_LocalRecursion(context, (LocalRecursion) semanticObject); - return; - } - else break; - case ScribbleDslPackage.LOCAL_SEND: - if(context == grammarAccess.getLlobalInteractionRule() || - context == grammarAccess.getLocalSendRule()) { - sequence_LocalSend(context, (LocalSend) semanticObject); - return; - } - else break; - case ScribbleDslPackage.LOCAL_THROW: - if(context == grammarAccess.getLocalThrowRule()) { - sequence_LocalThrow(context, (LocalThrow) semanticObject); - return; - } - else break; - case ScribbleDslPackage.MESSAGE: - if(context == grammarAccess.getMessageRule()) { - sequence_Message(context, (Message) semanticObject); - return; - } - else break; - case ScribbleDslPackage.MESSAGE_SIGNATURE: - if(context == grammarAccess.getMessageSignatureRule()) { - sequence_MessageSignature(context, (MessageSignature) semanticObject); - return; - } - else break; - case ScribbleDslPackage.MODULE: - if(context == grammarAccess.getModuleRule()) { - sequence_Module(context, (Module) semanticObject); - return; - } - else break; - case ScribbleDslPackage.PARAMETER_DECL: - if(context == grammarAccess.getParameterDeclRule()) { - sequence_ParameterDecl(context, (ParameterDecl) semanticObject); - return; - } - else break; - case ScribbleDslPackage.PAYLOAD_ELEMENT: - if(context == grammarAccess.getPayloadElementRule()) { - sequence_PayloadElement(context, (PayloadElement) semanticObject); - return; - } - else break; - case ScribbleDslPackage.PAYLOAD_TYPE_DECL: - if(context == grammarAccess.getPayloadTypeDeclRule()) { - sequence_PayloadTypeDecl(context, (PayloadTypeDecl) semanticObject); - return; - } - else break; - case ScribbleDslPackage.ROLE_DECL: - if(context == grammarAccess.getRoleDeclRule()) { - sequence_RoleDecl(context, (RoleDecl) semanticObject); - return; - } - else break; - case ScribbleDslPackage.ROLE_INSTANTIATION: - if(context == grammarAccess.getRoleInstantiationRule()) { - sequence_RoleInstantiation(context, (RoleInstantiation) semanticObject); - return; - } - else break; - } - if (errorAcceptor != null) errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context)); - } - - /** - * Constraint: - * ((signature=MessageSignature alias=ID?) | (name=ID alias=ID?)) - */ - protected void sequence_Argument(EObject context, Argument semanticObject) { - genericSequencer.createSequence(context, semanticObject); - } - - - /** - * Constraint: - * (role=ID blocks+=GlobalProtocolBlock blocks+=GlobalProtocolBlock*) - */ - protected void sequence_GlobalChoice(EObject context, GlobalChoice semanticObject) { - genericSequencer.createSequence(context, semanticObject); - } - - - /** - * Constraint: - * label=ID - */ - protected void sequence_GlobalContinue(EObject context, GlobalContinue semanticObject) { - if(errorAcceptor != null) { - if(transientValues.isValueTransient(semanticObject, ScribbleDslPackage.Literals.GLOBAL_CONTINUE__LABEL) == ValueTransient.YES) - errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, ScribbleDslPackage.Literals.GLOBAL_CONTINUE__LABEL)); - } - INodesForEObjectProvider nodes = createNodeProvider(semanticObject); - SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes); - feeder.accept(grammarAccess.getGlobalContinueAccess().getLabelIDTerminalRuleCall_1_0(), semanticObject.getLabel()); - feeder.finish(); - } - - - /** - * Constraint: - * (scope=ID? member=ID (arguments+=Argument arguments+=Argument*)? roles+=RoleInstantiation roles+=RoleInstantiation*) - */ - protected void sequence_GlobalDo(EObject context, GlobalDo semanticObject) { - genericSequencer.createSequence(context, semanticObject); - } - - - /** - * Constraint: - * (messages+=Message messages+=Message* role=ID) - */ - protected void sequence_GlobalInterrupt(EObject context, GlobalInterrupt semanticObject) { - genericSequencer.createSequence(context, semanticObject); - } - - - /** - * Constraint: - * (scope=ID? block=GlobalProtocolBlock interrupts+=GlobalInterrupt*) - */ - protected void sequence_GlobalInterruptible(EObject context, GlobalInterruptible semanticObject) { - genericSequencer.createSequence(context, semanticObject); - } - - - /** - * Constraint: - * (message=Message fromRole=ID toRoles+=ID toRoles+=ID*) - */ - protected void sequence_GlobalMessageTransfer(EObject context, GlobalMessageTransfer semanticObject) { - genericSequencer.createSequence(context, semanticObject); - } - - - /** - * Constraint: - * (blocks+=GlobalProtocolBlock blocks+=GlobalProtocolBlock*) - */ - protected void sequence_GlobalParallel(EObject context, GlobalParallel semanticObject) { - genericSequencer.createSequence(context, semanticObject); - } - - - /** - * Constraint: - * (activities+=GlobalInteraction*) - */ - protected void sequence_GlobalProtocolBlock(EObject context, GlobalProtocolBlock semanticObject) { - genericSequencer.createSequence(context, semanticObject); - } - - - /** - * Constraint: - * ( - * name=ID - * (parameters+=ParameterDecl parameters+=ParameterDecl*)? - * roles+=RoleDecl - * roles+=RoleDecl* - * ( - * block=GlobalProtocolBlock | - * (instantiates=ID (arguments+=Argument arguments+=Argument*)? roleInstantiations+=RoleInstantiation roleInstantiations+=RoleInstantiation*) - * ) - * ) - */ - protected void sequence_GlobalProtocolDecl(EObject context, GlobalProtocolDecl semanticObject) { - genericSequencer.createSequence(context, semanticObject); - } - - - /** - * Constraint: - * (label=ID block=GlobalProtocolBlock) - */ - protected void sequence_GlobalRecursion(EObject context, GlobalRecursion semanticObject) { - if(errorAcceptor != null) { - if(transientValues.isValueTransient(semanticObject, ScribbleDslPackage.Literals.GLOBAL_RECURSION__LABEL) == ValueTransient.YES) - errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, ScribbleDslPackage.Literals.GLOBAL_RECURSION__LABEL)); - if(transientValues.isValueTransient(semanticObject, ScribbleDslPackage.Literals.GLOBAL_RECURSION__BLOCK) == ValueTransient.YES) - errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, ScribbleDslPackage.Literals.GLOBAL_RECURSION__BLOCK)); - } - INodesForEObjectProvider nodes = createNodeProvider(semanticObject); - SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes); - feeder.accept(grammarAccess.getGlobalRecursionAccess().getLabelIDTerminalRuleCall_1_0(), semanticObject.getLabel()); - feeder.accept(grammarAccess.getGlobalRecursionAccess().getBlockGlobalProtocolBlockParserRuleCall_2_0(), semanticObject.getBlock()); - feeder.finish(); - } - - - /** - * Constraint: - * (name=ModuleName member=ID alias=ID?) - */ - protected void sequence_ImportMember(EObject context, ImportMember semanticObject) { - genericSequencer.createSequence(context, semanticObject); - } - - - /** - * Constraint: - * (name=ModuleName alias=ID?) - */ - protected void sequence_ImportModule(EObject context, ImportModule semanticObject) { - genericSequencer.createSequence(context, semanticObject); - } - - - /** - * Constraint: - * (messages+=Message messages+=Message* fromRole=ID) - */ - protected void sequence_LocalCatch(EObject context, LocalCatch semanticObject) { - genericSequencer.createSequence(context, semanticObject); - } - - - /** - * Constraint: - * (role=ID blocks+=LocalProtocolBlock blocks+=LocalProtocolBlock*) - */ - protected void sequence_LocalChoice(EObject context, LocalChoice semanticObject) { - genericSequencer.createSequence(context, semanticObject); - } - - - /** - * Constraint: - * label=ID - */ - protected void sequence_LocalContinue(EObject context, LocalContinue semanticObject) { - if(errorAcceptor != null) { - if(transientValues.isValueTransient(semanticObject, ScribbleDslPackage.Literals.LOCAL_CONTINUE__LABEL) == ValueTransient.YES) - errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, ScribbleDslPackage.Literals.LOCAL_CONTINUE__LABEL)); - } - INodesForEObjectProvider nodes = createNodeProvider(semanticObject); - SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes); - feeder.accept(grammarAccess.getLocalContinueAccess().getLabelIDTerminalRuleCall_1_0(), semanticObject.getLabel()); - feeder.finish(); - } - - - /** - * Constraint: - * (scope=ID? member=ID (arguments+=Argument arguments+=Argument*)? roles+=RoleInstantiation roles+=RoleInstantiation*) - */ - protected void sequence_LocalDo(EObject context, LocalDo semanticObject) { - genericSequencer.createSequence(context, semanticObject); - } - - - /** - * Constraint: - * (scope=ID? block=LocalProtocolBlock throw=LocalThrow? catches+=LocalCatch*) - */ - protected void sequence_LocalInterruptible(EObject context, LocalInterruptible semanticObject) { - genericSequencer.createSequence(context, semanticObject); - } - - - /** - * Constraint: - * (blocks+=LocalProtocolBlock blocks+=LocalProtocolBlock*) - */ - protected void sequence_LocalParallel(EObject context, LocalParallel semanticObject) { - genericSequencer.createSequence(context, semanticObject); - } - - - /** - * Constraint: - * (activities+=LlobalInteraction*) - */ - protected void sequence_LocalProtocolBlock(EObject context, LocalProtocolBlock semanticObject) { - genericSequencer.createSequence(context, semanticObject); - } - - - /** - * Constraint: - * ( - * name=ID - * role=ID - * (parameters+=ParameterDecl parameters+=ParameterDecl*)? - * roles+=RoleDecl - * roles+=RoleDecl* - * ( - * block=LocalProtocolBlock | - * (instantiates=ID (arguments+=Argument arguments+=Argument*)? roleInstantiations+=RoleInstantiation roleInstantiations+=RoleInstantiation*) - * ) - * ) - */ - protected void sequence_LocalProtocolDecl(EObject context, LocalProtocolDecl semanticObject) { - genericSequencer.createSequence(context, semanticObject); - } - - - /** - * Constraint: - * (message=Message fromRole=ID) - */ - protected void sequence_LocalReceive(EObject context, LocalReceive semanticObject) { - if(errorAcceptor != null) { - if(transientValues.isValueTransient(semanticObject, ScribbleDslPackage.Literals.LOCAL_RECEIVE__MESSAGE) == ValueTransient.YES) - errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, ScribbleDslPackage.Literals.LOCAL_RECEIVE__MESSAGE)); - if(transientValues.isValueTransient(semanticObject, ScribbleDslPackage.Literals.LOCAL_RECEIVE__FROM_ROLE) == ValueTransient.YES) - errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, ScribbleDslPackage.Literals.LOCAL_RECEIVE__FROM_ROLE)); - } - INodesForEObjectProvider nodes = createNodeProvider(semanticObject); - SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes); - feeder.accept(grammarAccess.getLocalReceiveAccess().getMessageMessageParserRuleCall_0_0(), semanticObject.getMessage()); - feeder.accept(grammarAccess.getLocalReceiveAccess().getFromRoleIDTerminalRuleCall_2_0(), semanticObject.getFromRole()); - feeder.finish(); - } - - - /** - * Constraint: - * (label=ID block=LocalProtocolBlock) - */ - protected void sequence_LocalRecursion(EObject context, LocalRecursion semanticObject) { - if(errorAcceptor != null) { - if(transientValues.isValueTransient(semanticObject, ScribbleDslPackage.Literals.LOCAL_RECURSION__LABEL) == ValueTransient.YES) - errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, ScribbleDslPackage.Literals.LOCAL_RECURSION__LABEL)); - if(transientValues.isValueTransient(semanticObject, ScribbleDslPackage.Literals.LOCAL_RECURSION__BLOCK) == ValueTransient.YES) - errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, ScribbleDslPackage.Literals.LOCAL_RECURSION__BLOCK)); - } - INodesForEObjectProvider nodes = createNodeProvider(semanticObject); - SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes); - feeder.accept(grammarAccess.getLocalRecursionAccess().getLabelIDTerminalRuleCall_1_0(), semanticObject.getLabel()); - feeder.accept(grammarAccess.getLocalRecursionAccess().getBlockLocalProtocolBlockParserRuleCall_2_0(), semanticObject.getBlock()); - feeder.finish(); - } - - - /** - * Constraint: - * (message=Message toRoles+=ID toRoles+=ID*) - */ - protected void sequence_LocalSend(EObject context, LocalSend semanticObject) { - genericSequencer.createSequence(context, semanticObject); - } - - - /** - * Constraint: - * (messages+=Message messages+=Message* toRoles+=ID toRoles+=ID*) - */ - protected void sequence_LocalThrow(EObject context, LocalThrow semanticObject) { - genericSequencer.createSequence(context, semanticObject); - } - - - /** - * Constraint: - * (operator=ID? (types+=PayloadElement types+=PayloadElement*)?) - */ - protected void sequence_MessageSignature(EObject context, MessageSignature semanticObject) { - genericSequencer.createSequence(context, semanticObject); - } - - - /** - * Constraint: - * (signature=MessageSignature | parameter=ID) - */ - protected void sequence_Message(EObject context, Message semanticObject) { - genericSequencer.createSequence(context, semanticObject); - } - - - /** - * Constraint: - * (name=ModuleName imports+=ImportDecl* types+=PayloadTypeDecl* (globals+=GlobalProtocolDecl | locals+=LocalProtocolDecl)*) - */ - protected void sequence_Module(EObject context, Module semanticObject) { - genericSequencer.createSequence(context, semanticObject); - } - - - /** - * Constraint: - * ((name=ID alias=ID?) | (name=ID alias=ID?)) - */ - protected void sequence_ParameterDecl(EObject context, ParameterDecl semanticObject) { - genericSequencer.createSequence(context, semanticObject); - } - - - /** - * Constraint: - * (name=ID? type=ID) - */ - protected void sequence_PayloadElement(EObject context, PayloadElement semanticObject) { - genericSequencer.createSequence(context, semanticObject); - } - - - /** - * Constraint: - * (schema=ID type=STRING location=STRING alias=ID) - */ - protected void sequence_PayloadTypeDecl(EObject context, PayloadTypeDecl semanticObject) { - if(errorAcceptor != null) { - if(transientValues.isValueTransient(semanticObject, ScribbleDslPackage.Literals.PAYLOAD_TYPE_DECL__SCHEMA) == ValueTransient.YES) - errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, ScribbleDslPackage.Literals.PAYLOAD_TYPE_DECL__SCHEMA)); - if(transientValues.isValueTransient(semanticObject, ScribbleDslPackage.Literals.PAYLOAD_TYPE_DECL__TYPE) == ValueTransient.YES) - errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, ScribbleDslPackage.Literals.PAYLOAD_TYPE_DECL__TYPE)); - if(transientValues.isValueTransient(semanticObject, ScribbleDslPackage.Literals.PAYLOAD_TYPE_DECL__LOCATION) == ValueTransient.YES) - errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, ScribbleDslPackage.Literals.PAYLOAD_TYPE_DECL__LOCATION)); - if(transientValues.isValueTransient(semanticObject, ScribbleDslPackage.Literals.PAYLOAD_TYPE_DECL__ALIAS) == ValueTransient.YES) - errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, ScribbleDslPackage.Literals.PAYLOAD_TYPE_DECL__ALIAS)); - } - INodesForEObjectProvider nodes = createNodeProvider(semanticObject); - SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes); - feeder.accept(grammarAccess.getPayloadTypeDeclAccess().getSchemaIDTerminalRuleCall_2_0(), semanticObject.getSchema()); - feeder.accept(grammarAccess.getPayloadTypeDeclAccess().getTypeSTRINGTerminalRuleCall_4_0(), semanticObject.getType()); - feeder.accept(grammarAccess.getPayloadTypeDeclAccess().getLocationSTRINGTerminalRuleCall_6_0(), semanticObject.getLocation()); - feeder.accept(grammarAccess.getPayloadTypeDeclAccess().getAliasIDTerminalRuleCall_8_0(), semanticObject.getAlias()); - feeder.finish(); - } - - - /** - * Constraint: - * (name=ID alias=ID?) - */ - protected void sequence_RoleDecl(EObject context, RoleDecl semanticObject) { - genericSequencer.createSequence(context, semanticObject); - } - - - /** - * Constraint: - * (name=ID alias=ID?) - */ - protected void sequence_RoleInstantiation(EObject context, RoleInstantiation semanticObject) { - genericSequencer.createSequence(context, semanticObject); - } -} diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/serializer/ScribbleDslSyntacticSequencer.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/serializer/ScribbleDslSyntacticSequencer.java deleted file mode 100644 index 2c4dcfef6..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/serializer/ScribbleDslSyntacticSequencer.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.scribble.editor.dsl.serializer; - -import com.google.inject.Inject; -import java.util.List; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.xtext.IGrammarAccess; -import org.eclipse.xtext.RuleCall; -import org.eclipse.xtext.nodemodel.INode; -import org.eclipse.xtext.serializer.analysis.GrammarAlias.AbstractElementAlias; -import org.eclipse.xtext.serializer.analysis.ISyntacticSequencerPDAProvider.ISynTransition; -import org.eclipse.xtext.serializer.sequencer.AbstractSyntacticSequencer; -import org.scribble.editor.dsl.services.ScribbleDslGrammarAccess; - -@SuppressWarnings("all") -public class ScribbleDslSyntacticSequencer extends AbstractSyntacticSequencer { - - protected ScribbleDslGrammarAccess grammarAccess; - - @Inject - protected void init(IGrammarAccess access) { - grammarAccess = (ScribbleDslGrammarAccess) access; - } - - @Override - protected String getUnassignedRuleCallToken(EObject semanticObject, RuleCall ruleCall, INode node) { - return ""; - } - - - @Override - protected void emitUnassignedTokens(EObject semanticObject, ISynTransition transition, INode fromNode, INode toNode) { - if (transition.getAmbiguousSyntaxes().isEmpty()) return; - List transitionNodes = collectNodes(fromNode, toNode); - for (AbstractElementAlias syntax : transition.getAmbiguousSyntaxes()) { - List syntaxNodes = getNodesFor(transitionNodes, syntax); - acceptNodes(getLastNavigableState(), syntaxNodes); - } - } - -} diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/services/ScribbleDslGrammarAccess.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/services/ScribbleDslGrammarAccess.java deleted file mode 100644 index 9b5cfdd48..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/services/ScribbleDslGrammarAccess.java +++ /dev/null @@ -1,2778 +0,0 @@ -/* -* generated by Xtext -*/ -package org.scribble.editor.dsl.services; - -import com.google.inject.Singleton; -import com.google.inject.Inject; - -import java.util.List; - -import org.eclipse.xtext.*; -import org.eclipse.xtext.service.GrammarProvider; -import org.eclipse.xtext.service.AbstractElementFinder.*; - -import org.eclipse.xtext.common.services.TerminalsGrammarAccess; - -@Singleton -public class ScribbleDslGrammarAccess extends AbstractGrammarElementFinder { - - - public class ModuleElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "Module"); - private final Group cGroup = (Group)rule.eContents().get(1); - private final Keyword cModuleKeyword_0 = (Keyword)cGroup.eContents().get(0); - private final Assignment cNameAssignment_1 = (Assignment)cGroup.eContents().get(1); - private final RuleCall cNameModuleNameParserRuleCall_1_0 = (RuleCall)cNameAssignment_1.eContents().get(0); - private final Keyword cSemicolonKeyword_2 = (Keyword)cGroup.eContents().get(2); - private final Assignment cImportsAssignment_3 = (Assignment)cGroup.eContents().get(3); - private final RuleCall cImportsImportDeclParserRuleCall_3_0 = (RuleCall)cImportsAssignment_3.eContents().get(0); - private final Assignment cTypesAssignment_4 = (Assignment)cGroup.eContents().get(4); - private final RuleCall cTypesPayloadTypeDeclParserRuleCall_4_0 = (RuleCall)cTypesAssignment_4.eContents().get(0); - private final Alternatives cAlternatives_5 = (Alternatives)cGroup.eContents().get(5); - private final Assignment cGlobalsAssignment_5_0 = (Assignment)cAlternatives_5.eContents().get(0); - private final RuleCall cGlobalsGlobalProtocolDeclParserRuleCall_5_0_0 = (RuleCall)cGlobalsAssignment_5_0.eContents().get(0); - private final Assignment cLocalsAssignment_5_1 = (Assignment)cAlternatives_5.eContents().get(1); - private final RuleCall cLocalsLocalProtocolDeclParserRuleCall_5_1_0 = (RuleCall)cLocalsAssignment_5_1.eContents().get(0); - - //Module: - // "module" name=ModuleName ";" imports+=ImportDecl* types+=PayloadTypeDecl* (globals+=GlobalProtocolDecl | - // locals+=LocalProtocolDecl)*; - public ParserRule getRule() { return rule; } - - //"module" name=ModuleName ";" imports+=ImportDecl* types+=PayloadTypeDecl* (globals+=GlobalProtocolDecl | - //locals+=LocalProtocolDecl)* - public Group getGroup() { return cGroup; } - - //"module" - public Keyword getModuleKeyword_0() { return cModuleKeyword_0; } - - //name=ModuleName - public Assignment getNameAssignment_1() { return cNameAssignment_1; } - - //ModuleName - public RuleCall getNameModuleNameParserRuleCall_1_0() { return cNameModuleNameParserRuleCall_1_0; } - - //";" - public Keyword getSemicolonKeyword_2() { return cSemicolonKeyword_2; } - - //imports+=ImportDecl* - public Assignment getImportsAssignment_3() { return cImportsAssignment_3; } - - //ImportDecl - public RuleCall getImportsImportDeclParserRuleCall_3_0() { return cImportsImportDeclParserRuleCall_3_0; } - - //types+=PayloadTypeDecl* - public Assignment getTypesAssignment_4() { return cTypesAssignment_4; } - - //PayloadTypeDecl - public RuleCall getTypesPayloadTypeDeclParserRuleCall_4_0() { return cTypesPayloadTypeDeclParserRuleCall_4_0; } - - //(globals+=GlobalProtocolDecl | locals+=LocalProtocolDecl)* - public Alternatives getAlternatives_5() { return cAlternatives_5; } - - //globals+=GlobalProtocolDecl - public Assignment getGlobalsAssignment_5_0() { return cGlobalsAssignment_5_0; } - - //GlobalProtocolDecl - public RuleCall getGlobalsGlobalProtocolDeclParserRuleCall_5_0_0() { return cGlobalsGlobalProtocolDeclParserRuleCall_5_0_0; } - - //locals+=LocalProtocolDecl - public Assignment getLocalsAssignment_5_1() { return cLocalsAssignment_5_1; } - - //LocalProtocolDecl - public RuleCall getLocalsLocalProtocolDeclParserRuleCall_5_1_0() { return cLocalsLocalProtocolDeclParserRuleCall_5_1_0; } - } - - public class ModuleNameElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "ModuleName"); - private final Group cGroup = (Group)rule.eContents().get(1); - private final RuleCall cIDTerminalRuleCall_0 = (RuleCall)cGroup.eContents().get(0); - private final Group cGroup_1 = (Group)cGroup.eContents().get(1); - private final Keyword cFullStopKeyword_1_0 = (Keyword)cGroup_1.eContents().get(0); - private final RuleCall cIDTerminalRuleCall_1_1 = (RuleCall)cGroup_1.eContents().get(1); - - //ModuleName: - // ID ("." ID)*; - public ParserRule getRule() { return rule; } - - //ID ("." ID)* - public Group getGroup() { return cGroup; } - - //ID - public RuleCall getIDTerminalRuleCall_0() { return cIDTerminalRuleCall_0; } - - //("." ID)* - public Group getGroup_1() { return cGroup_1; } - - //"." - public Keyword getFullStopKeyword_1_0() { return cFullStopKeyword_1_0; } - - //ID - public RuleCall getIDTerminalRuleCall_1_1() { return cIDTerminalRuleCall_1_1; } - } - - public class ImportDeclElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "ImportDecl"); - private final Alternatives cAlternatives = (Alternatives)rule.eContents().get(1); - private final RuleCall cImportModuleParserRuleCall_0 = (RuleCall)cAlternatives.eContents().get(0); - private final RuleCall cImportMemberParserRuleCall_1 = (RuleCall)cAlternatives.eContents().get(1); - - //ImportDecl: - // ImportModule | ImportMember; - public ParserRule getRule() { return rule; } - - //ImportModule | ImportMember - public Alternatives getAlternatives() { return cAlternatives; } - - //ImportModule - public RuleCall getImportModuleParserRuleCall_0() { return cImportModuleParserRuleCall_0; } - - //ImportMember - public RuleCall getImportMemberParserRuleCall_1() { return cImportMemberParserRuleCall_1; } - } - - public class ImportModuleElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "ImportModule"); - private final Group cGroup = (Group)rule.eContents().get(1); - private final Keyword cImportKeyword_0 = (Keyword)cGroup.eContents().get(0); - private final Assignment cNameAssignment_1 = (Assignment)cGroup.eContents().get(1); - private final RuleCall cNameModuleNameParserRuleCall_1_0 = (RuleCall)cNameAssignment_1.eContents().get(0); - private final Group cGroup_2 = (Group)cGroup.eContents().get(2); - private final Keyword cAsKeyword_2_0 = (Keyword)cGroup_2.eContents().get(0); - private final Assignment cAliasAssignment_2_1 = (Assignment)cGroup_2.eContents().get(1); - private final RuleCall cAliasIDTerminalRuleCall_2_1_0 = (RuleCall)cAliasAssignment_2_1.eContents().get(0); - private final Keyword cSemicolonKeyword_3 = (Keyword)cGroup.eContents().get(3); - - //ImportModule: - // "import" name=ModuleName ("as" alias=ID)? ";"; - public ParserRule getRule() { return rule; } - - //"import" name=ModuleName ("as" alias=ID)? ";" - public Group getGroup() { return cGroup; } - - //"import" - public Keyword getImportKeyword_0() { return cImportKeyword_0; } - - //name=ModuleName - public Assignment getNameAssignment_1() { return cNameAssignment_1; } - - //ModuleName - public RuleCall getNameModuleNameParserRuleCall_1_0() { return cNameModuleNameParserRuleCall_1_0; } - - //("as" alias=ID)? - public Group getGroup_2() { return cGroup_2; } - - //"as" - public Keyword getAsKeyword_2_0() { return cAsKeyword_2_0; } - - //alias=ID - public Assignment getAliasAssignment_2_1() { return cAliasAssignment_2_1; } - - //ID - public RuleCall getAliasIDTerminalRuleCall_2_1_0() { return cAliasIDTerminalRuleCall_2_1_0; } - - //";" - public Keyword getSemicolonKeyword_3() { return cSemicolonKeyword_3; } - } - - public class ImportMemberElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "ImportMember"); - private final Group cGroup = (Group)rule.eContents().get(1); - private final Keyword cFromKeyword_0 = (Keyword)cGroup.eContents().get(0); - private final Assignment cNameAssignment_1 = (Assignment)cGroup.eContents().get(1); - private final RuleCall cNameModuleNameParserRuleCall_1_0 = (RuleCall)cNameAssignment_1.eContents().get(0); - private final Keyword cImportKeyword_2 = (Keyword)cGroup.eContents().get(2); - private final Assignment cMemberAssignment_3 = (Assignment)cGroup.eContents().get(3); - private final RuleCall cMemberIDTerminalRuleCall_3_0 = (RuleCall)cMemberAssignment_3.eContents().get(0); - private final Group cGroup_4 = (Group)cGroup.eContents().get(4); - private final Keyword cAsKeyword_4_0 = (Keyword)cGroup_4.eContents().get(0); - private final Assignment cAliasAssignment_4_1 = (Assignment)cGroup_4.eContents().get(1); - private final RuleCall cAliasIDTerminalRuleCall_4_1_0 = (RuleCall)cAliasAssignment_4_1.eContents().get(0); - private final Keyword cSemicolonKeyword_5 = (Keyword)cGroup.eContents().get(5); - - //ImportMember: - // "from" name=ModuleName "import" member=ID ("as" alias=ID)? ";"; - public ParserRule getRule() { return rule; } - - //"from" name=ModuleName "import" member=ID ("as" alias=ID)? ";" - public Group getGroup() { return cGroup; } - - //"from" - public Keyword getFromKeyword_0() { return cFromKeyword_0; } - - //name=ModuleName - public Assignment getNameAssignment_1() { return cNameAssignment_1; } - - //ModuleName - public RuleCall getNameModuleNameParserRuleCall_1_0() { return cNameModuleNameParserRuleCall_1_0; } - - //"import" - public Keyword getImportKeyword_2() { return cImportKeyword_2; } - - //member=ID - public Assignment getMemberAssignment_3() { return cMemberAssignment_3; } - - //ID - public RuleCall getMemberIDTerminalRuleCall_3_0() { return cMemberIDTerminalRuleCall_3_0; } - - //("as" alias=ID)? - public Group getGroup_4() { return cGroup_4; } - - //"as" - public Keyword getAsKeyword_4_0() { return cAsKeyword_4_0; } - - //alias=ID - public Assignment getAliasAssignment_4_1() { return cAliasAssignment_4_1; } - - //ID - public RuleCall getAliasIDTerminalRuleCall_4_1_0() { return cAliasIDTerminalRuleCall_4_1_0; } - - //";" - public Keyword getSemicolonKeyword_5() { return cSemicolonKeyword_5; } - } - - public class PayloadTypeDeclElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "PayloadTypeDecl"); - private final Group cGroup = (Group)rule.eContents().get(1); - private final Keyword cTypeKeyword_0 = (Keyword)cGroup.eContents().get(0); - private final Keyword cLessThanSignKeyword_1 = (Keyword)cGroup.eContents().get(1); - private final Assignment cSchemaAssignment_2 = (Assignment)cGroup.eContents().get(2); - private final RuleCall cSchemaIDTerminalRuleCall_2_0 = (RuleCall)cSchemaAssignment_2.eContents().get(0); - private final Keyword cGreaterThanSignKeyword_3 = (Keyword)cGroup.eContents().get(3); - private final Assignment cTypeAssignment_4 = (Assignment)cGroup.eContents().get(4); - private final RuleCall cTypeSTRINGTerminalRuleCall_4_0 = (RuleCall)cTypeAssignment_4.eContents().get(0); - private final Keyword cFromKeyword_5 = (Keyword)cGroup.eContents().get(5); - private final Assignment cLocationAssignment_6 = (Assignment)cGroup.eContents().get(6); - private final RuleCall cLocationSTRINGTerminalRuleCall_6_0 = (RuleCall)cLocationAssignment_6.eContents().get(0); - private final Keyword cAsKeyword_7 = (Keyword)cGroup.eContents().get(7); - private final Assignment cAliasAssignment_8 = (Assignment)cGroup.eContents().get(8); - private final RuleCall cAliasIDTerminalRuleCall_8_0 = (RuleCall)cAliasAssignment_8.eContents().get(0); - private final Keyword cSemicolonKeyword_9 = (Keyword)cGroup.eContents().get(9); - - //PayloadTypeDecl: - // "type" "<" schema=ID ">" type=STRING "from" location=STRING "as" alias=ID ";"; - public ParserRule getRule() { return rule; } - - //"type" "<" schema=ID ">" type=STRING "from" location=STRING "as" alias=ID ";" - public Group getGroup() { return cGroup; } - - //"type" - public Keyword getTypeKeyword_0() { return cTypeKeyword_0; } - - //"<" - public Keyword getLessThanSignKeyword_1() { return cLessThanSignKeyword_1; } - - //schema=ID - public Assignment getSchemaAssignment_2() { return cSchemaAssignment_2; } - - //ID - public RuleCall getSchemaIDTerminalRuleCall_2_0() { return cSchemaIDTerminalRuleCall_2_0; } - - //">" - public Keyword getGreaterThanSignKeyword_3() { return cGreaterThanSignKeyword_3; } - - //type=STRING - public Assignment getTypeAssignment_4() { return cTypeAssignment_4; } - - //STRING - public RuleCall getTypeSTRINGTerminalRuleCall_4_0() { return cTypeSTRINGTerminalRuleCall_4_0; } - - //"from" - public Keyword getFromKeyword_5() { return cFromKeyword_5; } - - //location=STRING - public Assignment getLocationAssignment_6() { return cLocationAssignment_6; } - - //STRING - public RuleCall getLocationSTRINGTerminalRuleCall_6_0() { return cLocationSTRINGTerminalRuleCall_6_0; } - - //"as" - public Keyword getAsKeyword_7() { return cAsKeyword_7; } - - //alias=ID - public Assignment getAliasAssignment_8() { return cAliasAssignment_8; } - - //ID - public RuleCall getAliasIDTerminalRuleCall_8_0() { return cAliasIDTerminalRuleCall_8_0; } - - //";" - public Keyword getSemicolonKeyword_9() { return cSemicolonKeyword_9; } - } - - public class MessageSignatureElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "MessageSignature"); - private final Group cGroup = (Group)rule.eContents().get(1); - private final Action cMessageSignatureAction_0 = (Action)cGroup.eContents().get(0); - private final Assignment cOperatorAssignment_1 = (Assignment)cGroup.eContents().get(1); - private final RuleCall cOperatorIDTerminalRuleCall_1_0 = (RuleCall)cOperatorAssignment_1.eContents().get(0); - private final Keyword cLeftParenthesisKeyword_2 = (Keyword)cGroup.eContents().get(2); - private final Group cGroup_3 = (Group)cGroup.eContents().get(3); - private final Assignment cTypesAssignment_3_0 = (Assignment)cGroup_3.eContents().get(0); - private final RuleCall cTypesPayloadElementParserRuleCall_3_0_0 = (RuleCall)cTypesAssignment_3_0.eContents().get(0); - private final Group cGroup_3_1 = (Group)cGroup_3.eContents().get(1); - private final Keyword cCommaKeyword_3_1_0 = (Keyword)cGroup_3_1.eContents().get(0); - private final Assignment cTypesAssignment_3_1_1 = (Assignment)cGroup_3_1.eContents().get(1); - private final RuleCall cTypesPayloadElementParserRuleCall_3_1_1_0 = (RuleCall)cTypesAssignment_3_1_1.eContents().get(0); - private final Keyword cRightParenthesisKeyword_4 = (Keyword)cGroup.eContents().get(4); - - /// ** - // * Section 3.5 Message Signatures - // * / MessageSignature: - // {MessageSignature} operator=ID? "(" (types+=PayloadElement ("," types+=PayloadElement)*)? ")"; - public ParserRule getRule() { return rule; } - - //{MessageSignature} operator=ID? "(" (types+=PayloadElement ("," types+=PayloadElement)*)? ")" - public Group getGroup() { return cGroup; } - - //{MessageSignature} - public Action getMessageSignatureAction_0() { return cMessageSignatureAction_0; } - - //operator=ID? - public Assignment getOperatorAssignment_1() { return cOperatorAssignment_1; } - - //ID - public RuleCall getOperatorIDTerminalRuleCall_1_0() { return cOperatorIDTerminalRuleCall_1_0; } - - //"(" - public Keyword getLeftParenthesisKeyword_2() { return cLeftParenthesisKeyword_2; } - - //(types+=PayloadElement ("," types+=PayloadElement)*)? - public Group getGroup_3() { return cGroup_3; } - - //types+=PayloadElement - public Assignment getTypesAssignment_3_0() { return cTypesAssignment_3_0; } - - //PayloadElement - public RuleCall getTypesPayloadElementParserRuleCall_3_0_0() { return cTypesPayloadElementParserRuleCall_3_0_0; } - - //("," types+=PayloadElement)* - public Group getGroup_3_1() { return cGroup_3_1; } - - //"," - public Keyword getCommaKeyword_3_1_0() { return cCommaKeyword_3_1_0; } - - //types+=PayloadElement - public Assignment getTypesAssignment_3_1_1() { return cTypesAssignment_3_1_1; } - - //PayloadElement - public RuleCall getTypesPayloadElementParserRuleCall_3_1_1_0() { return cTypesPayloadElementParserRuleCall_3_1_1_0; } - - //")" - public Keyword getRightParenthesisKeyword_4() { return cRightParenthesisKeyword_4; } - } - - public class PayloadElementElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "PayloadElement"); - private final Group cGroup = (Group)rule.eContents().get(1); - private final Group cGroup_0 = (Group)cGroup.eContents().get(0); - private final Assignment cNameAssignment_0_0 = (Assignment)cGroup_0.eContents().get(0); - private final RuleCall cNameIDTerminalRuleCall_0_0_0 = (RuleCall)cNameAssignment_0_0.eContents().get(0); - private final Keyword cColonKeyword_0_1 = (Keyword)cGroup_0.eContents().get(1); - private final Assignment cTypeAssignment_1 = (Assignment)cGroup.eContents().get(1); - private final RuleCall cTypeIDTerminalRuleCall_1_0 = (RuleCall)cTypeAssignment_1.eContents().get(0); - - //PayloadElement: - // (name=ID ":")? type=ID; - public ParserRule getRule() { return rule; } - - //(name=ID ":")? type=ID - public Group getGroup() { return cGroup; } - - //(name=ID ":")? - public Group getGroup_0() { return cGroup_0; } - - //name=ID - public Assignment getNameAssignment_0_0() { return cNameAssignment_0_0; } - - //ID - public RuleCall getNameIDTerminalRuleCall_0_0_0() { return cNameIDTerminalRuleCall_0_0_0; } - - //":" - public Keyword getColonKeyword_0_1() { return cColonKeyword_0_1; } - - //type=ID - public Assignment getTypeAssignment_1() { return cTypeAssignment_1; } - - //ID - public RuleCall getTypeIDTerminalRuleCall_1_0() { return cTypeIDTerminalRuleCall_1_0; } - } - - public class GlobalProtocolDeclElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "GlobalProtocolDecl"); - private final Group cGroup = (Group)rule.eContents().get(1); - private final Keyword cGlobalKeyword_0 = (Keyword)cGroup.eContents().get(0); - private final Keyword cProtocolKeyword_1 = (Keyword)cGroup.eContents().get(1); - private final Assignment cNameAssignment_2 = (Assignment)cGroup.eContents().get(2); - private final RuleCall cNameIDTerminalRuleCall_2_0 = (RuleCall)cNameAssignment_2.eContents().get(0); - private final Group cGroup_3 = (Group)cGroup.eContents().get(3); - private final Keyword cLessThanSignKeyword_3_0 = (Keyword)cGroup_3.eContents().get(0); - private final Assignment cParametersAssignment_3_1 = (Assignment)cGroup_3.eContents().get(1); - private final RuleCall cParametersParameterDeclParserRuleCall_3_1_0 = (RuleCall)cParametersAssignment_3_1.eContents().get(0); - private final Group cGroup_3_2 = (Group)cGroup_3.eContents().get(2); - private final Keyword cCommaKeyword_3_2_0 = (Keyword)cGroup_3_2.eContents().get(0); - private final Assignment cParametersAssignment_3_2_1 = (Assignment)cGroup_3_2.eContents().get(1); - private final RuleCall cParametersParameterDeclParserRuleCall_3_2_1_0 = (RuleCall)cParametersAssignment_3_2_1.eContents().get(0); - private final Keyword cGreaterThanSignKeyword_3_3 = (Keyword)cGroup_3.eContents().get(3); - private final Keyword cLeftParenthesisKeyword_4 = (Keyword)cGroup.eContents().get(4); - private final Assignment cRolesAssignment_5 = (Assignment)cGroup.eContents().get(5); - private final RuleCall cRolesRoleDeclParserRuleCall_5_0 = (RuleCall)cRolesAssignment_5.eContents().get(0); - private final Group cGroup_6 = (Group)cGroup.eContents().get(6); - private final Keyword cCommaKeyword_6_0 = (Keyword)cGroup_6.eContents().get(0); - private final Assignment cRolesAssignment_6_1 = (Assignment)cGroup_6.eContents().get(1); - private final RuleCall cRolesRoleDeclParserRuleCall_6_1_0 = (RuleCall)cRolesAssignment_6_1.eContents().get(0); - private final Keyword cRightParenthesisKeyword_7 = (Keyword)cGroup.eContents().get(7); - private final Alternatives cAlternatives_8 = (Alternatives)cGroup.eContents().get(8); - private final Assignment cBlockAssignment_8_0 = (Assignment)cAlternatives_8.eContents().get(0); - private final RuleCall cBlockGlobalProtocolBlockParserRuleCall_8_0_0 = (RuleCall)cBlockAssignment_8_0.eContents().get(0); - private final Group cGroup_8_1 = (Group)cAlternatives_8.eContents().get(1); - private final Keyword cInstantiatesKeyword_8_1_0 = (Keyword)cGroup_8_1.eContents().get(0); - private final Assignment cInstantiatesAssignment_8_1_1 = (Assignment)cGroup_8_1.eContents().get(1); - private final RuleCall cInstantiatesIDTerminalRuleCall_8_1_1_0 = (RuleCall)cInstantiatesAssignment_8_1_1.eContents().get(0); - private final Group cGroup_8_1_2 = (Group)cGroup_8_1.eContents().get(2); - private final Keyword cLessThanSignKeyword_8_1_2_0 = (Keyword)cGroup_8_1_2.eContents().get(0); - private final Assignment cArgumentsAssignment_8_1_2_1 = (Assignment)cGroup_8_1_2.eContents().get(1); - private final RuleCall cArgumentsArgumentParserRuleCall_8_1_2_1_0 = (RuleCall)cArgumentsAssignment_8_1_2_1.eContents().get(0); - private final Group cGroup_8_1_2_2 = (Group)cGroup_8_1_2.eContents().get(2); - private final Keyword cCommaKeyword_8_1_2_2_0 = (Keyword)cGroup_8_1_2_2.eContents().get(0); - private final Assignment cArgumentsAssignment_8_1_2_2_1 = (Assignment)cGroup_8_1_2_2.eContents().get(1); - private final RuleCall cArgumentsArgumentParserRuleCall_8_1_2_2_1_0 = (RuleCall)cArgumentsAssignment_8_1_2_2_1.eContents().get(0); - private final Keyword cGreaterThanSignKeyword_8_1_2_3 = (Keyword)cGroup_8_1_2.eContents().get(3); - private final Keyword cLeftParenthesisKeyword_8_1_3 = (Keyword)cGroup_8_1.eContents().get(3); - private final Assignment cRoleInstantiationsAssignment_8_1_4 = (Assignment)cGroup_8_1.eContents().get(4); - private final RuleCall cRoleInstantiationsRoleInstantiationParserRuleCall_8_1_4_0 = (RuleCall)cRoleInstantiationsAssignment_8_1_4.eContents().get(0); - private final Group cGroup_8_1_5 = (Group)cGroup_8_1.eContents().get(5); - private final Keyword cCommaKeyword_8_1_5_0 = (Keyword)cGroup_8_1_5.eContents().get(0); - private final Assignment cRoleInstantiationsAssignment_8_1_5_1 = (Assignment)cGroup_8_1_5.eContents().get(1); - private final RuleCall cRoleInstantiationsRoleInstantiationParserRuleCall_8_1_5_1_0 = (RuleCall)cRoleInstantiationsAssignment_8_1_5_1.eContents().get(0); - private final Keyword cRightParenthesisKeyword_8_1_6 = (Keyword)cGroup_8_1.eContents().get(6); - private final Keyword cSemicolonKeyword_8_1_7 = (Keyword)cGroup_8_1.eContents().get(7); - - //GlobalProtocolDecl: - // "global" "protocol" name=ID ("<" parameters+=ParameterDecl ("," parameters+=ParameterDecl)* ">")? "(" roles+=RoleDecl - // ("," roles+=RoleDecl)* ")" (block=GlobalProtocolBlock | "instantiates" instantiates=ID ("<" arguments+=Argument ("," - // arguments+=Argument)* ">")? "(" roleInstantiations+=RoleInstantiation ("," roleInstantiations+=RoleInstantiation)* ")" - // ";"); - public ParserRule getRule() { return rule; } - - //"global" "protocol" name=ID ("<" parameters+=ParameterDecl ("," parameters+=ParameterDecl)* ">")? "(" roles+=RoleDecl - //("," roles+=RoleDecl)* ")" (block=GlobalProtocolBlock | "instantiates" instantiates=ID ("<" arguments+=Argument ("," - //arguments+=Argument)* ">")? "(" roleInstantiations+=RoleInstantiation ("," roleInstantiations+=RoleInstantiation)* ")" - //";") - public Group getGroup() { return cGroup; } - - //"global" - public Keyword getGlobalKeyword_0() { return cGlobalKeyword_0; } - - //"protocol" - public Keyword getProtocolKeyword_1() { return cProtocolKeyword_1; } - - //name=ID - public Assignment getNameAssignment_2() { return cNameAssignment_2; } - - //ID - public RuleCall getNameIDTerminalRuleCall_2_0() { return cNameIDTerminalRuleCall_2_0; } - - //("<" parameters+=ParameterDecl ("," parameters+=ParameterDecl)* ">")? - public Group getGroup_3() { return cGroup_3; } - - //"<" - public Keyword getLessThanSignKeyword_3_0() { return cLessThanSignKeyword_3_0; } - - //parameters+=ParameterDecl - public Assignment getParametersAssignment_3_1() { return cParametersAssignment_3_1; } - - //ParameterDecl - public RuleCall getParametersParameterDeclParserRuleCall_3_1_0() { return cParametersParameterDeclParserRuleCall_3_1_0; } - - //("," parameters+=ParameterDecl)* - public Group getGroup_3_2() { return cGroup_3_2; } - - //"," - public Keyword getCommaKeyword_3_2_0() { return cCommaKeyword_3_2_0; } - - //parameters+=ParameterDecl - public Assignment getParametersAssignment_3_2_1() { return cParametersAssignment_3_2_1; } - - //ParameterDecl - public RuleCall getParametersParameterDeclParserRuleCall_3_2_1_0() { return cParametersParameterDeclParserRuleCall_3_2_1_0; } - - //">" - public Keyword getGreaterThanSignKeyword_3_3() { return cGreaterThanSignKeyword_3_3; } - - //"(" - public Keyword getLeftParenthesisKeyword_4() { return cLeftParenthesisKeyword_4; } - - //roles+=RoleDecl - public Assignment getRolesAssignment_5() { return cRolesAssignment_5; } - - //RoleDecl - public RuleCall getRolesRoleDeclParserRuleCall_5_0() { return cRolesRoleDeclParserRuleCall_5_0; } - - //("," roles+=RoleDecl)* - public Group getGroup_6() { return cGroup_6; } - - //"," - public Keyword getCommaKeyword_6_0() { return cCommaKeyword_6_0; } - - //roles+=RoleDecl - public Assignment getRolesAssignment_6_1() { return cRolesAssignment_6_1; } - - //RoleDecl - public RuleCall getRolesRoleDeclParserRuleCall_6_1_0() { return cRolesRoleDeclParserRuleCall_6_1_0; } - - //")" - public Keyword getRightParenthesisKeyword_7() { return cRightParenthesisKeyword_7; } - - //block=GlobalProtocolBlock | "instantiates" instantiates=ID ("<" arguments+=Argument ("," arguments+=Argument)* ">")? "(" - //roleInstantiations+=RoleInstantiation ("," roleInstantiations+=RoleInstantiation)* ")" ";" - public Alternatives getAlternatives_8() { return cAlternatives_8; } - - //block=GlobalProtocolBlock - public Assignment getBlockAssignment_8_0() { return cBlockAssignment_8_0; } - - //GlobalProtocolBlock - public RuleCall getBlockGlobalProtocolBlockParserRuleCall_8_0_0() { return cBlockGlobalProtocolBlockParserRuleCall_8_0_0; } - - //"instantiates" instantiates=ID ("<" arguments+=Argument ("," arguments+=Argument)* ">")? "(" - //roleInstantiations+=RoleInstantiation ("," roleInstantiations+=RoleInstantiation)* ")" ";" - public Group getGroup_8_1() { return cGroup_8_1; } - - //"instantiates" - public Keyword getInstantiatesKeyword_8_1_0() { return cInstantiatesKeyword_8_1_0; } - - //instantiates=ID - public Assignment getInstantiatesAssignment_8_1_1() { return cInstantiatesAssignment_8_1_1; } - - //ID - public RuleCall getInstantiatesIDTerminalRuleCall_8_1_1_0() { return cInstantiatesIDTerminalRuleCall_8_1_1_0; } - - //("<" arguments+=Argument ("," arguments+=Argument)* ">")? - public Group getGroup_8_1_2() { return cGroup_8_1_2; } - - //"<" - public Keyword getLessThanSignKeyword_8_1_2_0() { return cLessThanSignKeyword_8_1_2_0; } - - //arguments+=Argument - public Assignment getArgumentsAssignment_8_1_2_1() { return cArgumentsAssignment_8_1_2_1; } - - //Argument - public RuleCall getArgumentsArgumentParserRuleCall_8_1_2_1_0() { return cArgumentsArgumentParserRuleCall_8_1_2_1_0; } - - //("," arguments+=Argument)* - public Group getGroup_8_1_2_2() { return cGroup_8_1_2_2; } - - //"," - public Keyword getCommaKeyword_8_1_2_2_0() { return cCommaKeyword_8_1_2_2_0; } - - //arguments+=Argument - public Assignment getArgumentsAssignment_8_1_2_2_1() { return cArgumentsAssignment_8_1_2_2_1; } - - //Argument - public RuleCall getArgumentsArgumentParserRuleCall_8_1_2_2_1_0() { return cArgumentsArgumentParserRuleCall_8_1_2_2_1_0; } - - //">" - public Keyword getGreaterThanSignKeyword_8_1_2_3() { return cGreaterThanSignKeyword_8_1_2_3; } - - //"(" - public Keyword getLeftParenthesisKeyword_8_1_3() { return cLeftParenthesisKeyword_8_1_3; } - - //roleInstantiations+=RoleInstantiation - public Assignment getRoleInstantiationsAssignment_8_1_4() { return cRoleInstantiationsAssignment_8_1_4; } - - //RoleInstantiation - public RuleCall getRoleInstantiationsRoleInstantiationParserRuleCall_8_1_4_0() { return cRoleInstantiationsRoleInstantiationParserRuleCall_8_1_4_0; } - - //("," roleInstantiations+=RoleInstantiation)* - public Group getGroup_8_1_5() { return cGroup_8_1_5; } - - //"," - public Keyword getCommaKeyword_8_1_5_0() { return cCommaKeyword_8_1_5_0; } - - //roleInstantiations+=RoleInstantiation - public Assignment getRoleInstantiationsAssignment_8_1_5_1() { return cRoleInstantiationsAssignment_8_1_5_1; } - - //RoleInstantiation - public RuleCall getRoleInstantiationsRoleInstantiationParserRuleCall_8_1_5_1_0() { return cRoleInstantiationsRoleInstantiationParserRuleCall_8_1_5_1_0; } - - //")" - public Keyword getRightParenthesisKeyword_8_1_6() { return cRightParenthesisKeyword_8_1_6; } - - //";" - public Keyword getSemicolonKeyword_8_1_7() { return cSemicolonKeyword_8_1_7; } - } - - public class RoleDeclElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "RoleDecl"); - private final Group cGroup = (Group)rule.eContents().get(1); - private final Keyword cRoleKeyword_0 = (Keyword)cGroup.eContents().get(0); - private final Assignment cNameAssignment_1 = (Assignment)cGroup.eContents().get(1); - private final RuleCall cNameIDTerminalRuleCall_1_0 = (RuleCall)cNameAssignment_1.eContents().get(0); - private final Group cGroup_2 = (Group)cGroup.eContents().get(2); - private final Keyword cAsKeyword_2_0 = (Keyword)cGroup_2.eContents().get(0); - private final Assignment cAliasAssignment_2_1 = (Assignment)cGroup_2.eContents().get(1); - private final RuleCall cAliasIDTerminalRuleCall_2_1_0 = (RuleCall)cAliasAssignment_2_1.eContents().get(0); - - //RoleDecl: - // "role" name=ID ("as" alias=ID)?; - public ParserRule getRule() { return rule; } - - //"role" name=ID ("as" alias=ID)? - public Group getGroup() { return cGroup; } - - //"role" - public Keyword getRoleKeyword_0() { return cRoleKeyword_0; } - - //name=ID - public Assignment getNameAssignment_1() { return cNameAssignment_1; } - - //ID - public RuleCall getNameIDTerminalRuleCall_1_0() { return cNameIDTerminalRuleCall_1_0; } - - //("as" alias=ID)? - public Group getGroup_2() { return cGroup_2; } - - //"as" - public Keyword getAsKeyword_2_0() { return cAsKeyword_2_0; } - - //alias=ID - public Assignment getAliasAssignment_2_1() { return cAliasAssignment_2_1; } - - //ID - public RuleCall getAliasIDTerminalRuleCall_2_1_0() { return cAliasIDTerminalRuleCall_2_1_0; } - } - - public class ParameterDeclElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "ParameterDecl"); - private final Alternatives cAlternatives = (Alternatives)rule.eContents().get(1); - private final Group cGroup_0 = (Group)cAlternatives.eContents().get(0); - private final Keyword cTypeKeyword_0_0 = (Keyword)cGroup_0.eContents().get(0); - private final Assignment cNameAssignment_0_1 = (Assignment)cGroup_0.eContents().get(1); - private final RuleCall cNameIDTerminalRuleCall_0_1_0 = (RuleCall)cNameAssignment_0_1.eContents().get(0); - private final Group cGroup_0_2 = (Group)cGroup_0.eContents().get(2); - private final Keyword cAsKeyword_0_2_0 = (Keyword)cGroup_0_2.eContents().get(0); - private final Assignment cAliasAssignment_0_2_1 = (Assignment)cGroup_0_2.eContents().get(1); - private final RuleCall cAliasIDTerminalRuleCall_0_2_1_0 = (RuleCall)cAliasAssignment_0_2_1.eContents().get(0); - private final Group cGroup_1 = (Group)cAlternatives.eContents().get(1); - private final Keyword cSigKeyword_1_0 = (Keyword)cGroup_1.eContents().get(0); - private final Assignment cNameAssignment_1_1 = (Assignment)cGroup_1.eContents().get(1); - private final RuleCall cNameIDTerminalRuleCall_1_1_0 = (RuleCall)cNameAssignment_1_1.eContents().get(0); - private final Group cGroup_1_2 = (Group)cGroup_1.eContents().get(2); - private final Keyword cAsKeyword_1_2_0 = (Keyword)cGroup_1_2.eContents().get(0); - private final Assignment cAliasAssignment_1_2_1 = (Assignment)cGroup_1_2.eContents().get(1); - private final RuleCall cAliasIDTerminalRuleCall_1_2_1_0 = (RuleCall)cAliasAssignment_1_2_1.eContents().get(0); - - //ParameterDecl: - // "type" name=ID ("as" alias=ID)? | "sig" name=ID ("as" alias=ID)?; - public ParserRule getRule() { return rule; } - - //"type" name=ID ("as" alias=ID)? | "sig" name=ID ("as" alias=ID)? - public Alternatives getAlternatives() { return cAlternatives; } - - //"type" name=ID ("as" alias=ID)? - public Group getGroup_0() { return cGroup_0; } - - //"type" - public Keyword getTypeKeyword_0_0() { return cTypeKeyword_0_0; } - - //name=ID - public Assignment getNameAssignment_0_1() { return cNameAssignment_0_1; } - - //ID - public RuleCall getNameIDTerminalRuleCall_0_1_0() { return cNameIDTerminalRuleCall_0_1_0; } - - //("as" alias=ID)? - public Group getGroup_0_2() { return cGroup_0_2; } - - //"as" - public Keyword getAsKeyword_0_2_0() { return cAsKeyword_0_2_0; } - - //alias=ID - public Assignment getAliasAssignment_0_2_1() { return cAliasAssignment_0_2_1; } - - //ID - public RuleCall getAliasIDTerminalRuleCall_0_2_1_0() { return cAliasIDTerminalRuleCall_0_2_1_0; } - - //"sig" name=ID ("as" alias=ID)? - public Group getGroup_1() { return cGroup_1; } - - //"sig" - public Keyword getSigKeyword_1_0() { return cSigKeyword_1_0; } - - //name=ID - public Assignment getNameAssignment_1_1() { return cNameAssignment_1_1; } - - //ID - public RuleCall getNameIDTerminalRuleCall_1_1_0() { return cNameIDTerminalRuleCall_1_1_0; } - - //("as" alias=ID)? - public Group getGroup_1_2() { return cGroup_1_2; } - - //"as" - public Keyword getAsKeyword_1_2_0() { return cAsKeyword_1_2_0; } - - //alias=ID - public Assignment getAliasAssignment_1_2_1() { return cAliasAssignment_1_2_1; } - - //ID - public RuleCall getAliasIDTerminalRuleCall_1_2_1_0() { return cAliasIDTerminalRuleCall_1_2_1_0; } - } - - public class RoleInstantiationElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "RoleInstantiation"); - private final Group cGroup = (Group)rule.eContents().get(1); - private final Assignment cNameAssignment_0 = (Assignment)cGroup.eContents().get(0); - private final RuleCall cNameIDTerminalRuleCall_0_0 = (RuleCall)cNameAssignment_0.eContents().get(0); - private final Group cGroup_1 = (Group)cGroup.eContents().get(1); - private final Keyword cAsKeyword_1_0 = (Keyword)cGroup_1.eContents().get(0); - private final Assignment cAliasAssignment_1_1 = (Assignment)cGroup_1.eContents().get(1); - private final RuleCall cAliasIDTerminalRuleCall_1_1_0 = (RuleCall)cAliasAssignment_1_1.eContents().get(0); - - //RoleInstantiation: - // name=ID ("as" alias=ID)?; - public ParserRule getRule() { return rule; } - - //name=ID ("as" alias=ID)? - public Group getGroup() { return cGroup; } - - //name=ID - public Assignment getNameAssignment_0() { return cNameAssignment_0; } - - //ID - public RuleCall getNameIDTerminalRuleCall_0_0() { return cNameIDTerminalRuleCall_0_0; } - - //("as" alias=ID)? - public Group getGroup_1() { return cGroup_1; } - - //"as" - public Keyword getAsKeyword_1_0() { return cAsKeyword_1_0; } - - //alias=ID - public Assignment getAliasAssignment_1_1() { return cAliasAssignment_1_1; } - - //ID - public RuleCall getAliasIDTerminalRuleCall_1_1_0() { return cAliasIDTerminalRuleCall_1_1_0; } - } - - public class ArgumentElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "Argument"); - private final Alternatives cAlternatives = (Alternatives)rule.eContents().get(1); - private final Group cGroup_0 = (Group)cAlternatives.eContents().get(0); - private final Assignment cSignatureAssignment_0_0 = (Assignment)cGroup_0.eContents().get(0); - private final RuleCall cSignatureMessageSignatureParserRuleCall_0_0_0 = (RuleCall)cSignatureAssignment_0_0.eContents().get(0); - private final Group cGroup_0_1 = (Group)cGroup_0.eContents().get(1); - private final Keyword cAsKeyword_0_1_0 = (Keyword)cGroup_0_1.eContents().get(0); - private final Assignment cAliasAssignment_0_1_1 = (Assignment)cGroup_0_1.eContents().get(1); - private final RuleCall cAliasIDTerminalRuleCall_0_1_1_0 = (RuleCall)cAliasAssignment_0_1_1.eContents().get(0); - private final Group cGroup_1 = (Group)cAlternatives.eContents().get(1); - private final Assignment cNameAssignment_1_0 = (Assignment)cGroup_1.eContents().get(0); - private final RuleCall cNameIDTerminalRuleCall_1_0_0 = (RuleCall)cNameAssignment_1_0.eContents().get(0); - private final Group cGroup_1_1 = (Group)cGroup_1.eContents().get(1); - private final Keyword cAsKeyword_1_1_0 = (Keyword)cGroup_1_1.eContents().get(0); - private final Assignment cAliasAssignment_1_1_1 = (Assignment)cGroup_1_1.eContents().get(1); - private final RuleCall cAliasIDTerminalRuleCall_1_1_1_0 = (RuleCall)cAliasAssignment_1_1_1.eContents().get(0); - - //Argument: - // signature=MessageSignature ("as" alias=ID)? | name=ID ("as" alias=ID)?; - public ParserRule getRule() { return rule; } - - //signature=MessageSignature ("as" alias=ID)? | name=ID ("as" alias=ID)? - public Alternatives getAlternatives() { return cAlternatives; } - - //signature=MessageSignature ("as" alias=ID)? - public Group getGroup_0() { return cGroup_0; } - - //signature=MessageSignature - public Assignment getSignatureAssignment_0_0() { return cSignatureAssignment_0_0; } - - //MessageSignature - public RuleCall getSignatureMessageSignatureParserRuleCall_0_0_0() { return cSignatureMessageSignatureParserRuleCall_0_0_0; } - - //("as" alias=ID)? - public Group getGroup_0_1() { return cGroup_0_1; } - - //"as" - public Keyword getAsKeyword_0_1_0() { return cAsKeyword_0_1_0; } - - //alias=ID - public Assignment getAliasAssignment_0_1_1() { return cAliasAssignment_0_1_1; } - - //ID - public RuleCall getAliasIDTerminalRuleCall_0_1_1_0() { return cAliasIDTerminalRuleCall_0_1_1_0; } - - //name=ID ("as" alias=ID)? - public Group getGroup_1() { return cGroup_1; } - - //name=ID - public Assignment getNameAssignment_1_0() { return cNameAssignment_1_0; } - - //ID - public RuleCall getNameIDTerminalRuleCall_1_0_0() { return cNameIDTerminalRuleCall_1_0_0; } - - //("as" alias=ID)? - public Group getGroup_1_1() { return cGroup_1_1; } - - //"as" - public Keyword getAsKeyword_1_1_0() { return cAsKeyword_1_1_0; } - - //alias=ID - public Assignment getAliasAssignment_1_1_1() { return cAliasAssignment_1_1_1; } - - //ID - public RuleCall getAliasIDTerminalRuleCall_1_1_1_0() { return cAliasIDTerminalRuleCall_1_1_1_0; } - } - - public class GlobalProtocolBlockElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "GlobalProtocolBlock"); - private final Group cGroup = (Group)rule.eContents().get(1); - private final Action cGlobalProtocolBlockAction_0 = (Action)cGroup.eContents().get(0); - private final Keyword cLeftCurlyBracketKeyword_1 = (Keyword)cGroup.eContents().get(1); - private final Assignment cActivitiesAssignment_2 = (Assignment)cGroup.eContents().get(2); - private final RuleCall cActivitiesGlobalInteractionParserRuleCall_2_0 = (RuleCall)cActivitiesAssignment_2.eContents().get(0); - private final Keyword cRightCurlyBracketKeyword_3 = (Keyword)cGroup.eContents().get(3); - - /// ** - // * Section 3.7.3 Global Interaction Sequences and Blocks - // * / GlobalProtocolBlock: - // {GlobalProtocolBlock} "{" activities+=GlobalInteraction* "}"; - public ParserRule getRule() { return rule; } - - //{GlobalProtocolBlock} "{" activities+=GlobalInteraction* "}" - public Group getGroup() { return cGroup; } - - //{GlobalProtocolBlock} - public Action getGlobalProtocolBlockAction_0() { return cGlobalProtocolBlockAction_0; } - - //"{" - public Keyword getLeftCurlyBracketKeyword_1() { return cLeftCurlyBracketKeyword_1; } - - //activities+=GlobalInteraction* - public Assignment getActivitiesAssignment_2() { return cActivitiesAssignment_2; } - - //GlobalInteraction - public RuleCall getActivitiesGlobalInteractionParserRuleCall_2_0() { return cActivitiesGlobalInteractionParserRuleCall_2_0; } - - //"}" - public Keyword getRightCurlyBracketKeyword_3() { return cRightCurlyBracketKeyword_3; } - } - - public class GlobalInteractionElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "GlobalInteraction"); - private final Alternatives cAlternatives = (Alternatives)rule.eContents().get(1); - private final RuleCall cGlobalMessageTransferParserRuleCall_0 = (RuleCall)cAlternatives.eContents().get(0); - private final RuleCall cGlobalChoiceParserRuleCall_1 = (RuleCall)cAlternatives.eContents().get(1); - private final RuleCall cGlobalRecursionParserRuleCall_2 = (RuleCall)cAlternatives.eContents().get(2); - private final RuleCall cGlobalContinueParserRuleCall_3 = (RuleCall)cAlternatives.eContents().get(3); - private final RuleCall cGlobalParallelParserRuleCall_4 = (RuleCall)cAlternatives.eContents().get(4); - private final RuleCall cGlobalInterruptibleParserRuleCall_5 = (RuleCall)cAlternatives.eContents().get(5); - private final RuleCall cGlobalDoParserRuleCall_6 = (RuleCall)cAlternatives.eContents().get(6); - - /// *| - // globalspawn* / GlobalInteraction: - // GlobalMessageTransfer | GlobalChoice | GlobalRecursion | GlobalContinue | GlobalParallel | GlobalInterruptible | - // GlobalDo; - public ParserRule getRule() { return rule; } - - //GlobalMessageTransfer | GlobalChoice | GlobalRecursion | GlobalContinue | GlobalParallel | GlobalInterruptible | - //GlobalDo - public Alternatives getAlternatives() { return cAlternatives; } - - //GlobalMessageTransfer - public RuleCall getGlobalMessageTransferParserRuleCall_0() { return cGlobalMessageTransferParserRuleCall_0; } - - //GlobalChoice - public RuleCall getGlobalChoiceParserRuleCall_1() { return cGlobalChoiceParserRuleCall_1; } - - //GlobalRecursion - public RuleCall getGlobalRecursionParserRuleCall_2() { return cGlobalRecursionParserRuleCall_2; } - - //GlobalContinue - public RuleCall getGlobalContinueParserRuleCall_3() { return cGlobalContinueParserRuleCall_3; } - - //GlobalParallel - public RuleCall getGlobalParallelParserRuleCall_4() { return cGlobalParallelParserRuleCall_4; } - - //GlobalInterruptible - public RuleCall getGlobalInterruptibleParserRuleCall_5() { return cGlobalInterruptibleParserRuleCall_5; } - - //GlobalDo - public RuleCall getGlobalDoParserRuleCall_6() { return cGlobalDoParserRuleCall_6; } - } - - public class GlobalMessageTransferElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "GlobalMessageTransfer"); - private final Group cGroup = (Group)rule.eContents().get(1); - private final Assignment cMessageAssignment_0 = (Assignment)cGroup.eContents().get(0); - private final RuleCall cMessageMessageParserRuleCall_0_0 = (RuleCall)cMessageAssignment_0.eContents().get(0); - private final Keyword cFromKeyword_1 = (Keyword)cGroup.eContents().get(1); - private final Assignment cFromRoleAssignment_2 = (Assignment)cGroup.eContents().get(2); - private final RuleCall cFromRoleIDTerminalRuleCall_2_0 = (RuleCall)cFromRoleAssignment_2.eContents().get(0); - private final Keyword cToKeyword_3 = (Keyword)cGroup.eContents().get(3); - private final Assignment cToRolesAssignment_4 = (Assignment)cGroup.eContents().get(4); - private final RuleCall cToRolesIDTerminalRuleCall_4_0 = (RuleCall)cToRolesAssignment_4.eContents().get(0); - private final Group cGroup_5 = (Group)cGroup.eContents().get(5); - private final Keyword cCommaKeyword_5_0 = (Keyword)cGroup_5.eContents().get(0); - private final Assignment cToRolesAssignment_5_1 = (Assignment)cGroup_5.eContents().get(1); - private final RuleCall cToRolesIDTerminalRuleCall_5_1_0 = (RuleCall)cToRolesAssignment_5_1.eContents().get(0); - private final Keyword cSemicolonKeyword_6 = (Keyword)cGroup.eContents().get(6); - - /// ** - // * Section 3.7.4 Global Message Transfer - // * / GlobalMessageTransfer: - // message=Message "from" fromRole=ID "to" toRoles+=ID ("," toRoles+=ID)* ";"; - public ParserRule getRule() { return rule; } - - //message=Message "from" fromRole=ID "to" toRoles+=ID ("," toRoles+=ID)* ";" - public Group getGroup() { return cGroup; } - - //message=Message - public Assignment getMessageAssignment_0() { return cMessageAssignment_0; } - - //Message - public RuleCall getMessageMessageParserRuleCall_0_0() { return cMessageMessageParserRuleCall_0_0; } - - //"from" - public Keyword getFromKeyword_1() { return cFromKeyword_1; } - - //fromRole=ID - public Assignment getFromRoleAssignment_2() { return cFromRoleAssignment_2; } - - //ID - public RuleCall getFromRoleIDTerminalRuleCall_2_0() { return cFromRoleIDTerminalRuleCall_2_0; } - - //"to" - public Keyword getToKeyword_3() { return cToKeyword_3; } - - //toRoles+=ID - public Assignment getToRolesAssignment_4() { return cToRolesAssignment_4; } - - //ID - public RuleCall getToRolesIDTerminalRuleCall_4_0() { return cToRolesIDTerminalRuleCall_4_0; } - - //("," toRoles+=ID)* - public Group getGroup_5() { return cGroup_5; } - - //"," - public Keyword getCommaKeyword_5_0() { return cCommaKeyword_5_0; } - - //toRoles+=ID - public Assignment getToRolesAssignment_5_1() { return cToRolesAssignment_5_1; } - - //ID - public RuleCall getToRolesIDTerminalRuleCall_5_1_0() { return cToRolesIDTerminalRuleCall_5_1_0; } - - //";" - public Keyword getSemicolonKeyword_6() { return cSemicolonKeyword_6; } - } - - public class MessageElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "Message"); - private final Alternatives cAlternatives = (Alternatives)rule.eContents().get(1); - private final Assignment cSignatureAssignment_0 = (Assignment)cAlternatives.eContents().get(0); - private final RuleCall cSignatureMessageSignatureParserRuleCall_0_0 = (RuleCall)cSignatureAssignment_0.eContents().get(0); - private final Assignment cParameterAssignment_1 = (Assignment)cAlternatives.eContents().get(1); - private final RuleCall cParameterIDTerminalRuleCall_1_0 = (RuleCall)cParameterAssignment_1.eContents().get(0); - - //Message: - // signature=MessageSignature | parameter=ID; - public ParserRule getRule() { return rule; } - - //signature=MessageSignature | parameter=ID - public Alternatives getAlternatives() { return cAlternatives; } - - //signature=MessageSignature - public Assignment getSignatureAssignment_0() { return cSignatureAssignment_0; } - - //MessageSignature - public RuleCall getSignatureMessageSignatureParserRuleCall_0_0() { return cSignatureMessageSignatureParserRuleCall_0_0; } - - //parameter=ID - public Assignment getParameterAssignment_1() { return cParameterAssignment_1; } - - //ID - public RuleCall getParameterIDTerminalRuleCall_1_0() { return cParameterIDTerminalRuleCall_1_0; } - } - - public class GlobalChoiceElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "GlobalChoice"); - private final Group cGroup = (Group)rule.eContents().get(1); - private final Keyword cChoiceKeyword_0 = (Keyword)cGroup.eContents().get(0); - private final Keyword cAtKeyword_1 = (Keyword)cGroup.eContents().get(1); - private final Assignment cRoleAssignment_2 = (Assignment)cGroup.eContents().get(2); - private final RuleCall cRoleIDTerminalRuleCall_2_0 = (RuleCall)cRoleAssignment_2.eContents().get(0); - private final Assignment cBlocksAssignment_3 = (Assignment)cGroup.eContents().get(3); - private final RuleCall cBlocksGlobalProtocolBlockParserRuleCall_3_0 = (RuleCall)cBlocksAssignment_3.eContents().get(0); - private final Group cGroup_4 = (Group)cGroup.eContents().get(4); - private final Keyword cOrKeyword_4_0 = (Keyword)cGroup_4.eContents().get(0); - private final Assignment cBlocksAssignment_4_1 = (Assignment)cGroup_4.eContents().get(1); - private final RuleCall cBlocksGlobalProtocolBlockParserRuleCall_4_1_0 = (RuleCall)cBlocksAssignment_4_1.eContents().get(0); - - /// ** - // * Section 3.7.5 Global Choice - // * / GlobalChoice: - // "choice" "at" role=ID blocks+=GlobalProtocolBlock ("or" blocks+=GlobalProtocolBlock)*; - public ParserRule getRule() { return rule; } - - //"choice" "at" role=ID blocks+=GlobalProtocolBlock ("or" blocks+=GlobalProtocolBlock)* - public Group getGroup() { return cGroup; } - - //"choice" - public Keyword getChoiceKeyword_0() { return cChoiceKeyword_0; } - - //"at" - public Keyword getAtKeyword_1() { return cAtKeyword_1; } - - //role=ID - public Assignment getRoleAssignment_2() { return cRoleAssignment_2; } - - //ID - public RuleCall getRoleIDTerminalRuleCall_2_0() { return cRoleIDTerminalRuleCall_2_0; } - - //blocks+=GlobalProtocolBlock - public Assignment getBlocksAssignment_3() { return cBlocksAssignment_3; } - - //GlobalProtocolBlock - public RuleCall getBlocksGlobalProtocolBlockParserRuleCall_3_0() { return cBlocksGlobalProtocolBlockParserRuleCall_3_0; } - - //("or" blocks+=GlobalProtocolBlock)* - public Group getGroup_4() { return cGroup_4; } - - //"or" - public Keyword getOrKeyword_4_0() { return cOrKeyword_4_0; } - - //blocks+=GlobalProtocolBlock - public Assignment getBlocksAssignment_4_1() { return cBlocksAssignment_4_1; } - - //GlobalProtocolBlock - public RuleCall getBlocksGlobalProtocolBlockParserRuleCall_4_1_0() { return cBlocksGlobalProtocolBlockParserRuleCall_4_1_0; } - } - - public class GlobalRecursionElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "GlobalRecursion"); - private final Group cGroup = (Group)rule.eContents().get(1); - private final Keyword cRecKeyword_0 = (Keyword)cGroup.eContents().get(0); - private final Assignment cLabelAssignment_1 = (Assignment)cGroup.eContents().get(1); - private final RuleCall cLabelIDTerminalRuleCall_1_0 = (RuleCall)cLabelAssignment_1.eContents().get(0); - private final Assignment cBlockAssignment_2 = (Assignment)cGroup.eContents().get(2); - private final RuleCall cBlockGlobalProtocolBlockParserRuleCall_2_0 = (RuleCall)cBlockAssignment_2.eContents().get(0); - - /// ** - // * Section 3.7.6 Global Recursion - // * / GlobalRecursion: - // "rec" label=ID block=GlobalProtocolBlock; - public ParserRule getRule() { return rule; } - - //"rec" label=ID block=GlobalProtocolBlock - public Group getGroup() { return cGroup; } - - //"rec" - public Keyword getRecKeyword_0() { return cRecKeyword_0; } - - //label=ID - public Assignment getLabelAssignment_1() { return cLabelAssignment_1; } - - //ID - public RuleCall getLabelIDTerminalRuleCall_1_0() { return cLabelIDTerminalRuleCall_1_0; } - - //block=GlobalProtocolBlock - public Assignment getBlockAssignment_2() { return cBlockAssignment_2; } - - //GlobalProtocolBlock - public RuleCall getBlockGlobalProtocolBlockParserRuleCall_2_0() { return cBlockGlobalProtocolBlockParserRuleCall_2_0; } - } - - public class GlobalContinueElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "GlobalContinue"); - private final Group cGroup = (Group)rule.eContents().get(1); - private final Keyword cContinueKeyword_0 = (Keyword)cGroup.eContents().get(0); - private final Assignment cLabelAssignment_1 = (Assignment)cGroup.eContents().get(1); - private final RuleCall cLabelIDTerminalRuleCall_1_0 = (RuleCall)cLabelAssignment_1.eContents().get(0); - private final Keyword cSemicolonKeyword_2 = (Keyword)cGroup.eContents().get(2); - - //GlobalContinue: - // "continue" label=ID ";"; - public ParserRule getRule() { return rule; } - - //"continue" label=ID ";" - public Group getGroup() { return cGroup; } - - //"continue" - public Keyword getContinueKeyword_0() { return cContinueKeyword_0; } - - //label=ID - public Assignment getLabelAssignment_1() { return cLabelAssignment_1; } - - //ID - public RuleCall getLabelIDTerminalRuleCall_1_0() { return cLabelIDTerminalRuleCall_1_0; } - - //";" - public Keyword getSemicolonKeyword_2() { return cSemicolonKeyword_2; } - } - - public class GlobalParallelElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "GlobalParallel"); - private final Group cGroup = (Group)rule.eContents().get(1); - private final Keyword cParKeyword_0 = (Keyword)cGroup.eContents().get(0); - private final Assignment cBlocksAssignment_1 = (Assignment)cGroup.eContents().get(1); - private final RuleCall cBlocksGlobalProtocolBlockParserRuleCall_1_0 = (RuleCall)cBlocksAssignment_1.eContents().get(0); - private final Group cGroup_2 = (Group)cGroup.eContents().get(2); - private final Keyword cAndKeyword_2_0 = (Keyword)cGroup_2.eContents().get(0); - private final Assignment cBlocksAssignment_2_1 = (Assignment)cGroup_2.eContents().get(1); - private final RuleCall cBlocksGlobalProtocolBlockParserRuleCall_2_1_0 = (RuleCall)cBlocksAssignment_2_1.eContents().get(0); - - /// ** - // * Section 3.7.7 Global Parallel - // * / GlobalParallel: - // "par" blocks+=GlobalProtocolBlock ("and" blocks+=GlobalProtocolBlock)*; - public ParserRule getRule() { return rule; } - - //"par" blocks+=GlobalProtocolBlock ("and" blocks+=GlobalProtocolBlock)* - public Group getGroup() { return cGroup; } - - //"par" - public Keyword getParKeyword_0() { return cParKeyword_0; } - - //blocks+=GlobalProtocolBlock - public Assignment getBlocksAssignment_1() { return cBlocksAssignment_1; } - - //GlobalProtocolBlock - public RuleCall getBlocksGlobalProtocolBlockParserRuleCall_1_0() { return cBlocksGlobalProtocolBlockParserRuleCall_1_0; } - - //("and" blocks+=GlobalProtocolBlock)* - public Group getGroup_2() { return cGroup_2; } - - //"and" - public Keyword getAndKeyword_2_0() { return cAndKeyword_2_0; } - - //blocks+=GlobalProtocolBlock - public Assignment getBlocksAssignment_2_1() { return cBlocksAssignment_2_1; } - - //GlobalProtocolBlock - public RuleCall getBlocksGlobalProtocolBlockParserRuleCall_2_1_0() { return cBlocksGlobalProtocolBlockParserRuleCall_2_1_0; } - } - - public class GlobalInterruptibleElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "GlobalInterruptible"); - private final Group cGroup = (Group)rule.eContents().get(1); - private final Keyword cInterruptibleKeyword_0 = (Keyword)cGroup.eContents().get(0); - private final Group cGroup_1 = (Group)cGroup.eContents().get(1); - private final Assignment cScopeAssignment_1_0 = (Assignment)cGroup_1.eContents().get(0); - private final RuleCall cScopeIDTerminalRuleCall_1_0_0 = (RuleCall)cScopeAssignment_1_0.eContents().get(0); - private final Keyword cColonKeyword_1_1 = (Keyword)cGroup_1.eContents().get(1); - private final Assignment cBlockAssignment_2 = (Assignment)cGroup.eContents().get(2); - private final RuleCall cBlockGlobalProtocolBlockParserRuleCall_2_0 = (RuleCall)cBlockAssignment_2.eContents().get(0); - private final Keyword cWithKeyword_3 = (Keyword)cGroup.eContents().get(3); - private final Keyword cLeftCurlyBracketKeyword_4 = (Keyword)cGroup.eContents().get(4); - private final Assignment cInterruptsAssignment_5 = (Assignment)cGroup.eContents().get(5); - private final RuleCall cInterruptsGlobalInterruptParserRuleCall_5_0 = (RuleCall)cInterruptsAssignment_5.eContents().get(0); - private final Keyword cRightCurlyBracketKeyword_6 = (Keyword)cGroup.eContents().get(6); - - /// ** - // * Section 3.7.8 Global Interruptible - // * / GlobalInterruptible: - // "interruptible" (scope=ID ":")? block=GlobalProtocolBlock "with" "{" interrupts+=GlobalInterrupt* "}"; - public ParserRule getRule() { return rule; } - - //"interruptible" (scope=ID ":")? block=GlobalProtocolBlock "with" "{" interrupts+=GlobalInterrupt* "}" - public Group getGroup() { return cGroup; } - - //"interruptible" - public Keyword getInterruptibleKeyword_0() { return cInterruptibleKeyword_0; } - - //(scope=ID ":")? - public Group getGroup_1() { return cGroup_1; } - - //scope=ID - public Assignment getScopeAssignment_1_0() { return cScopeAssignment_1_0; } - - //ID - public RuleCall getScopeIDTerminalRuleCall_1_0_0() { return cScopeIDTerminalRuleCall_1_0_0; } - - //":" - public Keyword getColonKeyword_1_1() { return cColonKeyword_1_1; } - - //block=GlobalProtocolBlock - public Assignment getBlockAssignment_2() { return cBlockAssignment_2; } - - //GlobalProtocolBlock - public RuleCall getBlockGlobalProtocolBlockParserRuleCall_2_0() { return cBlockGlobalProtocolBlockParserRuleCall_2_0; } - - //"with" - public Keyword getWithKeyword_3() { return cWithKeyword_3; } - - //"{" - public Keyword getLeftCurlyBracketKeyword_4() { return cLeftCurlyBracketKeyword_4; } - - //interrupts+=GlobalInterrupt* - public Assignment getInterruptsAssignment_5() { return cInterruptsAssignment_5; } - - //GlobalInterrupt - public RuleCall getInterruptsGlobalInterruptParserRuleCall_5_0() { return cInterruptsGlobalInterruptParserRuleCall_5_0; } - - //"}" - public Keyword getRightCurlyBracketKeyword_6() { return cRightCurlyBracketKeyword_6; } - } - - public class GlobalInterruptElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "GlobalInterrupt"); - private final Group cGroup = (Group)rule.eContents().get(1); - private final Assignment cMessagesAssignment_0 = (Assignment)cGroup.eContents().get(0); - private final RuleCall cMessagesMessageParserRuleCall_0_0 = (RuleCall)cMessagesAssignment_0.eContents().get(0); - private final Group cGroup_1 = (Group)cGroup.eContents().get(1); - private final Keyword cCommaKeyword_1_0 = (Keyword)cGroup_1.eContents().get(0); - private final Assignment cMessagesAssignment_1_1 = (Assignment)cGroup_1.eContents().get(1); - private final RuleCall cMessagesMessageParserRuleCall_1_1_0 = (RuleCall)cMessagesAssignment_1_1.eContents().get(0); - private final Keyword cByKeyword_2 = (Keyword)cGroup.eContents().get(2); - private final Assignment cRoleAssignment_3 = (Assignment)cGroup.eContents().get(3); - private final RuleCall cRoleIDTerminalRuleCall_3_0 = (RuleCall)cRoleAssignment_3.eContents().get(0); - private final Keyword cSemicolonKeyword_4 = (Keyword)cGroup.eContents().get(4); - - //GlobalInterrupt: - // messages+=Message ("," messages+=Message)* "by" role=ID ";"; - public ParserRule getRule() { return rule; } - - //messages+=Message ("," messages+=Message)* "by" role=ID ";" - public Group getGroup() { return cGroup; } - - //messages+=Message - public Assignment getMessagesAssignment_0() { return cMessagesAssignment_0; } - - //Message - public RuleCall getMessagesMessageParserRuleCall_0_0() { return cMessagesMessageParserRuleCall_0_0; } - - //("," messages+=Message)* - public Group getGroup_1() { return cGroup_1; } - - //"," - public Keyword getCommaKeyword_1_0() { return cCommaKeyword_1_0; } - - //messages+=Message - public Assignment getMessagesAssignment_1_1() { return cMessagesAssignment_1_1; } - - //Message - public RuleCall getMessagesMessageParserRuleCall_1_1_0() { return cMessagesMessageParserRuleCall_1_1_0; } - - //"by" - public Keyword getByKeyword_2() { return cByKeyword_2; } - - //role=ID - public Assignment getRoleAssignment_3() { return cRoleAssignment_3; } - - //ID - public RuleCall getRoleIDTerminalRuleCall_3_0() { return cRoleIDTerminalRuleCall_3_0; } - - //";" - public Keyword getSemicolonKeyword_4() { return cSemicolonKeyword_4; } - } - - public class GlobalDoElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "GlobalDo"); - private final Group cGroup = (Group)rule.eContents().get(1); - private final Keyword cDoKeyword_0 = (Keyword)cGroup.eContents().get(0); - private final Group cGroup_1 = (Group)cGroup.eContents().get(1); - private final Assignment cScopeAssignment_1_0 = (Assignment)cGroup_1.eContents().get(0); - private final RuleCall cScopeIDTerminalRuleCall_1_0_0 = (RuleCall)cScopeAssignment_1_0.eContents().get(0); - private final Keyword cColonKeyword_1_1 = (Keyword)cGroup_1.eContents().get(1); - private final Assignment cMemberAssignment_2 = (Assignment)cGroup.eContents().get(2); - private final RuleCall cMemberIDTerminalRuleCall_2_0 = (RuleCall)cMemberAssignment_2.eContents().get(0); - private final Group cGroup_3 = (Group)cGroup.eContents().get(3); - private final Keyword cLessThanSignKeyword_3_0 = (Keyword)cGroup_3.eContents().get(0); - private final Assignment cArgumentsAssignment_3_1 = (Assignment)cGroup_3.eContents().get(1); - private final RuleCall cArgumentsArgumentParserRuleCall_3_1_0 = (RuleCall)cArgumentsAssignment_3_1.eContents().get(0); - private final Group cGroup_3_2 = (Group)cGroup_3.eContents().get(2); - private final Keyword cCommaKeyword_3_2_0 = (Keyword)cGroup_3_2.eContents().get(0); - private final Assignment cArgumentsAssignment_3_2_1 = (Assignment)cGroup_3_2.eContents().get(1); - private final RuleCall cArgumentsArgumentParserRuleCall_3_2_1_0 = (RuleCall)cArgumentsAssignment_3_2_1.eContents().get(0); - private final Keyword cGreaterThanSignKeyword_3_3 = (Keyword)cGroup_3.eContents().get(3); - private final Keyword cLeftParenthesisKeyword_4 = (Keyword)cGroup.eContents().get(4); - private final Assignment cRolesAssignment_5 = (Assignment)cGroup.eContents().get(5); - private final RuleCall cRolesRoleInstantiationParserRuleCall_5_0 = (RuleCall)cRolesAssignment_5.eContents().get(0); - private final Group cGroup_6 = (Group)cGroup.eContents().get(6); - private final Keyword cCommaKeyword_6_0 = (Keyword)cGroup_6.eContents().get(0); - private final Assignment cRolesAssignment_6_1 = (Assignment)cGroup_6.eContents().get(1); - private final RuleCall cRolesRoleInstantiationParserRuleCall_6_1_0 = (RuleCall)cRolesAssignment_6_1.eContents().get(0); - private final Keyword cRightParenthesisKeyword_7 = (Keyword)cGroup.eContents().get(7); - private final Keyword cSemicolonKeyword_8 = (Keyword)cGroup.eContents().get(8); - - /// ** - // * Section 3.7.9 Global Do - // * / GlobalDo: - // "do" (scope=ID ":")? member=ID ("<" arguments+=Argument ("," arguments+=Argument)* ">")? "(" roles+=RoleInstantiation - // ("," roles+=RoleInstantiation)* ")" ";"; - public ParserRule getRule() { return rule; } - - //"do" (scope=ID ":")? member=ID ("<" arguments+=Argument ("," arguments+=Argument)* ">")? "(" roles+=RoleInstantiation - //("," roles+=RoleInstantiation)* ")" ";" - public Group getGroup() { return cGroup; } - - //"do" - public Keyword getDoKeyword_0() { return cDoKeyword_0; } - - //(scope=ID ":")? - public Group getGroup_1() { return cGroup_1; } - - //scope=ID - public Assignment getScopeAssignment_1_0() { return cScopeAssignment_1_0; } - - //ID - public RuleCall getScopeIDTerminalRuleCall_1_0_0() { return cScopeIDTerminalRuleCall_1_0_0; } - - //":" - public Keyword getColonKeyword_1_1() { return cColonKeyword_1_1; } - - //member=ID - public Assignment getMemberAssignment_2() { return cMemberAssignment_2; } - - //ID - public RuleCall getMemberIDTerminalRuleCall_2_0() { return cMemberIDTerminalRuleCall_2_0; } - - //("<" arguments+=Argument ("," arguments+=Argument)* ">")? - public Group getGroup_3() { return cGroup_3; } - - //"<" - public Keyword getLessThanSignKeyword_3_0() { return cLessThanSignKeyword_3_0; } - - //arguments+=Argument - public Assignment getArgumentsAssignment_3_1() { return cArgumentsAssignment_3_1; } - - //Argument - public RuleCall getArgumentsArgumentParserRuleCall_3_1_0() { return cArgumentsArgumentParserRuleCall_3_1_0; } - - //("," arguments+=Argument)* - public Group getGroup_3_2() { return cGroup_3_2; } - - //"," - public Keyword getCommaKeyword_3_2_0() { return cCommaKeyword_3_2_0; } - - //arguments+=Argument - public Assignment getArgumentsAssignment_3_2_1() { return cArgumentsAssignment_3_2_1; } - - //Argument - public RuleCall getArgumentsArgumentParserRuleCall_3_2_1_0() { return cArgumentsArgumentParserRuleCall_3_2_1_0; } - - //">" - public Keyword getGreaterThanSignKeyword_3_3() { return cGreaterThanSignKeyword_3_3; } - - //"(" - public Keyword getLeftParenthesisKeyword_4() { return cLeftParenthesisKeyword_4; } - - //roles+=RoleInstantiation - public Assignment getRolesAssignment_5() { return cRolesAssignment_5; } - - //RoleInstantiation - public RuleCall getRolesRoleInstantiationParserRuleCall_5_0() { return cRolesRoleInstantiationParserRuleCall_5_0; } - - //("," roles+=RoleInstantiation)* - public Group getGroup_6() { return cGroup_6; } - - //"," - public Keyword getCommaKeyword_6_0() { return cCommaKeyword_6_0; } - - //roles+=RoleInstantiation - public Assignment getRolesAssignment_6_1() { return cRolesAssignment_6_1; } - - //RoleInstantiation - public RuleCall getRolesRoleInstantiationParserRuleCall_6_1_0() { return cRolesRoleInstantiationParserRuleCall_6_1_0; } - - //")" - public Keyword getRightParenthesisKeyword_7() { return cRightParenthesisKeyword_7; } - - //";" - public Keyword getSemicolonKeyword_8() { return cSemicolonKeyword_8; } - } - - public class LocalProtocolDeclElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "LocalProtocolDecl"); - private final Group cGroup = (Group)rule.eContents().get(1); - private final Keyword cLocalKeyword_0 = (Keyword)cGroup.eContents().get(0); - private final Keyword cProtocolKeyword_1 = (Keyword)cGroup.eContents().get(1); - private final Assignment cNameAssignment_2 = (Assignment)cGroup.eContents().get(2); - private final RuleCall cNameIDTerminalRuleCall_2_0 = (RuleCall)cNameAssignment_2.eContents().get(0); - private final Keyword cAtKeyword_3 = (Keyword)cGroup.eContents().get(3); - private final Assignment cRoleAssignment_4 = (Assignment)cGroup.eContents().get(4); - private final RuleCall cRoleIDTerminalRuleCall_4_0 = (RuleCall)cRoleAssignment_4.eContents().get(0); - private final Group cGroup_5 = (Group)cGroup.eContents().get(5); - private final Keyword cLessThanSignKeyword_5_0 = (Keyword)cGroup_5.eContents().get(0); - private final Assignment cParametersAssignment_5_1 = (Assignment)cGroup_5.eContents().get(1); - private final RuleCall cParametersParameterDeclParserRuleCall_5_1_0 = (RuleCall)cParametersAssignment_5_1.eContents().get(0); - private final Group cGroup_5_2 = (Group)cGroup_5.eContents().get(2); - private final Keyword cCommaKeyword_5_2_0 = (Keyword)cGroup_5_2.eContents().get(0); - private final Assignment cParametersAssignment_5_2_1 = (Assignment)cGroup_5_2.eContents().get(1); - private final RuleCall cParametersParameterDeclParserRuleCall_5_2_1_0 = (RuleCall)cParametersAssignment_5_2_1.eContents().get(0); - private final Keyword cGreaterThanSignKeyword_5_3 = (Keyword)cGroup_5.eContents().get(3); - private final Keyword cLeftParenthesisKeyword_6 = (Keyword)cGroup.eContents().get(6); - private final Assignment cRolesAssignment_7 = (Assignment)cGroup.eContents().get(7); - private final RuleCall cRolesRoleDeclParserRuleCall_7_0 = (RuleCall)cRolesAssignment_7.eContents().get(0); - private final Group cGroup_8 = (Group)cGroup.eContents().get(8); - private final Keyword cCommaKeyword_8_0 = (Keyword)cGroup_8.eContents().get(0); - private final Assignment cRolesAssignment_8_1 = (Assignment)cGroup_8.eContents().get(1); - private final RuleCall cRolesRoleDeclParserRuleCall_8_1_0 = (RuleCall)cRolesAssignment_8_1.eContents().get(0); - private final Keyword cRightParenthesisKeyword_9 = (Keyword)cGroup.eContents().get(9); - private final Alternatives cAlternatives_10 = (Alternatives)cGroup.eContents().get(10); - private final Assignment cBlockAssignment_10_0 = (Assignment)cAlternatives_10.eContents().get(0); - private final RuleCall cBlockLocalProtocolBlockParserRuleCall_10_0_0 = (RuleCall)cBlockAssignment_10_0.eContents().get(0); - private final Group cGroup_10_1 = (Group)cAlternatives_10.eContents().get(1); - private final Keyword cInstantiatesKeyword_10_1_0 = (Keyword)cGroup_10_1.eContents().get(0); - private final Assignment cInstantiatesAssignment_10_1_1 = (Assignment)cGroup_10_1.eContents().get(1); - private final RuleCall cInstantiatesIDTerminalRuleCall_10_1_1_0 = (RuleCall)cInstantiatesAssignment_10_1_1.eContents().get(0); - private final Group cGroup_10_1_2 = (Group)cGroup_10_1.eContents().get(2); - private final Keyword cLessThanSignKeyword_10_1_2_0 = (Keyword)cGroup_10_1_2.eContents().get(0); - private final Assignment cArgumentsAssignment_10_1_2_1 = (Assignment)cGroup_10_1_2.eContents().get(1); - private final RuleCall cArgumentsArgumentParserRuleCall_10_1_2_1_0 = (RuleCall)cArgumentsAssignment_10_1_2_1.eContents().get(0); - private final Group cGroup_10_1_2_2 = (Group)cGroup_10_1_2.eContents().get(2); - private final Keyword cCommaKeyword_10_1_2_2_0 = (Keyword)cGroup_10_1_2_2.eContents().get(0); - private final Assignment cArgumentsAssignment_10_1_2_2_1 = (Assignment)cGroup_10_1_2_2.eContents().get(1); - private final RuleCall cArgumentsArgumentParserRuleCall_10_1_2_2_1_0 = (RuleCall)cArgumentsAssignment_10_1_2_2_1.eContents().get(0); - private final Keyword cGreaterThanSignKeyword_10_1_2_3 = (Keyword)cGroup_10_1_2.eContents().get(3); - private final Keyword cLeftParenthesisKeyword_10_1_3 = (Keyword)cGroup_10_1.eContents().get(3); - private final Assignment cRoleInstantiationsAssignment_10_1_4 = (Assignment)cGroup_10_1.eContents().get(4); - private final RuleCall cRoleInstantiationsRoleInstantiationParserRuleCall_10_1_4_0 = (RuleCall)cRoleInstantiationsAssignment_10_1_4.eContents().get(0); - private final Group cGroup_10_1_5 = (Group)cGroup_10_1.eContents().get(5); - private final Keyword cCommaKeyword_10_1_5_0 = (Keyword)cGroup_10_1_5.eContents().get(0); - private final Assignment cRoleInstantiationsAssignment_10_1_5_1 = (Assignment)cGroup_10_1_5.eContents().get(1); - private final RuleCall cRoleInstantiationsRoleInstantiationParserRuleCall_10_1_5_1_0 = (RuleCall)cRoleInstantiationsAssignment_10_1_5_1.eContents().get(0); - private final Keyword cRightParenthesisKeyword_10_1_6 = (Keyword)cGroup_10_1.eContents().get(6); - private final Keyword cSemicolonKeyword_10_1_7 = (Keyword)cGroup_10_1.eContents().get(7); - - /// * - // * Section 3.8 Local Protocol Declarations - // * / LocalProtocolDecl: - // "local" "protocol" name=ID "at" role=ID ("<" parameters+=ParameterDecl ("," parameters+=ParameterDecl)* ">")? "(" - // roles+=RoleDecl ("," roles+=RoleDecl)* ")" (block=LocalProtocolBlock | "instantiates" instantiates=ID ("<" - // arguments+=Argument ("," arguments+=Argument)* ">")? "(" roleInstantiations+=RoleInstantiation ("," - // roleInstantiations+=RoleInstantiation)* ")" ";"); - public ParserRule getRule() { return rule; } - - //"local" "protocol" name=ID "at" role=ID ("<" parameters+=ParameterDecl ("," parameters+=ParameterDecl)* ">")? "(" - //roles+=RoleDecl ("," roles+=RoleDecl)* ")" (block=LocalProtocolBlock | "instantiates" instantiates=ID ("<" - //arguments+=Argument ("," arguments+=Argument)* ">")? "(" roleInstantiations+=RoleInstantiation ("," - //roleInstantiations+=RoleInstantiation)* ")" ";") - public Group getGroup() { return cGroup; } - - //"local" - public Keyword getLocalKeyword_0() { return cLocalKeyword_0; } - - //"protocol" - public Keyword getProtocolKeyword_1() { return cProtocolKeyword_1; } - - //name=ID - public Assignment getNameAssignment_2() { return cNameAssignment_2; } - - //ID - public RuleCall getNameIDTerminalRuleCall_2_0() { return cNameIDTerminalRuleCall_2_0; } - - //"at" - public Keyword getAtKeyword_3() { return cAtKeyword_3; } - - //role=ID - public Assignment getRoleAssignment_4() { return cRoleAssignment_4; } - - //ID - public RuleCall getRoleIDTerminalRuleCall_4_0() { return cRoleIDTerminalRuleCall_4_0; } - - //("<" parameters+=ParameterDecl ("," parameters+=ParameterDecl)* ">")? - public Group getGroup_5() { return cGroup_5; } - - //"<" - public Keyword getLessThanSignKeyword_5_0() { return cLessThanSignKeyword_5_0; } - - //parameters+=ParameterDecl - public Assignment getParametersAssignment_5_1() { return cParametersAssignment_5_1; } - - //ParameterDecl - public RuleCall getParametersParameterDeclParserRuleCall_5_1_0() { return cParametersParameterDeclParserRuleCall_5_1_0; } - - //("," parameters+=ParameterDecl)* - public Group getGroup_5_2() { return cGroup_5_2; } - - //"," - public Keyword getCommaKeyword_5_2_0() { return cCommaKeyword_5_2_0; } - - //parameters+=ParameterDecl - public Assignment getParametersAssignment_5_2_1() { return cParametersAssignment_5_2_1; } - - //ParameterDecl - public RuleCall getParametersParameterDeclParserRuleCall_5_2_1_0() { return cParametersParameterDeclParserRuleCall_5_2_1_0; } - - //">" - public Keyword getGreaterThanSignKeyword_5_3() { return cGreaterThanSignKeyword_5_3; } - - //"(" - public Keyword getLeftParenthesisKeyword_6() { return cLeftParenthesisKeyword_6; } - - //roles+=RoleDecl - public Assignment getRolesAssignment_7() { return cRolesAssignment_7; } - - //RoleDecl - public RuleCall getRolesRoleDeclParserRuleCall_7_0() { return cRolesRoleDeclParserRuleCall_7_0; } - - //("," roles+=RoleDecl)* - public Group getGroup_8() { return cGroup_8; } - - //"," - public Keyword getCommaKeyword_8_0() { return cCommaKeyword_8_0; } - - //roles+=RoleDecl - public Assignment getRolesAssignment_8_1() { return cRolesAssignment_8_1; } - - //RoleDecl - public RuleCall getRolesRoleDeclParserRuleCall_8_1_0() { return cRolesRoleDeclParserRuleCall_8_1_0; } - - //")" - public Keyword getRightParenthesisKeyword_9() { return cRightParenthesisKeyword_9; } - - //block=LocalProtocolBlock | "instantiates" instantiates=ID ("<" arguments+=Argument ("," arguments+=Argument)* ">")? "(" - //roleInstantiations+=RoleInstantiation ("," roleInstantiations+=RoleInstantiation)* ")" ";" - public Alternatives getAlternatives_10() { return cAlternatives_10; } - - //block=LocalProtocolBlock - public Assignment getBlockAssignment_10_0() { return cBlockAssignment_10_0; } - - //LocalProtocolBlock - public RuleCall getBlockLocalProtocolBlockParserRuleCall_10_0_0() { return cBlockLocalProtocolBlockParserRuleCall_10_0_0; } - - //"instantiates" instantiates=ID ("<" arguments+=Argument ("," arguments+=Argument)* ">")? "(" - //roleInstantiations+=RoleInstantiation ("," roleInstantiations+=RoleInstantiation)* ")" ";" - public Group getGroup_10_1() { return cGroup_10_1; } - - //"instantiates" - public Keyword getInstantiatesKeyword_10_1_0() { return cInstantiatesKeyword_10_1_0; } - - //instantiates=ID - public Assignment getInstantiatesAssignment_10_1_1() { return cInstantiatesAssignment_10_1_1; } - - //ID - public RuleCall getInstantiatesIDTerminalRuleCall_10_1_1_0() { return cInstantiatesIDTerminalRuleCall_10_1_1_0; } - - //("<" arguments+=Argument ("," arguments+=Argument)* ">")? - public Group getGroup_10_1_2() { return cGroup_10_1_2; } - - //"<" - public Keyword getLessThanSignKeyword_10_1_2_0() { return cLessThanSignKeyword_10_1_2_0; } - - //arguments+=Argument - public Assignment getArgumentsAssignment_10_1_2_1() { return cArgumentsAssignment_10_1_2_1; } - - //Argument - public RuleCall getArgumentsArgumentParserRuleCall_10_1_2_1_0() { return cArgumentsArgumentParserRuleCall_10_1_2_1_0; } - - //("," arguments+=Argument)* - public Group getGroup_10_1_2_2() { return cGroup_10_1_2_2; } - - //"," - public Keyword getCommaKeyword_10_1_2_2_0() { return cCommaKeyword_10_1_2_2_0; } - - //arguments+=Argument - public Assignment getArgumentsAssignment_10_1_2_2_1() { return cArgumentsAssignment_10_1_2_2_1; } - - //Argument - public RuleCall getArgumentsArgumentParserRuleCall_10_1_2_2_1_0() { return cArgumentsArgumentParserRuleCall_10_1_2_2_1_0; } - - //">" - public Keyword getGreaterThanSignKeyword_10_1_2_3() { return cGreaterThanSignKeyword_10_1_2_3; } - - //"(" - public Keyword getLeftParenthesisKeyword_10_1_3() { return cLeftParenthesisKeyword_10_1_3; } - - //roleInstantiations+=RoleInstantiation - public Assignment getRoleInstantiationsAssignment_10_1_4() { return cRoleInstantiationsAssignment_10_1_4; } - - //RoleInstantiation - public RuleCall getRoleInstantiationsRoleInstantiationParserRuleCall_10_1_4_0() { return cRoleInstantiationsRoleInstantiationParserRuleCall_10_1_4_0; } - - //("," roleInstantiations+=RoleInstantiation)* - public Group getGroup_10_1_5() { return cGroup_10_1_5; } - - //"," - public Keyword getCommaKeyword_10_1_5_0() { return cCommaKeyword_10_1_5_0; } - - //roleInstantiations+=RoleInstantiation - public Assignment getRoleInstantiationsAssignment_10_1_5_1() { return cRoleInstantiationsAssignment_10_1_5_1; } - - //RoleInstantiation - public RuleCall getRoleInstantiationsRoleInstantiationParserRuleCall_10_1_5_1_0() { return cRoleInstantiationsRoleInstantiationParserRuleCall_10_1_5_1_0; } - - //")" - public Keyword getRightParenthesisKeyword_10_1_6() { return cRightParenthesisKeyword_10_1_6; } - - //";" - public Keyword getSemicolonKeyword_10_1_7() { return cSemicolonKeyword_10_1_7; } - } - - public class LocalProtocolBlockElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "LocalProtocolBlock"); - private final Group cGroup = (Group)rule.eContents().get(1); - private final Action cLocalProtocolBlockAction_0 = (Action)cGroup.eContents().get(0); - private final Keyword cLeftCurlyBracketKeyword_1 = (Keyword)cGroup.eContents().get(1); - private final Assignment cActivitiesAssignment_2 = (Assignment)cGroup.eContents().get(2); - private final RuleCall cActivitiesLlobalInteractionParserRuleCall_2_0 = (RuleCall)cActivitiesAssignment_2.eContents().get(0); - private final Keyword cRightCurlyBracketKeyword_3 = (Keyword)cGroup.eContents().get(3); - - /// ** - // * Section 3.8.3 Local Interaction Blocks and Sequences - // * / LocalProtocolBlock: - // {LocalProtocolBlock} "{" activities+=LlobalInteraction* "}"; - public ParserRule getRule() { return rule; } - - //{LocalProtocolBlock} "{" activities+=LlobalInteraction* "}" - public Group getGroup() { return cGroup; } - - //{LocalProtocolBlock} - public Action getLocalProtocolBlockAction_0() { return cLocalProtocolBlockAction_0; } - - //"{" - public Keyword getLeftCurlyBracketKeyword_1() { return cLeftCurlyBracketKeyword_1; } - - //activities+=LlobalInteraction* - public Assignment getActivitiesAssignment_2() { return cActivitiesAssignment_2; } - - //LlobalInteraction - public RuleCall getActivitiesLlobalInteractionParserRuleCall_2_0() { return cActivitiesLlobalInteractionParserRuleCall_2_0; } - - //"}" - public Keyword getRightCurlyBracketKeyword_3() { return cRightCurlyBracketKeyword_3; } - } - - public class LlobalInteractionElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "LlobalInteraction"); - private final Alternatives cAlternatives = (Alternatives)rule.eContents().get(1); - private final RuleCall cLocalSendParserRuleCall_0 = (RuleCall)cAlternatives.eContents().get(0); - private final RuleCall cLocalReceiveParserRuleCall_1 = (RuleCall)cAlternatives.eContents().get(1); - private final RuleCall cLocalChoiceParserRuleCall_2 = (RuleCall)cAlternatives.eContents().get(2); - private final RuleCall cLocalParallelParserRuleCall_3 = (RuleCall)cAlternatives.eContents().get(3); - private final RuleCall cLocalRecursionParserRuleCall_4 = (RuleCall)cAlternatives.eContents().get(4); - private final RuleCall cLocalContinueParserRuleCall_5 = (RuleCall)cAlternatives.eContents().get(5); - private final RuleCall cLocalInterruptibleParserRuleCall_6 = (RuleCall)cAlternatives.eContents().get(6); - private final RuleCall cLocalDoParserRuleCall_7 = (RuleCall)cAlternatives.eContents().get(7); - - /// *| - // localspawn* / LlobalInteraction: - // LocalSend | LocalReceive | LocalChoice | LocalParallel | LocalRecursion | LocalContinue | LocalInterruptible | - // LocalDo; - public ParserRule getRule() { return rule; } - - //LocalSend | LocalReceive | LocalChoice | LocalParallel | LocalRecursion | LocalContinue | LocalInterruptible | LocalDo - public Alternatives getAlternatives() { return cAlternatives; } - - //LocalSend - public RuleCall getLocalSendParserRuleCall_0() { return cLocalSendParserRuleCall_0; } - - //LocalReceive - public RuleCall getLocalReceiveParserRuleCall_1() { return cLocalReceiveParserRuleCall_1; } - - //LocalChoice - public RuleCall getLocalChoiceParserRuleCall_2() { return cLocalChoiceParserRuleCall_2; } - - //LocalParallel - public RuleCall getLocalParallelParserRuleCall_3() { return cLocalParallelParserRuleCall_3; } - - //LocalRecursion - public RuleCall getLocalRecursionParserRuleCall_4() { return cLocalRecursionParserRuleCall_4; } - - //LocalContinue - public RuleCall getLocalContinueParserRuleCall_5() { return cLocalContinueParserRuleCall_5; } - - //LocalInterruptible - public RuleCall getLocalInterruptibleParserRuleCall_6() { return cLocalInterruptibleParserRuleCall_6; } - - //LocalDo - public RuleCall getLocalDoParserRuleCall_7() { return cLocalDoParserRuleCall_7; } - } - - public class LocalSendElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "LocalSend"); - private final Group cGroup = (Group)rule.eContents().get(1); - private final Assignment cMessageAssignment_0 = (Assignment)cGroup.eContents().get(0); - private final RuleCall cMessageMessageParserRuleCall_0_0 = (RuleCall)cMessageAssignment_0.eContents().get(0); - private final Keyword cToKeyword_1 = (Keyword)cGroup.eContents().get(1); - private final Assignment cToRolesAssignment_2 = (Assignment)cGroup.eContents().get(2); - private final RuleCall cToRolesIDTerminalRuleCall_2_0 = (RuleCall)cToRolesAssignment_2.eContents().get(0); - private final Group cGroup_3 = (Group)cGroup.eContents().get(3); - private final Keyword cCommaKeyword_3_0 = (Keyword)cGroup_3.eContents().get(0); - private final Assignment cToRolesAssignment_3_1 = (Assignment)cGroup_3.eContents().get(1); - private final RuleCall cToRolesIDTerminalRuleCall_3_1_0 = (RuleCall)cToRolesAssignment_3_1.eContents().get(0); - private final Keyword cSemicolonKeyword_4 = (Keyword)cGroup.eContents().get(4); - - /// ** - // * Section 3.8.4 Local Send and Receive - // * / LocalSend: - // message=Message "to" toRoles+=ID ("," toRoles+=ID)* ";"; - public ParserRule getRule() { return rule; } - - //message=Message "to" toRoles+=ID ("," toRoles+=ID)* ";" - public Group getGroup() { return cGroup; } - - //message=Message - public Assignment getMessageAssignment_0() { return cMessageAssignment_0; } - - //Message - public RuleCall getMessageMessageParserRuleCall_0_0() { return cMessageMessageParserRuleCall_0_0; } - - //"to" - public Keyword getToKeyword_1() { return cToKeyword_1; } - - //toRoles+=ID - public Assignment getToRolesAssignment_2() { return cToRolesAssignment_2; } - - //ID - public RuleCall getToRolesIDTerminalRuleCall_2_0() { return cToRolesIDTerminalRuleCall_2_0; } - - //("," toRoles+=ID)* - public Group getGroup_3() { return cGroup_3; } - - //"," - public Keyword getCommaKeyword_3_0() { return cCommaKeyword_3_0; } - - //toRoles+=ID - public Assignment getToRolesAssignment_3_1() { return cToRolesAssignment_3_1; } - - //ID - public RuleCall getToRolesIDTerminalRuleCall_3_1_0() { return cToRolesIDTerminalRuleCall_3_1_0; } - - //";" - public Keyword getSemicolonKeyword_4() { return cSemicolonKeyword_4; } - } - - public class LocalReceiveElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "LocalReceive"); - private final Group cGroup = (Group)rule.eContents().get(1); - private final Assignment cMessageAssignment_0 = (Assignment)cGroup.eContents().get(0); - private final RuleCall cMessageMessageParserRuleCall_0_0 = (RuleCall)cMessageAssignment_0.eContents().get(0); - private final Keyword cFromKeyword_1 = (Keyword)cGroup.eContents().get(1); - private final Assignment cFromRoleAssignment_2 = (Assignment)cGroup.eContents().get(2); - private final RuleCall cFromRoleIDTerminalRuleCall_2_0 = (RuleCall)cFromRoleAssignment_2.eContents().get(0); - private final Keyword cSemicolonKeyword_3 = (Keyword)cGroup.eContents().get(3); - - //LocalReceive: - // message=Message "from" fromRole=ID ";"; - public ParserRule getRule() { return rule; } - - //message=Message "from" fromRole=ID ";" - public Group getGroup() { return cGroup; } - - //message=Message - public Assignment getMessageAssignment_0() { return cMessageAssignment_0; } - - //Message - public RuleCall getMessageMessageParserRuleCall_0_0() { return cMessageMessageParserRuleCall_0_0; } - - //"from" - public Keyword getFromKeyword_1() { return cFromKeyword_1; } - - //fromRole=ID - public Assignment getFromRoleAssignment_2() { return cFromRoleAssignment_2; } - - //ID - public RuleCall getFromRoleIDTerminalRuleCall_2_0() { return cFromRoleIDTerminalRuleCall_2_0; } - - //";" - public Keyword getSemicolonKeyword_3() { return cSemicolonKeyword_3; } - } - - public class LocalChoiceElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "LocalChoice"); - private final Group cGroup = (Group)rule.eContents().get(1); - private final Keyword cChoiceKeyword_0 = (Keyword)cGroup.eContents().get(0); - private final Keyword cAtKeyword_1 = (Keyword)cGroup.eContents().get(1); - private final Assignment cRoleAssignment_2 = (Assignment)cGroup.eContents().get(2); - private final RuleCall cRoleIDTerminalRuleCall_2_0 = (RuleCall)cRoleAssignment_2.eContents().get(0); - private final Assignment cBlocksAssignment_3 = (Assignment)cGroup.eContents().get(3); - private final RuleCall cBlocksLocalProtocolBlockParserRuleCall_3_0 = (RuleCall)cBlocksAssignment_3.eContents().get(0); - private final Group cGroup_4 = (Group)cGroup.eContents().get(4); - private final Keyword cOrKeyword_4_0 = (Keyword)cGroup_4.eContents().get(0); - private final Assignment cBlocksAssignment_4_1 = (Assignment)cGroup_4.eContents().get(1); - private final RuleCall cBlocksLocalProtocolBlockParserRuleCall_4_1_0 = (RuleCall)cBlocksAssignment_4_1.eContents().get(0); - - /// ** - // * Section 3.8.5 Local Choice - // * / LocalChoice: - // "choice" "at" role=ID blocks+=LocalProtocolBlock ("or" blocks+=LocalProtocolBlock)*; - public ParserRule getRule() { return rule; } - - //"choice" "at" role=ID blocks+=LocalProtocolBlock ("or" blocks+=LocalProtocolBlock)* - public Group getGroup() { return cGroup; } - - //"choice" - public Keyword getChoiceKeyword_0() { return cChoiceKeyword_0; } - - //"at" - public Keyword getAtKeyword_1() { return cAtKeyword_1; } - - //role=ID - public Assignment getRoleAssignment_2() { return cRoleAssignment_2; } - - //ID - public RuleCall getRoleIDTerminalRuleCall_2_0() { return cRoleIDTerminalRuleCall_2_0; } - - //blocks+=LocalProtocolBlock - public Assignment getBlocksAssignment_3() { return cBlocksAssignment_3; } - - //LocalProtocolBlock - public RuleCall getBlocksLocalProtocolBlockParserRuleCall_3_0() { return cBlocksLocalProtocolBlockParserRuleCall_3_0; } - - //("or" blocks+=LocalProtocolBlock)* - public Group getGroup_4() { return cGroup_4; } - - //"or" - public Keyword getOrKeyword_4_0() { return cOrKeyword_4_0; } - - //blocks+=LocalProtocolBlock - public Assignment getBlocksAssignment_4_1() { return cBlocksAssignment_4_1; } - - //LocalProtocolBlock - public RuleCall getBlocksLocalProtocolBlockParserRuleCall_4_1_0() { return cBlocksLocalProtocolBlockParserRuleCall_4_1_0; } - } - - public class LocalRecursionElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "LocalRecursion"); - private final Group cGroup = (Group)rule.eContents().get(1); - private final Keyword cRecKeyword_0 = (Keyword)cGroup.eContents().get(0); - private final Assignment cLabelAssignment_1 = (Assignment)cGroup.eContents().get(1); - private final RuleCall cLabelIDTerminalRuleCall_1_0 = (RuleCall)cLabelAssignment_1.eContents().get(0); - private final Assignment cBlockAssignment_2 = (Assignment)cGroup.eContents().get(2); - private final RuleCall cBlockLocalProtocolBlockParserRuleCall_2_0 = (RuleCall)cBlockAssignment_2.eContents().get(0); - - /// ** - // * Section 3.8.6 Local Recursion - // * / LocalRecursion: - // "rec" label=ID block=LocalProtocolBlock; - public ParserRule getRule() { return rule; } - - //"rec" label=ID block=LocalProtocolBlock - public Group getGroup() { return cGroup; } - - //"rec" - public Keyword getRecKeyword_0() { return cRecKeyword_0; } - - //label=ID - public Assignment getLabelAssignment_1() { return cLabelAssignment_1; } - - //ID - public RuleCall getLabelIDTerminalRuleCall_1_0() { return cLabelIDTerminalRuleCall_1_0; } - - //block=LocalProtocolBlock - public Assignment getBlockAssignment_2() { return cBlockAssignment_2; } - - //LocalProtocolBlock - public RuleCall getBlockLocalProtocolBlockParserRuleCall_2_0() { return cBlockLocalProtocolBlockParserRuleCall_2_0; } - } - - public class LocalContinueElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "LocalContinue"); - private final Group cGroup = (Group)rule.eContents().get(1); - private final Keyword cContinueKeyword_0 = (Keyword)cGroup.eContents().get(0); - private final Assignment cLabelAssignment_1 = (Assignment)cGroup.eContents().get(1); - private final RuleCall cLabelIDTerminalRuleCall_1_0 = (RuleCall)cLabelAssignment_1.eContents().get(0); - private final Keyword cSemicolonKeyword_2 = (Keyword)cGroup.eContents().get(2); - - //LocalContinue: - // "continue" label=ID ";"; - public ParserRule getRule() { return rule; } - - //"continue" label=ID ";" - public Group getGroup() { return cGroup; } - - //"continue" - public Keyword getContinueKeyword_0() { return cContinueKeyword_0; } - - //label=ID - public Assignment getLabelAssignment_1() { return cLabelAssignment_1; } - - //ID - public RuleCall getLabelIDTerminalRuleCall_1_0() { return cLabelIDTerminalRuleCall_1_0; } - - //";" - public Keyword getSemicolonKeyword_2() { return cSemicolonKeyword_2; } - } - - public class LocalParallelElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "LocalParallel"); - private final Group cGroup = (Group)rule.eContents().get(1); - private final Keyword cParKeyword_0 = (Keyword)cGroup.eContents().get(0); - private final Assignment cBlocksAssignment_1 = (Assignment)cGroup.eContents().get(1); - private final RuleCall cBlocksLocalProtocolBlockParserRuleCall_1_0 = (RuleCall)cBlocksAssignment_1.eContents().get(0); - private final Group cGroup_2 = (Group)cGroup.eContents().get(2); - private final Keyword cAndKeyword_2_0 = (Keyword)cGroup_2.eContents().get(0); - private final Assignment cBlocksAssignment_2_1 = (Assignment)cGroup_2.eContents().get(1); - private final RuleCall cBlocksLocalProtocolBlockParserRuleCall_2_1_0 = (RuleCall)cBlocksAssignment_2_1.eContents().get(0); - - /// ** - // * Section 3.8.7 Local Parallel - // * / LocalParallel: - // "par" blocks+=LocalProtocolBlock ("and" blocks+=LocalProtocolBlock)*; - public ParserRule getRule() { return rule; } - - //"par" blocks+=LocalProtocolBlock ("and" blocks+=LocalProtocolBlock)* - public Group getGroup() { return cGroup; } - - //"par" - public Keyword getParKeyword_0() { return cParKeyword_0; } - - //blocks+=LocalProtocolBlock - public Assignment getBlocksAssignment_1() { return cBlocksAssignment_1; } - - //LocalProtocolBlock - public RuleCall getBlocksLocalProtocolBlockParserRuleCall_1_0() { return cBlocksLocalProtocolBlockParserRuleCall_1_0; } - - //("and" blocks+=LocalProtocolBlock)* - public Group getGroup_2() { return cGroup_2; } - - //"and" - public Keyword getAndKeyword_2_0() { return cAndKeyword_2_0; } - - //blocks+=LocalProtocolBlock - public Assignment getBlocksAssignment_2_1() { return cBlocksAssignment_2_1; } - - //LocalProtocolBlock - public RuleCall getBlocksLocalProtocolBlockParserRuleCall_2_1_0() { return cBlocksLocalProtocolBlockParserRuleCall_2_1_0; } - } - - public class LocalInterruptibleElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "LocalInterruptible"); - private final Group cGroup = (Group)rule.eContents().get(1); - private final Keyword cInterruptibleKeyword_0 = (Keyword)cGroup.eContents().get(0); - private final Group cGroup_1 = (Group)cGroup.eContents().get(1); - private final Assignment cScopeAssignment_1_0 = (Assignment)cGroup_1.eContents().get(0); - private final RuleCall cScopeIDTerminalRuleCall_1_0_0 = (RuleCall)cScopeAssignment_1_0.eContents().get(0); - private final Keyword cColonKeyword_1_1 = (Keyword)cGroup_1.eContents().get(1); - private final Assignment cBlockAssignment_2 = (Assignment)cGroup.eContents().get(2); - private final RuleCall cBlockLocalProtocolBlockParserRuleCall_2_0 = (RuleCall)cBlockAssignment_2.eContents().get(0); - private final Keyword cWithKeyword_3 = (Keyword)cGroup.eContents().get(3); - private final Keyword cLeftCurlyBracketKeyword_4 = (Keyword)cGroup.eContents().get(4); - private final Assignment cThrowAssignment_5 = (Assignment)cGroup.eContents().get(5); - private final RuleCall cThrowLocalThrowParserRuleCall_5_0 = (RuleCall)cThrowAssignment_5.eContents().get(0); - private final Assignment cCatchesAssignment_6 = (Assignment)cGroup.eContents().get(6); - private final RuleCall cCatchesLocalCatchParserRuleCall_6_0 = (RuleCall)cCatchesAssignment_6.eContents().get(0); - private final Keyword cRightCurlyBracketKeyword_7 = (Keyword)cGroup.eContents().get(7); - - /// ** - // * Section 3.8.8 Local Interruptible - // * / LocalInterruptible: - // "interruptible" (scope=ID ":")? block=LocalProtocolBlock "with" "{" throw=LocalThrow? catches+=LocalCatch* "}"; - public ParserRule getRule() { return rule; } - - //"interruptible" (scope=ID ":")? block=LocalProtocolBlock "with" "{" throw=LocalThrow? catches+=LocalCatch* "}" - public Group getGroup() { return cGroup; } - - //"interruptible" - public Keyword getInterruptibleKeyword_0() { return cInterruptibleKeyword_0; } - - //(scope=ID ":")? - public Group getGroup_1() { return cGroup_1; } - - //scope=ID - public Assignment getScopeAssignment_1_0() { return cScopeAssignment_1_0; } - - //ID - public RuleCall getScopeIDTerminalRuleCall_1_0_0() { return cScopeIDTerminalRuleCall_1_0_0; } - - //":" - public Keyword getColonKeyword_1_1() { return cColonKeyword_1_1; } - - //block=LocalProtocolBlock - public Assignment getBlockAssignment_2() { return cBlockAssignment_2; } - - //LocalProtocolBlock - public RuleCall getBlockLocalProtocolBlockParserRuleCall_2_0() { return cBlockLocalProtocolBlockParserRuleCall_2_0; } - - //"with" - public Keyword getWithKeyword_3() { return cWithKeyword_3; } - - //"{" - public Keyword getLeftCurlyBracketKeyword_4() { return cLeftCurlyBracketKeyword_4; } - - //throw=LocalThrow? - public Assignment getThrowAssignment_5() { return cThrowAssignment_5; } - - //LocalThrow - public RuleCall getThrowLocalThrowParserRuleCall_5_0() { return cThrowLocalThrowParserRuleCall_5_0; } - - //catches+=LocalCatch* - public Assignment getCatchesAssignment_6() { return cCatchesAssignment_6; } - - //LocalCatch - public RuleCall getCatchesLocalCatchParserRuleCall_6_0() { return cCatchesLocalCatchParserRuleCall_6_0; } - - //"}" - public Keyword getRightCurlyBracketKeyword_7() { return cRightCurlyBracketKeyword_7; } - } - - public class LocalThrowElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "LocalThrow"); - private final Group cGroup = (Group)rule.eContents().get(1); - private final Keyword cThrowKeyword_0 = (Keyword)cGroup.eContents().get(0); - private final Assignment cMessagesAssignment_1 = (Assignment)cGroup.eContents().get(1); - private final RuleCall cMessagesMessageParserRuleCall_1_0 = (RuleCall)cMessagesAssignment_1.eContents().get(0); - private final Group cGroup_2 = (Group)cGroup.eContents().get(2); - private final Keyword cCommaKeyword_2_0 = (Keyword)cGroup_2.eContents().get(0); - private final Assignment cMessagesAssignment_2_1 = (Assignment)cGroup_2.eContents().get(1); - private final RuleCall cMessagesMessageParserRuleCall_2_1_0 = (RuleCall)cMessagesAssignment_2_1.eContents().get(0); - private final Keyword cToKeyword_3 = (Keyword)cGroup.eContents().get(3); - private final Assignment cToRolesAssignment_4 = (Assignment)cGroup.eContents().get(4); - private final RuleCall cToRolesIDTerminalRuleCall_4_0 = (RuleCall)cToRolesAssignment_4.eContents().get(0); - private final Group cGroup_5 = (Group)cGroup.eContents().get(5); - private final Keyword cCommaKeyword_5_0 = (Keyword)cGroup_5.eContents().get(0); - private final Assignment cToRolesAssignment_5_1 = (Assignment)cGroup_5.eContents().get(1); - private final RuleCall cToRolesIDTerminalRuleCall_5_1_0 = (RuleCall)cToRolesAssignment_5_1.eContents().get(0); - private final Keyword cSemicolonKeyword_6 = (Keyword)cGroup.eContents().get(6); - - //LocalThrow: - // "throw" messages+=Message ("," messages+=Message)* "to" toRoles+=ID ("," toRoles+=ID)* ";"; - public ParserRule getRule() { return rule; } - - //"throw" messages+=Message ("," messages+=Message)* "to" toRoles+=ID ("," toRoles+=ID)* ";" - public Group getGroup() { return cGroup; } - - //"throw" - public Keyword getThrowKeyword_0() { return cThrowKeyword_0; } - - //messages+=Message - public Assignment getMessagesAssignment_1() { return cMessagesAssignment_1; } - - //Message - public RuleCall getMessagesMessageParserRuleCall_1_0() { return cMessagesMessageParserRuleCall_1_0; } - - //("," messages+=Message)* - public Group getGroup_2() { return cGroup_2; } - - //"," - public Keyword getCommaKeyword_2_0() { return cCommaKeyword_2_0; } - - //messages+=Message - public Assignment getMessagesAssignment_2_1() { return cMessagesAssignment_2_1; } - - //Message - public RuleCall getMessagesMessageParserRuleCall_2_1_0() { return cMessagesMessageParserRuleCall_2_1_0; } - - //"to" - public Keyword getToKeyword_3() { return cToKeyword_3; } - - //toRoles+=ID - public Assignment getToRolesAssignment_4() { return cToRolesAssignment_4; } - - //ID - public RuleCall getToRolesIDTerminalRuleCall_4_0() { return cToRolesIDTerminalRuleCall_4_0; } - - //("," toRoles+=ID)* - public Group getGroup_5() { return cGroup_5; } - - //"," - public Keyword getCommaKeyword_5_0() { return cCommaKeyword_5_0; } - - //toRoles+=ID - public Assignment getToRolesAssignment_5_1() { return cToRolesAssignment_5_1; } - - //ID - public RuleCall getToRolesIDTerminalRuleCall_5_1_0() { return cToRolesIDTerminalRuleCall_5_1_0; } - - //";" - public Keyword getSemicolonKeyword_6() { return cSemicolonKeyword_6; } - } - - public class LocalCatchElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "LocalCatch"); - private final Group cGroup = (Group)rule.eContents().get(1); - private final Keyword cCatchesKeyword_0 = (Keyword)cGroup.eContents().get(0); - private final Assignment cMessagesAssignment_1 = (Assignment)cGroup.eContents().get(1); - private final RuleCall cMessagesMessageParserRuleCall_1_0 = (RuleCall)cMessagesAssignment_1.eContents().get(0); - private final Group cGroup_2 = (Group)cGroup.eContents().get(2); - private final Keyword cCommaKeyword_2_0 = (Keyword)cGroup_2.eContents().get(0); - private final Assignment cMessagesAssignment_2_1 = (Assignment)cGroup_2.eContents().get(1); - private final RuleCall cMessagesMessageParserRuleCall_2_1_0 = (RuleCall)cMessagesAssignment_2_1.eContents().get(0); - private final Keyword cFromKeyword_3 = (Keyword)cGroup.eContents().get(3); - private final Assignment cFromRoleAssignment_4 = (Assignment)cGroup.eContents().get(4); - private final RuleCall cFromRoleIDTerminalRuleCall_4_0 = (RuleCall)cFromRoleAssignment_4.eContents().get(0); - private final Keyword cSemicolonKeyword_5 = (Keyword)cGroup.eContents().get(5); - - //LocalCatch: - // "catches" messages+=Message ("," messages+=Message)* "from" fromRole=ID ";"; - public ParserRule getRule() { return rule; } - - //"catches" messages+=Message ("," messages+=Message)* "from" fromRole=ID ";" - public Group getGroup() { return cGroup; } - - //"catches" - public Keyword getCatchesKeyword_0() { return cCatchesKeyword_0; } - - //messages+=Message - public Assignment getMessagesAssignment_1() { return cMessagesAssignment_1; } - - //Message - public RuleCall getMessagesMessageParserRuleCall_1_0() { return cMessagesMessageParserRuleCall_1_0; } - - //("," messages+=Message)* - public Group getGroup_2() { return cGroup_2; } - - //"," - public Keyword getCommaKeyword_2_0() { return cCommaKeyword_2_0; } - - //messages+=Message - public Assignment getMessagesAssignment_2_1() { return cMessagesAssignment_2_1; } - - //Message - public RuleCall getMessagesMessageParserRuleCall_2_1_0() { return cMessagesMessageParserRuleCall_2_1_0; } - - //"from" - public Keyword getFromKeyword_3() { return cFromKeyword_3; } - - //fromRole=ID - public Assignment getFromRoleAssignment_4() { return cFromRoleAssignment_4; } - - //ID - public RuleCall getFromRoleIDTerminalRuleCall_4_0() { return cFromRoleIDTerminalRuleCall_4_0; } - - //";" - public Keyword getSemicolonKeyword_5() { return cSemicolonKeyword_5; } - } - - public class LocalDoElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "LocalDo"); - private final Group cGroup = (Group)rule.eContents().get(1); - private final Keyword cDoKeyword_0 = (Keyword)cGroup.eContents().get(0); - private final Group cGroup_1 = (Group)cGroup.eContents().get(1); - private final Assignment cScopeAssignment_1_0 = (Assignment)cGroup_1.eContents().get(0); - private final RuleCall cScopeIDTerminalRuleCall_1_0_0 = (RuleCall)cScopeAssignment_1_0.eContents().get(0); - private final Keyword cColonKeyword_1_1 = (Keyword)cGroup_1.eContents().get(1); - private final Assignment cMemberAssignment_2 = (Assignment)cGroup.eContents().get(2); - private final RuleCall cMemberIDTerminalRuleCall_2_0 = (RuleCall)cMemberAssignment_2.eContents().get(0); - private final Group cGroup_3 = (Group)cGroup.eContents().get(3); - private final Keyword cLessThanSignKeyword_3_0 = (Keyword)cGroup_3.eContents().get(0); - private final Assignment cArgumentsAssignment_3_1 = (Assignment)cGroup_3.eContents().get(1); - private final RuleCall cArgumentsArgumentParserRuleCall_3_1_0 = (RuleCall)cArgumentsAssignment_3_1.eContents().get(0); - private final Group cGroup_3_2 = (Group)cGroup_3.eContents().get(2); - private final Keyword cCommaKeyword_3_2_0 = (Keyword)cGroup_3_2.eContents().get(0); - private final Assignment cArgumentsAssignment_3_2_1 = (Assignment)cGroup_3_2.eContents().get(1); - private final RuleCall cArgumentsArgumentParserRuleCall_3_2_1_0 = (RuleCall)cArgumentsAssignment_3_2_1.eContents().get(0); - private final Keyword cGreaterThanSignKeyword_3_3 = (Keyword)cGroup_3.eContents().get(3); - private final Keyword cLeftParenthesisKeyword_4 = (Keyword)cGroup.eContents().get(4); - private final Assignment cRolesAssignment_5 = (Assignment)cGroup.eContents().get(5); - private final RuleCall cRolesRoleInstantiationParserRuleCall_5_0 = (RuleCall)cRolesAssignment_5.eContents().get(0); - private final Group cGroup_6 = (Group)cGroup.eContents().get(6); - private final Keyword cCommaKeyword_6_0 = (Keyword)cGroup_6.eContents().get(0); - private final Assignment cRolesAssignment_6_1 = (Assignment)cGroup_6.eContents().get(1); - private final RuleCall cRolesRoleInstantiationParserRuleCall_6_1_0 = (RuleCall)cRolesAssignment_6_1.eContents().get(0); - private final Keyword cRightParenthesisKeyword_7 = (Keyword)cGroup.eContents().get(7); - private final Keyword cSemicolonKeyword_8 = (Keyword)cGroup.eContents().get(8); - - /// ** - // * Section 3.8.9 Local Do - // * / LocalDo: - // "do" (scope=ID ":")? member=ID ("<" arguments+=Argument ("," arguments+=Argument)* ">")? "(" roles+=RoleInstantiation - // ("," roles+=RoleInstantiation)* ")" ";"; - public ParserRule getRule() { return rule; } - - //"do" (scope=ID ":")? member=ID ("<" arguments+=Argument ("," arguments+=Argument)* ">")? "(" roles+=RoleInstantiation - //("," roles+=RoleInstantiation)* ")" ";" - public Group getGroup() { return cGroup; } - - //"do" - public Keyword getDoKeyword_0() { return cDoKeyword_0; } - - //(scope=ID ":")? - public Group getGroup_1() { return cGroup_1; } - - //scope=ID - public Assignment getScopeAssignment_1_0() { return cScopeAssignment_1_0; } - - //ID - public RuleCall getScopeIDTerminalRuleCall_1_0_0() { return cScopeIDTerminalRuleCall_1_0_0; } - - //":" - public Keyword getColonKeyword_1_1() { return cColonKeyword_1_1; } - - //member=ID - public Assignment getMemberAssignment_2() { return cMemberAssignment_2; } - - //ID - public RuleCall getMemberIDTerminalRuleCall_2_0() { return cMemberIDTerminalRuleCall_2_0; } - - //("<" arguments+=Argument ("," arguments+=Argument)* ">")? - public Group getGroup_3() { return cGroup_3; } - - //"<" - public Keyword getLessThanSignKeyword_3_0() { return cLessThanSignKeyword_3_0; } - - //arguments+=Argument - public Assignment getArgumentsAssignment_3_1() { return cArgumentsAssignment_3_1; } - - //Argument - public RuleCall getArgumentsArgumentParserRuleCall_3_1_0() { return cArgumentsArgumentParserRuleCall_3_1_0; } - - //("," arguments+=Argument)* - public Group getGroup_3_2() { return cGroup_3_2; } - - //"," - public Keyword getCommaKeyword_3_2_0() { return cCommaKeyword_3_2_0; } - - //arguments+=Argument - public Assignment getArgumentsAssignment_3_2_1() { return cArgumentsAssignment_3_2_1; } - - //Argument - public RuleCall getArgumentsArgumentParserRuleCall_3_2_1_0() { return cArgumentsArgumentParserRuleCall_3_2_1_0; } - - //">" - public Keyword getGreaterThanSignKeyword_3_3() { return cGreaterThanSignKeyword_3_3; } - - //"(" - public Keyword getLeftParenthesisKeyword_4() { return cLeftParenthesisKeyword_4; } - - //roles+=RoleInstantiation - public Assignment getRolesAssignment_5() { return cRolesAssignment_5; } - - //RoleInstantiation - public RuleCall getRolesRoleInstantiationParserRuleCall_5_0() { return cRolesRoleInstantiationParserRuleCall_5_0; } - - //("," roles+=RoleInstantiation)* - public Group getGroup_6() { return cGroup_6; } - - //"," - public Keyword getCommaKeyword_6_0() { return cCommaKeyword_6_0; } - - //roles+=RoleInstantiation - public Assignment getRolesAssignment_6_1() { return cRolesAssignment_6_1; } - - //RoleInstantiation - public RuleCall getRolesRoleInstantiationParserRuleCall_6_1_0() { return cRolesRoleInstantiationParserRuleCall_6_1_0; } - - //")" - public Keyword getRightParenthesisKeyword_7() { return cRightParenthesisKeyword_7; } - - //";" - public Keyword getSemicolonKeyword_8() { return cSemicolonKeyword_8; } - } - - - private ModuleElements pModule; - private ModuleNameElements pModuleName; - private ImportDeclElements pImportDecl; - private ImportModuleElements pImportModule; - private ImportMemberElements pImportMember; - private PayloadTypeDeclElements pPayloadTypeDecl; - private MessageSignatureElements pMessageSignature; - private PayloadElementElements pPayloadElement; - private GlobalProtocolDeclElements pGlobalProtocolDecl; - private RoleDeclElements pRoleDecl; - private ParameterDeclElements pParameterDecl; - private RoleInstantiationElements pRoleInstantiation; - private ArgumentElements pArgument; - private GlobalProtocolBlockElements pGlobalProtocolBlock; - private GlobalInteractionElements pGlobalInteraction; - private GlobalMessageTransferElements pGlobalMessageTransfer; - private MessageElements pMessage; - private GlobalChoiceElements pGlobalChoice; - private GlobalRecursionElements pGlobalRecursion; - private GlobalContinueElements pGlobalContinue; - private GlobalParallelElements pGlobalParallel; - private GlobalInterruptibleElements pGlobalInterruptible; - private GlobalInterruptElements pGlobalInterrupt; - private GlobalDoElements pGlobalDo; - private LocalProtocolDeclElements pLocalProtocolDecl; - private LocalProtocolBlockElements pLocalProtocolBlock; - private LlobalInteractionElements pLlobalInteraction; - private LocalSendElements pLocalSend; - private LocalReceiveElements pLocalReceive; - private LocalChoiceElements pLocalChoice; - private LocalRecursionElements pLocalRecursion; - private LocalContinueElements pLocalContinue; - private LocalParallelElements pLocalParallel; - private LocalInterruptibleElements pLocalInterruptible; - private LocalThrowElements pLocalThrow; - private LocalCatchElements pLocalCatch; - private LocalDoElements pLocalDo; - - private final Grammar grammar; - - private TerminalsGrammarAccess gaTerminals; - - @Inject - public ScribbleDslGrammarAccess(GrammarProvider grammarProvider, - TerminalsGrammarAccess gaTerminals) { - this.grammar = internalFindGrammar(grammarProvider); - this.gaTerminals = gaTerminals; - } - - protected Grammar internalFindGrammar(GrammarProvider grammarProvider) { - Grammar grammar = grammarProvider.getGrammar(this); - while (grammar != null) { - if ("org.scribble.editor.dsl.ScribbleDsl".equals(grammar.getName())) { - return grammar; - } - List grammars = grammar.getUsedGrammars(); - if (!grammars.isEmpty()) { - grammar = grammars.iterator().next(); - } else { - return null; - } - } - return grammar; - } - - - public Grammar getGrammar() { - return grammar; - } - - - public TerminalsGrammarAccess getTerminalsGrammarAccess() { - return gaTerminals; - } - - - //Module: - // "module" name=ModuleName ";" imports+=ImportDecl* types+=PayloadTypeDecl* (globals+=GlobalProtocolDecl | - // locals+=LocalProtocolDecl)*; - public ModuleElements getModuleAccess() { - return (pModule != null) ? pModule : (pModule = new ModuleElements()); - } - - public ParserRule getModuleRule() { - return getModuleAccess().getRule(); - } - - //ModuleName: - // ID ("." ID)*; - public ModuleNameElements getModuleNameAccess() { - return (pModuleName != null) ? pModuleName : (pModuleName = new ModuleNameElements()); - } - - public ParserRule getModuleNameRule() { - return getModuleNameAccess().getRule(); - } - - //ImportDecl: - // ImportModule | ImportMember; - public ImportDeclElements getImportDeclAccess() { - return (pImportDecl != null) ? pImportDecl : (pImportDecl = new ImportDeclElements()); - } - - public ParserRule getImportDeclRule() { - return getImportDeclAccess().getRule(); - } - - //ImportModule: - // "import" name=ModuleName ("as" alias=ID)? ";"; - public ImportModuleElements getImportModuleAccess() { - return (pImportModule != null) ? pImportModule : (pImportModule = new ImportModuleElements()); - } - - public ParserRule getImportModuleRule() { - return getImportModuleAccess().getRule(); - } - - //ImportMember: - // "from" name=ModuleName "import" member=ID ("as" alias=ID)? ";"; - public ImportMemberElements getImportMemberAccess() { - return (pImportMember != null) ? pImportMember : (pImportMember = new ImportMemberElements()); - } - - public ParserRule getImportMemberRule() { - return getImportMemberAccess().getRule(); - } - - //PayloadTypeDecl: - // "type" "<" schema=ID ">" type=STRING "from" location=STRING "as" alias=ID ";"; - public PayloadTypeDeclElements getPayloadTypeDeclAccess() { - return (pPayloadTypeDecl != null) ? pPayloadTypeDecl : (pPayloadTypeDecl = new PayloadTypeDeclElements()); - } - - public ParserRule getPayloadTypeDeclRule() { - return getPayloadTypeDeclAccess().getRule(); - } - - /// ** - // * Section 3.5 Message Signatures - // * / MessageSignature: - // {MessageSignature} operator=ID? "(" (types+=PayloadElement ("," types+=PayloadElement)*)? ")"; - public MessageSignatureElements getMessageSignatureAccess() { - return (pMessageSignature != null) ? pMessageSignature : (pMessageSignature = new MessageSignatureElements()); - } - - public ParserRule getMessageSignatureRule() { - return getMessageSignatureAccess().getRule(); - } - - //PayloadElement: - // (name=ID ":")? type=ID; - public PayloadElementElements getPayloadElementAccess() { - return (pPayloadElement != null) ? pPayloadElement : (pPayloadElement = new PayloadElementElements()); - } - - public ParserRule getPayloadElementRule() { - return getPayloadElementAccess().getRule(); - } - - //GlobalProtocolDecl: - // "global" "protocol" name=ID ("<" parameters+=ParameterDecl ("," parameters+=ParameterDecl)* ">")? "(" roles+=RoleDecl - // ("," roles+=RoleDecl)* ")" (block=GlobalProtocolBlock | "instantiates" instantiates=ID ("<" arguments+=Argument ("," - // arguments+=Argument)* ">")? "(" roleInstantiations+=RoleInstantiation ("," roleInstantiations+=RoleInstantiation)* ")" - // ";"); - public GlobalProtocolDeclElements getGlobalProtocolDeclAccess() { - return (pGlobalProtocolDecl != null) ? pGlobalProtocolDecl : (pGlobalProtocolDecl = new GlobalProtocolDeclElements()); - } - - public ParserRule getGlobalProtocolDeclRule() { - return getGlobalProtocolDeclAccess().getRule(); - } - - //RoleDecl: - // "role" name=ID ("as" alias=ID)?; - public RoleDeclElements getRoleDeclAccess() { - return (pRoleDecl != null) ? pRoleDecl : (pRoleDecl = new RoleDeclElements()); - } - - public ParserRule getRoleDeclRule() { - return getRoleDeclAccess().getRule(); - } - - //ParameterDecl: - // "type" name=ID ("as" alias=ID)? | "sig" name=ID ("as" alias=ID)?; - public ParameterDeclElements getParameterDeclAccess() { - return (pParameterDecl != null) ? pParameterDecl : (pParameterDecl = new ParameterDeclElements()); - } - - public ParserRule getParameterDeclRule() { - return getParameterDeclAccess().getRule(); - } - - //RoleInstantiation: - // name=ID ("as" alias=ID)?; - public RoleInstantiationElements getRoleInstantiationAccess() { - return (pRoleInstantiation != null) ? pRoleInstantiation : (pRoleInstantiation = new RoleInstantiationElements()); - } - - public ParserRule getRoleInstantiationRule() { - return getRoleInstantiationAccess().getRule(); - } - - //Argument: - // signature=MessageSignature ("as" alias=ID)? | name=ID ("as" alias=ID)?; - public ArgumentElements getArgumentAccess() { - return (pArgument != null) ? pArgument : (pArgument = new ArgumentElements()); - } - - public ParserRule getArgumentRule() { - return getArgumentAccess().getRule(); - } - - /// ** - // * Section 3.7.3 Global Interaction Sequences and Blocks - // * / GlobalProtocolBlock: - // {GlobalProtocolBlock} "{" activities+=GlobalInteraction* "}"; - public GlobalProtocolBlockElements getGlobalProtocolBlockAccess() { - return (pGlobalProtocolBlock != null) ? pGlobalProtocolBlock : (pGlobalProtocolBlock = new GlobalProtocolBlockElements()); - } - - public ParserRule getGlobalProtocolBlockRule() { - return getGlobalProtocolBlockAccess().getRule(); - } - - /// *| - // globalspawn* / GlobalInteraction: - // GlobalMessageTransfer | GlobalChoice | GlobalRecursion | GlobalContinue | GlobalParallel | GlobalInterruptible | - // GlobalDo; - public GlobalInteractionElements getGlobalInteractionAccess() { - return (pGlobalInteraction != null) ? pGlobalInteraction : (pGlobalInteraction = new GlobalInteractionElements()); - } - - public ParserRule getGlobalInteractionRule() { - return getGlobalInteractionAccess().getRule(); - } - - /// ** - // * Section 3.7.4 Global Message Transfer - // * / GlobalMessageTransfer: - // message=Message "from" fromRole=ID "to" toRoles+=ID ("," toRoles+=ID)* ";"; - public GlobalMessageTransferElements getGlobalMessageTransferAccess() { - return (pGlobalMessageTransfer != null) ? pGlobalMessageTransfer : (pGlobalMessageTransfer = new GlobalMessageTransferElements()); - } - - public ParserRule getGlobalMessageTransferRule() { - return getGlobalMessageTransferAccess().getRule(); - } - - //Message: - // signature=MessageSignature | parameter=ID; - public MessageElements getMessageAccess() { - return (pMessage != null) ? pMessage : (pMessage = new MessageElements()); - } - - public ParserRule getMessageRule() { - return getMessageAccess().getRule(); - } - - /// ** - // * Section 3.7.5 Global Choice - // * / GlobalChoice: - // "choice" "at" role=ID blocks+=GlobalProtocolBlock ("or" blocks+=GlobalProtocolBlock)*; - public GlobalChoiceElements getGlobalChoiceAccess() { - return (pGlobalChoice != null) ? pGlobalChoice : (pGlobalChoice = new GlobalChoiceElements()); - } - - public ParserRule getGlobalChoiceRule() { - return getGlobalChoiceAccess().getRule(); - } - - /// ** - // * Section 3.7.6 Global Recursion - // * / GlobalRecursion: - // "rec" label=ID block=GlobalProtocolBlock; - public GlobalRecursionElements getGlobalRecursionAccess() { - return (pGlobalRecursion != null) ? pGlobalRecursion : (pGlobalRecursion = new GlobalRecursionElements()); - } - - public ParserRule getGlobalRecursionRule() { - return getGlobalRecursionAccess().getRule(); - } - - //GlobalContinue: - // "continue" label=ID ";"; - public GlobalContinueElements getGlobalContinueAccess() { - return (pGlobalContinue != null) ? pGlobalContinue : (pGlobalContinue = new GlobalContinueElements()); - } - - public ParserRule getGlobalContinueRule() { - return getGlobalContinueAccess().getRule(); - } - - /// ** - // * Section 3.7.7 Global Parallel - // * / GlobalParallel: - // "par" blocks+=GlobalProtocolBlock ("and" blocks+=GlobalProtocolBlock)*; - public GlobalParallelElements getGlobalParallelAccess() { - return (pGlobalParallel != null) ? pGlobalParallel : (pGlobalParallel = new GlobalParallelElements()); - } - - public ParserRule getGlobalParallelRule() { - return getGlobalParallelAccess().getRule(); - } - - /// ** - // * Section 3.7.8 Global Interruptible - // * / GlobalInterruptible: - // "interruptible" (scope=ID ":")? block=GlobalProtocolBlock "with" "{" interrupts+=GlobalInterrupt* "}"; - public GlobalInterruptibleElements getGlobalInterruptibleAccess() { - return (pGlobalInterruptible != null) ? pGlobalInterruptible : (pGlobalInterruptible = new GlobalInterruptibleElements()); - } - - public ParserRule getGlobalInterruptibleRule() { - return getGlobalInterruptibleAccess().getRule(); - } - - //GlobalInterrupt: - // messages+=Message ("," messages+=Message)* "by" role=ID ";"; - public GlobalInterruptElements getGlobalInterruptAccess() { - return (pGlobalInterrupt != null) ? pGlobalInterrupt : (pGlobalInterrupt = new GlobalInterruptElements()); - } - - public ParserRule getGlobalInterruptRule() { - return getGlobalInterruptAccess().getRule(); - } - - /// ** - // * Section 3.7.9 Global Do - // * / GlobalDo: - // "do" (scope=ID ":")? member=ID ("<" arguments+=Argument ("," arguments+=Argument)* ">")? "(" roles+=RoleInstantiation - // ("," roles+=RoleInstantiation)* ")" ";"; - public GlobalDoElements getGlobalDoAccess() { - return (pGlobalDo != null) ? pGlobalDo : (pGlobalDo = new GlobalDoElements()); - } - - public ParserRule getGlobalDoRule() { - return getGlobalDoAccess().getRule(); - } - - /// * - // * Section 3.8 Local Protocol Declarations - // * / LocalProtocolDecl: - // "local" "protocol" name=ID "at" role=ID ("<" parameters+=ParameterDecl ("," parameters+=ParameterDecl)* ">")? "(" - // roles+=RoleDecl ("," roles+=RoleDecl)* ")" (block=LocalProtocolBlock | "instantiates" instantiates=ID ("<" - // arguments+=Argument ("," arguments+=Argument)* ">")? "(" roleInstantiations+=RoleInstantiation ("," - // roleInstantiations+=RoleInstantiation)* ")" ";"); - public LocalProtocolDeclElements getLocalProtocolDeclAccess() { - return (pLocalProtocolDecl != null) ? pLocalProtocolDecl : (pLocalProtocolDecl = new LocalProtocolDeclElements()); - } - - public ParserRule getLocalProtocolDeclRule() { - return getLocalProtocolDeclAccess().getRule(); - } - - /// ** - // * Section 3.8.3 Local Interaction Blocks and Sequences - // * / LocalProtocolBlock: - // {LocalProtocolBlock} "{" activities+=LlobalInteraction* "}"; - public LocalProtocolBlockElements getLocalProtocolBlockAccess() { - return (pLocalProtocolBlock != null) ? pLocalProtocolBlock : (pLocalProtocolBlock = new LocalProtocolBlockElements()); - } - - public ParserRule getLocalProtocolBlockRule() { - return getLocalProtocolBlockAccess().getRule(); - } - - /// *| - // localspawn* / LlobalInteraction: - // LocalSend | LocalReceive | LocalChoice | LocalParallel | LocalRecursion | LocalContinue | LocalInterruptible | - // LocalDo; - public LlobalInteractionElements getLlobalInteractionAccess() { - return (pLlobalInteraction != null) ? pLlobalInteraction : (pLlobalInteraction = new LlobalInteractionElements()); - } - - public ParserRule getLlobalInteractionRule() { - return getLlobalInteractionAccess().getRule(); - } - - /// ** - // * Section 3.8.4 Local Send and Receive - // * / LocalSend: - // message=Message "to" toRoles+=ID ("," toRoles+=ID)* ";"; - public LocalSendElements getLocalSendAccess() { - return (pLocalSend != null) ? pLocalSend : (pLocalSend = new LocalSendElements()); - } - - public ParserRule getLocalSendRule() { - return getLocalSendAccess().getRule(); - } - - //LocalReceive: - // message=Message "from" fromRole=ID ";"; - public LocalReceiveElements getLocalReceiveAccess() { - return (pLocalReceive != null) ? pLocalReceive : (pLocalReceive = new LocalReceiveElements()); - } - - public ParserRule getLocalReceiveRule() { - return getLocalReceiveAccess().getRule(); - } - - /// ** - // * Section 3.8.5 Local Choice - // * / LocalChoice: - // "choice" "at" role=ID blocks+=LocalProtocolBlock ("or" blocks+=LocalProtocolBlock)*; - public LocalChoiceElements getLocalChoiceAccess() { - return (pLocalChoice != null) ? pLocalChoice : (pLocalChoice = new LocalChoiceElements()); - } - - public ParserRule getLocalChoiceRule() { - return getLocalChoiceAccess().getRule(); - } - - /// ** - // * Section 3.8.6 Local Recursion - // * / LocalRecursion: - // "rec" label=ID block=LocalProtocolBlock; - public LocalRecursionElements getLocalRecursionAccess() { - return (pLocalRecursion != null) ? pLocalRecursion : (pLocalRecursion = new LocalRecursionElements()); - } - - public ParserRule getLocalRecursionRule() { - return getLocalRecursionAccess().getRule(); - } - - //LocalContinue: - // "continue" label=ID ";"; - public LocalContinueElements getLocalContinueAccess() { - return (pLocalContinue != null) ? pLocalContinue : (pLocalContinue = new LocalContinueElements()); - } - - public ParserRule getLocalContinueRule() { - return getLocalContinueAccess().getRule(); - } - - /// ** - // * Section 3.8.7 Local Parallel - // * / LocalParallel: - // "par" blocks+=LocalProtocolBlock ("and" blocks+=LocalProtocolBlock)*; - public LocalParallelElements getLocalParallelAccess() { - return (pLocalParallel != null) ? pLocalParallel : (pLocalParallel = new LocalParallelElements()); - } - - public ParserRule getLocalParallelRule() { - return getLocalParallelAccess().getRule(); - } - - /// ** - // * Section 3.8.8 Local Interruptible - // * / LocalInterruptible: - // "interruptible" (scope=ID ":")? block=LocalProtocolBlock "with" "{" throw=LocalThrow? catches+=LocalCatch* "}"; - public LocalInterruptibleElements getLocalInterruptibleAccess() { - return (pLocalInterruptible != null) ? pLocalInterruptible : (pLocalInterruptible = new LocalInterruptibleElements()); - } - - public ParserRule getLocalInterruptibleRule() { - return getLocalInterruptibleAccess().getRule(); - } - - //LocalThrow: - // "throw" messages+=Message ("," messages+=Message)* "to" toRoles+=ID ("," toRoles+=ID)* ";"; - public LocalThrowElements getLocalThrowAccess() { - return (pLocalThrow != null) ? pLocalThrow : (pLocalThrow = new LocalThrowElements()); - } - - public ParserRule getLocalThrowRule() { - return getLocalThrowAccess().getRule(); - } - - //LocalCatch: - // "catches" messages+=Message ("," messages+=Message)* "from" fromRole=ID ";"; - public LocalCatchElements getLocalCatchAccess() { - return (pLocalCatch != null) ? pLocalCatch : (pLocalCatch = new LocalCatchElements()); - } - - public ParserRule getLocalCatchRule() { - return getLocalCatchAccess().getRule(); - } - - /// ** - // * Section 3.8.9 Local Do - // * / LocalDo: - // "do" (scope=ID ":")? member=ID ("<" arguments+=Argument ("," arguments+=Argument)* ">")? "(" roles+=RoleInstantiation - // ("," roles+=RoleInstantiation)* ")" ";"; - public LocalDoElements getLocalDoAccess() { - return (pLocalDo != null) ? pLocalDo : (pLocalDo = new LocalDoElements()); - } - - public ParserRule getLocalDoRule() { - return getLocalDoAccess().getRule(); - } - - //terminal ID: - // "^"? ("a".."z" | "A".."Z" | "_") ("a".."z" | "A".."Z" | "_" | "0".."9")*; - public TerminalRule getIDRule() { - return gaTerminals.getIDRule(); - } - - //terminal INT returns ecore::EInt: - // "0".."9"+; - public TerminalRule getINTRule() { - return gaTerminals.getINTRule(); - } - - //terminal STRING: - // "\"" ("\\" ("b" | "t" | "n" | "f" | "r" | "u" | "\"" | "\'" | "\\") | !("\\" | "\""))* "\"" | "\'" ("\\" ("b" | "t" | - // "n" | "f" | "r" | "u" | "\"" | "\'" | "\\") | !("\\" | "\'"))* "\'"; - public TerminalRule getSTRINGRule() { - return gaTerminals.getSTRINGRule(); - } - - //terminal ML_COMMENT: - // "/ *"->"* /"; - public TerminalRule getML_COMMENTRule() { - return gaTerminals.getML_COMMENTRule(); - } - - //terminal SL_COMMENT: - // "//" !("\n" | "\r")* ("\r"? "\n")?; - public TerminalRule getSL_COMMENTRule() { - return gaTerminals.getSL_COMMENTRule(); - } - - //terminal WS: - // (" " | "\t" | "\r" | "\n")+; - public TerminalRule getWSRule() { - return gaTerminals.getWSRule(); - } - - //terminal ANY_OTHER: - // .; - public TerminalRule getANY_OTHERRule() { - return gaTerminals.getANY_OTHERRule(); - } -} diff --git a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/validation/AbstractScribbleDslValidator.java b/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/validation/AbstractScribbleDslValidator.java deleted file mode 100644 index c188156c9..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src-gen/org/scribble/editor/dsl/validation/AbstractScribbleDslValidator.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * generated by Xtext - */ -package org.scribble.editor.dsl.validation; - -import java.util.ArrayList; -import java.util.List; -import org.eclipse.emf.ecore.EPackage; - -public class AbstractScribbleDslValidator extends org.eclipse.xtext.validation.AbstractDeclarativeValidator { - - @Override - protected List getEPackages() { - List result = new ArrayList(); - result.add(org.scribble.editor.dsl.scribbleDsl.ScribbleDslPackage.eINSTANCE); - return result; - } -} diff --git a/tools/eclipse/plugins/org.scribble.editor/src/org/scribble/editor/dsl/GenerateScribbleDsl.mwe2 b/tools/eclipse/plugins/org.scribble.editor/src/org/scribble/editor/dsl/GenerateScribbleDsl.mwe2 deleted file mode 100644 index 1966460af..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src/org/scribble/editor/dsl/GenerateScribbleDsl.mwe2 +++ /dev/null @@ -1,130 +0,0 @@ -module org.scribble.editor.dsl.GenerateScribbleDsl - -import org.eclipse.emf.mwe.utils.* -import org.eclipse.xtext.generator.* -import org.eclipse.xtext.ui.generator.* - -var grammarURI = "classpath:/org/scribble/editor/dsl/ScribbleDsl.xtext" -var fileExtensions = "scr" -var projectName = "org.scribble.editor" -var runtimeProject = "../${projectName}" -var generateXtendStub = true -var encoding = "UTF-8" - -Workflow { - bean = StandaloneSetup { - scanClassPath = true - platformUri = "${runtimeProject}/.." - // The following two lines can be removed, if Xbase is not used. - registerGeneratedEPackage = "org.eclipse.xtext.xbase.XbasePackage" - registerGenModelFile = "platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel" - } - - component = DirectoryCleaner { - directory = "${runtimeProject}/src-gen" - } - - component = DirectoryCleaner { - directory = "${runtimeProject}/model" - } - - component = DirectoryCleaner { - directory = "${runtimeProject}.ui/src-gen" - } - - component = DirectoryCleaner { - directory = "${runtimeProject}.tests/src-gen" - } - - component = Generator { - pathRtProject = runtimeProject - pathUiProject = "${runtimeProject}.ui" - pathTestProject = "${runtimeProject}.tests" - projectNameRt = projectName - projectNameUi = "${projectName}.ui" - encoding = encoding - language = auto-inject { - uri = grammarURI - - // Java API to access grammar elements (required by several other fragments) - fragment = grammarAccess.GrammarAccessFragment auto-inject {} - - // generates Java API for the generated EPackages - fragment = ecore.EMFGeneratorFragment auto-inject {} - - // the old serialization component - // fragment = parseTreeConstructor.ParseTreeConstructorFragment auto-inject {} - - // serializer 2.0 - fragment = serializer.SerializerFragment auto-inject { - generateStub = false - } - - // a custom ResourceFactory for use with EMF - fragment = resourceFactory.ResourceFactoryFragment auto-inject {} - - // The antlr parser generator fragment. - fragment = parser.antlr.XtextAntlrGeneratorFragment auto-inject { - // options = { - // backtrack = true - // } - } - - // Xtend-based API for validation - fragment = validation.ValidatorFragment auto-inject { - // composedCheck = "org.eclipse.xtext.validation.ImportUriValidator" - // composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator" - } - - // old scoping and exporting API - // fragment = scoping.ImportURIScopingFragment auto-inject {} - // fragment = exporting.SimpleNamesFragment auto-inject {} - - // scoping and exporting API - fragment = scoping.ImportNamespacesScopingFragment auto-inject {} - fragment = exporting.QualifiedNamesFragment auto-inject {} - fragment = builder.BuilderIntegrationFragment auto-inject {} - - // generator API - fragment = generator.GeneratorFragment auto-inject {} - - // formatter API - fragment = formatting.FormatterFragment auto-inject {} - - // labeling API - fragment = labeling.LabelProviderFragment auto-inject {} - - // outline API - fragment = outline.OutlineTreeProviderFragment auto-inject {} - fragment = outline.QuickOutlineFragment auto-inject {} - - // quickfix API - fragment = quickfix.QuickfixProviderFragment auto-inject {} - - // content assist API - fragment = contentAssist.ContentAssistFragment auto-inject {} - - // generates a more lightweight Antlr parser and lexer tailored for content assist - fragment = parser.antlr.XtextAntlrUiGeneratorFragment auto-inject {} - - // generates junit test support classes into Generator#pathTestProject - fragment = junit.Junit4Fragment auto-inject {} - - // rename refactoring - fragment = refactoring.RefactorElementNameFragment auto-inject {} - - // provides the necessary bindings for java types integration - fragment = types.TypesGeneratorFragment auto-inject {} - - // generates the required bindings only if the grammar inherits from Xbase - fragment = xbase.XbaseGeneratorFragment auto-inject {} - - // provides a preference page for template proposals - fragment = templates.CodetemplatesGeneratorFragment auto-inject {} - - // provides a compare view - fragment = compare.CompareFragment auto-inject {} - } - } -} - diff --git a/tools/eclipse/plugins/org.scribble.editor/src/org/scribble/editor/dsl/ScribbleDsl.xtext b/tools/eclipse/plugins/org.scribble.editor/src/org/scribble/editor/dsl/ScribbleDsl.xtext deleted file mode 100644 index 0a84cc10f..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src/org/scribble/editor/dsl/ScribbleDsl.xtext +++ /dev/null @@ -1,267 +0,0 @@ -grammar org.scribble.editor.dsl.ScribbleDsl with org.eclipse.xtext.common.Terminals - -generate scribbleDsl "http://www.scribble.org/editor/dsl/ScribbleDsl" - - -Module: - 'module' name=ModuleName ';' (imports+=ImportDecl)* (types+=PayloadTypeDecl)* - (globals+=GlobalProtocolDecl | locals+=LocalProtocolDecl )* -; - -ModuleName: - ID ('.' ID)* -; - -ImportDecl: - ImportModule -| - ImportMember -; - -ImportModule: - 'import' name=ModuleName ( 'as' alias=ID )? ';' -; - -ImportMember: - 'from' name=ModuleName 'import' member=ID ( 'as' alias=ID )? ';' -; - -PayloadTypeDecl: - 'type' '<' schema=ID '>' type=STRING 'from' location=STRING 'as' alias=ID ';' -; - -/** - * Section 3.5 Message Signatures - */ -MessageSignature: - {MessageSignature} ( operator=ID )? '(' ( types+=PayloadElement (',' types+=PayloadElement)* )? ')' -; - -PayloadElement: - ( name=ID ':' )? type=ID -; - - -GlobalProtocolDecl: - 'global' 'protocol' name=ID ( '<' parameters+=ParameterDecl (',' parameters+=ParameterDecl)* '>' )? - '(' roles+=RoleDecl (',' roles+=RoleDecl)* ')' ( block=GlobalProtocolBlock | - 'instantiates' instantiates=ID ( '<' arguments+=Argument (',' arguments+=Argument )* '>' )? - '(' roleInstantiations+=RoleInstantiation (',' roleInstantiations+=RoleInstantiation)* ')' ';' - ) -; - -RoleDecl: - 'role' name=ID ( 'as' alias=ID )? -; - -ParameterDecl: - 'type' name=ID ( 'as' alias=ID )? -| - 'sig' name=ID ( 'as' alias=ID )? -; - - - -RoleInstantiation: - name=ID ( 'as' alias=ID )? -; - -Argument: - signature=MessageSignature ( 'as' alias=ID )? -| - name=ID ( 'as' alias=ID )? -; - - -/** - * Section 3.7.3 Global Interaction Sequences and Blocks - */ -GlobalProtocolBlock: - {GlobalProtocolBlock} '{' (activities+=GlobalInteraction)* '}' -; - -GlobalInteraction: - GlobalMessageTransfer -| - GlobalChoice -| - GlobalRecursion -| - GlobalContinue -| - GlobalParallel -| - GlobalInterruptible -| - GlobalDo -/*| - globalspawn*/ -; - - -/** - * Section 3.7.4 Global Message Transfer - */ -GlobalMessageTransfer: - message=Message 'from' fromRole=ID 'to' toRoles+=ID (',' toRoles+=ID )* ';' -; - -Message: - signature=MessageSignature -| - parameter=ID -; - - -/** - * Section 3.7.5 Global Choice - */ -GlobalChoice: - 'choice' 'at' role=ID blocks+=GlobalProtocolBlock ('or' blocks+=GlobalProtocolBlock)* -; - - -/** - * Section 3.7.6 Global Recursion - */ -GlobalRecursion: - 'rec' label=ID block=GlobalProtocolBlock -; - -GlobalContinue: - 'continue' label=ID ';' -; - - -/** - * Section 3.7.7 Global Parallel - */ -GlobalParallel: - 'par' blocks+=GlobalProtocolBlock ('and' blocks+=GlobalProtocolBlock)* -; - - -/** - * Section 3.7.8 Global Interruptible - */ -GlobalInterruptible: - 'interruptible' ( scope=ID ':' )? block=GlobalProtocolBlock 'with' '{' (interrupts+=GlobalInterrupt)* '}' -; - -GlobalInterrupt: - messages+=Message (',' messages+=Message)* 'by' role=ID ';' -; - - -/** - * Section 3.7.9 Global Do - */ -GlobalDo: - 'do' ( scope=ID ':' )? member=ID ( '<' arguments+=Argument (',' arguments+=Argument )* '>' )? '(' roles+=RoleInstantiation (',' roles+=RoleInstantiation)* ')' ';' -; - - -/* - * Section 3.8 Local Protocol Declarations - */ -LocalProtocolDecl: - 'local' 'protocol' name=ID 'at' role=ID - ( '<' parameters+=ParameterDecl (',' parameters+=ParameterDecl)* '>' )? - '(' roles+=RoleDecl (',' roles+=RoleDecl)* ')' ( block=LocalProtocolBlock | - 'instantiates' instantiates=ID ( '<' arguments+=Argument (',' arguments+=Argument )* '>' )? - '(' roleInstantiations+=RoleInstantiation (',' roleInstantiations+=RoleInstantiation)* ')' ';' - ) -; - - -/** - * Section 3.8.3 Local Interaction Blocks and Sequences - */ -LocalProtocolBlock: - {LocalProtocolBlock} '{' (activities+=LlobalInteraction)* '}' -; - -LlobalInteraction: - LocalSend -| - LocalReceive -| - LocalChoice -| - LocalParallel -| - LocalRecursion -| - LocalContinue -| - LocalInterruptible -| - LocalDo -/*| - localspawn*/ -; - - -/** - * Section 3.8.4 Local Send and Receive - */ -LocalSend: - message=Message 'to' toRoles+=ID (',' toRoles+=ID )* ';' -; - -LocalReceive: - message=Message 'from' fromRole=ID ';' -; - - -/** - * Section 3.8.5 Local Choice - */ -LocalChoice: - 'choice' 'at' role=ID blocks+=LocalProtocolBlock ('or' blocks+=LocalProtocolBlock)* -; - - -/** - * Section 3.8.6 Local Recursion - */ -LocalRecursion: - 'rec' label=ID block=LocalProtocolBlock -; - -LocalContinue: - 'continue' label=ID ';' -; - - -/** - * Section 3.8.7 Local Parallel - */ -LocalParallel: - 'par' blocks+=LocalProtocolBlock ('and' blocks+=LocalProtocolBlock)* -; - - -/** - * Section 3.8.8 Local Interruptible - */ -LocalInterruptible: - 'interruptible' ( scope=ID ':' )? block=LocalProtocolBlock 'with' '{' ( throw=LocalThrow )? ( catches+=LocalCatch )* '}' -; - -LocalThrow: - 'throw' messages+=Message (',' messages+=Message)* 'to' toRoles+=ID (',' toRoles+=ID )* ';' -; - -LocalCatch: - 'catches' messages+=Message (',' messages+=Message)* 'from' fromRole=ID ';' -; - - -/** - * Section 3.8.9 Local Do - */ -LocalDo: - 'do' ( scope=ID ':' )? member=ID ( '<' arguments+=Argument (',' arguments+=Argument )* '>' )? '(' roles+=RoleInstantiation (',' roles+=RoleInstantiation)* ')' ';' -; - diff --git a/tools/eclipse/plugins/org.scribble.editor/src/org/scribble/editor/dsl/ScribbleDslRuntimeModule.java b/tools/eclipse/plugins/org.scribble.editor/src/org/scribble/editor/dsl/ScribbleDslRuntimeModule.java deleted file mode 100644 index c09b91b5a..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src/org/scribble/editor/dsl/ScribbleDslRuntimeModule.java +++ /dev/null @@ -1,11 +0,0 @@ -/* - * generated by Xtext - */ -package org.scribble.editor.dsl; - -/** - * Use this class to register components to be used at runtime / without the Equinox extension registry. - */ -public class ScribbleDslRuntimeModule extends org.scribble.editor.dsl.AbstractScribbleDslRuntimeModule { - -} diff --git a/tools/eclipse/plugins/org.scribble.editor/src/org/scribble/editor/dsl/ScribbleDslStandaloneSetup.java b/tools/eclipse/plugins/org.scribble.editor/src/org/scribble/editor/dsl/ScribbleDslStandaloneSetup.java deleted file mode 100644 index bb714a9e8..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src/org/scribble/editor/dsl/ScribbleDslStandaloneSetup.java +++ /dev/null @@ -1,16 +0,0 @@ -/* -* generated by Xtext -*/ -package org.scribble.editor.dsl; - -/** - * Initialization support for running Xtext languages - * without equinox extension registry - */ -public class ScribbleDslStandaloneSetup extends ScribbleDslStandaloneSetupGenerated{ - - public static void doSetup() { - new ScribbleDslStandaloneSetup().createInjectorAndDoEMFRegistration(); - } -} - diff --git a/tools/eclipse/plugins/org.scribble.editor/src/org/scribble/editor/dsl/formatting/ScribbleDslFormatter.xtend b/tools/eclipse/plugins/org.scribble.editor/src/org/scribble/editor/dsl/formatting/ScribbleDslFormatter.xtend deleted file mode 100644 index 316fe938f..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src/org/scribble/editor/dsl/formatting/ScribbleDslFormatter.xtend +++ /dev/null @@ -1,30 +0,0 @@ -/* - * generated by Xtext - */ -package org.scribble.editor.dsl.formatting - -import org.eclipse.xtext.formatting.impl.AbstractDeclarativeFormatter -import org.eclipse.xtext.formatting.impl.FormattingConfig -// import com.google.inject.Inject; -// import org.scribble.editor.dsl.services.ScribbleDslGrammarAccess - -/** - * This class contains custom formatting description. - * - * see : http://www.eclipse.org/Xtext/documentation.html#formatting - * on how and when to use it - * - * Also see {@link org.eclipse.xtext.xtext.XtextFormattingTokenSerializer} as an example - */ -class ScribbleDslFormatter extends AbstractDeclarativeFormatter { - -// @Inject extension ScribbleDslGrammarAccess - - override protected void configureFormatting(FormattingConfig c) { -// It's usually a good idea to activate the following three statements. -// They will add and preserve newlines around comments -// c.setLinewrap(0, 1, 2).before(SL_COMMENTRule) -// c.setLinewrap(0, 1, 2).before(ML_COMMENTRule) -// c.setLinewrap(0, 1, 1).after(ML_COMMENTRule) - } -} diff --git a/tools/eclipse/plugins/org.scribble.editor/src/org/scribble/editor/dsl/generator/ScribbleDslGenerator.xtend b/tools/eclipse/plugins/org.scribble.editor/src/org/scribble/editor/dsl/generator/ScribbleDslGenerator.xtend deleted file mode 100644 index 22b031204..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src/org/scribble/editor/dsl/generator/ScribbleDslGenerator.xtend +++ /dev/null @@ -1,24 +0,0 @@ -/* - * generated by Xtext - */ -package org.scribble.editor.dsl.generator - -import org.eclipse.emf.ecore.resource.Resource -import org.eclipse.xtext.generator.IGenerator -import org.eclipse.xtext.generator.IFileSystemAccess - -/** - * Generates code from your model files on save. - * - * see http://www.eclipse.org/Xtext/documentation.html#TutorialCodeGeneration - */ -class ScribbleDslGenerator implements IGenerator { - - override void doGenerate(Resource resource, IFileSystemAccess fsa) { -// fsa.generateFile('greetings.txt', 'People to greet: ' + -// resource.allContents -// .filter(typeof(Greeting)) -// .map[name] -// .join(', ')) - } -} diff --git a/tools/eclipse/plugins/org.scribble.editor/src/org/scribble/editor/dsl/scoping/ScribbleDslScopeProvider.xtend b/tools/eclipse/plugins/org.scribble.editor/src/org/scribble/editor/dsl/scoping/ScribbleDslScopeProvider.xtend deleted file mode 100644 index cc4cf138c..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src/org/scribble/editor/dsl/scoping/ScribbleDslScopeProvider.xtend +++ /dev/null @@ -1,15 +0,0 @@ -/* - * generated by Xtext - */ -package org.scribble.editor.dsl.scoping - -/** - * This class contains custom scoping description. - * - * see : http://www.eclipse.org/Xtext/documentation.html#scoping - * on how and when to use it - * - */ -class ScribbleDslScopeProvider extends org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider { - -} diff --git a/tools/eclipse/plugins/org.scribble.editor/src/org/scribble/editor/dsl/validation/ScribbleDslValidator.xtend b/tools/eclipse/plugins/org.scribble.editor/src/org/scribble/editor/dsl/validation/ScribbleDslValidator.xtend deleted file mode 100644 index f892104f6..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/src/org/scribble/editor/dsl/validation/ScribbleDslValidator.xtend +++ /dev/null @@ -1,24 +0,0 @@ -/* - * generated by Xtext - */ -package org.scribble.editor.dsl.validation -//import org.eclipse.xtext.validation.Check - -/** - * Custom validation rules. - * - * see http://www.eclipse.org/Xtext/documentation.html#validation - */ -class ScribbleDslValidator extends AbstractScribbleDslValidator { - -// public static val INVALID_NAME = 'invalidName' -// -// @Check -// def checkGreetingStartsWithCapital(Greeting greeting) { -// if (!Character.isUpperCase(greeting.name.charAt(0))) { -// warning('Name should start with a capital', -// MyDslPackage.Literals.GREETING__NAME, -// INVALID_NAME) -// } -// } -} diff --git a/tools/eclipse/plugins/org.scribble.editor/xtend-gen/org/scribble/editor/dsl/formatting/.ScribbleDslFormatter.java._trace b/tools/eclipse/plugins/org.scribble.editor/xtend-gen/org/scribble/editor/dsl/formatting/.ScribbleDslFormatter.java._trace deleted file mode 100644 index ef6b71121..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor/xtend-gen/org/scribble/editor/dsl/formatting/.ScribbleDslFormatter.java._trace and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor/xtend-gen/org/scribble/editor/dsl/formatting/ScribbleDslFormatter.java b/tools/eclipse/plugins/org.scribble.editor/xtend-gen/org/scribble/editor/dsl/formatting/ScribbleDslFormatter.java deleted file mode 100644 index 9e0868efa..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/xtend-gen/org/scribble/editor/dsl/formatting/ScribbleDslFormatter.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * generated by Xtext - */ -package org.scribble.editor.dsl.formatting; - -import org.eclipse.xtext.formatting.impl.AbstractDeclarativeFormatter; -import org.eclipse.xtext.formatting.impl.FormattingConfig; - -/** - * This class contains custom formatting description. - * - * see : http://www.eclipse.org/Xtext/documentation.html#formatting - * on how and when to use it - * - * Also see {@link org.eclipse.xtext.xtext.XtextFormattingTokenSerializer} as an example - */ -@SuppressWarnings("all") -public class ScribbleDslFormatter extends AbstractDeclarativeFormatter { - protected void configureFormatting(final FormattingConfig c) { - } -} diff --git a/tools/eclipse/plugins/org.scribble.editor/xtend-gen/org/scribble/editor/dsl/generator/.ScribbleDslGenerator.java._trace b/tools/eclipse/plugins/org.scribble.editor/xtend-gen/org/scribble/editor/dsl/generator/.ScribbleDslGenerator.java._trace deleted file mode 100644 index 2dfbe3774..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor/xtend-gen/org/scribble/editor/dsl/generator/.ScribbleDslGenerator.java._trace and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor/xtend-gen/org/scribble/editor/dsl/generator/ScribbleDslGenerator.java b/tools/eclipse/plugins/org.scribble.editor/xtend-gen/org/scribble/editor/dsl/generator/ScribbleDslGenerator.java deleted file mode 100644 index 7591fee55..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/xtend-gen/org/scribble/editor/dsl/generator/ScribbleDslGenerator.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - * generated by Xtext - */ -package org.scribble.editor.dsl.generator; - -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.xtext.generator.IFileSystemAccess; -import org.eclipse.xtext.generator.IGenerator; - -/** - * Generates code from your model files on save. - * - * see http://www.eclipse.org/Xtext/documentation.html#TutorialCodeGeneration - */ -@SuppressWarnings("all") -public class ScribbleDslGenerator implements IGenerator { - public void doGenerate(final Resource resource, final IFileSystemAccess fsa) { - } -} diff --git a/tools/eclipse/plugins/org.scribble.editor/xtend-gen/org/scribble/editor/dsl/scoping/.ScribbleDslScopeProvider.java._trace b/tools/eclipse/plugins/org.scribble.editor/xtend-gen/org/scribble/editor/dsl/scoping/.ScribbleDslScopeProvider.java._trace deleted file mode 100644 index 6a85e70b0..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor/xtend-gen/org/scribble/editor/dsl/scoping/.ScribbleDslScopeProvider.java._trace and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor/xtend-gen/org/scribble/editor/dsl/scoping/ScribbleDslScopeProvider.java b/tools/eclipse/plugins/org.scribble.editor/xtend-gen/org/scribble/editor/dsl/scoping/ScribbleDslScopeProvider.java deleted file mode 100644 index 285f64319..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/xtend-gen/org/scribble/editor/dsl/scoping/ScribbleDslScopeProvider.java +++ /dev/null @@ -1,16 +0,0 @@ -/** - * generated by Xtext - */ -package org.scribble.editor.dsl.scoping; - -import org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider; - -/** - * This class contains custom scoping description. - * - * see : http://www.eclipse.org/Xtext/documentation.html#scoping - * on how and when to use it - */ -@SuppressWarnings("all") -public class ScribbleDslScopeProvider extends AbstractDeclarativeScopeProvider { -} diff --git a/tools/eclipse/plugins/org.scribble.editor/xtend-gen/org/scribble/editor/dsl/validation/.ScribbleDslValidator.java._trace b/tools/eclipse/plugins/org.scribble.editor/xtend-gen/org/scribble/editor/dsl/validation/.ScribbleDslValidator.java._trace deleted file mode 100644 index 596f54ec9..000000000 Binary files a/tools/eclipse/plugins/org.scribble.editor/xtend-gen/org/scribble/editor/dsl/validation/.ScribbleDslValidator.java._trace and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.editor/xtend-gen/org/scribble/editor/dsl/validation/ScribbleDslValidator.java b/tools/eclipse/plugins/org.scribble.editor/xtend-gen/org/scribble/editor/dsl/validation/ScribbleDslValidator.java deleted file mode 100644 index c0fc66b79..000000000 --- a/tools/eclipse/plugins/org.scribble.editor/xtend-gen/org/scribble/editor/dsl/validation/ScribbleDslValidator.java +++ /dev/null @@ -1,15 +0,0 @@ -/** - * generated by Xtext - */ -package org.scribble.editor.dsl.validation; - -import org.scribble.editor.dsl.validation.AbstractScribbleDslValidator; - -/** - * Custom validation rules. - * - * see http://www.eclipse.org/Xtext/documentation.html#validation - */ -@SuppressWarnings("all") -public class ScribbleDslValidator extends AbstractScribbleDslValidator { -} diff --git a/tools/eclipse/plugins/org.scribble.trace.editor.tests/META-INF/MANIFEST.MF b/tools/eclipse/plugins/org.scribble.trace.editor.tests/META-INF/MANIFEST.MF deleted file mode 100644 index a79167c63..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor.tests/META-INF/MANIFEST.MF +++ /dev/null @@ -1,23 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: org.scribble.trace.editor.tests -Bundle-Vendor: My Company -Bundle-Version: 1.0.0.qualifier -Bundle-SymbolicName: org.scribble.trace.editor.tests; singleton:=true -Bundle-ActivationPolicy: lazy -Require-Bundle: org.scribble.trace.editor, - org.scribble.trace.editor.ui, - org.eclipse.core.runtime, - org.eclipse.xtext.junit4, - org.eclipse.ui.workbench;resolution:=optional, - org.objectweb.asm;bundle-version="[5.0.1,6.0.0)";resolution:=optional -Import-Package: org.apache.log4j, - org.junit;version="4.5.0", - org.junit.runner;version="4.5.0", - org.junit.runner.manipulation;version="4.5.0", - org.junit.runner.notification;version="4.5.0", - org.junit.runners;version="4.5.0", - org.junit.runners.model;version="4.5.0", - org.hamcrest.core -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 -Export-Package: org.scribble.trace.editor.dsl diff --git a/tools/eclipse/plugins/org.scribble.trace.editor.tests/build.properties b/tools/eclipse/plugins/org.scribble.trace.editor.tests/build.properties deleted file mode 100644 index c22eebe28..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor.tests/build.properties +++ /dev/null @@ -1,5 +0,0 @@ -source.. = src/,\ - src-gen/,\ - xtend-gen/ -bin.includes = META-INF/,\ - . diff --git a/tools/eclipse/plugins/org.scribble.trace.editor.tests/org.scribble.trace.editor.tests.launch b/tools/eclipse/plugins/org.scribble.trace.editor.tests/org.scribble.trace.editor.tests.launch deleted file mode 100644 index 2f107394e..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor.tests/org.scribble.trace.editor.tests.launch +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/tools/eclipse/plugins/org.scribble.trace.editor.tests/src-gen/org/scribble/trace/editor/dsl/ScribbleTraceDslInjectorProvider.java b/tools/eclipse/plugins/org.scribble.trace.editor.tests/src-gen/org/scribble/trace/editor/dsl/ScribbleTraceDslInjectorProvider.java deleted file mode 100644 index 0b8f326fa..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor.tests/src-gen/org/scribble/trace/editor/dsl/ScribbleTraceDslInjectorProvider.java +++ /dev/null @@ -1,45 +0,0 @@ -/* -* generated by Xtext -*/ -package org.scribble.trace.editor.dsl; - -import org.eclipse.xtext.junit4.GlobalRegistries; -import org.eclipse.xtext.junit4.GlobalRegistries.GlobalStateMemento; -import org.eclipse.xtext.junit4.IInjectorProvider; -import org.eclipse.xtext.junit4.IRegistryConfigurator; - -import com.google.inject.Injector; - -public class ScribbleTraceDslInjectorProvider implements IInjectorProvider, IRegistryConfigurator { - - protected GlobalStateMemento stateBeforeInjectorCreation; - protected GlobalStateMemento stateAfterInjectorCreation; - protected Injector injector; - - static { - GlobalRegistries.initializeDefaults(); - } - - public Injector getInjector() - { - if (injector == null) { - stateBeforeInjectorCreation = GlobalRegistries.makeCopyOfGlobalState(); - this.injector = internalCreateInjector(); - stateAfterInjectorCreation = GlobalRegistries.makeCopyOfGlobalState(); - } - return injector; - } - - protected Injector internalCreateInjector() { - return new ScribbleTraceDslStandaloneSetup().createInjectorAndDoEMFRegistration(); - } - - public void restoreRegistry() { - stateBeforeInjectorCreation.restoreGlobalState(); - } - - public void setupRegistry() { - getInjector(); - stateAfterInjectorCreation.restoreGlobalState(); - } -} diff --git a/tools/eclipse/plugins/org.scribble.trace.editor.tests/src-gen/org/scribble/trace/editor/dsl/ScribbleTraceDslUiInjectorProvider.java b/tools/eclipse/plugins/org.scribble.trace.editor.tests/src-gen/org/scribble/trace/editor/dsl/ScribbleTraceDslUiInjectorProvider.java deleted file mode 100644 index 2fca642a3..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor.tests/src-gen/org/scribble/trace/editor/dsl/ScribbleTraceDslUiInjectorProvider.java +++ /dev/null @@ -1,16 +0,0 @@ -/* -* generated by Xtext -*/ -package org.scribble.trace.editor.dsl; - -import org.eclipse.xtext.junit4.IInjectorProvider; - -import com.google.inject.Injector; - -public class ScribbleTraceDslUiInjectorProvider implements IInjectorProvider { - - public Injector getInjector() { - return org.scribble.trace.editor.dsl.ui.internal.ScribbleTraceDslActivator.getInstance().getInjector("org.scribble.trace.editor.dsl.ScribbleTraceDsl"); - } - -} diff --git a/tools/eclipse/plugins/org.scribble.trace.editor.ui/META-INF/MANIFEST.MF b/tools/eclipse/plugins/org.scribble.trace.editor.ui/META-INF/MANIFEST.MF deleted file mode 100644 index 2f3698e33..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor.ui/META-INF/MANIFEST.MF +++ /dev/null @@ -1,26 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: org.scribble.trace.editor.ui -Bundle-Vendor: Scribble.org -Bundle-Version: 0.3.2.qualifier -Bundle-SymbolicName: org.scribble.trace.editor.ui; singleton:=true -Bundle-ActivationPolicy: lazy -Require-Bundle: org.scribble.trace.editor;visibility:=reexport, - org.eclipse.xtext.ui, - org.eclipse.ui.editors;bundle-version="3.5.0", - org.eclipse.ui.ide;bundle-version="3.5.0", - org.eclipse.xtext.ui.shared, - org.eclipse.ui, - org.eclipse.xtext.builder, - org.eclipse.xtext.xbase.lib, - org.antlr.runtime, - org.eclipse.xtext.common.types.ui, - org.eclipse.xtext.ui.codetemplates.ui, - org.eclipse.compare -Import-Package: org.apache.log4j -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 -Export-Package: org.scribble.trace.editor.dsl.ui.quickfix, - org.scribble.trace.editor.dsl.ui.contentassist, - org.scribble.trace.editor.dsl.ui.contentassist.antlr, - org.scribble.trace.editor.dsl.ui.internal -Bundle-Activator: org.scribble.trace.editor.dsl.ui.internal.ScribbleTraceDslActivator diff --git a/tools/eclipse/plugins/org.scribble.trace.editor.ui/build.properties b/tools/eclipse/plugins/org.scribble.trace.editor.ui/build.properties deleted file mode 100644 index 31255ed05..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor.ui/build.properties +++ /dev/null @@ -1,6 +0,0 @@ -source.. = src/,\ - src-gen/,\ - xtend-gen/ -bin.includes = META-INF/,\ - .,\ - plugin.xml \ No newline at end of file diff --git a/tools/eclipse/plugins/org.scribble.trace.editor.ui/plugin.xml b/tools/eclipse/plugins/org.scribble.trace.editor.ui/plugin.xml deleted file mode 100644 index 04b59e0fd..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor.ui/plugin.xml +++ /dev/null @@ -1,398 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tools/eclipse/plugins/org.scribble.trace.editor.ui/plugin.xml_gen b/tools/eclipse/plugins/org.scribble.trace.editor.ui/plugin.xml_gen deleted file mode 100644 index 04b59e0fd..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor.ui/plugin.xml_gen +++ /dev/null @@ -1,398 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tools/eclipse/plugins/org.scribble.trace.editor.ui/pom.xml b/tools/eclipse/plugins/org.scribble.trace.editor.ui/pom.xml deleted file mode 100644 index 53981d90f..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor.ui/pom.xml +++ /dev/null @@ -1,17 +0,0 @@ - - 4.0.0 - org.scribble.tools.eclipse.plugins - org.scribble.trace.editor.ui - 0.3.2-SNAPSHOT - eclipse-plugin - Scribble::Tools::Eclipse::Plugins::Trace Editor UI - - - org.scribble.tools.eclipse - plugins - 0.3.2-SNAPSHOT - - - - diff --git a/tools/eclipse/plugins/org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/AbstractScribbleTraceDslUiModule.java b/tools/eclipse/plugins/org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/AbstractScribbleTraceDslUiModule.java deleted file mode 100644 index da97bd59d..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/AbstractScribbleTraceDslUiModule.java +++ /dev/null @@ -1,242 +0,0 @@ - -/* - * generated by Xtext - */ -package org.scribble.trace.editor.dsl.ui; - -import org.eclipse.xtext.ui.DefaultUiModule; -import org.eclipse.ui.plugin.AbstractUIPlugin; - -/** - * Manual modifications go to {org.scribble.trace.editor.dsl.ui.ScribbleTraceDslUiModule} - */ -@SuppressWarnings("all") -public abstract class AbstractScribbleTraceDslUiModule extends DefaultUiModule { - - public AbstractScribbleTraceDslUiModule(AbstractUIPlugin plugin) { - super(plugin); - } - - - // contributed by org.eclipse.xtext.ui.generator.ImplicitUiFragment - public com.google.inject.Provider provideIAllContainersState() { - return org.eclipse.xtext.ui.shared.Access.getJavaProjectsState(); - } - - // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment - public Class bindIProposalConflictHelper() { - return org.eclipse.xtext.ui.editor.contentassist.antlr.AntlrProposalConflictHelper.class; - } - - // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment - public void configureHighlightingLexer(com.google.inject.Binder binder) { - binder.bind(org.eclipse.xtext.parser.antlr.Lexer.class).annotatedWith(com.google.inject.name.Names.named(org.eclipse.xtext.ui.LexerUIBindings.HIGHLIGHTING)).to(org.scribble.trace.editor.dsl.parser.antlr.internal.InternalScribbleTraceDslLexer.class); - } - - // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment - public void configureHighlightingTokenDefProvider(com.google.inject.Binder binder) { - binder.bind(org.eclipse.xtext.parser.antlr.ITokenDefProvider.class).annotatedWith(com.google.inject.name.Names.named(org.eclipse.xtext.ui.LexerUIBindings.HIGHLIGHTING)).to(org.eclipse.xtext.parser.antlr.AntlrTokenDefProvider.class); - } - - // contributed by org.eclipse.xtext.generator.exporting.QualifiedNamesFragment - public Class bindIDependentElementsCalculator() { - return org.eclipse.xtext.ui.refactoring.impl.DefaultDependentElementsCalculator.class; - } - - // contributed by org.eclipse.xtext.generator.builder.BuilderIntegrationFragment - public void configureIResourceDescriptionsBuilderScope(com.google.inject.Binder binder) { - binder.bind(org.eclipse.xtext.resource.IResourceDescriptions.class).annotatedWith(com.google.inject.name.Names.named(org.eclipse.xtext.resource.impl.ResourceDescriptionsProvider.NAMED_BUILDER_SCOPE)).to(org.eclipse.xtext.builder.clustering.CurrentDescriptions.ResourceSetAware.class); - } - - // contributed by org.eclipse.xtext.generator.builder.BuilderIntegrationFragment - public Class bindIXtextEditorCallback() { - return org.eclipse.xtext.builder.nature.NatureAddingEditorCallback.class; - } - - // contributed by org.eclipse.xtext.generator.builder.BuilderIntegrationFragment - public void configureIResourceDescriptionsPersisted(com.google.inject.Binder binder) { - binder.bind(org.eclipse.xtext.resource.IResourceDescriptions.class).annotatedWith(com.google.inject.name.Names.named(org.eclipse.xtext.resource.impl.ResourceDescriptionsProvider.PERSISTED_DESCRIPTIONS)).to(org.eclipse.xtext.builder.builderState.IBuilderState.class); - } - - // contributed by org.eclipse.xtext.generator.builder.BuilderIntegrationFragment - public Class bindDocumentBasedDirtyResource() { - return org.eclipse.xtext.builder.impl.PersistentDataAwareDirtyResource.class; - } - - // contributed by org.eclipse.xtext.generator.generator.GeneratorFragment - public Class bindIXtextBuilderParticipant() { - return org.eclipse.xtext.builder.BuilderParticipant.class; - } - - // contributed by org.eclipse.xtext.generator.generator.GeneratorFragment - public org.eclipse.core.resources.IWorkspaceRoot bindIWorkspaceRootToInstance() { - return org.eclipse.core.resources.ResourcesPlugin.getWorkspace().getRoot(); - } - - // contributed by org.eclipse.xtext.generator.generator.GeneratorFragment - public void configureBuilderPreferenceStoreInitializer(com.google.inject.Binder binder) { - binder.bind(org.eclipse.xtext.ui.editor.preferences.IPreferenceStoreInitializer.class).annotatedWith(com.google.inject.name.Names.named("builderPreferenceInitializer")).to(org.eclipse.xtext.builder.preferences.BuilderPreferenceAccess.Initializer.class); - } - - // contributed by org.eclipse.xtext.ui.generator.labeling.LabelProviderFragment - public Class bindILabelProvider() { - return org.scribble.trace.editor.dsl.ui.labeling.ScribbleTraceDslLabelProvider.class; - } - - // contributed by org.eclipse.xtext.ui.generator.labeling.LabelProviderFragment - public void configureResourceUIServiceLabelProvider(com.google.inject.Binder binder) { - binder.bind(org.eclipse.jface.viewers.ILabelProvider.class).annotatedWith(org.eclipse.xtext.ui.resource.ResourceServiceDescriptionLabelProvider.class).to(org.scribble.trace.editor.dsl.ui.labeling.ScribbleTraceDslDescriptionLabelProvider.class); - } - - // contributed by org.eclipse.xtext.ui.generator.outline.OutlineTreeProviderFragment - public Class bindIOutlineTreeProvider() { - return org.scribble.trace.editor.dsl.ui.outline.ScribbleTraceDslOutlineTreeProvider.class; - } - - // contributed by org.eclipse.xtext.ui.generator.outline.OutlineTreeProviderFragment - public Class bindIOutlineTreeStructureProvider() { - return org.scribble.trace.editor.dsl.ui.outline.ScribbleTraceDslOutlineTreeProvider.class; - } - - // contributed by org.eclipse.xtext.ui.generator.quickfix.QuickfixProviderFragment - public Class bindIssueResolutionProvider() { - return org.scribble.trace.editor.dsl.ui.quickfix.ScribbleTraceDslQuickfixProvider.class; - } - - // contributed by org.eclipse.xtext.ui.generator.contentAssist.ContentAssistFragment - public Class bindIContentProposalProvider() { - return org.scribble.trace.editor.dsl.ui.contentassist.ScribbleTraceDslProposalProvider.class; - } - - // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrUiGeneratorFragment - public Class bindContentAssistContext$Factory() { - return org.eclipse.xtext.ui.editor.contentassist.antlr.ParserBasedContentAssistContextFactory.class; - } - - // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrUiGeneratorFragment - public Class bindIContentAssistParser() { - return org.scribble.trace.editor.dsl.ui.contentassist.antlr.ScribbleTraceDslParser.class; - } - - // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrUiGeneratorFragment - public void configureContentAssistLexerProvider(com.google.inject.Binder binder) { - binder.bind(org.scribble.trace.editor.dsl.ui.contentassist.antlr.internal.InternalScribbleTraceDslLexer.class).toProvider(org.eclipse.xtext.parser.antlr.LexerProvider.create(org.scribble.trace.editor.dsl.ui.contentassist.antlr.internal.InternalScribbleTraceDslLexer.class)); - } - - // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrUiGeneratorFragment - public void configureContentAssistLexer(com.google.inject.Binder binder) { - binder.bind(org.eclipse.xtext.ui.editor.contentassist.antlr.internal.Lexer.class).annotatedWith(com.google.inject.name.Names.named(org.eclipse.xtext.ui.LexerUIBindings.CONTENT_ASSIST)).to(org.scribble.trace.editor.dsl.ui.contentassist.antlr.internal.InternalScribbleTraceDslLexer.class); - } - - // contributed by org.eclipse.xtext.ui.generator.refactoring.RefactorElementNameFragment - public Class bindIRenameStrategy() { - return org.eclipse.xtext.ui.refactoring.impl.DefaultRenameStrategy.class; - } - - // contributed by org.eclipse.xtext.ui.generator.refactoring.RefactorElementNameFragment - public Class bindIReferenceUpdater() { - return org.eclipse.xtext.ui.refactoring.impl.DefaultReferenceUpdater.class; - } - - // contributed by org.eclipse.xtext.ui.generator.refactoring.RefactorElementNameFragment - public void configureIPreferenceStoreInitializer(com.google.inject.Binder binder) { - binder.bind(org.eclipse.xtext.ui.editor.preferences.IPreferenceStoreInitializer.class).annotatedWith(com.google.inject.name.Names.named("RefactoringPreferences")).to(org.eclipse.xtext.ui.refactoring.ui.RefactoringPreferences.Initializer.class); - } - - // contributed by org.eclipse.xtext.ui.generator.refactoring.RefactorElementNameFragment - public Class bindIRenameRefactoringProvider() { - return org.eclipse.xtext.ui.refactoring.impl.DefaultRenameRefactoringProvider.class; - } - - // contributed by org.eclipse.xtext.ui.generator.refactoring.RefactorElementNameFragment - public Class bindIRenameSupport$Factory() { - return org.eclipse.xtext.ui.refactoring.ui.DefaultRenameSupport.Factory.class; - } - - // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment - public java.lang.ClassLoader bindClassLoaderToInstance() { - return getClass().getClassLoader(); - } - - // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment - public Class bindIJvmTypeProvider$Factory() { - return org.eclipse.xtext.common.types.access.jdt.JdtTypeProviderFactory.class; - } - - // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment - public Class bindAbstractTypeScopeProvider() { - return org.eclipse.xtext.common.types.xtext.ui.JdtBasedSimpleTypeScopeProvider.class; - } - - // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment - public Class bindITypesProposalProvider() { - return org.eclipse.xtext.common.types.xtext.ui.JdtTypesProposalProvider.class; - } - - // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment - public Class bindIJavaProjectProvider() { - return org.eclipse.xtext.common.types.xtext.ui.XtextResourceSetBasedProjectProvider.class; - } - - // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment - public Class bindIHyperlinkHelper() { - return org.eclipse.xtext.common.types.xtext.ui.TypeAwareHyperlinkHelper.class; - } - - // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment - public Class bindPrefixMatcher() { - return org.eclipse.xtext.ui.editor.contentassist.FQNPrefixMatcher.class; - } - - // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment - public Class bindAbstractJavaBasedContentProposalProvider$ReferenceProposalCreator() { - return org.eclipse.xtext.common.types.xtext.ui.TypeAwareReferenceProposalCreator.class; - } - - // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment - public Class bindIValidationJobScheduler() { - return org.eclipse.xtext.common.types.xtext.ui.JdtValidationJobScheduler.class; - } - - // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment - public Class bindRefactoringResourceSetProvider() { - return org.eclipse.xtext.common.types.ui.refactoring.JvmRefactoringResourceSetProvider.class; - } - - // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment - public Class bindIJavaSearchParticipation() { - return org.eclipse.xtext.common.types.ui.query.IJavaSearchParticipation.Yes.class; - } - - // contributed by org.eclipse.xtext.ui.generator.templates.CodetemplatesGeneratorFragment - public com.google.inject.Provider provideTemplatesLanguageConfiguration() { - return org.eclipse.xtext.ui.codetemplates.ui.AccessibleCodetemplatesActivator.getTemplatesLanguageConfigurationProvider(); - } - - // contributed by org.eclipse.xtext.ui.generator.templates.CodetemplatesGeneratorFragment - public com.google.inject.Provider provideLanguageRegistry() { - return org.eclipse.xtext.ui.codetemplates.ui.AccessibleCodetemplatesActivator.getLanguageRegistry(); - } - - // contributed by org.eclipse.xtext.ui.generator.templates.CodetemplatesGeneratorFragment - @org.eclipse.xtext.service.SingletonBinding(eager=true) public Class bindLanguageRegistrar() { - return org.eclipse.xtext.ui.codetemplates.ui.registry.LanguageRegistrar.class; - } - - // contributed by org.eclipse.xtext.ui.generator.templates.CodetemplatesGeneratorFragment - public Class bindXtextTemplatePreferencePage() { - return org.eclipse.xtext.ui.codetemplates.ui.preferences.AdvancedTemplatesPreferencePage.class; - } - - // contributed by org.eclipse.xtext.ui.generator.templates.CodetemplatesGeneratorFragment - public Class bindIPartialContentAssistParser() { - return org.scribble.trace.editor.dsl.ui.contentassist.antlr.PartialScribbleTraceDslContentAssistParser.class; - } - - // contributed by org.eclipse.xtext.ui.generator.compare.CompareFragment - public Class bindIViewerCreator() { - return org.eclipse.xtext.ui.compare.DefaultViewerCreator.class; - } - - -} diff --git a/tools/eclipse/plugins/org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/ScribbleTraceDslExecutableExtensionFactory.java b/tools/eclipse/plugins/org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/ScribbleTraceDslExecutableExtensionFactory.java deleted file mode 100644 index 61472952f..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/ScribbleTraceDslExecutableExtensionFactory.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * generated by Xtext - */ -package org.scribble.trace.editor.dsl.ui; - -import org.eclipse.xtext.ui.guice.AbstractGuiceAwareExecutableExtensionFactory; -import org.osgi.framework.Bundle; - -import com.google.inject.Injector; - -import org.scribble.trace.editor.dsl.ui.internal.ScribbleTraceDslActivator; - -/** - * This class was generated. Customizations should only happen in a newly - * introduced subclass. - */ -public class ScribbleTraceDslExecutableExtensionFactory extends AbstractGuiceAwareExecutableExtensionFactory { - - @Override - protected Bundle getBundle() { - return ScribbleTraceDslActivator.getInstance().getBundle(); - } - - @Override - protected Injector getInjector() { - return ScribbleTraceDslActivator.getInstance().getInjector(ScribbleTraceDslActivator.ORG_SCRIBBLE_TRACE_EDITOR_DSL_SCRIBBLETRACEDSL); - } - -} diff --git a/tools/eclipse/plugins/org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/AbstractScribbleTraceDslProposalProvider.java b/tools/eclipse/plugins/org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/AbstractScribbleTraceDslProposalProvider.java deleted file mode 100644 index 9201b42c2..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/AbstractScribbleTraceDslProposalProvider.java +++ /dev/null @@ -1,59 +0,0 @@ -/* -* generated by Xtext -*/ -package org.scribble.trace.editor.dsl.ui.contentassist; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.xtext.*; -import org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor; -import org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext; - -/** - * Represents a generated, default implementation of superclass {@link org.eclipse.xtext.common.ui.contentassist.TerminalsProposalProvider}. - * Methods are dynamically dispatched on the first parameter, i.e., you can override them - * with a more concrete subtype. - */ -@SuppressWarnings("all") -public class AbstractScribbleTraceDslProposalProvider extends org.eclipse.xtext.common.ui.contentassist.TerminalsProposalProvider { - - public void completeTrace_Roles(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeTrace_Steps(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeMessagetransfer_Parameters(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeParameter_Type(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - public void completeParameter_Value(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - completeRuleCall(((RuleCall)assignment.getTerminal()), context, acceptor); - } - - public void complete_Trace(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_Sentence(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_Tracedefn(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_Module(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_Roledefn(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_Stepdefn(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_Messagetransfer(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } - public void complete_Parameter(EObject model, RuleCall ruleCall, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { - // subclasses may override - } -} diff --git a/tools/eclipse/plugins/org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/PartialScribbleTraceDslContentAssistParser.java b/tools/eclipse/plugins/org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/PartialScribbleTraceDslContentAssistParser.java deleted file mode 100644 index 8076bb31b..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/PartialScribbleTraceDslContentAssistParser.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * generated by Xtext - */ -package org.scribble.trace.editor.dsl.ui.contentassist.antlr; - -import java.util.Collection; -import java.util.Collections; - -import org.eclipse.xtext.AbstractRule; -import org.eclipse.xtext.ui.codetemplates.ui.partialEditing.IPartialContentAssistParser; -import org.eclipse.xtext.ui.editor.contentassist.antlr.FollowElement; -import org.eclipse.xtext.ui.editor.contentassist.antlr.internal.AbstractInternalContentAssistParser; -import org.eclipse.xtext.util.PolymorphicDispatcher; - -/** - * @author Sebastian Zarnekow - Initial contribution and API - */ -@SuppressWarnings("restriction") -public class PartialScribbleTraceDslContentAssistParser extends ScribbleTraceDslParser implements IPartialContentAssistParser { - - private AbstractRule rule; - - public void initializeFor(AbstractRule rule) { - this.rule = rule; - } - - @Override - protected Collection getFollowElements(AbstractInternalContentAssistParser parser) { - if (rule == null || rule.eIsProxy()) - return Collections.emptyList(); - String methodName = "entryRule" + rule.getName(); - PolymorphicDispatcher> dispatcher = - new PolymorphicDispatcher>(methodName, 0, 0, Collections.singletonList(parser)); - dispatcher.invoke(); - return parser.getFollowElements(); - } - -} diff --git a/tools/eclipse/plugins/org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/ScribbleTraceDslParser.java b/tools/eclipse/plugins/org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/ScribbleTraceDslParser.java deleted file mode 100644 index 2a8217496..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/ScribbleTraceDslParser.java +++ /dev/null @@ -1,91 +0,0 @@ -/* -* generated by Xtext -*/ -package org.scribble.trace.editor.dsl.ui.contentassist.antlr; - -import java.util.Collection; -import java.util.Map; -import java.util.HashMap; - -import org.antlr.runtime.RecognitionException; -import org.eclipse.xtext.AbstractElement; -import org.eclipse.xtext.ui.editor.contentassist.antlr.AbstractContentAssistParser; -import org.eclipse.xtext.ui.editor.contentassist.antlr.FollowElement; -import org.eclipse.xtext.ui.editor.contentassist.antlr.internal.AbstractInternalContentAssistParser; - -import com.google.inject.Inject; - -import org.scribble.trace.editor.dsl.services.ScribbleTraceDslGrammarAccess; - -public class ScribbleTraceDslParser extends AbstractContentAssistParser { - - @Inject - private ScribbleTraceDslGrammarAccess grammarAccess; - - private Map nameMappings; - - @Override - protected org.scribble.trace.editor.dsl.ui.contentassist.antlr.internal.InternalScribbleTraceDslParser createParser() { - org.scribble.trace.editor.dsl.ui.contentassist.antlr.internal.InternalScribbleTraceDslParser result = new org.scribble.trace.editor.dsl.ui.contentassist.antlr.internal.InternalScribbleTraceDslParser(null); - result.setGrammarAccess(grammarAccess); - return result; - } - - @Override - protected String getRuleName(AbstractElement element) { - if (nameMappings == null) { - nameMappings = new HashMap() { - private static final long serialVersionUID = 1L; - { - put(grammarAccess.getTraceAccess().getGroup(), "rule__Trace__Group__0"); - put(grammarAccess.getTracedefnAccess().getGroup(), "rule__Tracedefn__Group__0"); - put(grammarAccess.getTracedefnAccess().getGroup_2(), "rule__Tracedefn__Group_2__0"); - put(grammarAccess.getTracedefnAccess().getGroup_2_2(), "rule__Tracedefn__Group_2_2__0"); - put(grammarAccess.getModuleAccess().getGroup(), "rule__Module__Group__0"); - put(grammarAccess.getModuleAccess().getGroup_1(), "rule__Module__Group_1__0"); - put(grammarAccess.getRoledefnAccess().getGroup(), "rule__Roledefn__Group__0"); - put(grammarAccess.getRoledefnAccess().getGroup_2(), "rule__Roledefn__Group_2__0"); - put(grammarAccess.getRoledefnAccess().getGroup_2_4(), "rule__Roledefn__Group_2_4__0"); - put(grammarAccess.getMessagetransferAccess().getGroup(), "rule__Messagetransfer__Group__0"); - put(grammarAccess.getMessagetransferAccess().getGroup_2(), "rule__Messagetransfer__Group_2__0"); - put(grammarAccess.getMessagetransferAccess().getGroup_2_1(), "rule__Messagetransfer__Group_2_1__0"); - put(grammarAccess.getMessagetransferAccess().getGroup_2_1_1(), "rule__Messagetransfer__Group_2_1_1__0"); - put(grammarAccess.getMessagetransferAccess().getGroup_7(), "rule__Messagetransfer__Group_7__0"); - put(grammarAccess.getParameterAccess().getGroup(), "rule__Parameter__Group__0"); - put(grammarAccess.getParameterAccess().getGroup_1(), "rule__Parameter__Group_1__0"); - put(grammarAccess.getTraceAccess().getRolesAssignment_2(), "rule__Trace__RolesAssignment_2"); - put(grammarAccess.getTraceAccess().getStepsAssignment_3(), "rule__Trace__StepsAssignment_3"); - put(grammarAccess.getMessagetransferAccess().getParametersAssignment_2_1_0(), "rule__Messagetransfer__ParametersAssignment_2_1_0"); - put(grammarAccess.getMessagetransferAccess().getParametersAssignment_2_1_1_1(), "rule__Messagetransfer__ParametersAssignment_2_1_1_1"); - put(grammarAccess.getParameterAccess().getTypeAssignment_0(), "rule__Parameter__TypeAssignment_0"); - put(grammarAccess.getParameterAccess().getValueAssignment_1_1(), "rule__Parameter__ValueAssignment_1_1"); - } - }; - } - return nameMappings.get(element); - } - - @Override - protected Collection getFollowElements(AbstractInternalContentAssistParser parser) { - try { - org.scribble.trace.editor.dsl.ui.contentassist.antlr.internal.InternalScribbleTraceDslParser typedParser = (org.scribble.trace.editor.dsl.ui.contentassist.antlr.internal.InternalScribbleTraceDslParser) parser; - typedParser.entryRuleTrace(); - return typedParser.getFollowElements(); - } catch(RecognitionException ex) { - throw new RuntimeException(ex); - } - } - - @Override - protected String[] getInitialHiddenTokens() { - return new String[] { "RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT" }; - } - - public ScribbleTraceDslGrammarAccess getGrammarAccess() { - return this.grammarAccess; - } - - public void setGrammarAccess(ScribbleTraceDslGrammarAccess grammarAccess) { - this.grammarAccess = grammarAccess; - } -} diff --git a/tools/eclipse/plugins/org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g b/tools/eclipse/plugins/org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g deleted file mode 100644 index 6307674ba..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g +++ /dev/null @@ -1,1973 +0,0 @@ -/* -* generated by Xtext -*/ -grammar InternalScribbleTraceDsl; - -options { - superClass=AbstractInternalContentAssistParser; - -} - -@lexer::header { -package org.scribble.trace.editor.dsl.ui.contentassist.antlr.internal; - -// Hack: Use our own Lexer superclass by means of import. -// Currently there is no other way to specify the superclass for the lexer. -import org.eclipse.xtext.ui.editor.contentassist.antlr.internal.Lexer; -} - -@parser::header { -package org.scribble.trace.editor.dsl.ui.contentassist.antlr.internal; - -import java.io.InputStream; -import org.eclipse.xtext.*; -import org.eclipse.xtext.parser.*; -import org.eclipse.xtext.parser.impl.*; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.xtext.parser.antlr.XtextTokenStream; -import org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens; -import org.eclipse.xtext.ui.editor.contentassist.antlr.internal.AbstractInternalContentAssistParser; -import org.eclipse.xtext.ui.editor.contentassist.antlr.internal.DFA; -import org.scribble.trace.editor.dsl.services.ScribbleTraceDslGrammarAccess; - -} - -@parser::members { - - private ScribbleTraceDslGrammarAccess grammarAccess; - - public void setGrammarAccess(ScribbleTraceDslGrammarAccess grammarAccess) { - this.grammarAccess = grammarAccess; - } - - @Override - protected Grammar getGrammar() { - return grammarAccess.getGrammar(); - } - - @Override - protected String getValueForTokenName(String tokenName) { - return tokenName; - } - -} - - - - -// Entry rule entryRuleTrace -entryRuleTrace -: -{ before(grammarAccess.getTraceRule()); } - ruleTrace -{ after(grammarAccess.getTraceRule()); } - EOF -; - -// Rule Trace -ruleTrace - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getTraceAccess().getGroup()); } -(rule__Trace__Group__0) -{ after(grammarAccess.getTraceAccess().getGroup()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRuleSentence -entryRuleSentence -: -{ before(grammarAccess.getSentenceRule()); } - ruleSentence -{ after(grammarAccess.getSentenceRule()); } - EOF -; - -// Rule Sentence -ruleSentence - @init { - int stackSize = keepStackSize(); - } - : -( -( -{ before(grammarAccess.getSentenceAccess().getIDTerminalRuleCall()); } -( RULE_ID) -{ after(grammarAccess.getSentenceAccess().getIDTerminalRuleCall()); } -) -( -{ before(grammarAccess.getSentenceAccess().getIDTerminalRuleCall()); } -( RULE_ID)* -{ after(grammarAccess.getSentenceAccess().getIDTerminalRuleCall()); } -) -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRuleTracedefn -entryRuleTracedefn -: -{ before(grammarAccess.getTracedefnRule()); } - ruleTracedefn -{ after(grammarAccess.getTracedefnRule()); } - EOF -; - -// Rule Tracedefn -ruleTracedefn - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getTracedefnAccess().getGroup()); } -(rule__Tracedefn__Group__0) -{ after(grammarAccess.getTracedefnAccess().getGroup()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRuleModule -entryRuleModule -: -{ before(grammarAccess.getModuleRule()); } - ruleModule -{ after(grammarAccess.getModuleRule()); } - EOF -; - -// Rule Module -ruleModule - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getModuleAccess().getGroup()); } -(rule__Module__Group__0) -{ after(grammarAccess.getModuleAccess().getGroup()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRuleRoledefn -entryRuleRoledefn -: -{ before(grammarAccess.getRoledefnRule()); } - ruleRoledefn -{ after(grammarAccess.getRoledefnRule()); } - EOF -; - -// Rule Roledefn -ruleRoledefn - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getRoledefnAccess().getGroup()); } -(rule__Roledefn__Group__0) -{ after(grammarAccess.getRoledefnAccess().getGroup()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRuleStepdefn -entryRuleStepdefn -: -{ before(grammarAccess.getStepdefnRule()); } - ruleStepdefn -{ after(grammarAccess.getStepdefnRule()); } - EOF -; - -// Rule Stepdefn -ruleStepdefn - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getStepdefnAccess().getMessagetransferParserRuleCall()); } - ruleMessagetransfer -{ after(grammarAccess.getStepdefnAccess().getMessagetransferParserRuleCall()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRuleMessagetransfer -entryRuleMessagetransfer -: -{ before(grammarAccess.getMessagetransferRule()); } - ruleMessagetransfer -{ after(grammarAccess.getMessagetransferRule()); } - EOF -; - -// Rule Messagetransfer -ruleMessagetransfer - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getMessagetransferAccess().getGroup()); } -(rule__Messagetransfer__Group__0) -{ after(grammarAccess.getMessagetransferAccess().getGroup()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - -// Entry rule entryRuleParameter -entryRuleParameter -: -{ before(grammarAccess.getParameterRule()); } - ruleParameter -{ after(grammarAccess.getParameterRule()); } - EOF -; - -// Rule Parameter -ruleParameter - @init { - int stackSize = keepStackSize(); - } - : -( -{ before(grammarAccess.getParameterAccess().getGroup()); } -(rule__Parameter__Group__0) -{ after(grammarAccess.getParameterAccess().getGroup()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__Trace__Group__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__Trace__Group__0__Impl - rule__Trace__Group__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__Trace__Group__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getTraceAccess().getTraceAction_0()); } -( - -) -{ after(grammarAccess.getTraceAccess().getTraceAction_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Trace__Group__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__Trace__Group__1__Impl - rule__Trace__Group__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__Trace__Group__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getTraceAccess().getTracedefnParserRuleCall_1()); } - ruleTracedefn -{ after(grammarAccess.getTraceAccess().getTracedefnParserRuleCall_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Trace__Group__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__Trace__Group__2__Impl - rule__Trace__Group__3 -; -finally { - restoreStackSize(stackSize); -} - -rule__Trace__Group__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getTraceAccess().getRolesAssignment_2()); } -(rule__Trace__RolesAssignment_2)* -{ after(grammarAccess.getTraceAccess().getRolesAssignment_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Trace__Group__3 - @init { - int stackSize = keepStackSize(); - } -: - rule__Trace__Group__3__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__Trace__Group__3__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getTraceAccess().getStepsAssignment_3()); } -(rule__Trace__StepsAssignment_3)* -{ after(grammarAccess.getTraceAccess().getStepsAssignment_3()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - - - -rule__Tracedefn__Group__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__Tracedefn__Group__0__Impl - rule__Tracedefn__Group__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__Tracedefn__Group__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getTracedefnAccess().getTraceKeyword_0()); } - - 'trace' - -{ after(grammarAccess.getTracedefnAccess().getTraceKeyword_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Tracedefn__Group__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__Tracedefn__Group__1__Impl - rule__Tracedefn__Group__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__Tracedefn__Group__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getTracedefnAccess().getIDTerminalRuleCall_1()); } - RULE_ID -{ after(grammarAccess.getTracedefnAccess().getIDTerminalRuleCall_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Tracedefn__Group__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__Tracedefn__Group__2__Impl - rule__Tracedefn__Group__3 -; -finally { - restoreStackSize(stackSize); -} - -rule__Tracedefn__Group__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getTracedefnAccess().getGroup_2()); } -(rule__Tracedefn__Group_2__0)? -{ after(grammarAccess.getTracedefnAccess().getGroup_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Tracedefn__Group__3 - @init { - int stackSize = keepStackSize(); - } -: - rule__Tracedefn__Group__3__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__Tracedefn__Group__3__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getTracedefnAccess().getSemicolonKeyword_3()); } - - ';' - -{ after(grammarAccess.getTracedefnAccess().getSemicolonKeyword_3()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - - - -rule__Tracedefn__Group_2__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__Tracedefn__Group_2__0__Impl - rule__Tracedefn__Group_2__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__Tracedefn__Group_2__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getTracedefnAccess().getByKeyword_2_0()); } - - 'by' - -{ after(grammarAccess.getTracedefnAccess().getByKeyword_2_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Tracedefn__Group_2__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__Tracedefn__Group_2__1__Impl - rule__Tracedefn__Group_2__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__Tracedefn__Group_2__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getTracedefnAccess().getSentenceParserRuleCall_2_1()); } - ruleSentence -{ after(grammarAccess.getTracedefnAccess().getSentenceParserRuleCall_2_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Tracedefn__Group_2__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__Tracedefn__Group_2__2__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__Tracedefn__Group_2__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getTracedefnAccess().getGroup_2_2()); } -(rule__Tracedefn__Group_2_2__0)? -{ after(grammarAccess.getTracedefnAccess().getGroup_2_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - -rule__Tracedefn__Group_2_2__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__Tracedefn__Group_2_2__0__Impl - rule__Tracedefn__Group_2_2__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__Tracedefn__Group_2_2__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getTracedefnAccess().getShowsKeyword_2_2_0()); } - - 'shows' - -{ after(grammarAccess.getTracedefnAccess().getShowsKeyword_2_2_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Tracedefn__Group_2_2__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__Tracedefn__Group_2_2__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__Tracedefn__Group_2_2__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getTracedefnAccess().getSentenceParserRuleCall_2_2_1()); } - ruleSentence -{ after(grammarAccess.getTracedefnAccess().getSentenceParserRuleCall_2_2_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__Module__Group__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__Module__Group__0__Impl - rule__Module__Group__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__Module__Group__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getModuleAccess().getIDTerminalRuleCall_0()); } - RULE_ID -{ after(grammarAccess.getModuleAccess().getIDTerminalRuleCall_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Module__Group__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__Module__Group__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__Module__Group__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getModuleAccess().getGroup_1()); } -(rule__Module__Group_1__0)* -{ after(grammarAccess.getModuleAccess().getGroup_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__Module__Group_1__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__Module__Group_1__0__Impl - rule__Module__Group_1__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__Module__Group_1__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getModuleAccess().getFullStopKeyword_1_0()); } - - '.' - -{ after(grammarAccess.getModuleAccess().getFullStopKeyword_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Module__Group_1__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__Module__Group_1__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__Module__Group_1__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getModuleAccess().getIDTerminalRuleCall_1_1()); } - RULE_ID -{ after(grammarAccess.getModuleAccess().getIDTerminalRuleCall_1_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__Roledefn__Group__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__Roledefn__Group__0__Impl - rule__Roledefn__Group__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__Roledefn__Group__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getRoledefnAccess().getRoleKeyword_0()); } - - 'role' - -{ after(grammarAccess.getRoledefnAccess().getRoleKeyword_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Roledefn__Group__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__Roledefn__Group__1__Impl - rule__Roledefn__Group__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__Roledefn__Group__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getRoledefnAccess().getIDTerminalRuleCall_1()); } - RULE_ID -{ after(grammarAccess.getRoledefnAccess().getIDTerminalRuleCall_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Roledefn__Group__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__Roledefn__Group__2__Impl - rule__Roledefn__Group__3 -; -finally { - restoreStackSize(stackSize); -} - -rule__Roledefn__Group__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getRoledefnAccess().getGroup_2()); } -(rule__Roledefn__Group_2__0)? -{ after(grammarAccess.getRoledefnAccess().getGroup_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Roledefn__Group__3 - @init { - int stackSize = keepStackSize(); - } -: - rule__Roledefn__Group__3__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__Roledefn__Group__3__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getRoledefnAccess().getSemicolonKeyword_3()); } - - ';' - -{ after(grammarAccess.getRoledefnAccess().getSemicolonKeyword_3()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - - - -rule__Roledefn__Group_2__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__Roledefn__Group_2__0__Impl - rule__Roledefn__Group_2__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__Roledefn__Group_2__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getRoledefnAccess().getSimulatingKeyword_2_0()); } - - 'simulating' - -{ after(grammarAccess.getRoledefnAccess().getSimulatingKeyword_2_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Roledefn__Group_2__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__Roledefn__Group_2__1__Impl - rule__Roledefn__Group_2__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__Roledefn__Group_2__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getRoledefnAccess().getModuleParserRuleCall_2_1()); } - ruleModule -{ after(grammarAccess.getRoledefnAccess().getModuleParserRuleCall_2_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Roledefn__Group_2__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__Roledefn__Group_2__2__Impl - rule__Roledefn__Group_2__3 -; -finally { - restoreStackSize(stackSize); -} - -rule__Roledefn__Group_2__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getRoledefnAccess().getProtocolKeyword_2_2()); } - - 'protocol' - -{ after(grammarAccess.getRoledefnAccess().getProtocolKeyword_2_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Roledefn__Group_2__3 - @init { - int stackSize = keepStackSize(); - } -: - rule__Roledefn__Group_2__3__Impl - rule__Roledefn__Group_2__4 -; -finally { - restoreStackSize(stackSize); -} - -rule__Roledefn__Group_2__3__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getRoledefnAccess().getIDTerminalRuleCall_2_3()); } - RULE_ID -{ after(grammarAccess.getRoledefnAccess().getIDTerminalRuleCall_2_3()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Roledefn__Group_2__4 - @init { - int stackSize = keepStackSize(); - } -: - rule__Roledefn__Group_2__4__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__Roledefn__Group_2__4__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getRoledefnAccess().getGroup_2_4()); } -(rule__Roledefn__Group_2_4__0)? -{ after(grammarAccess.getRoledefnAccess().getGroup_2_4()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - - - - - -rule__Roledefn__Group_2_4__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__Roledefn__Group_2_4__0__Impl - rule__Roledefn__Group_2_4__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__Roledefn__Group_2_4__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getRoledefnAccess().getAsKeyword_2_4_0()); } - - 'as' - -{ after(grammarAccess.getRoledefnAccess().getAsKeyword_2_4_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Roledefn__Group_2_4__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__Roledefn__Group_2_4__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__Roledefn__Group_2_4__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getRoledefnAccess().getIDTerminalRuleCall_2_4_1()); } - RULE_ID -{ after(grammarAccess.getRoledefnAccess().getIDTerminalRuleCall_2_4_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__Messagetransfer__Group__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__Messagetransfer__Group__0__Impl - rule__Messagetransfer__Group__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__Messagetransfer__Group__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getMessagetransferAccess().getMessagetransferAction_0()); } -( - -) -{ after(grammarAccess.getMessagetransferAccess().getMessagetransferAction_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Messagetransfer__Group__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__Messagetransfer__Group__1__Impl - rule__Messagetransfer__Group__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__Messagetransfer__Group__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getMessagetransferAccess().getIDTerminalRuleCall_1()); } - RULE_ID -{ after(grammarAccess.getMessagetransferAccess().getIDTerminalRuleCall_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Messagetransfer__Group__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__Messagetransfer__Group__2__Impl - rule__Messagetransfer__Group__3 -; -finally { - restoreStackSize(stackSize); -} - -rule__Messagetransfer__Group__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getMessagetransferAccess().getGroup_2()); } -(rule__Messagetransfer__Group_2__0)? -{ after(grammarAccess.getMessagetransferAccess().getGroup_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Messagetransfer__Group__3 - @init { - int stackSize = keepStackSize(); - } -: - rule__Messagetransfer__Group__3__Impl - rule__Messagetransfer__Group__4 -; -finally { - restoreStackSize(stackSize); -} - -rule__Messagetransfer__Group__3__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getMessagetransferAccess().getFromKeyword_3()); } - - 'from' - -{ after(grammarAccess.getMessagetransferAccess().getFromKeyword_3()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Messagetransfer__Group__4 - @init { - int stackSize = keepStackSize(); - } -: - rule__Messagetransfer__Group__4__Impl - rule__Messagetransfer__Group__5 -; -finally { - restoreStackSize(stackSize); -} - -rule__Messagetransfer__Group__4__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getMessagetransferAccess().getIDTerminalRuleCall_4()); } - RULE_ID -{ after(grammarAccess.getMessagetransferAccess().getIDTerminalRuleCall_4()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Messagetransfer__Group__5 - @init { - int stackSize = keepStackSize(); - } -: - rule__Messagetransfer__Group__5__Impl - rule__Messagetransfer__Group__6 -; -finally { - restoreStackSize(stackSize); -} - -rule__Messagetransfer__Group__5__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getMessagetransferAccess().getToKeyword_5()); } - - 'to' - -{ after(grammarAccess.getMessagetransferAccess().getToKeyword_5()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Messagetransfer__Group__6 - @init { - int stackSize = keepStackSize(); - } -: - rule__Messagetransfer__Group__6__Impl - rule__Messagetransfer__Group__7 -; -finally { - restoreStackSize(stackSize); -} - -rule__Messagetransfer__Group__6__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getMessagetransferAccess().getIDTerminalRuleCall_6()); } - RULE_ID -{ after(grammarAccess.getMessagetransferAccess().getIDTerminalRuleCall_6()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Messagetransfer__Group__7 - @init { - int stackSize = keepStackSize(); - } -: - rule__Messagetransfer__Group__7__Impl - rule__Messagetransfer__Group__8 -; -finally { - restoreStackSize(stackSize); -} - -rule__Messagetransfer__Group__7__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getMessagetransferAccess().getGroup_7()); } -(rule__Messagetransfer__Group_7__0)* -{ after(grammarAccess.getMessagetransferAccess().getGroup_7()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Messagetransfer__Group__8 - @init { - int stackSize = keepStackSize(); - } -: - rule__Messagetransfer__Group__8__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__Messagetransfer__Group__8__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getMessagetransferAccess().getSemicolonKeyword_8()); } - - ';' - -{ after(grammarAccess.getMessagetransferAccess().getSemicolonKeyword_8()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - - - - - - - - - - - - - -rule__Messagetransfer__Group_2__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__Messagetransfer__Group_2__0__Impl - rule__Messagetransfer__Group_2__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__Messagetransfer__Group_2__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getMessagetransferAccess().getLeftParenthesisKeyword_2_0()); } - - '(' - -{ after(grammarAccess.getMessagetransferAccess().getLeftParenthesisKeyword_2_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Messagetransfer__Group_2__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__Messagetransfer__Group_2__1__Impl - rule__Messagetransfer__Group_2__2 -; -finally { - restoreStackSize(stackSize); -} - -rule__Messagetransfer__Group_2__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getMessagetransferAccess().getGroup_2_1()); } -(rule__Messagetransfer__Group_2_1__0)? -{ after(grammarAccess.getMessagetransferAccess().getGroup_2_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Messagetransfer__Group_2__2 - @init { - int stackSize = keepStackSize(); - } -: - rule__Messagetransfer__Group_2__2__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__Messagetransfer__Group_2__2__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getMessagetransferAccess().getRightParenthesisKeyword_2_2()); } - - ')' - -{ after(grammarAccess.getMessagetransferAccess().getRightParenthesisKeyword_2_2()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - - -rule__Messagetransfer__Group_2_1__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__Messagetransfer__Group_2_1__0__Impl - rule__Messagetransfer__Group_2_1__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__Messagetransfer__Group_2_1__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getMessagetransferAccess().getParametersAssignment_2_1_0()); } -(rule__Messagetransfer__ParametersAssignment_2_1_0) -{ after(grammarAccess.getMessagetransferAccess().getParametersAssignment_2_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Messagetransfer__Group_2_1__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__Messagetransfer__Group_2_1__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__Messagetransfer__Group_2_1__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getMessagetransferAccess().getGroup_2_1_1()); } -(rule__Messagetransfer__Group_2_1_1__0)* -{ after(grammarAccess.getMessagetransferAccess().getGroup_2_1_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__Messagetransfer__Group_2_1_1__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__Messagetransfer__Group_2_1_1__0__Impl - rule__Messagetransfer__Group_2_1_1__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__Messagetransfer__Group_2_1_1__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getMessagetransferAccess().getCommaKeyword_2_1_1_0()); } - - ',' - -{ after(grammarAccess.getMessagetransferAccess().getCommaKeyword_2_1_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Messagetransfer__Group_2_1_1__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__Messagetransfer__Group_2_1_1__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__Messagetransfer__Group_2_1_1__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getMessagetransferAccess().getParametersAssignment_2_1_1_1()); } -(rule__Messagetransfer__ParametersAssignment_2_1_1_1) -{ after(grammarAccess.getMessagetransferAccess().getParametersAssignment_2_1_1_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__Messagetransfer__Group_7__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__Messagetransfer__Group_7__0__Impl - rule__Messagetransfer__Group_7__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__Messagetransfer__Group_7__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getMessagetransferAccess().getCommaKeyword_7_0()); } - - ',' - -{ after(grammarAccess.getMessagetransferAccess().getCommaKeyword_7_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Messagetransfer__Group_7__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__Messagetransfer__Group_7__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__Messagetransfer__Group_7__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getMessagetransferAccess().getIDTerminalRuleCall_7_1()); } - RULE_ID -{ after(grammarAccess.getMessagetransferAccess().getIDTerminalRuleCall_7_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__Parameter__Group__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__Parameter__Group__0__Impl - rule__Parameter__Group__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__Parameter__Group__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getParameterAccess().getTypeAssignment_0()); } -(rule__Parameter__TypeAssignment_0) -{ after(grammarAccess.getParameterAccess().getTypeAssignment_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Parameter__Group__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__Parameter__Group__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__Parameter__Group__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getParameterAccess().getGroup_1()); } -(rule__Parameter__Group_1__0)? -{ after(grammarAccess.getParameterAccess().getGroup_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - -rule__Parameter__Group_1__0 - @init { - int stackSize = keepStackSize(); - } -: - rule__Parameter__Group_1__0__Impl - rule__Parameter__Group_1__1 -; -finally { - restoreStackSize(stackSize); -} - -rule__Parameter__Group_1__0__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getParameterAccess().getEqualsSignKeyword_1_0()); } - - '=' - -{ after(grammarAccess.getParameterAccess().getEqualsSignKeyword_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -rule__Parameter__Group_1__1 - @init { - int stackSize = keepStackSize(); - } -: - rule__Parameter__Group_1__1__Impl -; -finally { - restoreStackSize(stackSize); -} - -rule__Parameter__Group_1__1__Impl - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getParameterAccess().getValueAssignment_1_1()); } -(rule__Parameter__ValueAssignment_1_1) -{ after(grammarAccess.getParameterAccess().getValueAssignment_1_1()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - - - - - - -rule__Trace__RolesAssignment_2 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getTraceAccess().getRolesRoledefnParserRuleCall_2_0()); } - ruleRoledefn{ after(grammarAccess.getTraceAccess().getRolesRoledefnParserRuleCall_2_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__Trace__StepsAssignment_3 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getTraceAccess().getStepsStepdefnParserRuleCall_3_0()); } - ruleStepdefn{ after(grammarAccess.getTraceAccess().getStepsStepdefnParserRuleCall_3_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__Messagetransfer__ParametersAssignment_2_1_0 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getMessagetransferAccess().getParametersParameterParserRuleCall_2_1_0_0()); } - ruleParameter{ after(grammarAccess.getMessagetransferAccess().getParametersParameterParserRuleCall_2_1_0_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__Messagetransfer__ParametersAssignment_2_1_1_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getMessagetransferAccess().getParametersParameterParserRuleCall_2_1_1_1_0()); } - ruleParameter{ after(grammarAccess.getMessagetransferAccess().getParametersParameterParserRuleCall_2_1_1_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__Parameter__TypeAssignment_0 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getParameterAccess().getTypeSTRINGTerminalRuleCall_0_0()); } - RULE_STRING{ after(grammarAccess.getParameterAccess().getTypeSTRINGTerminalRuleCall_0_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - -rule__Parameter__ValueAssignment_1_1 - @init { - int stackSize = keepStackSize(); - } -: -( -{ before(grammarAccess.getParameterAccess().getValueSTRINGTerminalRuleCall_1_1_0()); } - RULE_STRING{ after(grammarAccess.getParameterAccess().getValueSTRINGTerminalRuleCall_1_1_0()); } -) - -; -finally { - restoreStackSize(stackSize); -} - - -RULE_ID : '^'? ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*; - -RULE_INT : ('0'..'9')+; - -RULE_STRING : ('"' ('\\' .|~(('\\'|'"')))* '"'|'\'' ('\\' .|~(('\\'|'\'')))* '\''); - -RULE_ML_COMMENT : '/*' ( options {greedy=false;} : . )*'*/'; - -RULE_SL_COMMENT : '//' ~(('\n'|'\r'))* ('\r'? '\n')?; - -RULE_WS : (' '|'\t'|'\r'|'\n')+; - -RULE_ANY_OTHER : .; - - diff --git a/tools/eclipse/plugins/org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.tokens b/tools/eclipse/plugins/org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.tokens deleted file mode 100644 index a6a7aa258..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.tokens +++ /dev/null @@ -1,37 +0,0 @@ -'('=22 -')'=23 -','=24 -'.'=15 -';'=12 -'='=25 -'as'=19 -'by'=13 -'from'=20 -'protocol'=18 -'role'=16 -'shows'=14 -'simulating'=17 -'to'=21 -'trace'=11 -RULE_ANY_OTHER=10 -RULE_ID=4 -RULE_INT=6 -RULE_ML_COMMENT=7 -RULE_SL_COMMENT=8 -RULE_STRING=5 -RULE_WS=9 -T__11=11 -T__12=12 -T__13=13 -T__14=14 -T__15=15 -T__16=16 -T__17=17 -T__18=18 -T__19=19 -T__20=20 -T__21=21 -T__22=22 -T__23=23 -T__24=24 -T__25=25 diff --git a/tools/eclipse/plugins/org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDslLexer.java b/tools/eclipse/plugins/org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDslLexer.java deleted file mode 100644 index 14c24c66a..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDslLexer.java +++ /dev/null @@ -1,1229 +0,0 @@ -package org.scribble.trace.editor.dsl.ui.contentassist.antlr.internal; - -// Hack: Use our own Lexer superclass by means of import. -// Currently there is no other way to specify the superclass for the lexer. -import org.eclipse.xtext.ui.editor.contentassist.antlr.internal.Lexer; - - -import org.antlr.runtime.*; -import java.util.Stack; -import java.util.List; -import java.util.ArrayList; - -@SuppressWarnings("all") -public class InternalScribbleTraceDslLexer extends Lexer { - public static final int RULE_ID=4; - public static final int T__25=25; - public static final int T__24=24; - public static final int T__23=23; - public static final int T__22=22; - public static final int RULE_ANY_OTHER=10; - public static final int T__21=21; - public static final int T__20=20; - public static final int EOF=-1; - public static final int RULE_SL_COMMENT=8; - public static final int RULE_ML_COMMENT=7; - public static final int T__19=19; - public static final int RULE_STRING=5; - public static final int T__16=16; - public static final int T__15=15; - public static final int T__18=18; - public static final int T__17=17; - public static final int T__12=12; - public static final int T__11=11; - public static final int T__14=14; - public static final int T__13=13; - public static final int RULE_INT=6; - public static final int RULE_WS=9; - - // delegates - // delegators - - public InternalScribbleTraceDslLexer() {;} - public InternalScribbleTraceDslLexer(CharStream input) { - this(input, new RecognizerSharedState()); - } - public InternalScribbleTraceDslLexer(CharStream input, RecognizerSharedState state) { - super(input,state); - - } - public String getGrammarFileName() { return "../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g"; } - - // $ANTLR start "T__11" - public final void mT__11() throws RecognitionException { - try { - int _type = T__11; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:11:7: ( 'trace' ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:11:9: 'trace' - { - match("trace"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__11" - - // $ANTLR start "T__12" - public final void mT__12() throws RecognitionException { - try { - int _type = T__12; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:12:7: ( ';' ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:12:9: ';' - { - match(';'); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__12" - - // $ANTLR start "T__13" - public final void mT__13() throws RecognitionException { - try { - int _type = T__13; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:13:7: ( 'by' ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:13:9: 'by' - { - match("by"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__13" - - // $ANTLR start "T__14" - public final void mT__14() throws RecognitionException { - try { - int _type = T__14; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:14:7: ( 'shows' ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:14:9: 'shows' - { - match("shows"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__14" - - // $ANTLR start "T__15" - public final void mT__15() throws RecognitionException { - try { - int _type = T__15; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:15:7: ( '.' ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:15:9: '.' - { - match('.'); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__15" - - // $ANTLR start "T__16" - public final void mT__16() throws RecognitionException { - try { - int _type = T__16; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:16:7: ( 'role' ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:16:9: 'role' - { - match("role"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__16" - - // $ANTLR start "T__17" - public final void mT__17() throws RecognitionException { - try { - int _type = T__17; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:17:7: ( 'simulating' ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:17:9: 'simulating' - { - match("simulating"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__17" - - // $ANTLR start "T__18" - public final void mT__18() throws RecognitionException { - try { - int _type = T__18; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:18:7: ( 'protocol' ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:18:9: 'protocol' - { - match("protocol"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__18" - - // $ANTLR start "T__19" - public final void mT__19() throws RecognitionException { - try { - int _type = T__19; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:19:7: ( 'as' ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:19:9: 'as' - { - match("as"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__19" - - // $ANTLR start "T__20" - public final void mT__20() throws RecognitionException { - try { - int _type = T__20; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:20:7: ( 'from' ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:20:9: 'from' - { - match("from"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__20" - - // $ANTLR start "T__21" - public final void mT__21() throws RecognitionException { - try { - int _type = T__21; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:21:7: ( 'to' ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:21:9: 'to' - { - match("to"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__21" - - // $ANTLR start "T__22" - public final void mT__22() throws RecognitionException { - try { - int _type = T__22; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:22:7: ( '(' ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:22:9: '(' - { - match('('); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__22" - - // $ANTLR start "T__23" - public final void mT__23() throws RecognitionException { - try { - int _type = T__23; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:23:7: ( ')' ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:23:9: ')' - { - match(')'); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__23" - - // $ANTLR start "T__24" - public final void mT__24() throws RecognitionException { - try { - int _type = T__24; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:24:7: ( ',' ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:24:9: ',' - { - match(','); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__24" - - // $ANTLR start "T__25" - public final void mT__25() throws RecognitionException { - try { - int _type = T__25; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:25:7: ( '=' ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:25:9: '=' - { - match('='); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__25" - - // $ANTLR start "RULE_ID" - public final void mRULE_ID() throws RecognitionException { - try { - int _type = RULE_ID; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1959:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1959:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1959:11: ( '^' )? - int alt1=2; - int LA1_0 = input.LA(1); - - if ( (LA1_0=='^') ) { - alt1=1; - } - switch (alt1) { - case 1 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1959:11: '^' - { - match('^'); - - } - break; - - } - - if ( (input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1959:40: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* - loop2: - do { - int alt2=2; - int LA2_0 = input.LA(1); - - if ( ((LA2_0>='0' && LA2_0<='9')||(LA2_0>='A' && LA2_0<='Z')||LA2_0=='_'||(LA2_0>='a' && LA2_0<='z')) ) { - alt2=1; - } - - - switch (alt2) { - case 1 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g: - { - if ( (input.LA(1)>='0' && input.LA(1)<='9')||(input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - - } - break; - - default : - break loop2; - } - } while (true); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "RULE_ID" - - // $ANTLR start "RULE_INT" - public final void mRULE_INT() throws RecognitionException { - try { - int _type = RULE_INT; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1961:10: ( ( '0' .. '9' )+ ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1961:12: ( '0' .. '9' )+ - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1961:12: ( '0' .. '9' )+ - int cnt3=0; - loop3: - do { - int alt3=2; - int LA3_0 = input.LA(1); - - if ( ((LA3_0>='0' && LA3_0<='9')) ) { - alt3=1; - } - - - switch (alt3) { - case 1 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1961:13: '0' .. '9' - { - matchRange('0','9'); - - } - break; - - default : - if ( cnt3 >= 1 ) break loop3; - EarlyExitException eee = - new EarlyExitException(3, input); - throw eee; - } - cnt3++; - } while (true); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "RULE_INT" - - // $ANTLR start "RULE_STRING" - public final void mRULE_STRING() throws RecognitionException { - try { - int _type = RULE_STRING; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1963:13: ( ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1963:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1963:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) - int alt6=2; - int LA6_0 = input.LA(1); - - if ( (LA6_0=='\"') ) { - alt6=1; - } - else if ( (LA6_0=='\'') ) { - alt6=2; - } - else { - NoViableAltException nvae = - new NoViableAltException("", 6, 0, input); - - throw nvae; - } - switch (alt6) { - case 1 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1963:16: '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' - { - match('\"'); - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1963:20: ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* - loop4: - do { - int alt4=3; - int LA4_0 = input.LA(1); - - if ( (LA4_0=='\\') ) { - alt4=1; - } - else if ( ((LA4_0>='\u0000' && LA4_0<='!')||(LA4_0>='#' && LA4_0<='[')||(LA4_0>=']' && LA4_0<='\uFFFF')) ) { - alt4=2; - } - - - switch (alt4) { - case 1 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1963:21: '\\\\' . - { - match('\\'); - matchAny(); - - } - break; - case 2 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1963:28: ~ ( ( '\\\\' | '\"' ) ) - { - if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - - } - break; - - default : - break loop4; - } - } while (true); - - match('\"'); - - } - break; - case 2 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1963:48: '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' - { - match('\''); - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1963:53: ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* - loop5: - do { - int alt5=3; - int LA5_0 = input.LA(1); - - if ( (LA5_0=='\\') ) { - alt5=1; - } - else if ( ((LA5_0>='\u0000' && LA5_0<='&')||(LA5_0>='(' && LA5_0<='[')||(LA5_0>=']' && LA5_0<='\uFFFF')) ) { - alt5=2; - } - - - switch (alt5) { - case 1 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1963:54: '\\\\' . - { - match('\\'); - matchAny(); - - } - break; - case 2 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1963:61: ~ ( ( '\\\\' | '\\'' ) ) - { - if ( (input.LA(1)>='\u0000' && input.LA(1)<='&')||(input.LA(1)>='(' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - - } - break; - - default : - break loop5; - } - } while (true); - - match('\''); - - } - break; - - } - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "RULE_STRING" - - // $ANTLR start "RULE_ML_COMMENT" - public final void mRULE_ML_COMMENT() throws RecognitionException { - try { - int _type = RULE_ML_COMMENT; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1965:17: ( '/*' ( options {greedy=false; } : . )* '*/' ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1965:19: '/*' ( options {greedy=false; } : . )* '*/' - { - match("/*"); - - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1965:24: ( options {greedy=false; } : . )* - loop7: - do { - int alt7=2; - int LA7_0 = input.LA(1); - - if ( (LA7_0=='*') ) { - int LA7_1 = input.LA(2); - - if ( (LA7_1=='/') ) { - alt7=2; - } - else if ( ((LA7_1>='\u0000' && LA7_1<='.')||(LA7_1>='0' && LA7_1<='\uFFFF')) ) { - alt7=1; - } - - - } - else if ( ((LA7_0>='\u0000' && LA7_0<=')')||(LA7_0>='+' && LA7_0<='\uFFFF')) ) { - alt7=1; - } - - - switch (alt7) { - case 1 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1965:52: . - { - matchAny(); - - } - break; - - default : - break loop7; - } - } while (true); - - match("*/"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "RULE_ML_COMMENT" - - // $ANTLR start "RULE_SL_COMMENT" - public final void mRULE_SL_COMMENT() throws RecognitionException { - try { - int _type = RULE_SL_COMMENT; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1967:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1967:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? - { - match("//"); - - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1967:24: (~ ( ( '\\n' | '\\r' ) ) )* - loop8: - do { - int alt8=2; - int LA8_0 = input.LA(1); - - if ( ((LA8_0>='\u0000' && LA8_0<='\t')||(LA8_0>='\u000B' && LA8_0<='\f')||(LA8_0>='\u000E' && LA8_0<='\uFFFF')) ) { - alt8=1; - } - - - switch (alt8) { - case 1 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1967:24: ~ ( ( '\\n' | '\\r' ) ) - { - if ( (input.LA(1)>='\u0000' && input.LA(1)<='\t')||(input.LA(1)>='\u000B' && input.LA(1)<='\f')||(input.LA(1)>='\u000E' && input.LA(1)<='\uFFFF') ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - - } - break; - - default : - break loop8; - } - } while (true); - - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1967:40: ( ( '\\r' )? '\\n' )? - int alt10=2; - int LA10_0 = input.LA(1); - - if ( (LA10_0=='\n'||LA10_0=='\r') ) { - alt10=1; - } - switch (alt10) { - case 1 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1967:41: ( '\\r' )? '\\n' - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1967:41: ( '\\r' )? - int alt9=2; - int LA9_0 = input.LA(1); - - if ( (LA9_0=='\r') ) { - alt9=1; - } - switch (alt9) { - case 1 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1967:41: '\\r' - { - match('\r'); - - } - break; - - } - - match('\n'); - - } - break; - - } - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "RULE_SL_COMMENT" - - // $ANTLR start "RULE_WS" - public final void mRULE_WS() throws RecognitionException { - try { - int _type = RULE_WS; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1969:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1969:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1969:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ - int cnt11=0; - loop11: - do { - int alt11=2; - int LA11_0 = input.LA(1); - - if ( ((LA11_0>='\t' && LA11_0<='\n')||LA11_0=='\r'||LA11_0==' ') ) { - alt11=1; - } - - - switch (alt11) { - case 1 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g: - { - if ( (input.LA(1)>='\t' && input.LA(1)<='\n')||input.LA(1)=='\r'||input.LA(1)==' ' ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - - } - break; - - default : - if ( cnt11 >= 1 ) break loop11; - EarlyExitException eee = - new EarlyExitException(11, input); - throw eee; - } - cnt11++; - } while (true); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "RULE_WS" - - // $ANTLR start "RULE_ANY_OTHER" - public final void mRULE_ANY_OTHER() throws RecognitionException { - try { - int _type = RULE_ANY_OTHER; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1971:16: ( . ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1971:18: . - { - matchAny(); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "RULE_ANY_OTHER" - - public void mTokens() throws RecognitionException { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1:8: ( T__11 | T__12 | T__13 | T__14 | T__15 | T__16 | T__17 | T__18 | T__19 | T__20 | T__21 | T__22 | T__23 | T__24 | T__25 | RULE_ID | RULE_INT | RULE_STRING | RULE_ML_COMMENT | RULE_SL_COMMENT | RULE_WS | RULE_ANY_OTHER ) - int alt12=22; - alt12 = dfa12.predict(input); - switch (alt12) { - case 1 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1:10: T__11 - { - mT__11(); - - } - break; - case 2 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1:16: T__12 - { - mT__12(); - - } - break; - case 3 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1:22: T__13 - { - mT__13(); - - } - break; - case 4 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1:28: T__14 - { - mT__14(); - - } - break; - case 5 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1:34: T__15 - { - mT__15(); - - } - break; - case 6 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1:40: T__16 - { - mT__16(); - - } - break; - case 7 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1:46: T__17 - { - mT__17(); - - } - break; - case 8 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1:52: T__18 - { - mT__18(); - - } - break; - case 9 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1:58: T__19 - { - mT__19(); - - } - break; - case 10 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1:64: T__20 - { - mT__20(); - - } - break; - case 11 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1:70: T__21 - { - mT__21(); - - } - break; - case 12 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1:76: T__22 - { - mT__22(); - - } - break; - case 13 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1:82: T__23 - { - mT__23(); - - } - break; - case 14 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1:88: T__24 - { - mT__24(); - - } - break; - case 15 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1:94: T__25 - { - mT__25(); - - } - break; - case 16 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1:100: RULE_ID - { - mRULE_ID(); - - } - break; - case 17 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1:108: RULE_INT - { - mRULE_INT(); - - } - break; - case 18 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1:117: RULE_STRING - { - mRULE_STRING(); - - } - break; - case 19 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1:129: RULE_ML_COMMENT - { - mRULE_ML_COMMENT(); - - } - break; - case 20 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1:145: RULE_SL_COMMENT - { - mRULE_SL_COMMENT(); - - } - break; - case 21 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1:161: RULE_WS - { - mRULE_WS(); - - } - break; - case 22 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1:169: RULE_ANY_OTHER - { - mRULE_ANY_OTHER(); - - } - break; - - } - - } - - - protected DFA12 dfa12 = new DFA12(this); - static final String DFA12_eotS = - "\1\uffff\1\30\1\uffff\2\30\1\uffff\4\30\4\uffff\1\25\2\uffff\3\25\2\uffff\1\30\1\54\2\uffff\1\55\2\30\1\uffff\2\30\1\62\1\30\11\uffff\1\30\2\uffff\4\30\1\uffff\4\30\1\75\1\30\1\77\1\100\1\101\1\30\1\uffff\1\30\3\uffff\5\30\1\111\1\30\1\uffff\1\113\1\uffff"; - static final String DFA12_eofS = - "\114\uffff"; - static final String DFA12_minS = - "\1\0\1\157\1\uffff\1\171\1\150\1\uffff\1\157\1\162\1\163\1\162\4\uffff\1\101\2\uffff\2\0\1\52\2\uffff\1\141\1\60\2\uffff\1\60\1\157\1\155\1\uffff\1\154\1\157\1\60\1\157\11\uffff\1\143\2\uffff\1\167\1\165\1\145\1\164\1\uffff\1\155\1\145\1\163\1\154\1\60\1\157\3\60\1\141\1\uffff\1\143\3\uffff\1\164\1\157\1\151\1\154\1\156\1\60\1\147\1\uffff\1\60\1\uffff"; - static final String DFA12_maxS = - "\1\uffff\1\162\1\uffff\1\171\1\151\1\uffff\1\157\1\162\1\163\1\162\4\uffff\1\172\2\uffff\2\uffff\1\57\2\uffff\1\141\1\172\2\uffff\1\172\1\157\1\155\1\uffff\1\154\1\157\1\172\1\157\11\uffff\1\143\2\uffff\1\167\1\165\1\145\1\164\1\uffff\1\155\1\145\1\163\1\154\1\172\1\157\3\172\1\141\1\uffff\1\143\3\uffff\1\164\1\157\1\151\1\154\1\156\1\172\1\147\1\uffff\1\172\1\uffff"; - static final String DFA12_acceptS = - "\2\uffff\1\2\2\uffff\1\5\4\uffff\1\14\1\15\1\16\1\17\1\uffff\1\20\1\21\3\uffff\1\25\1\26\2\uffff\1\20\1\2\3\uffff\1\5\4\uffff\1\14\1\15\1\16\1\17\1\21\1\22\1\23\1\24\1\25\1\uffff\1\13\1\3\4\uffff\1\11\12\uffff\1\6\1\uffff\1\12\1\1\1\4\7\uffff\1\10\1\uffff\1\7"; - static final String DFA12_specialS = - "\1\1\20\uffff\1\0\1\2\71\uffff}>"; - static final String[] DFA12_transitionS = { - "\11\25\2\24\2\25\1\24\22\25\1\24\1\25\1\21\4\25\1\22\1\12\1\13\2\25\1\14\1\25\1\5\1\23\12\20\1\25\1\2\1\25\1\15\3\25\32\17\3\25\1\16\1\17\1\25\1\10\1\3\3\17\1\11\11\17\1\7\1\17\1\6\1\4\1\1\6\17\uff85\25", - "\1\27\2\uffff\1\26", - "", - "\1\32", - "\1\33\1\34", - "", - "\1\36", - "\1\37", - "\1\40", - "\1\41", - "", - "", - "", - "", - "\32\30\4\uffff\1\30\1\uffff\32\30", - "", - "", - "\0\47", - "\0\47", - "\1\50\4\uffff\1\51", - "", - "", - "\1\53", - "\12\30\7\uffff\32\30\4\uffff\1\30\1\uffff\32\30", - "", - "", - "\12\30\7\uffff\32\30\4\uffff\1\30\1\uffff\32\30", - "\1\56", - "\1\57", - "", - "\1\60", - "\1\61", - "\12\30\7\uffff\32\30\4\uffff\1\30\1\uffff\32\30", - "\1\63", - "", - "", - "", - "", - "", - "", - "", - "", - "", - "\1\64", - "", - "", - "\1\65", - "\1\66", - "\1\67", - "\1\70", - "", - "\1\71", - "\1\72", - "\1\73", - "\1\74", - "\12\30\7\uffff\32\30\4\uffff\1\30\1\uffff\32\30", - "\1\76", - "\12\30\7\uffff\32\30\4\uffff\1\30\1\uffff\32\30", - "\12\30\7\uffff\32\30\4\uffff\1\30\1\uffff\32\30", - "\12\30\7\uffff\32\30\4\uffff\1\30\1\uffff\32\30", - "\1\102", - "", - "\1\103", - "", - "", - "", - "\1\104", - "\1\105", - "\1\106", - "\1\107", - "\1\110", - "\12\30\7\uffff\32\30\4\uffff\1\30\1\uffff\32\30", - "\1\112", - "", - "\12\30\7\uffff\32\30\4\uffff\1\30\1\uffff\32\30", - "" - }; - - static final short[] DFA12_eot = DFA.unpackEncodedString(DFA12_eotS); - static final short[] DFA12_eof = DFA.unpackEncodedString(DFA12_eofS); - static final char[] DFA12_min = DFA.unpackEncodedStringToUnsignedChars(DFA12_minS); - static final char[] DFA12_max = DFA.unpackEncodedStringToUnsignedChars(DFA12_maxS); - static final short[] DFA12_accept = DFA.unpackEncodedString(DFA12_acceptS); - static final short[] DFA12_special = DFA.unpackEncodedString(DFA12_specialS); - static final short[][] DFA12_transition; - - static { - int numStates = DFA12_transitionS.length; - DFA12_transition = new short[numStates][]; - for (int i=0; i='\u0000' && LA12_17<='\uFFFF')) ) {s = 39;} - - else s = 21; - - if ( s>=0 ) return s; - break; - case 1 : - int LA12_0 = input.LA(1); - - s = -1; - if ( (LA12_0=='t') ) {s = 1;} - - else if ( (LA12_0==';') ) {s = 2;} - - else if ( (LA12_0=='b') ) {s = 3;} - - else if ( (LA12_0=='s') ) {s = 4;} - - else if ( (LA12_0=='.') ) {s = 5;} - - else if ( (LA12_0=='r') ) {s = 6;} - - else if ( (LA12_0=='p') ) {s = 7;} - - else if ( (LA12_0=='a') ) {s = 8;} - - else if ( (LA12_0=='f') ) {s = 9;} - - else if ( (LA12_0=='(') ) {s = 10;} - - else if ( (LA12_0==')') ) {s = 11;} - - else if ( (LA12_0==',') ) {s = 12;} - - else if ( (LA12_0=='=') ) {s = 13;} - - else if ( (LA12_0=='^') ) {s = 14;} - - else if ( ((LA12_0>='A' && LA12_0<='Z')||LA12_0=='_'||(LA12_0>='c' && LA12_0<='e')||(LA12_0>='g' && LA12_0<='o')||LA12_0=='q'||(LA12_0>='u' && LA12_0<='z')) ) {s = 15;} - - else if ( ((LA12_0>='0' && LA12_0<='9')) ) {s = 16;} - - else if ( (LA12_0=='\"') ) {s = 17;} - - else if ( (LA12_0=='\'') ) {s = 18;} - - else if ( (LA12_0=='/') ) {s = 19;} - - else if ( ((LA12_0>='\t' && LA12_0<='\n')||LA12_0=='\r'||LA12_0==' ') ) {s = 20;} - - else if ( ((LA12_0>='\u0000' && LA12_0<='\b')||(LA12_0>='\u000B' && LA12_0<='\f')||(LA12_0>='\u000E' && LA12_0<='\u001F')||LA12_0=='!'||(LA12_0>='#' && LA12_0<='&')||(LA12_0>='*' && LA12_0<='+')||LA12_0=='-'||LA12_0==':'||LA12_0=='<'||(LA12_0>='>' && LA12_0<='@')||(LA12_0>='[' && LA12_0<=']')||LA12_0=='`'||(LA12_0>='{' && LA12_0<='\uFFFF')) ) {s = 21;} - - if ( s>=0 ) return s; - break; - case 2 : - int LA12_18 = input.LA(1); - - s = -1; - if ( ((LA12_18>='\u0000' && LA12_18<='\uFFFF')) ) {s = 39;} - - else s = 21; - - if ( s>=0 ) return s; - break; - } - NoViableAltException nvae = - new NoViableAltException(getDescription(), 12, _s, input); - error(nvae); - throw nvae; - } - } - - -} \ No newline at end of file diff --git a/tools/eclipse/plugins/org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDslParser.java b/tools/eclipse/plugins/org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDslParser.java deleted file mode 100644 index 6385d2ccd..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDslParser.java +++ /dev/null @@ -1,5152 +0,0 @@ -package org.scribble.trace.editor.dsl.ui.contentassist.antlr.internal; - -import java.io.InputStream; -import org.eclipse.xtext.*; -import org.eclipse.xtext.parser.*; -import org.eclipse.xtext.parser.impl.*; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.xtext.parser.antlr.XtextTokenStream; -import org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens; -import org.eclipse.xtext.ui.editor.contentassist.antlr.internal.AbstractInternalContentAssistParser; -import org.eclipse.xtext.ui.editor.contentassist.antlr.internal.DFA; -import org.scribble.trace.editor.dsl.services.ScribbleTraceDslGrammarAccess; - - - -import org.antlr.runtime.*; -import java.util.Stack; -import java.util.List; -import java.util.ArrayList; - -@SuppressWarnings("all") -public class InternalScribbleTraceDslParser extends AbstractInternalContentAssistParser { - public static final String[] tokenNames = new String[] { - "", "", "", "", "RULE_ID", "RULE_STRING", "RULE_INT", "RULE_ML_COMMENT", "RULE_SL_COMMENT", "RULE_WS", "RULE_ANY_OTHER", "'trace'", "';'", "'by'", "'shows'", "'.'", "'role'", "'simulating'", "'protocol'", "'as'", "'from'", "'to'", "'('", "')'", "','", "'='" - }; - public static final int RULE_ID=4; - public static final int T__25=25; - public static final int T__24=24; - public static final int T__23=23; - public static final int T__22=22; - public static final int RULE_ANY_OTHER=10; - public static final int T__21=21; - public static final int T__20=20; - public static final int RULE_SL_COMMENT=8; - public static final int EOF=-1; - public static final int RULE_ML_COMMENT=7; - public static final int T__19=19; - public static final int RULE_STRING=5; - public static final int T__16=16; - public static final int T__15=15; - public static final int T__18=18; - public static final int T__17=17; - public static final int T__12=12; - public static final int T__11=11; - public static final int T__14=14; - public static final int T__13=13; - public static final int RULE_INT=6; - public static final int RULE_WS=9; - - // delegates - // delegators - - - public InternalScribbleTraceDslParser(TokenStream input) { - this(input, new RecognizerSharedState()); - } - public InternalScribbleTraceDslParser(TokenStream input, RecognizerSharedState state) { - super(input, state); - - } - - - public String[] getTokenNames() { return InternalScribbleTraceDslParser.tokenNames; } - public String getGrammarFileName() { return "../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g"; } - - - - private ScribbleTraceDslGrammarAccess grammarAccess; - - public void setGrammarAccess(ScribbleTraceDslGrammarAccess grammarAccess) { - this.grammarAccess = grammarAccess; - } - - @Override - protected Grammar getGrammar() { - return grammarAccess.getGrammar(); - } - - @Override - protected String getValueForTokenName(String tokenName) { - return tokenName; - } - - - - - // $ANTLR start "entryRuleTrace" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:60:1: entryRuleTrace : ruleTrace EOF ; - public final void entryRuleTrace() throws RecognitionException { - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:61:1: ( ruleTrace EOF ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:62:1: ruleTrace EOF - { - before(grammarAccess.getTraceRule()); - pushFollow(FOLLOW_ruleTrace_in_entryRuleTrace61); - ruleTrace(); - - state._fsp--; - - after(grammarAccess.getTraceRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleTrace68); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleTrace" - - - // $ANTLR start "ruleTrace" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:69:1: ruleTrace : ( ( rule__Trace__Group__0 ) ) ; - public final void ruleTrace() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:73:2: ( ( ( rule__Trace__Group__0 ) ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:74:1: ( ( rule__Trace__Group__0 ) ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:74:1: ( ( rule__Trace__Group__0 ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:75:1: ( rule__Trace__Group__0 ) - { - before(grammarAccess.getTraceAccess().getGroup()); - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:76:1: ( rule__Trace__Group__0 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:76:2: rule__Trace__Group__0 - { - pushFollow(FOLLOW_rule__Trace__Group__0_in_ruleTrace94); - rule__Trace__Group__0(); - - state._fsp--; - - - } - - after(grammarAccess.getTraceAccess().getGroup()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleTrace" - - - // $ANTLR start "entryRuleSentence" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:88:1: entryRuleSentence : ruleSentence EOF ; - public final void entryRuleSentence() throws RecognitionException { - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:89:1: ( ruleSentence EOF ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:90:1: ruleSentence EOF - { - before(grammarAccess.getSentenceRule()); - pushFollow(FOLLOW_ruleSentence_in_entryRuleSentence121); - ruleSentence(); - - state._fsp--; - - after(grammarAccess.getSentenceRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleSentence128); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleSentence" - - - // $ANTLR start "ruleSentence" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:97:1: ruleSentence : ( ( ( RULE_ID ) ) ( ( RULE_ID )* ) ) ; - public final void ruleSentence() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:101:2: ( ( ( ( RULE_ID ) ) ( ( RULE_ID )* ) ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:102:1: ( ( ( RULE_ID ) ) ( ( RULE_ID )* ) ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:102:1: ( ( ( RULE_ID ) ) ( ( RULE_ID )* ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:103:1: ( ( RULE_ID ) ) ( ( RULE_ID )* ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:103:1: ( ( RULE_ID ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:104:1: ( RULE_ID ) - { - before(grammarAccess.getSentenceAccess().getIDTerminalRuleCall()); - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:105:1: ( RULE_ID ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:105:3: RULE_ID - { - match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleSentence157); - - } - - after(grammarAccess.getSentenceAccess().getIDTerminalRuleCall()); - - } - - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:108:1: ( ( RULE_ID )* ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:109:1: ( RULE_ID )* - { - before(grammarAccess.getSentenceAccess().getIDTerminalRuleCall()); - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:110:1: ( RULE_ID )* - loop1: - do { - int alt1=2; - int LA1_0 = input.LA(1); - - if ( (LA1_0==RULE_ID) ) { - alt1=1; - } - - - switch (alt1) { - case 1 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:110:3: RULE_ID - { - match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleSentence170); - - } - break; - - default : - break loop1; - } - } while (true); - - after(grammarAccess.getSentenceAccess().getIDTerminalRuleCall()); - - } - - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleSentence" - - - // $ANTLR start "entryRuleTracedefn" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:123:1: entryRuleTracedefn : ruleTracedefn EOF ; - public final void entryRuleTracedefn() throws RecognitionException { - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:124:1: ( ruleTracedefn EOF ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:125:1: ruleTracedefn EOF - { - before(grammarAccess.getTracedefnRule()); - pushFollow(FOLLOW_ruleTracedefn_in_entryRuleTracedefn200); - ruleTracedefn(); - - state._fsp--; - - after(grammarAccess.getTracedefnRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleTracedefn207); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleTracedefn" - - - // $ANTLR start "ruleTracedefn" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:132:1: ruleTracedefn : ( ( rule__Tracedefn__Group__0 ) ) ; - public final void ruleTracedefn() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:136:2: ( ( ( rule__Tracedefn__Group__0 ) ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:137:1: ( ( rule__Tracedefn__Group__0 ) ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:137:1: ( ( rule__Tracedefn__Group__0 ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:138:1: ( rule__Tracedefn__Group__0 ) - { - before(grammarAccess.getTracedefnAccess().getGroup()); - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:139:1: ( rule__Tracedefn__Group__0 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:139:2: rule__Tracedefn__Group__0 - { - pushFollow(FOLLOW_rule__Tracedefn__Group__0_in_ruleTracedefn233); - rule__Tracedefn__Group__0(); - - state._fsp--; - - - } - - after(grammarAccess.getTracedefnAccess().getGroup()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleTracedefn" - - - // $ANTLR start "entryRuleModule" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:151:1: entryRuleModule : ruleModule EOF ; - public final void entryRuleModule() throws RecognitionException { - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:152:1: ( ruleModule EOF ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:153:1: ruleModule EOF - { - before(grammarAccess.getModuleRule()); - pushFollow(FOLLOW_ruleModule_in_entryRuleModule260); - ruleModule(); - - state._fsp--; - - after(grammarAccess.getModuleRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleModule267); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleModule" - - - // $ANTLR start "ruleModule" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:160:1: ruleModule : ( ( rule__Module__Group__0 ) ) ; - public final void ruleModule() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:164:2: ( ( ( rule__Module__Group__0 ) ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:165:1: ( ( rule__Module__Group__0 ) ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:165:1: ( ( rule__Module__Group__0 ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:166:1: ( rule__Module__Group__0 ) - { - before(grammarAccess.getModuleAccess().getGroup()); - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:167:1: ( rule__Module__Group__0 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:167:2: rule__Module__Group__0 - { - pushFollow(FOLLOW_rule__Module__Group__0_in_ruleModule293); - rule__Module__Group__0(); - - state._fsp--; - - - } - - after(grammarAccess.getModuleAccess().getGroup()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleModule" - - - // $ANTLR start "entryRuleRoledefn" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:179:1: entryRuleRoledefn : ruleRoledefn EOF ; - public final void entryRuleRoledefn() throws RecognitionException { - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:180:1: ( ruleRoledefn EOF ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:181:1: ruleRoledefn EOF - { - before(grammarAccess.getRoledefnRule()); - pushFollow(FOLLOW_ruleRoledefn_in_entryRuleRoledefn320); - ruleRoledefn(); - - state._fsp--; - - after(grammarAccess.getRoledefnRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleRoledefn327); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleRoledefn" - - - // $ANTLR start "ruleRoledefn" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:188:1: ruleRoledefn : ( ( rule__Roledefn__Group__0 ) ) ; - public final void ruleRoledefn() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:192:2: ( ( ( rule__Roledefn__Group__0 ) ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:193:1: ( ( rule__Roledefn__Group__0 ) ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:193:1: ( ( rule__Roledefn__Group__0 ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:194:1: ( rule__Roledefn__Group__0 ) - { - before(grammarAccess.getRoledefnAccess().getGroup()); - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:195:1: ( rule__Roledefn__Group__0 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:195:2: rule__Roledefn__Group__0 - { - pushFollow(FOLLOW_rule__Roledefn__Group__0_in_ruleRoledefn353); - rule__Roledefn__Group__0(); - - state._fsp--; - - - } - - after(grammarAccess.getRoledefnAccess().getGroup()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleRoledefn" - - - // $ANTLR start "entryRuleStepdefn" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:207:1: entryRuleStepdefn : ruleStepdefn EOF ; - public final void entryRuleStepdefn() throws RecognitionException { - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:208:1: ( ruleStepdefn EOF ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:209:1: ruleStepdefn EOF - { - before(grammarAccess.getStepdefnRule()); - pushFollow(FOLLOW_ruleStepdefn_in_entryRuleStepdefn380); - ruleStepdefn(); - - state._fsp--; - - after(grammarAccess.getStepdefnRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleStepdefn387); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleStepdefn" - - - // $ANTLR start "ruleStepdefn" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:216:1: ruleStepdefn : ( ruleMessagetransfer ) ; - public final void ruleStepdefn() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:220:2: ( ( ruleMessagetransfer ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:221:1: ( ruleMessagetransfer ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:221:1: ( ruleMessagetransfer ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:222:1: ruleMessagetransfer - { - before(grammarAccess.getStepdefnAccess().getMessagetransferParserRuleCall()); - pushFollow(FOLLOW_ruleMessagetransfer_in_ruleStepdefn413); - ruleMessagetransfer(); - - state._fsp--; - - after(grammarAccess.getStepdefnAccess().getMessagetransferParserRuleCall()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleStepdefn" - - - // $ANTLR start "entryRuleMessagetransfer" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:235:1: entryRuleMessagetransfer : ruleMessagetransfer EOF ; - public final void entryRuleMessagetransfer() throws RecognitionException { - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:236:1: ( ruleMessagetransfer EOF ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:237:1: ruleMessagetransfer EOF - { - before(grammarAccess.getMessagetransferRule()); - pushFollow(FOLLOW_ruleMessagetransfer_in_entryRuleMessagetransfer439); - ruleMessagetransfer(); - - state._fsp--; - - after(grammarAccess.getMessagetransferRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleMessagetransfer446); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleMessagetransfer" - - - // $ANTLR start "ruleMessagetransfer" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:244:1: ruleMessagetransfer : ( ( rule__Messagetransfer__Group__0 ) ) ; - public final void ruleMessagetransfer() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:248:2: ( ( ( rule__Messagetransfer__Group__0 ) ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:249:1: ( ( rule__Messagetransfer__Group__0 ) ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:249:1: ( ( rule__Messagetransfer__Group__0 ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:250:1: ( rule__Messagetransfer__Group__0 ) - { - before(grammarAccess.getMessagetransferAccess().getGroup()); - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:251:1: ( rule__Messagetransfer__Group__0 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:251:2: rule__Messagetransfer__Group__0 - { - pushFollow(FOLLOW_rule__Messagetransfer__Group__0_in_ruleMessagetransfer472); - rule__Messagetransfer__Group__0(); - - state._fsp--; - - - } - - after(grammarAccess.getMessagetransferAccess().getGroup()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleMessagetransfer" - - - // $ANTLR start "entryRuleParameter" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:263:1: entryRuleParameter : ruleParameter EOF ; - public final void entryRuleParameter() throws RecognitionException { - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:264:1: ( ruleParameter EOF ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:265:1: ruleParameter EOF - { - before(grammarAccess.getParameterRule()); - pushFollow(FOLLOW_ruleParameter_in_entryRuleParameter499); - ruleParameter(); - - state._fsp--; - - after(grammarAccess.getParameterRule()); - match(input,EOF,FOLLOW_EOF_in_entryRuleParameter506); - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - } - return ; - } - // $ANTLR end "entryRuleParameter" - - - // $ANTLR start "ruleParameter" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:272:1: ruleParameter : ( ( rule__Parameter__Group__0 ) ) ; - public final void ruleParameter() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:276:2: ( ( ( rule__Parameter__Group__0 ) ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:277:1: ( ( rule__Parameter__Group__0 ) ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:277:1: ( ( rule__Parameter__Group__0 ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:278:1: ( rule__Parameter__Group__0 ) - { - before(grammarAccess.getParameterAccess().getGroup()); - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:279:1: ( rule__Parameter__Group__0 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:279:2: rule__Parameter__Group__0 - { - pushFollow(FOLLOW_rule__Parameter__Group__0_in_ruleParameter532); - rule__Parameter__Group__0(); - - state._fsp--; - - - } - - after(grammarAccess.getParameterAccess().getGroup()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "ruleParameter" - - - // $ANTLR start "rule__Trace__Group__0" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:293:1: rule__Trace__Group__0 : rule__Trace__Group__0__Impl rule__Trace__Group__1 ; - public final void rule__Trace__Group__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:297:1: ( rule__Trace__Group__0__Impl rule__Trace__Group__1 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:298:2: rule__Trace__Group__0__Impl rule__Trace__Group__1 - { - pushFollow(FOLLOW_rule__Trace__Group__0__Impl_in_rule__Trace__Group__0566); - rule__Trace__Group__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Trace__Group__1_in_rule__Trace__Group__0569); - rule__Trace__Group__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Trace__Group__0" - - - // $ANTLR start "rule__Trace__Group__0__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:305:1: rule__Trace__Group__0__Impl : ( () ) ; - public final void rule__Trace__Group__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:309:1: ( ( () ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:310:1: ( () ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:310:1: ( () ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:311:1: () - { - before(grammarAccess.getTraceAccess().getTraceAction_0()); - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:312:1: () - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:314:1: - { - } - - after(grammarAccess.getTraceAccess().getTraceAction_0()); - - } - - - } - - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Trace__Group__0__Impl" - - - // $ANTLR start "rule__Trace__Group__1" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:324:1: rule__Trace__Group__1 : rule__Trace__Group__1__Impl rule__Trace__Group__2 ; - public final void rule__Trace__Group__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:328:1: ( rule__Trace__Group__1__Impl rule__Trace__Group__2 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:329:2: rule__Trace__Group__1__Impl rule__Trace__Group__2 - { - pushFollow(FOLLOW_rule__Trace__Group__1__Impl_in_rule__Trace__Group__1627); - rule__Trace__Group__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Trace__Group__2_in_rule__Trace__Group__1630); - rule__Trace__Group__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Trace__Group__1" - - - // $ANTLR start "rule__Trace__Group__1__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:336:1: rule__Trace__Group__1__Impl : ( ruleTracedefn ) ; - public final void rule__Trace__Group__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:340:1: ( ( ruleTracedefn ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:341:1: ( ruleTracedefn ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:341:1: ( ruleTracedefn ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:342:1: ruleTracedefn - { - before(grammarAccess.getTraceAccess().getTracedefnParserRuleCall_1()); - pushFollow(FOLLOW_ruleTracedefn_in_rule__Trace__Group__1__Impl657); - ruleTracedefn(); - - state._fsp--; - - after(grammarAccess.getTraceAccess().getTracedefnParserRuleCall_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Trace__Group__1__Impl" - - - // $ANTLR start "rule__Trace__Group__2" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:353:1: rule__Trace__Group__2 : rule__Trace__Group__2__Impl rule__Trace__Group__3 ; - public final void rule__Trace__Group__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:357:1: ( rule__Trace__Group__2__Impl rule__Trace__Group__3 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:358:2: rule__Trace__Group__2__Impl rule__Trace__Group__3 - { - pushFollow(FOLLOW_rule__Trace__Group__2__Impl_in_rule__Trace__Group__2686); - rule__Trace__Group__2__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Trace__Group__3_in_rule__Trace__Group__2689); - rule__Trace__Group__3(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Trace__Group__2" - - - // $ANTLR start "rule__Trace__Group__2__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:365:1: rule__Trace__Group__2__Impl : ( ( rule__Trace__RolesAssignment_2 )* ) ; - public final void rule__Trace__Group__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:369:1: ( ( ( rule__Trace__RolesAssignment_2 )* ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:370:1: ( ( rule__Trace__RolesAssignment_2 )* ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:370:1: ( ( rule__Trace__RolesAssignment_2 )* ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:371:1: ( rule__Trace__RolesAssignment_2 )* - { - before(grammarAccess.getTraceAccess().getRolesAssignment_2()); - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:372:1: ( rule__Trace__RolesAssignment_2 )* - loop2: - do { - int alt2=2; - int LA2_0 = input.LA(1); - - if ( (LA2_0==16) ) { - alt2=1; - } - - - switch (alt2) { - case 1 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:372:2: rule__Trace__RolesAssignment_2 - { - pushFollow(FOLLOW_rule__Trace__RolesAssignment_2_in_rule__Trace__Group__2__Impl716); - rule__Trace__RolesAssignment_2(); - - state._fsp--; - - - } - break; - - default : - break loop2; - } - } while (true); - - after(grammarAccess.getTraceAccess().getRolesAssignment_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Trace__Group__2__Impl" - - - // $ANTLR start "rule__Trace__Group__3" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:382:1: rule__Trace__Group__3 : rule__Trace__Group__3__Impl ; - public final void rule__Trace__Group__3() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:386:1: ( rule__Trace__Group__3__Impl ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:387:2: rule__Trace__Group__3__Impl - { - pushFollow(FOLLOW_rule__Trace__Group__3__Impl_in_rule__Trace__Group__3747); - rule__Trace__Group__3__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Trace__Group__3" - - - // $ANTLR start "rule__Trace__Group__3__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:393:1: rule__Trace__Group__3__Impl : ( ( rule__Trace__StepsAssignment_3 )* ) ; - public final void rule__Trace__Group__3__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:397:1: ( ( ( rule__Trace__StepsAssignment_3 )* ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:398:1: ( ( rule__Trace__StepsAssignment_3 )* ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:398:1: ( ( rule__Trace__StepsAssignment_3 )* ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:399:1: ( rule__Trace__StepsAssignment_3 )* - { - before(grammarAccess.getTraceAccess().getStepsAssignment_3()); - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:400:1: ( rule__Trace__StepsAssignment_3 )* - loop3: - do { - int alt3=2; - int LA3_0 = input.LA(1); - - if ( (LA3_0==RULE_ID) ) { - alt3=1; - } - - - switch (alt3) { - case 1 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:400:2: rule__Trace__StepsAssignment_3 - { - pushFollow(FOLLOW_rule__Trace__StepsAssignment_3_in_rule__Trace__Group__3__Impl774); - rule__Trace__StepsAssignment_3(); - - state._fsp--; - - - } - break; - - default : - break loop3; - } - } while (true); - - after(grammarAccess.getTraceAccess().getStepsAssignment_3()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Trace__Group__3__Impl" - - - // $ANTLR start "rule__Tracedefn__Group__0" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:418:1: rule__Tracedefn__Group__0 : rule__Tracedefn__Group__0__Impl rule__Tracedefn__Group__1 ; - public final void rule__Tracedefn__Group__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:422:1: ( rule__Tracedefn__Group__0__Impl rule__Tracedefn__Group__1 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:423:2: rule__Tracedefn__Group__0__Impl rule__Tracedefn__Group__1 - { - pushFollow(FOLLOW_rule__Tracedefn__Group__0__Impl_in_rule__Tracedefn__Group__0813); - rule__Tracedefn__Group__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Tracedefn__Group__1_in_rule__Tracedefn__Group__0816); - rule__Tracedefn__Group__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Tracedefn__Group__0" - - - // $ANTLR start "rule__Tracedefn__Group__0__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:430:1: rule__Tracedefn__Group__0__Impl : ( 'trace' ) ; - public final void rule__Tracedefn__Group__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:434:1: ( ( 'trace' ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:435:1: ( 'trace' ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:435:1: ( 'trace' ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:436:1: 'trace' - { - before(grammarAccess.getTracedefnAccess().getTraceKeyword_0()); - match(input,11,FOLLOW_11_in_rule__Tracedefn__Group__0__Impl844); - after(grammarAccess.getTracedefnAccess().getTraceKeyword_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Tracedefn__Group__0__Impl" - - - // $ANTLR start "rule__Tracedefn__Group__1" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:449:1: rule__Tracedefn__Group__1 : rule__Tracedefn__Group__1__Impl rule__Tracedefn__Group__2 ; - public final void rule__Tracedefn__Group__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:453:1: ( rule__Tracedefn__Group__1__Impl rule__Tracedefn__Group__2 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:454:2: rule__Tracedefn__Group__1__Impl rule__Tracedefn__Group__2 - { - pushFollow(FOLLOW_rule__Tracedefn__Group__1__Impl_in_rule__Tracedefn__Group__1875); - rule__Tracedefn__Group__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Tracedefn__Group__2_in_rule__Tracedefn__Group__1878); - rule__Tracedefn__Group__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Tracedefn__Group__1" - - - // $ANTLR start "rule__Tracedefn__Group__1__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:461:1: rule__Tracedefn__Group__1__Impl : ( RULE_ID ) ; - public final void rule__Tracedefn__Group__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:465:1: ( ( RULE_ID ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:466:1: ( RULE_ID ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:466:1: ( RULE_ID ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:467:1: RULE_ID - { - before(grammarAccess.getTracedefnAccess().getIDTerminalRuleCall_1()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__Tracedefn__Group__1__Impl905); - after(grammarAccess.getTracedefnAccess().getIDTerminalRuleCall_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Tracedefn__Group__1__Impl" - - - // $ANTLR start "rule__Tracedefn__Group__2" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:478:1: rule__Tracedefn__Group__2 : rule__Tracedefn__Group__2__Impl rule__Tracedefn__Group__3 ; - public final void rule__Tracedefn__Group__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:482:1: ( rule__Tracedefn__Group__2__Impl rule__Tracedefn__Group__3 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:483:2: rule__Tracedefn__Group__2__Impl rule__Tracedefn__Group__3 - { - pushFollow(FOLLOW_rule__Tracedefn__Group__2__Impl_in_rule__Tracedefn__Group__2934); - rule__Tracedefn__Group__2__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Tracedefn__Group__3_in_rule__Tracedefn__Group__2937); - rule__Tracedefn__Group__3(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Tracedefn__Group__2" - - - // $ANTLR start "rule__Tracedefn__Group__2__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:490:1: rule__Tracedefn__Group__2__Impl : ( ( rule__Tracedefn__Group_2__0 )? ) ; - public final void rule__Tracedefn__Group__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:494:1: ( ( ( rule__Tracedefn__Group_2__0 )? ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:495:1: ( ( rule__Tracedefn__Group_2__0 )? ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:495:1: ( ( rule__Tracedefn__Group_2__0 )? ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:496:1: ( rule__Tracedefn__Group_2__0 )? - { - before(grammarAccess.getTracedefnAccess().getGroup_2()); - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:497:1: ( rule__Tracedefn__Group_2__0 )? - int alt4=2; - int LA4_0 = input.LA(1); - - if ( (LA4_0==13) ) { - alt4=1; - } - switch (alt4) { - case 1 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:497:2: rule__Tracedefn__Group_2__0 - { - pushFollow(FOLLOW_rule__Tracedefn__Group_2__0_in_rule__Tracedefn__Group__2__Impl964); - rule__Tracedefn__Group_2__0(); - - state._fsp--; - - - } - break; - - } - - after(grammarAccess.getTracedefnAccess().getGroup_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Tracedefn__Group__2__Impl" - - - // $ANTLR start "rule__Tracedefn__Group__3" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:507:1: rule__Tracedefn__Group__3 : rule__Tracedefn__Group__3__Impl ; - public final void rule__Tracedefn__Group__3() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:511:1: ( rule__Tracedefn__Group__3__Impl ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:512:2: rule__Tracedefn__Group__3__Impl - { - pushFollow(FOLLOW_rule__Tracedefn__Group__3__Impl_in_rule__Tracedefn__Group__3995); - rule__Tracedefn__Group__3__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Tracedefn__Group__3" - - - // $ANTLR start "rule__Tracedefn__Group__3__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:518:1: rule__Tracedefn__Group__3__Impl : ( ';' ) ; - public final void rule__Tracedefn__Group__3__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:522:1: ( ( ';' ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:523:1: ( ';' ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:523:1: ( ';' ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:524:1: ';' - { - before(grammarAccess.getTracedefnAccess().getSemicolonKeyword_3()); - match(input,12,FOLLOW_12_in_rule__Tracedefn__Group__3__Impl1023); - after(grammarAccess.getTracedefnAccess().getSemicolonKeyword_3()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Tracedefn__Group__3__Impl" - - - // $ANTLR start "rule__Tracedefn__Group_2__0" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:545:1: rule__Tracedefn__Group_2__0 : rule__Tracedefn__Group_2__0__Impl rule__Tracedefn__Group_2__1 ; - public final void rule__Tracedefn__Group_2__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:549:1: ( rule__Tracedefn__Group_2__0__Impl rule__Tracedefn__Group_2__1 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:550:2: rule__Tracedefn__Group_2__0__Impl rule__Tracedefn__Group_2__1 - { - pushFollow(FOLLOW_rule__Tracedefn__Group_2__0__Impl_in_rule__Tracedefn__Group_2__01062); - rule__Tracedefn__Group_2__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Tracedefn__Group_2__1_in_rule__Tracedefn__Group_2__01065); - rule__Tracedefn__Group_2__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Tracedefn__Group_2__0" - - - // $ANTLR start "rule__Tracedefn__Group_2__0__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:557:1: rule__Tracedefn__Group_2__0__Impl : ( 'by' ) ; - public final void rule__Tracedefn__Group_2__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:561:1: ( ( 'by' ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:562:1: ( 'by' ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:562:1: ( 'by' ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:563:1: 'by' - { - before(grammarAccess.getTracedefnAccess().getByKeyword_2_0()); - match(input,13,FOLLOW_13_in_rule__Tracedefn__Group_2__0__Impl1093); - after(grammarAccess.getTracedefnAccess().getByKeyword_2_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Tracedefn__Group_2__0__Impl" - - - // $ANTLR start "rule__Tracedefn__Group_2__1" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:576:1: rule__Tracedefn__Group_2__1 : rule__Tracedefn__Group_2__1__Impl rule__Tracedefn__Group_2__2 ; - public final void rule__Tracedefn__Group_2__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:580:1: ( rule__Tracedefn__Group_2__1__Impl rule__Tracedefn__Group_2__2 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:581:2: rule__Tracedefn__Group_2__1__Impl rule__Tracedefn__Group_2__2 - { - pushFollow(FOLLOW_rule__Tracedefn__Group_2__1__Impl_in_rule__Tracedefn__Group_2__11124); - rule__Tracedefn__Group_2__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Tracedefn__Group_2__2_in_rule__Tracedefn__Group_2__11127); - rule__Tracedefn__Group_2__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Tracedefn__Group_2__1" - - - // $ANTLR start "rule__Tracedefn__Group_2__1__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:588:1: rule__Tracedefn__Group_2__1__Impl : ( ruleSentence ) ; - public final void rule__Tracedefn__Group_2__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:592:1: ( ( ruleSentence ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:593:1: ( ruleSentence ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:593:1: ( ruleSentence ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:594:1: ruleSentence - { - before(grammarAccess.getTracedefnAccess().getSentenceParserRuleCall_2_1()); - pushFollow(FOLLOW_ruleSentence_in_rule__Tracedefn__Group_2__1__Impl1154); - ruleSentence(); - - state._fsp--; - - after(grammarAccess.getTracedefnAccess().getSentenceParserRuleCall_2_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Tracedefn__Group_2__1__Impl" - - - // $ANTLR start "rule__Tracedefn__Group_2__2" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:605:1: rule__Tracedefn__Group_2__2 : rule__Tracedefn__Group_2__2__Impl ; - public final void rule__Tracedefn__Group_2__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:609:1: ( rule__Tracedefn__Group_2__2__Impl ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:610:2: rule__Tracedefn__Group_2__2__Impl - { - pushFollow(FOLLOW_rule__Tracedefn__Group_2__2__Impl_in_rule__Tracedefn__Group_2__21183); - rule__Tracedefn__Group_2__2__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Tracedefn__Group_2__2" - - - // $ANTLR start "rule__Tracedefn__Group_2__2__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:616:1: rule__Tracedefn__Group_2__2__Impl : ( ( rule__Tracedefn__Group_2_2__0 )? ) ; - public final void rule__Tracedefn__Group_2__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:620:1: ( ( ( rule__Tracedefn__Group_2_2__0 )? ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:621:1: ( ( rule__Tracedefn__Group_2_2__0 )? ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:621:1: ( ( rule__Tracedefn__Group_2_2__0 )? ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:622:1: ( rule__Tracedefn__Group_2_2__0 )? - { - before(grammarAccess.getTracedefnAccess().getGroup_2_2()); - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:623:1: ( rule__Tracedefn__Group_2_2__0 )? - int alt5=2; - int LA5_0 = input.LA(1); - - if ( (LA5_0==14) ) { - alt5=1; - } - switch (alt5) { - case 1 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:623:2: rule__Tracedefn__Group_2_2__0 - { - pushFollow(FOLLOW_rule__Tracedefn__Group_2_2__0_in_rule__Tracedefn__Group_2__2__Impl1210); - rule__Tracedefn__Group_2_2__0(); - - state._fsp--; - - - } - break; - - } - - after(grammarAccess.getTracedefnAccess().getGroup_2_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Tracedefn__Group_2__2__Impl" - - - // $ANTLR start "rule__Tracedefn__Group_2_2__0" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:639:1: rule__Tracedefn__Group_2_2__0 : rule__Tracedefn__Group_2_2__0__Impl rule__Tracedefn__Group_2_2__1 ; - public final void rule__Tracedefn__Group_2_2__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:643:1: ( rule__Tracedefn__Group_2_2__0__Impl rule__Tracedefn__Group_2_2__1 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:644:2: rule__Tracedefn__Group_2_2__0__Impl rule__Tracedefn__Group_2_2__1 - { - pushFollow(FOLLOW_rule__Tracedefn__Group_2_2__0__Impl_in_rule__Tracedefn__Group_2_2__01247); - rule__Tracedefn__Group_2_2__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Tracedefn__Group_2_2__1_in_rule__Tracedefn__Group_2_2__01250); - rule__Tracedefn__Group_2_2__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Tracedefn__Group_2_2__0" - - - // $ANTLR start "rule__Tracedefn__Group_2_2__0__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:651:1: rule__Tracedefn__Group_2_2__0__Impl : ( 'shows' ) ; - public final void rule__Tracedefn__Group_2_2__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:655:1: ( ( 'shows' ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:656:1: ( 'shows' ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:656:1: ( 'shows' ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:657:1: 'shows' - { - before(grammarAccess.getTracedefnAccess().getShowsKeyword_2_2_0()); - match(input,14,FOLLOW_14_in_rule__Tracedefn__Group_2_2__0__Impl1278); - after(grammarAccess.getTracedefnAccess().getShowsKeyword_2_2_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Tracedefn__Group_2_2__0__Impl" - - - // $ANTLR start "rule__Tracedefn__Group_2_2__1" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:670:1: rule__Tracedefn__Group_2_2__1 : rule__Tracedefn__Group_2_2__1__Impl ; - public final void rule__Tracedefn__Group_2_2__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:674:1: ( rule__Tracedefn__Group_2_2__1__Impl ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:675:2: rule__Tracedefn__Group_2_2__1__Impl - { - pushFollow(FOLLOW_rule__Tracedefn__Group_2_2__1__Impl_in_rule__Tracedefn__Group_2_2__11309); - rule__Tracedefn__Group_2_2__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Tracedefn__Group_2_2__1" - - - // $ANTLR start "rule__Tracedefn__Group_2_2__1__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:681:1: rule__Tracedefn__Group_2_2__1__Impl : ( ruleSentence ) ; - public final void rule__Tracedefn__Group_2_2__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:685:1: ( ( ruleSentence ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:686:1: ( ruleSentence ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:686:1: ( ruleSentence ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:687:1: ruleSentence - { - before(grammarAccess.getTracedefnAccess().getSentenceParserRuleCall_2_2_1()); - pushFollow(FOLLOW_ruleSentence_in_rule__Tracedefn__Group_2_2__1__Impl1336); - ruleSentence(); - - state._fsp--; - - after(grammarAccess.getTracedefnAccess().getSentenceParserRuleCall_2_2_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Tracedefn__Group_2_2__1__Impl" - - - // $ANTLR start "rule__Module__Group__0" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:702:1: rule__Module__Group__0 : rule__Module__Group__0__Impl rule__Module__Group__1 ; - public final void rule__Module__Group__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:706:1: ( rule__Module__Group__0__Impl rule__Module__Group__1 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:707:2: rule__Module__Group__0__Impl rule__Module__Group__1 - { - pushFollow(FOLLOW_rule__Module__Group__0__Impl_in_rule__Module__Group__01369); - rule__Module__Group__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Module__Group__1_in_rule__Module__Group__01372); - rule__Module__Group__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Module__Group__0" - - - // $ANTLR start "rule__Module__Group__0__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:714:1: rule__Module__Group__0__Impl : ( RULE_ID ) ; - public final void rule__Module__Group__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:718:1: ( ( RULE_ID ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:719:1: ( RULE_ID ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:719:1: ( RULE_ID ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:720:1: RULE_ID - { - before(grammarAccess.getModuleAccess().getIDTerminalRuleCall_0()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__Module__Group__0__Impl1399); - after(grammarAccess.getModuleAccess().getIDTerminalRuleCall_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Module__Group__0__Impl" - - - // $ANTLR start "rule__Module__Group__1" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:731:1: rule__Module__Group__1 : rule__Module__Group__1__Impl ; - public final void rule__Module__Group__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:735:1: ( rule__Module__Group__1__Impl ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:736:2: rule__Module__Group__1__Impl - { - pushFollow(FOLLOW_rule__Module__Group__1__Impl_in_rule__Module__Group__11428); - rule__Module__Group__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Module__Group__1" - - - // $ANTLR start "rule__Module__Group__1__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:742:1: rule__Module__Group__1__Impl : ( ( rule__Module__Group_1__0 )* ) ; - public final void rule__Module__Group__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:746:1: ( ( ( rule__Module__Group_1__0 )* ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:747:1: ( ( rule__Module__Group_1__0 )* ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:747:1: ( ( rule__Module__Group_1__0 )* ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:748:1: ( rule__Module__Group_1__0 )* - { - before(grammarAccess.getModuleAccess().getGroup_1()); - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:749:1: ( rule__Module__Group_1__0 )* - loop6: - do { - int alt6=2; - int LA6_0 = input.LA(1); - - if ( (LA6_0==15) ) { - alt6=1; - } - - - switch (alt6) { - case 1 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:749:2: rule__Module__Group_1__0 - { - pushFollow(FOLLOW_rule__Module__Group_1__0_in_rule__Module__Group__1__Impl1455); - rule__Module__Group_1__0(); - - state._fsp--; - - - } - break; - - default : - break loop6; - } - } while (true); - - after(grammarAccess.getModuleAccess().getGroup_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Module__Group__1__Impl" - - - // $ANTLR start "rule__Module__Group_1__0" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:763:1: rule__Module__Group_1__0 : rule__Module__Group_1__0__Impl rule__Module__Group_1__1 ; - public final void rule__Module__Group_1__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:767:1: ( rule__Module__Group_1__0__Impl rule__Module__Group_1__1 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:768:2: rule__Module__Group_1__0__Impl rule__Module__Group_1__1 - { - pushFollow(FOLLOW_rule__Module__Group_1__0__Impl_in_rule__Module__Group_1__01490); - rule__Module__Group_1__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Module__Group_1__1_in_rule__Module__Group_1__01493); - rule__Module__Group_1__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Module__Group_1__0" - - - // $ANTLR start "rule__Module__Group_1__0__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:775:1: rule__Module__Group_1__0__Impl : ( '.' ) ; - public final void rule__Module__Group_1__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:779:1: ( ( '.' ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:780:1: ( '.' ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:780:1: ( '.' ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:781:1: '.' - { - before(grammarAccess.getModuleAccess().getFullStopKeyword_1_0()); - match(input,15,FOLLOW_15_in_rule__Module__Group_1__0__Impl1521); - after(grammarAccess.getModuleAccess().getFullStopKeyword_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Module__Group_1__0__Impl" - - - // $ANTLR start "rule__Module__Group_1__1" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:794:1: rule__Module__Group_1__1 : rule__Module__Group_1__1__Impl ; - public final void rule__Module__Group_1__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:798:1: ( rule__Module__Group_1__1__Impl ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:799:2: rule__Module__Group_1__1__Impl - { - pushFollow(FOLLOW_rule__Module__Group_1__1__Impl_in_rule__Module__Group_1__11552); - rule__Module__Group_1__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Module__Group_1__1" - - - // $ANTLR start "rule__Module__Group_1__1__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:805:1: rule__Module__Group_1__1__Impl : ( RULE_ID ) ; - public final void rule__Module__Group_1__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:809:1: ( ( RULE_ID ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:810:1: ( RULE_ID ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:810:1: ( RULE_ID ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:811:1: RULE_ID - { - before(grammarAccess.getModuleAccess().getIDTerminalRuleCall_1_1()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__Module__Group_1__1__Impl1579); - after(grammarAccess.getModuleAccess().getIDTerminalRuleCall_1_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Module__Group_1__1__Impl" - - - // $ANTLR start "rule__Roledefn__Group__0" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:826:1: rule__Roledefn__Group__0 : rule__Roledefn__Group__0__Impl rule__Roledefn__Group__1 ; - public final void rule__Roledefn__Group__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:830:1: ( rule__Roledefn__Group__0__Impl rule__Roledefn__Group__1 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:831:2: rule__Roledefn__Group__0__Impl rule__Roledefn__Group__1 - { - pushFollow(FOLLOW_rule__Roledefn__Group__0__Impl_in_rule__Roledefn__Group__01612); - rule__Roledefn__Group__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Roledefn__Group__1_in_rule__Roledefn__Group__01615); - rule__Roledefn__Group__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Roledefn__Group__0" - - - // $ANTLR start "rule__Roledefn__Group__0__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:838:1: rule__Roledefn__Group__0__Impl : ( 'role' ) ; - public final void rule__Roledefn__Group__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:842:1: ( ( 'role' ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:843:1: ( 'role' ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:843:1: ( 'role' ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:844:1: 'role' - { - before(grammarAccess.getRoledefnAccess().getRoleKeyword_0()); - match(input,16,FOLLOW_16_in_rule__Roledefn__Group__0__Impl1643); - after(grammarAccess.getRoledefnAccess().getRoleKeyword_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Roledefn__Group__0__Impl" - - - // $ANTLR start "rule__Roledefn__Group__1" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:857:1: rule__Roledefn__Group__1 : rule__Roledefn__Group__1__Impl rule__Roledefn__Group__2 ; - public final void rule__Roledefn__Group__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:861:1: ( rule__Roledefn__Group__1__Impl rule__Roledefn__Group__2 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:862:2: rule__Roledefn__Group__1__Impl rule__Roledefn__Group__2 - { - pushFollow(FOLLOW_rule__Roledefn__Group__1__Impl_in_rule__Roledefn__Group__11674); - rule__Roledefn__Group__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Roledefn__Group__2_in_rule__Roledefn__Group__11677); - rule__Roledefn__Group__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Roledefn__Group__1" - - - // $ANTLR start "rule__Roledefn__Group__1__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:869:1: rule__Roledefn__Group__1__Impl : ( RULE_ID ) ; - public final void rule__Roledefn__Group__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:873:1: ( ( RULE_ID ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:874:1: ( RULE_ID ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:874:1: ( RULE_ID ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:875:1: RULE_ID - { - before(grammarAccess.getRoledefnAccess().getIDTerminalRuleCall_1()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__Roledefn__Group__1__Impl1704); - after(grammarAccess.getRoledefnAccess().getIDTerminalRuleCall_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Roledefn__Group__1__Impl" - - - // $ANTLR start "rule__Roledefn__Group__2" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:886:1: rule__Roledefn__Group__2 : rule__Roledefn__Group__2__Impl rule__Roledefn__Group__3 ; - public final void rule__Roledefn__Group__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:890:1: ( rule__Roledefn__Group__2__Impl rule__Roledefn__Group__3 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:891:2: rule__Roledefn__Group__2__Impl rule__Roledefn__Group__3 - { - pushFollow(FOLLOW_rule__Roledefn__Group__2__Impl_in_rule__Roledefn__Group__21733); - rule__Roledefn__Group__2__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Roledefn__Group__3_in_rule__Roledefn__Group__21736); - rule__Roledefn__Group__3(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Roledefn__Group__2" - - - // $ANTLR start "rule__Roledefn__Group__2__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:898:1: rule__Roledefn__Group__2__Impl : ( ( rule__Roledefn__Group_2__0 )? ) ; - public final void rule__Roledefn__Group__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:902:1: ( ( ( rule__Roledefn__Group_2__0 )? ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:903:1: ( ( rule__Roledefn__Group_2__0 )? ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:903:1: ( ( rule__Roledefn__Group_2__0 )? ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:904:1: ( rule__Roledefn__Group_2__0 )? - { - before(grammarAccess.getRoledefnAccess().getGroup_2()); - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:905:1: ( rule__Roledefn__Group_2__0 )? - int alt7=2; - int LA7_0 = input.LA(1); - - if ( (LA7_0==17) ) { - alt7=1; - } - switch (alt7) { - case 1 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:905:2: rule__Roledefn__Group_2__0 - { - pushFollow(FOLLOW_rule__Roledefn__Group_2__0_in_rule__Roledefn__Group__2__Impl1763); - rule__Roledefn__Group_2__0(); - - state._fsp--; - - - } - break; - - } - - after(grammarAccess.getRoledefnAccess().getGroup_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Roledefn__Group__2__Impl" - - - // $ANTLR start "rule__Roledefn__Group__3" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:915:1: rule__Roledefn__Group__3 : rule__Roledefn__Group__3__Impl ; - public final void rule__Roledefn__Group__3() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:919:1: ( rule__Roledefn__Group__3__Impl ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:920:2: rule__Roledefn__Group__3__Impl - { - pushFollow(FOLLOW_rule__Roledefn__Group__3__Impl_in_rule__Roledefn__Group__31794); - rule__Roledefn__Group__3__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Roledefn__Group__3" - - - // $ANTLR start "rule__Roledefn__Group__3__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:926:1: rule__Roledefn__Group__3__Impl : ( ';' ) ; - public final void rule__Roledefn__Group__3__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:930:1: ( ( ';' ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:931:1: ( ';' ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:931:1: ( ';' ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:932:1: ';' - { - before(grammarAccess.getRoledefnAccess().getSemicolonKeyword_3()); - match(input,12,FOLLOW_12_in_rule__Roledefn__Group__3__Impl1822); - after(grammarAccess.getRoledefnAccess().getSemicolonKeyword_3()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Roledefn__Group__3__Impl" - - - // $ANTLR start "rule__Roledefn__Group_2__0" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:953:1: rule__Roledefn__Group_2__0 : rule__Roledefn__Group_2__0__Impl rule__Roledefn__Group_2__1 ; - public final void rule__Roledefn__Group_2__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:957:1: ( rule__Roledefn__Group_2__0__Impl rule__Roledefn__Group_2__1 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:958:2: rule__Roledefn__Group_2__0__Impl rule__Roledefn__Group_2__1 - { - pushFollow(FOLLOW_rule__Roledefn__Group_2__0__Impl_in_rule__Roledefn__Group_2__01861); - rule__Roledefn__Group_2__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Roledefn__Group_2__1_in_rule__Roledefn__Group_2__01864); - rule__Roledefn__Group_2__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Roledefn__Group_2__0" - - - // $ANTLR start "rule__Roledefn__Group_2__0__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:965:1: rule__Roledefn__Group_2__0__Impl : ( 'simulating' ) ; - public final void rule__Roledefn__Group_2__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:969:1: ( ( 'simulating' ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:970:1: ( 'simulating' ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:970:1: ( 'simulating' ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:971:1: 'simulating' - { - before(grammarAccess.getRoledefnAccess().getSimulatingKeyword_2_0()); - match(input,17,FOLLOW_17_in_rule__Roledefn__Group_2__0__Impl1892); - after(grammarAccess.getRoledefnAccess().getSimulatingKeyword_2_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Roledefn__Group_2__0__Impl" - - - // $ANTLR start "rule__Roledefn__Group_2__1" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:984:1: rule__Roledefn__Group_2__1 : rule__Roledefn__Group_2__1__Impl rule__Roledefn__Group_2__2 ; - public final void rule__Roledefn__Group_2__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:988:1: ( rule__Roledefn__Group_2__1__Impl rule__Roledefn__Group_2__2 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:989:2: rule__Roledefn__Group_2__1__Impl rule__Roledefn__Group_2__2 - { - pushFollow(FOLLOW_rule__Roledefn__Group_2__1__Impl_in_rule__Roledefn__Group_2__11923); - rule__Roledefn__Group_2__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Roledefn__Group_2__2_in_rule__Roledefn__Group_2__11926); - rule__Roledefn__Group_2__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Roledefn__Group_2__1" - - - // $ANTLR start "rule__Roledefn__Group_2__1__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:996:1: rule__Roledefn__Group_2__1__Impl : ( ruleModule ) ; - public final void rule__Roledefn__Group_2__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1000:1: ( ( ruleModule ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1001:1: ( ruleModule ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1001:1: ( ruleModule ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1002:1: ruleModule - { - before(grammarAccess.getRoledefnAccess().getModuleParserRuleCall_2_1()); - pushFollow(FOLLOW_ruleModule_in_rule__Roledefn__Group_2__1__Impl1953); - ruleModule(); - - state._fsp--; - - after(grammarAccess.getRoledefnAccess().getModuleParserRuleCall_2_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Roledefn__Group_2__1__Impl" - - - // $ANTLR start "rule__Roledefn__Group_2__2" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1013:1: rule__Roledefn__Group_2__2 : rule__Roledefn__Group_2__2__Impl rule__Roledefn__Group_2__3 ; - public final void rule__Roledefn__Group_2__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1017:1: ( rule__Roledefn__Group_2__2__Impl rule__Roledefn__Group_2__3 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1018:2: rule__Roledefn__Group_2__2__Impl rule__Roledefn__Group_2__3 - { - pushFollow(FOLLOW_rule__Roledefn__Group_2__2__Impl_in_rule__Roledefn__Group_2__21982); - rule__Roledefn__Group_2__2__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Roledefn__Group_2__3_in_rule__Roledefn__Group_2__21985); - rule__Roledefn__Group_2__3(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Roledefn__Group_2__2" - - - // $ANTLR start "rule__Roledefn__Group_2__2__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1025:1: rule__Roledefn__Group_2__2__Impl : ( 'protocol' ) ; - public final void rule__Roledefn__Group_2__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1029:1: ( ( 'protocol' ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1030:1: ( 'protocol' ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1030:1: ( 'protocol' ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1031:1: 'protocol' - { - before(grammarAccess.getRoledefnAccess().getProtocolKeyword_2_2()); - match(input,18,FOLLOW_18_in_rule__Roledefn__Group_2__2__Impl2013); - after(grammarAccess.getRoledefnAccess().getProtocolKeyword_2_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Roledefn__Group_2__2__Impl" - - - // $ANTLR start "rule__Roledefn__Group_2__3" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1044:1: rule__Roledefn__Group_2__3 : rule__Roledefn__Group_2__3__Impl rule__Roledefn__Group_2__4 ; - public final void rule__Roledefn__Group_2__3() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1048:1: ( rule__Roledefn__Group_2__3__Impl rule__Roledefn__Group_2__4 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1049:2: rule__Roledefn__Group_2__3__Impl rule__Roledefn__Group_2__4 - { - pushFollow(FOLLOW_rule__Roledefn__Group_2__3__Impl_in_rule__Roledefn__Group_2__32044); - rule__Roledefn__Group_2__3__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Roledefn__Group_2__4_in_rule__Roledefn__Group_2__32047); - rule__Roledefn__Group_2__4(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Roledefn__Group_2__3" - - - // $ANTLR start "rule__Roledefn__Group_2__3__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1056:1: rule__Roledefn__Group_2__3__Impl : ( RULE_ID ) ; - public final void rule__Roledefn__Group_2__3__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1060:1: ( ( RULE_ID ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1061:1: ( RULE_ID ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1061:1: ( RULE_ID ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1062:1: RULE_ID - { - before(grammarAccess.getRoledefnAccess().getIDTerminalRuleCall_2_3()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__Roledefn__Group_2__3__Impl2074); - after(grammarAccess.getRoledefnAccess().getIDTerminalRuleCall_2_3()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Roledefn__Group_2__3__Impl" - - - // $ANTLR start "rule__Roledefn__Group_2__4" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1073:1: rule__Roledefn__Group_2__4 : rule__Roledefn__Group_2__4__Impl ; - public final void rule__Roledefn__Group_2__4() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1077:1: ( rule__Roledefn__Group_2__4__Impl ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1078:2: rule__Roledefn__Group_2__4__Impl - { - pushFollow(FOLLOW_rule__Roledefn__Group_2__4__Impl_in_rule__Roledefn__Group_2__42103); - rule__Roledefn__Group_2__4__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Roledefn__Group_2__4" - - - // $ANTLR start "rule__Roledefn__Group_2__4__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1084:1: rule__Roledefn__Group_2__4__Impl : ( ( rule__Roledefn__Group_2_4__0 )? ) ; - public final void rule__Roledefn__Group_2__4__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1088:1: ( ( ( rule__Roledefn__Group_2_4__0 )? ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1089:1: ( ( rule__Roledefn__Group_2_4__0 )? ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1089:1: ( ( rule__Roledefn__Group_2_4__0 )? ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1090:1: ( rule__Roledefn__Group_2_4__0 )? - { - before(grammarAccess.getRoledefnAccess().getGroup_2_4()); - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1091:1: ( rule__Roledefn__Group_2_4__0 )? - int alt8=2; - int LA8_0 = input.LA(1); - - if ( (LA8_0==19) ) { - alt8=1; - } - switch (alt8) { - case 1 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1091:2: rule__Roledefn__Group_2_4__0 - { - pushFollow(FOLLOW_rule__Roledefn__Group_2_4__0_in_rule__Roledefn__Group_2__4__Impl2130); - rule__Roledefn__Group_2_4__0(); - - state._fsp--; - - - } - break; - - } - - after(grammarAccess.getRoledefnAccess().getGroup_2_4()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Roledefn__Group_2__4__Impl" - - - // $ANTLR start "rule__Roledefn__Group_2_4__0" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1111:1: rule__Roledefn__Group_2_4__0 : rule__Roledefn__Group_2_4__0__Impl rule__Roledefn__Group_2_4__1 ; - public final void rule__Roledefn__Group_2_4__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1115:1: ( rule__Roledefn__Group_2_4__0__Impl rule__Roledefn__Group_2_4__1 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1116:2: rule__Roledefn__Group_2_4__0__Impl rule__Roledefn__Group_2_4__1 - { - pushFollow(FOLLOW_rule__Roledefn__Group_2_4__0__Impl_in_rule__Roledefn__Group_2_4__02171); - rule__Roledefn__Group_2_4__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Roledefn__Group_2_4__1_in_rule__Roledefn__Group_2_4__02174); - rule__Roledefn__Group_2_4__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Roledefn__Group_2_4__0" - - - // $ANTLR start "rule__Roledefn__Group_2_4__0__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1123:1: rule__Roledefn__Group_2_4__0__Impl : ( 'as' ) ; - public final void rule__Roledefn__Group_2_4__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1127:1: ( ( 'as' ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1128:1: ( 'as' ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1128:1: ( 'as' ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1129:1: 'as' - { - before(grammarAccess.getRoledefnAccess().getAsKeyword_2_4_0()); - match(input,19,FOLLOW_19_in_rule__Roledefn__Group_2_4__0__Impl2202); - after(grammarAccess.getRoledefnAccess().getAsKeyword_2_4_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Roledefn__Group_2_4__0__Impl" - - - // $ANTLR start "rule__Roledefn__Group_2_4__1" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1142:1: rule__Roledefn__Group_2_4__1 : rule__Roledefn__Group_2_4__1__Impl ; - public final void rule__Roledefn__Group_2_4__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1146:1: ( rule__Roledefn__Group_2_4__1__Impl ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1147:2: rule__Roledefn__Group_2_4__1__Impl - { - pushFollow(FOLLOW_rule__Roledefn__Group_2_4__1__Impl_in_rule__Roledefn__Group_2_4__12233); - rule__Roledefn__Group_2_4__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Roledefn__Group_2_4__1" - - - // $ANTLR start "rule__Roledefn__Group_2_4__1__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1153:1: rule__Roledefn__Group_2_4__1__Impl : ( RULE_ID ) ; - public final void rule__Roledefn__Group_2_4__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1157:1: ( ( RULE_ID ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1158:1: ( RULE_ID ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1158:1: ( RULE_ID ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1159:1: RULE_ID - { - before(grammarAccess.getRoledefnAccess().getIDTerminalRuleCall_2_4_1()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__Roledefn__Group_2_4__1__Impl2260); - after(grammarAccess.getRoledefnAccess().getIDTerminalRuleCall_2_4_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Roledefn__Group_2_4__1__Impl" - - - // $ANTLR start "rule__Messagetransfer__Group__0" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1174:1: rule__Messagetransfer__Group__0 : rule__Messagetransfer__Group__0__Impl rule__Messagetransfer__Group__1 ; - public final void rule__Messagetransfer__Group__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1178:1: ( rule__Messagetransfer__Group__0__Impl rule__Messagetransfer__Group__1 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1179:2: rule__Messagetransfer__Group__0__Impl rule__Messagetransfer__Group__1 - { - pushFollow(FOLLOW_rule__Messagetransfer__Group__0__Impl_in_rule__Messagetransfer__Group__02293); - rule__Messagetransfer__Group__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Messagetransfer__Group__1_in_rule__Messagetransfer__Group__02296); - rule__Messagetransfer__Group__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Messagetransfer__Group__0" - - - // $ANTLR start "rule__Messagetransfer__Group__0__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1186:1: rule__Messagetransfer__Group__0__Impl : ( () ) ; - public final void rule__Messagetransfer__Group__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1190:1: ( ( () ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1191:1: ( () ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1191:1: ( () ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1192:1: () - { - before(grammarAccess.getMessagetransferAccess().getMessagetransferAction_0()); - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1193:1: () - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1195:1: - { - } - - after(grammarAccess.getMessagetransferAccess().getMessagetransferAction_0()); - - } - - - } - - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Messagetransfer__Group__0__Impl" - - - // $ANTLR start "rule__Messagetransfer__Group__1" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1205:1: rule__Messagetransfer__Group__1 : rule__Messagetransfer__Group__1__Impl rule__Messagetransfer__Group__2 ; - public final void rule__Messagetransfer__Group__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1209:1: ( rule__Messagetransfer__Group__1__Impl rule__Messagetransfer__Group__2 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1210:2: rule__Messagetransfer__Group__1__Impl rule__Messagetransfer__Group__2 - { - pushFollow(FOLLOW_rule__Messagetransfer__Group__1__Impl_in_rule__Messagetransfer__Group__12354); - rule__Messagetransfer__Group__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Messagetransfer__Group__2_in_rule__Messagetransfer__Group__12357); - rule__Messagetransfer__Group__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Messagetransfer__Group__1" - - - // $ANTLR start "rule__Messagetransfer__Group__1__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1217:1: rule__Messagetransfer__Group__1__Impl : ( RULE_ID ) ; - public final void rule__Messagetransfer__Group__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1221:1: ( ( RULE_ID ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1222:1: ( RULE_ID ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1222:1: ( RULE_ID ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1223:1: RULE_ID - { - before(grammarAccess.getMessagetransferAccess().getIDTerminalRuleCall_1()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__Messagetransfer__Group__1__Impl2384); - after(grammarAccess.getMessagetransferAccess().getIDTerminalRuleCall_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Messagetransfer__Group__1__Impl" - - - // $ANTLR start "rule__Messagetransfer__Group__2" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1234:1: rule__Messagetransfer__Group__2 : rule__Messagetransfer__Group__2__Impl rule__Messagetransfer__Group__3 ; - public final void rule__Messagetransfer__Group__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1238:1: ( rule__Messagetransfer__Group__2__Impl rule__Messagetransfer__Group__3 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1239:2: rule__Messagetransfer__Group__2__Impl rule__Messagetransfer__Group__3 - { - pushFollow(FOLLOW_rule__Messagetransfer__Group__2__Impl_in_rule__Messagetransfer__Group__22413); - rule__Messagetransfer__Group__2__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Messagetransfer__Group__3_in_rule__Messagetransfer__Group__22416); - rule__Messagetransfer__Group__3(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Messagetransfer__Group__2" - - - // $ANTLR start "rule__Messagetransfer__Group__2__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1246:1: rule__Messagetransfer__Group__2__Impl : ( ( rule__Messagetransfer__Group_2__0 )? ) ; - public final void rule__Messagetransfer__Group__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1250:1: ( ( ( rule__Messagetransfer__Group_2__0 )? ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1251:1: ( ( rule__Messagetransfer__Group_2__0 )? ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1251:1: ( ( rule__Messagetransfer__Group_2__0 )? ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1252:1: ( rule__Messagetransfer__Group_2__0 )? - { - before(grammarAccess.getMessagetransferAccess().getGroup_2()); - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1253:1: ( rule__Messagetransfer__Group_2__0 )? - int alt9=2; - int LA9_0 = input.LA(1); - - if ( (LA9_0==22) ) { - alt9=1; - } - switch (alt9) { - case 1 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1253:2: rule__Messagetransfer__Group_2__0 - { - pushFollow(FOLLOW_rule__Messagetransfer__Group_2__0_in_rule__Messagetransfer__Group__2__Impl2443); - rule__Messagetransfer__Group_2__0(); - - state._fsp--; - - - } - break; - - } - - after(grammarAccess.getMessagetransferAccess().getGroup_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Messagetransfer__Group__2__Impl" - - - // $ANTLR start "rule__Messagetransfer__Group__3" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1263:1: rule__Messagetransfer__Group__3 : rule__Messagetransfer__Group__3__Impl rule__Messagetransfer__Group__4 ; - public final void rule__Messagetransfer__Group__3() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1267:1: ( rule__Messagetransfer__Group__3__Impl rule__Messagetransfer__Group__4 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1268:2: rule__Messagetransfer__Group__3__Impl rule__Messagetransfer__Group__4 - { - pushFollow(FOLLOW_rule__Messagetransfer__Group__3__Impl_in_rule__Messagetransfer__Group__32474); - rule__Messagetransfer__Group__3__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Messagetransfer__Group__4_in_rule__Messagetransfer__Group__32477); - rule__Messagetransfer__Group__4(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Messagetransfer__Group__3" - - - // $ANTLR start "rule__Messagetransfer__Group__3__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1275:1: rule__Messagetransfer__Group__3__Impl : ( 'from' ) ; - public final void rule__Messagetransfer__Group__3__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1279:1: ( ( 'from' ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1280:1: ( 'from' ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1280:1: ( 'from' ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1281:1: 'from' - { - before(grammarAccess.getMessagetransferAccess().getFromKeyword_3()); - match(input,20,FOLLOW_20_in_rule__Messagetransfer__Group__3__Impl2505); - after(grammarAccess.getMessagetransferAccess().getFromKeyword_3()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Messagetransfer__Group__3__Impl" - - - // $ANTLR start "rule__Messagetransfer__Group__4" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1294:1: rule__Messagetransfer__Group__4 : rule__Messagetransfer__Group__4__Impl rule__Messagetransfer__Group__5 ; - public final void rule__Messagetransfer__Group__4() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1298:1: ( rule__Messagetransfer__Group__4__Impl rule__Messagetransfer__Group__5 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1299:2: rule__Messagetransfer__Group__4__Impl rule__Messagetransfer__Group__5 - { - pushFollow(FOLLOW_rule__Messagetransfer__Group__4__Impl_in_rule__Messagetransfer__Group__42536); - rule__Messagetransfer__Group__4__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Messagetransfer__Group__5_in_rule__Messagetransfer__Group__42539); - rule__Messagetransfer__Group__5(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Messagetransfer__Group__4" - - - // $ANTLR start "rule__Messagetransfer__Group__4__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1306:1: rule__Messagetransfer__Group__4__Impl : ( RULE_ID ) ; - public final void rule__Messagetransfer__Group__4__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1310:1: ( ( RULE_ID ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1311:1: ( RULE_ID ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1311:1: ( RULE_ID ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1312:1: RULE_ID - { - before(grammarAccess.getMessagetransferAccess().getIDTerminalRuleCall_4()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__Messagetransfer__Group__4__Impl2566); - after(grammarAccess.getMessagetransferAccess().getIDTerminalRuleCall_4()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Messagetransfer__Group__4__Impl" - - - // $ANTLR start "rule__Messagetransfer__Group__5" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1323:1: rule__Messagetransfer__Group__5 : rule__Messagetransfer__Group__5__Impl rule__Messagetransfer__Group__6 ; - public final void rule__Messagetransfer__Group__5() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1327:1: ( rule__Messagetransfer__Group__5__Impl rule__Messagetransfer__Group__6 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1328:2: rule__Messagetransfer__Group__5__Impl rule__Messagetransfer__Group__6 - { - pushFollow(FOLLOW_rule__Messagetransfer__Group__5__Impl_in_rule__Messagetransfer__Group__52595); - rule__Messagetransfer__Group__5__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Messagetransfer__Group__6_in_rule__Messagetransfer__Group__52598); - rule__Messagetransfer__Group__6(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Messagetransfer__Group__5" - - - // $ANTLR start "rule__Messagetransfer__Group__5__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1335:1: rule__Messagetransfer__Group__5__Impl : ( 'to' ) ; - public final void rule__Messagetransfer__Group__5__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1339:1: ( ( 'to' ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1340:1: ( 'to' ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1340:1: ( 'to' ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1341:1: 'to' - { - before(grammarAccess.getMessagetransferAccess().getToKeyword_5()); - match(input,21,FOLLOW_21_in_rule__Messagetransfer__Group__5__Impl2626); - after(grammarAccess.getMessagetransferAccess().getToKeyword_5()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Messagetransfer__Group__5__Impl" - - - // $ANTLR start "rule__Messagetransfer__Group__6" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1354:1: rule__Messagetransfer__Group__6 : rule__Messagetransfer__Group__6__Impl rule__Messagetransfer__Group__7 ; - public final void rule__Messagetransfer__Group__6() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1358:1: ( rule__Messagetransfer__Group__6__Impl rule__Messagetransfer__Group__7 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1359:2: rule__Messagetransfer__Group__6__Impl rule__Messagetransfer__Group__7 - { - pushFollow(FOLLOW_rule__Messagetransfer__Group__6__Impl_in_rule__Messagetransfer__Group__62657); - rule__Messagetransfer__Group__6__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Messagetransfer__Group__7_in_rule__Messagetransfer__Group__62660); - rule__Messagetransfer__Group__7(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Messagetransfer__Group__6" - - - // $ANTLR start "rule__Messagetransfer__Group__6__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1366:1: rule__Messagetransfer__Group__6__Impl : ( RULE_ID ) ; - public final void rule__Messagetransfer__Group__6__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1370:1: ( ( RULE_ID ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1371:1: ( RULE_ID ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1371:1: ( RULE_ID ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1372:1: RULE_ID - { - before(grammarAccess.getMessagetransferAccess().getIDTerminalRuleCall_6()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__Messagetransfer__Group__6__Impl2687); - after(grammarAccess.getMessagetransferAccess().getIDTerminalRuleCall_6()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Messagetransfer__Group__6__Impl" - - - // $ANTLR start "rule__Messagetransfer__Group__7" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1383:1: rule__Messagetransfer__Group__7 : rule__Messagetransfer__Group__7__Impl rule__Messagetransfer__Group__8 ; - public final void rule__Messagetransfer__Group__7() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1387:1: ( rule__Messagetransfer__Group__7__Impl rule__Messagetransfer__Group__8 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1388:2: rule__Messagetransfer__Group__7__Impl rule__Messagetransfer__Group__8 - { - pushFollow(FOLLOW_rule__Messagetransfer__Group__7__Impl_in_rule__Messagetransfer__Group__72716); - rule__Messagetransfer__Group__7__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Messagetransfer__Group__8_in_rule__Messagetransfer__Group__72719); - rule__Messagetransfer__Group__8(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Messagetransfer__Group__7" - - - // $ANTLR start "rule__Messagetransfer__Group__7__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1395:1: rule__Messagetransfer__Group__7__Impl : ( ( rule__Messagetransfer__Group_7__0 )* ) ; - public final void rule__Messagetransfer__Group__7__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1399:1: ( ( ( rule__Messagetransfer__Group_7__0 )* ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1400:1: ( ( rule__Messagetransfer__Group_7__0 )* ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1400:1: ( ( rule__Messagetransfer__Group_7__0 )* ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1401:1: ( rule__Messagetransfer__Group_7__0 )* - { - before(grammarAccess.getMessagetransferAccess().getGroup_7()); - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1402:1: ( rule__Messagetransfer__Group_7__0 )* - loop10: - do { - int alt10=2; - int LA10_0 = input.LA(1); - - if ( (LA10_0==24) ) { - alt10=1; - } - - - switch (alt10) { - case 1 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1402:2: rule__Messagetransfer__Group_7__0 - { - pushFollow(FOLLOW_rule__Messagetransfer__Group_7__0_in_rule__Messagetransfer__Group__7__Impl2746); - rule__Messagetransfer__Group_7__0(); - - state._fsp--; - - - } - break; - - default : - break loop10; - } - } while (true); - - after(grammarAccess.getMessagetransferAccess().getGroup_7()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Messagetransfer__Group__7__Impl" - - - // $ANTLR start "rule__Messagetransfer__Group__8" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1412:1: rule__Messagetransfer__Group__8 : rule__Messagetransfer__Group__8__Impl ; - public final void rule__Messagetransfer__Group__8() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1416:1: ( rule__Messagetransfer__Group__8__Impl ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1417:2: rule__Messagetransfer__Group__8__Impl - { - pushFollow(FOLLOW_rule__Messagetransfer__Group__8__Impl_in_rule__Messagetransfer__Group__82777); - rule__Messagetransfer__Group__8__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Messagetransfer__Group__8" - - - // $ANTLR start "rule__Messagetransfer__Group__8__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1423:1: rule__Messagetransfer__Group__8__Impl : ( ';' ) ; - public final void rule__Messagetransfer__Group__8__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1427:1: ( ( ';' ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1428:1: ( ';' ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1428:1: ( ';' ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1429:1: ';' - { - before(grammarAccess.getMessagetransferAccess().getSemicolonKeyword_8()); - match(input,12,FOLLOW_12_in_rule__Messagetransfer__Group__8__Impl2805); - after(grammarAccess.getMessagetransferAccess().getSemicolonKeyword_8()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Messagetransfer__Group__8__Impl" - - - // $ANTLR start "rule__Messagetransfer__Group_2__0" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1460:1: rule__Messagetransfer__Group_2__0 : rule__Messagetransfer__Group_2__0__Impl rule__Messagetransfer__Group_2__1 ; - public final void rule__Messagetransfer__Group_2__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1464:1: ( rule__Messagetransfer__Group_2__0__Impl rule__Messagetransfer__Group_2__1 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1465:2: rule__Messagetransfer__Group_2__0__Impl rule__Messagetransfer__Group_2__1 - { - pushFollow(FOLLOW_rule__Messagetransfer__Group_2__0__Impl_in_rule__Messagetransfer__Group_2__02854); - rule__Messagetransfer__Group_2__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Messagetransfer__Group_2__1_in_rule__Messagetransfer__Group_2__02857); - rule__Messagetransfer__Group_2__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Messagetransfer__Group_2__0" - - - // $ANTLR start "rule__Messagetransfer__Group_2__0__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1472:1: rule__Messagetransfer__Group_2__0__Impl : ( '(' ) ; - public final void rule__Messagetransfer__Group_2__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1476:1: ( ( '(' ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1477:1: ( '(' ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1477:1: ( '(' ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1478:1: '(' - { - before(grammarAccess.getMessagetransferAccess().getLeftParenthesisKeyword_2_0()); - match(input,22,FOLLOW_22_in_rule__Messagetransfer__Group_2__0__Impl2885); - after(grammarAccess.getMessagetransferAccess().getLeftParenthesisKeyword_2_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Messagetransfer__Group_2__0__Impl" - - - // $ANTLR start "rule__Messagetransfer__Group_2__1" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1491:1: rule__Messagetransfer__Group_2__1 : rule__Messagetransfer__Group_2__1__Impl rule__Messagetransfer__Group_2__2 ; - public final void rule__Messagetransfer__Group_2__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1495:1: ( rule__Messagetransfer__Group_2__1__Impl rule__Messagetransfer__Group_2__2 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1496:2: rule__Messagetransfer__Group_2__1__Impl rule__Messagetransfer__Group_2__2 - { - pushFollow(FOLLOW_rule__Messagetransfer__Group_2__1__Impl_in_rule__Messagetransfer__Group_2__12916); - rule__Messagetransfer__Group_2__1__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Messagetransfer__Group_2__2_in_rule__Messagetransfer__Group_2__12919); - rule__Messagetransfer__Group_2__2(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Messagetransfer__Group_2__1" - - - // $ANTLR start "rule__Messagetransfer__Group_2__1__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1503:1: rule__Messagetransfer__Group_2__1__Impl : ( ( rule__Messagetransfer__Group_2_1__0 )? ) ; - public final void rule__Messagetransfer__Group_2__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1507:1: ( ( ( rule__Messagetransfer__Group_2_1__0 )? ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1508:1: ( ( rule__Messagetransfer__Group_2_1__0 )? ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1508:1: ( ( rule__Messagetransfer__Group_2_1__0 )? ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1509:1: ( rule__Messagetransfer__Group_2_1__0 )? - { - before(grammarAccess.getMessagetransferAccess().getGroup_2_1()); - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1510:1: ( rule__Messagetransfer__Group_2_1__0 )? - int alt11=2; - int LA11_0 = input.LA(1); - - if ( (LA11_0==RULE_STRING) ) { - alt11=1; - } - switch (alt11) { - case 1 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1510:2: rule__Messagetransfer__Group_2_1__0 - { - pushFollow(FOLLOW_rule__Messagetransfer__Group_2_1__0_in_rule__Messagetransfer__Group_2__1__Impl2946); - rule__Messagetransfer__Group_2_1__0(); - - state._fsp--; - - - } - break; - - } - - after(grammarAccess.getMessagetransferAccess().getGroup_2_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Messagetransfer__Group_2__1__Impl" - - - // $ANTLR start "rule__Messagetransfer__Group_2__2" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1520:1: rule__Messagetransfer__Group_2__2 : rule__Messagetransfer__Group_2__2__Impl ; - public final void rule__Messagetransfer__Group_2__2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1524:1: ( rule__Messagetransfer__Group_2__2__Impl ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1525:2: rule__Messagetransfer__Group_2__2__Impl - { - pushFollow(FOLLOW_rule__Messagetransfer__Group_2__2__Impl_in_rule__Messagetransfer__Group_2__22977); - rule__Messagetransfer__Group_2__2__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Messagetransfer__Group_2__2" - - - // $ANTLR start "rule__Messagetransfer__Group_2__2__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1531:1: rule__Messagetransfer__Group_2__2__Impl : ( ')' ) ; - public final void rule__Messagetransfer__Group_2__2__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1535:1: ( ( ')' ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1536:1: ( ')' ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1536:1: ( ')' ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1537:1: ')' - { - before(grammarAccess.getMessagetransferAccess().getRightParenthesisKeyword_2_2()); - match(input,23,FOLLOW_23_in_rule__Messagetransfer__Group_2__2__Impl3005); - after(grammarAccess.getMessagetransferAccess().getRightParenthesisKeyword_2_2()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Messagetransfer__Group_2__2__Impl" - - - // $ANTLR start "rule__Messagetransfer__Group_2_1__0" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1556:1: rule__Messagetransfer__Group_2_1__0 : rule__Messagetransfer__Group_2_1__0__Impl rule__Messagetransfer__Group_2_1__1 ; - public final void rule__Messagetransfer__Group_2_1__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1560:1: ( rule__Messagetransfer__Group_2_1__0__Impl rule__Messagetransfer__Group_2_1__1 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1561:2: rule__Messagetransfer__Group_2_1__0__Impl rule__Messagetransfer__Group_2_1__1 - { - pushFollow(FOLLOW_rule__Messagetransfer__Group_2_1__0__Impl_in_rule__Messagetransfer__Group_2_1__03042); - rule__Messagetransfer__Group_2_1__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Messagetransfer__Group_2_1__1_in_rule__Messagetransfer__Group_2_1__03045); - rule__Messagetransfer__Group_2_1__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Messagetransfer__Group_2_1__0" - - - // $ANTLR start "rule__Messagetransfer__Group_2_1__0__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1568:1: rule__Messagetransfer__Group_2_1__0__Impl : ( ( rule__Messagetransfer__ParametersAssignment_2_1_0 ) ) ; - public final void rule__Messagetransfer__Group_2_1__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1572:1: ( ( ( rule__Messagetransfer__ParametersAssignment_2_1_0 ) ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1573:1: ( ( rule__Messagetransfer__ParametersAssignment_2_1_0 ) ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1573:1: ( ( rule__Messagetransfer__ParametersAssignment_2_1_0 ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1574:1: ( rule__Messagetransfer__ParametersAssignment_2_1_0 ) - { - before(grammarAccess.getMessagetransferAccess().getParametersAssignment_2_1_0()); - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1575:1: ( rule__Messagetransfer__ParametersAssignment_2_1_0 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1575:2: rule__Messagetransfer__ParametersAssignment_2_1_0 - { - pushFollow(FOLLOW_rule__Messagetransfer__ParametersAssignment_2_1_0_in_rule__Messagetransfer__Group_2_1__0__Impl3072); - rule__Messagetransfer__ParametersAssignment_2_1_0(); - - state._fsp--; - - - } - - after(grammarAccess.getMessagetransferAccess().getParametersAssignment_2_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Messagetransfer__Group_2_1__0__Impl" - - - // $ANTLR start "rule__Messagetransfer__Group_2_1__1" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1585:1: rule__Messagetransfer__Group_2_1__1 : rule__Messagetransfer__Group_2_1__1__Impl ; - public final void rule__Messagetransfer__Group_2_1__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1589:1: ( rule__Messagetransfer__Group_2_1__1__Impl ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1590:2: rule__Messagetransfer__Group_2_1__1__Impl - { - pushFollow(FOLLOW_rule__Messagetransfer__Group_2_1__1__Impl_in_rule__Messagetransfer__Group_2_1__13102); - rule__Messagetransfer__Group_2_1__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Messagetransfer__Group_2_1__1" - - - // $ANTLR start "rule__Messagetransfer__Group_2_1__1__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1596:1: rule__Messagetransfer__Group_2_1__1__Impl : ( ( rule__Messagetransfer__Group_2_1_1__0 )* ) ; - public final void rule__Messagetransfer__Group_2_1__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1600:1: ( ( ( rule__Messagetransfer__Group_2_1_1__0 )* ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1601:1: ( ( rule__Messagetransfer__Group_2_1_1__0 )* ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1601:1: ( ( rule__Messagetransfer__Group_2_1_1__0 )* ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1602:1: ( rule__Messagetransfer__Group_2_1_1__0 )* - { - before(grammarAccess.getMessagetransferAccess().getGroup_2_1_1()); - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1603:1: ( rule__Messagetransfer__Group_2_1_1__0 )* - loop12: - do { - int alt12=2; - int LA12_0 = input.LA(1); - - if ( (LA12_0==24) ) { - alt12=1; - } - - - switch (alt12) { - case 1 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1603:2: rule__Messagetransfer__Group_2_1_1__0 - { - pushFollow(FOLLOW_rule__Messagetransfer__Group_2_1_1__0_in_rule__Messagetransfer__Group_2_1__1__Impl3129); - rule__Messagetransfer__Group_2_1_1__0(); - - state._fsp--; - - - } - break; - - default : - break loop12; - } - } while (true); - - after(grammarAccess.getMessagetransferAccess().getGroup_2_1_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Messagetransfer__Group_2_1__1__Impl" - - - // $ANTLR start "rule__Messagetransfer__Group_2_1_1__0" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1617:1: rule__Messagetransfer__Group_2_1_1__0 : rule__Messagetransfer__Group_2_1_1__0__Impl rule__Messagetransfer__Group_2_1_1__1 ; - public final void rule__Messagetransfer__Group_2_1_1__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1621:1: ( rule__Messagetransfer__Group_2_1_1__0__Impl rule__Messagetransfer__Group_2_1_1__1 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1622:2: rule__Messagetransfer__Group_2_1_1__0__Impl rule__Messagetransfer__Group_2_1_1__1 - { - pushFollow(FOLLOW_rule__Messagetransfer__Group_2_1_1__0__Impl_in_rule__Messagetransfer__Group_2_1_1__03164); - rule__Messagetransfer__Group_2_1_1__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Messagetransfer__Group_2_1_1__1_in_rule__Messagetransfer__Group_2_1_1__03167); - rule__Messagetransfer__Group_2_1_1__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Messagetransfer__Group_2_1_1__0" - - - // $ANTLR start "rule__Messagetransfer__Group_2_1_1__0__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1629:1: rule__Messagetransfer__Group_2_1_1__0__Impl : ( ',' ) ; - public final void rule__Messagetransfer__Group_2_1_1__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1633:1: ( ( ',' ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1634:1: ( ',' ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1634:1: ( ',' ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1635:1: ',' - { - before(grammarAccess.getMessagetransferAccess().getCommaKeyword_2_1_1_0()); - match(input,24,FOLLOW_24_in_rule__Messagetransfer__Group_2_1_1__0__Impl3195); - after(grammarAccess.getMessagetransferAccess().getCommaKeyword_2_1_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Messagetransfer__Group_2_1_1__0__Impl" - - - // $ANTLR start "rule__Messagetransfer__Group_2_1_1__1" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1648:1: rule__Messagetransfer__Group_2_1_1__1 : rule__Messagetransfer__Group_2_1_1__1__Impl ; - public final void rule__Messagetransfer__Group_2_1_1__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1652:1: ( rule__Messagetransfer__Group_2_1_1__1__Impl ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1653:2: rule__Messagetransfer__Group_2_1_1__1__Impl - { - pushFollow(FOLLOW_rule__Messagetransfer__Group_2_1_1__1__Impl_in_rule__Messagetransfer__Group_2_1_1__13226); - rule__Messagetransfer__Group_2_1_1__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Messagetransfer__Group_2_1_1__1" - - - // $ANTLR start "rule__Messagetransfer__Group_2_1_1__1__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1659:1: rule__Messagetransfer__Group_2_1_1__1__Impl : ( ( rule__Messagetransfer__ParametersAssignment_2_1_1_1 ) ) ; - public final void rule__Messagetransfer__Group_2_1_1__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1663:1: ( ( ( rule__Messagetransfer__ParametersAssignment_2_1_1_1 ) ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1664:1: ( ( rule__Messagetransfer__ParametersAssignment_2_1_1_1 ) ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1664:1: ( ( rule__Messagetransfer__ParametersAssignment_2_1_1_1 ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1665:1: ( rule__Messagetransfer__ParametersAssignment_2_1_1_1 ) - { - before(grammarAccess.getMessagetransferAccess().getParametersAssignment_2_1_1_1()); - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1666:1: ( rule__Messagetransfer__ParametersAssignment_2_1_1_1 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1666:2: rule__Messagetransfer__ParametersAssignment_2_1_1_1 - { - pushFollow(FOLLOW_rule__Messagetransfer__ParametersAssignment_2_1_1_1_in_rule__Messagetransfer__Group_2_1_1__1__Impl3253); - rule__Messagetransfer__ParametersAssignment_2_1_1_1(); - - state._fsp--; - - - } - - after(grammarAccess.getMessagetransferAccess().getParametersAssignment_2_1_1_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Messagetransfer__Group_2_1_1__1__Impl" - - - // $ANTLR start "rule__Messagetransfer__Group_7__0" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1680:1: rule__Messagetransfer__Group_7__0 : rule__Messagetransfer__Group_7__0__Impl rule__Messagetransfer__Group_7__1 ; - public final void rule__Messagetransfer__Group_7__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1684:1: ( rule__Messagetransfer__Group_7__0__Impl rule__Messagetransfer__Group_7__1 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1685:2: rule__Messagetransfer__Group_7__0__Impl rule__Messagetransfer__Group_7__1 - { - pushFollow(FOLLOW_rule__Messagetransfer__Group_7__0__Impl_in_rule__Messagetransfer__Group_7__03287); - rule__Messagetransfer__Group_7__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Messagetransfer__Group_7__1_in_rule__Messagetransfer__Group_7__03290); - rule__Messagetransfer__Group_7__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Messagetransfer__Group_7__0" - - - // $ANTLR start "rule__Messagetransfer__Group_7__0__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1692:1: rule__Messagetransfer__Group_7__0__Impl : ( ',' ) ; - public final void rule__Messagetransfer__Group_7__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1696:1: ( ( ',' ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1697:1: ( ',' ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1697:1: ( ',' ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1698:1: ',' - { - before(grammarAccess.getMessagetransferAccess().getCommaKeyword_7_0()); - match(input,24,FOLLOW_24_in_rule__Messagetransfer__Group_7__0__Impl3318); - after(grammarAccess.getMessagetransferAccess().getCommaKeyword_7_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Messagetransfer__Group_7__0__Impl" - - - // $ANTLR start "rule__Messagetransfer__Group_7__1" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1711:1: rule__Messagetransfer__Group_7__1 : rule__Messagetransfer__Group_7__1__Impl ; - public final void rule__Messagetransfer__Group_7__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1715:1: ( rule__Messagetransfer__Group_7__1__Impl ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1716:2: rule__Messagetransfer__Group_7__1__Impl - { - pushFollow(FOLLOW_rule__Messagetransfer__Group_7__1__Impl_in_rule__Messagetransfer__Group_7__13349); - rule__Messagetransfer__Group_7__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Messagetransfer__Group_7__1" - - - // $ANTLR start "rule__Messagetransfer__Group_7__1__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1722:1: rule__Messagetransfer__Group_7__1__Impl : ( RULE_ID ) ; - public final void rule__Messagetransfer__Group_7__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1726:1: ( ( RULE_ID ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1727:1: ( RULE_ID ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1727:1: ( RULE_ID ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1728:1: RULE_ID - { - before(grammarAccess.getMessagetransferAccess().getIDTerminalRuleCall_7_1()); - match(input,RULE_ID,FOLLOW_RULE_ID_in_rule__Messagetransfer__Group_7__1__Impl3376); - after(grammarAccess.getMessagetransferAccess().getIDTerminalRuleCall_7_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Messagetransfer__Group_7__1__Impl" - - - // $ANTLR start "rule__Parameter__Group__0" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1743:1: rule__Parameter__Group__0 : rule__Parameter__Group__0__Impl rule__Parameter__Group__1 ; - public final void rule__Parameter__Group__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1747:1: ( rule__Parameter__Group__0__Impl rule__Parameter__Group__1 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1748:2: rule__Parameter__Group__0__Impl rule__Parameter__Group__1 - { - pushFollow(FOLLOW_rule__Parameter__Group__0__Impl_in_rule__Parameter__Group__03409); - rule__Parameter__Group__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Parameter__Group__1_in_rule__Parameter__Group__03412); - rule__Parameter__Group__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Parameter__Group__0" - - - // $ANTLR start "rule__Parameter__Group__0__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1755:1: rule__Parameter__Group__0__Impl : ( ( rule__Parameter__TypeAssignment_0 ) ) ; - public final void rule__Parameter__Group__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1759:1: ( ( ( rule__Parameter__TypeAssignment_0 ) ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1760:1: ( ( rule__Parameter__TypeAssignment_0 ) ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1760:1: ( ( rule__Parameter__TypeAssignment_0 ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1761:1: ( rule__Parameter__TypeAssignment_0 ) - { - before(grammarAccess.getParameterAccess().getTypeAssignment_0()); - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1762:1: ( rule__Parameter__TypeAssignment_0 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1762:2: rule__Parameter__TypeAssignment_0 - { - pushFollow(FOLLOW_rule__Parameter__TypeAssignment_0_in_rule__Parameter__Group__0__Impl3439); - rule__Parameter__TypeAssignment_0(); - - state._fsp--; - - - } - - after(grammarAccess.getParameterAccess().getTypeAssignment_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Parameter__Group__0__Impl" - - - // $ANTLR start "rule__Parameter__Group__1" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1772:1: rule__Parameter__Group__1 : rule__Parameter__Group__1__Impl ; - public final void rule__Parameter__Group__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1776:1: ( rule__Parameter__Group__1__Impl ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1777:2: rule__Parameter__Group__1__Impl - { - pushFollow(FOLLOW_rule__Parameter__Group__1__Impl_in_rule__Parameter__Group__13469); - rule__Parameter__Group__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Parameter__Group__1" - - - // $ANTLR start "rule__Parameter__Group__1__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1783:1: rule__Parameter__Group__1__Impl : ( ( rule__Parameter__Group_1__0 )? ) ; - public final void rule__Parameter__Group__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1787:1: ( ( ( rule__Parameter__Group_1__0 )? ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1788:1: ( ( rule__Parameter__Group_1__0 )? ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1788:1: ( ( rule__Parameter__Group_1__0 )? ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1789:1: ( rule__Parameter__Group_1__0 )? - { - before(grammarAccess.getParameterAccess().getGroup_1()); - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1790:1: ( rule__Parameter__Group_1__0 )? - int alt13=2; - int LA13_0 = input.LA(1); - - if ( (LA13_0==25) ) { - alt13=1; - } - switch (alt13) { - case 1 : - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1790:2: rule__Parameter__Group_1__0 - { - pushFollow(FOLLOW_rule__Parameter__Group_1__0_in_rule__Parameter__Group__1__Impl3496); - rule__Parameter__Group_1__0(); - - state._fsp--; - - - } - break; - - } - - after(grammarAccess.getParameterAccess().getGroup_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Parameter__Group__1__Impl" - - - // $ANTLR start "rule__Parameter__Group_1__0" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1804:1: rule__Parameter__Group_1__0 : rule__Parameter__Group_1__0__Impl rule__Parameter__Group_1__1 ; - public final void rule__Parameter__Group_1__0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1808:1: ( rule__Parameter__Group_1__0__Impl rule__Parameter__Group_1__1 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1809:2: rule__Parameter__Group_1__0__Impl rule__Parameter__Group_1__1 - { - pushFollow(FOLLOW_rule__Parameter__Group_1__0__Impl_in_rule__Parameter__Group_1__03531); - rule__Parameter__Group_1__0__Impl(); - - state._fsp--; - - pushFollow(FOLLOW_rule__Parameter__Group_1__1_in_rule__Parameter__Group_1__03534); - rule__Parameter__Group_1__1(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Parameter__Group_1__0" - - - // $ANTLR start "rule__Parameter__Group_1__0__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1816:1: rule__Parameter__Group_1__0__Impl : ( '=' ) ; - public final void rule__Parameter__Group_1__0__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1820:1: ( ( '=' ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1821:1: ( '=' ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1821:1: ( '=' ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1822:1: '=' - { - before(grammarAccess.getParameterAccess().getEqualsSignKeyword_1_0()); - match(input,25,FOLLOW_25_in_rule__Parameter__Group_1__0__Impl3562); - after(grammarAccess.getParameterAccess().getEqualsSignKeyword_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Parameter__Group_1__0__Impl" - - - // $ANTLR start "rule__Parameter__Group_1__1" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1835:1: rule__Parameter__Group_1__1 : rule__Parameter__Group_1__1__Impl ; - public final void rule__Parameter__Group_1__1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1839:1: ( rule__Parameter__Group_1__1__Impl ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1840:2: rule__Parameter__Group_1__1__Impl - { - pushFollow(FOLLOW_rule__Parameter__Group_1__1__Impl_in_rule__Parameter__Group_1__13593); - rule__Parameter__Group_1__1__Impl(); - - state._fsp--; - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Parameter__Group_1__1" - - - // $ANTLR start "rule__Parameter__Group_1__1__Impl" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1846:1: rule__Parameter__Group_1__1__Impl : ( ( rule__Parameter__ValueAssignment_1_1 ) ) ; - public final void rule__Parameter__Group_1__1__Impl() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1850:1: ( ( ( rule__Parameter__ValueAssignment_1_1 ) ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1851:1: ( ( rule__Parameter__ValueAssignment_1_1 ) ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1851:1: ( ( rule__Parameter__ValueAssignment_1_1 ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1852:1: ( rule__Parameter__ValueAssignment_1_1 ) - { - before(grammarAccess.getParameterAccess().getValueAssignment_1_1()); - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1853:1: ( rule__Parameter__ValueAssignment_1_1 ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1853:2: rule__Parameter__ValueAssignment_1_1 - { - pushFollow(FOLLOW_rule__Parameter__ValueAssignment_1_1_in_rule__Parameter__Group_1__1__Impl3620); - rule__Parameter__ValueAssignment_1_1(); - - state._fsp--; - - - } - - after(grammarAccess.getParameterAccess().getValueAssignment_1_1()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Parameter__Group_1__1__Impl" - - - // $ANTLR start "rule__Trace__RolesAssignment_2" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1868:1: rule__Trace__RolesAssignment_2 : ( ruleRoledefn ) ; - public final void rule__Trace__RolesAssignment_2() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1872:1: ( ( ruleRoledefn ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1873:1: ( ruleRoledefn ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1873:1: ( ruleRoledefn ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1874:1: ruleRoledefn - { - before(grammarAccess.getTraceAccess().getRolesRoledefnParserRuleCall_2_0()); - pushFollow(FOLLOW_ruleRoledefn_in_rule__Trace__RolesAssignment_23659); - ruleRoledefn(); - - state._fsp--; - - after(grammarAccess.getTraceAccess().getRolesRoledefnParserRuleCall_2_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Trace__RolesAssignment_2" - - - // $ANTLR start "rule__Trace__StepsAssignment_3" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1883:1: rule__Trace__StepsAssignment_3 : ( ruleStepdefn ) ; - public final void rule__Trace__StepsAssignment_3() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1887:1: ( ( ruleStepdefn ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1888:1: ( ruleStepdefn ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1888:1: ( ruleStepdefn ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1889:1: ruleStepdefn - { - before(grammarAccess.getTraceAccess().getStepsStepdefnParserRuleCall_3_0()); - pushFollow(FOLLOW_ruleStepdefn_in_rule__Trace__StepsAssignment_33690); - ruleStepdefn(); - - state._fsp--; - - after(grammarAccess.getTraceAccess().getStepsStepdefnParserRuleCall_3_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Trace__StepsAssignment_3" - - - // $ANTLR start "rule__Messagetransfer__ParametersAssignment_2_1_0" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1898:1: rule__Messagetransfer__ParametersAssignment_2_1_0 : ( ruleParameter ) ; - public final void rule__Messagetransfer__ParametersAssignment_2_1_0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1902:1: ( ( ruleParameter ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1903:1: ( ruleParameter ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1903:1: ( ruleParameter ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1904:1: ruleParameter - { - before(grammarAccess.getMessagetransferAccess().getParametersParameterParserRuleCall_2_1_0_0()); - pushFollow(FOLLOW_ruleParameter_in_rule__Messagetransfer__ParametersAssignment_2_1_03721); - ruleParameter(); - - state._fsp--; - - after(grammarAccess.getMessagetransferAccess().getParametersParameterParserRuleCall_2_1_0_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Messagetransfer__ParametersAssignment_2_1_0" - - - // $ANTLR start "rule__Messagetransfer__ParametersAssignment_2_1_1_1" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1913:1: rule__Messagetransfer__ParametersAssignment_2_1_1_1 : ( ruleParameter ) ; - public final void rule__Messagetransfer__ParametersAssignment_2_1_1_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1917:1: ( ( ruleParameter ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1918:1: ( ruleParameter ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1918:1: ( ruleParameter ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1919:1: ruleParameter - { - before(grammarAccess.getMessagetransferAccess().getParametersParameterParserRuleCall_2_1_1_1_0()); - pushFollow(FOLLOW_ruleParameter_in_rule__Messagetransfer__ParametersAssignment_2_1_1_13752); - ruleParameter(); - - state._fsp--; - - after(grammarAccess.getMessagetransferAccess().getParametersParameterParserRuleCall_2_1_1_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Messagetransfer__ParametersAssignment_2_1_1_1" - - - // $ANTLR start "rule__Parameter__TypeAssignment_0" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1928:1: rule__Parameter__TypeAssignment_0 : ( RULE_STRING ) ; - public final void rule__Parameter__TypeAssignment_0() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1932:1: ( ( RULE_STRING ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1933:1: ( RULE_STRING ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1933:1: ( RULE_STRING ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1934:1: RULE_STRING - { - before(grammarAccess.getParameterAccess().getTypeSTRINGTerminalRuleCall_0_0()); - match(input,RULE_STRING,FOLLOW_RULE_STRING_in_rule__Parameter__TypeAssignment_03783); - after(grammarAccess.getParameterAccess().getTypeSTRINGTerminalRuleCall_0_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Parameter__TypeAssignment_0" - - - // $ANTLR start "rule__Parameter__ValueAssignment_1_1" - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1943:1: rule__Parameter__ValueAssignment_1_1 : ( RULE_STRING ) ; - public final void rule__Parameter__ValueAssignment_1_1() throws RecognitionException { - - int stackSize = keepStackSize(); - - try { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1947:1: ( ( RULE_STRING ) ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1948:1: ( RULE_STRING ) - { - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1948:1: ( RULE_STRING ) - // ../org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/contentassist/antlr/internal/InternalScribbleTraceDsl.g:1949:1: RULE_STRING - { - before(grammarAccess.getParameterAccess().getValueSTRINGTerminalRuleCall_1_1_0()); - match(input,RULE_STRING,FOLLOW_RULE_STRING_in_rule__Parameter__ValueAssignment_1_13814); - after(grammarAccess.getParameterAccess().getValueSTRINGTerminalRuleCall_1_1_0()); - - } - - - } - - } - catch (RecognitionException re) { - reportError(re); - recover(input,re); - } - finally { - - restoreStackSize(stackSize); - - } - return ; - } - // $ANTLR end "rule__Parameter__ValueAssignment_1_1" - - // Delegated rules - - - - - public static final BitSet FOLLOW_ruleTrace_in_entryRuleTrace61 = new BitSet(new long[]{0x0000000000000000L}); - public static final BitSet FOLLOW_EOF_in_entryRuleTrace68 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Trace__Group__0_in_ruleTrace94 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ruleSentence_in_entryRuleSentence121 = new BitSet(new long[]{0x0000000000000000L}); - public static final BitSet FOLLOW_EOF_in_entryRuleSentence128 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_RULE_ID_in_ruleSentence157 = new BitSet(new long[]{0x0000000000000012L}); - public static final BitSet FOLLOW_RULE_ID_in_ruleSentence170 = new BitSet(new long[]{0x0000000000000012L}); - public static final BitSet FOLLOW_ruleTracedefn_in_entryRuleTracedefn200 = new BitSet(new long[]{0x0000000000000000L}); - public static final BitSet FOLLOW_EOF_in_entryRuleTracedefn207 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Tracedefn__Group__0_in_ruleTracedefn233 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ruleModule_in_entryRuleModule260 = new BitSet(new long[]{0x0000000000000000L}); - public static final BitSet FOLLOW_EOF_in_entryRuleModule267 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Module__Group__0_in_ruleModule293 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ruleRoledefn_in_entryRuleRoledefn320 = new BitSet(new long[]{0x0000000000000000L}); - public static final BitSet FOLLOW_EOF_in_entryRuleRoledefn327 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Roledefn__Group__0_in_ruleRoledefn353 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ruleStepdefn_in_entryRuleStepdefn380 = new BitSet(new long[]{0x0000000000000000L}); - public static final BitSet FOLLOW_EOF_in_entryRuleStepdefn387 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ruleMessagetransfer_in_ruleStepdefn413 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ruleMessagetransfer_in_entryRuleMessagetransfer439 = new BitSet(new long[]{0x0000000000000000L}); - public static final BitSet FOLLOW_EOF_in_entryRuleMessagetransfer446 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Messagetransfer__Group__0_in_ruleMessagetransfer472 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ruleParameter_in_entryRuleParameter499 = new BitSet(new long[]{0x0000000000000000L}); - public static final BitSet FOLLOW_EOF_in_entryRuleParameter506 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Parameter__Group__0_in_ruleParameter532 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Trace__Group__0__Impl_in_rule__Trace__Group__0566 = new BitSet(new long[]{0x0000000000000800L}); - public static final BitSet FOLLOW_rule__Trace__Group__1_in_rule__Trace__Group__0569 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Trace__Group__1__Impl_in_rule__Trace__Group__1627 = new BitSet(new long[]{0x0000000000010010L}); - public static final BitSet FOLLOW_rule__Trace__Group__2_in_rule__Trace__Group__1630 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ruleTracedefn_in_rule__Trace__Group__1__Impl657 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Trace__Group__2__Impl_in_rule__Trace__Group__2686 = new BitSet(new long[]{0x0000000000010010L}); - public static final BitSet FOLLOW_rule__Trace__Group__3_in_rule__Trace__Group__2689 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Trace__RolesAssignment_2_in_rule__Trace__Group__2__Impl716 = new BitSet(new long[]{0x0000000000010002L}); - public static final BitSet FOLLOW_rule__Trace__Group__3__Impl_in_rule__Trace__Group__3747 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Trace__StepsAssignment_3_in_rule__Trace__Group__3__Impl774 = new BitSet(new long[]{0x0000000000000012L}); - public static final BitSet FOLLOW_rule__Tracedefn__Group__0__Impl_in_rule__Tracedefn__Group__0813 = new BitSet(new long[]{0x0000000000000010L}); - public static final BitSet FOLLOW_rule__Tracedefn__Group__1_in_rule__Tracedefn__Group__0816 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_11_in_rule__Tracedefn__Group__0__Impl844 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Tracedefn__Group__1__Impl_in_rule__Tracedefn__Group__1875 = new BitSet(new long[]{0x0000000000003000L}); - public static final BitSet FOLLOW_rule__Tracedefn__Group__2_in_rule__Tracedefn__Group__1878 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_RULE_ID_in_rule__Tracedefn__Group__1__Impl905 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Tracedefn__Group__2__Impl_in_rule__Tracedefn__Group__2934 = new BitSet(new long[]{0x0000000000003000L}); - public static final BitSet FOLLOW_rule__Tracedefn__Group__3_in_rule__Tracedefn__Group__2937 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Tracedefn__Group_2__0_in_rule__Tracedefn__Group__2__Impl964 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Tracedefn__Group__3__Impl_in_rule__Tracedefn__Group__3995 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_12_in_rule__Tracedefn__Group__3__Impl1023 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Tracedefn__Group_2__0__Impl_in_rule__Tracedefn__Group_2__01062 = new BitSet(new long[]{0x0000000000000010L}); - public static final BitSet FOLLOW_rule__Tracedefn__Group_2__1_in_rule__Tracedefn__Group_2__01065 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_13_in_rule__Tracedefn__Group_2__0__Impl1093 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Tracedefn__Group_2__1__Impl_in_rule__Tracedefn__Group_2__11124 = new BitSet(new long[]{0x0000000000004000L}); - public static final BitSet FOLLOW_rule__Tracedefn__Group_2__2_in_rule__Tracedefn__Group_2__11127 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ruleSentence_in_rule__Tracedefn__Group_2__1__Impl1154 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Tracedefn__Group_2__2__Impl_in_rule__Tracedefn__Group_2__21183 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Tracedefn__Group_2_2__0_in_rule__Tracedefn__Group_2__2__Impl1210 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Tracedefn__Group_2_2__0__Impl_in_rule__Tracedefn__Group_2_2__01247 = new BitSet(new long[]{0x0000000000000010L}); - public static final BitSet FOLLOW_rule__Tracedefn__Group_2_2__1_in_rule__Tracedefn__Group_2_2__01250 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_14_in_rule__Tracedefn__Group_2_2__0__Impl1278 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Tracedefn__Group_2_2__1__Impl_in_rule__Tracedefn__Group_2_2__11309 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ruleSentence_in_rule__Tracedefn__Group_2_2__1__Impl1336 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Module__Group__0__Impl_in_rule__Module__Group__01369 = new BitSet(new long[]{0x0000000000008000L}); - public static final BitSet FOLLOW_rule__Module__Group__1_in_rule__Module__Group__01372 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_RULE_ID_in_rule__Module__Group__0__Impl1399 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Module__Group__1__Impl_in_rule__Module__Group__11428 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Module__Group_1__0_in_rule__Module__Group__1__Impl1455 = new BitSet(new long[]{0x0000000000008002L}); - public static final BitSet FOLLOW_rule__Module__Group_1__0__Impl_in_rule__Module__Group_1__01490 = new BitSet(new long[]{0x0000000000000010L}); - public static final BitSet FOLLOW_rule__Module__Group_1__1_in_rule__Module__Group_1__01493 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_15_in_rule__Module__Group_1__0__Impl1521 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Module__Group_1__1__Impl_in_rule__Module__Group_1__11552 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_RULE_ID_in_rule__Module__Group_1__1__Impl1579 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Roledefn__Group__0__Impl_in_rule__Roledefn__Group__01612 = new BitSet(new long[]{0x0000000000000010L}); - public static final BitSet FOLLOW_rule__Roledefn__Group__1_in_rule__Roledefn__Group__01615 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_16_in_rule__Roledefn__Group__0__Impl1643 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Roledefn__Group__1__Impl_in_rule__Roledefn__Group__11674 = new BitSet(new long[]{0x0000000000021000L}); - public static final BitSet FOLLOW_rule__Roledefn__Group__2_in_rule__Roledefn__Group__11677 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_RULE_ID_in_rule__Roledefn__Group__1__Impl1704 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Roledefn__Group__2__Impl_in_rule__Roledefn__Group__21733 = new BitSet(new long[]{0x0000000000021000L}); - public static final BitSet FOLLOW_rule__Roledefn__Group__3_in_rule__Roledefn__Group__21736 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Roledefn__Group_2__0_in_rule__Roledefn__Group__2__Impl1763 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Roledefn__Group__3__Impl_in_rule__Roledefn__Group__31794 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_12_in_rule__Roledefn__Group__3__Impl1822 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Roledefn__Group_2__0__Impl_in_rule__Roledefn__Group_2__01861 = new BitSet(new long[]{0x0000000000000010L}); - public static final BitSet FOLLOW_rule__Roledefn__Group_2__1_in_rule__Roledefn__Group_2__01864 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_17_in_rule__Roledefn__Group_2__0__Impl1892 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Roledefn__Group_2__1__Impl_in_rule__Roledefn__Group_2__11923 = new BitSet(new long[]{0x0000000000040000L}); - public static final BitSet FOLLOW_rule__Roledefn__Group_2__2_in_rule__Roledefn__Group_2__11926 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ruleModule_in_rule__Roledefn__Group_2__1__Impl1953 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Roledefn__Group_2__2__Impl_in_rule__Roledefn__Group_2__21982 = new BitSet(new long[]{0x0000000000000010L}); - public static final BitSet FOLLOW_rule__Roledefn__Group_2__3_in_rule__Roledefn__Group_2__21985 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_18_in_rule__Roledefn__Group_2__2__Impl2013 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Roledefn__Group_2__3__Impl_in_rule__Roledefn__Group_2__32044 = new BitSet(new long[]{0x0000000000080000L}); - public static final BitSet FOLLOW_rule__Roledefn__Group_2__4_in_rule__Roledefn__Group_2__32047 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_RULE_ID_in_rule__Roledefn__Group_2__3__Impl2074 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Roledefn__Group_2__4__Impl_in_rule__Roledefn__Group_2__42103 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Roledefn__Group_2_4__0_in_rule__Roledefn__Group_2__4__Impl2130 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Roledefn__Group_2_4__0__Impl_in_rule__Roledefn__Group_2_4__02171 = new BitSet(new long[]{0x0000000000000010L}); - public static final BitSet FOLLOW_rule__Roledefn__Group_2_4__1_in_rule__Roledefn__Group_2_4__02174 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_19_in_rule__Roledefn__Group_2_4__0__Impl2202 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Roledefn__Group_2_4__1__Impl_in_rule__Roledefn__Group_2_4__12233 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_RULE_ID_in_rule__Roledefn__Group_2_4__1__Impl2260 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Messagetransfer__Group__0__Impl_in_rule__Messagetransfer__Group__02293 = new BitSet(new long[]{0x0000000000000010L}); - public static final BitSet FOLLOW_rule__Messagetransfer__Group__1_in_rule__Messagetransfer__Group__02296 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Messagetransfer__Group__1__Impl_in_rule__Messagetransfer__Group__12354 = new BitSet(new long[]{0x0000000000500000L}); - public static final BitSet FOLLOW_rule__Messagetransfer__Group__2_in_rule__Messagetransfer__Group__12357 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_RULE_ID_in_rule__Messagetransfer__Group__1__Impl2384 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Messagetransfer__Group__2__Impl_in_rule__Messagetransfer__Group__22413 = new BitSet(new long[]{0x0000000000500000L}); - public static final BitSet FOLLOW_rule__Messagetransfer__Group__3_in_rule__Messagetransfer__Group__22416 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Messagetransfer__Group_2__0_in_rule__Messagetransfer__Group__2__Impl2443 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Messagetransfer__Group__3__Impl_in_rule__Messagetransfer__Group__32474 = new BitSet(new long[]{0x0000000000000010L}); - public static final BitSet FOLLOW_rule__Messagetransfer__Group__4_in_rule__Messagetransfer__Group__32477 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_20_in_rule__Messagetransfer__Group__3__Impl2505 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Messagetransfer__Group__4__Impl_in_rule__Messagetransfer__Group__42536 = new BitSet(new long[]{0x0000000000200000L}); - public static final BitSet FOLLOW_rule__Messagetransfer__Group__5_in_rule__Messagetransfer__Group__42539 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_RULE_ID_in_rule__Messagetransfer__Group__4__Impl2566 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Messagetransfer__Group__5__Impl_in_rule__Messagetransfer__Group__52595 = new BitSet(new long[]{0x0000000000000010L}); - public static final BitSet FOLLOW_rule__Messagetransfer__Group__6_in_rule__Messagetransfer__Group__52598 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_21_in_rule__Messagetransfer__Group__5__Impl2626 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Messagetransfer__Group__6__Impl_in_rule__Messagetransfer__Group__62657 = new BitSet(new long[]{0x0000000001001000L}); - public static final BitSet FOLLOW_rule__Messagetransfer__Group__7_in_rule__Messagetransfer__Group__62660 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_RULE_ID_in_rule__Messagetransfer__Group__6__Impl2687 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Messagetransfer__Group__7__Impl_in_rule__Messagetransfer__Group__72716 = new BitSet(new long[]{0x0000000001001000L}); - public static final BitSet FOLLOW_rule__Messagetransfer__Group__8_in_rule__Messagetransfer__Group__72719 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Messagetransfer__Group_7__0_in_rule__Messagetransfer__Group__7__Impl2746 = new BitSet(new long[]{0x0000000001000002L}); - public static final BitSet FOLLOW_rule__Messagetransfer__Group__8__Impl_in_rule__Messagetransfer__Group__82777 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_12_in_rule__Messagetransfer__Group__8__Impl2805 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Messagetransfer__Group_2__0__Impl_in_rule__Messagetransfer__Group_2__02854 = new BitSet(new long[]{0x0000000000800020L}); - public static final BitSet FOLLOW_rule__Messagetransfer__Group_2__1_in_rule__Messagetransfer__Group_2__02857 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_22_in_rule__Messagetransfer__Group_2__0__Impl2885 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Messagetransfer__Group_2__1__Impl_in_rule__Messagetransfer__Group_2__12916 = new BitSet(new long[]{0x0000000000800020L}); - public static final BitSet FOLLOW_rule__Messagetransfer__Group_2__2_in_rule__Messagetransfer__Group_2__12919 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Messagetransfer__Group_2_1__0_in_rule__Messagetransfer__Group_2__1__Impl2946 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Messagetransfer__Group_2__2__Impl_in_rule__Messagetransfer__Group_2__22977 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_23_in_rule__Messagetransfer__Group_2__2__Impl3005 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Messagetransfer__Group_2_1__0__Impl_in_rule__Messagetransfer__Group_2_1__03042 = new BitSet(new long[]{0x0000000001000000L}); - public static final BitSet FOLLOW_rule__Messagetransfer__Group_2_1__1_in_rule__Messagetransfer__Group_2_1__03045 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Messagetransfer__ParametersAssignment_2_1_0_in_rule__Messagetransfer__Group_2_1__0__Impl3072 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Messagetransfer__Group_2_1__1__Impl_in_rule__Messagetransfer__Group_2_1__13102 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Messagetransfer__Group_2_1_1__0_in_rule__Messagetransfer__Group_2_1__1__Impl3129 = new BitSet(new long[]{0x0000000001000002L}); - public static final BitSet FOLLOW_rule__Messagetransfer__Group_2_1_1__0__Impl_in_rule__Messagetransfer__Group_2_1_1__03164 = new BitSet(new long[]{0x0000000000000020L}); - public static final BitSet FOLLOW_rule__Messagetransfer__Group_2_1_1__1_in_rule__Messagetransfer__Group_2_1_1__03167 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_24_in_rule__Messagetransfer__Group_2_1_1__0__Impl3195 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Messagetransfer__Group_2_1_1__1__Impl_in_rule__Messagetransfer__Group_2_1_1__13226 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Messagetransfer__ParametersAssignment_2_1_1_1_in_rule__Messagetransfer__Group_2_1_1__1__Impl3253 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Messagetransfer__Group_7__0__Impl_in_rule__Messagetransfer__Group_7__03287 = new BitSet(new long[]{0x0000000000000010L}); - public static final BitSet FOLLOW_rule__Messagetransfer__Group_7__1_in_rule__Messagetransfer__Group_7__03290 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_24_in_rule__Messagetransfer__Group_7__0__Impl3318 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Messagetransfer__Group_7__1__Impl_in_rule__Messagetransfer__Group_7__13349 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_RULE_ID_in_rule__Messagetransfer__Group_7__1__Impl3376 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Parameter__Group__0__Impl_in_rule__Parameter__Group__03409 = new BitSet(new long[]{0x0000000002000000L}); - public static final BitSet FOLLOW_rule__Parameter__Group__1_in_rule__Parameter__Group__03412 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Parameter__TypeAssignment_0_in_rule__Parameter__Group__0__Impl3439 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Parameter__Group__1__Impl_in_rule__Parameter__Group__13469 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Parameter__Group_1__0_in_rule__Parameter__Group__1__Impl3496 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Parameter__Group_1__0__Impl_in_rule__Parameter__Group_1__03531 = new BitSet(new long[]{0x0000000000000020L}); - public static final BitSet FOLLOW_rule__Parameter__Group_1__1_in_rule__Parameter__Group_1__03534 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_25_in_rule__Parameter__Group_1__0__Impl3562 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Parameter__Group_1__1__Impl_in_rule__Parameter__Group_1__13593 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_rule__Parameter__ValueAssignment_1_1_in_rule__Parameter__Group_1__1__Impl3620 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ruleRoledefn_in_rule__Trace__RolesAssignment_23659 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ruleStepdefn_in_rule__Trace__StepsAssignment_33690 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ruleParameter_in_rule__Messagetransfer__ParametersAssignment_2_1_03721 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ruleParameter_in_rule__Messagetransfer__ParametersAssignment_2_1_1_13752 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_RULE_STRING_in_rule__Parameter__TypeAssignment_03783 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_RULE_STRING_in_rule__Parameter__ValueAssignment_1_13814 = new BitSet(new long[]{0x0000000000000002L}); - -} \ No newline at end of file diff --git a/tools/eclipse/plugins/org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/internal/ScribbleTraceDslActivator.java b/tools/eclipse/plugins/org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/internal/ScribbleTraceDslActivator.java deleted file mode 100644 index 7528c8f20..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor.ui/src-gen/org/scribble/trace/editor/dsl/ui/internal/ScribbleTraceDslActivator.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * generated by Xtext - */ -package org.scribble.trace.editor.dsl.ui.internal; - -import java.util.Collections; -import java.util.Map; - -import org.apache.log4j.Logger; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.eclipse.xtext.ui.shared.SharedStateModule; -import org.eclipse.xtext.util.Modules2; -import org.osgi.framework.BundleContext; - -import com.google.common.collect.Maps; -import com.google.inject.Guice; -import com.google.inject.Injector; -import com.google.inject.Module; - -/** - * This class was generated. Customizations should only happen in a newly - * introduced subclass. - */ -public class ScribbleTraceDslActivator extends AbstractUIPlugin { - - public static final String ORG_SCRIBBLE_TRACE_EDITOR_DSL_SCRIBBLETRACEDSL = "org.scribble.trace.editor.dsl.ScribbleTraceDsl"; - - private static final Logger logger = Logger.getLogger(ScribbleTraceDslActivator.class); - - private static ScribbleTraceDslActivator INSTANCE; - - private Map injectors = Collections.synchronizedMap(Maps. newHashMapWithExpectedSize(1)); - - @Override - public void start(BundleContext context) throws Exception { - super.start(context); - INSTANCE = this; - } - - @Override - public void stop(BundleContext context) throws Exception { - injectors.clear(); - INSTANCE = null; - super.stop(context); - } - - public static ScribbleTraceDslActivator getInstance() { - return INSTANCE; - } - - public Injector getInjector(String language) { - synchronized (injectors) { - Injector injector = injectors.get(language); - if (injector == null) { - injectors.put(language, injector = createInjector(language)); - } - return injector; - } - } - - protected Injector createInjector(String language) { - try { - Module runtimeModule = getRuntimeModule(language); - Module sharedStateModule = getSharedStateModule(); - Module uiModule = getUiModule(language); - Module mergedModule = Modules2.mixin(runtimeModule, sharedStateModule, uiModule); - return Guice.createInjector(mergedModule); - } catch (Exception e) { - logger.error("Failed to create injector for " + language); - logger.error(e.getMessage(), e); - throw new RuntimeException("Failed to create injector for " + language, e); - } - } - - protected Module getRuntimeModule(String grammar) { - if (ORG_SCRIBBLE_TRACE_EDITOR_DSL_SCRIBBLETRACEDSL.equals(grammar)) { - return new org.scribble.trace.editor.dsl.ScribbleTraceDslRuntimeModule(); - } - - throw new IllegalArgumentException(grammar); - } - - protected Module getUiModule(String grammar) { - if (ORG_SCRIBBLE_TRACE_EDITOR_DSL_SCRIBBLETRACEDSL.equals(grammar)) { - return new org.scribble.trace.editor.dsl.ui.ScribbleTraceDslUiModule(this); - } - - throw new IllegalArgumentException(grammar); - } - - protected Module getSharedStateModule() { - return new SharedStateModule(); - } - -} diff --git a/tools/eclipse/plugins/org.scribble.trace.editor.ui/src/org/scribble/trace/editor/dsl/ui/ScribbleTraceDslUiModule.java b/tools/eclipse/plugins/org.scribble.trace.editor.ui/src/org/scribble/trace/editor/dsl/ui/ScribbleTraceDslUiModule.java deleted file mode 100644 index f510cec22..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor.ui/src/org/scribble/trace/editor/dsl/ui/ScribbleTraceDslUiModule.java +++ /dev/null @@ -1,15 +0,0 @@ -/* - * generated by Xtext - */ -package org.scribble.trace.editor.dsl.ui; - -import org.eclipse.ui.plugin.AbstractUIPlugin; - -/** - * Use this class to register components to be used within the IDE. - */ -public class ScribbleTraceDslUiModule extends org.scribble.trace.editor.dsl.ui.AbstractScribbleTraceDslUiModule { - public ScribbleTraceDslUiModule(AbstractUIPlugin plugin) { - super(plugin); - } -} diff --git a/tools/eclipse/plugins/org.scribble.trace.editor.ui/src/org/scribble/trace/editor/dsl/ui/contentassist/ScribbleTraceDslProposalProvider.xtend b/tools/eclipse/plugins/org.scribble.trace.editor.ui/src/org/scribble/trace/editor/dsl/ui/contentassist/ScribbleTraceDslProposalProvider.xtend deleted file mode 100644 index 5ef2be8c3..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor.ui/src/org/scribble/trace/editor/dsl/ui/contentassist/ScribbleTraceDslProposalProvider.xtend +++ /dev/null @@ -1,12 +0,0 @@ -/* - * generated by Xtext - */ -package org.scribble.trace.editor.dsl.ui.contentassist - -import org.scribble.trace.editor.dsl.ui.contentassist.AbstractScribbleTraceDslProposalProvider - -/** - * see http://www.eclipse.org/Xtext/documentation.html#contentAssist on how to customize content assistant - */ -class ScribbleTraceDslProposalProvider extends AbstractScribbleTraceDslProposalProvider { -} diff --git a/tools/eclipse/plugins/org.scribble.trace.editor.ui/src/org/scribble/trace/editor/dsl/ui/labeling/ScribbleTraceDslDescriptionLabelProvider.xtend b/tools/eclipse/plugins/org.scribble.trace.editor.ui/src/org/scribble/trace/editor/dsl/ui/labeling/ScribbleTraceDslDescriptionLabelProvider.xtend deleted file mode 100644 index 02bcba957..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor.ui/src/org/scribble/trace/editor/dsl/ui/labeling/ScribbleTraceDslDescriptionLabelProvider.xtend +++ /dev/null @@ -1,24 +0,0 @@ -/* -* generated by Xtext -*/ -package org.scribble.trace.editor.dsl.ui.labeling - -//import org.eclipse.xtext.resource.IEObjectDescription - -/** - * Provides labels for a IEObjectDescriptions and IResourceDescriptions. - * - * see http://www.eclipse.org/Xtext/documentation.html#labelProvider - */ -class ScribbleTraceDslDescriptionLabelProvider extends org.eclipse.xtext.ui.label.DefaultDescriptionLabelProvider { - - // Labels and icons can be computed like this: - -// override text(IEObjectDescription ele) { -// ele.name.toString -// } -// -// override image(IEObjectDescription ele) { -// ele.EClass.name + '.gif' -// } -} diff --git a/tools/eclipse/plugins/org.scribble.trace.editor.ui/src/org/scribble/trace/editor/dsl/ui/labeling/ScribbleTraceDslLabelProvider.xtend b/tools/eclipse/plugins/org.scribble.trace.editor.ui/src/org/scribble/trace/editor/dsl/ui/labeling/ScribbleTraceDslLabelProvider.xtend deleted file mode 100644 index 7a56e417b..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor.ui/src/org/scribble/trace/editor/dsl/ui/labeling/ScribbleTraceDslLabelProvider.xtend +++ /dev/null @@ -1,29 +0,0 @@ -/* -* generated by Xtext -*/ -package org.scribble.trace.editor.dsl.ui.labeling - -import com.google.inject.Inject - -/** - * Provides labels for a EObjects. - * - * see http://www.eclipse.org/Xtext/documentation.html#labelProvider - */ -class ScribbleTraceDslLabelProvider extends org.eclipse.xtext.ui.label.DefaultEObjectLabelProvider { - - @Inject - new(org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider delegate) { - super(delegate); - } - - // Labels and icons can be computed like this: - -// def text(Greeting ele) { -// 'A greeting to ' + ele.name -// } -// -// def image(Greeting ele) { -// 'Greeting.gif' -// } -} diff --git a/tools/eclipse/plugins/org.scribble.trace.editor.ui/src/org/scribble/trace/editor/dsl/ui/outline/ScribbleTraceDslOutlineTreeProvider.xtend b/tools/eclipse/plugins/org.scribble.trace.editor.ui/src/org/scribble/trace/editor/dsl/ui/outline/ScribbleTraceDslOutlineTreeProvider.xtend deleted file mode 100644 index 5295aec77..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor.ui/src/org/scribble/trace/editor/dsl/ui/outline/ScribbleTraceDslOutlineTreeProvider.xtend +++ /dev/null @@ -1,13 +0,0 @@ -/* -* generated by Xtext -*/ -package org.scribble.trace.editor.dsl.ui.outline - -/** - * Customization of the default outline structure. - * - * see http://www.eclipse.org/Xtext/documentation.html#outline - */ -class ScribbleTraceDslOutlineTreeProvider extends org.eclipse.xtext.ui.editor.outline.impl.DefaultOutlineTreeProvider { - -} diff --git a/tools/eclipse/plugins/org.scribble.trace.editor.ui/src/org/scribble/trace/editor/dsl/ui/quickfix/ScribbleTraceDslQuickfixProvider.xtend b/tools/eclipse/plugins/org.scribble.trace.editor.ui/src/org/scribble/trace/editor/dsl/ui/quickfix/ScribbleTraceDslQuickfixProvider.xtend deleted file mode 100644 index 8d83eb7b1..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor.ui/src/org/scribble/trace/editor/dsl/ui/quickfix/ScribbleTraceDslQuickfixProvider.xtend +++ /dev/null @@ -1,26 +0,0 @@ -/* -* generated by Xtext -*/ -package org.scribble.trace.editor.dsl.ui.quickfix - -//import org.eclipse.xtext.ui.editor.quickfix.Fix -//import org.eclipse.xtext.ui.editor.quickfix.IssueResolutionAcceptor -//import org.eclipse.xtext.validation.Issue - -/** - * Custom quickfixes. - * - * see http://www.eclipse.org/Xtext/documentation.html#quickfixes - */ -class ScribbleTraceDslQuickfixProvider extends org.eclipse.xtext.ui.editor.quickfix.DefaultQuickfixProvider { - -// @Fix(MyDslValidator::INVALID_NAME) -// def capitalizeName(Issue issue, IssueResolutionAcceptor acceptor) { -// acceptor.accept(issue, 'Capitalize name', 'Capitalize the name.', 'upcase.png') [ -// context | -// val xtextDocument = context.xtextDocument -// val firstLetter = xtextDocument.get(issue.offset, 1) -// xtextDocument.replace(issue.offset, 1, firstLetter.toUpperCase) -// ] -// } -} diff --git a/tools/eclipse/plugins/org.scribble.trace.editor.ui/xtend-gen/org/scribble/trace/editor/dsl/ui/contentassist/.gitignore b/tools/eclipse/plugins/org.scribble.trace.editor.ui/xtend-gen/org/scribble/trace/editor/dsl/ui/contentassist/.gitignore deleted file mode 100644 index cf59eb854..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor.ui/xtend-gen/org/scribble/trace/editor/dsl/ui/contentassist/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/.ScribbleTraceDslProposalProvider.java._trace diff --git a/tools/eclipse/plugins/org.scribble.trace.editor.ui/xtend-gen/org/scribble/trace/editor/dsl/ui/contentassist/ScribbleTraceDslProposalProvider.java b/tools/eclipse/plugins/org.scribble.trace.editor.ui/xtend-gen/org/scribble/trace/editor/dsl/ui/contentassist/ScribbleTraceDslProposalProvider.java deleted file mode 100644 index 434d0deb3..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor.ui/xtend-gen/org/scribble/trace/editor/dsl/ui/contentassist/ScribbleTraceDslProposalProvider.java +++ /dev/null @@ -1,13 +0,0 @@ -/** - * generated by Xtext - */ -package org.scribble.trace.editor.dsl.ui.contentassist; - -import org.scribble.trace.editor.dsl.ui.contentassist.AbstractScribbleTraceDslProposalProvider; - -/** - * see http://www.eclipse.org/Xtext/documentation.html#contentAssist on how to customize content assistant - */ -@SuppressWarnings("all") -public class ScribbleTraceDslProposalProvider extends AbstractScribbleTraceDslProposalProvider { -} diff --git a/tools/eclipse/plugins/org.scribble.trace.editor.ui/xtend-gen/org/scribble/trace/editor/dsl/ui/labeling/.gitignore b/tools/eclipse/plugins/org.scribble.trace.editor.ui/xtend-gen/org/scribble/trace/editor/dsl/ui/labeling/.gitignore deleted file mode 100644 index 508853163..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor.ui/xtend-gen/org/scribble/trace/editor/dsl/ui/labeling/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/.ScribbleTraceDslDescriptionLabelProvider.java._trace -/.ScribbleTraceDslLabelProvider.java._trace diff --git a/tools/eclipse/plugins/org.scribble.trace.editor.ui/xtend-gen/org/scribble/trace/editor/dsl/ui/labeling/ScribbleTraceDslDescriptionLabelProvider.java b/tools/eclipse/plugins/org.scribble.trace.editor.ui/xtend-gen/org/scribble/trace/editor/dsl/ui/labeling/ScribbleTraceDslDescriptionLabelProvider.java deleted file mode 100644 index 004794204..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor.ui/xtend-gen/org/scribble/trace/editor/dsl/ui/labeling/ScribbleTraceDslDescriptionLabelProvider.java +++ /dev/null @@ -1,15 +0,0 @@ -/** - * generated by Xtext - */ -package org.scribble.trace.editor.dsl.ui.labeling; - -import org.eclipse.xtext.ui.label.DefaultDescriptionLabelProvider; - -/** - * Provides labels for a IEObjectDescriptions and IResourceDescriptions. - * - * see http://www.eclipse.org/Xtext/documentation.html#labelProvider - */ -@SuppressWarnings("all") -public class ScribbleTraceDslDescriptionLabelProvider extends DefaultDescriptionLabelProvider { -} diff --git a/tools/eclipse/plugins/org.scribble.trace.editor.ui/xtend-gen/org/scribble/trace/editor/dsl/ui/labeling/ScribbleTraceDslLabelProvider.java b/tools/eclipse/plugins/org.scribble.trace.editor.ui/xtend-gen/org/scribble/trace/editor/dsl/ui/labeling/ScribbleTraceDslLabelProvider.java deleted file mode 100644 index 8b65bb2cf..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor.ui/xtend-gen/org/scribble/trace/editor/dsl/ui/labeling/ScribbleTraceDslLabelProvider.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * generated by Xtext - */ -package org.scribble.trace.editor.dsl.ui.labeling; - -import com.google.inject.Inject; -import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; -import org.eclipse.xtext.ui.label.DefaultEObjectLabelProvider; - -/** - * Provides labels for a EObjects. - * - * see http://www.eclipse.org/Xtext/documentation.html#labelProvider - */ -@SuppressWarnings("all") -public class ScribbleTraceDslLabelProvider extends DefaultEObjectLabelProvider { - @Inject - public ScribbleTraceDslLabelProvider(final AdapterFactoryLabelProvider delegate) { - super(delegate); - } -} diff --git a/tools/eclipse/plugins/org.scribble.trace.editor.ui/xtend-gen/org/scribble/trace/editor/dsl/ui/outline/.gitignore b/tools/eclipse/plugins/org.scribble.trace.editor.ui/xtend-gen/org/scribble/trace/editor/dsl/ui/outline/.gitignore deleted file mode 100644 index 294d93576..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor.ui/xtend-gen/org/scribble/trace/editor/dsl/ui/outline/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/.ScribbleTraceDslOutlineTreeProvider.java._trace diff --git a/tools/eclipse/plugins/org.scribble.trace.editor.ui/xtend-gen/org/scribble/trace/editor/dsl/ui/outline/ScribbleTraceDslOutlineTreeProvider.java b/tools/eclipse/plugins/org.scribble.trace.editor.ui/xtend-gen/org/scribble/trace/editor/dsl/ui/outline/ScribbleTraceDslOutlineTreeProvider.java deleted file mode 100644 index 567fec61f..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor.ui/xtend-gen/org/scribble/trace/editor/dsl/ui/outline/ScribbleTraceDslOutlineTreeProvider.java +++ /dev/null @@ -1,15 +0,0 @@ -/** - * generated by Xtext - */ -package org.scribble.trace.editor.dsl.ui.outline; - -import org.eclipse.xtext.ui.editor.outline.impl.DefaultOutlineTreeProvider; - -/** - * Customization of the default outline structure. - * - * see http://www.eclipse.org/Xtext/documentation.html#outline - */ -@SuppressWarnings("all") -public class ScribbleTraceDslOutlineTreeProvider extends DefaultOutlineTreeProvider { -} diff --git a/tools/eclipse/plugins/org.scribble.trace.editor.ui/xtend-gen/org/scribble/trace/editor/dsl/ui/quickfix/.gitignore b/tools/eclipse/plugins/org.scribble.trace.editor.ui/xtend-gen/org/scribble/trace/editor/dsl/ui/quickfix/.gitignore deleted file mode 100644 index 8fbd158be..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor.ui/xtend-gen/org/scribble/trace/editor/dsl/ui/quickfix/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/.ScribbleTraceDslQuickfixProvider.java._trace diff --git a/tools/eclipse/plugins/org.scribble.trace.editor.ui/xtend-gen/org/scribble/trace/editor/dsl/ui/quickfix/ScribbleTraceDslQuickfixProvider.java b/tools/eclipse/plugins/org.scribble.trace.editor.ui/xtend-gen/org/scribble/trace/editor/dsl/ui/quickfix/ScribbleTraceDslQuickfixProvider.java deleted file mode 100644 index 30e003ca3..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor.ui/xtend-gen/org/scribble/trace/editor/dsl/ui/quickfix/ScribbleTraceDslQuickfixProvider.java +++ /dev/null @@ -1,15 +0,0 @@ -/** - * generated by Xtext - */ -package org.scribble.trace.editor.dsl.ui.quickfix; - -import org.eclipse.xtext.ui.editor.quickfix.DefaultQuickfixProvider; - -/** - * Custom quickfixes. - * - * see http://www.eclipse.org/Xtext/documentation.html#quickfixes - */ -@SuppressWarnings("all") -public class ScribbleTraceDslQuickfixProvider extends DefaultQuickfixProvider { -} diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/.launch/Generate Language Infrastructure (org.scribble.trace.editor).launch b/tools/eclipse/plugins/org.scribble.trace.editor/.launch/Generate Language Infrastructure (org.scribble.trace.editor).launch deleted file mode 100644 index cab077acd..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/.launch/Generate Language Infrastructure (org.scribble.trace.editor).launch +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/META-INF/MANIFEST.MF b/tools/eclipse/plugins/org.scribble.trace.editor/META-INF/MANIFEST.MF deleted file mode 100644 index 66cffadf0..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/META-INF/MANIFEST.MF +++ /dev/null @@ -1,36 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: org.scribble.trace.editor -Bundle-Vendor: Scribble.org -Bundle-Version: 0.3.2.qualifier -Bundle-SymbolicName: org.scribble.trace.editor; singleton:=true -Bundle-ActivationPolicy: lazy -Require-Bundle: org.eclipse.xtext;visibility:=reexport, - org.eclipse.xtext.xbase;resolution:=optional;visibility:=reexport, - org.eclipse.xtext.generator;resolution:=optional, - org.apache.commons.logging;bundle-version="1.0.4";resolution:=optional, - org.eclipse.emf.codegen.ecore;resolution:=optional, - org.eclipse.emf.mwe.utils;resolution:=optional, - org.eclipse.emf.mwe2.launch;resolution:=optional, - org.eclipse.xtext.util, - org.eclipse.emf.ecore, - org.eclipse.emf.common, - org.eclipse.xtext.xbase.lib, - org.antlr.runtime, - org.eclipse.xtext.common.types, - org.objectweb.asm;bundle-version="[5.0.1,6.0.0)";resolution:=optional -Import-Package: org.apache.log4j -Bundle-RequiredExecutionEnvironment: JavaSE-1.7 -Export-Package: org.scribble.trace.editor.dsl, - org.scribble.trace.editor.dsl.services, - org.scribble.trace.editor.dsl.scribbleTraceDsl, - org.scribble.trace.editor.dsl.scribbleTraceDsl.impl, - org.scribble.trace.editor.dsl.scribbleTraceDsl.util, - org.scribble.trace.editor.dsl.serializer, - org.scribble.trace.editor.dsl.parser.antlr, - org.scribble.trace.editor.dsl.parser.antlr.internal, - org.scribble.trace.editor.dsl.validation, - org.scribble.trace.editor.dsl.scoping, - org.scribble.trace.editor.dsl.generator, - org.scribble.trace.editor.dsl.formatting - diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/build.properties b/tools/eclipse/plugins/org.scribble.trace.editor/build.properties deleted file mode 100644 index 9b82d81de..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/build.properties +++ /dev/null @@ -1,7 +0,0 @@ -source.. = src/,\ - src-gen/,\ - xtend-gen/ -bin.includes = model/,\ - META-INF/,\ - .,\ - plugin.xml \ No newline at end of file diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/model/generated/ScribbleTraceDsl.ecore b/tools/eclipse/plugins/org.scribble.trace.editor/model/generated/ScribbleTraceDsl.ecore deleted file mode 100644 index a927e91dd..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/model/generated/ScribbleTraceDsl.ecore +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/model/generated/ScribbleTraceDsl.genmodel b/tools/eclipse/plugins/org.scribble.trace.editor/model/generated/ScribbleTraceDsl.genmodel deleted file mode 100644 index 49d2ac12f..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/model/generated/ScribbleTraceDsl.genmodel +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/plugin.xml b/tools/eclipse/plugins/org.scribble.trace.editor/plugin.xml deleted file mode 100644 index 0094c5db0..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/plugin.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/plugin.xml_gen b/tools/eclipse/plugins/org.scribble.trace.editor/plugin.xml_gen deleted file mode 100644 index 0094c5db0..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/plugin.xml_gen +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/pom.xml b/tools/eclipse/plugins/org.scribble.trace.editor/pom.xml deleted file mode 100644 index 252a8d6ae..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/pom.xml +++ /dev/null @@ -1,17 +0,0 @@ - - 4.0.0 - org.scribble.tools.eclipse.plugins - org.scribble.trace.editor - 0.3.2-SNAPSHOT - eclipse-plugin - Scribble::Tools::Eclipse::Plugins::Trace Editor - - - org.scribble.tools.eclipse - plugins - 0.3.2-SNAPSHOT - - - - diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/AbstractScribbleTraceDslRuntimeModule.java b/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/AbstractScribbleTraceDslRuntimeModule.java deleted file mode 100644 index 66b8fe23f..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/AbstractScribbleTraceDslRuntimeModule.java +++ /dev/null @@ -1,172 +0,0 @@ -/* - * generated by Xtext - */ -package org.scribble.trace.editor.dsl; - -import java.util.Properties; - -import org.eclipse.xtext.Constants; -import org.eclipse.xtext.service.DefaultRuntimeModule; - -import com.google.inject.Binder; -import com.google.inject.name.Names; - -/** - * Manual modifications go to {org.scribble.trace.editor.dsl.ScribbleTraceDslRuntimeModule} - */ - @SuppressWarnings("all") -public abstract class AbstractScribbleTraceDslRuntimeModule extends DefaultRuntimeModule { - - protected Properties properties = null; - - @Override - public void configure(Binder binder) { - properties = tryBindProperties(binder, "org/scribble/trace/editor/dsl/ScribbleTraceDsl.properties"); - super.configure(binder); - } - - public void configureLanguageName(Binder binder) { - binder.bind(String.class).annotatedWith(Names.named(Constants.LANGUAGE_NAME)).toInstance("org.scribble.trace.editor.dsl.ScribbleTraceDsl"); - } - - public void configureFileExtensions(Binder binder) { - if (properties == null || properties.getProperty(Constants.FILE_EXTENSIONS) == null) - binder.bind(String.class).annotatedWith(Names.named(Constants.FILE_EXTENSIONS)).toInstance("trace"); - } - - // contributed by org.eclipse.xtext.generator.grammarAccess.GrammarAccessFragment - public Class bindIGrammarAccess() { - return org.scribble.trace.editor.dsl.services.ScribbleTraceDslGrammarAccess.class; - } - - // contributed by org.eclipse.xtext.generator.serializer.SerializerFragment - public Class bindISemanticSequencer() { - return org.scribble.trace.editor.dsl.serializer.ScribbleTraceDslSemanticSequencer.class; - } - - // contributed by org.eclipse.xtext.generator.serializer.SerializerFragment - public Class bindISyntacticSequencer() { - return org.scribble.trace.editor.dsl.serializer.ScribbleTraceDslSyntacticSequencer.class; - } - - // contributed by org.eclipse.xtext.generator.serializer.SerializerFragment - public Class bindISerializer() { - return org.eclipse.xtext.serializer.impl.Serializer.class; - } - - // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment - public Class bindIParser() { - return org.scribble.trace.editor.dsl.parser.antlr.ScribbleTraceDslParser.class; - } - - // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment - public Class bindITokenToStringConverter() { - return org.eclipse.xtext.parser.antlr.AntlrTokenToStringConverter.class; - } - - // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment - public Class bindIAntlrTokenFileProvider() { - return org.scribble.trace.editor.dsl.parser.antlr.ScribbleTraceDslAntlrTokenFileProvider.class; - } - - // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment - public Class bindLexer() { - return org.scribble.trace.editor.dsl.parser.antlr.internal.InternalScribbleTraceDslLexer.class; - } - - // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment - public com.google.inject.Provider provideInternalScribbleTraceDslLexer() { - return org.eclipse.xtext.parser.antlr.LexerProvider.create(org.scribble.trace.editor.dsl.parser.antlr.internal.InternalScribbleTraceDslLexer.class); - } - - // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment - public void configureRuntimeLexer(com.google.inject.Binder binder) { - binder.bind(org.eclipse.xtext.parser.antlr.Lexer.class).annotatedWith(com.google.inject.name.Names.named(org.eclipse.xtext.parser.antlr.LexerBindings.RUNTIME)).to(org.scribble.trace.editor.dsl.parser.antlr.internal.InternalScribbleTraceDslLexer.class); - } - - // contributed by org.eclipse.xtext.generator.parser.antlr.XtextAntlrGeneratorFragment - public Class bindITokenDefProvider() { - return org.eclipse.xtext.parser.antlr.AntlrTokenDefProvider.class; - } - - // contributed by org.eclipse.xtext.generator.validation.ValidatorFragment - @org.eclipse.xtext.service.SingletonBinding(eager=true) public Class bindScribbleTraceDslValidator() { - return org.scribble.trace.editor.dsl.validation.ScribbleTraceDslValidator.class; - } - - // contributed by org.eclipse.xtext.generator.scoping.AbstractScopingFragment - public Class bindIScopeProvider() { - return org.scribble.trace.editor.dsl.scoping.ScribbleTraceDslScopeProvider.class; - } - - // contributed by org.eclipse.xtext.generator.scoping.AbstractScopingFragment - public void configureIScopeProviderDelegate(com.google.inject.Binder binder) { - binder.bind(org.eclipse.xtext.scoping.IScopeProvider.class).annotatedWith(com.google.inject.name.Names.named(org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider.NAMED_DELEGATE)).to(org.eclipse.xtext.scoping.impl.ImportedNamespaceAwareLocalScopeProvider.class); - } - - // contributed by org.eclipse.xtext.generator.scoping.AbstractScopingFragment - public void configureIgnoreCaseLinking(com.google.inject.Binder binder) { - binder.bindConstant().annotatedWith(org.eclipse.xtext.scoping.IgnoreCaseLinking.class).to(false); - } - - // contributed by org.eclipse.xtext.generator.exporting.QualifiedNamesFragment - public Class bindIQualifiedNameProvider() { - return org.eclipse.xtext.naming.DefaultDeclarativeQualifiedNameProvider.class; - } - - // contributed by org.eclipse.xtext.generator.builder.BuilderIntegrationFragment - public Class bindIContainer$Manager() { - return org.eclipse.xtext.resource.containers.StateBasedContainerManager.class; - } - - // contributed by org.eclipse.xtext.generator.builder.BuilderIntegrationFragment - public Class bindIAllContainersState$Provider() { - return org.eclipse.xtext.resource.containers.ResourceSetBasedAllContainersStateProvider.class; - } - - // contributed by org.eclipse.xtext.generator.builder.BuilderIntegrationFragment - public void configureIResourceDescriptions(com.google.inject.Binder binder) { - binder.bind(org.eclipse.xtext.resource.IResourceDescriptions.class).to(org.eclipse.xtext.resource.impl.ResourceSetBasedResourceDescriptions.class); - } - - // contributed by org.eclipse.xtext.generator.builder.BuilderIntegrationFragment - public void configureIResourceDescriptionsPersisted(com.google.inject.Binder binder) { - binder.bind(org.eclipse.xtext.resource.IResourceDescriptions.class).annotatedWith(com.google.inject.name.Names.named(org.eclipse.xtext.resource.impl.ResourceDescriptionsProvider.PERSISTED_DESCRIPTIONS)).to(org.eclipse.xtext.resource.impl.ResourceSetBasedResourceDescriptions.class); - } - - // contributed by org.eclipse.xtext.generator.generator.GeneratorFragment - public Class bindIGenerator() { - return org.scribble.trace.editor.dsl.generator.ScribbleTraceDslGenerator.class; - } - - // contributed by org.eclipse.xtext.generator.formatting.FormatterFragment - public Class bindIFormatter() { - return org.scribble.trace.editor.dsl.formatting.ScribbleTraceDslFormatter.class; - } - - // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment - public java.lang.ClassLoader bindClassLoaderToInstance() { - return getClass().getClassLoader(); - } - - // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment - public org.eclipse.xtext.common.types.TypesFactory bindTypesFactoryToInstance() { - return org.eclipse.xtext.common.types.TypesFactory.eINSTANCE; - } - - // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment - public Class bindIJvmTypeProvider$Factory() { - return org.eclipse.xtext.common.types.access.ClasspathTypeProviderFactory.class; - } - - // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment - public Class bindAbstractTypeScopeProvider() { - return org.eclipse.xtext.common.types.xtext.ClasspathBasedTypeScopeProvider.class; - } - - // contributed by org.eclipse.xtext.generator.types.TypesGeneratorFragment - public Class bindIGlobalScopeProvider() { - return org.eclipse.xtext.common.types.xtext.TypesAwareDefaultGlobalScopeProvider.class; - } - -} diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/ScribbleTraceDsl.xtextbin b/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/ScribbleTraceDsl.xtextbin deleted file mode 100644 index 521a5cca5..000000000 Binary files a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/ScribbleTraceDsl.xtextbin and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/ScribbleTraceDslStandaloneSetupGenerated.java b/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/ScribbleTraceDslStandaloneSetupGenerated.java deleted file mode 100644 index 0048f4393..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/ScribbleTraceDslStandaloneSetupGenerated.java +++ /dev/null @@ -1,44 +0,0 @@ -/* -* generated by Xtext -*/ -package org.scribble.trace.editor.dsl; - -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.xtext.ISetup; -import org.eclipse.emf.ecore.resource.Resource; - -import com.google.inject.Guice; -import com.google.inject.Injector; - -/** - * Generated from StandaloneSetup.xpt! - */ -@SuppressWarnings("all") -public class ScribbleTraceDslStandaloneSetupGenerated implements ISetup { - - public Injector createInjectorAndDoEMFRegistration() { - org.eclipse.xtext.common.TerminalsStandaloneSetup.doSetup(); - - Injector injector = createInjector(); - register(injector); - return injector; - } - - public Injector createInjector() { - return Guice.createInjector(new org.scribble.trace.editor.dsl.ScribbleTraceDslRuntimeModule()); - } - - public void register(Injector injector) { - if (!EPackage.Registry.INSTANCE.containsKey("http://www.scribble.org/trace/editor/dsl/ScribbleTraceDsl")) { - EPackage.Registry.INSTANCE.put("http://www.scribble.org/trace/editor/dsl/ScribbleTraceDsl", org.scribble.trace.editor.dsl.scribbleTraceDsl.ScribbleTraceDslPackage.eINSTANCE); - } - - org.eclipse.xtext.resource.IResourceFactory resourceFactory = injector.getInstance(org.eclipse.xtext.resource.IResourceFactory.class); - org.eclipse.xtext.resource.IResourceServiceProvider serviceProvider = injector.getInstance(org.eclipse.xtext.resource.IResourceServiceProvider.class); - Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("trace", resourceFactory); - org.eclipse.xtext.resource.IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("trace", serviceProvider); - - - - } -} diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/ScribbleTraceDslAntlrTokenFileProvider.java b/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/ScribbleTraceDslAntlrTokenFileProvider.java deleted file mode 100644 index 5339ee9d1..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/ScribbleTraceDslAntlrTokenFileProvider.java +++ /dev/null @@ -1,15 +0,0 @@ -/* -* generated by Xtext -*/ -package org.scribble.trace.editor.dsl.parser.antlr; - -import java.io.InputStream; -import org.eclipse.xtext.parser.antlr.IAntlrTokenFileProvider; - -public class ScribbleTraceDslAntlrTokenFileProvider implements IAntlrTokenFileProvider { - - public InputStream getAntlrTokenFile() { - ClassLoader classLoader = getClass().getClassLoader(); - return classLoader.getResourceAsStream("org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.tokens"); - } -} diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/ScribbleTraceDslParser.java b/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/ScribbleTraceDslParser.java deleted file mode 100644 index 319902ab8..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/ScribbleTraceDslParser.java +++ /dev/null @@ -1,39 +0,0 @@ -/* -* generated by Xtext -*/ -package org.scribble.trace.editor.dsl.parser.antlr; - -import com.google.inject.Inject; - -import org.eclipse.xtext.parser.antlr.XtextTokenStream; -import org.scribble.trace.editor.dsl.services.ScribbleTraceDslGrammarAccess; - -public class ScribbleTraceDslParser extends org.eclipse.xtext.parser.antlr.AbstractAntlrParser { - - @Inject - private ScribbleTraceDslGrammarAccess grammarAccess; - - @Override - protected void setInitialHiddenTokens(XtextTokenStream tokenStream) { - tokenStream.setInitialHiddenTokens("RULE_WS", "RULE_ML_COMMENT", "RULE_SL_COMMENT"); - } - - @Override - protected org.scribble.trace.editor.dsl.parser.antlr.internal.InternalScribbleTraceDslParser createParser(XtextTokenStream stream) { - return new org.scribble.trace.editor.dsl.parser.antlr.internal.InternalScribbleTraceDslParser(stream, getGrammarAccess()); - } - - @Override - protected String getDefaultRuleName() { - return "Trace"; - } - - public ScribbleTraceDslGrammarAccess getGrammarAccess() { - return this.grammarAccess; - } - - public void setGrammarAccess(ScribbleTraceDslGrammarAccess grammarAccess) { - this.grammarAccess = grammarAccess; - } - -} diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g b/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g deleted file mode 100644 index cc2e17f4a..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g +++ /dev/null @@ -1,575 +0,0 @@ -/* -* generated by Xtext -*/ -grammar InternalScribbleTraceDsl; - -options { - superClass=AbstractInternalAntlrParser; - -} - -@lexer::header { -package org.scribble.trace.editor.dsl.parser.antlr.internal; - -// Hack: Use our own Lexer superclass by means of import. -// Currently there is no other way to specify the superclass for the lexer. -import org.eclipse.xtext.parser.antlr.Lexer; -} - -@parser::header { -package org.scribble.trace.editor.dsl.parser.antlr.internal; - -import org.eclipse.xtext.*; -import org.eclipse.xtext.parser.*; -import org.eclipse.xtext.parser.impl.*; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.xtext.parser.antlr.AbstractInternalAntlrParser; -import org.eclipse.xtext.parser.antlr.XtextTokenStream; -import org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens; -import org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken; -import org.scribble.trace.editor.dsl.services.ScribbleTraceDslGrammarAccess; - -} - -@parser::members { - - private ScribbleTraceDslGrammarAccess grammarAccess; - - public InternalScribbleTraceDslParser(TokenStream input, ScribbleTraceDslGrammarAccess grammarAccess) { - this(input); - this.grammarAccess = grammarAccess; - registerRules(grammarAccess.getGrammar()); - } - - @Override - protected String getFirstRuleName() { - return "Trace"; - } - - @Override - protected ScribbleTraceDslGrammarAccess getGrammarAccess() { - return grammarAccess; - } -} - -@rulecatch { - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } -} - - - - -// Entry rule entryRuleTrace -entryRuleTrace returns [EObject current=null] - : - { newCompositeNode(grammarAccess.getTraceRule()); } - iv_ruleTrace=ruleTrace - { $current=$iv_ruleTrace.current; } - EOF -; - -// Rule Trace -ruleTrace returns [EObject current=null] - @init { enterRule(); - } - @after { leaveRule(); }: -(( - { - $current = forceCreateModelElement( - grammarAccess.getTraceAccess().getTraceAction_0(), - $current); - } -) - { - newCompositeNode(grammarAccess.getTraceAccess().getTracedefnParserRuleCall_1()); - } -ruleTracedefn - { - afterParserOrEnumRuleCall(); - } -( -( - { - newCompositeNode(grammarAccess.getTraceAccess().getRolesRoledefnParserRuleCall_2_0()); - } - lv_roles_2_0=ruleRoledefn { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getTraceRule()); - } - add( - $current, - "roles", - lv_roles_2_0, - "Roledefn"); - afterParserOrEnumRuleCall(); - } - -) -)*( -( - { - newCompositeNode(grammarAccess.getTraceAccess().getStepsStepdefnParserRuleCall_3_0()); - } - lv_steps_3_0=ruleStepdefn { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getTraceRule()); - } - add( - $current, - "steps", - lv_steps_3_0, - "Stepdefn"); - afterParserOrEnumRuleCall(); - } - -) -)*) -; - - - - - -// Entry rule entryRuleSentence -entryRuleSentence returns [String current=null] - : - { newCompositeNode(grammarAccess.getSentenceRule()); } - iv_ruleSentence=ruleSentence - { $current=$iv_ruleSentence.current.getText(); } - EOF -; - -// Rule Sentence -ruleSentence returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] - @init { enterRule(); - } - @after { leaveRule(); }: -( this_ID_0=RULE_ID { - $current.merge(this_ID_0); - } - - { - newLeafNode(this_ID_0, grammarAccess.getSentenceAccess().getIDTerminalRuleCall()); - } -)+ - ; - - - - - -// Entry rule entryRuleTracedefn -entryRuleTracedefn returns [String current=null] - : - { newCompositeNode(grammarAccess.getTracedefnRule()); } - iv_ruleTracedefn=ruleTracedefn - { $current=$iv_ruleTracedefn.current.getText(); } - EOF -; - -// Rule Tracedefn -ruleTracedefn returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] - @init { enterRule(); - } - @after { leaveRule(); }: -( - kw='trace' - { - $current.merge(kw); - newLeafNode(kw, grammarAccess.getTracedefnAccess().getTraceKeyword_0()); - } - this_ID_1=RULE_ID { - $current.merge(this_ID_1); - } - - { - newLeafNode(this_ID_1, grammarAccess.getTracedefnAccess().getIDTerminalRuleCall_1()); - } -( - kw='by' - { - $current.merge(kw); - newLeafNode(kw, grammarAccess.getTracedefnAccess().getByKeyword_2_0()); - } - - { - newCompositeNode(grammarAccess.getTracedefnAccess().getSentenceParserRuleCall_2_1()); - } - this_Sentence_3=ruleSentence { - $current.merge(this_Sentence_3); - } - - { - afterParserOrEnumRuleCall(); - } -( - kw='shows' - { - $current.merge(kw); - newLeafNode(kw, grammarAccess.getTracedefnAccess().getShowsKeyword_2_2_0()); - } - - { - newCompositeNode(grammarAccess.getTracedefnAccess().getSentenceParserRuleCall_2_2_1()); - } - this_Sentence_5=ruleSentence { - $current.merge(this_Sentence_5); - } - - { - afterParserOrEnumRuleCall(); - } -)?)? - kw=';' - { - $current.merge(kw); - newLeafNode(kw, grammarAccess.getTracedefnAccess().getSemicolonKeyword_3()); - } -) - ; - - - - - -// Entry rule entryRuleModule -entryRuleModule returns [String current=null] - : - { newCompositeNode(grammarAccess.getModuleRule()); } - iv_ruleModule=ruleModule - { $current=$iv_ruleModule.current.getText(); } - EOF -; - -// Rule Module -ruleModule returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] - @init { enterRule(); - } - @after { leaveRule(); }: -( this_ID_0=RULE_ID { - $current.merge(this_ID_0); - } - - { - newLeafNode(this_ID_0, grammarAccess.getModuleAccess().getIDTerminalRuleCall_0()); - } -( - kw='.' - { - $current.merge(kw); - newLeafNode(kw, grammarAccess.getModuleAccess().getFullStopKeyword_1_0()); - } - this_ID_2=RULE_ID { - $current.merge(this_ID_2); - } - - { - newLeafNode(this_ID_2, grammarAccess.getModuleAccess().getIDTerminalRuleCall_1_1()); - } -)*) - ; - - - - - -// Entry rule entryRuleRoledefn -entryRuleRoledefn returns [String current=null] - : - { newCompositeNode(grammarAccess.getRoledefnRule()); } - iv_ruleRoledefn=ruleRoledefn - { $current=$iv_ruleRoledefn.current.getText(); } - EOF -; - -// Rule Roledefn -ruleRoledefn returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] - @init { enterRule(); - } - @after { leaveRule(); }: -( - kw='role' - { - $current.merge(kw); - newLeafNode(kw, grammarAccess.getRoledefnAccess().getRoleKeyword_0()); - } - this_ID_1=RULE_ID { - $current.merge(this_ID_1); - } - - { - newLeafNode(this_ID_1, grammarAccess.getRoledefnAccess().getIDTerminalRuleCall_1()); - } -( - kw='simulating' - { - $current.merge(kw); - newLeafNode(kw, grammarAccess.getRoledefnAccess().getSimulatingKeyword_2_0()); - } - - { - newCompositeNode(grammarAccess.getRoledefnAccess().getModuleParserRuleCall_2_1()); - } - this_Module_3=ruleModule { - $current.merge(this_Module_3); - } - - { - afterParserOrEnumRuleCall(); - } - - kw='protocol' - { - $current.merge(kw); - newLeafNode(kw, grammarAccess.getRoledefnAccess().getProtocolKeyword_2_2()); - } - this_ID_5=RULE_ID { - $current.merge(this_ID_5); - } - - { - newLeafNode(this_ID_5, grammarAccess.getRoledefnAccess().getIDTerminalRuleCall_2_3()); - } -( - kw='as' - { - $current.merge(kw); - newLeafNode(kw, grammarAccess.getRoledefnAccess().getAsKeyword_2_4_0()); - } - this_ID_7=RULE_ID { - $current.merge(this_ID_7); - } - - { - newLeafNode(this_ID_7, grammarAccess.getRoledefnAccess().getIDTerminalRuleCall_2_4_1()); - } -)?)? - kw=';' - { - $current.merge(kw); - newLeafNode(kw, grammarAccess.getRoledefnAccess().getSemicolonKeyword_3()); - } -) - ; - - - - - -// Entry rule entryRuleStepdefn -entryRuleStepdefn returns [EObject current=null] - : - { newCompositeNode(grammarAccess.getStepdefnRule()); } - iv_ruleStepdefn=ruleStepdefn - { $current=$iv_ruleStepdefn.current; } - EOF -; - -// Rule Stepdefn -ruleStepdefn returns [EObject current=null] - @init { enterRule(); - } - @after { leaveRule(); }: - - { - newCompositeNode(grammarAccess.getStepdefnAccess().getMessagetransferParserRuleCall()); - } - this_Messagetransfer_0=ruleMessagetransfer - { - $current = $this_Messagetransfer_0.current; - afterParserOrEnumRuleCall(); - } - -; - - - - - -// Entry rule entryRuleMessagetransfer -entryRuleMessagetransfer returns [EObject current=null] - : - { newCompositeNode(grammarAccess.getMessagetransferRule()); } - iv_ruleMessagetransfer=ruleMessagetransfer - { $current=$iv_ruleMessagetransfer.current; } - EOF -; - -// Rule Messagetransfer -ruleMessagetransfer returns [EObject current=null] - @init { enterRule(); - } - @after { leaveRule(); }: -(( - { - $current = forceCreateModelElement( - grammarAccess.getMessagetransferAccess().getMessagetransferAction_0(), - $current); - } -)this_ID_1=RULE_ID - { - newLeafNode(this_ID_1, grammarAccess.getMessagetransferAccess().getIDTerminalRuleCall_1()); - } -( otherlv_2='(' - { - newLeafNode(otherlv_2, grammarAccess.getMessagetransferAccess().getLeftParenthesisKeyword_2_0()); - } -(( -( - { - newCompositeNode(grammarAccess.getMessagetransferAccess().getParametersParameterParserRuleCall_2_1_0_0()); - } - lv_parameters_3_0=ruleParameter { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getMessagetransferRule()); - } - add( - $current, - "parameters", - lv_parameters_3_0, - "Parameter"); - afterParserOrEnumRuleCall(); - } - -) -)( otherlv_4=',' - { - newLeafNode(otherlv_4, grammarAccess.getMessagetransferAccess().getCommaKeyword_2_1_1_0()); - } -( -( - { - newCompositeNode(grammarAccess.getMessagetransferAccess().getParametersParameterParserRuleCall_2_1_1_1_0()); - } - lv_parameters_5_0=ruleParameter { - if ($current==null) { - $current = createModelElementForParent(grammarAccess.getMessagetransferRule()); - } - add( - $current, - "parameters", - lv_parameters_5_0, - "Parameter"); - afterParserOrEnumRuleCall(); - } - -) -))*)? otherlv_6=')' - { - newLeafNode(otherlv_6, grammarAccess.getMessagetransferAccess().getRightParenthesisKeyword_2_2()); - } -)? otherlv_7='from' - { - newLeafNode(otherlv_7, grammarAccess.getMessagetransferAccess().getFromKeyword_3()); - } -this_ID_8=RULE_ID - { - newLeafNode(this_ID_8, grammarAccess.getMessagetransferAccess().getIDTerminalRuleCall_4()); - } - otherlv_9='to' - { - newLeafNode(otherlv_9, grammarAccess.getMessagetransferAccess().getToKeyword_5()); - } -this_ID_10=RULE_ID - { - newLeafNode(this_ID_10, grammarAccess.getMessagetransferAccess().getIDTerminalRuleCall_6()); - } -( otherlv_11=',' - { - newLeafNode(otherlv_11, grammarAccess.getMessagetransferAccess().getCommaKeyword_7_0()); - } -this_ID_12=RULE_ID - { - newLeafNode(this_ID_12, grammarAccess.getMessagetransferAccess().getIDTerminalRuleCall_7_1()); - } -)* otherlv_13=';' - { - newLeafNode(otherlv_13, grammarAccess.getMessagetransferAccess().getSemicolonKeyword_8()); - } -) -; - - - - - -// Entry rule entryRuleParameter -entryRuleParameter returns [EObject current=null] - : - { newCompositeNode(grammarAccess.getParameterRule()); } - iv_ruleParameter=ruleParameter - { $current=$iv_ruleParameter.current; } - EOF -; - -// Rule Parameter -ruleParameter returns [EObject current=null] - @init { enterRule(); - } - @after { leaveRule(); }: -(( -( - lv_type_0_0=RULE_STRING - { - newLeafNode(lv_type_0_0, grammarAccess.getParameterAccess().getTypeSTRINGTerminalRuleCall_0_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getParameterRule()); - } - setWithLastConsumed( - $current, - "type", - lv_type_0_0, - "STRING"); - } - -) -)( otherlv_1='=' - { - newLeafNode(otherlv_1, grammarAccess.getParameterAccess().getEqualsSignKeyword_1_0()); - } -( -( - lv_value_2_0=RULE_STRING - { - newLeafNode(lv_value_2_0, grammarAccess.getParameterAccess().getValueSTRINGTerminalRuleCall_1_1_0()); - } - { - if ($current==null) { - $current = createModelElement(grammarAccess.getParameterRule()); - } - setWithLastConsumed( - $current, - "value", - lv_value_2_0, - "STRING"); - } - -) -))?) -; - - - - - -RULE_ID : '^'? ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*; - -RULE_INT : ('0'..'9')+; - -RULE_STRING : ('"' ('\\' .|~(('\\'|'"')))* '"'|'\'' ('\\' .|~(('\\'|'\'')))* '\''); - -RULE_ML_COMMENT : '/*' ( options {greedy=false;} : . )*'*/'; - -RULE_SL_COMMENT : '//' ~(('\n'|'\r'))* ('\r'? '\n')?; - -RULE_WS : (' '|'\t'|'\r'|'\n')+; - -RULE_ANY_OTHER : .; - - diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.tokens b/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.tokens deleted file mode 100644 index 9b0fb5ee8..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.tokens +++ /dev/null @@ -1,37 +0,0 @@ -'('=20 -')'=22 -','=21 -'.'=15 -';'=14 -'='=25 -'as'=19 -'by'=12 -'from'=23 -'protocol'=18 -'role'=16 -'shows'=13 -'simulating'=17 -'to'=24 -'trace'=11 -RULE_ANY_OTHER=10 -RULE_ID=4 -RULE_INT=6 -RULE_ML_COMMENT=7 -RULE_SL_COMMENT=8 -RULE_STRING=5 -RULE_WS=9 -T__11=11 -T__12=12 -T__13=13 -T__14=14 -T__15=15 -T__16=16 -T__17=17 -T__18=18 -T__19=19 -T__20=20 -T__21=21 -T__22=22 -T__23=23 -T__24=24 -T__25=25 diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDslLexer.java b/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDslLexer.java deleted file mode 100644 index b86f1a395..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDslLexer.java +++ /dev/null @@ -1,1229 +0,0 @@ -package org.scribble.trace.editor.dsl.parser.antlr.internal; - -// Hack: Use our own Lexer superclass by means of import. -// Currently there is no other way to specify the superclass for the lexer. -import org.eclipse.xtext.parser.antlr.Lexer; - - -import org.antlr.runtime.*; -import java.util.Stack; -import java.util.List; -import java.util.ArrayList; - -@SuppressWarnings("all") -public class InternalScribbleTraceDslLexer extends Lexer { - public static final int RULE_ID=4; - public static final int T__25=25; - public static final int T__24=24; - public static final int T__23=23; - public static final int T__22=22; - public static final int RULE_ANY_OTHER=10; - public static final int T__21=21; - public static final int T__20=20; - public static final int EOF=-1; - public static final int RULE_SL_COMMENT=8; - public static final int RULE_ML_COMMENT=7; - public static final int T__19=19; - public static final int RULE_STRING=5; - public static final int T__16=16; - public static final int T__15=15; - public static final int T__18=18; - public static final int T__17=17; - public static final int T__12=12; - public static final int T__11=11; - public static final int T__14=14; - public static final int T__13=13; - public static final int RULE_INT=6; - public static final int RULE_WS=9; - - // delegates - // delegators - - public InternalScribbleTraceDslLexer() {;} - public InternalScribbleTraceDslLexer(CharStream input) { - this(input, new RecognizerSharedState()); - } - public InternalScribbleTraceDslLexer(CharStream input, RecognizerSharedState state) { - super(input,state); - - } - public String getGrammarFileName() { return "../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g"; } - - // $ANTLR start "T__11" - public final void mT__11() throws RecognitionException { - try { - int _type = T__11; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:11:7: ( 'trace' ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:11:9: 'trace' - { - match("trace"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__11" - - // $ANTLR start "T__12" - public final void mT__12() throws RecognitionException { - try { - int _type = T__12; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:12:7: ( 'by' ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:12:9: 'by' - { - match("by"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__12" - - // $ANTLR start "T__13" - public final void mT__13() throws RecognitionException { - try { - int _type = T__13; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:13:7: ( 'shows' ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:13:9: 'shows' - { - match("shows"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__13" - - // $ANTLR start "T__14" - public final void mT__14() throws RecognitionException { - try { - int _type = T__14; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:14:7: ( ';' ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:14:9: ';' - { - match(';'); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__14" - - // $ANTLR start "T__15" - public final void mT__15() throws RecognitionException { - try { - int _type = T__15; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:15:7: ( '.' ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:15:9: '.' - { - match('.'); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__15" - - // $ANTLR start "T__16" - public final void mT__16() throws RecognitionException { - try { - int _type = T__16; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:16:7: ( 'role' ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:16:9: 'role' - { - match("role"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__16" - - // $ANTLR start "T__17" - public final void mT__17() throws RecognitionException { - try { - int _type = T__17; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:17:7: ( 'simulating' ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:17:9: 'simulating' - { - match("simulating"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__17" - - // $ANTLR start "T__18" - public final void mT__18() throws RecognitionException { - try { - int _type = T__18; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:18:7: ( 'protocol' ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:18:9: 'protocol' - { - match("protocol"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__18" - - // $ANTLR start "T__19" - public final void mT__19() throws RecognitionException { - try { - int _type = T__19; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:19:7: ( 'as' ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:19:9: 'as' - { - match("as"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__19" - - // $ANTLR start "T__20" - public final void mT__20() throws RecognitionException { - try { - int _type = T__20; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:20:7: ( '(' ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:20:9: '(' - { - match('('); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__20" - - // $ANTLR start "T__21" - public final void mT__21() throws RecognitionException { - try { - int _type = T__21; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:21:7: ( ',' ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:21:9: ',' - { - match(','); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__21" - - // $ANTLR start "T__22" - public final void mT__22() throws RecognitionException { - try { - int _type = T__22; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:22:7: ( ')' ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:22:9: ')' - { - match(')'); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__22" - - // $ANTLR start "T__23" - public final void mT__23() throws RecognitionException { - try { - int _type = T__23; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:23:7: ( 'from' ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:23:9: 'from' - { - match("from"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__23" - - // $ANTLR start "T__24" - public final void mT__24() throws RecognitionException { - try { - int _type = T__24; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:24:7: ( 'to' ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:24:9: 'to' - { - match("to"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__24" - - // $ANTLR start "T__25" - public final void mT__25() throws RecognitionException { - try { - int _type = T__25; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:25:7: ( '=' ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:25:9: '=' - { - match('='); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "T__25" - - // $ANTLR start "RULE_ID" - public final void mRULE_ID() throws RecognitionException { - try { - int _type = RULE_ID; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:561:9: ( ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:561:11: ( '^' )? ( 'a' .. 'z' | 'A' .. 'Z' | '_' ) ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* - { - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:561:11: ( '^' )? - int alt1=2; - int LA1_0 = input.LA(1); - - if ( (LA1_0=='^') ) { - alt1=1; - } - switch (alt1) { - case 1 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:561:11: '^' - { - match('^'); - - } - break; - - } - - if ( (input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:561:40: ( 'a' .. 'z' | 'A' .. 'Z' | '_' | '0' .. '9' )* - loop2: - do { - int alt2=2; - int LA2_0 = input.LA(1); - - if ( ((LA2_0>='0' && LA2_0<='9')||(LA2_0>='A' && LA2_0<='Z')||LA2_0=='_'||(LA2_0>='a' && LA2_0<='z')) ) { - alt2=1; - } - - - switch (alt2) { - case 1 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g: - { - if ( (input.LA(1)>='0' && input.LA(1)<='9')||(input.LA(1)>='A' && input.LA(1)<='Z')||input.LA(1)=='_'||(input.LA(1)>='a' && input.LA(1)<='z') ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - - } - break; - - default : - break loop2; - } - } while (true); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "RULE_ID" - - // $ANTLR start "RULE_INT" - public final void mRULE_INT() throws RecognitionException { - try { - int _type = RULE_INT; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:563:10: ( ( '0' .. '9' )+ ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:563:12: ( '0' .. '9' )+ - { - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:563:12: ( '0' .. '9' )+ - int cnt3=0; - loop3: - do { - int alt3=2; - int LA3_0 = input.LA(1); - - if ( ((LA3_0>='0' && LA3_0<='9')) ) { - alt3=1; - } - - - switch (alt3) { - case 1 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:563:13: '0' .. '9' - { - matchRange('0','9'); - - } - break; - - default : - if ( cnt3 >= 1 ) break loop3; - EarlyExitException eee = - new EarlyExitException(3, input); - throw eee; - } - cnt3++; - } while (true); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "RULE_INT" - - // $ANTLR start "RULE_STRING" - public final void mRULE_STRING() throws RecognitionException { - try { - int _type = RULE_STRING; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:565:13: ( ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:565:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) - { - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:565:15: ( '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' | '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' ) - int alt6=2; - int LA6_0 = input.LA(1); - - if ( (LA6_0=='\"') ) { - alt6=1; - } - else if ( (LA6_0=='\'') ) { - alt6=2; - } - else { - NoViableAltException nvae = - new NoViableAltException("", 6, 0, input); - - throw nvae; - } - switch (alt6) { - case 1 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:565:16: '\"' ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* '\"' - { - match('\"'); - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:565:20: ( '\\\\' . | ~ ( ( '\\\\' | '\"' ) ) )* - loop4: - do { - int alt4=3; - int LA4_0 = input.LA(1); - - if ( (LA4_0=='\\') ) { - alt4=1; - } - else if ( ((LA4_0>='\u0000' && LA4_0<='!')||(LA4_0>='#' && LA4_0<='[')||(LA4_0>=']' && LA4_0<='\uFFFF')) ) { - alt4=2; - } - - - switch (alt4) { - case 1 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:565:21: '\\\\' . - { - match('\\'); - matchAny(); - - } - break; - case 2 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:565:28: ~ ( ( '\\\\' | '\"' ) ) - { - if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - - } - break; - - default : - break loop4; - } - } while (true); - - match('\"'); - - } - break; - case 2 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:565:48: '\\'' ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* '\\'' - { - match('\''); - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:565:53: ( '\\\\' . | ~ ( ( '\\\\' | '\\'' ) ) )* - loop5: - do { - int alt5=3; - int LA5_0 = input.LA(1); - - if ( (LA5_0=='\\') ) { - alt5=1; - } - else if ( ((LA5_0>='\u0000' && LA5_0<='&')||(LA5_0>='(' && LA5_0<='[')||(LA5_0>=']' && LA5_0<='\uFFFF')) ) { - alt5=2; - } - - - switch (alt5) { - case 1 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:565:54: '\\\\' . - { - match('\\'); - matchAny(); - - } - break; - case 2 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:565:61: ~ ( ( '\\\\' | '\\'' ) ) - { - if ( (input.LA(1)>='\u0000' && input.LA(1)<='&')||(input.LA(1)>='(' && input.LA(1)<='[')||(input.LA(1)>=']' && input.LA(1)<='\uFFFF') ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - - } - break; - - default : - break loop5; - } - } while (true); - - match('\''); - - } - break; - - } - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "RULE_STRING" - - // $ANTLR start "RULE_ML_COMMENT" - public final void mRULE_ML_COMMENT() throws RecognitionException { - try { - int _type = RULE_ML_COMMENT; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:567:17: ( '/*' ( options {greedy=false; } : . )* '*/' ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:567:19: '/*' ( options {greedy=false; } : . )* '*/' - { - match("/*"); - - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:567:24: ( options {greedy=false; } : . )* - loop7: - do { - int alt7=2; - int LA7_0 = input.LA(1); - - if ( (LA7_0=='*') ) { - int LA7_1 = input.LA(2); - - if ( (LA7_1=='/') ) { - alt7=2; - } - else if ( ((LA7_1>='\u0000' && LA7_1<='.')||(LA7_1>='0' && LA7_1<='\uFFFF')) ) { - alt7=1; - } - - - } - else if ( ((LA7_0>='\u0000' && LA7_0<=')')||(LA7_0>='+' && LA7_0<='\uFFFF')) ) { - alt7=1; - } - - - switch (alt7) { - case 1 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:567:52: . - { - matchAny(); - - } - break; - - default : - break loop7; - } - } while (true); - - match("*/"); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "RULE_ML_COMMENT" - - // $ANTLR start "RULE_SL_COMMENT" - public final void mRULE_SL_COMMENT() throws RecognitionException { - try { - int _type = RULE_SL_COMMENT; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:569:17: ( '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:569:19: '//' (~ ( ( '\\n' | '\\r' ) ) )* ( ( '\\r' )? '\\n' )? - { - match("//"); - - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:569:24: (~ ( ( '\\n' | '\\r' ) ) )* - loop8: - do { - int alt8=2; - int LA8_0 = input.LA(1); - - if ( ((LA8_0>='\u0000' && LA8_0<='\t')||(LA8_0>='\u000B' && LA8_0<='\f')||(LA8_0>='\u000E' && LA8_0<='\uFFFF')) ) { - alt8=1; - } - - - switch (alt8) { - case 1 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:569:24: ~ ( ( '\\n' | '\\r' ) ) - { - if ( (input.LA(1)>='\u0000' && input.LA(1)<='\t')||(input.LA(1)>='\u000B' && input.LA(1)<='\f')||(input.LA(1)>='\u000E' && input.LA(1)<='\uFFFF') ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - - } - break; - - default : - break loop8; - } - } while (true); - - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:569:40: ( ( '\\r' )? '\\n' )? - int alt10=2; - int LA10_0 = input.LA(1); - - if ( (LA10_0=='\n'||LA10_0=='\r') ) { - alt10=1; - } - switch (alt10) { - case 1 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:569:41: ( '\\r' )? '\\n' - { - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:569:41: ( '\\r' )? - int alt9=2; - int LA9_0 = input.LA(1); - - if ( (LA9_0=='\r') ) { - alt9=1; - } - switch (alt9) { - case 1 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:569:41: '\\r' - { - match('\r'); - - } - break; - - } - - match('\n'); - - } - break; - - } - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "RULE_SL_COMMENT" - - // $ANTLR start "RULE_WS" - public final void mRULE_WS() throws RecognitionException { - try { - int _type = RULE_WS; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:571:9: ( ( ' ' | '\\t' | '\\r' | '\\n' )+ ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:571:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ - { - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:571:11: ( ' ' | '\\t' | '\\r' | '\\n' )+ - int cnt11=0; - loop11: - do { - int alt11=2; - int LA11_0 = input.LA(1); - - if ( ((LA11_0>='\t' && LA11_0<='\n')||LA11_0=='\r'||LA11_0==' ') ) { - alt11=1; - } - - - switch (alt11) { - case 1 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g: - { - if ( (input.LA(1)>='\t' && input.LA(1)<='\n')||input.LA(1)=='\r'||input.LA(1)==' ' ) { - input.consume(); - - } - else { - MismatchedSetException mse = new MismatchedSetException(null,input); - recover(mse); - throw mse;} - - - } - break; - - default : - if ( cnt11 >= 1 ) break loop11; - EarlyExitException eee = - new EarlyExitException(11, input); - throw eee; - } - cnt11++; - } while (true); - - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "RULE_WS" - - // $ANTLR start "RULE_ANY_OTHER" - public final void mRULE_ANY_OTHER() throws RecognitionException { - try { - int _type = RULE_ANY_OTHER; - int _channel = DEFAULT_TOKEN_CHANNEL; - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:573:16: ( . ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:573:18: . - { - matchAny(); - - } - - state.type = _type; - state.channel = _channel; - } - finally { - } - } - // $ANTLR end "RULE_ANY_OTHER" - - public void mTokens() throws RecognitionException { - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:1:8: ( T__11 | T__12 | T__13 | T__14 | T__15 | T__16 | T__17 | T__18 | T__19 | T__20 | T__21 | T__22 | T__23 | T__24 | T__25 | RULE_ID | RULE_INT | RULE_STRING | RULE_ML_COMMENT | RULE_SL_COMMENT | RULE_WS | RULE_ANY_OTHER ) - int alt12=22; - alt12 = dfa12.predict(input); - switch (alt12) { - case 1 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:1:10: T__11 - { - mT__11(); - - } - break; - case 2 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:1:16: T__12 - { - mT__12(); - - } - break; - case 3 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:1:22: T__13 - { - mT__13(); - - } - break; - case 4 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:1:28: T__14 - { - mT__14(); - - } - break; - case 5 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:1:34: T__15 - { - mT__15(); - - } - break; - case 6 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:1:40: T__16 - { - mT__16(); - - } - break; - case 7 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:1:46: T__17 - { - mT__17(); - - } - break; - case 8 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:1:52: T__18 - { - mT__18(); - - } - break; - case 9 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:1:58: T__19 - { - mT__19(); - - } - break; - case 10 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:1:64: T__20 - { - mT__20(); - - } - break; - case 11 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:1:70: T__21 - { - mT__21(); - - } - break; - case 12 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:1:76: T__22 - { - mT__22(); - - } - break; - case 13 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:1:82: T__23 - { - mT__23(); - - } - break; - case 14 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:1:88: T__24 - { - mT__24(); - - } - break; - case 15 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:1:94: T__25 - { - mT__25(); - - } - break; - case 16 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:1:100: RULE_ID - { - mRULE_ID(); - - } - break; - case 17 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:1:108: RULE_INT - { - mRULE_INT(); - - } - break; - case 18 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:1:117: RULE_STRING - { - mRULE_STRING(); - - } - break; - case 19 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:1:129: RULE_ML_COMMENT - { - mRULE_ML_COMMENT(); - - } - break; - case 20 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:1:145: RULE_SL_COMMENT - { - mRULE_SL_COMMENT(); - - } - break; - case 21 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:1:161: RULE_WS - { - mRULE_WS(); - - } - break; - case 22 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:1:169: RULE_ANY_OTHER - { - mRULE_ANY_OTHER(); - - } - break; - - } - - } - - - protected DFA12 dfa12 = new DFA12(this); - static final String DFA12_eotS = - "\1\uffff\3\30\2\uffff\3\30\3\uffff\1\30\1\uffff\1\25\2\uffff\3\25\2\uffff\1\30\1\54\1\uffff\1\55\2\30\2\uffff\2\30\1\62\3\uffff\1\30\6\uffff\1\30\2\uffff\4\30\1\uffff\4\30\1\75\1\30\1\77\1\100\1\101\1\30\1\uffff\1\30\3\uffff\5\30\1\111\1\30\1\uffff\1\113\1\uffff"; - static final String DFA12_eofS = - "\114\uffff"; - static final String DFA12_minS = - "\1\0\1\157\1\171\1\150\2\uffff\1\157\1\162\1\163\3\uffff\1\162\1\uffff\1\101\2\uffff\2\0\1\52\2\uffff\1\141\1\60\1\uffff\1\60\1\157\1\155\2\uffff\1\154\1\157\1\60\3\uffff\1\157\6\uffff\1\143\2\uffff\1\167\1\165\1\145\1\164\1\uffff\1\155\1\145\1\163\1\154\1\60\1\157\3\60\1\141\1\uffff\1\143\3\uffff\1\164\1\157\1\151\1\154\1\156\1\60\1\147\1\uffff\1\60\1\uffff"; - static final String DFA12_maxS = - "\1\uffff\1\162\1\171\1\151\2\uffff\1\157\1\162\1\163\3\uffff\1\162\1\uffff\1\172\2\uffff\2\uffff\1\57\2\uffff\1\141\1\172\1\uffff\1\172\1\157\1\155\2\uffff\1\154\1\157\1\172\3\uffff\1\157\6\uffff\1\143\2\uffff\1\167\1\165\1\145\1\164\1\uffff\1\155\1\145\1\163\1\154\1\172\1\157\3\172\1\141\1\uffff\1\143\3\uffff\1\164\1\157\1\151\1\154\1\156\1\172\1\147\1\uffff\1\172\1\uffff"; - static final String DFA12_acceptS = - "\4\uffff\1\4\1\5\3\uffff\1\12\1\13\1\14\1\uffff\1\17\1\uffff\1\20\1\21\3\uffff\1\25\1\26\2\uffff\1\20\3\uffff\1\4\1\5\3\uffff\1\12\1\13\1\14\1\uffff\1\17\1\21\1\22\1\23\1\24\1\25\1\uffff\1\16\1\2\4\uffff\1\11\12\uffff\1\6\1\uffff\1\15\1\1\1\3\7\uffff\1\10\1\uffff\1\7"; - static final String DFA12_specialS = - "\1\1\20\uffff\1\0\1\2\71\uffff}>"; - static final String[] DFA12_transitionS = { - "\11\25\2\24\2\25\1\24\22\25\1\24\1\25\1\21\4\25\1\22\1\11\1\13\2\25\1\12\1\25\1\5\1\23\12\20\1\25\1\4\1\25\1\15\3\25\32\17\3\25\1\16\1\17\1\25\1\10\1\2\3\17\1\14\11\17\1\7\1\17\1\6\1\3\1\1\6\17\uff85\25", - "\1\27\2\uffff\1\26", - "\1\31", - "\1\32\1\33", - "", - "", - "\1\36", - "\1\37", - "\1\40", - "", - "", - "", - "\1\44", - "", - "\32\30\4\uffff\1\30\1\uffff\32\30", - "", - "", - "\0\47", - "\0\47", - "\1\50\4\uffff\1\51", - "", - "", - "\1\53", - "\12\30\7\uffff\32\30\4\uffff\1\30\1\uffff\32\30", - "", - "\12\30\7\uffff\32\30\4\uffff\1\30\1\uffff\32\30", - "\1\56", - "\1\57", - "", - "", - "\1\60", - "\1\61", - "\12\30\7\uffff\32\30\4\uffff\1\30\1\uffff\32\30", - "", - "", - "", - "\1\63", - "", - "", - "", - "", - "", - "", - "\1\64", - "", - "", - "\1\65", - "\1\66", - "\1\67", - "\1\70", - "", - "\1\71", - "\1\72", - "\1\73", - "\1\74", - "\12\30\7\uffff\32\30\4\uffff\1\30\1\uffff\32\30", - "\1\76", - "\12\30\7\uffff\32\30\4\uffff\1\30\1\uffff\32\30", - "\12\30\7\uffff\32\30\4\uffff\1\30\1\uffff\32\30", - "\12\30\7\uffff\32\30\4\uffff\1\30\1\uffff\32\30", - "\1\102", - "", - "\1\103", - "", - "", - "", - "\1\104", - "\1\105", - "\1\106", - "\1\107", - "\1\110", - "\12\30\7\uffff\32\30\4\uffff\1\30\1\uffff\32\30", - "\1\112", - "", - "\12\30\7\uffff\32\30\4\uffff\1\30\1\uffff\32\30", - "" - }; - - static final short[] DFA12_eot = DFA.unpackEncodedString(DFA12_eotS); - static final short[] DFA12_eof = DFA.unpackEncodedString(DFA12_eofS); - static final char[] DFA12_min = DFA.unpackEncodedStringToUnsignedChars(DFA12_minS); - static final char[] DFA12_max = DFA.unpackEncodedStringToUnsignedChars(DFA12_maxS); - static final short[] DFA12_accept = DFA.unpackEncodedString(DFA12_acceptS); - static final short[] DFA12_special = DFA.unpackEncodedString(DFA12_specialS); - static final short[][] DFA12_transition; - - static { - int numStates = DFA12_transitionS.length; - DFA12_transition = new short[numStates][]; - for (int i=0; i='\u0000' && LA12_17<='\uFFFF')) ) {s = 39;} - - else s = 21; - - if ( s>=0 ) return s; - break; - case 1 : - int LA12_0 = input.LA(1); - - s = -1; - if ( (LA12_0=='t') ) {s = 1;} - - else if ( (LA12_0=='b') ) {s = 2;} - - else if ( (LA12_0=='s') ) {s = 3;} - - else if ( (LA12_0==';') ) {s = 4;} - - else if ( (LA12_0=='.') ) {s = 5;} - - else if ( (LA12_0=='r') ) {s = 6;} - - else if ( (LA12_0=='p') ) {s = 7;} - - else if ( (LA12_0=='a') ) {s = 8;} - - else if ( (LA12_0=='(') ) {s = 9;} - - else if ( (LA12_0==',') ) {s = 10;} - - else if ( (LA12_0==')') ) {s = 11;} - - else if ( (LA12_0=='f') ) {s = 12;} - - else if ( (LA12_0=='=') ) {s = 13;} - - else if ( (LA12_0=='^') ) {s = 14;} - - else if ( ((LA12_0>='A' && LA12_0<='Z')||LA12_0=='_'||(LA12_0>='c' && LA12_0<='e')||(LA12_0>='g' && LA12_0<='o')||LA12_0=='q'||(LA12_0>='u' && LA12_0<='z')) ) {s = 15;} - - else if ( ((LA12_0>='0' && LA12_0<='9')) ) {s = 16;} - - else if ( (LA12_0=='\"') ) {s = 17;} - - else if ( (LA12_0=='\'') ) {s = 18;} - - else if ( (LA12_0=='/') ) {s = 19;} - - else if ( ((LA12_0>='\t' && LA12_0<='\n')||LA12_0=='\r'||LA12_0==' ') ) {s = 20;} - - else if ( ((LA12_0>='\u0000' && LA12_0<='\b')||(LA12_0>='\u000B' && LA12_0<='\f')||(LA12_0>='\u000E' && LA12_0<='\u001F')||LA12_0=='!'||(LA12_0>='#' && LA12_0<='&')||(LA12_0>='*' && LA12_0<='+')||LA12_0=='-'||LA12_0==':'||LA12_0=='<'||(LA12_0>='>' && LA12_0<='@')||(LA12_0>='[' && LA12_0<=']')||LA12_0=='`'||(LA12_0>='{' && LA12_0<='\uFFFF')) ) {s = 21;} - - if ( s>=0 ) return s; - break; - case 2 : - int LA12_18 = input.LA(1); - - s = -1; - if ( ((LA12_18>='\u0000' && LA12_18<='\uFFFF')) ) {s = 39;} - - else s = 21; - - if ( s>=0 ) return s; - break; - } - NoViableAltException nvae = - new NoViableAltException(getDescription(), 12, _s, input); - error(nvae); - throw nvae; - } - } - - -} \ No newline at end of file diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDslParser.java b/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDslParser.java deleted file mode 100644 index 069602227..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDslParser.java +++ /dev/null @@ -1,1411 +0,0 @@ -package org.scribble.trace.editor.dsl.parser.antlr.internal; - -import org.eclipse.xtext.*; -import org.eclipse.xtext.parser.*; -import org.eclipse.xtext.parser.impl.*; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.xtext.parser.antlr.AbstractInternalAntlrParser; -import org.eclipse.xtext.parser.antlr.XtextTokenStream; -import org.eclipse.xtext.parser.antlr.XtextTokenStream.HiddenTokens; -import org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken; -import org.scribble.trace.editor.dsl.services.ScribbleTraceDslGrammarAccess; - - - -import org.antlr.runtime.*; -import java.util.Stack; -import java.util.List; -import java.util.ArrayList; - -@SuppressWarnings("all") -public class InternalScribbleTraceDslParser extends AbstractInternalAntlrParser { - public static final String[] tokenNames = new String[] { - "", "", "", "", "RULE_ID", "RULE_STRING", "RULE_INT", "RULE_ML_COMMENT", "RULE_SL_COMMENT", "RULE_WS", "RULE_ANY_OTHER", "'trace'", "'by'", "'shows'", "';'", "'.'", "'role'", "'simulating'", "'protocol'", "'as'", "'('", "','", "')'", "'from'", "'to'", "'='" - }; - public static final int RULE_ID=4; - public static final int T__25=25; - public static final int T__24=24; - public static final int T__23=23; - public static final int T__22=22; - public static final int RULE_ANY_OTHER=10; - public static final int T__21=21; - public static final int T__20=20; - public static final int RULE_SL_COMMENT=8; - public static final int EOF=-1; - public static final int RULE_ML_COMMENT=7; - public static final int T__19=19; - public static final int RULE_STRING=5; - public static final int T__16=16; - public static final int T__15=15; - public static final int T__18=18; - public static final int T__17=17; - public static final int T__12=12; - public static final int T__11=11; - public static final int T__14=14; - public static final int T__13=13; - public static final int RULE_INT=6; - public static final int RULE_WS=9; - - // delegates - // delegators - - - public InternalScribbleTraceDslParser(TokenStream input) { - this(input, new RecognizerSharedState()); - } - public InternalScribbleTraceDslParser(TokenStream input, RecognizerSharedState state) { - super(input, state); - - } - - - public String[] getTokenNames() { return InternalScribbleTraceDslParser.tokenNames; } - public String getGrammarFileName() { return "../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g"; } - - - - private ScribbleTraceDslGrammarAccess grammarAccess; - - public InternalScribbleTraceDslParser(TokenStream input, ScribbleTraceDslGrammarAccess grammarAccess) { - this(input); - this.grammarAccess = grammarAccess; - registerRules(grammarAccess.getGrammar()); - } - - @Override - protected String getFirstRuleName() { - return "Trace"; - } - - @Override - protected ScribbleTraceDslGrammarAccess getGrammarAccess() { - return grammarAccess; - } - - - - // $ANTLR start "entryRuleTrace" - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:67:1: entryRuleTrace returns [EObject current=null] : iv_ruleTrace= ruleTrace EOF ; - public final EObject entryRuleTrace() throws RecognitionException { - EObject current = null; - - EObject iv_ruleTrace = null; - - - try { - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:68:2: (iv_ruleTrace= ruleTrace EOF ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:69:2: iv_ruleTrace= ruleTrace EOF - { - newCompositeNode(grammarAccess.getTraceRule()); - pushFollow(FOLLOW_ruleTrace_in_entryRuleTrace75); - iv_ruleTrace=ruleTrace(); - - state._fsp--; - - current =iv_ruleTrace; - match(input,EOF,FOLLOW_EOF_in_entryRuleTrace85); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleTrace" - - - // $ANTLR start "ruleTrace" - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:76:1: ruleTrace returns [EObject current=null] : ( () ruleTracedefn ( (lv_roles_2_0= ruleRoledefn ) )* ( (lv_steps_3_0= ruleStepdefn ) )* ) ; - public final EObject ruleTrace() throws RecognitionException { - EObject current = null; - - AntlrDatatypeRuleToken lv_roles_2_0 = null; - - EObject lv_steps_3_0 = null; - - - enterRule(); - - try { - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:79:28: ( ( () ruleTracedefn ( (lv_roles_2_0= ruleRoledefn ) )* ( (lv_steps_3_0= ruleStepdefn ) )* ) ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:80:1: ( () ruleTracedefn ( (lv_roles_2_0= ruleRoledefn ) )* ( (lv_steps_3_0= ruleStepdefn ) )* ) - { - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:80:1: ( () ruleTracedefn ( (lv_roles_2_0= ruleRoledefn ) )* ( (lv_steps_3_0= ruleStepdefn ) )* ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:80:2: () ruleTracedefn ( (lv_roles_2_0= ruleRoledefn ) )* ( (lv_steps_3_0= ruleStepdefn ) )* - { - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:80:2: () - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:81:5: - { - - current = forceCreateModelElement( - grammarAccess.getTraceAccess().getTraceAction_0(), - current); - - - } - - - newCompositeNode(grammarAccess.getTraceAccess().getTracedefnParserRuleCall_1()); - - pushFollow(FOLLOW_ruleTracedefn_in_ruleTrace135); - ruleTracedefn(); - - state._fsp--; - - - afterParserOrEnumRuleCall(); - - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:94:1: ( (lv_roles_2_0= ruleRoledefn ) )* - loop1: - do { - int alt1=2; - int LA1_0 = input.LA(1); - - if ( (LA1_0==16) ) { - alt1=1; - } - - - switch (alt1) { - case 1 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:95:1: (lv_roles_2_0= ruleRoledefn ) - { - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:95:1: (lv_roles_2_0= ruleRoledefn ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:96:3: lv_roles_2_0= ruleRoledefn - { - - newCompositeNode(grammarAccess.getTraceAccess().getRolesRoledefnParserRuleCall_2_0()); - - pushFollow(FOLLOW_ruleRoledefn_in_ruleTrace155); - lv_roles_2_0=ruleRoledefn(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getTraceRule()); - } - add( - current, - "roles", - lv_roles_2_0, - "Roledefn"); - afterParserOrEnumRuleCall(); - - - } - - - } - break; - - default : - break loop1; - } - } while (true); - - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:112:3: ( (lv_steps_3_0= ruleStepdefn ) )* - loop2: - do { - int alt2=2; - int LA2_0 = input.LA(1); - - if ( (LA2_0==RULE_ID) ) { - alt2=1; - } - - - switch (alt2) { - case 1 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:113:1: (lv_steps_3_0= ruleStepdefn ) - { - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:113:1: (lv_steps_3_0= ruleStepdefn ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:114:3: lv_steps_3_0= ruleStepdefn - { - - newCompositeNode(grammarAccess.getTraceAccess().getStepsStepdefnParserRuleCall_3_0()); - - pushFollow(FOLLOW_ruleStepdefn_in_ruleTrace177); - lv_steps_3_0=ruleStepdefn(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getTraceRule()); - } - add( - current, - "steps", - lv_steps_3_0, - "Stepdefn"); - afterParserOrEnumRuleCall(); - - - } - - - } - break; - - default : - break loop2; - } - } while (true); - - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleTrace" - - - // $ANTLR start "entryRuleSentence" - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:138:1: entryRuleSentence returns [String current=null] : iv_ruleSentence= ruleSentence EOF ; - public final String entryRuleSentence() throws RecognitionException { - String current = null; - - AntlrDatatypeRuleToken iv_ruleSentence = null; - - - try { - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:139:2: (iv_ruleSentence= ruleSentence EOF ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:140:2: iv_ruleSentence= ruleSentence EOF - { - newCompositeNode(grammarAccess.getSentenceRule()); - pushFollow(FOLLOW_ruleSentence_in_entryRuleSentence215); - iv_ruleSentence=ruleSentence(); - - state._fsp--; - - current =iv_ruleSentence.getText(); - match(input,EOF,FOLLOW_EOF_in_entryRuleSentence226); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleSentence" - - - // $ANTLR start "ruleSentence" - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:147:1: ruleSentence returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : (this_ID_0= RULE_ID )+ ; - public final AntlrDatatypeRuleToken ruleSentence() throws RecognitionException { - AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken(); - - Token this_ID_0=null; - - enterRule(); - - try { - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:150:28: ( (this_ID_0= RULE_ID )+ ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:151:1: (this_ID_0= RULE_ID )+ - { - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:151:1: (this_ID_0= RULE_ID )+ - int cnt3=0; - loop3: - do { - int alt3=2; - int LA3_0 = input.LA(1); - - if ( (LA3_0==RULE_ID) ) { - alt3=1; - } - - - switch (alt3) { - case 1 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:151:6: this_ID_0= RULE_ID - { - this_ID_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleSentence266); - - current.merge(this_ID_0); - - - newLeafNode(this_ID_0, grammarAccess.getSentenceAccess().getIDTerminalRuleCall()); - - - } - break; - - default : - if ( cnt3 >= 1 ) break loop3; - EarlyExitException eee = - new EarlyExitException(3, input); - throw eee; - } - cnt3++; - } while (true); - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleSentence" - - - // $ANTLR start "entryRuleTracedefn" - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:166:1: entryRuleTracedefn returns [String current=null] : iv_ruleTracedefn= ruleTracedefn EOF ; - public final String entryRuleTracedefn() throws RecognitionException { - String current = null; - - AntlrDatatypeRuleToken iv_ruleTracedefn = null; - - - try { - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:167:2: (iv_ruleTracedefn= ruleTracedefn EOF ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:168:2: iv_ruleTracedefn= ruleTracedefn EOF - { - newCompositeNode(grammarAccess.getTracedefnRule()); - pushFollow(FOLLOW_ruleTracedefn_in_entryRuleTracedefn313); - iv_ruleTracedefn=ruleTracedefn(); - - state._fsp--; - - current =iv_ruleTracedefn.getText(); - match(input,EOF,FOLLOW_EOF_in_entryRuleTracedefn324); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleTracedefn" - - - // $ANTLR start "ruleTracedefn" - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:175:1: ruleTracedefn returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : (kw= 'trace' this_ID_1= RULE_ID (kw= 'by' this_Sentence_3= ruleSentence (kw= 'shows' this_Sentence_5= ruleSentence )? )? kw= ';' ) ; - public final AntlrDatatypeRuleToken ruleTracedefn() throws RecognitionException { - AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken(); - - Token kw=null; - Token this_ID_1=null; - AntlrDatatypeRuleToken this_Sentence_3 = null; - - AntlrDatatypeRuleToken this_Sentence_5 = null; - - - enterRule(); - - try { - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:178:28: ( (kw= 'trace' this_ID_1= RULE_ID (kw= 'by' this_Sentence_3= ruleSentence (kw= 'shows' this_Sentence_5= ruleSentence )? )? kw= ';' ) ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:179:1: (kw= 'trace' this_ID_1= RULE_ID (kw= 'by' this_Sentence_3= ruleSentence (kw= 'shows' this_Sentence_5= ruleSentence )? )? kw= ';' ) - { - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:179:1: (kw= 'trace' this_ID_1= RULE_ID (kw= 'by' this_Sentence_3= ruleSentence (kw= 'shows' this_Sentence_5= ruleSentence )? )? kw= ';' ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:180:2: kw= 'trace' this_ID_1= RULE_ID (kw= 'by' this_Sentence_3= ruleSentence (kw= 'shows' this_Sentence_5= ruleSentence )? )? kw= ';' - { - kw=(Token)match(input,11,FOLLOW_11_in_ruleTracedefn362); - - current.merge(kw); - newLeafNode(kw, grammarAccess.getTracedefnAccess().getTraceKeyword_0()); - - this_ID_1=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleTracedefn377); - - current.merge(this_ID_1); - - - newLeafNode(this_ID_1, grammarAccess.getTracedefnAccess().getIDTerminalRuleCall_1()); - - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:192:1: (kw= 'by' this_Sentence_3= ruleSentence (kw= 'shows' this_Sentence_5= ruleSentence )? )? - int alt5=2; - int LA5_0 = input.LA(1); - - if ( (LA5_0==12) ) { - alt5=1; - } - switch (alt5) { - case 1 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:193:2: kw= 'by' this_Sentence_3= ruleSentence (kw= 'shows' this_Sentence_5= ruleSentence )? - { - kw=(Token)match(input,12,FOLLOW_12_in_ruleTracedefn396); - - current.merge(kw); - newLeafNode(kw, grammarAccess.getTracedefnAccess().getByKeyword_2_0()); - - - newCompositeNode(grammarAccess.getTracedefnAccess().getSentenceParserRuleCall_2_1()); - - pushFollow(FOLLOW_ruleSentence_in_ruleTracedefn418); - this_Sentence_3=ruleSentence(); - - state._fsp--; - - - current.merge(this_Sentence_3); - - - afterParserOrEnumRuleCall(); - - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:209:1: (kw= 'shows' this_Sentence_5= ruleSentence )? - int alt4=2; - int LA4_0 = input.LA(1); - - if ( (LA4_0==13) ) { - alt4=1; - } - switch (alt4) { - case 1 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:210:2: kw= 'shows' this_Sentence_5= ruleSentence - { - kw=(Token)match(input,13,FOLLOW_13_in_ruleTracedefn437); - - current.merge(kw); - newLeafNode(kw, grammarAccess.getTracedefnAccess().getShowsKeyword_2_2_0()); - - - newCompositeNode(grammarAccess.getTracedefnAccess().getSentenceParserRuleCall_2_2_1()); - - pushFollow(FOLLOW_ruleSentence_in_ruleTracedefn459); - this_Sentence_5=ruleSentence(); - - state._fsp--; - - - current.merge(this_Sentence_5); - - - afterParserOrEnumRuleCall(); - - - } - break; - - } - - - } - break; - - } - - kw=(Token)match(input,14,FOLLOW_14_in_ruleTracedefn481); - - current.merge(kw); - newLeafNode(kw, grammarAccess.getTracedefnAccess().getSemicolonKeyword_3()); - - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleTracedefn" - - - // $ANTLR start "entryRuleModule" - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:240:1: entryRuleModule returns [String current=null] : iv_ruleModule= ruleModule EOF ; - public final String entryRuleModule() throws RecognitionException { - String current = null; - - AntlrDatatypeRuleToken iv_ruleModule = null; - - - try { - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:241:2: (iv_ruleModule= ruleModule EOF ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:242:2: iv_ruleModule= ruleModule EOF - { - newCompositeNode(grammarAccess.getModuleRule()); - pushFollow(FOLLOW_ruleModule_in_entryRuleModule522); - iv_ruleModule=ruleModule(); - - state._fsp--; - - current =iv_ruleModule.getText(); - match(input,EOF,FOLLOW_EOF_in_entryRuleModule533); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleModule" - - - // $ANTLR start "ruleModule" - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:249:1: ruleModule returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : (this_ID_0= RULE_ID (kw= '.' this_ID_2= RULE_ID )* ) ; - public final AntlrDatatypeRuleToken ruleModule() throws RecognitionException { - AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken(); - - Token this_ID_0=null; - Token kw=null; - Token this_ID_2=null; - - enterRule(); - - try { - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:252:28: ( (this_ID_0= RULE_ID (kw= '.' this_ID_2= RULE_ID )* ) ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:253:1: (this_ID_0= RULE_ID (kw= '.' this_ID_2= RULE_ID )* ) - { - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:253:1: (this_ID_0= RULE_ID (kw= '.' this_ID_2= RULE_ID )* ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:253:6: this_ID_0= RULE_ID (kw= '.' this_ID_2= RULE_ID )* - { - this_ID_0=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleModule573); - - current.merge(this_ID_0); - - - newLeafNode(this_ID_0, grammarAccess.getModuleAccess().getIDTerminalRuleCall_0()); - - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:260:1: (kw= '.' this_ID_2= RULE_ID )* - loop6: - do { - int alt6=2; - int LA6_0 = input.LA(1); - - if ( (LA6_0==15) ) { - alt6=1; - } - - - switch (alt6) { - case 1 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:261:2: kw= '.' this_ID_2= RULE_ID - { - kw=(Token)match(input,15,FOLLOW_15_in_ruleModule592); - - current.merge(kw); - newLeafNode(kw, grammarAccess.getModuleAccess().getFullStopKeyword_1_0()); - - this_ID_2=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleModule607); - - current.merge(this_ID_2); - - - newLeafNode(this_ID_2, grammarAccess.getModuleAccess().getIDTerminalRuleCall_1_1()); - - - } - break; - - default : - break loop6; - } - } while (true); - - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleModule" - - - // $ANTLR start "entryRuleRoledefn" - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:281:1: entryRuleRoledefn returns [String current=null] : iv_ruleRoledefn= ruleRoledefn EOF ; - public final String entryRuleRoledefn() throws RecognitionException { - String current = null; - - AntlrDatatypeRuleToken iv_ruleRoledefn = null; - - - try { - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:282:2: (iv_ruleRoledefn= ruleRoledefn EOF ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:283:2: iv_ruleRoledefn= ruleRoledefn EOF - { - newCompositeNode(grammarAccess.getRoledefnRule()); - pushFollow(FOLLOW_ruleRoledefn_in_entryRuleRoledefn655); - iv_ruleRoledefn=ruleRoledefn(); - - state._fsp--; - - current =iv_ruleRoledefn.getText(); - match(input,EOF,FOLLOW_EOF_in_entryRuleRoledefn666); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleRoledefn" - - - // $ANTLR start "ruleRoledefn" - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:290:1: ruleRoledefn returns [AntlrDatatypeRuleToken current=new AntlrDatatypeRuleToken()] : (kw= 'role' this_ID_1= RULE_ID (kw= 'simulating' this_Module_3= ruleModule kw= 'protocol' this_ID_5= RULE_ID (kw= 'as' this_ID_7= RULE_ID )? )? kw= ';' ) ; - public final AntlrDatatypeRuleToken ruleRoledefn() throws RecognitionException { - AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken(); - - Token kw=null; - Token this_ID_1=null; - Token this_ID_5=null; - Token this_ID_7=null; - AntlrDatatypeRuleToken this_Module_3 = null; - - - enterRule(); - - try { - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:293:28: ( (kw= 'role' this_ID_1= RULE_ID (kw= 'simulating' this_Module_3= ruleModule kw= 'protocol' this_ID_5= RULE_ID (kw= 'as' this_ID_7= RULE_ID )? )? kw= ';' ) ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:294:1: (kw= 'role' this_ID_1= RULE_ID (kw= 'simulating' this_Module_3= ruleModule kw= 'protocol' this_ID_5= RULE_ID (kw= 'as' this_ID_7= RULE_ID )? )? kw= ';' ) - { - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:294:1: (kw= 'role' this_ID_1= RULE_ID (kw= 'simulating' this_Module_3= ruleModule kw= 'protocol' this_ID_5= RULE_ID (kw= 'as' this_ID_7= RULE_ID )? )? kw= ';' ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:295:2: kw= 'role' this_ID_1= RULE_ID (kw= 'simulating' this_Module_3= ruleModule kw= 'protocol' this_ID_5= RULE_ID (kw= 'as' this_ID_7= RULE_ID )? )? kw= ';' - { - kw=(Token)match(input,16,FOLLOW_16_in_ruleRoledefn704); - - current.merge(kw); - newLeafNode(kw, grammarAccess.getRoledefnAccess().getRoleKeyword_0()); - - this_ID_1=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleRoledefn719); - - current.merge(this_ID_1); - - - newLeafNode(this_ID_1, grammarAccess.getRoledefnAccess().getIDTerminalRuleCall_1()); - - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:307:1: (kw= 'simulating' this_Module_3= ruleModule kw= 'protocol' this_ID_5= RULE_ID (kw= 'as' this_ID_7= RULE_ID )? )? - int alt8=2; - int LA8_0 = input.LA(1); - - if ( (LA8_0==17) ) { - alt8=1; - } - switch (alt8) { - case 1 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:308:2: kw= 'simulating' this_Module_3= ruleModule kw= 'protocol' this_ID_5= RULE_ID (kw= 'as' this_ID_7= RULE_ID )? - { - kw=(Token)match(input,17,FOLLOW_17_in_ruleRoledefn738); - - current.merge(kw); - newLeafNode(kw, grammarAccess.getRoledefnAccess().getSimulatingKeyword_2_0()); - - - newCompositeNode(grammarAccess.getRoledefnAccess().getModuleParserRuleCall_2_1()); - - pushFollow(FOLLOW_ruleModule_in_ruleRoledefn760); - this_Module_3=ruleModule(); - - state._fsp--; - - - current.merge(this_Module_3); - - - afterParserOrEnumRuleCall(); - - kw=(Token)match(input,18,FOLLOW_18_in_ruleRoledefn778); - - current.merge(kw); - newLeafNode(kw, grammarAccess.getRoledefnAccess().getProtocolKeyword_2_2()); - - this_ID_5=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleRoledefn793); - - current.merge(this_ID_5); - - - newLeafNode(this_ID_5, grammarAccess.getRoledefnAccess().getIDTerminalRuleCall_2_3()); - - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:337:1: (kw= 'as' this_ID_7= RULE_ID )? - int alt7=2; - int LA7_0 = input.LA(1); - - if ( (LA7_0==19) ) { - alt7=1; - } - switch (alt7) { - case 1 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:338:2: kw= 'as' this_ID_7= RULE_ID - { - kw=(Token)match(input,19,FOLLOW_19_in_ruleRoledefn812); - - current.merge(kw); - newLeafNode(kw, grammarAccess.getRoledefnAccess().getAsKeyword_2_4_0()); - - this_ID_7=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleRoledefn827); - - current.merge(this_ID_7); - - - newLeafNode(this_ID_7, grammarAccess.getRoledefnAccess().getIDTerminalRuleCall_2_4_1()); - - - } - break; - - } - - - } - break; - - } - - kw=(Token)match(input,14,FOLLOW_14_in_ruleRoledefn849); - - current.merge(kw); - newLeafNode(kw, grammarAccess.getRoledefnAccess().getSemicolonKeyword_3()); - - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleRoledefn" - - - // $ANTLR start "entryRuleStepdefn" - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:364:1: entryRuleStepdefn returns [EObject current=null] : iv_ruleStepdefn= ruleStepdefn EOF ; - public final EObject entryRuleStepdefn() throws RecognitionException { - EObject current = null; - - EObject iv_ruleStepdefn = null; - - - try { - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:365:2: (iv_ruleStepdefn= ruleStepdefn EOF ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:366:2: iv_ruleStepdefn= ruleStepdefn EOF - { - newCompositeNode(grammarAccess.getStepdefnRule()); - pushFollow(FOLLOW_ruleStepdefn_in_entryRuleStepdefn889); - iv_ruleStepdefn=ruleStepdefn(); - - state._fsp--; - - current =iv_ruleStepdefn; - match(input,EOF,FOLLOW_EOF_in_entryRuleStepdefn899); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleStepdefn" - - - // $ANTLR start "ruleStepdefn" - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:373:1: ruleStepdefn returns [EObject current=null] : this_Messagetransfer_0= ruleMessagetransfer ; - public final EObject ruleStepdefn() throws RecognitionException { - EObject current = null; - - EObject this_Messagetransfer_0 = null; - - - enterRule(); - - try { - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:376:28: (this_Messagetransfer_0= ruleMessagetransfer ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:378:5: this_Messagetransfer_0= ruleMessagetransfer - { - - newCompositeNode(grammarAccess.getStepdefnAccess().getMessagetransferParserRuleCall()); - - pushFollow(FOLLOW_ruleMessagetransfer_in_ruleStepdefn945); - this_Messagetransfer_0=ruleMessagetransfer(); - - state._fsp--; - - - current = this_Messagetransfer_0; - afterParserOrEnumRuleCall(); - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleStepdefn" - - - // $ANTLR start "entryRuleMessagetransfer" - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:394:1: entryRuleMessagetransfer returns [EObject current=null] : iv_ruleMessagetransfer= ruleMessagetransfer EOF ; - public final EObject entryRuleMessagetransfer() throws RecognitionException { - EObject current = null; - - EObject iv_ruleMessagetransfer = null; - - - try { - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:395:2: (iv_ruleMessagetransfer= ruleMessagetransfer EOF ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:396:2: iv_ruleMessagetransfer= ruleMessagetransfer EOF - { - newCompositeNode(grammarAccess.getMessagetransferRule()); - pushFollow(FOLLOW_ruleMessagetransfer_in_entryRuleMessagetransfer979); - iv_ruleMessagetransfer=ruleMessagetransfer(); - - state._fsp--; - - current =iv_ruleMessagetransfer; - match(input,EOF,FOLLOW_EOF_in_entryRuleMessagetransfer989); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleMessagetransfer" - - - // $ANTLR start "ruleMessagetransfer" - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:403:1: ruleMessagetransfer returns [EObject current=null] : ( () this_ID_1= RULE_ID (otherlv_2= '(' ( ( (lv_parameters_3_0= ruleParameter ) ) (otherlv_4= ',' ( (lv_parameters_5_0= ruleParameter ) ) )* )? otherlv_6= ')' )? otherlv_7= 'from' this_ID_8= RULE_ID otherlv_9= 'to' this_ID_10= RULE_ID (otherlv_11= ',' this_ID_12= RULE_ID )* otherlv_13= ';' ) ; - public final EObject ruleMessagetransfer() throws RecognitionException { - EObject current = null; - - Token this_ID_1=null; - Token otherlv_2=null; - Token otherlv_4=null; - Token otherlv_6=null; - Token otherlv_7=null; - Token this_ID_8=null; - Token otherlv_9=null; - Token this_ID_10=null; - Token otherlv_11=null; - Token this_ID_12=null; - Token otherlv_13=null; - EObject lv_parameters_3_0 = null; - - EObject lv_parameters_5_0 = null; - - - enterRule(); - - try { - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:406:28: ( ( () this_ID_1= RULE_ID (otherlv_2= '(' ( ( (lv_parameters_3_0= ruleParameter ) ) (otherlv_4= ',' ( (lv_parameters_5_0= ruleParameter ) ) )* )? otherlv_6= ')' )? otherlv_7= 'from' this_ID_8= RULE_ID otherlv_9= 'to' this_ID_10= RULE_ID (otherlv_11= ',' this_ID_12= RULE_ID )* otherlv_13= ';' ) ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:407:1: ( () this_ID_1= RULE_ID (otherlv_2= '(' ( ( (lv_parameters_3_0= ruleParameter ) ) (otherlv_4= ',' ( (lv_parameters_5_0= ruleParameter ) ) )* )? otherlv_6= ')' )? otherlv_7= 'from' this_ID_8= RULE_ID otherlv_9= 'to' this_ID_10= RULE_ID (otherlv_11= ',' this_ID_12= RULE_ID )* otherlv_13= ';' ) - { - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:407:1: ( () this_ID_1= RULE_ID (otherlv_2= '(' ( ( (lv_parameters_3_0= ruleParameter ) ) (otherlv_4= ',' ( (lv_parameters_5_0= ruleParameter ) ) )* )? otherlv_6= ')' )? otherlv_7= 'from' this_ID_8= RULE_ID otherlv_9= 'to' this_ID_10= RULE_ID (otherlv_11= ',' this_ID_12= RULE_ID )* otherlv_13= ';' ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:407:2: () this_ID_1= RULE_ID (otherlv_2= '(' ( ( (lv_parameters_3_0= ruleParameter ) ) (otherlv_4= ',' ( (lv_parameters_5_0= ruleParameter ) ) )* )? otherlv_6= ')' )? otherlv_7= 'from' this_ID_8= RULE_ID otherlv_9= 'to' this_ID_10= RULE_ID (otherlv_11= ',' this_ID_12= RULE_ID )* otherlv_13= ';' - { - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:407:2: () - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:408:5: - { - - current = forceCreateModelElement( - grammarAccess.getMessagetransferAccess().getMessagetransferAction_0(), - current); - - - } - - this_ID_1=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleMessagetransfer1034); - - newLeafNode(this_ID_1, grammarAccess.getMessagetransferAccess().getIDTerminalRuleCall_1()); - - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:417:1: (otherlv_2= '(' ( ( (lv_parameters_3_0= ruleParameter ) ) (otherlv_4= ',' ( (lv_parameters_5_0= ruleParameter ) ) )* )? otherlv_6= ')' )? - int alt11=2; - int LA11_0 = input.LA(1); - - if ( (LA11_0==20) ) { - alt11=1; - } - switch (alt11) { - case 1 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:417:3: otherlv_2= '(' ( ( (lv_parameters_3_0= ruleParameter ) ) (otherlv_4= ',' ( (lv_parameters_5_0= ruleParameter ) ) )* )? otherlv_6= ')' - { - otherlv_2=(Token)match(input,20,FOLLOW_20_in_ruleMessagetransfer1046); - - newLeafNode(otherlv_2, grammarAccess.getMessagetransferAccess().getLeftParenthesisKeyword_2_0()); - - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:421:1: ( ( (lv_parameters_3_0= ruleParameter ) ) (otherlv_4= ',' ( (lv_parameters_5_0= ruleParameter ) ) )* )? - int alt10=2; - int LA10_0 = input.LA(1); - - if ( (LA10_0==RULE_STRING) ) { - alt10=1; - } - switch (alt10) { - case 1 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:421:2: ( (lv_parameters_3_0= ruleParameter ) ) (otherlv_4= ',' ( (lv_parameters_5_0= ruleParameter ) ) )* - { - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:421:2: ( (lv_parameters_3_0= ruleParameter ) ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:422:1: (lv_parameters_3_0= ruleParameter ) - { - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:422:1: (lv_parameters_3_0= ruleParameter ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:423:3: lv_parameters_3_0= ruleParameter - { - - newCompositeNode(grammarAccess.getMessagetransferAccess().getParametersParameterParserRuleCall_2_1_0_0()); - - pushFollow(FOLLOW_ruleParameter_in_ruleMessagetransfer1068); - lv_parameters_3_0=ruleParameter(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getMessagetransferRule()); - } - add( - current, - "parameters", - lv_parameters_3_0, - "Parameter"); - afterParserOrEnumRuleCall(); - - - } - - - } - - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:439:2: (otherlv_4= ',' ( (lv_parameters_5_0= ruleParameter ) ) )* - loop9: - do { - int alt9=2; - int LA9_0 = input.LA(1); - - if ( (LA9_0==21) ) { - alt9=1; - } - - - switch (alt9) { - case 1 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:439:4: otherlv_4= ',' ( (lv_parameters_5_0= ruleParameter ) ) - { - otherlv_4=(Token)match(input,21,FOLLOW_21_in_ruleMessagetransfer1081); - - newLeafNode(otherlv_4, grammarAccess.getMessagetransferAccess().getCommaKeyword_2_1_1_0()); - - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:443:1: ( (lv_parameters_5_0= ruleParameter ) ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:444:1: (lv_parameters_5_0= ruleParameter ) - { - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:444:1: (lv_parameters_5_0= ruleParameter ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:445:3: lv_parameters_5_0= ruleParameter - { - - newCompositeNode(grammarAccess.getMessagetransferAccess().getParametersParameterParserRuleCall_2_1_1_1_0()); - - pushFollow(FOLLOW_ruleParameter_in_ruleMessagetransfer1102); - lv_parameters_5_0=ruleParameter(); - - state._fsp--; - - - if (current==null) { - current = createModelElementForParent(grammarAccess.getMessagetransferRule()); - } - add( - current, - "parameters", - lv_parameters_5_0, - "Parameter"); - afterParserOrEnumRuleCall(); - - - } - - - } - - - } - break; - - default : - break loop9; - } - } while (true); - - - } - break; - - } - - otherlv_6=(Token)match(input,22,FOLLOW_22_in_ruleMessagetransfer1118); - - newLeafNode(otherlv_6, grammarAccess.getMessagetransferAccess().getRightParenthesisKeyword_2_2()); - - - } - break; - - } - - otherlv_7=(Token)match(input,23,FOLLOW_23_in_ruleMessagetransfer1132); - - newLeafNode(otherlv_7, grammarAccess.getMessagetransferAccess().getFromKeyword_3()); - - this_ID_8=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleMessagetransfer1143); - - newLeafNode(this_ID_8, grammarAccess.getMessagetransferAccess().getIDTerminalRuleCall_4()); - - otherlv_9=(Token)match(input,24,FOLLOW_24_in_ruleMessagetransfer1154); - - newLeafNode(otherlv_9, grammarAccess.getMessagetransferAccess().getToKeyword_5()); - - this_ID_10=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleMessagetransfer1165); - - newLeafNode(this_ID_10, grammarAccess.getMessagetransferAccess().getIDTerminalRuleCall_6()); - - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:481:1: (otherlv_11= ',' this_ID_12= RULE_ID )* - loop12: - do { - int alt12=2; - int LA12_0 = input.LA(1); - - if ( (LA12_0==21) ) { - alt12=1; - } - - - switch (alt12) { - case 1 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:481:3: otherlv_11= ',' this_ID_12= RULE_ID - { - otherlv_11=(Token)match(input,21,FOLLOW_21_in_ruleMessagetransfer1177); - - newLeafNode(otherlv_11, grammarAccess.getMessagetransferAccess().getCommaKeyword_7_0()); - - this_ID_12=(Token)match(input,RULE_ID,FOLLOW_RULE_ID_in_ruleMessagetransfer1188); - - newLeafNode(this_ID_12, grammarAccess.getMessagetransferAccess().getIDTerminalRuleCall_7_1()); - - - } - break; - - default : - break loop12; - } - } while (true); - - otherlv_13=(Token)match(input,14,FOLLOW_14_in_ruleMessagetransfer1201); - - newLeafNode(otherlv_13, grammarAccess.getMessagetransferAccess().getSemicolonKeyword_8()); - - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleMessagetransfer" - - - // $ANTLR start "entryRuleParameter" - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:501:1: entryRuleParameter returns [EObject current=null] : iv_ruleParameter= ruleParameter EOF ; - public final EObject entryRuleParameter() throws RecognitionException { - EObject current = null; - - EObject iv_ruleParameter = null; - - - try { - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:502:2: (iv_ruleParameter= ruleParameter EOF ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:503:2: iv_ruleParameter= ruleParameter EOF - { - newCompositeNode(grammarAccess.getParameterRule()); - pushFollow(FOLLOW_ruleParameter_in_entryRuleParameter1237); - iv_ruleParameter=ruleParameter(); - - state._fsp--; - - current =iv_ruleParameter; - match(input,EOF,FOLLOW_EOF_in_entryRuleParameter1247); - - } - - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "entryRuleParameter" - - - // $ANTLR start "ruleParameter" - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:510:1: ruleParameter returns [EObject current=null] : ( ( (lv_type_0_0= RULE_STRING ) ) (otherlv_1= '=' ( (lv_value_2_0= RULE_STRING ) ) )? ) ; - public final EObject ruleParameter() throws RecognitionException { - EObject current = null; - - Token lv_type_0_0=null; - Token otherlv_1=null; - Token lv_value_2_0=null; - - enterRule(); - - try { - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:513:28: ( ( ( (lv_type_0_0= RULE_STRING ) ) (otherlv_1= '=' ( (lv_value_2_0= RULE_STRING ) ) )? ) ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:514:1: ( ( (lv_type_0_0= RULE_STRING ) ) (otherlv_1= '=' ( (lv_value_2_0= RULE_STRING ) ) )? ) - { - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:514:1: ( ( (lv_type_0_0= RULE_STRING ) ) (otherlv_1= '=' ( (lv_value_2_0= RULE_STRING ) ) )? ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:514:2: ( (lv_type_0_0= RULE_STRING ) ) (otherlv_1= '=' ( (lv_value_2_0= RULE_STRING ) ) )? - { - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:514:2: ( (lv_type_0_0= RULE_STRING ) ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:515:1: (lv_type_0_0= RULE_STRING ) - { - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:515:1: (lv_type_0_0= RULE_STRING ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:516:3: lv_type_0_0= RULE_STRING - { - lv_type_0_0=(Token)match(input,RULE_STRING,FOLLOW_RULE_STRING_in_ruleParameter1289); - - newLeafNode(lv_type_0_0, grammarAccess.getParameterAccess().getTypeSTRINGTerminalRuleCall_0_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getParameterRule()); - } - setWithLastConsumed( - current, - "type", - lv_type_0_0, - "STRING"); - - - } - - - } - - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:532:2: (otherlv_1= '=' ( (lv_value_2_0= RULE_STRING ) ) )? - int alt13=2; - int LA13_0 = input.LA(1); - - if ( (LA13_0==25) ) { - alt13=1; - } - switch (alt13) { - case 1 : - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:532:4: otherlv_1= '=' ( (lv_value_2_0= RULE_STRING ) ) - { - otherlv_1=(Token)match(input,25,FOLLOW_25_in_ruleParameter1307); - - newLeafNode(otherlv_1, grammarAccess.getParameterAccess().getEqualsSignKeyword_1_0()); - - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:536:1: ( (lv_value_2_0= RULE_STRING ) ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:537:1: (lv_value_2_0= RULE_STRING ) - { - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:537:1: (lv_value_2_0= RULE_STRING ) - // ../org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/parser/antlr/internal/InternalScribbleTraceDsl.g:538:3: lv_value_2_0= RULE_STRING - { - lv_value_2_0=(Token)match(input,RULE_STRING,FOLLOW_RULE_STRING_in_ruleParameter1324); - - newLeafNode(lv_value_2_0, grammarAccess.getParameterAccess().getValueSTRINGTerminalRuleCall_1_1_0()); - - - if (current==null) { - current = createModelElement(grammarAccess.getParameterRule()); - } - setWithLastConsumed( - current, - "value", - lv_value_2_0, - "STRING"); - - - } - - - } - - - } - break; - - } - - - } - - - } - - leaveRule(); - } - - catch (RecognitionException re) { - recover(input,re); - appendSkippedTokens(); - } - finally { - } - return current; - } - // $ANTLR end "ruleParameter" - - // Delegated rules - - - - - public static final BitSet FOLLOW_ruleTrace_in_entryRuleTrace75 = new BitSet(new long[]{0x0000000000000000L}); - public static final BitSet FOLLOW_EOF_in_entryRuleTrace85 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ruleTracedefn_in_ruleTrace135 = new BitSet(new long[]{0x0000000000010012L}); - public static final BitSet FOLLOW_ruleRoledefn_in_ruleTrace155 = new BitSet(new long[]{0x0000000000010012L}); - public static final BitSet FOLLOW_ruleStepdefn_in_ruleTrace177 = new BitSet(new long[]{0x0000000000000012L}); - public static final BitSet FOLLOW_ruleSentence_in_entryRuleSentence215 = new BitSet(new long[]{0x0000000000000000L}); - public static final BitSet FOLLOW_EOF_in_entryRuleSentence226 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_RULE_ID_in_ruleSentence266 = new BitSet(new long[]{0x0000000000000012L}); - public static final BitSet FOLLOW_ruleTracedefn_in_entryRuleTracedefn313 = new BitSet(new long[]{0x0000000000000000L}); - public static final BitSet FOLLOW_EOF_in_entryRuleTracedefn324 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_11_in_ruleTracedefn362 = new BitSet(new long[]{0x0000000000000010L}); - public static final BitSet FOLLOW_RULE_ID_in_ruleTracedefn377 = new BitSet(new long[]{0x0000000000005000L}); - public static final BitSet FOLLOW_12_in_ruleTracedefn396 = new BitSet(new long[]{0x0000000000000010L}); - public static final BitSet FOLLOW_ruleSentence_in_ruleTracedefn418 = new BitSet(new long[]{0x0000000000006000L}); - public static final BitSet FOLLOW_13_in_ruleTracedefn437 = new BitSet(new long[]{0x0000000000000010L}); - public static final BitSet FOLLOW_ruleSentence_in_ruleTracedefn459 = new BitSet(new long[]{0x0000000000004000L}); - public static final BitSet FOLLOW_14_in_ruleTracedefn481 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ruleModule_in_entryRuleModule522 = new BitSet(new long[]{0x0000000000000000L}); - public static final BitSet FOLLOW_EOF_in_entryRuleModule533 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_RULE_ID_in_ruleModule573 = new BitSet(new long[]{0x0000000000008002L}); - public static final BitSet FOLLOW_15_in_ruleModule592 = new BitSet(new long[]{0x0000000000000010L}); - public static final BitSet FOLLOW_RULE_ID_in_ruleModule607 = new BitSet(new long[]{0x0000000000008002L}); - public static final BitSet FOLLOW_ruleRoledefn_in_entryRuleRoledefn655 = new BitSet(new long[]{0x0000000000000000L}); - public static final BitSet FOLLOW_EOF_in_entryRuleRoledefn666 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_16_in_ruleRoledefn704 = new BitSet(new long[]{0x0000000000000010L}); - public static final BitSet FOLLOW_RULE_ID_in_ruleRoledefn719 = new BitSet(new long[]{0x0000000000024000L}); - public static final BitSet FOLLOW_17_in_ruleRoledefn738 = new BitSet(new long[]{0x0000000000000010L}); - public static final BitSet FOLLOW_ruleModule_in_ruleRoledefn760 = new BitSet(new long[]{0x0000000000040000L}); - public static final BitSet FOLLOW_18_in_ruleRoledefn778 = new BitSet(new long[]{0x0000000000000010L}); - public static final BitSet FOLLOW_RULE_ID_in_ruleRoledefn793 = new BitSet(new long[]{0x0000000000084000L}); - public static final BitSet FOLLOW_19_in_ruleRoledefn812 = new BitSet(new long[]{0x0000000000000010L}); - public static final BitSet FOLLOW_RULE_ID_in_ruleRoledefn827 = new BitSet(new long[]{0x0000000000004000L}); - public static final BitSet FOLLOW_14_in_ruleRoledefn849 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ruleStepdefn_in_entryRuleStepdefn889 = new BitSet(new long[]{0x0000000000000000L}); - public static final BitSet FOLLOW_EOF_in_entryRuleStepdefn899 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ruleMessagetransfer_in_ruleStepdefn945 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ruleMessagetransfer_in_entryRuleMessagetransfer979 = new BitSet(new long[]{0x0000000000000000L}); - public static final BitSet FOLLOW_EOF_in_entryRuleMessagetransfer989 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_RULE_ID_in_ruleMessagetransfer1034 = new BitSet(new long[]{0x0000000000900000L}); - public static final BitSet FOLLOW_20_in_ruleMessagetransfer1046 = new BitSet(new long[]{0x0000000000400020L}); - public static final BitSet FOLLOW_ruleParameter_in_ruleMessagetransfer1068 = new BitSet(new long[]{0x0000000000600000L}); - public static final BitSet FOLLOW_21_in_ruleMessagetransfer1081 = new BitSet(new long[]{0x0000000000000020L}); - public static final BitSet FOLLOW_ruleParameter_in_ruleMessagetransfer1102 = new BitSet(new long[]{0x0000000000600000L}); - public static final BitSet FOLLOW_22_in_ruleMessagetransfer1118 = new BitSet(new long[]{0x0000000000800000L}); - public static final BitSet FOLLOW_23_in_ruleMessagetransfer1132 = new BitSet(new long[]{0x0000000000000010L}); - public static final BitSet FOLLOW_RULE_ID_in_ruleMessagetransfer1143 = new BitSet(new long[]{0x0000000001000000L}); - public static final BitSet FOLLOW_24_in_ruleMessagetransfer1154 = new BitSet(new long[]{0x0000000000000010L}); - public static final BitSet FOLLOW_RULE_ID_in_ruleMessagetransfer1165 = new BitSet(new long[]{0x0000000000204000L}); - public static final BitSet FOLLOW_21_in_ruleMessagetransfer1177 = new BitSet(new long[]{0x0000000000000010L}); - public static final BitSet FOLLOW_RULE_ID_in_ruleMessagetransfer1188 = new BitSet(new long[]{0x0000000000204000L}); - public static final BitSet FOLLOW_14_in_ruleMessagetransfer1201 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_ruleParameter_in_entryRuleParameter1237 = new BitSet(new long[]{0x0000000000000000L}); - public static final BitSet FOLLOW_EOF_in_entryRuleParameter1247 = new BitSet(new long[]{0x0000000000000002L}); - public static final BitSet FOLLOW_RULE_STRING_in_ruleParameter1289 = new BitSet(new long[]{0x0000000002000002L}); - public static final BitSet FOLLOW_25_in_ruleParameter1307 = new BitSet(new long[]{0x0000000000000020L}); - public static final BitSet FOLLOW_RULE_STRING_in_ruleParameter1324 = new BitSet(new long[]{0x0000000000000002L}); - -} \ No newline at end of file diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/scribbleTraceDsl/Messagetransfer.java b/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/scribbleTraceDsl/Messagetransfer.java deleted file mode 100644 index a8061da57..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/scribbleTraceDsl/Messagetransfer.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - */ -package org.scribble.trace.editor.dsl.scribbleTraceDsl; - -import org.eclipse.emf.common.util.EList; - -/** - * - * A representation of the model object 'Messagetransfer'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.scribble.trace.editor.dsl.scribbleTraceDsl.Messagetransfer#getParameters Parameters}
  • - *
- *

- * - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.ScribbleTraceDslPackage#getMessagetransfer() - * @model - * @generated - */ -public interface Messagetransfer extends Stepdefn -{ - /** - * Returns the value of the 'Parameters' containment reference list. - * The list contents are of type {@link org.scribble.trace.editor.dsl.scribbleTraceDsl.Parameter}. - * - *

- * If the meaning of the 'Parameters' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Parameters' containment reference list. - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.ScribbleTraceDslPackage#getMessagetransfer_Parameters() - * @model containment="true" - * @generated - */ - EList getParameters(); - -} // Messagetransfer diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/scribbleTraceDsl/Parameter.java b/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/scribbleTraceDsl/Parameter.java deleted file mode 100644 index 407eed625..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/scribbleTraceDsl/Parameter.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - */ -package org.scribble.trace.editor.dsl.scribbleTraceDsl; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Parameter'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.scribble.trace.editor.dsl.scribbleTraceDsl.Parameter#getType Type}
  • - *
  • {@link org.scribble.trace.editor.dsl.scribbleTraceDsl.Parameter#getValue Value}
  • - *
- *

- * - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.ScribbleTraceDslPackage#getParameter() - * @model - * @generated - */ -public interface Parameter extends EObject -{ - /** - * Returns the value of the 'Type' attribute. - * - *

- * If the meaning of the 'Type' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Type' attribute. - * @see #setType(String) - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.ScribbleTraceDslPackage#getParameter_Type() - * @model - * @generated - */ - String getType(); - - /** - * Sets the value of the '{@link org.scribble.trace.editor.dsl.scribbleTraceDsl.Parameter#getType Type}' attribute. - * - * - * @param value the new value of the 'Type' attribute. - * @see #getType() - * @generated - */ - void setType(String value); - - /** - * Returns the value of the 'Value' attribute. - * - *

- * If the meaning of the 'Value' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Value' attribute. - * @see #setValue(String) - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.ScribbleTraceDslPackage#getParameter_Value() - * @model - * @generated - */ - String getValue(); - - /** - * Sets the value of the '{@link org.scribble.trace.editor.dsl.scribbleTraceDsl.Parameter#getValue Value}' attribute. - * - * - * @param value the new value of the 'Value' attribute. - * @see #getValue() - * @generated - */ - void setValue(String value); - -} // Parameter diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/scribbleTraceDsl/ScribbleTraceDslFactory.java b/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/scribbleTraceDsl/ScribbleTraceDslFactory.java deleted file mode 100644 index 86a4fd839..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/scribbleTraceDsl/ScribbleTraceDslFactory.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - */ -package org.scribble.trace.editor.dsl.scribbleTraceDsl; - -import org.eclipse.emf.ecore.EFactory; - -/** - * - * The Factory for the model. - * It provides a create method for each non-abstract class of the model. - * - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.ScribbleTraceDslPackage - * @generated - */ -public interface ScribbleTraceDslFactory extends EFactory -{ - /** - * The singleton instance of the factory. - * - * - * @generated - */ - ScribbleTraceDslFactory eINSTANCE = org.scribble.trace.editor.dsl.scribbleTraceDsl.impl.ScribbleTraceDslFactoryImpl.init(); - - /** - * Returns a new object of class 'Trace'. - * - * - * @return a new object of class 'Trace'. - * @generated - */ - Trace createTrace(); - - /** - * Returns a new object of class 'Stepdefn'. - * - * - * @return a new object of class 'Stepdefn'. - * @generated - */ - Stepdefn createStepdefn(); - - /** - * Returns a new object of class 'Messagetransfer'. - * - * - * @return a new object of class 'Messagetransfer'. - * @generated - */ - Messagetransfer createMessagetransfer(); - - /** - * Returns a new object of class 'Parameter'. - * - * - * @return a new object of class 'Parameter'. - * @generated - */ - Parameter createParameter(); - - /** - * Returns the package supported by this factory. - * - * - * @return the package supported by this factory. - * @generated - */ - ScribbleTraceDslPackage getScribbleTraceDslPackage(); - -} //ScribbleTraceDslFactory diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/scribbleTraceDsl/ScribbleTraceDslPackage.java b/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/scribbleTraceDsl/ScribbleTraceDslPackage.java deleted file mode 100644 index 18ef836f4..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/scribbleTraceDsl/ScribbleTraceDslPackage.java +++ /dev/null @@ -1,381 +0,0 @@ -/** - */ -package org.scribble.trace.editor.dsl.scribbleTraceDsl; - -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; - -/** - * - * The Package for the model. - * It contains accessors for the meta objects to represent - *
    - *
  • each class,
  • - *
  • each feature of each class,
  • - *
  • each enum,
  • - *
  • and each data type
  • - *
- * - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.ScribbleTraceDslFactory - * @model kind="package" - * @generated - */ -public interface ScribbleTraceDslPackage extends EPackage -{ - /** - * The package name. - * - * - * @generated - */ - String eNAME = "scribbleTraceDsl"; - - /** - * The package namespace URI. - * - * - * @generated - */ - String eNS_URI = "http://www.scribble.org/trace/editor/dsl/ScribbleTraceDsl"; - - /** - * The package namespace name. - * - * - * @generated - */ - String eNS_PREFIX = "scribbleTraceDsl"; - - /** - * The singleton instance of the package. - * - * - * @generated - */ - ScribbleTraceDslPackage eINSTANCE = org.scribble.trace.editor.dsl.scribbleTraceDsl.impl.ScribbleTraceDslPackageImpl.init(); - - /** - * The meta object id for the '{@link org.scribble.trace.editor.dsl.scribbleTraceDsl.impl.TraceImpl Trace}' class. - * - * - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.impl.TraceImpl - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.impl.ScribbleTraceDslPackageImpl#getTrace() - * @generated - */ - int TRACE = 0; - - /** - * The feature id for the 'Roles' attribute list. - * - * - * @generated - * @ordered - */ - int TRACE__ROLES = 0; - - /** - * The feature id for the 'Steps' containment reference list. - * - * - * @generated - * @ordered - */ - int TRACE__STEPS = 1; - - /** - * The number of structural features of the 'Trace' class. - * - * - * @generated - * @ordered - */ - int TRACE_FEATURE_COUNT = 2; - - /** - * The meta object id for the '{@link org.scribble.trace.editor.dsl.scribbleTraceDsl.impl.StepdefnImpl Stepdefn}' class. - * - * - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.impl.StepdefnImpl - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.impl.ScribbleTraceDslPackageImpl#getStepdefn() - * @generated - */ - int STEPDEFN = 1; - - /** - * The number of structural features of the 'Stepdefn' class. - * - * - * @generated - * @ordered - */ - int STEPDEFN_FEATURE_COUNT = 0; - - /** - * The meta object id for the '{@link org.scribble.trace.editor.dsl.scribbleTraceDsl.impl.MessagetransferImpl Messagetransfer}' class. - * - * - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.impl.MessagetransferImpl - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.impl.ScribbleTraceDslPackageImpl#getMessagetransfer() - * @generated - */ - int MESSAGETRANSFER = 2; - - /** - * The feature id for the 'Parameters' containment reference list. - * - * - * @generated - * @ordered - */ - int MESSAGETRANSFER__PARAMETERS = STEPDEFN_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'Messagetransfer' class. - * - * - * @generated - * @ordered - */ - int MESSAGETRANSFER_FEATURE_COUNT = STEPDEFN_FEATURE_COUNT + 1; - - /** - * The meta object id for the '{@link org.scribble.trace.editor.dsl.scribbleTraceDsl.impl.ParameterImpl Parameter}' class. - * - * - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.impl.ParameterImpl - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.impl.ScribbleTraceDslPackageImpl#getParameter() - * @generated - */ - int PARAMETER = 3; - - /** - * The feature id for the 'Type' attribute. - * - * - * @generated - * @ordered - */ - int PARAMETER__TYPE = 0; - - /** - * The feature id for the 'Value' attribute. - * - * - * @generated - * @ordered - */ - int PARAMETER__VALUE = 1; - - /** - * The number of structural features of the 'Parameter' class. - * - * - * @generated - * @ordered - */ - int PARAMETER_FEATURE_COUNT = 2; - - - /** - * Returns the meta object for class '{@link org.scribble.trace.editor.dsl.scribbleTraceDsl.Trace Trace}'. - * - * - * @return the meta object for class 'Trace'. - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.Trace - * @generated - */ - EClass getTrace(); - - /** - * Returns the meta object for the attribute list '{@link org.scribble.trace.editor.dsl.scribbleTraceDsl.Trace#getRoles Roles}'. - * - * - * @return the meta object for the attribute list 'Roles'. - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.Trace#getRoles() - * @see #getTrace() - * @generated - */ - EAttribute getTrace_Roles(); - - /** - * Returns the meta object for the containment reference list '{@link org.scribble.trace.editor.dsl.scribbleTraceDsl.Trace#getSteps Steps}'. - * - * - * @return the meta object for the containment reference list 'Steps'. - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.Trace#getSteps() - * @see #getTrace() - * @generated - */ - EReference getTrace_Steps(); - - /** - * Returns the meta object for class '{@link org.scribble.trace.editor.dsl.scribbleTraceDsl.Stepdefn Stepdefn}'. - * - * - * @return the meta object for class 'Stepdefn'. - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.Stepdefn - * @generated - */ - EClass getStepdefn(); - - /** - * Returns the meta object for class '{@link org.scribble.trace.editor.dsl.scribbleTraceDsl.Messagetransfer Messagetransfer}'. - * - * - * @return the meta object for class 'Messagetransfer'. - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.Messagetransfer - * @generated - */ - EClass getMessagetransfer(); - - /** - * Returns the meta object for the containment reference list '{@link org.scribble.trace.editor.dsl.scribbleTraceDsl.Messagetransfer#getParameters Parameters}'. - * - * - * @return the meta object for the containment reference list 'Parameters'. - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.Messagetransfer#getParameters() - * @see #getMessagetransfer() - * @generated - */ - EReference getMessagetransfer_Parameters(); - - /** - * Returns the meta object for class '{@link org.scribble.trace.editor.dsl.scribbleTraceDsl.Parameter Parameter}'. - * - * - * @return the meta object for class 'Parameter'. - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.Parameter - * @generated - */ - EClass getParameter(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.trace.editor.dsl.scribbleTraceDsl.Parameter#getType Type}'. - * - * - * @return the meta object for the attribute 'Type'. - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.Parameter#getType() - * @see #getParameter() - * @generated - */ - EAttribute getParameter_Type(); - - /** - * Returns the meta object for the attribute '{@link org.scribble.trace.editor.dsl.scribbleTraceDsl.Parameter#getValue Value}'. - * - * - * @return the meta object for the attribute 'Value'. - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.Parameter#getValue() - * @see #getParameter() - * @generated - */ - EAttribute getParameter_Value(); - - /** - * Returns the factory that creates the instances of the model. - * - * - * @return the factory that creates the instances of the model. - * @generated - */ - ScribbleTraceDslFactory getScribbleTraceDslFactory(); - - /** - * - * Defines literals for the meta objects that represent - *
    - *
  • each class,
  • - *
  • each feature of each class,
  • - *
  • each enum,
  • - *
  • and each data type
  • - *
- * - * @generated - */ - interface Literals - { - /** - * The meta object literal for the '{@link org.scribble.trace.editor.dsl.scribbleTraceDsl.impl.TraceImpl Trace}' class. - * - * - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.impl.TraceImpl - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.impl.ScribbleTraceDslPackageImpl#getTrace() - * @generated - */ - EClass TRACE = eINSTANCE.getTrace(); - - /** - * The meta object literal for the 'Roles' attribute list feature. - * - * - * @generated - */ - EAttribute TRACE__ROLES = eINSTANCE.getTrace_Roles(); - - /** - * The meta object literal for the 'Steps' containment reference list feature. - * - * - * @generated - */ - EReference TRACE__STEPS = eINSTANCE.getTrace_Steps(); - - /** - * The meta object literal for the '{@link org.scribble.trace.editor.dsl.scribbleTraceDsl.impl.StepdefnImpl Stepdefn}' class. - * - * - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.impl.StepdefnImpl - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.impl.ScribbleTraceDslPackageImpl#getStepdefn() - * @generated - */ - EClass STEPDEFN = eINSTANCE.getStepdefn(); - - /** - * The meta object literal for the '{@link org.scribble.trace.editor.dsl.scribbleTraceDsl.impl.MessagetransferImpl Messagetransfer}' class. - * - * - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.impl.MessagetransferImpl - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.impl.ScribbleTraceDslPackageImpl#getMessagetransfer() - * @generated - */ - EClass MESSAGETRANSFER = eINSTANCE.getMessagetransfer(); - - /** - * The meta object literal for the 'Parameters' containment reference list feature. - * - * - * @generated - */ - EReference MESSAGETRANSFER__PARAMETERS = eINSTANCE.getMessagetransfer_Parameters(); - - /** - * The meta object literal for the '{@link org.scribble.trace.editor.dsl.scribbleTraceDsl.impl.ParameterImpl Parameter}' class. - * - * - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.impl.ParameterImpl - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.impl.ScribbleTraceDslPackageImpl#getParameter() - * @generated - */ - EClass PARAMETER = eINSTANCE.getParameter(); - - /** - * The meta object literal for the 'Type' attribute feature. - * - * - * @generated - */ - EAttribute PARAMETER__TYPE = eINSTANCE.getParameter_Type(); - - /** - * The meta object literal for the 'Value' attribute feature. - * - * - * @generated - */ - EAttribute PARAMETER__VALUE = eINSTANCE.getParameter_Value(); - - } - -} //ScribbleTraceDslPackage diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/scribbleTraceDsl/Stepdefn.java b/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/scribbleTraceDsl/Stepdefn.java deleted file mode 100644 index c5cc3d5f6..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/scribbleTraceDsl/Stepdefn.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - */ -package org.scribble.trace.editor.dsl.scribbleTraceDsl; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Stepdefn'. - * - * - * - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.ScribbleTraceDslPackage#getStepdefn() - * @model - * @generated - */ -public interface Stepdefn extends EObject -{ -} // Stepdefn diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/scribbleTraceDsl/Trace.java b/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/scribbleTraceDsl/Trace.java deleted file mode 100644 index 84e84ac84..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/scribbleTraceDsl/Trace.java +++ /dev/null @@ -1,60 +0,0 @@ -/** - */ -package org.scribble.trace.editor.dsl.scribbleTraceDsl; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Trace'. - * - * - *

- * The following features are supported: - *

    - *
  • {@link org.scribble.trace.editor.dsl.scribbleTraceDsl.Trace#getRoles Roles}
  • - *
  • {@link org.scribble.trace.editor.dsl.scribbleTraceDsl.Trace#getSteps Steps}
  • - *
- *

- * - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.ScribbleTraceDslPackage#getTrace() - * @model - * @generated - */ -public interface Trace extends EObject -{ - /** - * Returns the value of the 'Roles' attribute list. - * The list contents are of type {@link java.lang.String}. - * - *

- * If the meaning of the 'Roles' attribute list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Roles' attribute list. - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.ScribbleTraceDslPackage#getTrace_Roles() - * @model unique="false" - * @generated - */ - EList getRoles(); - - /** - * Returns the value of the 'Steps' containment reference list. - * The list contents are of type {@link org.scribble.trace.editor.dsl.scribbleTraceDsl.Stepdefn}. - * - *

- * If the meaning of the 'Steps' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Steps' containment reference list. - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.ScribbleTraceDslPackage#getTrace_Steps() - * @model containment="true" - * @generated - */ - EList getSteps(); - -} // Trace diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/scribbleTraceDsl/impl/MessagetransferImpl.java b/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/scribbleTraceDsl/impl/MessagetransferImpl.java deleted file mode 100644 index ac38b0182..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/scribbleTraceDsl/impl/MessagetransferImpl.java +++ /dev/null @@ -1,165 +0,0 @@ -/** - */ -package org.scribble.trace.editor.dsl.scribbleTraceDsl.impl; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -import org.scribble.trace.editor.dsl.scribbleTraceDsl.Messagetransfer; -import org.scribble.trace.editor.dsl.scribbleTraceDsl.Parameter; -import org.scribble.trace.editor.dsl.scribbleTraceDsl.ScribbleTraceDslPackage; - -/** - * - * An implementation of the model object 'Messagetransfer'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.scribble.trace.editor.dsl.scribbleTraceDsl.impl.MessagetransferImpl#getParameters Parameters}
  • - *
- *

- * - * @generated - */ -public class MessagetransferImpl extends StepdefnImpl implements Messagetransfer -{ - /** - * The cached value of the '{@link #getParameters() Parameters}' containment reference list. - * - * - * @see #getParameters() - * @generated - * @ordered - */ - protected EList parameters; - - /** - * - * - * @generated - */ - protected MessagetransferImpl() - { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() - { - return ScribbleTraceDslPackage.Literals.MESSAGETRANSFER; - } - - /** - * - * - * @generated - */ - public EList getParameters() - { - if (parameters == null) - { - parameters = new EObjectContainmentEList(Parameter.class, this, ScribbleTraceDslPackage.MESSAGETRANSFER__PARAMETERS); - } - return parameters; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case ScribbleTraceDslPackage.MESSAGETRANSFER__PARAMETERS: - return ((InternalEList)getParameters()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ScribbleTraceDslPackage.MESSAGETRANSFER__PARAMETERS: - return getParameters(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ScribbleTraceDslPackage.MESSAGETRANSFER__PARAMETERS: - getParameters().clear(); - getParameters().addAll((Collection)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) - { - switch (featureID) - { - case ScribbleTraceDslPackage.MESSAGETRANSFER__PARAMETERS: - getParameters().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ScribbleTraceDslPackage.MESSAGETRANSFER__PARAMETERS: - return parameters != null && !parameters.isEmpty(); - } - return super.eIsSet(featureID); - } - -} //MessagetransferImpl diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/scribbleTraceDsl/impl/ParameterImpl.java b/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/scribbleTraceDsl/impl/ParameterImpl.java deleted file mode 100644 index 80ddced42..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/scribbleTraceDsl/impl/ParameterImpl.java +++ /dev/null @@ -1,233 +0,0 @@ -/** - */ -package org.scribble.trace.editor.dsl.scribbleTraceDsl.impl; - -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.ecore.EClass; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; - -import org.scribble.trace.editor.dsl.scribbleTraceDsl.Parameter; -import org.scribble.trace.editor.dsl.scribbleTraceDsl.ScribbleTraceDslPackage; - -/** - * - * An implementation of the model object 'Parameter'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.scribble.trace.editor.dsl.scribbleTraceDsl.impl.ParameterImpl#getType Type}
  • - *
  • {@link org.scribble.trace.editor.dsl.scribbleTraceDsl.impl.ParameterImpl#getValue Value}
  • - *
- *

- * - * @generated - */ -public class ParameterImpl extends MinimalEObjectImpl.Container implements Parameter -{ - /** - * The default value of the '{@link #getType() Type}' attribute. - * - * - * @see #getType() - * @generated - * @ordered - */ - protected static final String TYPE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getType() Type}' attribute. - * - * - * @see #getType() - * @generated - * @ordered - */ - protected String type = TYPE_EDEFAULT; - - /** - * The default value of the '{@link #getValue() Value}' attribute. - * - * - * @see #getValue() - * @generated - * @ordered - */ - protected static final String VALUE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getValue() Value}' attribute. - * - * - * @see #getValue() - * @generated - * @ordered - */ - protected String value = VALUE_EDEFAULT; - - /** - * - * - * @generated - */ - protected ParameterImpl() - { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() - { - return ScribbleTraceDslPackage.Literals.PARAMETER; - } - - /** - * - * - * @generated - */ - public String getType() - { - return type; - } - - /** - * - * - * @generated - */ - public void setType(String newType) - { - String oldType = type; - type = newType; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleTraceDslPackage.PARAMETER__TYPE, oldType, type)); - } - - /** - * - * - * @generated - */ - public String getValue() - { - return value; - } - - /** - * - * - * @generated - */ - public void setValue(String newValue) - { - String oldValue = value; - value = newValue; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ScribbleTraceDslPackage.PARAMETER__VALUE, oldValue, value)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ScribbleTraceDslPackage.PARAMETER__TYPE: - return getType(); - case ScribbleTraceDslPackage.PARAMETER__VALUE: - return getValue(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ScribbleTraceDslPackage.PARAMETER__TYPE: - setType((String)newValue); - return; - case ScribbleTraceDslPackage.PARAMETER__VALUE: - setValue((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) - { - switch (featureID) - { - case ScribbleTraceDslPackage.PARAMETER__TYPE: - setType(TYPE_EDEFAULT); - return; - case ScribbleTraceDslPackage.PARAMETER__VALUE: - setValue(VALUE_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ScribbleTraceDslPackage.PARAMETER__TYPE: - return TYPE_EDEFAULT == null ? type != null : !TYPE_EDEFAULT.equals(type); - case ScribbleTraceDslPackage.PARAMETER__VALUE: - return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (type: "); - result.append(type); - result.append(", value: "); - result.append(value); - result.append(')'); - return result.toString(); - } - -} //ParameterImpl diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/scribbleTraceDsl/impl/ScribbleTraceDslFactoryImpl.java b/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/scribbleTraceDsl/impl/ScribbleTraceDslFactoryImpl.java deleted file mode 100644 index 9a5c9f242..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/scribbleTraceDsl/impl/ScribbleTraceDslFactoryImpl.java +++ /dev/null @@ -1,142 +0,0 @@ -/** - */ -package org.scribble.trace.editor.dsl.scribbleTraceDsl.impl; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; - -import org.eclipse.emf.ecore.impl.EFactoryImpl; - -import org.eclipse.emf.ecore.plugin.EcorePlugin; - -import org.scribble.trace.editor.dsl.scribbleTraceDsl.*; - -/** - * - * An implementation of the model Factory. - * - * @generated - */ -public class ScribbleTraceDslFactoryImpl extends EFactoryImpl implements ScribbleTraceDslFactory -{ - /** - * Creates the default factory implementation. - * - * - * @generated - */ - public static ScribbleTraceDslFactory init() - { - try - { - ScribbleTraceDslFactory theScribbleTraceDslFactory = (ScribbleTraceDslFactory)EPackage.Registry.INSTANCE.getEFactory(ScribbleTraceDslPackage.eNS_URI); - if (theScribbleTraceDslFactory != null) - { - return theScribbleTraceDslFactory; - } - } - catch (Exception exception) - { - EcorePlugin.INSTANCE.log(exception); - } - return new ScribbleTraceDslFactoryImpl(); - } - - /** - * Creates an instance of the factory. - * - * - * @generated - */ - public ScribbleTraceDslFactoryImpl() - { - super(); - } - - /** - * - * - * @generated - */ - @Override - public EObject create(EClass eClass) - { - switch (eClass.getClassifierID()) - { - case ScribbleTraceDslPackage.TRACE: return createTrace(); - case ScribbleTraceDslPackage.STEPDEFN: return createStepdefn(); - case ScribbleTraceDslPackage.MESSAGETRANSFER: return createMessagetransfer(); - case ScribbleTraceDslPackage.PARAMETER: return createParameter(); - default: - throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); - } - } - - /** - * - * - * @generated - */ - public Trace createTrace() - { - TraceImpl trace = new TraceImpl(); - return trace; - } - - /** - * - * - * @generated - */ - public Stepdefn createStepdefn() - { - StepdefnImpl stepdefn = new StepdefnImpl(); - return stepdefn; - } - - /** - * - * - * @generated - */ - public Messagetransfer createMessagetransfer() - { - MessagetransferImpl messagetransfer = new MessagetransferImpl(); - return messagetransfer; - } - - /** - * - * - * @generated - */ - public Parameter createParameter() - { - ParameterImpl parameter = new ParameterImpl(); - return parameter; - } - - /** - * - * - * @generated - */ - public ScribbleTraceDslPackage getScribbleTraceDslPackage() - { - return (ScribbleTraceDslPackage)getEPackage(); - } - - /** - * - * - * @deprecated - * @generated - */ - @Deprecated - public static ScribbleTraceDslPackage getPackage() - { - return ScribbleTraceDslPackage.eINSTANCE; - } - -} //ScribbleTraceDslFactoryImpl diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/scribbleTraceDsl/impl/ScribbleTraceDslPackageImpl.java b/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/scribbleTraceDsl/impl/ScribbleTraceDslPackageImpl.java deleted file mode 100644 index 919f31988..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/scribbleTraceDsl/impl/ScribbleTraceDslPackageImpl.java +++ /dev/null @@ -1,301 +0,0 @@ -/** - */ -package org.scribble.trace.editor.dsl.scribbleTraceDsl.impl; - -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; - -import org.eclipse.emf.ecore.impl.EPackageImpl; - -import org.scribble.trace.editor.dsl.scribbleTraceDsl.Messagetransfer; -import org.scribble.trace.editor.dsl.scribbleTraceDsl.Parameter; -import org.scribble.trace.editor.dsl.scribbleTraceDsl.ScribbleTraceDslFactory; -import org.scribble.trace.editor.dsl.scribbleTraceDsl.ScribbleTraceDslPackage; -import org.scribble.trace.editor.dsl.scribbleTraceDsl.Stepdefn; -import org.scribble.trace.editor.dsl.scribbleTraceDsl.Trace; - -/** - * - * An implementation of the model Package. - * - * @generated - */ -public class ScribbleTraceDslPackageImpl extends EPackageImpl implements ScribbleTraceDslPackage -{ - /** - * - * - * @generated - */ - private EClass traceEClass = null; - - /** - * - * - * @generated - */ - private EClass stepdefnEClass = null; - - /** - * - * - * @generated - */ - private EClass messagetransferEClass = null; - - /** - * - * - * @generated - */ - private EClass parameterEClass = null; - - /** - * Creates an instance of the model Package, registered with - * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package - * package URI value. - *

Note: the correct way to create the package is via the static - * factory method {@link #init init()}, which also performs - * initialization of the package, or returns the registered package, - * if one already exists. - * - * - * @see org.eclipse.emf.ecore.EPackage.Registry - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.ScribbleTraceDslPackage#eNS_URI - * @see #init() - * @generated - */ - private ScribbleTraceDslPackageImpl() - { - super(eNS_URI, ScribbleTraceDslFactory.eINSTANCE); - } - - /** - * - * - * @generated - */ - private static boolean isInited = false; - - /** - * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. - * - *

This method is used to initialize {@link ScribbleTraceDslPackage#eINSTANCE} when that field is accessed. - * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. - * - * - * @see #eNS_URI - * @see #createPackageContents() - * @see #initializePackageContents() - * @generated - */ - public static ScribbleTraceDslPackage init() - { - if (isInited) return (ScribbleTraceDslPackage)EPackage.Registry.INSTANCE.getEPackage(ScribbleTraceDslPackage.eNS_URI); - - // Obtain or create and register package - ScribbleTraceDslPackageImpl theScribbleTraceDslPackage = (ScribbleTraceDslPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof ScribbleTraceDslPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new ScribbleTraceDslPackageImpl()); - - isInited = true; - - // Create package meta-data objects - theScribbleTraceDslPackage.createPackageContents(); - - // Initialize created meta-data - theScribbleTraceDslPackage.initializePackageContents(); - - // Mark meta-data to indicate it can't be changed - theScribbleTraceDslPackage.freeze(); - - - // Update the registry and return the package - EPackage.Registry.INSTANCE.put(ScribbleTraceDslPackage.eNS_URI, theScribbleTraceDslPackage); - return theScribbleTraceDslPackage; - } - - /** - * - * - * @generated - */ - public EClass getTrace() - { - return traceEClass; - } - - /** - * - * - * @generated - */ - public EAttribute getTrace_Roles() - { - return (EAttribute)traceEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EReference getTrace_Steps() - { - return (EReference)traceEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public EClass getStepdefn() - { - return stepdefnEClass; - } - - /** - * - * - * @generated - */ - public EClass getMessagetransfer() - { - return messagetransferEClass; - } - - /** - * - * - * @generated - */ - public EReference getMessagetransfer_Parameters() - { - return (EReference)messagetransferEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EClass getParameter() - { - return parameterEClass; - } - - /** - * - * - * @generated - */ - public EAttribute getParameter_Type() - { - return (EAttribute)parameterEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EAttribute getParameter_Value() - { - return (EAttribute)parameterEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public ScribbleTraceDslFactory getScribbleTraceDslFactory() - { - return (ScribbleTraceDslFactory)getEFactoryInstance(); - } - - /** - * - * - * @generated - */ - private boolean isCreated = false; - - /** - * Creates the meta-model objects for the package. This method is - * guarded to have no affect on any invocation but its first. - * - * - * @generated - */ - public void createPackageContents() - { - if (isCreated) return; - isCreated = true; - - // Create classes and their features - traceEClass = createEClass(TRACE); - createEAttribute(traceEClass, TRACE__ROLES); - createEReference(traceEClass, TRACE__STEPS); - - stepdefnEClass = createEClass(STEPDEFN); - - messagetransferEClass = createEClass(MESSAGETRANSFER); - createEReference(messagetransferEClass, MESSAGETRANSFER__PARAMETERS); - - parameterEClass = createEClass(PARAMETER); - createEAttribute(parameterEClass, PARAMETER__TYPE); - createEAttribute(parameterEClass, PARAMETER__VALUE); - } - - /** - * - * - * @generated - */ - private boolean isInitialized = false; - - /** - * Complete the initialization of the package and its meta-model. This - * method is guarded to have no affect on any invocation but its first. - * - * - * @generated - */ - public void initializePackageContents() - { - if (isInitialized) return; - isInitialized = true; - - // Initialize package - setName(eNAME); - setNsPrefix(eNS_PREFIX); - setNsURI(eNS_URI); - - // Create type parameters - - // Set bounds for type parameters - - // Add supertypes to classes - messagetransferEClass.getESuperTypes().add(this.getStepdefn()); - - // Initialize classes and features; add operations and parameters - initEClass(traceEClass, Trace.class, "Trace", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getTrace_Roles(), ecorePackage.getEString(), "roles", null, 0, -1, Trace.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getTrace_Steps(), this.getStepdefn(), null, "steps", null, 0, -1, Trace.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(stepdefnEClass, Stepdefn.class, "Stepdefn", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - - initEClass(messagetransferEClass, Messagetransfer.class, "Messagetransfer", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getMessagetransfer_Parameters(), this.getParameter(), null, "parameters", null, 0, -1, Messagetransfer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(parameterEClass, Parameter.class, "Parameter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getParameter_Type(), ecorePackage.getEString(), "type", null, 0, 1, Parameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getParameter_Value(), ecorePackage.getEString(), "value", null, 0, 1, Parameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - // Create resource - createResource(eNS_URI); - } - -} //ScribbleTraceDslPackageImpl diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/scribbleTraceDsl/impl/StepdefnImpl.java b/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/scribbleTraceDsl/impl/StepdefnImpl.java deleted file mode 100644 index 9c09afee8..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/scribbleTraceDsl/impl/StepdefnImpl.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - */ -package org.scribble.trace.editor.dsl.scribbleTraceDsl.impl; - -import org.eclipse.emf.ecore.EClass; - -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; - -import org.scribble.trace.editor.dsl.scribbleTraceDsl.ScribbleTraceDslPackage; -import org.scribble.trace.editor.dsl.scribbleTraceDsl.Stepdefn; - -/** - * - * An implementation of the model object 'Stepdefn'. - * - *

- *

- * - * @generated - */ -public class StepdefnImpl extends MinimalEObjectImpl.Container implements Stepdefn -{ - /** - * - * - * @generated - */ - protected StepdefnImpl() - { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() - { - return ScribbleTraceDslPackage.Literals.STEPDEFN; - } - -} //StepdefnImpl diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/scribbleTraceDsl/impl/TraceImpl.java b/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/scribbleTraceDsl/impl/TraceImpl.java deleted file mode 100644 index 19d52cd1c..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/scribbleTraceDsl/impl/TraceImpl.java +++ /dev/null @@ -1,221 +0,0 @@ -/** - */ -package org.scribble.trace.editor.dsl.scribbleTraceDsl.impl; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; - -import org.eclipse.emf.ecore.util.EDataTypeEList; -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -import org.scribble.trace.editor.dsl.scribbleTraceDsl.ScribbleTraceDslPackage; -import org.scribble.trace.editor.dsl.scribbleTraceDsl.Stepdefn; -import org.scribble.trace.editor.dsl.scribbleTraceDsl.Trace; - -/** - * - * An implementation of the model object 'Trace'. - * - *

- * The following features are implemented: - *

    - *
  • {@link org.scribble.trace.editor.dsl.scribbleTraceDsl.impl.TraceImpl#getRoles Roles}
  • - *
  • {@link org.scribble.trace.editor.dsl.scribbleTraceDsl.impl.TraceImpl#getSteps Steps}
  • - *
- *

- * - * @generated - */ -public class TraceImpl extends MinimalEObjectImpl.Container implements Trace -{ - /** - * The cached value of the '{@link #getRoles() Roles}' attribute list. - * - * - * @see #getRoles() - * @generated - * @ordered - */ - protected EList roles; - - /** - * The cached value of the '{@link #getSteps() Steps}' containment reference list. - * - * - * @see #getSteps() - * @generated - * @ordered - */ - protected EList steps; - - /** - * - * - * @generated - */ - protected TraceImpl() - { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() - { - return ScribbleTraceDslPackage.Literals.TRACE; - } - - /** - * - * - * @generated - */ - public EList getRoles() - { - if (roles == null) - { - roles = new EDataTypeEList(String.class, this, ScribbleTraceDslPackage.TRACE__ROLES); - } - return roles; - } - - /** - * - * - * @generated - */ - public EList getSteps() - { - if (steps == null) - { - steps = new EObjectContainmentEList(Stepdefn.class, this, ScribbleTraceDslPackage.TRACE__STEPS); - } - return steps; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) - { - switch (featureID) - { - case ScribbleTraceDslPackage.TRACE__STEPS: - return ((InternalEList)getSteps()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) - { - switch (featureID) - { - case ScribbleTraceDslPackage.TRACE__ROLES: - return getRoles(); - case ScribbleTraceDslPackage.TRACE__STEPS: - return getSteps(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) - { - switch (featureID) - { - case ScribbleTraceDslPackage.TRACE__ROLES: - getRoles().clear(); - getRoles().addAll((Collection)newValue); - return; - case ScribbleTraceDslPackage.TRACE__STEPS: - getSteps().clear(); - getSteps().addAll((Collection)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) - { - switch (featureID) - { - case ScribbleTraceDslPackage.TRACE__ROLES: - getRoles().clear(); - return; - case ScribbleTraceDslPackage.TRACE__STEPS: - getSteps().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) - { - switch (featureID) - { - case ScribbleTraceDslPackage.TRACE__ROLES: - return roles != null && !roles.isEmpty(); - case ScribbleTraceDslPackage.TRACE__STEPS: - return steps != null && !steps.isEmpty(); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() - { - if (eIsProxy()) return super.toString(); - - StringBuffer result = new StringBuffer(super.toString()); - result.append(" (roles: "); - result.append(roles); - result.append(')'); - return result.toString(); - } - -} //TraceImpl diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/scribbleTraceDsl/util/ScribbleTraceDslAdapterFactory.java b/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/scribbleTraceDsl/util/ScribbleTraceDslAdapterFactory.java deleted file mode 100644 index f23962d6e..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/scribbleTraceDsl/util/ScribbleTraceDslAdapterFactory.java +++ /dev/null @@ -1,192 +0,0 @@ -/** - */ -package org.scribble.trace.editor.dsl.scribbleTraceDsl.util; - -import org.eclipse.emf.common.notify.Adapter; -import org.eclipse.emf.common.notify.Notifier; - -import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; - -import org.eclipse.emf.ecore.EObject; - -import org.scribble.trace.editor.dsl.scribbleTraceDsl.*; - -/** - * - * The Adapter Factory for the model. - * It provides an adapter createXXX method for each class of the model. - * - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.ScribbleTraceDslPackage - * @generated - */ -public class ScribbleTraceDslAdapterFactory extends AdapterFactoryImpl -{ - /** - * The cached model package. - * - * - * @generated - */ - protected static ScribbleTraceDslPackage modelPackage; - - /** - * Creates an instance of the adapter factory. - * - * - * @generated - */ - public ScribbleTraceDslAdapterFactory() - { - if (modelPackage == null) - { - modelPackage = ScribbleTraceDslPackage.eINSTANCE; - } - } - - /** - * Returns whether this factory is applicable for the type of the object. - * - * This implementation returns true if the object is either the model's package or is an instance object of the model. - * - * @return whether this factory is applicable for the type of the object. - * @generated - */ - @Override - public boolean isFactoryForType(Object object) - { - if (object == modelPackage) - { - return true; - } - if (object instanceof EObject) - { - return ((EObject)object).eClass().getEPackage() == modelPackage; - } - return false; - } - - /** - * The switch that delegates to the createXXX methods. - * - * - * @generated - */ - protected ScribbleTraceDslSwitch modelSwitch = - new ScribbleTraceDslSwitch() - { - @Override - public Adapter caseTrace(Trace object) - { - return createTraceAdapter(); - } - @Override - public Adapter caseStepdefn(Stepdefn object) - { - return createStepdefnAdapter(); - } - @Override - public Adapter caseMessagetransfer(Messagetransfer object) - { - return createMessagetransferAdapter(); - } - @Override - public Adapter caseParameter(Parameter object) - { - return createParameterAdapter(); - } - @Override - public Adapter defaultCase(EObject object) - { - return createEObjectAdapter(); - } - }; - - /** - * Creates an adapter for the target. - * - * - * @param target the object to adapt. - * @return the adapter for the target. - * @generated - */ - @Override - public Adapter createAdapter(Notifier target) - { - return modelSwitch.doSwitch((EObject)target); - } - - - /** - * Creates a new adapter for an object of class '{@link org.scribble.trace.editor.dsl.scribbleTraceDsl.Trace Trace}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.Trace - * @generated - */ - public Adapter createTraceAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.scribble.trace.editor.dsl.scribbleTraceDsl.Stepdefn Stepdefn}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.Stepdefn - * @generated - */ - public Adapter createStepdefnAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.scribble.trace.editor.dsl.scribbleTraceDsl.Messagetransfer Messagetransfer}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.Messagetransfer - * @generated - */ - public Adapter createMessagetransferAdapter() - { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.scribble.trace.editor.dsl.scribbleTraceDsl.Parameter Parameter}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.Parameter - * @generated - */ - public Adapter createParameterAdapter() - { - return null; - } - - /** - * Creates a new adapter for the default case. - * - * This default implementation returns null. - * - * @return the new adapter. - * @generated - */ - public Adapter createEObjectAdapter() - { - return null; - } - -} //ScribbleTraceDslAdapterFactory diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/scribbleTraceDsl/util/ScribbleTraceDslSwitch.java b/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/scribbleTraceDsl/util/ScribbleTraceDslSwitch.java deleted file mode 100644 index a98b34bf5..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/scribbleTraceDsl/util/ScribbleTraceDslSwitch.java +++ /dev/null @@ -1,189 +0,0 @@ -/** - */ -package org.scribble.trace.editor.dsl.scribbleTraceDsl.util; - -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; - -import org.eclipse.emf.ecore.util.Switch; - -import org.scribble.trace.editor.dsl.scribbleTraceDsl.*; - -/** - * - * The Switch for the model's inheritance hierarchy. - * It supports the call {@link #doSwitch(EObject) doSwitch(object)} - * to invoke the caseXXX method for each class of the model, - * starting with the actual class of the object - * and proceeding up the inheritance hierarchy - * until a non-null result is returned, - * which is the result of the switch. - * - * @see org.scribble.trace.editor.dsl.scribbleTraceDsl.ScribbleTraceDslPackage - * @generated - */ -public class ScribbleTraceDslSwitch extends Switch -{ - /** - * The cached model package - * - * - * @generated - */ - protected static ScribbleTraceDslPackage modelPackage; - - /** - * Creates an instance of the switch. - * - * - * @generated - */ - public ScribbleTraceDslSwitch() - { - if (modelPackage == null) - { - modelPackage = ScribbleTraceDslPackage.eINSTANCE; - } - } - - /** - * Checks whether this is a switch for the given package. - * - * - * @parameter ePackage the package in question. - * @return whether this is a switch for the given package. - * @generated - */ - @Override - protected boolean isSwitchFor(EPackage ePackage) - { - return ePackage == modelPackage; - } - - /** - * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. - * - * - * @return the first non-null result returned by a caseXXX call. - * @generated - */ - @Override - protected T doSwitch(int classifierID, EObject theEObject) - { - switch (classifierID) - { - case ScribbleTraceDslPackage.TRACE: - { - Trace trace = (Trace)theEObject; - T result = caseTrace(trace); - if (result == null) result = defaultCase(theEObject); - return result; - } - case ScribbleTraceDslPackage.STEPDEFN: - { - Stepdefn stepdefn = (Stepdefn)theEObject; - T result = caseStepdefn(stepdefn); - if (result == null) result = defaultCase(theEObject); - return result; - } - case ScribbleTraceDslPackage.MESSAGETRANSFER: - { - Messagetransfer messagetransfer = (Messagetransfer)theEObject; - T result = caseMessagetransfer(messagetransfer); - if (result == null) result = caseStepdefn(messagetransfer); - if (result == null) result = defaultCase(theEObject); - return result; - } - case ScribbleTraceDslPackage.PARAMETER: - { - Parameter parameter = (Parameter)theEObject; - T result = caseParameter(parameter); - if (result == null) result = defaultCase(theEObject); - return result; - } - default: return defaultCase(theEObject); - } - } - - /** - * Returns the result of interpreting the object as an instance of 'Trace'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Trace'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseTrace(Trace object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Stepdefn'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Stepdefn'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseStepdefn(Stepdefn object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Messagetransfer'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Messagetransfer'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseMessagetransfer(Messagetransfer object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Parameter'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Parameter'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseParameter(Parameter object) - { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'EObject'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch, but this is the last case anyway. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'EObject'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) - * @generated - */ - @Override - public T defaultCase(EObject object) - { - return null; - } - -} //ScribbleTraceDslSwitch diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/serializer/ScribbleTraceDslSemanticSequencer.java b/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/serializer/ScribbleTraceDslSemanticSequencer.java deleted file mode 100644 index 69586a46e..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/serializer/ScribbleTraceDslSemanticSequencer.java +++ /dev/null @@ -1,75 +0,0 @@ -package org.scribble.trace.editor.dsl.serializer; - -import com.google.inject.Inject; -import com.google.inject.Provider; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.xtext.serializer.acceptor.ISemanticSequenceAcceptor; -import org.eclipse.xtext.serializer.diagnostic.ISemanticSequencerDiagnosticProvider; -import org.eclipse.xtext.serializer.diagnostic.ISerializationDiagnostic.Acceptor; -import org.eclipse.xtext.serializer.sequencer.AbstractDelegatingSemanticSequencer; -import org.eclipse.xtext.serializer.sequencer.GenericSequencer; -import org.eclipse.xtext.serializer.sequencer.ISemanticSequencer; -import org.eclipse.xtext.serializer.sequencer.ITransientValueService; -import org.scribble.trace.editor.dsl.scribbleTraceDsl.Messagetransfer; -import org.scribble.trace.editor.dsl.scribbleTraceDsl.Parameter; -import org.scribble.trace.editor.dsl.scribbleTraceDsl.ScribbleTraceDslPackage; -import org.scribble.trace.editor.dsl.scribbleTraceDsl.Trace; -import org.scribble.trace.editor.dsl.services.ScribbleTraceDslGrammarAccess; - -@SuppressWarnings("all") -public class ScribbleTraceDslSemanticSequencer extends AbstractDelegatingSemanticSequencer { - - @Inject - private ScribbleTraceDslGrammarAccess grammarAccess; - - public void createSequence(EObject context, EObject semanticObject) { - if(semanticObject.eClass().getEPackage() == ScribbleTraceDslPackage.eINSTANCE) switch(semanticObject.eClass().getClassifierID()) { - case ScribbleTraceDslPackage.MESSAGETRANSFER: - if(context == grammarAccess.getMessagetransferRule() || - context == grammarAccess.getStepdefnRule()) { - sequence_Messagetransfer(context, (Messagetransfer) semanticObject); - return; - } - else break; - case ScribbleTraceDslPackage.PARAMETER: - if(context == grammarAccess.getParameterRule()) { - sequence_Parameter(context, (Parameter) semanticObject); - return; - } - else break; - case ScribbleTraceDslPackage.TRACE: - if(context == grammarAccess.getTraceRule()) { - sequence_Trace(context, (Trace) semanticObject); - return; - } - else break; - } - if (errorAcceptor != null) errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context)); - } - - /** - * Constraint: - * ((parameters+=Parameter parameters+=Parameter*)?) - */ - protected void sequence_Messagetransfer(EObject context, Messagetransfer semanticObject) { - genericSequencer.createSequence(context, semanticObject); - } - - - /** - * Constraint: - * (type=STRING value=STRING?) - */ - protected void sequence_Parameter(EObject context, Parameter semanticObject) { - genericSequencer.createSequence(context, semanticObject); - } - - - /** - * Constraint: - * (roles+=Roledefn* steps+=Stepdefn*) - */ - protected void sequence_Trace(EObject context, Trace semanticObject) { - genericSequencer.createSequence(context, semanticObject); - } -} diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/serializer/ScribbleTraceDslSyntacticSequencer.java b/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/serializer/ScribbleTraceDslSyntacticSequencer.java deleted file mode 100644 index 05138fa2f..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/serializer/ScribbleTraceDslSyntacticSequencer.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.scribble.trace.editor.dsl.serializer; - -import com.google.inject.Inject; -import java.util.List; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.xtext.IGrammarAccess; -import org.eclipse.xtext.RuleCall; -import org.eclipse.xtext.nodemodel.INode; -import org.eclipse.xtext.serializer.analysis.GrammarAlias.AbstractElementAlias; -import org.eclipse.xtext.serializer.analysis.GrammarAlias.GroupAlias; -import org.eclipse.xtext.serializer.analysis.GrammarAlias.TokenAlias; -import org.eclipse.xtext.serializer.analysis.ISyntacticSequencerPDAProvider.ISynNavigable; -import org.eclipse.xtext.serializer.analysis.ISyntacticSequencerPDAProvider.ISynTransition; -import org.eclipse.xtext.serializer.sequencer.AbstractSyntacticSequencer; -import org.scribble.trace.editor.dsl.services.ScribbleTraceDslGrammarAccess; - -@SuppressWarnings("all") -public class ScribbleTraceDslSyntacticSequencer extends AbstractSyntacticSequencer { - - protected ScribbleTraceDslGrammarAccess grammarAccess; - protected AbstractElementAlias match_Messagetransfer___CommaKeyword_7_0_IDTerminalRuleCall_7_1__a; - protected AbstractElementAlias match_Messagetransfer___LeftParenthesisKeyword_2_0_RightParenthesisKeyword_2_2__q; - - @Inject - protected void init(IGrammarAccess access) { - grammarAccess = (ScribbleTraceDslGrammarAccess) access; - match_Messagetransfer___CommaKeyword_7_0_IDTerminalRuleCall_7_1__a = new GroupAlias(true, true, new TokenAlias(false, false, grammarAccess.getMessagetransferAccess().getCommaKeyword_7_0()), new TokenAlias(false, false, grammarAccess.getMessagetransferAccess().getIDTerminalRuleCall_7_1())); - match_Messagetransfer___LeftParenthesisKeyword_2_0_RightParenthesisKeyword_2_2__q = new GroupAlias(false, true, new TokenAlias(false, false, grammarAccess.getMessagetransferAccess().getLeftParenthesisKeyword_2_0()), new TokenAlias(false, false, grammarAccess.getMessagetransferAccess().getRightParenthesisKeyword_2_2())); - } - - @Override - protected String getUnassignedRuleCallToken(EObject semanticObject, RuleCall ruleCall, INode node) { - if(ruleCall.getRule() == grammarAccess.getIDRule()) - return getIDToken(semanticObject, ruleCall, node); - else if(ruleCall.getRule() == grammarAccess.getTracedefnRule()) - return getTracedefnToken(semanticObject, ruleCall, node); - return ""; - } - - /** - * terminal ID : '^'?('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'_'|'0'..'9')*; - */ - protected String getIDToken(EObject semanticObject, RuleCall ruleCall, INode node) { - if (node != null) - return getTokenText(node); - return ""; - } - - /** - * Tracedefn: 'trace' ID ( 'by' Sentence ( 'shows' Sentence )? )? ';' ; - */ - protected String getTracedefnToken(EObject semanticObject, RuleCall ruleCall, INode node) { - if (node != null) - return getTokenText(node); - return "trace;"; - } - - @Override - protected void emitUnassignedTokens(EObject semanticObject, ISynTransition transition, INode fromNode, INode toNode) { - if (transition.getAmbiguousSyntaxes().isEmpty()) return; - List transitionNodes = collectNodes(fromNode, toNode); - for (AbstractElementAlias syntax : transition.getAmbiguousSyntaxes()) { - List syntaxNodes = getNodesFor(transitionNodes, syntax); - if(match_Messagetransfer___CommaKeyword_7_0_IDTerminalRuleCall_7_1__a.equals(syntax)) - emit_Messagetransfer___CommaKeyword_7_0_IDTerminalRuleCall_7_1__a(semanticObject, getLastNavigableState(), syntaxNodes); - else if(match_Messagetransfer___LeftParenthesisKeyword_2_0_RightParenthesisKeyword_2_2__q.equals(syntax)) - emit_Messagetransfer___LeftParenthesisKeyword_2_0_RightParenthesisKeyword_2_2__q(semanticObject, getLastNavigableState(), syntaxNodes); - else acceptNodes(getLastNavigableState(), syntaxNodes); - } - } - - /** - * Syntax: - * (',' ID)* - */ - protected void emit_Messagetransfer___CommaKeyword_7_0_IDTerminalRuleCall_7_1__a(EObject semanticObject, ISynNavigable transition, List nodes) { - acceptNodes(transition, nodes); - } - - /** - * Syntax: - * ('(' ')')? - */ - protected void emit_Messagetransfer___LeftParenthesisKeyword_2_0_RightParenthesisKeyword_2_2__q(EObject semanticObject, ISynNavigable transition, List nodes) { - acceptNodes(transition, nodes); - } - -} diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/services/ScribbleTraceDslGrammarAccess.java b/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/services/ScribbleTraceDslGrammarAccess.java deleted file mode 100644 index 9907a0e0b..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/services/ScribbleTraceDslGrammarAccess.java +++ /dev/null @@ -1,519 +0,0 @@ -/* -* generated by Xtext -*/ -package org.scribble.trace.editor.dsl.services; - -import com.google.inject.Singleton; -import com.google.inject.Inject; - -import java.util.List; - -import org.eclipse.xtext.*; -import org.eclipse.xtext.service.GrammarProvider; -import org.eclipse.xtext.service.AbstractElementFinder.*; - -import org.eclipse.xtext.common.services.TerminalsGrammarAccess; - -@Singleton -public class ScribbleTraceDslGrammarAccess extends AbstractGrammarElementFinder { - - - public class TraceElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "Trace"); - private final Group cGroup = (Group)rule.eContents().get(1); - private final Action cTraceAction_0 = (Action)cGroup.eContents().get(0); - private final RuleCall cTracedefnParserRuleCall_1 = (RuleCall)cGroup.eContents().get(1); - private final Assignment cRolesAssignment_2 = (Assignment)cGroup.eContents().get(2); - private final RuleCall cRolesRoledefnParserRuleCall_2_0 = (RuleCall)cRolesAssignment_2.eContents().get(0); - private final Assignment cStepsAssignment_3 = (Assignment)cGroup.eContents().get(3); - private final RuleCall cStepsStepdefnParserRuleCall_3_0 = (RuleCall)cStepsAssignment_3.eContents().get(0); - - //Trace: - // {Trace} Tracedefn roles+=Roledefn* steps+=Stepdefn*; - public ParserRule getRule() { return rule; } - - //{Trace} Tracedefn roles+=Roledefn* steps+=Stepdefn* - public Group getGroup() { return cGroup; } - - //{Trace} - public Action getTraceAction_0() { return cTraceAction_0; } - - //Tracedefn - public RuleCall getTracedefnParserRuleCall_1() { return cTracedefnParserRuleCall_1; } - - //roles+=Roledefn* - public Assignment getRolesAssignment_2() { return cRolesAssignment_2; } - - //Roledefn - public RuleCall getRolesRoledefnParserRuleCall_2_0() { return cRolesRoledefnParserRuleCall_2_0; } - - //steps+=Stepdefn* - public Assignment getStepsAssignment_3() { return cStepsAssignment_3; } - - //Stepdefn - public RuleCall getStepsStepdefnParserRuleCall_3_0() { return cStepsStepdefnParserRuleCall_3_0; } - } - - public class SentenceElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "Sentence"); - private final RuleCall cIDTerminalRuleCall = (RuleCall)rule.eContents().get(1); - - //Sentence: - // ID+; - public ParserRule getRule() { return rule; } - - //ID+ - public RuleCall getIDTerminalRuleCall() { return cIDTerminalRuleCall; } - } - - public class TracedefnElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "Tracedefn"); - private final Group cGroup = (Group)rule.eContents().get(1); - private final Keyword cTraceKeyword_0 = (Keyword)cGroup.eContents().get(0); - private final RuleCall cIDTerminalRuleCall_1 = (RuleCall)cGroup.eContents().get(1); - private final Group cGroup_2 = (Group)cGroup.eContents().get(2); - private final Keyword cByKeyword_2_0 = (Keyword)cGroup_2.eContents().get(0); - private final RuleCall cSentenceParserRuleCall_2_1 = (RuleCall)cGroup_2.eContents().get(1); - private final Group cGroup_2_2 = (Group)cGroup_2.eContents().get(2); - private final Keyword cShowsKeyword_2_2_0 = (Keyword)cGroup_2_2.eContents().get(0); - private final RuleCall cSentenceParserRuleCall_2_2_1 = (RuleCall)cGroup_2_2.eContents().get(1); - private final Keyword cSemicolonKeyword_3 = (Keyword)cGroup.eContents().get(3); - - //Tracedefn: - // "trace" ID ("by" Sentence ("shows" Sentence)?)? ";"; - public ParserRule getRule() { return rule; } - - //"trace" ID ("by" Sentence ("shows" Sentence)?)? ";" - public Group getGroup() { return cGroup; } - - //"trace" - public Keyword getTraceKeyword_0() { return cTraceKeyword_0; } - - //ID - public RuleCall getIDTerminalRuleCall_1() { return cIDTerminalRuleCall_1; } - - //("by" Sentence ("shows" Sentence)?)? - public Group getGroup_2() { return cGroup_2; } - - //"by" - public Keyword getByKeyword_2_0() { return cByKeyword_2_0; } - - //Sentence - public RuleCall getSentenceParserRuleCall_2_1() { return cSentenceParserRuleCall_2_1; } - - //("shows" Sentence)? - public Group getGroup_2_2() { return cGroup_2_2; } - - //"shows" - public Keyword getShowsKeyword_2_2_0() { return cShowsKeyword_2_2_0; } - - //Sentence - public RuleCall getSentenceParserRuleCall_2_2_1() { return cSentenceParserRuleCall_2_2_1; } - - //";" - public Keyword getSemicolonKeyword_3() { return cSemicolonKeyword_3; } - } - - public class ModuleElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "Module"); - private final Group cGroup = (Group)rule.eContents().get(1); - private final RuleCall cIDTerminalRuleCall_0 = (RuleCall)cGroup.eContents().get(0); - private final Group cGroup_1 = (Group)cGroup.eContents().get(1); - private final Keyword cFullStopKeyword_1_0 = (Keyword)cGroup_1.eContents().get(0); - private final RuleCall cIDTerminalRuleCall_1_1 = (RuleCall)cGroup_1.eContents().get(1); - - //Module: - // ID ("." ID)*; - public ParserRule getRule() { return rule; } - - //ID ("." ID)* - public Group getGroup() { return cGroup; } - - //ID - public RuleCall getIDTerminalRuleCall_0() { return cIDTerminalRuleCall_0; } - - //("." ID)* - public Group getGroup_1() { return cGroup_1; } - - //"." - public Keyword getFullStopKeyword_1_0() { return cFullStopKeyword_1_0; } - - //ID - public RuleCall getIDTerminalRuleCall_1_1() { return cIDTerminalRuleCall_1_1; } - } - - public class RoledefnElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "Roledefn"); - private final Group cGroup = (Group)rule.eContents().get(1); - private final Keyword cRoleKeyword_0 = (Keyword)cGroup.eContents().get(0); - private final RuleCall cIDTerminalRuleCall_1 = (RuleCall)cGroup.eContents().get(1); - private final Group cGroup_2 = (Group)cGroup.eContents().get(2); - private final Keyword cSimulatingKeyword_2_0 = (Keyword)cGroup_2.eContents().get(0); - private final RuleCall cModuleParserRuleCall_2_1 = (RuleCall)cGroup_2.eContents().get(1); - private final Keyword cProtocolKeyword_2_2 = (Keyword)cGroup_2.eContents().get(2); - private final RuleCall cIDTerminalRuleCall_2_3 = (RuleCall)cGroup_2.eContents().get(3); - private final Group cGroup_2_4 = (Group)cGroup_2.eContents().get(4); - private final Keyword cAsKeyword_2_4_0 = (Keyword)cGroup_2_4.eContents().get(0); - private final RuleCall cIDTerminalRuleCall_2_4_1 = (RuleCall)cGroup_2_4.eContents().get(1); - private final Keyword cSemicolonKeyword_3 = (Keyword)cGroup.eContents().get(3); - - //Roledefn: - // "role" ID ("simulating" Module "protocol" ID ("as" ID)?)? ";"; - public ParserRule getRule() { return rule; } - - //"role" ID ("simulating" Module "protocol" ID ("as" ID)?)? ";" - public Group getGroup() { return cGroup; } - - //"role" - public Keyword getRoleKeyword_0() { return cRoleKeyword_0; } - - //ID - public RuleCall getIDTerminalRuleCall_1() { return cIDTerminalRuleCall_1; } - - //("simulating" Module "protocol" ID ("as" ID)?)? - public Group getGroup_2() { return cGroup_2; } - - //"simulating" - public Keyword getSimulatingKeyword_2_0() { return cSimulatingKeyword_2_0; } - - //Module - public RuleCall getModuleParserRuleCall_2_1() { return cModuleParserRuleCall_2_1; } - - //"protocol" - public Keyword getProtocolKeyword_2_2() { return cProtocolKeyword_2_2; } - - //ID - public RuleCall getIDTerminalRuleCall_2_3() { return cIDTerminalRuleCall_2_3; } - - //("as" ID)? - public Group getGroup_2_4() { return cGroup_2_4; } - - //"as" - public Keyword getAsKeyword_2_4_0() { return cAsKeyword_2_4_0; } - - //ID - public RuleCall getIDTerminalRuleCall_2_4_1() { return cIDTerminalRuleCall_2_4_1; } - - //";" - public Keyword getSemicolonKeyword_3() { return cSemicolonKeyword_3; } - } - - public class StepdefnElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "Stepdefn"); - private final RuleCall cMessagetransferParserRuleCall = (RuleCall)rule.eContents().get(1); - - //Stepdefn: - // Messagetransfer; - public ParserRule getRule() { return rule; } - - //Messagetransfer - public RuleCall getMessagetransferParserRuleCall() { return cMessagetransferParserRuleCall; } - } - - public class MessagetransferElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "Messagetransfer"); - private final Group cGroup = (Group)rule.eContents().get(1); - private final Action cMessagetransferAction_0 = (Action)cGroup.eContents().get(0); - private final RuleCall cIDTerminalRuleCall_1 = (RuleCall)cGroup.eContents().get(1); - private final Group cGroup_2 = (Group)cGroup.eContents().get(2); - private final Keyword cLeftParenthesisKeyword_2_0 = (Keyword)cGroup_2.eContents().get(0); - private final Group cGroup_2_1 = (Group)cGroup_2.eContents().get(1); - private final Assignment cParametersAssignment_2_1_0 = (Assignment)cGroup_2_1.eContents().get(0); - private final RuleCall cParametersParameterParserRuleCall_2_1_0_0 = (RuleCall)cParametersAssignment_2_1_0.eContents().get(0); - private final Group cGroup_2_1_1 = (Group)cGroup_2_1.eContents().get(1); - private final Keyword cCommaKeyword_2_1_1_0 = (Keyword)cGroup_2_1_1.eContents().get(0); - private final Assignment cParametersAssignment_2_1_1_1 = (Assignment)cGroup_2_1_1.eContents().get(1); - private final RuleCall cParametersParameterParserRuleCall_2_1_1_1_0 = (RuleCall)cParametersAssignment_2_1_1_1.eContents().get(0); - private final Keyword cRightParenthesisKeyword_2_2 = (Keyword)cGroup_2.eContents().get(2); - private final Keyword cFromKeyword_3 = (Keyword)cGroup.eContents().get(3); - private final RuleCall cIDTerminalRuleCall_4 = (RuleCall)cGroup.eContents().get(4); - private final Keyword cToKeyword_5 = (Keyword)cGroup.eContents().get(5); - private final RuleCall cIDTerminalRuleCall_6 = (RuleCall)cGroup.eContents().get(6); - private final Group cGroup_7 = (Group)cGroup.eContents().get(7); - private final Keyword cCommaKeyword_7_0 = (Keyword)cGroup_7.eContents().get(0); - private final RuleCall cIDTerminalRuleCall_7_1 = (RuleCall)cGroup_7.eContents().get(1); - private final Keyword cSemicolonKeyword_8 = (Keyword)cGroup.eContents().get(8); - - //Messagetransfer: - // {Messagetransfer} ID ("(" (parameters+=Parameter ("," parameters+=Parameter)*)? ")")? "from" ID "to" ID ("," ID)* ";"; - public ParserRule getRule() { return rule; } - - //{Messagetransfer} ID ("(" (parameters+=Parameter ("," parameters+=Parameter)*)? ")")? "from" ID "to" ID ("," ID)* ";" - public Group getGroup() { return cGroup; } - - //{Messagetransfer} - public Action getMessagetransferAction_0() { return cMessagetransferAction_0; } - - //ID - public RuleCall getIDTerminalRuleCall_1() { return cIDTerminalRuleCall_1; } - - //("(" (parameters+=Parameter ("," parameters+=Parameter)*)? ")")? - public Group getGroup_2() { return cGroup_2; } - - //"(" - public Keyword getLeftParenthesisKeyword_2_0() { return cLeftParenthesisKeyword_2_0; } - - //(parameters+=Parameter ("," parameters+=Parameter)*)? - public Group getGroup_2_1() { return cGroup_2_1; } - - //parameters+=Parameter - public Assignment getParametersAssignment_2_1_0() { return cParametersAssignment_2_1_0; } - - //Parameter - public RuleCall getParametersParameterParserRuleCall_2_1_0_0() { return cParametersParameterParserRuleCall_2_1_0_0; } - - //("," parameters+=Parameter)* - public Group getGroup_2_1_1() { return cGroup_2_1_1; } - - //"," - public Keyword getCommaKeyword_2_1_1_0() { return cCommaKeyword_2_1_1_0; } - - //parameters+=Parameter - public Assignment getParametersAssignment_2_1_1_1() { return cParametersAssignment_2_1_1_1; } - - //Parameter - public RuleCall getParametersParameterParserRuleCall_2_1_1_1_0() { return cParametersParameterParserRuleCall_2_1_1_1_0; } - - //")" - public Keyword getRightParenthesisKeyword_2_2() { return cRightParenthesisKeyword_2_2; } - - //"from" - public Keyword getFromKeyword_3() { return cFromKeyword_3; } - - //ID - public RuleCall getIDTerminalRuleCall_4() { return cIDTerminalRuleCall_4; } - - //"to" - public Keyword getToKeyword_5() { return cToKeyword_5; } - - //ID - public RuleCall getIDTerminalRuleCall_6() { return cIDTerminalRuleCall_6; } - - //("," ID)* - public Group getGroup_7() { return cGroup_7; } - - //"," - public Keyword getCommaKeyword_7_0() { return cCommaKeyword_7_0; } - - //ID - public RuleCall getIDTerminalRuleCall_7_1() { return cIDTerminalRuleCall_7_1; } - - //";" - public Keyword getSemicolonKeyword_8() { return cSemicolonKeyword_8; } - } - - public class ParameterElements extends AbstractParserRuleElementFinder { - private final ParserRule rule = (ParserRule) GrammarUtil.findRuleForName(getGrammar(), "Parameter"); - private final Group cGroup = (Group)rule.eContents().get(1); - private final Assignment cTypeAssignment_0 = (Assignment)cGroup.eContents().get(0); - private final RuleCall cTypeSTRINGTerminalRuleCall_0_0 = (RuleCall)cTypeAssignment_0.eContents().get(0); - private final Group cGroup_1 = (Group)cGroup.eContents().get(1); - private final Keyword cEqualsSignKeyword_1_0 = (Keyword)cGroup_1.eContents().get(0); - private final Assignment cValueAssignment_1_1 = (Assignment)cGroup_1.eContents().get(1); - private final RuleCall cValueSTRINGTerminalRuleCall_1_1_0 = (RuleCall)cValueAssignment_1_1.eContents().get(0); - - //Parameter: - // type=STRING ("=" value=STRING)?; - public ParserRule getRule() { return rule; } - - //type=STRING ("=" value=STRING)? - public Group getGroup() { return cGroup; } - - //type=STRING - public Assignment getTypeAssignment_0() { return cTypeAssignment_0; } - - //STRING - public RuleCall getTypeSTRINGTerminalRuleCall_0_0() { return cTypeSTRINGTerminalRuleCall_0_0; } - - //("=" value=STRING)? - public Group getGroup_1() { return cGroup_1; } - - //"=" - public Keyword getEqualsSignKeyword_1_0() { return cEqualsSignKeyword_1_0; } - - //value=STRING - public Assignment getValueAssignment_1_1() { return cValueAssignment_1_1; } - - //STRING - public RuleCall getValueSTRINGTerminalRuleCall_1_1_0() { return cValueSTRINGTerminalRuleCall_1_1_0; } - } - - - private final TraceElements pTrace; - private final SentenceElements pSentence; - private final TracedefnElements pTracedefn; - private final ModuleElements pModule; - private final RoledefnElements pRoledefn; - private final StepdefnElements pStepdefn; - private final MessagetransferElements pMessagetransfer; - private final ParameterElements pParameter; - - private final Grammar grammar; - - private final TerminalsGrammarAccess gaTerminals; - - @Inject - public ScribbleTraceDslGrammarAccess(GrammarProvider grammarProvider, - TerminalsGrammarAccess gaTerminals) { - this.grammar = internalFindGrammar(grammarProvider); - this.gaTerminals = gaTerminals; - this.pTrace = new TraceElements(); - this.pSentence = new SentenceElements(); - this.pTracedefn = new TracedefnElements(); - this.pModule = new ModuleElements(); - this.pRoledefn = new RoledefnElements(); - this.pStepdefn = new StepdefnElements(); - this.pMessagetransfer = new MessagetransferElements(); - this.pParameter = new ParameterElements(); - } - - protected Grammar internalFindGrammar(GrammarProvider grammarProvider) { - Grammar grammar = grammarProvider.getGrammar(this); - while (grammar != null) { - if ("org.scribble.trace.editor.dsl.ScribbleTraceDsl".equals(grammar.getName())) { - return grammar; - } - List grammars = grammar.getUsedGrammars(); - if (!grammars.isEmpty()) { - grammar = grammars.iterator().next(); - } else { - return null; - } - } - return grammar; - } - - - public Grammar getGrammar() { - return grammar; - } - - - public TerminalsGrammarAccess getTerminalsGrammarAccess() { - return gaTerminals; - } - - - //Trace: - // {Trace} Tracedefn roles+=Roledefn* steps+=Stepdefn*; - public TraceElements getTraceAccess() { - return pTrace; - } - - public ParserRule getTraceRule() { - return getTraceAccess().getRule(); - } - - //Sentence: - // ID+; - public SentenceElements getSentenceAccess() { - return pSentence; - } - - public ParserRule getSentenceRule() { - return getSentenceAccess().getRule(); - } - - //Tracedefn: - // "trace" ID ("by" Sentence ("shows" Sentence)?)? ";"; - public TracedefnElements getTracedefnAccess() { - return pTracedefn; - } - - public ParserRule getTracedefnRule() { - return getTracedefnAccess().getRule(); - } - - //Module: - // ID ("." ID)*; - public ModuleElements getModuleAccess() { - return pModule; - } - - public ParserRule getModuleRule() { - return getModuleAccess().getRule(); - } - - //Roledefn: - // "role" ID ("simulating" Module "protocol" ID ("as" ID)?)? ";"; - public RoledefnElements getRoledefnAccess() { - return pRoledefn; - } - - public ParserRule getRoledefnRule() { - return getRoledefnAccess().getRule(); - } - - //Stepdefn: - // Messagetransfer; - public StepdefnElements getStepdefnAccess() { - return pStepdefn; - } - - public ParserRule getStepdefnRule() { - return getStepdefnAccess().getRule(); - } - - //Messagetransfer: - // {Messagetransfer} ID ("(" (parameters+=Parameter ("," parameters+=Parameter)*)? ")")? "from" ID "to" ID ("," ID)* ";"; - public MessagetransferElements getMessagetransferAccess() { - return pMessagetransfer; - } - - public ParserRule getMessagetransferRule() { - return getMessagetransferAccess().getRule(); - } - - //Parameter: - // type=STRING ("=" value=STRING)?; - public ParameterElements getParameterAccess() { - return pParameter; - } - - public ParserRule getParameterRule() { - return getParameterAccess().getRule(); - } - - //terminal ID: - // "^"? ("a".."z" | "A".."Z" | "_") ("a".."z" | "A".."Z" | "_" | "0".."9")*; - public TerminalRule getIDRule() { - return gaTerminals.getIDRule(); - } - - //terminal INT returns ecore::EInt: - // "0".."9"+; - public TerminalRule getINTRule() { - return gaTerminals.getINTRule(); - } - - //terminal STRING: - // "\"" ("\\" . / * 'b'|'t'|'n'|'f'|'r'|'u'|'"'|"'"|'\\' * / | !("\\" | "\""))* "\"" | "\'" ("\\" . - // / * 'b'|'t'|'n'|'f'|'r'|'u'|'"'|"'"|'\\' * / | !("\\" | "\'"))* "\'"; - public TerminalRule getSTRINGRule() { - return gaTerminals.getSTRINGRule(); - } - - //terminal ML_COMMENT: - // "/ *"->"* /"; - public TerminalRule getML_COMMENTRule() { - return gaTerminals.getML_COMMENTRule(); - } - - //terminal SL_COMMENT: - // "//" !("\n" | "\r")* ("\r"? "\n")?; - public TerminalRule getSL_COMMENTRule() { - return gaTerminals.getSL_COMMENTRule(); - } - - //terminal WS: - // (" " | "\t" | "\r" | "\n")+; - public TerminalRule getWSRule() { - return gaTerminals.getWSRule(); - } - - //terminal ANY_OTHER: - // .; - public TerminalRule getANY_OTHERRule() { - return gaTerminals.getANY_OTHERRule(); - } -} diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/validation/AbstractScribbleTraceDslValidator.java b/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/validation/AbstractScribbleTraceDslValidator.java deleted file mode 100644 index d8ae0e1ab..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/src-gen/org/scribble/trace/editor/dsl/validation/AbstractScribbleTraceDslValidator.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * generated by Xtext - */ -package org.scribble.trace.editor.dsl.validation; - -import java.util.ArrayList; -import java.util.List; -import org.eclipse.emf.ecore.EPackage; - -public class AbstractScribbleTraceDslValidator extends org.eclipse.xtext.validation.AbstractDeclarativeValidator { - - @Override - protected List getEPackages() { - List result = new ArrayList(); - result.add(org.scribble.trace.editor.dsl.scribbleTraceDsl.ScribbleTraceDslPackage.eINSTANCE); - return result; - } -} diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/src/org/scribble/trace/editor/dsl/GenerateScribbleTraceDsl.mwe2 b/tools/eclipse/plugins/org.scribble.trace.editor/src/org/scribble/trace/editor/dsl/GenerateScribbleTraceDsl.mwe2 deleted file mode 100644 index 335fe5209..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/src/org/scribble/trace/editor/dsl/GenerateScribbleTraceDsl.mwe2 +++ /dev/null @@ -1,133 +0,0 @@ -module org.scribble.trace.editor.dsl.GenerateScribbleTraceDsl - -import org.eclipse.emf.mwe.utils.* -import org.eclipse.xtext.generator.* -import org.eclipse.xtext.ui.generator.* - -var grammarURI = "classpath:/org/scribble/trace/editor/dsl/ScribbleTraceDsl.xtext" -var fileExtensions = "trace" -var projectName = "org.scribble.trace.editor" -var runtimeProject = "../${projectName}" -var generateXtendStub = true -var encoding = "UTF-8" - -Workflow { - bean = StandaloneSetup { - scanClassPath = true - platformUri = "${runtimeProject}/.." - // The following two lines can be removed, if Xbase is not used. - registerGeneratedEPackage = "org.eclipse.xtext.xbase.XbasePackage" - registerGenModelFile = "platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel" - } - - component = DirectoryCleaner { - directory = "${runtimeProject}/src-gen" - } - - component = DirectoryCleaner { - directory = "${runtimeProject}/model/generated" - } - - component = DirectoryCleaner { - directory = "${runtimeProject}.ui/src-gen" - } - - component = DirectoryCleaner { - directory = "${runtimeProject}.tests/src-gen" - } - - component = Generator { - pathRtProject = runtimeProject - pathUiProject = "${runtimeProject}.ui" - pathTestProject = "${runtimeProject}.tests" - projectNameRt = projectName - projectNameUi = "${projectName}.ui" - encoding = encoding - language = auto-inject { - uri = grammarURI - - // Java API to access grammar elements (required by several other fragments) - fragment = grammarAccess.GrammarAccessFragment auto-inject {} - - // generates Java API for the generated EPackages - fragment = ecore.EMFGeneratorFragment auto-inject {} - - // the old serialization component - // fragment = parseTreeConstructor.ParseTreeConstructorFragment auto-inject {} - - // serializer 2.0 - fragment = serializer.SerializerFragment auto-inject { - generateStub = false - } - - // a custom ResourceFactory for use with EMF - fragment = resourceFactory.ResourceFactoryFragment auto-inject {} - - // The antlr parser generator fragment. - fragment = parser.antlr.XtextAntlrGeneratorFragment auto-inject { - // options = { - // backtrack = true - // } - } - - // Xtend-based API for validation - fragment = validation.ValidatorFragment auto-inject { - // composedCheck = "org.eclipse.xtext.validation.ImportUriValidator" - // composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator" - } - - // old scoping and exporting API - // fragment = scoping.ImportURIScopingFragment auto-inject {} - // fragment = exporting.SimpleNamesFragment auto-inject {} - - // scoping and exporting API - fragment = scoping.ImportNamespacesScopingFragment auto-inject {} - fragment = exporting.QualifiedNamesFragment auto-inject {} - fragment = builder.BuilderIntegrationFragment auto-inject {} - - // generator API - fragment = generator.GeneratorFragment auto-inject {} - - // formatter API - fragment = formatting.FormatterFragment auto-inject {} - - // labeling API - fragment = labeling.LabelProviderFragment auto-inject {} - - // outline API - fragment = outline.OutlineTreeProviderFragment auto-inject {} - fragment = outline.QuickOutlineFragment auto-inject {} - - // quickfix API - fragment = quickfix.QuickfixProviderFragment auto-inject {} - - // content assist API - fragment = contentAssist.ContentAssistFragment auto-inject {} - - // generates a more lightweight Antlr parser and lexer tailored for content assist - fragment = parser.antlr.XtextAntlrUiGeneratorFragment auto-inject {} - - // generates junit test support classes into Generator#pathTestProject - fragment = junit.Junit4Fragment auto-inject {} - - // rename refactoring - fragment = refactoring.RefactorElementNameFragment auto-inject {} - - // provides the necessary bindings for java types integration - fragment = types.TypesGeneratorFragment auto-inject {} - - // generates the required bindings only if the grammar inherits from Xbase - fragment = xbase.XbaseGeneratorFragment auto-inject {} - - // generates the required bindings only if the grammar inherits from Xtype - fragment = xbase.XtypeGeneratorFragment auto-inject {} - - // provides a preference page for template proposals - fragment = templates.CodetemplatesGeneratorFragment auto-inject {} - - // provides a compare view - fragment = compare.CompareFragment auto-inject {} - } - } -} - diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/src/org/scribble/trace/editor/dsl/ScribbleTraceDsl.xtext b/tools/eclipse/plugins/org.scribble.trace.editor/src/org/scribble/trace/editor/dsl/ScribbleTraceDsl.xtext deleted file mode 100644 index 6040e990b..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/src/org/scribble/trace/editor/dsl/ScribbleTraceDsl.xtext +++ /dev/null @@ -1,22 +0,0 @@ -grammar org.scribble.trace.editor.dsl.ScribbleTraceDsl with org.eclipse.xtext.common.Terminals - -generate scribbleTraceDsl "http://www.scribble.org/trace/editor/dsl/ScribbleTraceDsl" - - -Trace: {Trace} Tracedefn ( roles+=Roledefn )* ( steps+=Stepdefn )* ; - -Sentence: ID+; - -Tracedefn: 'trace' ID ( 'by' Sentence ( 'shows' Sentence )? )? ';' ; - -Module: ID ( '.' ID )* ; - -Roledefn: 'role' ID ( 'simulating' Module 'protocol' ID ( 'as' ID )? )? ';' ; - -Stepdefn: Messagetransfer ; - -Messagetransfer: {Messagetransfer} ID ( '(' ( parameters+=Parameter ( ',' parameters+=Parameter )* )? ')' )? 'from' ID 'to' ID ( ',' ID )* ';' ; - -Parameter: type=STRING ( '=' value=STRING )? ; - - diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/src/org/scribble/trace/editor/dsl/ScribbleTraceDslRuntimeModule.java b/tools/eclipse/plugins/org.scribble.trace.editor/src/org/scribble/trace/editor/dsl/ScribbleTraceDslRuntimeModule.java deleted file mode 100644 index acbad7147..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/src/org/scribble/trace/editor/dsl/ScribbleTraceDslRuntimeModule.java +++ /dev/null @@ -1,11 +0,0 @@ -/* - * generated by Xtext - */ -package org.scribble.trace.editor.dsl; - -/** - * Use this class to register components to be used at runtime / without the Equinox extension registry. - */ -public class ScribbleTraceDslRuntimeModule extends org.scribble.trace.editor.dsl.AbstractScribbleTraceDslRuntimeModule { - -} diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/src/org/scribble/trace/editor/dsl/ScribbleTraceDslStandaloneSetup.java b/tools/eclipse/plugins/org.scribble.trace.editor/src/org/scribble/trace/editor/dsl/ScribbleTraceDslStandaloneSetup.java deleted file mode 100644 index ad6ad1c50..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/src/org/scribble/trace/editor/dsl/ScribbleTraceDslStandaloneSetup.java +++ /dev/null @@ -1,16 +0,0 @@ -/* -* generated by Xtext -*/ -package org.scribble.trace.editor.dsl; - -/** - * Initialization support for running Xtext languages - * without equinox extension registry - */ -public class ScribbleTraceDslStandaloneSetup extends ScribbleTraceDslStandaloneSetupGenerated{ - - public static void doSetup() { - new ScribbleTraceDslStandaloneSetup().createInjectorAndDoEMFRegistration(); - } -} - diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/src/org/scribble/trace/editor/dsl/formatting/ScribbleTraceDslFormatter.xtend b/tools/eclipse/plugins/org.scribble.trace.editor/src/org/scribble/trace/editor/dsl/formatting/ScribbleTraceDslFormatter.xtend deleted file mode 100644 index c52ef03b7..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/src/org/scribble/trace/editor/dsl/formatting/ScribbleTraceDslFormatter.xtend +++ /dev/null @@ -1,30 +0,0 @@ -/* - * generated by Xtext - */ -package org.scribble.trace.editor.dsl.formatting - -import org.eclipse.xtext.formatting.impl.AbstractDeclarativeFormatter -import org.eclipse.xtext.formatting.impl.FormattingConfig -// import com.google.inject.Inject; -// import org.scribble.trace.editor.dsl.services.ScribbleTraceDslGrammarAccess - -/** - * This class contains custom formatting description. - * - * see : http://www.eclipse.org/Xtext/documentation.html#formatting - * on how and when to use it - * - * Also see {@link org.eclipse.xtext.xtext.XtextFormattingTokenSerializer} as an example - */ -class ScribbleTraceDslFormatter extends AbstractDeclarativeFormatter { - -// @Inject extension ScribbleTraceDslGrammarAccess - - override protected void configureFormatting(FormattingConfig c) { -// It's usually a good idea to activate the following three statements. -// They will add and preserve newlines around comments -// c.setLinewrap(0, 1, 2).before(SL_COMMENTRule) -// c.setLinewrap(0, 1, 2).before(ML_COMMENTRule) -// c.setLinewrap(0, 1, 1).after(ML_COMMENTRule) - } -} diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/src/org/scribble/trace/editor/dsl/generator/ScribbleTraceDslGenerator.xtend b/tools/eclipse/plugins/org.scribble.trace.editor/src/org/scribble/trace/editor/dsl/generator/ScribbleTraceDslGenerator.xtend deleted file mode 100644 index d90a0c565..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/src/org/scribble/trace/editor/dsl/generator/ScribbleTraceDslGenerator.xtend +++ /dev/null @@ -1,24 +0,0 @@ -/* - * generated by Xtext - */ -package org.scribble.trace.editor.dsl.generator - -import org.eclipse.emf.ecore.resource.Resource -import org.eclipse.xtext.generator.IGenerator -import org.eclipse.xtext.generator.IFileSystemAccess - -/** - * Generates code from your model files on save. - * - * see http://www.eclipse.org/Xtext/documentation.html#TutorialCodeGeneration - */ -class ScribbleTraceDslGenerator implements IGenerator { - - override void doGenerate(Resource resource, IFileSystemAccess fsa) { -// fsa.generateFile('greetings.txt', 'People to greet: ' + -// resource.allContents -// .filter(typeof(Greeting)) -// .map[name] -// .join(', ')) - } -} diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/src/org/scribble/trace/editor/dsl/scoping/ScribbleTraceDslScopeProvider.xtend b/tools/eclipse/plugins/org.scribble.trace.editor/src/org/scribble/trace/editor/dsl/scoping/ScribbleTraceDslScopeProvider.xtend deleted file mode 100644 index 5f028c4a1..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/src/org/scribble/trace/editor/dsl/scoping/ScribbleTraceDslScopeProvider.xtend +++ /dev/null @@ -1,15 +0,0 @@ -/* - * generated by Xtext - */ -package org.scribble.trace.editor.dsl.scoping - -/** - * This class contains custom scoping description. - * - * see : http://www.eclipse.org/Xtext/documentation.html#scoping - * on how and when to use it - * - */ -class ScribbleTraceDslScopeProvider extends org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider { - -} diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/src/org/scribble/trace/editor/dsl/validation/ScribbleTraceDslValidator.xtend b/tools/eclipse/plugins/org.scribble.trace.editor/src/org/scribble/trace/editor/dsl/validation/ScribbleTraceDslValidator.xtend deleted file mode 100644 index b6a1ec715..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/src/org/scribble/trace/editor/dsl/validation/ScribbleTraceDslValidator.xtend +++ /dev/null @@ -1,24 +0,0 @@ -/* - * generated by Xtext - */ -package org.scribble.trace.editor.dsl.validation -//import org.eclipse.xtext.validation.Check - -/** - * Custom validation rules. - * - * see http://www.eclipse.org/Xtext/documentation.html#validation - */ -class ScribbleTraceDslValidator extends AbstractScribbleTraceDslValidator { - -// public static val INVALID_NAME = 'invalidName' -// -// @Check -// def checkGreetingStartsWithCapital(Greeting greeting) { -// if (!Character.isUpperCase(greeting.name.charAt(0))) { -// warning('Name should start with a capital', -// MyDslPackage.Literals.GREETING__NAME, -// INVALID_NAME) -// } -// } -} diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/xtend-gen/org/scribble/trace/editor/dsl/formatting/.ScribbleTraceDslFormatter.java._trace b/tools/eclipse/plugins/org.scribble.trace.editor/xtend-gen/org/scribble/trace/editor/dsl/formatting/.ScribbleTraceDslFormatter.java._trace deleted file mode 100644 index a02722d7d..000000000 Binary files a/tools/eclipse/plugins/org.scribble.trace.editor/xtend-gen/org/scribble/trace/editor/dsl/formatting/.ScribbleTraceDslFormatter.java._trace and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/xtend-gen/org/scribble/trace/editor/dsl/formatting/ScribbleTraceDslFormatter.java b/tools/eclipse/plugins/org.scribble.trace.editor/xtend-gen/org/scribble/trace/editor/dsl/formatting/ScribbleTraceDslFormatter.java deleted file mode 100644 index 4067c6d37..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/xtend-gen/org/scribble/trace/editor/dsl/formatting/ScribbleTraceDslFormatter.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * generated by Xtext - */ -package org.scribble.trace.editor.dsl.formatting; - -import org.eclipse.xtext.formatting.impl.AbstractDeclarativeFormatter; -import org.eclipse.xtext.formatting.impl.FormattingConfig; - -/** - * This class contains custom formatting description. - * - * see : http://www.eclipse.org/Xtext/documentation.html#formatting - * on how and when to use it - * - * Also see {@link org.eclipse.xtext.xtext.XtextFormattingTokenSerializer} as an example - */ -@SuppressWarnings("all") -public class ScribbleTraceDslFormatter extends AbstractDeclarativeFormatter { - protected void configureFormatting(final FormattingConfig c) { - } -} diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/xtend-gen/org/scribble/trace/editor/dsl/generator/.ScribbleTraceDslGenerator.java._trace b/tools/eclipse/plugins/org.scribble.trace.editor/xtend-gen/org/scribble/trace/editor/dsl/generator/.ScribbleTraceDslGenerator.java._trace deleted file mode 100644 index 0052e385f..000000000 Binary files a/tools/eclipse/plugins/org.scribble.trace.editor/xtend-gen/org/scribble/trace/editor/dsl/generator/.ScribbleTraceDslGenerator.java._trace and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/xtend-gen/org/scribble/trace/editor/dsl/generator/ScribbleTraceDslGenerator.java b/tools/eclipse/plugins/org.scribble.trace.editor/xtend-gen/org/scribble/trace/editor/dsl/generator/ScribbleTraceDslGenerator.java deleted file mode 100644 index d8b1eb98d..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/xtend-gen/org/scribble/trace/editor/dsl/generator/ScribbleTraceDslGenerator.java +++ /dev/null @@ -1,19 +0,0 @@ -/** - * generated by Xtext - */ -package org.scribble.trace.editor.dsl.generator; - -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.xtext.generator.IFileSystemAccess; -import org.eclipse.xtext.generator.IGenerator; - -/** - * Generates code from your model files on save. - * - * see http://www.eclipse.org/Xtext/documentation.html#TutorialCodeGeneration - */ -@SuppressWarnings("all") -public class ScribbleTraceDslGenerator implements IGenerator { - public void doGenerate(final Resource resource, final IFileSystemAccess fsa) { - } -} diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/xtend-gen/org/scribble/trace/editor/dsl/scoping/.ScribbleTraceDslScopeProvider.java._trace b/tools/eclipse/plugins/org.scribble.trace.editor/xtend-gen/org/scribble/trace/editor/dsl/scoping/.ScribbleTraceDslScopeProvider.java._trace deleted file mode 100644 index 1b16892ff..000000000 Binary files a/tools/eclipse/plugins/org.scribble.trace.editor/xtend-gen/org/scribble/trace/editor/dsl/scoping/.ScribbleTraceDslScopeProvider.java._trace and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/xtend-gen/org/scribble/trace/editor/dsl/scoping/ScribbleTraceDslScopeProvider.java b/tools/eclipse/plugins/org.scribble.trace.editor/xtend-gen/org/scribble/trace/editor/dsl/scoping/ScribbleTraceDslScopeProvider.java deleted file mode 100644 index 0f05b7daf..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/xtend-gen/org/scribble/trace/editor/dsl/scoping/ScribbleTraceDslScopeProvider.java +++ /dev/null @@ -1,16 +0,0 @@ -/** - * generated by Xtext - */ -package org.scribble.trace.editor.dsl.scoping; - -import org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider; - -/** - * This class contains custom scoping description. - * - * see : http://www.eclipse.org/Xtext/documentation.html#scoping - * on how and when to use it - */ -@SuppressWarnings("all") -public class ScribbleTraceDslScopeProvider extends AbstractDeclarativeScopeProvider { -} diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/xtend-gen/org/scribble/trace/editor/dsl/validation/.ScribbleTraceDslValidator.java._trace b/tools/eclipse/plugins/org.scribble.trace.editor/xtend-gen/org/scribble/trace/editor/dsl/validation/.ScribbleTraceDslValidator.java._trace deleted file mode 100644 index 899be390c..000000000 Binary files a/tools/eclipse/plugins/org.scribble.trace.editor/xtend-gen/org/scribble/trace/editor/dsl/validation/.ScribbleTraceDslValidator.java._trace and /dev/null differ diff --git a/tools/eclipse/plugins/org.scribble.trace.editor/xtend-gen/org/scribble/trace/editor/dsl/validation/ScribbleTraceDslValidator.java b/tools/eclipse/plugins/org.scribble.trace.editor/xtend-gen/org/scribble/trace/editor/dsl/validation/ScribbleTraceDslValidator.java deleted file mode 100644 index 06b8d53c7..000000000 --- a/tools/eclipse/plugins/org.scribble.trace.editor/xtend-gen/org/scribble/trace/editor/dsl/validation/ScribbleTraceDslValidator.java +++ /dev/null @@ -1,15 +0,0 @@ -/** - * generated by Xtext - */ -package org.scribble.trace.editor.dsl.validation; - -import org.scribble.trace.editor.dsl.validation.AbstractScribbleTraceDslValidator; - -/** - * Custom validation rules. - * - * see http://www.eclipse.org/Xtext/documentation.html#validation - */ -@SuppressWarnings("all") -public class ScribbleTraceDslValidator extends AbstractScribbleTraceDslValidator { -} diff --git a/tools/eclipse/plugins/pom.xml b/tools/eclipse/plugins/pom.xml deleted file mode 100644 index c1a1b7eff..000000000 --- a/tools/eclipse/plugins/pom.xml +++ /dev/null @@ -1,27 +0,0 @@ - - 4.0.0 - org.scribble.tools.eclipse - plugins - pom - 0.3.2-SNAPSHOT - Scribble::Tools::Eclipse::Plugins - - - org.scribble.tools - eclipse - 0.3.2-SNAPSHOT - - - - org.scribble.editor - org.scribble.editor.tools - org.scribble.editor.trace - org.scribble.editor.ui - org.scribble.trace.editor - org.scribble.trace.editor.ui - - - - diff --git a/tools/eclipse/pom.xml b/tools/eclipse/pom.xml deleted file mode 100644 index e07df767e..000000000 --- a/tools/eclipse/pom.xml +++ /dev/null @@ -1,174 +0,0 @@ - - 4.0.0 - org.scribble.tools - eclipse - 0.3.2-SNAPSHOT - pom - Scribble::Tools::Eclipse - - - org.scribble - tools - 0.3.2-SNAPSHOT - - - - 0.18.1 - - - - plugins - features - tests - site - - - - - osx - - - java.vendor.url - http://www.apple.com/ - - - - - -d32 -Dosgi.arch=x86 -XstartOnFirstThread - - - - - hudson - - - BUILD_NUMBER - - - - - - org.eclipse.tycho - tycho-packaging-plugin - ${tycho-version} - - 'v'yyyyMMdd-HHmm'-H${BUILD_NUMBER}-${BUILD_ALIAS}' - true - - - - - - - - - src - - - org.eclipse.tycho - tycho-maven-plugin - ${tycho-version} - true - - - - org.eclipse.tycho - target-platform-configuration - ${tycho-version} - - p2 - true - consider - - - linux - gtk - x86 - - - linux - gtk - x86_64 - - - win32 - win32 - x86 - - - macosx - cocoa - x86 - - - - - - - org.eclipse.tycho - tycho-packaging-plugin - ${tycho-version} - - 'v'yyyyMMdd-HHmm'-LOCAL' - true - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - 2.6 - - checkstyle/checkstyle.xml - false - checkstyle/suppressions.xml - false - - - - - org.scribble - scribble-build - ${project.version} - - - - - check-style - site - - checkstyle - - - - - - - - - - luna - p2 - http://download.eclipse.org/releases/luna - - - - - - jboss-public-repository-group - JBoss Public Maven Repository Group - https://repository.jboss.org/nexus/content/groups/public/ - default - - never - - - never - - - - - - diff --git a/tools/eclipse/site/pom.xml b/tools/eclipse/site/pom.xml deleted file mode 100644 index 05c3bc891..000000000 --- a/tools/eclipse/site/pom.xml +++ /dev/null @@ -1,17 +0,0 @@ - - 4.0.0 - org.scribble.tools.eclipse - scribble-update-site - 0.3.2-SNAPSHOT - eclipse-update-site - Scribble::Tools::Eclipse::Site - - - org.scribble.tools - eclipse - 0.3.2-SNAPSHOT - - - - diff --git a/tools/eclipse/site/site.xml b/tools/eclipse/site/site.xml deleted file mode 100644 index de62a119d..000000000 --- a/tools/eclipse/site/site.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - This is the update site for the Scribble tools. - - - - - - - Scribble description - - - diff --git a/tools/eclipse/tests/pom.xml b/tools/eclipse/tests/pom.xml deleted file mode 100644 index a421d0dad..000000000 --- a/tools/eclipse/tests/pom.xml +++ /dev/null @@ -1,23 +0,0 @@ - - 4.0.0 - org.scribble.tools.eclipse - tests - pom - 0.3.2-SNAPSHOT - Scribble::Tools::Eclipse::Tests - - - org.scribble.tools - eclipse - 0.3.2-SNAPSHOT - - - - - - diff --git a/tools/pom.xml b/tools/pom.xml deleted file mode 100644 index 9b1305de3..000000000 --- a/tools/pom.xml +++ /dev/null @@ -1,33 +0,0 @@ - - 4.0.0 - tools - pom - 0.3.2-SNAPSHOT - Scribble::Tools - - - org.scribble - parent - 0.3.2-SNAPSHOT - - - - cli - eclipse - - - - - - org.apache.maven.plugins - maven-deploy-plugin - - true - - - - - - diff --git a/travis/publish.sh b/travis/publish.sh new file mode 100755 index 000000000..c4f841d1f --- /dev/null +++ b/travis/publish.sh @@ -0,0 +1,117 @@ +set -euo pipefail +set -x + +build_started_by_tag() { + if [ "${TRAVIS_TAG}" == "" ]; then + echo "[Publishing] This build was not started by a tag, publishing snapshot" + return 1 + else + echo "[Publishing] This build was started by the tag ${TRAVIS_TAG}, publishing release" + return 0 + fi +} + +is_pull_request() { + if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then + echo "[Not Publishing] This is a Pull Request" + return 0 + else + echo "[Publishing] This is not a Pull Request" + return 1 + fi +} + +is_travis_branch_master() { + if [ "${TRAVIS_BRANCH}" = master ]; then + echo "[Publishing] Travis branch is master" + return 0 + else + echo "[Not Publishing] Travis branch is not master" + return 1 + fi +} + +check_travis_branch_equals_travis_tag() { + #Weird comparison comparing branch to tag because when you 'git push --tags' + #the branch somehow becomes the tag value + #github issue: https://github.com/travis-ci/travis-ci/issues/1675 + if [ "${TRAVIS_BRANCH}" != "${TRAVIS_TAG}" ]; then + echo "Travis branch does not equal Travis tag, which it should, bailing out." + echo " github issue: https://github.com/travis-ci/travis-ci/issues/1675" + exit 1 + else + echo "[Publishing] Branch (${TRAVIS_BRANCH}) same as Tag (${TRAVIS_TAG})" + fi +} + +check_release_tag() { + tag="${TRAVIS_TAG}" + if [[ "$tag" =~ ^[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+$ ]]; then + echo "Build started by version tag $tag. During the release process tags like this" + echo "are created by the 'release' Maven plugin. Nothing to do here." + exit 0 + elif [[ ! "$tag" =~ ^release-[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+$ ]]; then + echo "You must specify a tag of the format 'release-0.0.0' to release this project." + echo "The provided tag ${tag} doesn't match that. Aborting." + exit 1 + fi +} + +is_release_commit() { + project_version=$(./mvnw help:evaluate -N -Dexpression=project.version | grep -v '\[') + if [[ "$project_version" =~ ^[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+$ ]]; then + echo "Build started by release commit $project_version. Will synchronize to maven central." + return 0 + else + return 1 + fi +} + +release_version() { + echo "${TRAVIS_TAG}" | sed 's/^release-//' +} + +safe_checkout_master() { + # We need to be on a branch for release:perform to be able to create commits, and we want that branch to be master. + # But we also want to make sure that we build and release exactly the tagged version, so we verify that the remote + # master is where our tag is. + git checkout -B master + git fetch origin master:origin/master + commit_local_master="$(git show --pretty='format:%H' master)" + commit_remote_master="$(git show --pretty='format:%H' origin/master)" + if [ "$commit_local_master" != "$commit_remote_master" ]; then + echo "Master on remote 'origin' has commits since the version under release, aborting" + exit 1 + fi +} + +#---------------------- +# MAIN +#---------------------- + +if ! is_pull_request && build_started_by_tag; then + check_travis_branch_equals_travis_tag + check_release_tag +fi + +./mvnw --batch-mode install -nsu + +# If we are on a pull request, our only job is to run tests, which happened above via ./mvnw install +if is_pull_request; then + true +# If we are on master, we will deploy the latest snapshot or release version +# - If a release commit fails to deploy for a transient reason, delete the broken version from bintray and click rebuild +elif is_travis_branch_master; then + #./mvnw --batch-mode -s ./.settings.xml -Prelease -nsu -DskipTests deploy + # + ## If the deployment succeeded, sync it to Maven Central. Note: this needs to be done once per project, not module, hence -N + #if is_release_commit; then + # ./mvnw --batch-mode -s ./.settings.xml -nsu -N io.zipkin.centralsync-maven-plugin:centralsync-maven-plugin:sync + #fi + true + +# If we are on a release tag, the following will update any version references and push a version tag for deployment. +elif build_started_by_tag; then + safe_checkout_master + ./mvnw --batch-mode -s ./.settings.xml -Prelease -nsu -DreleaseVersion="$(release_version)" -Darguments="-DskipTests" release:prepare +fi